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(ZooKeeperConnection zooKeeperConnection,
int poolSize,
String znode)
Claim a resource.
|
static ResourceClaim |
claimExpiring(ZooKeeperConnection zooKeeperConnection,
int poolSize,
String znode,
Long timeout)
Claim a resource.
|
claim, close, close, connected, disconnected, get, getConfiguredZNodepublic static ResourceClaim claimExpiring(ZooKeeperConnection zooKeeperConnection, int poolSize, String znode) throws IOException
zooKeeperConnection - ZooKeeper connection to use.poolSize - Size of the resource pool.znode - Root znode of the ZooKeeper resource-pool.IOExceptionpublic static ResourceClaim claimExpiring(ZooKeeperConnection zooKeeperConnection, int poolSize, String znode, Long timeout) throws IOException
zooKeeperConnection - 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–2018 Lable. All rights reserved.