public class ComponentContainerContextFallback extends AbstractLoggableComponent implements ComponentContainer
ComponentContainer
used as fallback for
AbstractUiContext.getContainer()
if no real Ioc
is available.Modifier and Type | Field and Description |
---|---|
private Map<Class<?>,Object> |
componentMap |
private AbstractUiContext |
context
The
AbstractUiContext instance. |
Constructor and Description |
---|
ComponentContainerContextFallback(AbstractUiContext context)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
doInitialized()
This method is invoked at the end of the actual
initialization . |
<COMPONENT_API> |
get(Class<COMPONENT_API> apiClass)
This method gets the component that realizes the given
apiClass . |
<COMPONENT_API> |
get(Class<COMPONENT_API> apiClass,
String componentId)
This method gets the component that realizes the given
apiClass and is registered under the given
componentId . |
<COMPONENT_API> |
put(Class<COMPONENT_API> apiClass,
COMPONENT_API componentInstance)
Puts the given
componentInstance associated with the given apiClass into this
container. |
createLogger, doInitialize, getLogger
getInitializationState, initialize
private final AbstractUiContext context
AbstractUiContext
instance.private final Map<Class<?>,Object> componentMap
get(Class)
public ComponentContainerContextFallback(AbstractUiContext context)
context
- is the AbstractUiContext
.protected void doInitialized()
initialization
. It is called when
AbstractComponent.initialize()
is invoked for the first time after AbstractComponent.doInitialize()
is completed and
initialization-state
has changed to initialized
. super.
AbstractComponent.doInitialized()
.doInitialized
in class AbstractComponent
public <COMPONENT_API> COMPONENT_API get(Class<COMPONENT_API> apiClass) throws ResourceAmbiguousException, ResourceMissingException
apiClass
.get
in interface ComponentContainer
COMPONENT_API
- is the generic type of the apiClass
.apiClass
- is the class reflecting the API of the requested component. This should be an interface.ResourceAmbiguousException
- if there are multiple components registered that implement the given
apiClass
.ResourceMissingException
- if there is no component registered that implements the given apiClass
.public <COMPONENT_API> COMPONENT_API get(Class<COMPONENT_API> apiClass, String componentId) throws ResourceMissingException
apiClass
and is registered under the given
componentId
.get
in interface ComponentContainer
COMPONENT_API
- is the generic type of the apiClass
.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.ResourceMissingException
- if there is no component registered under the given componentId
or the
registered component does NOT realize the given apiClass
.public <COMPONENT_API> void put(Class<COMPONENT_API> apiClass, COMPONENT_API componentInstance)
componentInstance
associated with the given apiClass
into this
container. Cdi
.COMPONENT_API
- is the generic type of the apiClass
.apiClass
- is the class reflecting the API of component. This should be an interface.componentInstance
- is the instance of the component to register.Copyright © 2001–2016 mmm-Team. All rights reserved.