org.codehaus.plexus.component.manager
Class SingletonComponentManager<T>

java.lang.Object
  extended by org.codehaus.plexus.component.manager.AbstractComponentManager<T>
      extended by 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
SingletonComponentManager(MutablePlexusContainer container, LifecycleHandler lifecycleHandler, ComponentDescriptor<T> componentDescriptor, java.lang.String role, java.lang.String roleHint)
           
 
Method Summary
 void dispose()
           
 T getComponent()
           
 void release(java.lang.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
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SingletonComponentManager

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

release

public void release(java.lang.Object component)
             throws ComponentLifecycleException
Throws:
ComponentLifecycleException

dispose

public void dispose()
             throws ComponentLifecycleException
Throws:
ComponentLifecycleException

getComponent

public T getComponent()
               throws ComponentInstantiationException,
                      ComponentLifecycleException
Throws:
ComponentInstantiationException
ComponentLifecycleException


Copyright © 2001-2010 Codehaus. All Rights Reserved.