public class ReflectionLifecycleStrategy
extends org.picocontainer.defaults.AbstractMonitoringLifecycleStrategy
Startable
,
Disposable
,
DefaultLifecycleStrategy
,
Serialized FormModifier and Type | Field and Description |
---|---|
private static int |
DISPOSE |
private java.util.Map |
methodMap |
private java.lang.String[] |
methodNames |
private static int |
START |
private static int |
STOP |
Constructor and Description |
---|
ReflectionLifecycleStrategy(org.picocontainer.ComponentMonitor monitor)
Construct a ReflectionLifecycleStrategy.
|
ReflectionLifecycleStrategy(org.picocontainer.ComponentMonitor monitor,
java.lang.String startMethodName,
java.lang.String stopMethodName,
java.lang.String disposeMethodName)
Construct a ReflectionLifecycleStrategy with individual method names.
|
Modifier and Type | Method and Description |
---|---|
void |
dispose(java.lang.Object component) |
boolean |
hasLifecycle(java.lang.Class type)
The component has a lifecylce if at least one of the three methods is present.
|
private java.lang.reflect.Method[] |
init(java.lang.Class type) |
private void |
invokeMethod(java.lang.Object component,
java.lang.reflect.Method method) |
void |
start(java.lang.Object component) |
void |
stop(java.lang.Object component) |
private static final int START
private static final int STOP
private static final int DISPOSE
private java.lang.String[] methodNames
private final transient java.util.Map methodMap
public ReflectionLifecycleStrategy(org.picocontainer.ComponentMonitor monitor)
monitor
- the monitor to usejava.lang.NullPointerException
- if the monitor is null
public ReflectionLifecycleStrategy(org.picocontainer.ComponentMonitor monitor, java.lang.String startMethodName, java.lang.String stopMethodName, java.lang.String disposeMethodName)
monitor
- the monitor to usestartMethodName
- the name of the start methodstopMethodName
- the name of the stop methoddisposeMethodName
- the name of the dispose methodjava.lang.NullPointerException
- if the monitor is null
public void start(java.lang.Object component)
public void stop(java.lang.Object component)
public void dispose(java.lang.Object component)
private void invokeMethod(java.lang.Object component, java.lang.reflect.Method method)
public boolean hasLifecycle(java.lang.Class type)
private java.lang.reflect.Method[] init(java.lang.Class type)