public class LeaseMap<T> extends ConcurrentHashMap<T,Lease<T>>
LeaseMap
object is used to map lease keys to the
lease objects managing those objects. This allows components that
are using the leasing framework to associate an object with its
lease and vice versa. Such a capability enables lease renewals to
be performed without the need for a direct handle on the lease.ConcurrentHashMap.KeySetView<K,V>
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
LeaseMap()
Constructor for the
LeaseMap object. |
LeaseMap(int capacity)
Constructor for the
LeaseMap object. |
Modifier and Type | Method and Description |
---|---|
Lease<T> |
get(Object key)
This is used to acquire the
Lease object that is
mapped to the specified key. |
Lease<T> |
remove(Object key)
This is used to remove the
Lease object that is
mapped to the specified key. |
clear, compute, computeIfAbsent, computeIfPresent, contains, containsKey, containsValue, elements, entrySet, equals, forEach, forEach, forEach, forEachEntry, forEachEntry, forEachKey, forEachKey, forEachValue, forEachValue, getOrDefault, hashCode, isEmpty, keys, keySet, keySet, mappingCount, merge, newKeySet, newKeySet, put, putAll, putIfAbsent, reduce, reduceEntries, reduceEntries, reduceEntriesToDouble, reduceEntriesToInt, reduceEntriesToLong, reduceKeys, reduceKeys, reduceKeysToDouble, reduceKeysToInt, reduceKeysToLong, reduceToDouble, reduceToInt, reduceToLong, reduceValues, reduceValues, reduceValuesToDouble, reduceValuesToInt, reduceValuesToLong, remove, replace, replace, replaceAll, search, searchEntries, searchKeys, searchValues, size, toString, values
clone
public LeaseMap()
LeaseMap
object. This will
create a map for mapping leased resource keys to the leases
that manage them. Having such a map allows leases to be
maintained without having a direct handle on the lease.public LeaseMap(int capacity)
LeaseMap
object. This will
create a map for mapping leased resource keys to the leases
that manage them. Having such a map allows leases to be
maintained without having a direct handle on the lease.capacity
- this is the initial capacity of the mappublic Lease<T> get(Object key)
Lease
object that is
mapped to the specified key. Overriding this method ensures
that even without generic parameters a type safe method for
acquiring the registered lease objects can be used.Copyright © 2018. All rights reserved.