CoordinationException
Date: 2016-06-25

org.osgi.service.coordinator

## Class CoordinationException

- java.lang.Object
- - java.lang.Throwable
  - - java.lang.Exception
    - - java.lang.RuntimeException
      - - org.osgi.service.coordinator.CoordinationException

- All Implemented Interfaces:
    java.io.Serializable

      public class CoordinationException
      extends java.lang.RuntimeException

  Unchecked exception which may be thrown by a Coordinator implementation.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static int` | `ALREADY_ENDED` The Coordination has already terminated normally.
    `static int` | `ALREADY_PUSHED` The Coordination was already on a thread's thread local Coordination stack.
    `static int` | `DEADLOCK_DETECTED` Registering a Participant with a Coordination would have resulted in a deadlock.
    `static int` | `FAILED` The Coordination has terminated as a failure with `Coordination.fail(Throwable)`.
    `static int` | `LOCK_INTERRUPTED` The current thread was interrupted while waiting to register a Participant with a Coordination.
    `static int` | `PARTIALLY_ENDED` The Coordination has partially ended.
    `static int` | `UNKNOWN` Unknown reason for this exception.
    `static int` | `WRONG_THREAD` The Coordination cannot be ended by the calling thread since the Coordination is on the thread local Coordination stack of another thread.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `CoordinationException(java.lang.String message, Coordination coordination, int type)` Create a new Coordination Exception.
    `CoordinationException(java.lang.String message, Coordination coordination, int type, java.lang.Throwable cause)` Create a new Coordination Exception with a cause.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `long` | `getId()` Returns the id of the `Coordination` associated with this exception.
    `java.lang.String` | `getName()` Returns the name of the `Coordination` associated with this exception.
    `int` | `getType()` Returns the type for this exception.

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

      `addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString`

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

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

- - ### Field Detail

    - #### UNKNOWN

          public static final int UNKNOWN

      Unknown reason for this exception.
      See Also:
        Constant Field Values

    - #### DEADLOCK_DETECTED

          public static final int DEADLOCK_DETECTED

      Registering a Participant with a Coordination would have resulted in a deadlock.
      See Also:
        Constant Field Values

    - #### FAILED

          public static final int FAILED

      The Coordination has terminated as a failure with `Coordination.fail(Throwable)`. When this exception type is used, the `Throwable.getCause()` method must return a non-null value.
      See Also:
        Constant Field Values

    - #### PARTIALLY_ENDED

          public static final int PARTIALLY_ENDED

      The Coordination has partially ended.
      See Also:
        Constant Field Values

    - #### ALREADY_ENDED

          public static final int ALREADY_ENDED

      The Coordination has already terminated normally.
      See Also:
        Constant Field Values

    - #### ALREADY_PUSHED

          public static final int ALREADY_PUSHED

      The Coordination was already on a thread's thread local Coordination stack.
      See Also:
        Constant Field Values

    - #### LOCK_INTERRUPTED

          public static final int LOCK_INTERRUPTED

      The current thread was interrupted while waiting to register a Participant with a Coordination.
      See Also:
        Constant Field Values

    - #### WRONG_THREAD

          public static final int WRONG_THREAD

      The Coordination cannot be ended by the calling thread since the Coordination is on the thread local Coordination stack of another thread.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### CoordinationException

          public CoordinationException(java.lang.String message,
                               Coordination coordination,
                               int type,
                               java.lang.Throwable cause)

      Create a new Coordination Exception with a cause.
      Parameters:
        `message` - The detail message for this exception.
        `coordination` - The Coordination associated with this exception.
        `cause` - The cause associated with this exception.
        `type` - The type of this exception.
      Throws:
        `java.lang.IllegalArgumentException` - If the specified type is `FAILED` and the specified cause is `null`.

    - #### CoordinationException

          public CoordinationException(java.lang.String message,
                               Coordination coordination,
                               int type)

      Create a new Coordination Exception.
      Parameters:
        `message` - The detail message for this exception.
        `coordination` - The Coordination associated with this exception.
        `type` - The type of this exception.
      Throws:
        `java.lang.IllegalArgumentException` - If the specified type is `FAILED` .

  - ### Method Detail

    - #### getName

          public java.lang.String getName()

      Returns the name of the `Coordination` associated with this exception.
      Returns:
        The name of the Coordination associated with this exception or `"<>"` if no Coordination is associated with this exception.

    - #### getType

          public int getType()

      Returns the type for this exception.
      Returns:
        The type of this exception.

    - #### getId

          public long getId()

      Returns the id of the `Coordination` associated with this exception.
      Returns:
        The id of the Coordination associated with this exception or `-1` if no Coordination is associated with this exception.