com.espertech.esper.core.service
Class StatementAgentInstanceRWLockImpl

java.lang.Object
  extended by com.espertech.esper.core.service.StatementAgentInstanceRWLockImpl
All Implemented Interfaces:
StatementAgentInstanceLock

public class StatementAgentInstanceRWLockImpl
extends java.lang.Object
implements StatementAgentInstanceLock

Simple read-write lock based on ReentrantReadWriteLock that associates a name with the lock and traces read/write locking and unlocking.


Field Summary
 
Fields inherited from interface com.espertech.esper.core.service.StatementAgentInstanceLock
ACQUIRE_TEXT, ACQUIRED_TEXT, RELEASE_TEXT, RELEASED_TEXT
 
Constructor Summary
StatementAgentInstanceRWLockImpl(boolean isFair)
          Ctor.
 
Method Summary
 void acquireReadLock()
          Lock read lock.
 void acquireWriteLock()
          Lock write lock.
 boolean acquireWriteLock(long msecTimeout)
           
 boolean addAcquiredLock(java.util.concurrent.locks.Lock lock)
           
 void releaseReadLock()
          Unlock read lock.
 void releaseWriteLock()
          Unlock write lock.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

StatementAgentInstanceRWLockImpl

public StatementAgentInstanceRWLockImpl(boolean isFair)
Ctor.

Parameters:
isFair - true if a fair lock, false if not
Method Detail

acquireWriteLock

public void acquireWriteLock()
Lock write lock.

Specified by:
acquireWriteLock in interface StatementAgentInstanceLock

acquireWriteLock

public boolean acquireWriteLock(long msecTimeout)
Specified by:
acquireWriteLock in interface StatementAgentInstanceLock

releaseWriteLock

public void releaseWriteLock()
Unlock write lock.

Specified by:
releaseWriteLock in interface StatementAgentInstanceLock

acquireReadLock

public void acquireReadLock()
Lock read lock.

Specified by:
acquireReadLock in interface StatementAgentInstanceLock

releaseReadLock

public void releaseReadLock()
Unlock read lock.

Specified by:
releaseReadLock in interface StatementAgentInstanceLock

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

addAcquiredLock

public boolean addAcquiredLock(java.util.concurrent.locks.Lock lock)

© 2006-2015 EsperTech Inc.
All rights reserved.
Visit us at espertech.com