com.wiley.posa3.coordinator
Interface Coordinator

All Known Implementing Classes:
SWCoordinator

public interface Coordinator

Coordinator interface provides the means for a client to begin or terminate a task. In addition, it allows participants of the task to register.

Version:
1.0
Author:
Michael Kircher, Prashant Jain

Method Summary
 void beginTask()
          The beginTask() method is used by the client to define the beginning of a task.
 boolean commitTask()
          The commitTask() method is executed by the client once all the participants have registered.
 void register(Coordination participant)
          The register() method is used by the participants to register themselves with the coordinator once a task has begun.
 

Method Detail

register

public void register(Coordination participant)
The register() method is used by the participants to register themselves with the coordinator once a task has begun.

Parameters:
participant - the participant that needs to be registered and whose task needs to be coordinated

beginTask

public void beginTask()
The beginTask() method is used by the client to define the beginning of a task. At this point the coordinator does not do anything.


commitTask

public boolean commitTask()
The commitTask() method is executed by the client once all the participants have registered. This serves as an indicator of two things to the coordinator: Firstly, that all participants of the task have registered, and secondly, that the coordinator can begin coordinating the execution of the task by the participants. The coordinator now uses the two-phase commit protocol defined by Coordination interface to ensure that the participants complete the task.

Returns:
boolean the result of committing the task


Copyright 2004 John Wiley and Sons. All Rights Reserved.