|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.picocontainer.lifecycle.AbstractMonitoringLifecycleStrategy
org.picocontainer.lifecycle.ReflectionLifecycleStrategy
public final class ReflectionLifecycleStrategy
Reflection lifecycle strategy. Starts, stops, disposes of component if appropriate methods are present. The component may implement only one of the three methods.
Startable,
Disposable,
StartableLifecycleStrategy,
Serialized Form| Constructor Summary | |
|---|---|
ReflectionLifecycleStrategy(ComponentMonitor monitor)
Construct a ReflectionLifecycleStrategy. |
|
ReflectionLifecycleStrategy(ComponentMonitor monitor,
String startMethodName,
String stopMethodName,
String disposeMethodName)
Construct a ReflectionLifecycleStrategy with individual method names. |
|
| Method Summary | |
|---|---|
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. The component has a lifecylce if at least one of the three methods is present. |
protected void |
monitorAndThrowReflectionLifecycleException(Method method,
Exception 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. |
| Methods inherited from class org.picocontainer.lifecycle.AbstractMonitoringLifecycleStrategy |
|---|
changeMonitor, currentMonitor |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ReflectionLifecycleStrategy(ComponentMonitor monitor)
monitor - the monitor to use
NullPointerException - if the monitor is null
public 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 method
NullPointerException - if the monitor is null| Method Detail |
|---|
public void start(Object component)
LifecycleStrategy
component - the instance of the component to startpublic void stop(Object component)
LifecycleStrategy
component - the instance of the component to stoppublic void dispose(Object component)
LifecycleStrategy
component - the instance of the component to dispose
protected void monitorAndThrowReflectionLifecycleException(Method method,
Exception e,
Object component)
public boolean hasLifecycle(Class type)
type - the component's type
true if the component has a lifecycle
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||