org.jboss.ha.framework.server.lock
Class YieldingGloballyExclusiveClusterLockSupport
java.lang.Object
org.jboss.ha.framework.server.lock.AbstractClusterLockSupport
org.jboss.ha.framework.server.lock.YieldingGloballyExclusiveClusterLockSupport
- All Implemented Interfaces:
- org.jboss.ha.framework.interfaces.HAPartition.HAMembershipListener
public class YieldingGloballyExclusiveClusterLockSupport
- extends AbstractClusterLockSupport
Support class for cluster locking scenarios where threads cannot acquire
a local lock unless the node owns a cluster-wide lock, but where the node
owning the cluster-wide lock will yield it to another node if no thread
has a local lock. Use case for this is scenarios like session management
where a node needs to acquire ownership of a cluster-wide lock for a session,
but then once acquired wishes to handle multiple calls for the session without
make cluster-wide locking calls. The node handling the session would acquire
the cluster-wide lock if it doesn't have it and thereafter would only use
local locks; if another node received a request for the session it would
request the lock and the first node would release it if no local locks are
held.
- Author:
- Brian Stansberry
Methods inherited from class org.jboss.ha.framework.server.lock.AbstractClusterLockSupport |
getClusterLockState, getCurrentView, getLocalClusterNode, getLocalHandler, getLock, getPartition, getPartitionName, getServiceHAName, lock, membershipChanged, recordLockHolder, removeLockState, start, stop |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
YieldingGloballyExclusiveClusterLockSupport
public YieldingGloballyExclusiveClusterLockSupport(String serviceHAName,
org.jboss.ha.framework.interfaces.HAPartition partition,
LocalLockHandler handler)
unlock
public void unlock(Serializable lockId)
- Specified by:
unlock
in class AbstractClusterLockSupport
getClusterLockState
protected ClusterLockState getClusterLockState(Serializable categoryName)
- Specified by:
getClusterLockState
in class AbstractClusterLockSupport
yieldLock
protected RemoteLockResponse yieldLock(ClusterLockState lockState,
org.jboss.ha.framework.interfaces.ClusterNode caller,
long timeout)
- Specified by:
yieldLock
in class AbstractClusterLockSupport
handleLockSuccess
protected RemoteLockResponse handleLockSuccess(ClusterLockState lockState,
org.jboss.ha.framework.interfaces.ClusterNode caller)
- Specified by:
handleLockSuccess
in class AbstractClusterLockSupport
Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.