org.codehaus.plexus.component.manager
Class ClassicSingletonComponentManager
java.lang.Object
org.codehaus.plexus.component.manager.AbstractComponentManager
org.codehaus.plexus.component.manager.ClassicSingletonComponentManager
- All Implemented Interfaces:
- java.lang.Cloneable, ComponentManager
public class ClassicSingletonComponentManager
- extends AbstractComponentManager
This ensures only a single manager of a a component exists. Once no
more connections for this component exists it is disposed.
- Version:
- $Id: ClassicSingletonComponentManager.java 6984 2007-10-22 01:51:38Z jvanzyl $
- Author:
- Jason van Zyl, Bert van Brakel
Method Summary |
void |
dispose()
|
protected java.lang.Object |
findSingleton(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
|
protected java.lang.Object |
findSingleton(java.lang.Object component)
|
java.lang.Object |
getComponent(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
|
java.lang.String |
getId()
|
void |
initialize()
|
void |
release(java.lang.Object component)
|
Methods inherited from class org.codehaus.plexus.component.manager.AbstractComponentManager |
connected, copy, createComponentInstance, createComponentInstance, decrementConnectionCount, endComponentLifecycle, getComponent, getComponentDescriptor, getConnections, getContainer, getLifecycleHandler, getLogger, incrementConnectionCount, setup, startComponentLifecycle |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
lock
private java.lang.Object lock
singletonMap
private java.util.Map singletonMap
ClassicSingletonComponentManager
public ClassicSingletonComponentManager()
getId
public java.lang.String getId()
release
public void release(java.lang.Object component)
throws ComponentLifecycleException
- Throws:
ComponentLifecycleException
dispose
public void dispose()
throws ComponentLifecycleException
- Throws:
ComponentLifecycleException
getComponent
public java.lang.Object getComponent(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
throws ComponentInstantiationException,
ComponentLifecycleException
- Throws:
ComponentInstantiationException
ComponentLifecycleException
findSingleton
protected java.lang.Object findSingleton(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
findSingleton
protected java.lang.Object findSingleton(java.lang.Object component)
initialize
public void initialize()
- Specified by:
initialize
in interface ComponentManager
- Overrides:
initialize
in class AbstractComponentManager