Class ContainerUtil
- java.lang.Object
-
- org.apache.avalon.framework.container.ContainerUtil
-
public final class ContainerUtil extends java.lang.ObjectUtility class that makes it easier to transfer a component throught it's lifecycle stages.- Version:
- $Id: ContainerUtil.java 30977 2004-07-30 03:57:54 -0500 (Fri, 30 Jul 2004) niclas $
- Author:
- Avalon Development Team
-
-
Constructor Summary
Constructors Modifier Constructor Description privateContainerUtil()Private constructor to block instantiation.
-
Method Summary
All Methods Static Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static voidcompose(java.lang.Object object, org.apache.avalon.framework.component.ComponentManager componentManager)Deprecated.compose() is no longer the preferred method via which components will be supplied with Components.static voidconfigure(java.lang.Object object, org.apache.avalon.framework.configuration.Configuration configuration)Configure specified object if it implements theConfigurableinterface.static voidcontextualize(java.lang.Object object, org.apache.avalon.framework.context.Context context)Supply specified object with a Context object if it implements theContextualizableinterface.static voiddispose(java.lang.Object object)Dispose specified object if it implements theDisposableinterface.static voidenableLogging(java.lang.Object object, org.apache.avalon.framework.logger.Logger logger)Supply specified object with Logger if it implements theLogEnabledinterface.static voidexecute(java.lang.Object object)Execute the specified object if it implements theExecutableinterface.static voidinitialize(java.lang.Object object)Initialize specified object if it implements theInitializableinterface.static voidparameterize(java.lang.Object object, org.apache.avalon.framework.parameters.Parameters parameters)Parameterize specified object if it implements theParameterizableinterface.static voidservice(java.lang.Object object, org.apache.avalon.framework.service.ServiceManager serviceManager)Supply specified object with ServiceManager if it implements theServiceableinterface.static voidshutdown(java.lang.Object object)Run specified object through shutdown lifecycle stages (Stop and Dispose).static voidstart(java.lang.Object object)Start specified object if it implements theStartableinterface.static voidstop(java.lang.Object object)Stop specified object if it implements theStartableinterface.
-
-
-
Method Detail
-
shutdown
public static void shutdown(java.lang.Object object) throws java.lang.ExceptionRun specified object through shutdown lifecycle stages (Stop and Dispose).- Parameters:
object- the object to shutdown- Throws:
java.lang.Exception- if there is a problem stoppping object
-
enableLogging
public static void enableLogging(java.lang.Object object, org.apache.avalon.framework.logger.Logger logger)Supply specified object with Logger if it implements theLogEnabledinterface.- Parameters:
object- the object to Startlogger- the logger to enable component with. May be null in which case the specified object must not implement LogEnabled.- Throws:
java.lang.IllegalArgumentException- if the object is LogEnabled but Logger is null
-
contextualize
public static void contextualize(java.lang.Object object, org.apache.avalon.framework.context.Context context) throws org.apache.avalon.framework.context.ContextExceptionSupply specified object with a Context object if it implements theContextualizableinterface.- Parameters:
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.- Throws:
org.apache.avalon.framework.context.ContextException- if there is a problem contextualizing objectjava.lang.IllegalArgumentException- if the object is Contextualizable but context is null
-
service
public static void service(java.lang.Object object, org.apache.avalon.framework.service.ServiceManager serviceManager) throws org.apache.avalon.framework.service.ServiceExceptionSupply specified object with ServiceManager if it implements theServiceableinterface.- Parameters:
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.- Throws:
org.apache.avalon.framework.service.ServiceException- if there is a problem servicing objectjava.lang.IllegalArgumentException- if the object is Servicable but ServiceManager is null
-
compose
public static void compose(java.lang.Object object, org.apache.avalon.framework.component.ComponentManager componentManager) throws org.apache.avalon.framework.component.ComponentExceptionDeprecated.compose() is no longer the preferred method via which components will be supplied with Components. Please Use service() from Composable instead.Supply specified object with ComponentManager if it implements theComposableinterface.- Parameters:
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.- Throws:
org.apache.avalon.framework.component.ComponentException- if there is a problem composing objectjava.lang.IllegalArgumentException- if the object is Composable but ComponentManager is null
-
configure
public static void configure(java.lang.Object object, org.apache.avalon.framework.configuration.Configuration configuration) throws org.apache.avalon.framework.configuration.ConfigurationExceptionConfigure specified object if it implements theConfigurableinterface.- Parameters:
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- Throws:
org.apache.avalon.framework.configuration.ConfigurationException- if there is a problem Configuring object, or the object is Configurable but Configuration is nulljava.lang.IllegalArgumentException- if the object is Configurable but Configuration is null
-
parameterize
public static void parameterize(java.lang.Object object, org.apache.avalon.framework.parameters.Parameters parameters) throws org.apache.avalon.framework.parameters.ParameterExceptionParameterize specified object if it implements theParameterizableinterface.- Parameters:
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.- Throws:
org.apache.avalon.framework.parameters.ParameterException- if there is a problem Parameterizing objectjava.lang.IllegalArgumentException- if the object is Parameterizable but parameters is null
-
initialize
public static void initialize(java.lang.Object object) throws java.lang.ExceptionInitialize specified object if it implements theInitializableinterface.- Parameters:
object- the object to Initialize- Throws:
java.lang.Exception- if there is a problem Initializing object
-
start
public static void start(java.lang.Object object) throws java.lang.ExceptionStart specified object if it implements theStartableinterface.- Parameters:
object- the object to Start- Throws:
java.lang.Exception- if there is a problem Starting object
-
execute
public static void execute(java.lang.Object object) throws java.lang.ExceptionExecute the specified object if it implements theExecutableinterface.- Parameters:
object- the object to execute- Throws:
java.lang.Exception- if there is a problem executing object
-
stop
public static void stop(java.lang.Object object) throws java.lang.ExceptionStop specified object if it implements theStartableinterface.- Parameters:
object- the object to stop- Throws:
java.lang.Exception- if there is a problem stoppping object
-
dispose
public static void dispose(java.lang.Object object)
Dispose specified object if it implements theDisposableinterface.- Parameters:
object- the object to dispose
-
-