package org.seasar.framework.container.deployer;

import org.seasar.framework.container.ComponentDef;
import org.seasar.framework.container.util.InstanceModeUtil;

/**
 * @author higa
 *
 */
public final class ComponentDeployerFactory {

	private ComponentDeployerFactory() {
	}

	public static ComponentDeployer create(ComponentDef componentDef) {
		if (InstanceModeUtil.isSingleton(componentDef.getInstanceMode())) {
			return new SingletonComponentDeployer(componentDef);
		} else if (InstanceModeUtil.isPrototype(componentDef.getInstanceMode())) {
			return new PrototypeComponentDeployer(componentDef);
		} else {
			return new OuterComponentDeployer(componentDef);
		}
	}
}
