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:
org.eclipse.net4j.internal.util.bundle.AbstractManagedContainer, ExecutorWorkSerializer, FiniteStateMachine, LifecycleHook, 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 class Notifier
Notifier.CancelationNested classes/interfaces inherited from interface ILifecycle
ILifecycle.DeferrableActivationNested classes/interfaces inherited from interface 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 voidCancels an activation that is still waiting for an asynchronous completion.protected voidprotected final voiddump()final LifecycleStatefinal booleanisActive()booleantoString()Methods inherited from class Notifier
addListener, addUniqueListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListener, hasListeners, lastListenerRemoved, listenerAdded, listenerRemoved, removeListenerMethods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface 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
-
isDeferredActivation
public boolean isDeferredActivation()- Specified by:
isDeferredActivationin interfaceILifecycle.DeferrableActivation- Since:
- 3.2
-
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
-
doBeforeActivate
-
doActivate
-
doAfterActivate
-
doCancelActivation
protected void doCancelActivation()Cancels an activation that is still waiting for an asynchronous completion. This hook is called by deactivation while the lifecycle state isLifecycleState.ACTIVATING; implementations can stop the pending operation and calldeferredActivate(boolean)withfalseto release the activation semaphore exactly once. If activation has already completed when this hook returns, normal deactivation continues. The default implementation leaves cancellation to the activation owner.- Since:
- 3.31
-
doBeforeDeactivate
-
doDeactivate
-