Class SingletonComponentManager<T>
- java.lang.Object
-
- org.codehaus.plexus.component.manager.AbstractComponentManager<T>
-
- org.codehaus.plexus.component.manager.SingletonComponentManager<T>
-
- All Implemented Interfaces:
ComponentManager<T>
public class SingletonComponentManager<T> extends AbstractComponentManager<T>
This ensures a component is only used as a singleton, and is only shutdown when the container shuts down.- Author:
- Jason van Zyl
-
-
Field Summary
-
Fields inherited from class org.codehaus.plexus.component.manager.AbstractComponentManager
builder, componentContextRealms, componentDescriptor, container
-
Fields inherited from interface org.codehaus.plexus.component.manager.ComponentManager
NEXT_START_ID, ROLE
-
-
Constructor Summary
Constructors Constructor Description SingletonComponentManager(MutablePlexusContainer container, LifecycleHandler lifecycleHandler, ComponentDescriptor<T> componentDescriptor, String role, String roleHint)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
T
getComponent()
void
release(Object component)
-
Methods inherited from class org.codehaus.plexus.component.manager.AbstractComponentManager
connected, createComponentInstance, decrementConnectionCount, dissociateComponentRealm, endComponentLifecycle, getComponentDescriptor, getConnections, getContainer, getLifecycleHandler, getLogger, getRealm, getRole, getRoleHint, getStartId, getType, incrementConnectionCount, start
-
-
-
-
Constructor Detail
-
SingletonComponentManager
public SingletonComponentManager(MutablePlexusContainer container, LifecycleHandler lifecycleHandler, ComponentDescriptor<T> componentDescriptor, String role, String roleHint)
-
-
Method Detail
-
release
public void release(Object component) throws ComponentLifecycleException
- Throws:
ComponentLifecycleException
-
dispose
public void dispose() throws ComponentLifecycleException
- Throws:
ComponentLifecycleException
-
getComponent
public T getComponent() throws ComponentInstantiationException, ComponentLifecycleException
-
-