net.esper.util
Class ManagedLockImpl

java.lang.Object
  extended by net.esper.util.ManagedLockImpl
All Implemented Interfaces:
ManagedLock

public class ManagedLockImpl
extends Object
implements ManagedLock

Simple lock based on ReentrantLock that associates a name with the lock and traces locking and unlocking.


Constructor Summary
ManagedLockImpl(String name)
          Ctor.
 
Method Summary
 void acquireLock(StatementLockFactory statementLockFactory)
          Lock.
 boolean isHeldByCurrentThread()
          Returns true if the current thread holds the lock, or false if not.
 void releaseLock(StatementLockFactory statementLockFactory)
          Unlock.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ManagedLockImpl

public ManagedLockImpl(String name)
Ctor.

Parameters:
name - of lock
Method Detail

acquireLock

public void acquireLock(StatementLockFactory statementLockFactory)
Lock.

Specified by:
acquireLock in interface ManagedLock
Parameters:
statementLockFactory - is the engine lock factory service that the lock can use for engine lock services

releaseLock

public void releaseLock(StatementLockFactory statementLockFactory)
Unlock.

Specified by:
releaseLock in interface ManagedLock
Parameters:
statementLockFactory - is the engine lock factory service that the lock can use for engine lock services

isHeldByCurrentThread

public boolean isHeldByCurrentThread()
Description copied from interface: ManagedLock
Returns true if the current thread holds the lock, or false if not.

Specified by:
isHeldByCurrentThread in interface ManagedLock
Returns:
thread owner indication