package org.seasar.framework.container;



/**
 * @author higa
 *
 */
public interface S2Container {

	public String NAME = "container";

	public Object getComponent(Object componentKey)
		throws
			ComponentNotFoundRuntimeException,
			TooManyRegistrationRuntimeException,
			CyclicReferenceRuntimeException;

	public void injectDependency(Object outerComponent)
		throws ClassUnmatchRuntimeException;

	public void injectDependency(Object outerComponent, Class componentClass)
		throws ClassUnmatchRuntimeException;

	public void injectDependency(Object outerComponent, String componentName)
		throws ClassUnmatchRuntimeException;

	public void register(Object component);
	
	public void register(Object component, String componentName);

	public void register(Class componentClass);

	public void register(Class componentClass, String componentName);

	public void register(ComponentDef componentDef);

	public int getComponentDefSize();

	public ComponentDef getComponentDef(int index);

	public ComponentDef getComponentDef(Object componentKey)
		throws ComponentNotFoundRuntimeException;

	public boolean hasComponentDef(Object componentKey);
	
	public boolean hasDescendant(String path);
	
	public S2Container getDescendant(String path)
		throws ContainerNotRegisteredRuntimeException;
	
	public void registerDescendant(S2Container descendant);

	public void include(S2Container child);
	
	public int getChildSize();
	
	public S2Container getChild(int index);

	public void init();

	public void destroy();
	
	public String getNamespace();
	
	public void setNamespace(String namespace);
	
	public String getPath();
	
	public void setPath(String path);

	public S2Container getRoot();
	
	public void setRoot(S2Container root);
}
