Method Summary |
|
public Object | findComponent(Object key) Finds the component with the specified key .
Parameters: key - the unique key of the component as an Object. |
public Object | findComponent(Class key) Finds the component with the specified Class key . |
public Object | findComponent(String key, Class type) Attempts to find the component with the specified unique key ,
if it can't be found, the default of the specified type is
returned, if no default is set, null is returned. |
public Object | findComponentByNamespace(String namespace, Object key) Finds a component in this container with a unique (within this container)
key registered by the specified namespace .
Parameters: namespace - the namespace for which to search. Parameters: key - the unique key. |
public Collection | findComponentsOfType(Class type) Finds all components having the given type .
Parameters: type - the component type. |
public Object | findRequiredComponent(Class key) Attempts to Find the component with the specified type ,
throwing a
ComponentContainerException exception if one can not
be found.
Parameters: key - the unique key of the component as an Object. |
final protected String | getComponentDefaultConfigurationPath(Class type) Returns the expected path to the component's default configuration file.
Parameters: type - the component type. |
public static ComponentContainer | instance() Gets the shared instance of this ComponentContainer. |
public boolean | isRegistered(Object key) Registers true (false otherwise) if the component in this container with
a unique (within this container) key is registered.
Parameters: key - the unique key. |
public boolean | isRegisteredByNamespace(String namespace, Object key) Registers true (false otherwise) if the component in this container with
a unique (within this container) key is registered by the
specified namespace .
Parameters: namespace - the namespace for which to register the component. Parameters: key - the unique key. |
public Object | newComponent(String implementation, Class type) Creates a new component of the given implementation (if it
isn't null or empty), otherwise attempts to find the default
implementation of the given type by searching the
META-INF/services directory for the default
implementation.
Parameters: implementation - the fully qualified name of the implementationclass. Parameters: type - the type to retrieve if the implementation is empty. |
public Object | newComponent(Class implementation, Class type) Creates a new component of the given implementation (if it
isn't null or empty), otherwise attempts to find the default
implementation of the given type by searching the
META-INF/services directory for the default
implementation.
Parameters: implementation - the implementation class. Parameters: type - the type to retrieve if the implementation is empty. |
public Object | newDefaultComponent(Class type) Creates a new component of the given type by searching the
META-INF/services directory and finding its default
implementation. |
public Object | registerComponent(Object key, Object component) Registers the component in this container with a unique (within this
container) key .
Parameters: key - the unique key. |
public void | registerComponentByNamespace(String namespace, Object key, Object component) Registers the component in this container with a unique (within this
container) key by the specified namespace . |
public void | registerComponentType(Class type) Registers the component of the specified type . |
public Object | registerComponentType(String type) Registers the components of the specified type . |
public void | registerDefaultComponent(Class componentInterface, String defaultTypeName) Registers the "default" for the specified componentInterface.
Parameters: componentInterface - the interface for the component. Parameters: defaultTypeName - the name of the "default" type of theimplementation to use for the componentInterface. |
public Object | registerDefaultComponent(Class componentInterface, Class defaultType) Registers the "default" for the specified componentInterface.
Parameters: componentInterface - the interface for the component. Parameters: defaultType - the "default" implementation to use for thecomponentInterface. |
public void | shutdown() Shuts down this container instance. |
public Object | unregisterComponent(String key) Unregisters the component in this container with a unique (within this
container) key .
Parameters: key - the unique key. |