org.jboss.ha.framework.server.lock
Class NonGloballyExclusiveClusterLockSupport
java.lang.Object
org.jboss.ha.framework.server.lock.AbstractClusterLockSupport
org.jboss.ha.framework.server.lock.NonGloballyExclusiveClusterLockSupport
- All Implemented Interfaces:
- org.jboss.ha.framework.interfaces.HAPartition.HAMembershipListener
public class NonGloballyExclusiveClusterLockSupport
- extends AbstractClusterLockSupport
Support class for cluster locking scenarios where threads can hold a
local lock on a category but not a cluster-wide lock. Multiple nodes can
simultaneously hold a local lock on a category, but none can hold a local
lock on a category if the cluster-wide lock is held. Cluster-wide lock cannot
be acquired while any node holds a local lock.
NOTE: This class does not support "upgrades", i.e. scenarios
where a thread acquires the local lock and then while holding the local
lock attempts to acquire the cluster-wide lock.
- 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 |
NonGloballyExclusiveClusterLockSupport
public NonGloballyExclusiveClusterLockSupport(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.