org.objectweb.perseus.distribution.api
Interface DistResCoordinator


public interface DistResCoordinator


Method Summary
 java.io.Serializable freeze(java.lang.Object resId)
          This method is called during a coordination migration or replication.
 boolean joinUsersRequest(java.lang.Object resId, java.io.Serializable nodeId)
          This method is called whenever a node wants to becomes user of a recource.
 void nodeFailed(java.lang.Object resId, java.io.Serializable nodeId)
           
 void receive(java.lang.Object resId, java.io.Serializable nodeId, java.io.Serializable msg)
          This method is called when a message is received from a user of a resource
 void recover(java.lang.Object resId, java.util.Map userStates)
           
 

Method Detail

receive

public void receive(java.lang.Object resId,
                    java.io.Serializable nodeId,
                    java.io.Serializable msg)
This method is called when a message is received from a user of a resource

Parameters:
resId - the id of the related resource
nodeId - the id of the node using this resource
msg - the sent message

freeze

public java.io.Serializable freeze(java.lang.Object resId)
This method is called during a coordination migration or replication. The coordinator must freeze everything and return the state that must be used to initialized the new coordinator. Note that the state must reflect all messages that have been received and sent by this coordinator. Using this state, the new coordinator must be able to construct a new state (or modify its own state) so that it would be equal to the state that it would have provided it had received and sent the exactly the same messages that the local one. Note also that the service guarantees FIFO order of communication w/ a coordinator even if it is migrated

Parameters:
resId -
Returns:
the state to send to the new coordinator

joinUsersRequest

public boolean joinUsersRequest(java.lang.Object resId,
                                java.io.Serializable nodeId)
This method is called whenever a node wants to becomes user of a recource. The coordinator instance can accept or reject the request. The request is finally accepted only if all coordinators have accepted it.

Parameters:
resId - the id of the related resource
nodeId - the id of the node that wants to become a user of this resource
Returns:
true if the request is accepted, false if it is rejected

recover

public void recover(java.lang.Object resId,
                    java.util.Map userStates)

nodeFailed

public void nodeFailed(java.lang.Object resId,
                       java.io.Serializable nodeId)


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