public class DLockUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
LOCK_SERVICE_NAME |
| Constructor and Description |
|---|
DLockUtil() |
| Modifier and Type | Method and Description |
|---|---|
static void |
getEntryLock(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Given a region and a key, get a lock on the key's entry in the region.
|
static void |
getLock(Object name)
|
static void |
getLock(Object name,
long timeoutMs)
Gets a lock on the object with the specified name.
|
static com.gemstone.gemfire.distributed.DistributedLockService |
getLockService()
Returns a DistributedLockService with name LOCK_SERVICE_NAME.
|
static boolean |
hasLock(Object name)
Answers whether this thread has the lock for the object with the specified name.
|
static void |
unlock(Object name)
Unlocks the object with the specified name.
|
static void |
unlockEntryLock(com.gemstone.gemfire.cache.Region aRegion,
Object key)
Given a region and a key, unlock the entry lock for that key.
|
public static final String LOCK_SERVICE_NAME
public static com.gemstone.gemfire.distributed.DistributedLockService getLockService()
public static void getLock(Object name)
public static void getEntryLock(com.gemstone.gemfire.cache.Region aRegion,
Object key)
public static void unlockEntryLock(com.gemstone.gemfire.cache.Region aRegion,
Object key)
public static void getLock(Object name, long timeoutMs)
timeoutMs milliseconds for the lock to be
established before timing out.HydraRuntimeException - if this thread already locked the object
or if the attempt is interrupted or times out or if there is
a cache exception.public static void unlock(Object name)
HydraRuntimeException - if this thread does have the lock on the object
or if there is a cache exception.public static boolean hasLock(Object name)
HydraRuntimeException - if there is a cache exception.Copyright © 2010-2015 Pivotal Software, Inc. All rights reserved.