com.sun.jini.reggie
Class RegistrarLeaseMap

java.lang.Object
  extended by com.sun.jini.lease.AbstractLeaseMap
      extended by com.sun.jini.reggie.RegistrarLeaseMap
All Implemented Interfaces:
Map, LeaseMap
Direct Known Subclasses:
ConstrainableRegistrarLeaseMap

 class RegistrarLeaseMap
extends AbstractLeaseMap

The LeaseMap implementation class for registrar leases. Clients only see instances via the LeaseMap interface.

Author:
Sun Microsystems, Inc.

Field Summary
(package private)  ServiceID registrarID
          The registrar's service ID.
private static long serialVersionUID
           
(package private)  Registrar server
          The registrar.
 
Fields inherited from class com.sun.jini.lease.AbstractLeaseMap
map
 
Constructor Summary
RegistrarLeaseMap(RegistrarLease lease, long duration)
          Simple constructor
RegistrarLeaseMap(Registrar server, RegistrarLease lease, long duration)
          Constructor used by ConstrainableRegistrarLeaseMap
 
Method Summary
 void cancelAll()
          Cancels all leases in the LeaseMap.
 boolean canContainKey(Object key)
          Any RegistrarLease from the same server can be in the map
 void renewAll()
          Renews all leases in the LeaseMap, using their current values as the renewal durations.
 
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

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

server

final Registrar server
The registrar.


registrarID

final ServiceID registrarID
The registrar's service ID.

Constructor Detail

RegistrarLeaseMap

RegistrarLeaseMap(RegistrarLease lease,
                  long duration)
Simple constructor


RegistrarLeaseMap

RegistrarLeaseMap(Registrar server,
                  RegistrarLease lease,
                  long duration)
Constructor used by ConstrainableRegistrarLeaseMap

Method Detail

canContainKey

public boolean canContainKey(Object key)
Any RegistrarLease from the same server can be in the map

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)

renewAll

public void renewAll()
              throws LeaseMapException,
                     RemoteException
Description copied from interface: LeaseMap
Renews all leases in the LeaseMap, using their current values as the renewal durations. If all renewals are successful, returns normally. Otherwise, removes all leases that failed to renew from the LeaseMap, and throws LeaseMapException.

Throws:
LeaseMapException
RemoteException

cancelAll

public void cancelAll()
               throws LeaseMapException,
                      RemoteException
Description copied from interface: LeaseMap
Cancels all leases in the LeaseMap. If all cancels are successful, returns normally (leaving all leases in the map). Otherwise, removes all leases that failed to cancel from the LeaseMap, and throws LeaseMapException.

Throws:
LeaseMapException
RemoteException


Copyright 2007-2010, multiple authors.
Licensed under the Apache License, Version 2.0, see the NOTICE file for attributions.