com.atlassian.confluence.cluster.tangosol
Class TangosolClusteredLock

java.lang.Object
  extended bycom.atlassian.confluence.cluster.tangosol.TangosolClusteredLock
All Implemented Interfaces:
ClusteredLock, Lock

public class TangosolClusteredLock
extends Object
implements ClusteredLock

Tangosol implementation of a ClusteredLock


Field Summary
static long WAIT_UNTIL_ACQUIRED
           
 
Constructor Summary
TangosolClusteredLock(com.tangosol.net.NamedCache cache, String key)
           
 
Method Summary
 boolean equals(Object o)
           
 Serializable getValue()
           
 int hashCode()
           
 void lock()
          Acquire a lock - blocks until lock is successfully acquired
 void setValue(Serializable value)
          Set the value of the key that is locked
 boolean tryLock()
          Try to obtain a lock - returns immediately
 void unlock()
          Unlock this lock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WAIT_UNTIL_ACQUIRED

public static final long WAIT_UNTIL_ACQUIRED
See Also:
Constant Field Values
Constructor Detail

TangosolClusteredLock

public TangosolClusteredLock(com.tangosol.net.NamedCache cache,
                             String key)
Method Detail

tryLock

public boolean tryLock()
Description copied from interface: Lock
Try to obtain a lock - returns immediately

Specified by:
tryLock in interface Lock
Returns:
true if the lock was successful, false if currently locked by something else

lock

public void lock()
Description copied from interface: Lock
Acquire a lock - blocks until lock is successfully acquired

Specified by:
lock in interface Lock

unlock

public void unlock()
Description copied from interface: Lock
Unlock this lock

Specified by:
unlock in interface Lock

getValue

public Serializable getValue()
Specified by:
getValue in interface ClusteredLock
Returns:
The value of the key that is locked

setValue

public void setValue(Serializable value)
Description copied from interface: ClusteredLock
Set the value of the key that is locked

Specified by:
setValue in interface ClusteredLock
Parameters:
value -

equals

public boolean equals(Object o)

hashCode

public int hashCode()


Confluence is developed by Atlassian.