public class

TangosolClusteredLock

extends Object
implements ClusteredLock
java.lang.Object
   ↳ com.atlassian.confluence.cluster.coherence.TangosolClusteredLock

Class Overview

Tangosol implementation of a ClusteredLock

Summary

Constants
long WAIT_UNTIL_ACQUIRED
Public Constructors
TangosolClusteredLock(NamedCache cache, String key)
Public Methods
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
[Expand]
Inherited Methods
From class java.lang.Object
From interface com.atlassian.confluence.cluster.ClusteredLock
From interface com.atlassian.confluence.concurrent.Lock

Constants

public static final long WAIT_UNTIL_ACQUIRED

Constant Value: -1 (0xffffffffffffffff)

Public Constructors

public TangosolClusteredLock (NamedCache cache, String key)

Public Methods

public boolean equals (Object o)

public Serializable getValue ()

public int hashCode ()

public void lock ()

Acquire a lock - blocks until lock is successfully acquired

public void setValue (Serializable value)

Set the value of the key that is locked

public boolean tryLock ()

Try to obtain a lock - returns immediately

Returns
  • true if the lock was successful, false if currently locked by something else

public void unlock ()

Unlock this lock