org.helidb.util.concurrent
Class AbstractLockAdapter

java.lang.Object
  extended by org.helidb.util.concurrent.AbstractLockAdapter
All Implemented Interfaces:
Lock

public abstract class AbstractLockAdapter
extends Object
implements Lock

This class can be used as the base of an implementation of a Lock adapter. It implements all methods in the Lock interface to throw UnsupportedOperationException. Subclasses override the methods that they want to change the behavior of.

Since:
1.0
Author:
Karl Gustafsson
In_jar:
helidb-core

Constructor Summary
AbstractLockAdapter()
           
 
Method Summary
 void lock()
           
 void lockInterruptibly()
           
 Condition newCondition()
           
 boolean tryLock()
           
 boolean tryLock(long time, TimeUnit unit)
           
 void unlock()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLockAdapter

public AbstractLockAdapter()
Method Detail

newCondition

public Condition newCondition()
Specified by:
newCondition in interface Lock

tryLock

public boolean tryLock()
Specified by:
tryLock in interface Lock

tryLock

public boolean tryLock(long time,
                       TimeUnit unit)
Specified by:
tryLock in interface Lock

lock

public void lock()
Specified by:
lock in interface Lock

lockInterruptibly

public void lockInterruptibly()
Specified by:
lockInterruptibly in interface Lock

unlock

public void unlock()
Specified by:
unlock in interface Lock