|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.apache.cocoon.components.LifecycleHelper
public class LifecycleHelper
Utility class for setting up Avalon components. Similar to Excalibur's
DefaultComponentFactory
, but on existing objects.
Constructor Summary | |
---|---|
LifecycleHelper(Logger logger,
Context context,
ComponentManager componentManager,
RoleManager roles,
Configuration configuration)
Deprecated. ComponentManager and RoleManager are deprecated |
|
LifecycleHelper(Logger logger,
Context context,
ServiceManager serviceManager,
ComponentManager componentManager,
RoleManager roles,
Configuration configuration)
Deprecated. ComponentManager and RoleManager are deprecated |
|
LifecycleHelper(Logger logger,
Context context,
ServiceManager serviceManager,
Configuration configuration)
Construct a new LifecycleHelper that can be used repeatedly to
setup several components. |
|
LifecycleHelper(Logger logger,
Context context,
ServiceManager serviceManager,
RoleManager roles,
Configuration configuration)
Deprecated. RoleManager is deprecated |
Method Summary | |
---|---|
static void |
decommission(Object component)
Decomission a component, by stopping (if it's Startable ) and
disposing (if it's Disposable ) a component. |
static void |
dispose(Object component)
Dispose a component if it's Disposable . |
Object |
setupComponent(Object component)
Setup a component, including initialization and start. |
Object |
setupComponent(Object component,
boolean initializeAndStart)
Setup a component, and optionnaly initializes (if it's Initializable )
and starts it (if it's Startable ). |
static Object |
setupComponent(Object component,
Logger logger,
Context context,
ComponentManager componentManager,
RoleManager roles,
Configuration configuration)
Deprecated. ComponentManager and RoleManager are deprecated |
static Object |
setupComponent(Object component,
Logger logger,
Context context,
ComponentManager componentManager,
RoleManager roles,
Configuration configuration,
boolean initializeAndStart)
Deprecated. ComponentManager and RoleManager are deprecated |
static Object |
setupComponent(Object component,
Logger logger,
Context context,
ServiceManager serviceManager,
ComponentManager componentManager,
RoleManager roles,
Configuration configuration,
boolean initializeAndStart)
Deprecated. ComponentManager and RoleManager are deprecated |
static Object |
setupComponent(Object component,
Logger logger,
Context context,
ServiceManager serviceManager,
Configuration configuration)
Alternative setupComponent method that takes a ServiceManager instead of a ComponentManger. |
static Object |
setupComponent(Object component,
Logger logger,
Context context,
ServiceManager serviceManager,
Configuration configuration,
boolean initializeAndStart)
Alternative setupComponent method that takes a ServiceManager instead of a ComponentManger. |
static Object |
setupComponent(Object component,
Logger logger,
Context context,
ServiceManager serviceManager,
RoleManager roles,
Configuration configuration)
Deprecated. RoleManager is deprecated |
static Object |
setupComponent(Object component,
Logger logger,
Context context,
ServiceManager serviceManager,
RoleManager roles,
Configuration configuration,
boolean initializeAndStart)
Deprecated. RoleManager is deprecated |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public LifecycleHelper(Logger logger, Context context, ComponentManager componentManager, RoleManager roles, 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 LogEnabled
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.public LifecycleHelper(Logger logger, Context context, ServiceManager serviceManager, RoleManager roles, 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 LogEnabled
s, unless there is
a LogKitManager
and the configuration specifies a logger name.context
- the Context
to pass to Contexutalizable
s.serviceManager
- the service manager to pass to Serviceable
s.roles
- the RoleManager
to pass to DefaultComponentSelector
s.configuration
- the Configuration
object to pass to new instances.public LifecycleHelper(Logger logger, Context context, ServiceManager serviceManager, 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 LogEnabled
s, unless there is
a LogKitManager
and the configuration specifies a logger name.context
- the Context
to pass to Contexutalizable
s.serviceManager
- the service manager to pass to Serviceable
s.configuration
- the Configuration
object to pass to new instances.public LifecycleHelper(Logger logger, Context context, ServiceManager serviceManager, ComponentManager componentManager, RoleManager roles, 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 LogEnabled
s, unless there is
a LogKitManager
and the configuration specifies a logger name.context
- the Context
to pass to Contexutalizable
s.serviceManager
- the service manager to pass to Serviceable
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 Object setupComponent(Object component) throws Exception
component
- the component to setup.
Exception
- if something went wrong.public Object setupComponent(Object component, boolean initializeAndStart) throws Exception
Initializable
)
and starts it (if it's Startable
).
component
- the component to setup.initializeAndStart
- if true, intialize()
and start()
will be called.
Exception
- if something went wrong.public static Object setupComponent(Object component, Logger logger, Context context, ComponentManager componentManager, RoleManager roles, Configuration configuration) throws Exception
setupComponent(Object)
, to be used when there's only one
component to setup.
Exception
public static Object setupComponent(Object component, Logger logger, Context context, ServiceManager serviceManager, RoleManager roles, Configuration configuration) throws Exception
Exception
public static Object setupComponent(Object component, Logger logger, Context context, ServiceManager serviceManager, Configuration configuration) throws Exception
Exception
public static Object setupComponent(Object component, Logger logger, Context context, ComponentManager componentManager, RoleManager roles, Configuration configuration, boolean initializeAndStart) throws Exception
setupComponent(Object, boolean)
, to be used when there's only one
component to setup.
Exception
public static Object setupComponent(Object component, Logger logger, Context context, ServiceManager serviceManager, RoleManager roles, Configuration configuration, boolean initializeAndStart) throws Exception
Exception
public static Object setupComponent(Object component, Logger logger, Context context, ServiceManager serviceManager, Configuration configuration, boolean initializeAndStart) throws Exception
Exception
public static Object setupComponent(Object component, Logger logger, Context context, ServiceManager serviceManager, ComponentManager componentManager, RoleManager roles, Configuration configuration, boolean initializeAndStart) throws Exception
setupComponent(Object, boolean)
, to be used when there's only one
component to setup.
Exception
public static final void decommission(Object component) throws Exception
Startable
) and
disposing (if it's Disposable
) a component.
Exception
public static final void dispose(Object component)
Disposable
. Otherwhise, do nothing.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |