org.picocontainer.gems.lifecycle
Class ReflectionLifecycleStrategy
java.lang.Object
org.picocontainer.defaults.AbstractMonitoringLifecycleStrategy
org.picocontainer.gems.lifecycle.ReflectionLifecycleStrategy
- All Implemented Interfaces:
- org.picocontainer.defaults.ComponentMonitorStrategy, org.picocontainer.defaults.LifecycleStrategy, Serializable
- public class ReflectionLifecycleStrategy
- extends org.picocontainer.defaults.AbstractMonitoringLifecycleStrategy
Reflection lifecycle strategy. Starts, stops, disposes of component if appropriate methods are
present. The component may implement only one of the three methods.
- Since:
- 1.2
- Author:
- Paul Hammant, Mauro Talevi, Jörg Schaible
- See Also:
Startable
,
Disposable
,
DefaultLifecycleStrategy
,
Serialized Form
Methods inherited from class org.picocontainer.defaults.AbstractMonitoringLifecycleStrategy |
changeMonitor, currentMonitor |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ReflectionLifecycleStrategy
public ReflectionLifecycleStrategy(org.picocontainer.ComponentMonitor monitor)
- Construct a ReflectionLifecycleStrategy.
- Parameters:
monitor
- the monitor to use
- Throws:
NullPointerException
- if the monitor is null
ReflectionLifecycleStrategy
public ReflectionLifecycleStrategy(org.picocontainer.ComponentMonitor monitor,
String startMethodName,
String stopMethodName,
String disposeMethodName)
- Construct a ReflectionLifecycleStrategy with individual method names. Note, that a lifecycle
method does not have any arguments.
- Parameters:
monitor
- the monitor to usestartMethodName
- the name of the start methodstopMethodName
- the name of the stop methoddisposeMethodName
- the name of the dispose method
- Throws:
NullPointerException
- if the monitor is null
start
public void start(Object component)
stop
public void stop(Object component)
dispose
public void dispose(Object component)
hasLifecycle
public boolean hasLifecycle(Class type)
- The component has a lifecylce if at least one of the three methods is present.
Copyright © 2003-2007 Codehaus. All Rights Reserved.