org.mbari.siam.distributed.leasing
Interface LeaseListener

All Known Implementing Classes:
AuxComms.Listener, CommsLeaseListener

public interface LeaseListener

LeaseListener is notified by LeaseManager when significant leasing events occur. Note: it important that the callbacks implemented by LeaseListeners execute in a timely manner, so that remote lease clients are not blocked for an excessive amount of time.


Method Summary
 void leaseEstablishCallback(int id, long leasePeriod, long nextEstablishTime, int numConnections)
          Called when a lease is being established.
 void leaseExpiredCallback(int id, long nextEstablishTime, int numConnections)
          Called when lease expires.
 void leaseRenewalCallback(int id, long leasePeriod, int numConnections)
          Called when lease is being renewed.
 void leaseTerminatedCallback(int id, long nextEstablishTime, int numConnections)
          Called when lease is being terminated.
 

Method Detail

leaseEstablishCallback

void leaseEstablishCallback(int id,
                            long leasePeriod,
                            long nextEstablishTime,
                            int numConnections)
                            throws LeaseRefused
Called when a lease is being established. Can throw LeaseRefused. This callback implementation must execute in a timely manner.

Parameters:
id - lease ID of session being established
leasePeriod - lease period in milliseconds
nextEstablishTime - next estimated lease establishment time
numConnections - Total number of connections on the comms media, including this one.
Throws:
LeaseRefused

leaseTerminatedCallback

void leaseTerminatedCallback(int id,
                             long nextEstablishTime,
                             int numConnections)
Called when lease is being terminated. This callback implementation must execute in a timely manner.

Parameters:
id - lease ID of session being terminated
nextEstablishTime - next estimated lease establishment time
numConnections - Total number of connections on the comms media, after this one has been terminated

leaseExpiredCallback

void leaseExpiredCallback(int id,
                          long nextEstablishTime,
                          int numConnections)
Called when lease expires. This callback implementation must execute in a timely manner.

Parameters:
id - lease ID of session being established
nextEstablishTime - next estimated lease establishment time
numConnections - Total number of connections on the comms media, after this one has expired

leaseRenewalCallback

void leaseRenewalCallback(int id,
                          long leasePeriod,
                          int numConnections)
                          throws LeaseRefused
Called when lease is being renewed. Can throw LeaseRefused. This callback implementation must execute in a timely manner.

Parameters:
id - lease ID of session being renewed
leasePeriod - lease period in milliseconds
numConnections - Total number of connections on the comms media, including this one.
Throws:
LeaseRefused


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.