Class LockStrategyWTimeout

java.lang.Object
com.espertech.esper.runtime.client.util.LockStrategyWTimeout
All Implemented Interfaces:
LockStrategy

public class LockStrategyWTimeout extends Object implements LockStrategy
Obtains the write lock of the runtime-wide event processing read-write lock by trying the lock waiting for the timeout and throwing an exception if the lock was not taken.
  • Constructor Summary

    Constructors
    Constructor
    Description
    LockStrategyWTimeout(long timeout, TimeUnit unit)
    Ctor.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    acquire(com.espertech.esper.common.internal.util.ManagedReadWriteLock runtimeWideLock)
    Acquire should acquire the write lock of the provided read-write lock and may retry and backoff or fail.
    void
    release(com.espertech.esper.common.internal.util.ManagedReadWriteLock runtimeWideLock)
    Release should release the write lock of the provided read-write lock and should never fail.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • LockStrategyWTimeout

      public LockStrategyWTimeout(long timeout, TimeUnit unit)
      Ctor.
      Parameters:
      timeout - timeout value in the unit given
      unit - unit
  • Method Details

    • acquire

      public void acquire(com.espertech.esper.common.internal.util.ManagedReadWriteLock runtimeWideLock) throws LockStrategyException, InterruptedException
      Description copied from interface: LockStrategy
      Acquire should acquire the write lock of the provided read-write lock and may retry and backoff or fail.
      Specified by:
      acquire in interface LockStrategy
      Parameters:
      runtimeWideLock - the runtime-wide event processing read-write lock
      Throws:
      LockStrategyException - to indicate lock attempt failed
      InterruptedException - when lock-taking is interrupted
    • release

      public void release(com.espertech.esper.common.internal.util.ManagedReadWriteLock runtimeWideLock)
      Description copied from interface: LockStrategy
      Release should release the write lock of the provided read-write lock and should never fail.
      Specified by:
      release in interface LockStrategy
      Parameters:
      runtimeWideLock - the runtime-wide event processing read-write lock