public class ExpiringResourceClaim extends ResourceClaim
ResourceClaim that automatically relinquishes its hold on a resource
after a set amount of time.ResourceClaim.State| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_TIMEOUT |
state| Modifier and Type | Method and Description |
|---|---|
static ResourceClaim |
claimExpiring(org.apache.zookeeper.ZooKeeper zookeeper,
int poolSize,
String znode)
Claim a resource.
|
static ResourceClaim |
claimExpiring(org.apache.zookeeper.ZooKeeper zookeeper,
int poolSize,
String znode,
long timeout)
Claim a resource.
|
claim, close, connected, disconnected, get, getConfiguredZNodepublic static ResourceClaim claimExpiring(org.apache.zookeeper.ZooKeeper zookeeper, int poolSize, String znode) throws IOException
zookeeper - ZooKeeper connection to use.poolSize - Size of the resource pool.znode - Root znode of the ZooKeeper resource-pool.IOExceptionpublic static ResourceClaim claimExpiring(org.apache.zookeeper.ZooKeeper zookeeper, int poolSize, String znode, long timeout) throws IOException
zookeeper - ZooKeeper connection to use.poolSize - Size of the resource pool.znode - Root znode of the ZooKeeper resource-pool.timeout - Delay in milliseconds before the claim expires.IOExceptionCopyright © 2014–2015 Lable. All rights reserved.