Package org.picocontainer.lifecycle
Class NullLifecycleStrategy
- java.lang.Object
-
- org.picocontainer.lifecycle.NullLifecycleStrategy
-
- All Implemented Interfaces:
java.io.Serializable,LifecycleStrategy
public class NullLifecycleStrategy extends java.lang.Object implements LifecycleStrategy, java.io.Serializable
Lifecycle strategy that does nothing.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description NullLifecycleStrategy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddispose(java.lang.Object component)Invoke the "dispose" method on the component instance if this is disposable.booleanhasLifecycle(java.lang.Class<?> type)Test if a component instance has a lifecycle.booleanisLazy(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() ).voidstart(java.lang.Object component)Invoke the "start" method on the component instance if this is startable.voidstop(java.lang.Object component)Invoke the "stop" method on the component instance if this is stoppable.
-
-
-
Method Detail
-
start
public void start(java.lang.Object component)
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.- Specified by:
startin interfaceLifecycleStrategy- Parameters:
component- the instance of the component to start
-
stop
public void stop(java.lang.Object component)
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.- Specified by:
stopin interfaceLifecycleStrategy- Parameters:
component- the instance of the component to stop
-
dispose
public void dispose(java.lang.Object component)
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.- Specified by:
disposein interfaceLifecycleStrategy- Parameters:
component- the instance of the component to dispose
-
hasLifecycle
public boolean hasLifecycle(java.lang.Class<?> type)
Test if a component instance has a lifecycle.- Specified by:
hasLifecyclein interfaceLifecycleStrategy- Parameters:
type- the component's type- Returns:
trueif the component has a lifecycle
-
isLazy
public boolean isLazy(ComponentAdapter<?> adapter)
Description copied from interface:LifecycleStrategyIs 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.- Specified by:
isLazyin interfaceLifecycleStrategy- Returns:
- true if lazy, false if not lazy
-
-