Class LockStrategyWTimeout
java.lang.Object
com.espertech.esper.runtime.client.util.LockStrategyWTimeout
- All Implemented Interfaces:
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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.
-
Constructor Details
-
LockStrategyWTimeout
Ctor.- Parameters:
timeout
- timeout value in the unit givenunit
- 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 interfaceLockStrategy
- Parameters:
runtimeWideLock
- the runtime-wide event processing read-write lock- Throws:
LockStrategyException
- to indicate lock attempt failedInterruptedException
- 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 interfaceLockStrategy
- Parameters:
runtimeWideLock
- the runtime-wide event processing read-write lock
-