org.jboss.ha.framework.server.lock
Interface LocalLockHandler


public interface LocalLockHandler

Provides local lock coordination for an AbstractClusterLockSupport.

Version:
$Revision: 86130 $
Author:
Brian Stansberry

Method Summary
 org.jboss.ha.framework.interfaces.ClusterNode getLocalNode(org.jboss.ha.framework.interfaces.ClusterNode localNode)
           
 org.jboss.ha.framework.interfaces.ClusterNode getLockHolder(Serializable lockName)
          Gets the node the holds the given lock on this node, or null if no node holds the lock on this node.
 void lockFromCluster(Serializable lockName, org.jboss.ha.framework.interfaces.ClusterNode caller, long timeout)
          Try to acquire the local lock within the given timeout.
 void setLocalNode(org.jboss.ha.framework.interfaces.ClusterNode localNode)
           
 void unlockFromCluster(Serializable lockName, org.jboss.ha.framework.interfaces.ClusterNode caller)
          Release the lock.
 

Method Detail

getLockHolder

org.jboss.ha.framework.interfaces.ClusterNode getLockHolder(Serializable lockName)
Gets the node the holds the given lock on this node, or null if no node holds the lock on this node.

Parameters:
lockName -
Returns:

lockFromCluster

void lockFromCluster(Serializable lockName,
                     org.jboss.ha.framework.interfaces.ClusterNode caller,
                     long timeout)
                     throws TimeoutException,
                            InterruptedException
Try to acquire the local lock within the given timeout. If this method returns successfully, the caller has acquired the lock.

Parameters:
lockName - the name of the lock.
caller - the node making the request
timeout - number of ms the caller will accept waiting before the lock acquisition should be considered a failure. A value less than one means wait as long as necessary.
Throws:
TimeoutException - if the lock could not be acquired within the specified timeout
InterruptedException

unlockFromCluster

void unlockFromCluster(Serializable lockName,
                       org.jboss.ha.framework.interfaces.ClusterNode caller)
Release the lock.

Parameters:
lockName - the name of the lock.
caller - the node making the request

getLocalNode

org.jboss.ha.framework.interfaces.ClusterNode getLocalNode(org.jboss.ha.framework.interfaces.ClusterNode localNode)

setLocalNode

void setLocalNode(org.jboss.ha.framework.interfaces.ClusterNode localNode)


Copyright © 2009 JBoss, a division of Red Hat, Inc.. All Rights Reserved.