com.sun.jini.lease.landlord
Interface LeaseManager


public abstract interface LeaseManager

LeaseManager provides an interface for tracking lease status. Some implementations of LeasePolicy (e.g. LeaseDurationPolicy) allow registration of a LeaseManager that will be notified when a new Lease is created or a Lease's duration changes.

The LeaseManager interface has methods indicating when new leases have been granted and when existing leases have been renewed, it does not have a method to indicate when a lease has been cancelled. Because of this, LeaseManager implementations need to be careful not to leak memory/resources if leases are cancelled before they expire. In particular, they should not hold on to LeasedResources directly since this would prevent garbage collection of resources when their leases are cancelled before they expire.

See Also:
LeaseDurationPolicy, LeasedResource

Method Summary
 void register(LeasedResource resource, long duration)
          Notifies the manager of a new lease being created.
 void renewed(LeasedResource resource, long duration, long oldExpiration)
          Notifies the manager of a lease being renewed.
 

Method Detail

register

public void register(LeasedResource resource,
                     long duration)
Notifies the manager of a new lease being created.
Parameters:
resource - The resource associated with the new Lease.
duration - The duration of the lease

renewed

public void renewed(LeasedResource resource,
                    long duration,
                    long oldExpiration)
Notifies the manager of a lease being renewed.
Parameters:
resource - The resource associated with the new Lease.
duration - The duration of the lease
oldExpiration - The expiration the resource had before it was renewed


Copyright © 1999 Sun Microsystems, Inc. All rights reserved