Top Description Methods
org.osgi.service.coordinator

public Interface Participant

Annotations
@ConsumerType
Imports
org.osgi.annotation.versioning.ConsumerType

A Participant participates in a Coordination.

A Participant can participate in a Coordination by registering itself with the Coordination. After successfully registering itself, the Participant is notified when the Coordination is terminated.

If a Coordination terminates normally, then all registered Participants are notified on their ended(Coordination) method. If the Coordination terminates as a failure, then all registered Participants are notified on their failed(Coordination) method.

Participants are required to be thread safe as notification can be made on any thread.

A Participant can only be registered with a single active Coordination at a time. If a Participant is already registered with an active Coordination, attempts to register the Participation with another active Coordination will block until the Coordination the Participant is registered with terminates. Notice that in edge cases the notification to the Participant that the Coordination has terminated can happen before the registration method returns.

Author
$Id: 7c958674f4263c811c1b24995f6cedee50e75815 $

Method Summary

Modifier and TypeMethod and Description
public void
ended(Coordination
The Coordination that has terminated normally.
coordination
)

Notification that a Coordination has terminated normally.

public void
failed(Coordination
The Coordination that has terminated as a failure.
coordination
)

Notification that a Coordination has terminated as a failure.

Method Detail

endedback to summary
public void ended(Coordination coordination) throws Exception

Notification that a Coordination has terminated normally.

This Participant should finalize any work associated with the specified Coordination.

Parameters
coordination:Coordination

The Coordination that has terminated normally.

Exceptions
Exception:
If this Participant throws an exception, the Coordinator service should log the exception. The Coordination#end() method which is notifying this Participant must continue notification of other registered Participants. When this is completed, the Coordination#end() method must throw a CoordinationException of type CoordinationException#PARTIALLY_ENDED.
failedback to summary
public void failed(Coordination coordination) throws Exception

Notification that a Coordination has terminated as a failure.

This Participant should discard any work associated with the specified Coordination.

Parameters
coordination:Coordination

The Coordination that has terminated as a failure.

Exceptions
Exception:
If this Participant throws an exception, the Coordinator service should log the exception. The Coordination#fail(Throwable) method which is notifying this Participant must continue notification of other registered Participants.