public class DeploymentLockStrategyWTimeout extends Object implements DeploymentLockStrategy
Constructor and Description |
---|
DeploymentLockStrategyWTimeout(long timeout,
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, TimeUnit unit)
timeout
- timeout value in the unit givenunit
- unitpublic void acquire(ManagedReadWriteLock engineWideLock) throws DeploymentLockException, InterruptedException
DeploymentLockStrategy
acquire
in interface DeploymentLockStrategy
engineWideLock
- the engine-wide event processing read-write lockDeploymentLockException
- to indicate lock attempt failedInterruptedException
- when lock-taking is interruptedpublic void release(ManagedReadWriteLock engineWideLock)
DeploymentLockStrategy
release
in interface DeploymentLockStrategy
engineWideLock
- the engine-wide event processing read-write lock