org.picocontainer
Interface RegistrationPicoContainer

All Superinterfaces:
PicoContainer
All Known Implementing Classes:
DefaultPicoContainer

public interface RegistrationPicoContainer
extends PicoContainer


Method Summary
 void addParameterToComponent(Object componentKey, Class parameter, Object arg)
          Add a parameter to a component.
 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 componentInstance)
          Registers a component that is instantiated and configured outside the internals.
 void registerComponentByClass(Class componentImplementation)
          Registers a component.
 void registerComponentByInstance(Object componentInstance)
          Registers an instantiated component.
 
Methods inherited from interface org.picocontainer.PicoContainer
getComponent, getComponentKeys, getComponentMulticaster, getComponentMulticaster, getComponents, hasComponent, instantiateComponents
 

Method Detail

registerComponentByClass

public void registerComponentByClass(Class componentImplementation)
                              throws PicoRegistrationException,
                                     PicoIntrospectionException
Registers a component. Same as calling registerComponent(Object, Class) with the componentImplementation as key.

Parameters:
componentImplementation - The class of the component to instantiate
Throws:
PicoRegistrationException - If a registration problem
PicoIntrospectionException

registerComponent

public void registerComponent(Object componentKey,
                              Class componentImplementation)
                       throws PicoRegistrationException,
                              PicoIntrospectionException
Alternate way of registering components with additional component type.

Parameters:
componentKey - Component type
componentImplementation - The class of the component to instantiate
Throws:
PicoRegistrationException - If a registration problem
PicoIntrospectionException

registerComponent

public void registerComponent(Object componentKey,
                              Object componentInstance)
                       throws PicoRegistrationException,
                              PicoIntrospectionException
Registers a component that is instantiated and configured outside the internals. Useful in cases where pico doesn't have sufficient knowledge to instantiate a component.

Parameters:
componentKey - Component type
componentInstance - preinstantiated component
Throws:
PicoRegistrationException - If a registration problem
PicoIntrospectionException

registerComponentByInstance

public void registerComponentByInstance(Object componentInstance)
                                 throws PicoRegistrationException,
                                        PicoIntrospectionException
Registers an instantiated component. This might be because you are creating trees of Pico containers or if you have a class that you want treated as a component, but is not Pico component compatible. Will use the components class as key.

Parameters:
componentInstance - The pre instantiated component to register
Throws:
PicoRegistrationException
PicoIntrospectionException

registerComponent

public void registerComponent(Object componentKey,
                              Class componentImplementation,
                              Parameter[] parameters)
                       throws PicoRegistrationException
Register component with key, implementation and bindings for its parameters.

Parameters:
componentKey - Component type
componentImplementation - The class of the component to instantiate
Throws:
PicoRegistrationException - If a registration problem

addParameterToComponent

public void addParameterToComponent(Object componentKey,
                                    Class parameter,
                                    Object arg)
                             throws PicoIntrospectionException
Add a parameter to a component. Used for configuring them. Very liekly to change before release.

Parameters:
componentKey - The component type
parameter - The parameter it pertains to
arg - The argukemt to pass in.
Throws:
PicoIntrospectionException


Copyright © 2003 Codehaus. All Rights Reserved.