Top Description Fields Constructors Methods
org.osgi.service.coordinator

public Class CoordinationException

extends RuntimeException
Class Inheritance

Unchecked exception which may be thrown by a Coordinator implementation.
Author
$Id: cb7e25af0ab76e8956d6544c670edadf3e8cdc01 $

Field Summary

Modifier and TypeField and Description
public static final int
ALREADY_ENDED

The Coordination has already terminated normally.

public static final int
ALREADY_PUSHED

The Coordination was already on a thread's thread local Coordination stack.

public static final int
DEADLOCK_DETECTED

Registering a Participant with a Coordination would have resulted in a deadlock.

public static final int
FAILED

The Coordination has terminated as a failure with Coordination#fail(Throwable).

private final long
public static final int
LOCK_INTERRUPTED

The current thread was interrupted while waiting to register a Participant with a Coordination.

private final String
public static final int
PARTIALLY_ENDED

The Coordination has partially ended.

private static final long
private final int
public static final int
UNKNOWN

Unknown reason for this exception.

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.

Constructor Summary

AccessConstructor and Description
public
CoordinationException(String
The detail message for this exception.
message
,
Coordination
The Coordination associated with this exception.
coordination
,
int
The type of this exception.
type
,
Throwable
The cause associated with this exception.
cause
)

Create a new Coordination Exception with a cause.

public
CoordinationException(String
The detail message for this exception.
message
,
Coordination
The Coordination associated with this exception.
coordination
,
int
The type of this exception.
type
)

Create a new Coordination Exception.

Method Summary

Modifier and TypeMethod and Description
public long

Returns:

The id of the Coordination associated with this exception or -1 if no Coordination is associated with this exception.
getId
()

Returns the id of the Coordination associated with this exception.

public String

Returns:

The name of the Coordination associated with this exception or "<>" if no Coordination is associated with this exception.
getName
()

Returns the name of the Coordination associated with this exception.

public int

Returns:

The type of this exception.
getType
()

Returns the type for this exception.

Field Detail

ALREADY_ENDEDback to summary
public static final int ALREADY_ENDED

The Coordination has already terminated normally.

ALREADY_PUSHEDback to summary
public static final int ALREADY_PUSHED

The Coordination was already on a thread's thread local Coordination stack.

DEADLOCK_DETECTEDback to summary
public static final int DEADLOCK_DETECTED

Registering a Participant with a Coordination would have resulted in a deadlock.

FAILEDback to summary
public static final int FAILED

The Coordination has terminated as a failure with Coordination#fail(Throwable). When this exception type is used, the getCause() method must return a non-null value.

idback to summary
private final long id
LOCK_INTERRUPTEDback to summary
public static final int LOCK_INTERRUPTED

The current thread was interrupted while waiting to register a Participant with a Coordination.

nameback to summary
private final String name
PARTIALLY_ENDEDback to summary
public static final int PARTIALLY_ENDED

The Coordination has partially ended.

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.RuntimeException.serialVersionUID.

typeback to summary
private final int type
UNKNOWNback to summary
public static final int UNKNOWN

Unknown reason for this exception.

WRONG_THREADback to summary
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.

Constructor Detail

CoordinationExceptionback to summary
public CoordinationException(String message, Coordination coordination, int type, Throwable cause)

Create a new Coordination Exception with a cause.

Parameters
message:String

The detail message for this exception.

coordination:Coordination

The Coordination associated with this exception.

type:int

The type of this exception.

cause:Throwable

The cause associated with this exception.

Exceptions
IllegalArgumentException:
If the specified type is FAILED and the specified cause is null.
CoordinationExceptionback to summary
public CoordinationException(String message, Coordination coordination, int type)

Create a new Coordination Exception.

Parameters
message:String

The detail message for this exception.

coordination:Coordination

The Coordination associated with this exception.

type:int

The type of this exception.

Exceptions
IllegalArgumentException:
If the specified type is FAILED .

Method Detail

getIdback to summary
public long getId()

Returns the id of the Coordination associated with this exception.

Returns:long

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

getNameback to summary
public String getName()

Returns the name of the Coordination associated with this exception.

Returns:String

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

getTypeback to summary
public int getType()

Returns the type for this exception.

Returns:int

The type of this exception.