com.atlassian.confluence.concurrent
Interface Lock

All Known Subinterfaces:
ClusteredLock
All Known Implementing Classes:
TangosolClusteredLock

public interface Lock

Generic lock interface - a subset of Java 1.5 java.util.concurrent.locks.Lock interface

See Also:
LockOperation

Method Summary
 void lock()
          Acquire a lock - blocks until lock is successfully acquired
 boolean tryLock()
          Try to obtain a lock - returns immediately
 void unlock()
          Unlock this lock
 

Method Detail

tryLock

boolean tryLock()
Try to obtain a lock - returns immediately

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

unlock

void unlock()
Unlock this lock


lock

void lock()
Acquire a lock - blocks until lock is successfully acquired



Copyright © 2003-2010 Atlassian. All Rights Reserved.