Package org.picocontainer.lifecycle
Class AbstractMonitoringLifecycleStrategy
java.lang.Object
org.picocontainer.lifecycle.AbstractMonitoringLifecycleStrategy
- All Implemented Interfaces:
Serializable,ComponentMonitorStrategy,LifecycleStrategy
- Direct Known Subclasses:
JavaEE5LifecycleStrategy,ReflectionLifecycleStrategy,StartableLifecycleStrategy
public abstract class AbstractMonitoringLifecycleStrategy
extends Object
implements LifecycleStrategy, ComponentMonitorStrategy, Serializable
Abstract base class for lifecycle strategy implementation supporting a
ComponentMonitor.- Author:
- Jörg Schaible
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstruct a AbstractMonitoringLifecycleStrategy. -
Method Summary
Modifier and TypeMethodDescriptionvoidchangeMonitor(ComponentMonitor monitor) Swaps the current monitor with a replacement.Returns the monitor currently usedbooleanisLazy(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() ).Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.picocontainer.LifecycleStrategy
dispose, hasLifecycle, start, stop
-
Constructor Details
-
AbstractMonitoringLifecycleStrategy
Construct a AbstractMonitoringLifecycleStrategy.- Parameters:
monitor- the componentMonitor to use- Throws:
NullPointerException- if the monitor isnull
-
-
Method Details
-
changeMonitor
Swaps the current monitor with a replacement.- Specified by:
changeMonitorin interfaceComponentMonitorStrategy- Parameters:
monitor- The new monitor.- Throws:
NullPointerException- if the passed in monitor is null.
-
currentMonitor
Description copied from interface:ComponentMonitorStrategyReturns the monitor currently used- Specified by:
currentMonitorin interfaceComponentMonitorStrategy- Returns:
- The ComponentMonitor currently used
-
isLazy
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- Parameters:
adapter-- Returns:
- true if lazy, false if not lazy
-