com.sun.jini.landlord
Class ConstrainableLandlordLeaseMap
java.lang.Object
com.sun.jini.lease.AbstractLeaseMap
com.sun.jini.landlord.LandlordLeaseMap
com.sun.jini.landlord.ConstrainableLandlordLeaseMap
- All Implemented Interfaces:
- Map, LeaseMap
public final class ConstrainableLandlordLeaseMap
- extends LandlordLeaseMap
Constrainable sub-class of LandlordLeaseMap
.
- Since:
- 2.0
- Author:
- Sun Microsystems, Inc.
Method Summary |
boolean |
canContainKey(Object key)
Returns true if the given object is a Lease which can be renewed
and cancelled in a batch with other leases in the map. |
Methods inherited from class com.sun.jini.lease.AbstractLeaseMap |
checkKey, checkValue, clear, containsKey, containsValue, entrySet, equals, get, hashCode, isEmpty, keySet, put, putAll, remove, size, values |
ConstrainableLandlordLeaseMap
ConstrainableLandlordLeaseMap(Landlord landlord,
Uuid landlordUuid,
Lease lease,
long duration)
- Create a new
ConstrainableLandlordLeaseMap
.
- Parameters:
landlord
- Reference to the entity that created
lease
. Assumes that any
necessary method constraints have been
attached.landlordUuid
- a universally unique id that has been
assigned to the server granting of the lease.
Ideally the Uuid
landlord.getUuid
would
return if landlord
implemented
ReferentUuid
. Used to determine when
leases can be added to this map.lease
- First lease to be placed in the map. It is
assumed that canContainKey(lease)
would be true
. Must work with the
landlord protocol.duration
- The duration the lease should be renewed for if
renewAll
is called.
- Throws:
ClassCastException
- if landlord
does not implement RemoteMethodControl
.
NullPointerException
- if landlord is null
.
canContainKey
public boolean canContainKey(Object key)
- Description copied from interface:
LeaseMap
- Returns true if the given object is a Lease which can be renewed
and cancelled in a batch with other leases in the map. Whether
or not two Lease objects can be batched is an implementation
detail determined by the objects.
- Specified by:
canContainKey
in interface LeaseMap
- Overrides:
canContainKey
in class LandlordLeaseMap
- Parameters:
key
- an object that should be a lease
- Returns:
- true if the lease can be renewed and cancelled in a
a batch with other leases
- See Also:
Lease.canBatch(net.jini.core.lease.Lease)
Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.