net.sf.mmm.util.component.api
Interface IocContainer

All Known Implementing Classes:
SpringContainer

public interface IocContainer

This is the interface for the container of an inversion of control (IoC) framework. It is just use as abstraction layer for frameworks like spring, guice or seam - you will not find a native implementation within this project.

Since:
2.0.0
Author:
Joerg Hohwiller (hohwille at users.sourceforge.net)

Method Summary
 void dispose()
          This method disposes the container (performs a shutdown and destroys all components).
<COMPONENT_API>
COMPONENT_API
getComponent(Class<COMPONENT_API> apiClass)
          This method gets the component that realizes the given apiClass.
<COMPONENT_API>
COMPONENT_API
getComponent(Class<COMPONENT_API> apiClass, String componentId)
          This method gets the component that realizes the given apiClass and is registered under the given componentId.
 

Method Detail

getComponent

<COMPONENT_API> COMPONENT_API getComponent(Class<COMPONENT_API> apiClass)
                           throws ResourceAmbiguousException,
                                  ResourceMissingException
This method gets the component that realizes the given apiClass.

Type Parameters:
COMPONENT_API - is the generic type of the apiClass.
Parameters:
apiClass - is the class reflecting the API of the requested component. This should be an interface.
Returns:
the requested component.
Throws:
ResourceMissingException - if there is no component registered that implements the given apiClass.
ResourceAmbiguousException - if there are multiple components registered that implement the given apiClass.

getComponent

<COMPONENT_API> COMPONENT_API getComponent(Class<COMPONENT_API> apiClass,
                                           String componentId)
                           throws ResourceMissingException
This method gets the component that realizes the given apiClass and is registered under the given componentId.

Type Parameters:
COMPONENT_API - is the generic type of the apiClass.
Parameters:
apiClass - is the class reflecting the API of the requested component. This should be an interface.
componentId - is the unique ID under which the component is registered in this container.
Returns:
the requested component.
Throws:
ResourceMissingException - if there is no component registered under the given componentId or the registered component does NOT realize the given apiClass.

dispose

void dispose()
This method disposes the container (performs a shutdown and destroys all components).



Copyright © 2001-2010 mmm-Team. All Rights Reserved.