Package org.picocontainer.lifecycle
Class JavaEE5LifecycleStrategy
java.lang.Object
org.picocontainer.lifecycle.AbstractMonitoringLifecycleStrategy
org.picocontainer.lifecycle.JavaEE5LifecycleStrategy
- All Implemented Interfaces:
Serializable
,ComponentMonitorStrategy
,LifecycleStrategy
Java EE 5 has some annotations PreDestroy and PostConstruct that map to start() and dispose() in our world
- Author:
- Paul Hammant
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionJavaEE5LifecycleStrategy
(ComponentMonitor monitor) Construct a JavaEE5LifecycleStrategy. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Invoke the "dispose" method on the component instance if this is disposable.boolean
hasLifecycle
(Class<?> type) Test if a component instance has a lifecycle.void
Invoke the "start" method on the component instance if this is startable.void
Invoke the "stop" method on the component instance if this is stoppable.Methods inherited from class org.picocontainer.lifecycle.AbstractMonitoringLifecycleStrategy
changeMonitor, currentMonitor, isLazy
-
Constructor Details
-
JavaEE5LifecycleStrategy
Construct a JavaEE5LifecycleStrategy.- Parameters:
monitor
- the monitor to use- Throws:
NullPointerException
- if the monitor isnull
-
-
Method Details
-
start
Invoke the "start" method on the component instance if this is startable. It is up to the implementation of the strategy what "start" and "startable" means.- Parameters:
component
- the instance of the component to start
-
stop
Invoke the "stop" method on the component instance if this is stoppable. It is up to the implementation of the strategy what "stop" and "stoppable" means.- Parameters:
component
- the instance of the component to stop
-
dispose
Invoke the "dispose" method on the component instance if this is disposable. It is up to the implementation of the strategy what "dispose" and "disposable" means.- Parameters:
component
- the instance of the component to dispose
-
hasLifecycle
Test if a component instance has a lifecycle. The component has a lifecycle PreDestroy or PostConstruct are on a method- Parameters:
type
- the component's type- Returns:
true
if the component has a lifecycle
-