Package org.eclipse.sisu.bean
Class BeanLifecycle
java.lang.Object
org.eclipse.sisu.bean.BeanLifecycle
- All Implemented Interfaces:
PrivilegedAction<Void>
Represents the JSR250 lifecycle for a particular bean type.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final Method[]
(package private) static final BeanLifecycle
private final Method[]
private final Method[]
-
Constructor Summary
ConstructorsConstructorDescriptionBeanLifecycle
(List<Method> startMethods, List<Method> stopMethods) Creates a new lifecycle based on the given start and stop methods. -
Method Summary
-
Field Details
-
NO_METHODS
-
NO_OP
-
startMethods
-
stopMethods
-
-
Constructor Details
-
BeanLifecycle
Creates a new lifecycle based on the given start and stop methods.- Parameters:
startMethods
- The methods used to start the bean; from subclass to superclassstopMethods
- The methods used to stop the bean; from subclass to superclass
-
-
Method Details
-
isStartable
public boolean isStartable()- Returns:
true
if this lifecycle can be started; otherwisefalse
-
isStoppable
public boolean isStoppable()- Returns:
true
if this lifecycle can be stopped; otherwisefalse
-
start
Starts the given bean by invoking the methods defined in this lifecycle.- Parameters:
bean
- The bean to start
-
stop
Stops the given bean by invoking the methods defined in this lifecycle.- Parameters:
bean
- The bean to stop
-
run
- Specified by:
run
in interfacePrivilegedAction<Void>
-
toArray
-