|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.jini.lease.AbstractLeaseMap
com.sun.jini.fiddler.FiddlerLeaseMap
class FiddlerLeaseMap
When clients request a registration with the Fiddler implementation of
the lookup discovery service, leases of type FiddlerLease are granted
on those registrations. Under certain circumstances it may be desirable
to collect multiple granted leases in a set which implements the
net.jini.core.lease.LeaseMap
interface.
This class is the implementation class of the LeaseMap
interface that is employed by the Fiddler implementation of the lookup
discovery service. When a client wishes to "batch" leases granted by
that service, the are placed in an instance of this class.
Clients only see instances of this class via the LeaseMap
interface.
Nested Class Summary | |
---|---|
(package private) static class |
FiddlerLeaseMap.ConstrainableFiddlerLeaseMap
The constrainable version of the class FiddlerLeaseMap . |
Field Summary | |
---|---|
(package private) Fiddler |
server
The reference to the back-end server of the lookup discovery service |
(package private) Uuid |
serverID
The unique ID associated with the server referenced in this class (used to compare server references). |
Fields inherited from class com.sun.jini.lease.AbstractLeaseMap |
---|
map |
Constructor Summary | |
---|---|
private |
FiddlerLeaseMap(Fiddler server,
FiddlerLease lease,
long duration)
Constructs a new instance of FiddlerLeaseMap. |
Method Summary | |
---|---|
void |
cancelAll()
Cancels all leases in this map. |
boolean |
canContainKey(Object key)
Examines the input parameter to determine if that parameter will be accepted or rejected by this map as a "legal" key value. |
(package private) static FiddlerLeaseMap |
createLeaseMap(FiddlerLease lease,
long duration)
Static factory method that creates and returns an instance of FiddlerLeaseMap . |
void |
renewAll()
Renews all leases in this 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 |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
final Fiddler server
final Uuid serverID
Constructor Detail |
---|
private FiddlerLeaseMap(Fiddler server, FiddlerLease lease, long duration)
server
- reference to the server object through which
communication occurs between the client-side and
server-side of the associated service.lease
- reference to a lease to add to the map as a key valueduration
- the duration of the corresponding lease. This value
is the "mapped" value corresponding to the lease key.Method Detail |
---|
static FiddlerLeaseMap createLeaseMap(FiddlerLease lease, long duration)
FiddlerLeaseMap
. If the lease input to this method
is and instance of ConstrainableFiddlerLease
, then
the object returned by this method will be an instance of
ConstrainableFiddlerLeaseMap
.
Note that because of the way the Lease
class for the
associated service is implemented, together with the way the
canBatch
method of that class is implemented, if the
lease
object input to this method implements
ConstrainableFiddlerLease
, then the server
object referenced in this class will implement
RemoteMethodControl
as well.
lease
- reference to a lease to add to the map as a key valueduration
- the duration of the corresponding lease. This value
is the "mapped" value corresponding to the lease key.
FiddlerLeaseMap
, or an instance
of ConstrainableFiddlerLeaseMap
if the given
lease
is an instance of
ConstrainableFiddlerLease
.public boolean canContainKey(Object key)
This method will return true if the key
parameter is
the type of lease which can be "batch-wise" renewed and cancelled
along with all of the other leases in the map.
For the Fiddler implementation of the lookup discovery service, two
leases can be batched (placed in the same FiddlerLeaseMap)
if they are both instances of FiddlerLease
and they
were both granted by the same Fiddler implementation of the lookup
discovery service. That is, they are the same type, and they were
granted by the same server.
key
- reference to the object that this method examines to
determine if this map will accept or reject it as a key
key
parameter,
false otherwiseLease.canBatch(net.jini.core.lease.Lease)
public void renewAll() throws LeaseMapException, RemoteException
LeaseMapException
.
LeaseMapException
- this exception is thrown
when one or more leases in the map could not be renewed.
RemoteException
- typically, this exception occurs when
there is a communication failure between the client and the
server. When this exception does occur, the leases in the map
may or may not have been renewed successfully.public void cancelAll() throws LeaseMapException, RemoteException
LeaseMapException
.
Note that a lease is removed from this map only when an attempt to cancel it fails; that is, every lease that is successfully cancelled is left in the map.
LeaseMapException
- this exception is thrown
when one or more leases in the map could not be cancelled.
RemoteException
- typically, this exception occurs when
there is a communication failure between the client and the
server. When this exception does occur, the leases in the map
may or may not have been cancelled successfully.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |