org.objectweb.perseus.distribution.jgroups
Class JGroupsUserService
java.lang.Object
org.objectweb.perseus.distribution.jgroups.JGroupsUserService
- DistResUserService
public class JGroupsUserService
extends java.lang.Object
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 | getNodeId() - Returns the id of the local node.
|
DistResUser | getUser(Object resId) - Gets the user interface associated with a given resource identifier.
|
boolean | joinUsers(Object rId, DistResUser dru) - Request the coordinator(s) to join the users of a resource.
|
void | sendToCoordinator(Object rId, Serializable message) - Asynchronously sends a message to the coordinator(s).
|
String | toString()
|
getNodeId
public Serializable getNodeId()
Returns the id of the local node. The identifier can be sent in messages
as it is serializable.
- getNodeId in interface DistResUserService
- the id of the local node
getUser
public DistResUser getUser(Object resId)
Gets the user interface associated with a given resource identifier.
- getUser in interface DistResUserService
resId
- the id of the coresponding resource
- the user interface associated with the resource identifier, null
if there is no correspondance.
joinUsers
public boolean joinUsers(Object rId,
DistResUser dru)
throws UseNotGrantedException,
InterruptedException
Request the coordinator(s) to join the users of a resource. This is a
synchronous operation which is accepted only if all coordinators have
accepted the node as a new user member.
- joinUsers in interface DistResUserService
dru
- the user to which messages must be delivered
- true if the user is the first (and only one) user of the resource
UseNotGrantedException
- if the joining has not been accepted
sendToCoordinator
public void sendToCoordinator(Object rId,
Serializable message)
throws NotUserException
Asynchronously sends a message to the coordinator(s). A FIFO delivery is
guaranteed for each resource, that is, the receive method of the
coordinator will be called in the same order that the call to this
method with the same resource id. Also, either the coordinator will
receive the message once and only once, or the user will be excluded
from the users
- sendToCoordinator in interface DistResUserService
message
- the message to send
NotUserException
- if the not is not registered has a user of
this resource
toString
public String toString()
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.