org.objectweb.perseus.distribution.api
Interface DistResCoordinatorService
- 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).
Serializable | getNodeId() - Returns the id of the local node which can be sent in messages as it
is serializable.
|
void | sendToAllUsers(Object resId, Serializable message) - Asynchronously broadcasts a message to ALL users of a resource.
|
void | sendToUser(Object resId, Serializable message, Object nodeId) - Asynchronously sends a message to ONE user of a resource.
|
void | sendToUsers(Object resId, Serializable message, Set nodeIds) - Asynchronously multicasts a message to A SET OF users of a resource.
|
getNodeId
public Serializable getNodeId()
Returns the id of the local node which can be sent in messages as it
is serializable.
- the id of the local node
sendToAllUsers
public void sendToAllUsers(Object resId,
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.
resId
- the id of the related resourcemessage
- the message to be sent
NotCoordinatorException
-
sendToUser
public void sendToUser(Object resId,
Serializable message,
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.
resId
- the id of the related resourcemessage
- the message to be sentnodeId
- the id of the user node to which the message is to be sent
NotCoordinatorException
-
sendToUsers
public void sendToUsers(Object resId,
Serializable message,
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.
resId
- the id of the related resourcemessage
- the message to be sentnodeIds
- the set of users to which the message is to be sent
NotCoordinatorException
-
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.