|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface ContainerI
Container interface. Components can be registered & retrieved from a Container, which manages instances lookup & lifecycle
DefaultContainer
Field Summary |
---|
Fields inherited from interface net.mchaplin.ioc.component.ComponentI |
---|
CMP_I |
Method Summary | |
---|---|
void |
addSon(ContainerI container)
|
ContainerI |
getContainer()
Provide component dependencies lookup facility |
java.lang.String |
getInstanceName()
|
ContainerI |
getParent()
|
java.util.Map<java.lang.String,java.util.List<ComponentI>> |
getRegisteredTypes()
|
ContainerI[] |
getSons()
|
java.lang.String |
getState()
Return the current state of a Container instance, as formatted text. |
java.lang.String |
lookupComponent(java.lang.Class classType)
Lookup for to see if a given component is currently registered in this Container, its parent or sons. |
java.lang.String |
lookupComponent(java.lang.Class classType,
int where)
Lookup for to see if a given component is currently registered. |
void |
makeComponentAvailable()
Gives back a Component when you stop using it. |
void |
registerComponentImplementation(java.lang.Class component)
Register a Component into the Container |
void |
registerComponentImplementation(java.lang.Class component,
java.lang.Class factory)
Custom component registration. |
void |
registerComponentImplementation(java.lang.Class component,
java.lang.Class factory,
java.lang.String type)
Custom component registration. |
void |
registerComponentImplementation(java.lang.Class component,
java.lang.String type)
Component registration. |
void |
registerComponentInstance(ComponentI instance)
|
void |
registerComponentInstance(ComponentI instance,
java.lang.String key)
|
void |
registerFactoryImplementation(java.lang.Class factory)
Register a Factory for later use. |
void |
reset()
Provide facility for runtime component redeployment |
ComponentI |
retrieveComponentInstance(java.lang.Class classType)
Retrieve the first instance in List of given type. |
ComponentI |
retrieveComponentInstance(java.lang.String key)
Retrieve the first instance in List of given type. |
ComponentI |
retrieveComponentInstance(java.lang.String key,
java.lang.String location)
Retrieve the first instance in List of given type. |
void |
retrieveComponentInstances()
Retrieve a list of all registered components |
java.util.List |
retrieveComponentInstances(java.lang.String key)
Retrieve a list of registered components for the given key |
ComponentFactoryI |
retrieveFactoryInstance(java.lang.Class classType)
Retrieve the first instance in List of given type. |
ComponentFactoryI |
retrieveFactoryInstance(java.lang.String key)
Retrieve the first instance in List of given type. |
void |
setInstanceName(java.lang.String instanceName)
|
void |
setParent(ContainerI aParent)
|
void |
unregisterComponentInstance(ComponentI instance)
|
Methods inherited from interface net.mchaplin.ioc.component.ComponentI |
---|
setContainer |
Method Detail |
---|
void registerComponentImplementation(java.lang.Class component)
component
- the component to registervoid registerFactoryImplementation(java.lang.Class factory)
factory
- the factory to registervoid registerComponentImplementation(java.lang.Class component, java.lang.String type)
component
- the component Class to registersimple
- if true, will try a newInstance() call only. Otherwise, will
introspect potential constructors for already known components
& try to instanciate through reflectiontype
- optional, the type to register this instance as. If set, the
Component will be registered under its fully qualified class
namevoid registerComponentImplementation(java.lang.Class component, java.lang.Class factory) throws ContainerException
component
- the component to registerfactory
- the factory to register
ContainerException
registerComponentImplementation(java.lang.Class,
java.lang.Class)
void registerComponentImplementation(java.lang.Class component, java.lang.Class factory, java.lang.String type) throws ContainerException
component
- the component to registerfactory
- the factory to registertype
- the type to register this instance as. If set, the
Component will be registered under its fully qualified class
name
ContainerException
registerComponentImplementation(java.lang.Class,
java.lang.Class)
void registerComponentInstance(ComponentI instance)
void registerComponentInstance(ComponentI instance, java.lang.String key)
java.lang.String lookupComponent(java.lang.Class classType)
classType
- the Class type to lookup for.
java.lang.String lookupComponent(java.lang.Class classType, int where)
classType
- the Class type to lookup for.where
- where to lookup the component : here, parent or sons
ComponentI retrieveComponentInstance(java.lang.Class classType)
classType
- the Class type to retrieve an instance of.
ComponentI retrieveComponentInstance(java.lang.String key)
key
- the component type to retrieve an instance of
ComponentI retrieveComponentInstance(java.lang.String key, java.lang.String location)
key
- the component type to retrieve an instance oflocation
- the location of the container where the component
should be retrieved from.
ComponentFactoryI retrieveFactoryInstance(java.lang.Class classType)
classType
- the Class type to retrieve an instance of.
ComponentFactoryI retrieveFactoryInstance(java.lang.String key)
key
- the key to retrieve associated Factory instance.
java.util.List retrieveComponentInstances(java.lang.String key)
void retrieveComponentInstances()
void makeComponentAvailable()
void unregisterComponentInstance(ComponentI instance)
java.lang.String getState()
void setParent(ContainerI aParent)
setParent(net.mchaplin.ioc.ContainerI)
java.lang.String getInstanceName()
void setInstanceName(java.lang.String instanceName)
instanceName
- The instanceName to set.ContainerI getParent()
getParent()
java.util.Map<java.lang.String,java.util.List<ComponentI>> getRegisteredTypes()
ContainerI[] getSons()
void addSon(ContainerI container)
ContainerI getContainer()
ComponentI
getContainer
in interface ComponentI
net.mchaplin.ioc.ComponentI#getContainer()
void reset()
ComponentI
reset
in interface ComponentI
net.mchaplin.ioc.ComponentI#reset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |