final class BeanLifecycle
extends java.lang.Object
implements java.security.PrivilegedAction<java.lang.Void>
Modifier and Type | Field and Description |
---|---|
private static java.lang.reflect.Method[] |
NO_METHODS |
(package private) static BeanLifecycle |
NO_OP |
private java.lang.reflect.Method[] |
startMethods |
private java.lang.reflect.Method[] |
stopMethods |
Constructor and Description |
---|
BeanLifecycle(java.util.List<java.lang.reflect.Method> startMethods,
java.util.List<java.lang.reflect.Method> stopMethods)
Creates a new lifecycle based on the given start and stop methods.
|
Modifier and Type | Method and Description |
---|---|
boolean |
isStartable() |
boolean |
isStoppable() |
java.lang.Void |
run() |
void |
start(java.lang.Object bean)
Starts the given bean by invoking the methods defined in this lifecycle.
|
void |
stop(java.lang.Object bean)
Stops the given bean by invoking the methods defined in this lifecycle.
|
private static java.lang.reflect.Method[] |
toArray(java.util.List<java.lang.reflect.Method> methods) |
private static final java.lang.reflect.Method[] NO_METHODS
static final BeanLifecycle NO_OP
private final java.lang.reflect.Method[] startMethods
private final java.lang.reflect.Method[] stopMethods
BeanLifecycle(java.util.List<java.lang.reflect.Method> startMethods, java.util.List<java.lang.reflect.Method> stopMethods)
startMethods
- The methods used to start the bean; from subclass to superclassstopMethods
- The methods used to stop the bean; from subclass to superclasspublic boolean isStartable()
true
if this lifecycle can be started; otherwise false
public boolean isStoppable()
true
if this lifecycle can be stopped; otherwise false
public void start(java.lang.Object bean)
bean
- The bean to startpublic void stop(java.lang.Object bean)
bean
- The bean to stoppublic java.lang.Void run()
run
in interface java.security.PrivilegedAction<java.lang.Void>
private static java.lang.reflect.Method[] toArray(java.util.List<java.lang.reflect.Method> methods)