public class DeploymentLockStrategyWTimeout extends java.lang.Object implements DeploymentLockStrategy
Constructor and Description |
---|
DeploymentLockStrategyWTimeout(long timeout,
java.util.concurrent.TimeUnit unit)
Ctor.
|
Modifier and Type | Method and Description |
---|---|
void |
acquire(ManagedReadWriteLock engineWideLock)
Acquire should acquire the write lock of the provided read-write lock and may retry and backoff or fail.
|
void |
release(ManagedReadWriteLock engineWideLock)
Release should release the write lock of the provided read-write lock and should never fail.
|
public DeploymentLockStrategyWTimeout(long timeout, java.util.concurrent.TimeUnit unit)
timeout
- timeout value in the unit givenunit
- unitpublic void acquire(ManagedReadWriteLock engineWideLock) throws DeploymentLockException, java.lang.InterruptedException
DeploymentLockStrategy
acquire
in interface DeploymentLockStrategy
engineWideLock
- the engine-wide event processing read-write lockDeploymentLockException
- to indicate lock attempt failedjava.lang.InterruptedException
- when lock-taking is interruptedpublic void release(ManagedReadWriteLock engineWideLock)
DeploymentLockStrategy
release
in interface DeploymentLockStrategy
engineWideLock
- the engine-wide event processing read-write lock