com.atlassian.confluence.cluster.coherence
Class TangosolClusteredLock

java.lang.Object
  extended by com.atlassian.confluence.cluster.coherence.TangosolClusteredLock
All Implemented Interfaces:
ClusteredLock, Lock

public class TangosolClusteredLock
extends java.lang.Object
implements ClusteredLock

Tangosol implementation of a ClusteredLock


Field Summary
static long WAIT_UNTIL_ACQUIRED
           
 
Constructor Summary
TangosolClusteredLock(com.tangosol.net.NamedCache cache, java.lang.String key)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
 java.io.Serializable getValue()
           
 int hashCode()
           
 void lock()
          Acquire a lock - blocks until lock is successfully acquired
 void setValue(java.io.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,
                             java.lang.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 java.io.Serializable getValue()
Specified by:
getValue in interface ClusteredLock
Returns:
The value of the key that is locked

setValue

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

Specified by:
setValue in interface ClusteredLock

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object


Copyright © 2003-2010 Atlassian. All Rights Reserved.