org.objectweb.perseus.concurrency.distributed.globallock.lib
Class GlobalLockCoordinator
java.lang.Object
org.objectweb.perseus.concurrency.distributed.globallock.lib.GlobalLockCoordinator
- DistResCoordinator, Serializable
public class GlobalLockCoordinator
extends java.lang.Object
implements DistResCoordinator, Serializable
This class is the server side of the global lock management and is not
intended to be used directly. Coordinators will be dynamically created by
the distributed respurce management through the GlobalLockCoordinatorFactory.
Coordinators communicate with users using the DistResCoordinatorService
interface. As global locks are cached by users, they must be called back
when necessary. The coordinator ensure that a lock is never granted to
different users with incompatible levels. Incompatibility is defined by the
lockValue when initializing the GlobalLockCoordinatorFactory instance. When
a user request cannot be satisfied because it is not compatible with other
users, a downgrade lock authoritative request (that is, a call back) is sent
users with a level compatible with the requested one. On reception, users
must adjust their grantable lock level so that new
local reuqest will be blocked, and notify the coordinator of the effective
downgrading when the local granted level is less or equal to the call back
level. Note that new coordinator instance is created by the
GlobalLockMasterFactory for each shared resource. Hence the instance itself
is sent when coordination migration or replication.
GlobalLockUser
, GlobalLockCoordinatorFactory
, LockValue
, org.objectweb.perseus.distribution.api.DistResCoordinator
, org.objectweb.perseus.distribution.api.DistResCoordinatorService
GlobalLockCoordinator
public GlobalLockCoordinator(Object resId,
DistResCoordinatorService drcs,
LockValue lockValue)
Create a new coordinator using a LockValue
lockValue
-
GlobalLockCoordinator
, LockValue
freeze
public Serializable freeze(Object resId)
joinUsersRequest
public boolean joinUsersRequest(Object resId,
Serializable node)
nodeFailed
public void nodeFailed(Object resId,
Serializable nodeId)
receive
public void receive(Object objId,
Serializable user,
Serializable msg)
recover
public void recover(Object resId,
Map userStates)
toString
public String toString()
Copyright © 2000-2002 France Telecom S.A., INRIA, IMAG-LSR All Rights Reserved.