Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

com.fetish.toolkit
Class FetishLeaseRenewalManager  view FetishLeaseRenewalManager download FetishLeaseRenewalManager.java

java.lang.Object
  extended byLeaseRenewalManager
      extended bycom.fetish.toolkit.FetishLeaseRenewalManager

public class FetishLeaseRenewalManager
extends LeaseRenewalManager

The Fetish Lease Renewal Manager.
This class takes care of renewing the service registration leases in time, and in case of lease cancellation by late arrival of renewal request, it reregisters the expired service proxy by calling the reregister method in the FetishImpl class.


Nested Class Summary
private  class FetishLeaseRenewalManager.ExpirationComparator
           
private  class FetishLeaseRenewalManager.LeaseEntry
           
private  class FetishLeaseRenewalManager.Renewer
           
 
Field Summary
private static long defaultExpiration
           
private  long delay
           
private  long expiration
           
private  FetishImpl handback
           
private  Lease lease
           
private  java.lang.Thread t
           
private  java.util.TreeMap tree
           
 
Constructor Summary
FetishLeaseRenewalManager(FetishImpl handback)
          Constructor.
 
Method Summary
 void cancel(Lease lease)
          Cancel the lease.
 void remove(Lease lease)
          Remove the lease from the registry.
 void renewFor(Lease lease, ServiceID sid, java.lang.String url)
          Starts the automatic renewal of the lease.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

lease

private Lease lease

expiration

private long expiration

delay

private long delay

t

private java.lang.Thread t

tree

private java.util.TreeMap tree

defaultExpiration

private static long defaultExpiration

handback

private FetishImpl handback
Constructor Detail

FetishLeaseRenewalManager

public FetishLeaseRenewalManager(FetishImpl handback)
Constructor.
Takes a FetishImpl instance as a parameter, to achieve reregistration of expired services.

Method Detail

renewFor

public void renewFor(Lease lease,
                     ServiceID sid,
                     java.lang.String url)
Starts the automatic renewal of the lease.
The lease associated with the ServiceID sid obtained from the registration of a service in the FADA pointed by the url will be renewed until one of these two cases happen:
  • The lease is cancelled - The lease is dropped from the internal registry
  • The lease expires because lease renewal is late - The service identified by sid in the FADA identified by url will be reregistered. However, the lease has already been lost, but the reregister method will add a new entry in the registry by calling this method


cancel

public void cancel(Lease lease)
Cancel the lease.
The lease is cancelled, causing the dropping of the associated service, and it is removed from the internal registry.


remove

public void remove(Lease lease)
Remove the lease from the registry.
This method is identical to cancel(). It causes the removal of the lease from the internal registry, and also cancels it.