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 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

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object


Copyright © 2003-2013 Atlassian. All Rights Reserved.