public class ReflectionLifecycleStrategy extends AbstractMonitoringLifecycleStrategy
Startable,
Disposable,
StartableLifecycleStrategy,
Serialized Form| Constructor and Description |
|---|
ReflectionLifecycleStrategy(ComponentMonitor monitor)
Construct a ReflectionLifecycleStrategy.
|
ReflectionLifecycleStrategy(ComponentMonitor monitor,
String startMethodName,
String stopMethodName,
String disposeMethodName)
Construct a ReflectionLifecycleStrategy with individual method names.
|
| Modifier and Type | Method and Description |
|---|---|
void |
dispose(Object component)
Invoke the "dispose" method on the component instance if this is disposable.
|
boolean |
hasLifecycle(Class<?> type)
Test if a component instance has a lifecycle.
|
protected void |
monitorAndThrowReflectionLifecycleException(Method method,
Throwable e,
Object component) |
void |
start(Object component)
Invoke the "start" method on the component instance if this is startable.
|
void |
stop(Object component)
Invoke the "stop" method on the component instance if this is stoppable.
|
changeMonitor, currentMonitor, isLazypublic ReflectionLifecycleStrategy(ComponentMonitor monitor)
monitor - the monitor to useNullPointerException - if the monitor is nullpublic ReflectionLifecycleStrategy(ComponentMonitor monitor, String startMethodName, String stopMethodName, String disposeMethodName)
monitor - the monitor to usestartMethodName - the name of the start methodstopMethodName - the name of the stop methoddisposeMethodName - the name of the dispose methodNullPointerException - if the monitor is nullpublic void start(Object component)
component - the instance of the component to startpublic void stop(Object component)
component - the instance of the component to stoppublic void dispose(Object component)
component - the instance of the component to disposeprotected void monitorAndThrowReflectionLifecycleException(Method method, Throwable e, Object component)
public boolean hasLifecycle(Class<?> type)
type - the component's typetrue if the component has a lifecycleCopyright © 2003-2014 Codehaus. All Rights Reserved.