Class AbstractComponentManager<T>
- java.lang.Object
-
- org.codehaus.plexus.component.manager.AbstractComponentManager<T>
-
- All Implemented Interfaces:
ComponentManager<T>
- Direct Known Subclasses:
PerLookupComponentManager,SingletonComponentManager
public abstract class AbstractComponentManager<T> extends Object implements ComponentManager<T>
-
-
Field Summary
Fields Modifier and Type Field Description protected ComponentBuilder<T>builderprotected Map<Object,org.codehaus.plexus.classworlds.realm.ClassRealm>componentContextRealmsContains a mapping from singleton instances to the realms they were used to configure with.protected ComponentDescriptor<T>componentDescriptorprotected MutablePlexusContainercontainer-
Fields inherited from interface org.codehaus.plexus.component.manager.ComponentManager
NEXT_START_ID, ROLE
-
-
Constructor Summary
Constructors Constructor Description AbstractComponentManager(MutablePlexusContainer container, LifecycleHandler lifecycleHandler, ComponentDescriptor<T> componentDescriptor, String role, String roleHint)
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected booleanconnected()protected TcreateComponentInstance()protected voiddecrementConnectionCount()voiddissociateComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)protected voidendComponentLifecycle(Object component)ComponentDescriptor<T>getComponentDescriptor()intgetConnections()MutablePlexusContainergetContainer()LifecycleHandlergetLifecycleHandler()LoggergetLogger()org.codehaus.plexus.classworlds.realm.ClassRealmgetRealm()StringgetRole()StringgetRoleHint()longgetStartId()Deprecated.for internal use only..Class<? extends T>getType()protected voidincrementConnectionCount()voidstart(Object component)-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.codehaus.plexus.component.manager.ComponentManager
dispose, getComponent, release
-
-
-
-
Field Detail
-
container
protected final MutablePlexusContainer container
-
componentDescriptor
protected final ComponentDescriptor<T> componentDescriptor
-
builder
protected final ComponentBuilder<T> builder
-
componentContextRealms
protected final Map<Object,org.codehaus.plexus.classworlds.realm.ClassRealm> componentContextRealms
Contains a mapping from singleton instances to the realms they were used to configure with. This realm will be used to call all lifecycle methods. This will define a synchronized map, make sure to synchronize the map when iterating.
-
-
Constructor Detail
-
AbstractComponentManager
public AbstractComponentManager(MutablePlexusContainer container, LifecycleHandler lifecycleHandler, ComponentDescriptor<T> componentDescriptor, String role, String roleHint)
-
-
Method Detail
-
getComponentDescriptor
public ComponentDescriptor<T> getComponentDescriptor()
- Specified by:
getComponentDescriptorin interfaceComponentManager<T>
-
getType
public Class<? extends T> getType()
- Specified by:
getTypein interfaceComponentManager<T>
-
getRealm
public org.codehaus.plexus.classworlds.realm.ClassRealm getRealm()
- Specified by:
getRealmin interfaceComponentManager<T>
-
getRole
public String getRole()
- Specified by:
getRolein interfaceComponentManager<T>
-
getRoleHint
public String getRoleHint()
- Specified by:
getRoleHintin interfaceComponentManager<T>
-
getLifecycleHandler
public LifecycleHandler getLifecycleHandler()
- Specified by:
getLifecycleHandlerin interfaceComponentManager<T>- Returns:
LifecycleHandler.
-
incrementConnectionCount
protected void incrementConnectionCount()
-
decrementConnectionCount
protected void decrementConnectionCount()
-
connected
protected boolean connected()
-
getConnections
public int getConnections()
- Specified by:
getConnectionsin interfaceComponentManager<T>
-
start
public void start(Object component) throws PhaseExecutionException
- Specified by:
startin interfaceComponentManager<T>- Throws:
PhaseExecutionException
-
getStartId
public long getStartId()
Deprecated.for internal use only.. will be removed- Specified by:
getStartIdin interfaceComponentManager<T>- Returns:
- The start id.
-
createComponentInstance
protected T createComponentInstance() throws ComponentInstantiationException, ComponentLifecycleException
-
endComponentLifecycle
protected void endComponentLifecycle(Object component) throws ComponentLifecycleException
- Throws:
ComponentLifecycleException
-
getContainer
public MutablePlexusContainer getContainer()
- Specified by:
getContainerin interfaceComponentManager<T>
-
getLogger
public Logger getLogger()
-
dissociateComponentRealm
public void dissociateComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm) throws ComponentLifecycleException- Specified by:
dissociateComponentRealmin interfaceComponentManager<T>- Throws:
ComponentLifecycleException
-
-