public class LockWrapper extends Object
ReentrantLock which is used to share and sync locks across various
components of Siddhi. LockWrapper creates a mutable instance where the internal lock can be
assigned and reassigned to new instances.
However, internal lock is not intended to be replaced after initialization.| Constructor and Description |
|---|
LockWrapper(String lockId)
Construct an empty LockWrapper object with no lock inside.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
equals(Object o) |
ReentrantLock |
getLock()
Return the internal lock of the
LockWrapper |
int |
hashCode() |
void |
lock()
Acquires the lock.
|
void |
setLock(ReentrantLock lock)
Set the internal lock to this
LockWrapper |
void |
unlock()
Release the lock.
|
public LockWrapper(String lockId)
lockId - id of the lock. Cannot be null.public ReentrantLock getLock()
LockWrapperpublic void setLock(ReentrantLock lock)
LockWrapperlock - the actual lock to be usedpublic void lock()
public void unlock()
Copyright © 2018 WSO2. All rights reserved.