|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.apache.cocoon.components.LifecycleHelper
Utility class for setting up Avalon components. Similar to Excalibur's
DefaultComponentFactory
, but on existing objects.
To be moved to Avalon ?
Constructor Summary | |
LifecycleHelper(org.apache.log.Logger logger,
org.apache.avalon.framework.context.Context context,
org.apache.avalon.framework.component.ComponentManager componentManager,
org.apache.avalon.excalibur.component.RoleManager roles,
org.apache.avalon.excalibur.logger.LogKitManager logkit,
org.apache.avalon.framework.configuration.Configuration configuration)
Construct a new LifecycleHelper that can be used repeatedly to
setup several components. |
Method Summary | |
static void |
decommission(java.lang.Object component)
Decomission a component, by stopping (if it's Startable ) and
disposing (if it's Disposable ) a component. |
static void |
dispose(java.lang.Object component)
Dispose a component if it's Disposable . |
java.lang.Object |
setupComponent(java.lang.Object component)
Setup a component, including initialization and start. |
java.lang.Object |
setupComponent(java.lang.Object component,
boolean initializeAndStart)
Setup a component, and optionnaly initializes (if it's Initializable )
and starts it (if it's Startable ). |
static java.lang.Object |
setupComponent(java.lang.Object component,
org.apache.log.Logger logger,
org.apache.avalon.framework.context.Context context,
org.apache.avalon.framework.component.ComponentManager componentManager,
org.apache.avalon.excalibur.component.RoleManager roles,
org.apache.avalon.excalibur.logger.LogKitManager logkit,
org.apache.avalon.framework.configuration.Configuration configuration)
Static equivalent to setupComponent(Object) , to be used when there's only one
component to setup. |
static java.lang.Object |
setupComponent(java.lang.Object component,
org.apache.log.Logger logger,
org.apache.avalon.framework.context.Context context,
org.apache.avalon.framework.component.ComponentManager componentManager,
org.apache.avalon.excalibur.component.RoleManager roles,
org.apache.avalon.excalibur.logger.LogKitManager logkit,
org.apache.avalon.framework.configuration.Configuration configuration,
boolean initializeAndStart)
Static equivalent to setupComponent(Object, boolean) , to be used when there's only one
component to setup. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public LifecycleHelper(org.apache.log.Logger logger, org.apache.avalon.framework.context.Context context, org.apache.avalon.framework.component.ComponentManager componentManager, org.apache.avalon.excalibur.component.RoleManager roles, org.apache.avalon.excalibur.logger.LogKitManager logkit, org.apache.avalon.framework.configuration.Configuration configuration)
LifecycleHelper
that can be used repeatedly to
setup several components. Note : if a parameter is null
,
the corresponding method isn't called (e.g. if configuration
is
null
, configure()
isn't called).logger
- the Logger
to pass to Loggable
s, unless there is
a LogKitManager
and the configuration specifies a logger name.context
- the Context
to pass to Contexutalizable
s.componentManager
- the component manager to pass to Composable
s.roles
- the RoleManager
to pass to DefaultComponentSelector
s.configuration
- the Configuration
object to pass to new instances.Method Detail |
public java.lang.Object setupComponent(java.lang.Object component) throws java.lang.Exception
component
- the component to setup.java.lang.Exception
- if something went wrong.public java.lang.Object setupComponent(java.lang.Object component, boolean initializeAndStart) throws java.lang.Exception
Initializable
)
and starts it (if it's Startable
).component
- the component to setup.initializeAndStart
- if true, intialize()
and start()
will be called.java.lang.Exception
- if something went wrong.public static java.lang.Object setupComponent(java.lang.Object component, org.apache.log.Logger logger, org.apache.avalon.framework.context.Context context, org.apache.avalon.framework.component.ComponentManager componentManager, org.apache.avalon.excalibur.component.RoleManager roles, org.apache.avalon.excalibur.logger.LogKitManager logkit, org.apache.avalon.framework.configuration.Configuration configuration) throws java.lang.Exception
setupComponent(Object)
, to be used when there's only one
component to setup.public static java.lang.Object setupComponent(java.lang.Object component, org.apache.log.Logger logger, org.apache.avalon.framework.context.Context context, org.apache.avalon.framework.component.ComponentManager componentManager, org.apache.avalon.excalibur.component.RoleManager roles, org.apache.avalon.excalibur.logger.LogKitManager logkit, org.apache.avalon.framework.configuration.Configuration configuration, boolean initializeAndStart) throws java.lang.Exception
setupComponent(Object, boolean)
, to be used when there's only one
component to setup.public static final void decommission(java.lang.Object component) throws java.lang.Exception
Startable
) and
disposing (if it's Disposable
) a component.public static final void dispose(java.lang.Object component)
Disposable
. Otherwhise, do nothing.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |