org.codehaus.plexus.component.manager

## 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 java.lang.Object
    implements ComponentManager<T>

### Field Summary

Fields
`protected ComponentBuilder<T>` `builder`
`protected java.util.Map<java.lang.Object,org.codehaus.plexus.classworlds.realm.ClassRealm>` `componentContextRealms` Contains a mapping from singleton instances to the realms they were used to configure with.
`protected ComponentDescriptor<T>` `componentDescriptor`
`protected MutablePlexusContainer` `container`

### Fields inherited from interface org.codehaus.plexus.component.manager.ComponentManager

`NEXT_START_ID, ROLE`

### Constructor Summary

Constructors
Constructor and Description
`AbstractComponentManager(MutablePlexusContainer container, LifecycleHandler lifecycleHandler, ComponentDescriptor<T> componentDescriptor, java.lang.String role, java.lang.String roleHint)`

### Method Summary

All Methods Instance Methods Concrete Methods Deprecated Methods
`protected boolean` `connected()`
`protected T` `createComponentInstance()`
`protected void` `decrementConnectionCount()`
`void` `dissociateComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)`
`protected void` `endComponentLifecycle(java.lang.Object component)`
`ComponentDescriptor<T>` `getComponentDescriptor()`
`int` `getConnections()`
`MutablePlexusContainer` `getContainer()`
`LifecycleHandler` `getLifecycleHandler()`
`Logger` `getLogger()`
`org.codehaus.plexus.classworlds.realm.ClassRealm` `getRealm()`
`java.lang.String` `getRole()`
`java.lang.String` `getRoleHint()`
`long` `getStartId()` Deprecated. for internal use only.. will be removed
`java.lang.Class<? extends T>` `getType()`
`protected void` `incrementConnectionCount()`
`void` `start(java.lang.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 java.util.Map<java.lang.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.

### Constructor Detail

#### AbstractComponentManager

    public AbstractComponentManager(MutablePlexusContainer container,
                                    LifecycleHandler lifecycleHandler,
                                    ComponentDescriptor<T> componentDescriptor,
                                    java.lang.String role,
                                    java.lang.String roleHint)

### Method Detail

#### getComponentDescriptor

    public ComponentDescriptor<T> getComponentDescriptor()

Specified by:
  `getComponentDescriptor` in interface `ComponentManager<T>`

#### getType

    public java.lang.Class<? extends T> getType()

Specified by:
  `getType` in interface `ComponentManager<T>`

#### getRealm

    public org.codehaus.plexus.classworlds.realm.ClassRealm getRealm()

Specified by:
  `getRealm` in interface `ComponentManager<T>`

#### getRole

    public java.lang.String getRole()

Specified by:
  `getRole` in interface `ComponentManager<T>`

#### getRoleHint

    public java.lang.String getRoleHint()

Specified by:
  `getRoleHint` in interface `ComponentManager<T>`

#### getLifecycleHandler

    public LifecycleHandler getLifecycleHandler()

Specified by:
  `getLifecycleHandler` in interface `ComponentManager<T>`

#### incrementConnectionCount

    protected void incrementConnectionCount()

#### decrementConnectionCount

    protected void decrementConnectionCount()

#### connected

    protected boolean connected()

#### getConnections

    public int getConnections()

Specified by:
  `getConnections` in interface `ComponentManager<T>`

#### start

    public void start(java.lang.Object component)
               throws PhaseExecutionException

Specified by:
  `start` in interface `ComponentManager<T>`
Throws:
  `PhaseExecutionException`

#### getStartId

    public long getStartId()

Deprecated. for internal use only.. will be removed

Specified by:
  `getStartId` in interface `ComponentManager<T>`

#### createComponentInstance

    protected T createComponentInstance()
                                 throws ComponentInstantiationException,
                                        ComponentLifecycleException

Throws:
  `ComponentInstantiationException`
  `ComponentLifecycleException`

#### endComponentLifecycle

    protected void endComponentLifecycle(java.lang.Object component)
                                  throws ComponentLifecycleException

Throws:
  `ComponentLifecycleException`

#### getContainer

    public MutablePlexusContainer getContainer()

Specified by:
  `getContainer` in interface `ComponentManager<T>`

#### getLogger

    public Logger getLogger()

#### dissociateComponentRealm

    public void dissociateComponentRealm(org.codehaus.plexus.classworlds.realm.ClassRealm realm)
                                  throws ComponentLifecycleException

Specified by:
  `dissociateComponentRealm` in interface `ComponentManager<T>`
Throws:
  `ComponentLifecycleException`