|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.avalon.framework.container.ContainerUtil
Utility class that makes it easier to transfer a component throught it's lifecycle stages.
Method Summary | |
static void |
compose(Object object,
ComponentManager componentManager)
Deprecated. compose() is no longer the preferred method via which components will be supplied with Components. Please Use service() from Composable instead. |
static void |
configure(Object object,
Configuration configuration)
Configure specified object if it implements the Configurable interface. |
static void |
contextualize(Object object,
Context context)
Supply specified object with a Context object if it implements the Contextualizable interface. |
static void |
dispose(Object object)
Dispose specified object if it implements the Disposable interface. |
static void |
enableLogging(Object object,
Logger logger)
Supply specified object with Logger if it implements the LogEnabled interface. |
static void |
initialize(Object object)
Initialize specified object if it implements the Initializable interface. |
static void |
parameterize(Object object,
Parameters parameters)
Parameterize specified object if it implements the Parameterizable interface. |
static void |
service(Object object,
ServiceManager serviceManager)
Supply specified object with ServiceManager if it implements the Serviceable interface. |
static void |
shutdown(Object object)
Run specified object through shutdown lifecycle stages (Stop and Dispose). |
static void |
start(Object object)
Start specified object if it implements the Startable interface. |
static void |
stop(Object object)
Stop specified object if it implements the Startable interface. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public static void shutdown(Object object) throws Exception
object
- the object to shutdown
Exception
- if there is a problem stoppping objectpublic static void enableLogging(Object object, Logger logger)
LogEnabled
interface.
object
- the object to Startlogger
- the logger to enable component with. May be null
in which case the specified object must not implement LogEnabled.
IllegalArgumentException
- if the object is LogEnabled but Logger is nullpublic static void contextualize(Object object, Context context) throws ContextException
Contextualizable
interface.
object
- the object to contextualizecontext
- the context object to use for object.
May be null in which case the specified object must not
implement Contextualizable.
ContextException
- if there is a problem contextualizing object
IllegalArgumentException
- if the object is Contextualizable but
context is nullpublic static void service(Object object, ServiceManager serviceManager) throws ServiceException
Serviceable
interface.
object
- the object to serviceserviceManager
- the serviceManager object to use for object.
May be null in which case the specified object must not
implement Serviceable.
ServiceException
- if there is a problem servicing object
IllegalArgumentException
- if the object is Servicable but
ServiceManager is nullpublic static void compose(Object object, ComponentManager componentManager) throws ComponentException
Composable
interface.
object
- the object to composecomponentManager
- the ComponentManager object to use for object.
May be null in which case the specified object must not
implement Composable.
ComponentException
- if there is a problem composing object
IllegalArgumentException
- if the object is Composable but
ComponentManager is nullpublic static void configure(Object object, Configuration configuration) throws ConfigurationException
Configurable
interface.
object
- the object to Startconfiguration
- the configuration object to use during
configuration. May be null in which case the specified object
must not implement Configurable
ConfigurationException
- if there is a problem Configuring object,
or the object is Configurable but Configuration is null
IllegalArgumentException
- if the object is Configurable but
Configuration is nullpublic static void parameterize(Object object, Parameters parameters) throws ParameterException
Parameterizable
interface.
object
- the object to Parameterize.parameters
- the parameters object to use during Parameterization.
May be null in which case the specified object must not
implement Parameterizable.
ParameterException
- if there is a problem Parameterizing object
IllegalArgumentException
- if the object is Parameterizable but
parameters is nullpublic static void initialize(Object object) throws Exception
Initializable
interface.
object
- the object to Initialize
Exception
- if there is a problem Initializing objectpublic static void start(Object object) throws Exception
Startable
interface.
object
- the object to Start
Exception
- if there is a problem Starting objectpublic static void stop(Object object) throws Exception
Startable
interface.
object
- the object to stop
Exception
- if there is a problem stoppping objectpublic static void dispose(Object object)
Disposable
interface.
object
- the object to dispose
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |