Package org.eclipse.net4j.util.lifecycle
Class Lifecycle
java.lang.Object
org.eclipse.net4j.util.event.Notifier
org.eclipse.net4j.util.lifecycle.Lifecycle
- All Implemented Interfaces:
INotifier,INotifier.INotifier2,IDeactivateable,ILifecycle,ILifecycle.DeferrableActivation
- Direct Known Subclasses:
ExecutorWorkSerializer,FiniteStateMachine,LifecycleHook,ManagedContainer,Randomizer,RWLockManager,RWOLockManager,SerializingExecutor,ShareableLifecycle,UserManager,UserManagerAuthenticator,Worker
A default implementation of an entity with a
lifecycle.- Author:
- Eike Stepper
-
Nested Class Summary
Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle
ILifecycle.DeferrableActivationNested classes/interfaces inherited from interface org.eclipse.net4j.util.event.INotifier
INotifier.INotifier2 -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal voidactivate()protected final voidprotected final voidprotected final voidprotected final voidprotected final voidprotected final voidcheckState(boolean expr, String msg) protected final voidcheckState(Object handle, String handleName) final Exceptionprotected final voiddeferredActivate(boolean successful) protected voidprotected voidprotected voidprotected voidprotected voidprotected final voiddump()final LifecycleStatefinal booleanisActive()booleantoString()Methods inherited from class org.eclipse.net4j.util.event.Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListenerMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.eclipse.net4j.util.event.INotifier
addListener, getListeners, hasListeners, removeListener
-
Field Details
-
USE_LABEL
public static boolean USE_LABEL
-
-
Constructor Details
-
Lifecycle
public Lifecycle()- Since:
- 2.0
-
-
Method Details
-
activate
- Specified by:
activatein interfaceILifecycle- Throws:
LifecycleException
-
deactivate
- Specified by:
deactivatein interfaceIDeactivateable- Specified by:
deactivatein interfaceILifecycle
-
getLifecycleState
- Specified by:
getLifecycleStatein interfaceILifecycle- Since:
- 3.0
-
isActive
public final boolean isActive()- Specified by:
isActivein interfaceILifecycle
-
toString
-
dump
protected final void dump() -
checkActive
protected final void checkActive() -
checkInactive
protected final void checkInactive() -
checkNull
- Throws:
NullPointerException
-
checkArg
- Throws:
IllegalArgumentException
-
checkArg
- Throws:
IllegalArgumentException
-
checkState
- Throws:
IllegalStateException
-
checkState
- Throws:
IllegalStateException
-
deferredActivate
protected final void deferredActivate(boolean successful) - Since:
- 2.0
-
isDeferredActivation
public boolean isDeferredActivation()- Specified by:
isDeferredActivationin interfaceILifecycle.DeferrableActivation- Since:
- 3.2
-
doBeforeActivate
- Throws:
Exception
-
doActivate
- Throws:
Exception
-
doAfterActivate
- Throws:
Exception- Since:
- 3.0
-
doBeforeDeactivate
- Throws:
Exception
-
doDeactivate
- Throws:
Exception
-