org.objectweb.perseus.distribution.api
Interface DistResCoordinator
public interface DistResCoordinator
Copyright (C) 2003-2004
- France Telecom R&D
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Release: 1.0
Authors: Olivier Lobry (olivier.lobry@rd.francetelecom.com)
Serializable | freeze(Object resId) - This method is called during a coordination migration or replication.
|
boolean | joinUsersRequest(Object resId, Serializable nodeId) - This method is called whenever a node wants to becomes user of a
recource.
|
void | nodeFailed(Object resId, Serializable nodeId)
|
void | receive(Object resId, Serializable nodeId, Serializable msg) - This method is called when a message is received from a user of a resource
|
void | recover(Object resId, Map userStates)
|
freeze
public Serializable freeze(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
resId
-
- the state to send to the new coordinator
joinUsersRequest
public boolean joinUsersRequest(Object resId,
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.
resId
- the id of the related resourcenodeId
- the id of the node that wants to become a user of this resource
- true if the request is accepted, false if it is rejected
nodeFailed
public void nodeFailed(Object resId,
Serializable nodeId)
receive
public void receive(Object resId,
Serializable nodeId,
Serializable msg)
This method is called when a message is received from a user of a resource
resId
- the id of the related resourcenodeId
- the id of the node using this resourcemsg
- the sent message
recover
public void recover(Object resId,
Map userStates)
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.