/* JFox, the OpenSource J2EE Application Server
 *
 * Distributable under GNU LGPL license by gun.org
 * more details please visit http://www.huihoo.org/jfox
 */
package org.jfox.framework;

/**
 * @author <a href="mailto:young_yy@hotmail.com">Young Yang</a>
 */

public class InstanceComponentFactory implements ComponentFactory {
    private Component instance;
    private ComponentName compName;
    private Registry registry = null;

    public InstanceComponentFactory(Component instance) {
        this.instance = instance;
        compName = ComponentName.newInstance(instance.getClass());
    }

    public Component makeComponent() {
        return instance;
    }

    public Class getImplementation() {
        return instance.getClass();
    }

    public ComponentName getComponentName() {
        return compName;
    }

    public Parameter[] getParameters() {
        return null;
    }

    public Registry getRegistry() {
        return registry;
    }

    public void setRegistry(Registry registry) {
        this.registry = registry;
    }

    public static void main(String[] args) {

    }
}

