org.objectweb.perseus.distribution.api
Interface DistResCoordinatorService

All Known Implementing Classes:
JGroupsCoordinatorService

public interface DistResCoordinatorService

This is the coordinator side interface of the distributed resource service. A coordinator must use this interface to exchange messages with users. Note that the coordinator should only send messages in response to user requests and not in an autonomous manner. Not respecting this rule could prevent coordination migrations and replications from terminating. This is because messages may need to be flushed so as to preserve a FIFO delivery order (see the JGroups implementation for example).


Method Summary
 java.io.Serializable getNodeId()
          Returns the id of the local node which can be sent in messages as it is serializable.
 void sendToAllUsers(java.lang.Object resId, java.io.Serializable message)
          Asynchronously broadcasts a message to ALL users of a resource.
 void sendToUser(java.lang.Object resId, java.io.Serializable message, java.lang.Object nodeId)
          Asynchronously sends a message to ONE user of a resource.
 void sendToUsers(java.lang.Object resId, java.io.Serializable message, java.util.Set nodeIds)
          Asynchronously multicasts a message to A SET OF users of a resource.
 

Method Detail

sendToAllUsers

public void sendToAllUsers(java.lang.Object resId,
                           java.io.Serializable message)
                    throws NotCoordinatorException
Asynchronously broadcasts a message to ALL users of a resource. A FIFO delivery is guaranteed for each resource, that is, the receive method of the coordinator(s) will be called in the same order that the call to this method with the same resource id.

Parameters:
resId - the id of the related resource
message - the message to be sent
Throws:
NotCoordinatorException

sendToUser

public void sendToUser(java.lang.Object resId,
                       java.io.Serializable message,
                       java.lang.Object nodeId)
                throws NotCoordinatorException
Asynchronously sends a message to ONE user of a resource. A FIFO delivery is guaranteed for each resource, that is, the receive method of the coordinator(s) will be called in the same order that the call to this method with the same resource id.

Parameters:
resId - the id of the related resource
message - the message to be sent
nodeId - the id of the user node to which the message is to be sent
Throws:
NotCoordinatorException

sendToUsers

public void sendToUsers(java.lang.Object resId,
                        java.io.Serializable message,
                        java.util.Set nodeIds)
                 throws NotCoordinatorException
Asynchronously multicasts a message to A SET OF users of a resource. A FIFO delivery is guaranteed for each resource, that is, the receive method of the coordinator(s) will be called in the same order that the call to this method with the same resource id.

Parameters:
resId - the id of the related resource
message - the message to be sent
nodeIds - the set of users to which the message is to be sent
Throws:
NotCoordinatorException

getNodeId

public java.io.Serializable getNodeId()
Returns the id of the local node which can be sent in messages as it is serializable.

Returns:
the id of the local node


Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.