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, IDeactivateable, ILifecycle, ILifecycle.DeferrableActivation
  Direct Known Subclasses:
    ExecutorWorkSerializer, FiniteStateMachine, LifecycleHook, ManagedContainer, Randomizer, RWLockManager, RWOLockManager, ShareableLifecycle, UserManager, UserManagerAuthenticator, Worker

      public class Lifecycle
      extends Notifier
      implements ILifecycle, ILifecycle.DeferrableActivation

  A default implementation of an entity with a `lifecycle`.
  Author:
    Eike Stepper
  Apiviz

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.eclipse.net4j.util.lifecycle.ILifecycle

      `ILifecycle.DeferrableActivation`

  - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static boolean` | `USE_LABEL`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `Lifecycle()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `activate()`
    `protected void` | `checkActive()`
    `protected void` | `checkArg(boolean expr, java.lang.String msg)`
    `protected void` | `checkArg(java.lang.Object handle, java.lang.String handleName)`
    `protected void` | `checkInactive()`
    `protected void` | `checkNull(java.lang.Object handle, java.lang.String msg)`
    `protected void` | `checkState(boolean expr, java.lang.String msg)`
    `protected void` | `checkState(java.lang.Object handle, java.lang.String handleName)`
    `java.lang.Exception` | `deactivate()`
    `protected void` | `deferredActivate(boolean successful)`
    `protected void` | `doActivate()`
    `protected void` | `doAfterActivate()`
    `protected void` | `doBeforeActivate()`
    `protected void` | `doBeforeDeactivate()`
    `protected void` | `doDeactivate()`
    `protected void` | `dump()`
    `LifecycleState` | `getLifecycleState()`
    `boolean` | `isActive()`
    `boolean` | `isDeferredActivation()`
    `java.lang.String` | `toString()`

    - ### Methods inherited from class org.eclipse.net4j.util.event.Notifier

      `addListener, fireEvent, fireEvent, fireEvent, fireThrowable, firstListenerAdded, getListeners, getNotificationService, hasListeners, lastListenerRemoved, removeListener`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

    - ### Methods inherited from interface org.eclipse.net4j.util.event.INotifier

      `addListener, getListeners, hasListeners, removeListener`

- - ### Field Detail

    - #### USE_LABEL

          public static boolean USE_LABEL

  - ### Constructor Detail

    - #### Lifecycle

          public Lifecycle()

      Since:
        2.0

  - ### Method Detail

    - #### activate

          public final void activate()
                              throws LifecycleException

      Specified by:
        `activate` in interface `ILifecycle`
      Throws:
        `LifecycleException`

    - #### deactivate

          public final java.lang.Exception deactivate()

      Specified by:
        `deactivate` in interface `IDeactivateable`
      Specified by:
        `deactivate` in interface `ILifecycle`

    - #### getLifecycleState

          public final LifecycleState getLifecycleState()

      Specified by:
        `getLifecycleState` in interface `ILifecycle`
      Since:
        3.0

    - #### isActive

          public final boolean isActive()

      Specified by:
        `isActive` in interface `ILifecycle`

    - #### toString

          public java.lang.String toString()

      Overrides:
        `toString` in class `java.lang.Object`

    - #### dump

          protected final void dump()

    - #### checkActive

          protected final void checkActive()

    - #### checkInactive

          protected final void checkInactive()

    - #### checkNull

          protected final void checkNull(java.lang.Object handle,
                                         java.lang.String msg)
                                  throws java.lang.NullPointerException

      Throws:
        `java.lang.NullPointerException`

    - #### checkArg

          protected final void checkArg(boolean expr,
                                        java.lang.String msg)
                                 throws java.lang.IllegalArgumentException

      Throws:
        `java.lang.IllegalArgumentException`

    - #### checkArg

          protected final void checkArg(java.lang.Object handle,
                                        java.lang.String handleName)
                                 throws java.lang.IllegalArgumentException

      Throws:
        `java.lang.IllegalArgumentException`

    - #### checkState

          protected final void checkState(boolean expr,
                                          java.lang.String msg)
                                   throws java.lang.IllegalStateException

      Throws:
        `java.lang.IllegalStateException`

    - #### checkState

          protected final void checkState(java.lang.Object handle,
                                          java.lang.String handleName)
                                   throws java.lang.IllegalStateException

      Throws:
        `java.lang.IllegalStateException`

    - #### deferredActivate

          protected final void deferredActivate(boolean successful)

      Since:
        2.0

    - #### isDeferredActivation

          public boolean isDeferredActivation()

      Specified by:
        `isDeferredActivation` in interface `ILifecycle.DeferrableActivation`
      Since:
        3.2

    - #### doBeforeActivate

          protected void doBeforeActivate()
                                   throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### doActivate

          protected void doActivate()
                             throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### doAfterActivate

          protected void doAfterActivate()
                                  throws java.lang.Exception

      Throws:
        `java.lang.Exception`
      Since:
        3.0

    - #### doBeforeDeactivate

          protected void doBeforeDeactivate()
                                     throws java.lang.Exception

      Throws:
        `java.lang.Exception`

    - #### doDeactivate

          protected void doDeactivate()
                               throws java.lang.Exception

      Throws:
        `java.lang.Exception`

Copyright (c) 2014 Eike Stepper (Berlin, Germany) and others.
All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html