com.jdon.container
Interface ContainerWrapper

All Known Implementing Classes:
PicoContainerWrapper

public interface ContainerWrapper

ContainerWrapper is main interface of jdonframework


Method Summary
 java.util.List getAllInstances()
          return all instances
 ContainerWrapper getChild(java.lang.String name)
          get the child container
 java.lang.Class getComponentClass(java.lang.String name)
          return a component class from container
 java.lang.Object getComponentNewInstance(java.lang.String name)
          when access this method, will return a new component instance it is difference with lookup method
 java.lang.Object lookup(java.lang.String name)
          get a component instance from container
 void register(java.lang.String name)
          register a component, its class value is its name value
 void register(java.lang.String name, java.lang.Class className)
          register a component class
 void register(java.lang.String name, java.lang.Class className, java.lang.String[] constructors)
          register a component class with construtors of String type
 void register(java.lang.String name, java.lang.Object instance)
          register a component instance
 void registerChild(java.lang.String name)
          register a child container
 void start()
          start the container this method will active all components's startup methods in container,
 void stop()
          stop the container this method will active all components's stop methods in container.
 

Method Detail

register

void register(java.lang.String name,
              java.lang.Class className)
register a component class

Parameters:
name - component name
className - component class

register

void register(java.lang.String name,
              java.lang.Class className,
              java.lang.String[] constructors)
register a component class with construtors of String type

Parameters:
name - component name
className - component class
constructors - component construtor parameters

register

void register(java.lang.String name,
              java.lang.Object instance)
register a component instance

Parameters:
name - component name
instance - component instance

register

void register(java.lang.String name)
register a component, its class value is its name value

Parameters:
name - the name must be a class string

start

void start()
start the container this method will active all components's startup methods in container,


stop

void stop()
stop the container this method will active all components's stop methods in container.


getAllInstances

java.util.List getAllInstances()
return all instances

Returns:
all instances collection in container

lookup

java.lang.Object lookup(java.lang.String name)
get a component instance from container

Parameters:
name - component name
Returns:
component single instance

getComponentNewInstance

java.lang.Object getComponentNewInstance(java.lang.String name)
when access this method, will return a new component instance it is difference with lookup method

Parameters:
name -
Returns:
a new component instance

getComponentClass

java.lang.Class getComponentClass(java.lang.String name)
return a component class from container

Parameters:
name -
Returns:
component Class

registerChild

void registerChild(java.lang.String name)
register a child container

Parameters:
name -

getChild

ContainerWrapper getChild(java.lang.String name)
get the child container

Parameters:
name -
Returns:
container