org.eclipse.net4j.util.lifecycle

## Class LifecycleUtil

- java.lang.Object
- - org.eclipse.net4j.util.lifecycle.LifecycleUtil

-     public final class LifecycleUtil
      extends java.lang.Object

  Various static helper methods for dealing with `lifecycles`.
  Author:
    Eike Stepper

- - ### Nested Class Summary

    Nested Classes
    Modifier and Type | Class and Description
    --- | ---
    `static interface` | `LifecycleUtil.Activator` Annotates a method of a POJO class that's supposed to be called to activate a POJO object during `activate(Object)`.
    `static interface` | `LifecycleUtil.Deactivator` Annotates a method of a POJO class that's supposed to be called to deactivate a POJO object during `deactivate(Object)`.
    `static class` | `LifecycleUtil.Delegator<T>` The `invocation handler` of the `dynamic proxy` created in `LifecycleUtil.delegateLifecycle()`.

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `activate(java.lang.Object object)`
    `static void` | `activate(java.lang.Object object, boolean useAnnotation)`
    `static java.lang.Exception` | `activateSilent(java.lang.Object object)`
    `static java.lang.Exception` | `activateSilent(java.lang.Object object, boolean useAnnotation)`
    `static void` | `checkActive(java.lang.Object object)`
    `static void` | `checkInactive(java.lang.Object object)`
    `static java.lang.Exception` | `deactivate(java.lang.Object object)`
    `static java.lang.Exception` | `deactivate(java.lang.Object object, boolean useAnnotation)`
    `static void` | `deactivate(java.lang.Object object, OMLogger.Level logLevel)`
    `static void` | `deactivateNoisy(java.lang.Object object)`
    `static void` | `deactivateNoisy(java.lang.Object object, boolean useAnnotation)`
    `static <T> T` | `delegateLifecycle(java.lang.ClassLoader loader, T pojo, java.lang.Class<?> pojoInterface, ILifecycle delegate)`
    `static <T> T` | `delegateLifecycle(java.lang.ClassLoader loader, T pojo, ILifecycle delegate)`
    `static LifecycleState` | `getLifecycleState(java.lang.Object object)`
    `static int` | `getRefCount(java.lang.Object object)`
    `static boolean` | `isActive(java.lang.Object object)`
    `static boolean` | `isDeferredActivation(java.lang.Object object)`
    `static boolean` | `waitFor(java.lang.Object object, long millis, LifecycleState state)`
    `static boolean` | `waitForActive(java.lang.Object object, long millis)`
    `static boolean` | `waitForInactive(java.lang.Object object, long millis)`

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

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

- - ### Method Detail

    - #### getRefCount

          public static int getRefCount(java.lang.Object object)

      Since:
        3.5

    - #### getLifecycleState

          public static LifecycleState getLifecycleState(java.lang.Object object)

      Since:
        3.0

    - #### isDeferredActivation

          public static boolean isDeferredActivation(java.lang.Object object)

      Since:
        3.2

    - #### isActive

          public static boolean isActive(java.lang.Object object)

    - #### checkActive

          public static void checkActive(java.lang.Object object)
                                  throws LifecycleException

      Throws:
        `LifecycleException`
      Since:
        2.0

    - #### checkInactive

          public static void checkInactive(java.lang.Object object)
                                    throws LifecycleException

      Throws:
        `LifecycleException`
      Since:
        2.0

    - #### activate

          public static void activate(java.lang.Object object)
                               throws LifecycleException

      Throws:
        `LifecycleException`

    - #### activate

          public static void activate(java.lang.Object object,
                                      boolean useAnnotation)
                               throws LifecycleException

      Throws:
        `LifecycleException`
      See Also:
        `LifecycleUtil.Activator`

    - #### activateSilent

          public static java.lang.Exception activateSilent(java.lang.Object object)

    - #### activateSilent

          public static java.lang.Exception activateSilent(java.lang.Object object,
                                                           boolean useAnnotation)

      See Also:
        `LifecycleUtil.Activator`

    - #### waitForActive

          public static boolean waitForActive(java.lang.Object object,
                                              long millis)

    - #### waitForInactive

          public static boolean waitForInactive(java.lang.Object object,
                                                long millis)

      Since:
        3.1

    - #### waitFor

          public static boolean waitFor(java.lang.Object object,
                                        long millis,
                                        LifecycleState state)

      Since:
        3.1

    - #### deactivate

          public static java.lang.Exception deactivate(java.lang.Object object)

    - #### deactivate

          public static java.lang.Exception deactivate(java.lang.Object object,
                                                       boolean useAnnotation)

      See Also:
        `LifecycleUtil.Deactivator`

    - #### deactivate

          public static void deactivate(java.lang.Object object,
                                        OMLogger.Level logLevel)

      Since:
        2.0

    - #### deactivateNoisy

          public static void deactivateNoisy(java.lang.Object object)
                                      throws LifecycleException

      Throws:
        `LifecycleException`

    - #### deactivateNoisy

          public static void deactivateNoisy(java.lang.Object object,
                                             boolean useAnnotation)
                                      throws LifecycleException

      Throws:
        `LifecycleException`

    - #### delegateLifecycle

          public static <T> T delegateLifecycle(java.lang.ClassLoader loader,
                                                T pojo,
                                                java.lang.Class<?> pojoInterface,
                                                ILifecycle delegate)

      Since:
        2.0

    - #### delegateLifecycle

          public static <T> T delegateLifecycle(java.lang.ClassLoader loader,
                                                T pojo,
                                                ILifecycle delegate)

      Since:
        2.0

Copyright (c) 2004-2019 Eike Stepper (Loehne, 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