|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.picocontainer.defaults.DefaultPicoContainer
Abstract baseclass for various PicoContainer implementations.
Nested Class Summary | |
static class |
DefaultPicoContainer.Default
|
static class |
DefaultPicoContainer.WithComponentFactory
|
static class |
DefaultPicoContainer.WithComponentRegistry
|
Field Summary | |
protected List |
unmanagedComponents
|
Constructor Summary | |
DefaultPicoContainer(ComponentFactory componentFactory,
ComponentRegistry componentRegistry)
|
Method Summary | |
void |
addParameterToComponent(Object componentKey,
Class parameter,
Object arg)
Add a parameter to a component. |
Object |
getComponent(Object componentKey)
Get a component for a component type. |
Collection |
getComponentKeys()
Get all component types (random order). |
Object |
getComponentMulticaster()
Shorthand for getComponentMulticaster(boolean, boolean) (true, true). |
Object |
getComponentMulticaster(boolean callInInstantiationOrder,
boolean callUnmanagedComponents)
Returns a proxy that implements the union of all the components' interfaces. |
Collection |
getComponents()
Get all components (random order). |
boolean |
hasComponent(Object componentKey)
Does the internals have a partilcilar component type? |
void |
instantiateComponents()
Initialize the internals. |
void |
registerComponent(Object componentKey,
Class componentImplementation)
Alternate way of registering components with additional component type. |
void |
registerComponent(Object componentKey,
Class componentImplementation,
Parameter[] parameters)
Register component with key, implementation and bindings for its parameters. |
void |
registerComponent(Object componentKey,
Object component)
Registers a component that is instantiated and configured outside the internals. |
void |
registerComponentByClass(Class componentImplementation)
Registers a component. |
void |
registerComponentByInstance(Object component)
Registers an instantiated component. |
void |
unregisterComponent(Object componentKey)
TODO promote to RegistrationPicoContainer, it's all Pauls fault anyway |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected List unmanagedComponents
Constructor Detail |
public DefaultPicoContainer(ComponentFactory componentFactory, ComponentRegistry componentRegistry)
Method Detail |
public final Object getComponentMulticaster()
PicoContainer
PicoContainer.getComponentMulticaster(boolean, boolean)
(true, true).
getComponentMulticaster
in interface PicoContainer
public final Object getComponentMulticaster(boolean callInInstantiationOrder, boolean callUnmanagedComponents)
PicoContainer
getComponentMulticaster
in interface PicoContainer
callInInstantiationOrder
- whether to call the methods in the order of instantiation (true) or reverse (false)callUnmanagedComponents
- whether to exclude components registered via instance rather than classpublic void registerComponent(Object componentKey, Class componentImplementation) throws DuplicateComponentKeyRegistrationException, AssignabilityRegistrationException, NotConcreteRegistrationException, PicoIntrospectionException
RegistrationPicoContainer
registerComponent
in interface RegistrationPicoContainer
componentKey
- Component typecomponentImplementation
- The class of the component to instantiate
DuplicateComponentKeyRegistrationException
AssignabilityRegistrationException
NotConcreteRegistrationException
PicoIntrospectionException
public void registerComponent(Object componentKey, Class componentImplementation, Parameter[] parameters) throws NotConcreteRegistrationException, AssignabilityRegistrationException, DuplicateComponentKeyRegistrationException
RegistrationPicoContainer
registerComponent
in interface RegistrationPicoContainer
componentKey
- Component typecomponentImplementation
- The class of the component to instantiate
NotConcreteRegistrationException
AssignabilityRegistrationException
DuplicateComponentKeyRegistrationException
public void registerComponentByInstance(Object component) throws PicoRegistrationException, PicoIntrospectionException
RegistrationPicoContainer
registerComponentByInstance
in interface RegistrationPicoContainer
component
- The pre instantiated component to register
PicoRegistrationException
PicoIntrospectionException
public void registerComponent(Object componentKey, Object component) throws PicoRegistrationException, PicoIntrospectionException
RegistrationPicoContainer
registerComponent
in interface RegistrationPicoContainer
componentKey
- Component typecomponent
- preinstantiated component
PicoRegistrationException
- If a registration problem
PicoIntrospectionException
public void addParameterToComponent(Object componentKey, Class parameter, Object arg) throws PicoIntrospectionException
RegistrationPicoContainer
addParameterToComponent
in interface RegistrationPicoContainer
componentKey
- The component typeparameter
- The parameter it pertains toarg
- The argukemt to pass in.
PicoIntrospectionException
public void registerComponentByClass(Class componentImplementation) throws DuplicateComponentKeyRegistrationException, AssignabilityRegistrationException, NotConcreteRegistrationException, PicoIntrospectionException
RegistrationPicoContainer
RegistrationPicoContainer.registerComponent(Object, Class)
with the componentImplementation as key.
registerComponentByClass
in interface RegistrationPicoContainer
componentImplementation
- The class of the component to instantiate
DuplicateComponentKeyRegistrationException
AssignabilityRegistrationException
NotConcreteRegistrationException
PicoIntrospectionException
public void unregisterComponent(Object componentKey)
componentKey
- public void instantiateComponents() throws PicoInitializationException, PicoInvocationTargetInitializationException
PicoContainer
instantiateComponents
in interface PicoContainer
PicoInitializationException
PicoInvocationTargetInitializationException
public Object getComponent(Object componentKey)
PicoContainer
getComponent
in interface PicoContainer
componentKey
- The component type to look for.
public Collection getComponents()
PicoContainer
getComponents
in interface PicoContainer
public Collection getComponentKeys()
PicoContainer
getComponentKeys
in interface PicoContainer
public final boolean hasComponent(Object componentKey)
PicoContainer
hasComponent
in interface PicoContainer
componentKey
- The component type to look for.
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |