public abstract class AbstractSpringContainer extends AbstractLoggableComponent implements IocContainer
IocContainer
using spring. spring
is an optional dependency in mmm-util-core
.Modifier and Type | Field and Description |
---|---|
private org.springframework.context.ApplicationContext |
applicationContext
The
ConfigurableApplicationContext to delegate to. |
Modifier | Constructor and Description |
---|---|
protected |
AbstractSpringContainer()
The constructor.
|
protected |
AbstractSpringContainer(org.springframework.context.ConfigurableApplicationContext applicationContext)
The constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose()
This method disposes the container (performs a shutdown and destroys all components).
|
<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 . |
protected org.springframework.context.ApplicationContext |
getContext() |
boolean |
isDisposed()
This method tests if this object has been
disposed . |
(package private) void |
setContext(org.springframework.context.ApplicationContext context) |
createLogger, doInitialize, getLogger
doInitialized, getInitializationState, initialize
private org.springframework.context.ApplicationContext applicationContext
ConfigurableApplicationContext
to delegate to.protected AbstractSpringContainer(org.springframework.context.ConfigurableApplicationContext applicationContext)
applicationContext
- is the ConfigurableApplicationContext
to adapt.protected AbstractSpringContainer()
protected org.springframework.context.ApplicationContext getContext()
void setContext(org.springframework.context.ApplicationContext context)
context
- is the ApplicationContext
to set.public <COMPONENT_API> COMPONENT_API get(Class<COMPONENT_API> apiClass)
ComponentContainer
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.public <COMPONENT_API> COMPONENT_API get(Class<COMPONENT_API> apiClass, String componentId)
ComponentContainer
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.public void dispose()
IocContainer
dispose
in interface IocContainer
dispose
in interface AttributeWriteDisposed
public boolean isDisposed()
AttributeReadDisposed
disposed
. A disposed object can
NOT be used anymore.isDisposed
in interface AttributeReadDisposed
true
if this object has been disposed.AttributeWriteDisposed.dispose()
Copyright © 2001–2016 mmm-Team. All rights reserved.