MB - public class BuilderSyncSetup<MB extends com.google.protobuf.GeneratedMessage.Builder<MB>> extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
LOCK_TIMEOUT |
protected org.slf4j.Logger |
logger |
| Constructor and Description |
|---|
BuilderSyncSetup(MB builder,
ReentrantReadWriteLock.ReadLock readLock,
ReentrantReadWriteLock.WriteLock writeLock,
Changeable holder) |
| Modifier and Type | Method and Description |
|---|---|
MB |
getBuilder()
Returns the internal builder instance.
|
void |
lockRead(Object consumer) |
void |
lockWrite(Object consumer) |
boolean |
tryLockRead(long time,
TimeUnit unit,
Object consumer) |
boolean |
tryLockRead(Object consumer) |
boolean |
tryLockWrite(long time,
TimeUnit unit,
Object consumer) |
boolean |
tryLockWrite(Object consumer) |
void |
unlockRead(Object consumer) |
void |
unlockWrite()
Method unlocks the write lock.
|
void |
unlockWrite(boolean notifyChange)
Method unlocks the write lock and notifies the change to the internal data holder.
|
public static final long LOCK_TIMEOUT
protected final org.slf4j.Logger logger
public BuilderSyncSetup(MB builder, ReentrantReadWriteLock.ReadLock readLock, ReentrantReadWriteLock.WriteLock writeLock, Changeable holder)
public MB getBuilder()
public void lockRead(Object consumer)
public boolean tryLockRead(Object consumer)
public boolean tryLockRead(long time,
TimeUnit unit,
Object consumer)
throws InterruptedException
InterruptedExceptionpublic void unlockRead(Object consumer)
public void lockWrite(Object consumer)
public boolean tryLockWrite(Object consumer)
public boolean tryLockWrite(long time,
TimeUnit unit,
Object consumer)
throws InterruptedException
InterruptedExceptionpublic void unlockWrite()
public void unlockWrite(boolean notifyChange)
notifyChange - Copyright © 2015–2017 openbase.org. All rights reserved.