public class LifecycleManager
extends java.lang.Object
implements java.io.Closeable
| Constructor and Description |
|---|
LifecycleManager() |
LifecycleManager(LifecycleManagerArguments arguments) |
LifecycleManager(LifecycleManagerArguments arguments,
com.google.inject.Injector injector) |
| Modifier and Type | Method and Description |
|---|---|
void |
add(java.lang.Object... objects)
Add the objects to the container.
|
void |
add(java.lang.Object obj)
Add the object to the container.
|
void |
add(java.lang.Object obj,
LifecycleMethods methods)
Add the object to the container.
|
void |
close() |
DAGManager |
getDAGManager() |
java.util.Collection<LifecycleListener> |
getListeners()
Return the lifecycle listener if any
|
LifecycleState |
getState(java.lang.Object obj)
Return the current state of the given object or LATENT if unknown
|
boolean |
hasStarted()
Returns true if the lifecycle has started (i.e.
|
void |
start()
The manager MUST be started.
|
boolean |
start(long maxWait,
java.util.concurrent.TimeUnit unit)
The manager MUST be started.
|
void |
validate()
Run the validations on the managed objects.
|
void |
validate(java.lang.Object obj)
Run validations on the given object
|
public LifecycleManager()
public LifecycleManager(LifecycleManagerArguments arguments)
@Inject public LifecycleManager(LifecycleManagerArguments arguments, com.google.inject.Injector injector)
public java.util.Collection<LifecycleListener> getListeners()
public void add(java.lang.Object... objects)
throws java.lang.Exception
objects - objects to addjava.lang.Exception - errorspublic void add(java.lang.Object obj)
throws java.lang.Exception
obj - object to addjava.lang.Exception - errorspublic void add(java.lang.Object obj,
LifecycleMethods methods)
throws java.lang.Exception
obj - object to addmethods - calculated lifecycle methodsjava.lang.Exception - errorspublic boolean hasStarted()
start() has been called).public LifecycleState getState(java.lang.Object obj)
obj - object to checkpublic void start()
throws java.lang.Exception
java.lang.Exception - errorspublic boolean start(long maxWait,
java.util.concurrent.TimeUnit unit)
throws java.lang.Exception
maxWait - maximum wait time for warm up methods - if the time elapses, the warm up methods are interruptedunit - time unitjava.lang.Exception - errorspublic void close()
close in interface java.io.Closeableclose in interface java.lang.AutoCloseablepublic void validate()
throws ValidationException
start() is called.
But you can call this at any time you need.ValidationExceptionpublic void validate(java.lang.Object obj)
throws ValidationException
obj - the object to validateValidationExceptionpublic DAGManager getDAGManager()