Package org.picocontainer
Interface LifecycleStrategy
- All Known Implementing Classes:
AbstractBehavior
,AbstractMonitoringLifecycleStrategy
,Automated
,Cached
,CompositeLifecycleStrategy
,Decorated
,FieldDecorated
,Guarded
,HiddenImplementation
,InstanceAdapter
,Intercepted
,JavaEE5LifecycleStrategy
,Locked
,NullLifecycleStrategy
,PropertyApplicator
,ProviderAdapter
,ReflectionLifecycleStrategy
,StartableLifecycleStrategy
,Stored
,Synchronized
,ThreadCached
public interface LifecycleStrategy
An interface which specifies the lifecycle strategy on the component instance.
Lifecycle strategies are used by component adapters to delegate the lifecycle
operations on the component instances.
- Author:
- Paul Hammant, Peter Royal, Jörg Schaible, Mauro Talevi
- See Also:
-
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.boolean
isLazy
(ComponentAdapter<?> adapter) Is a component eager (not lazy) in that it should start when start() or equivalent is called, or lazy (it will only start on first getComponent() ).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.
-
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.- Parameters:
type
- the component's type- Returns:
true
if the component has a lifecycle
-
isLazy
Is a component eager (not lazy) in that it should start when start() or equivalent is called, or lazy (it will only start on first getComponent() ). The default is the first of those two.- Parameters:
adapter
-- Returns:
- true if lazy, false if not lazy
-