com.sun.jini.lease
Class LeaseRenewalManager

java.lang.Object
  |
  +--com.sun.jini.lease.LeaseRenewalManager

Deprecated. This class was experimental; as of 1.1Alpha, it has been replaced by LeaseRenewalManager. This class will be removed in a future release, so please update your code, and refer to the javadoc for net.jini.lease.LeaseRenewalManager for details on LeaseRenewalManager.

public class LeaseRenewalManager
extends java.lang.Object

A lease renewal manager. The operations are appropriately synchronized for concurrent operation.

See Also:
LeaseRenewalManager

Constructor Summary
LeaseRenewalManager()
          Deprecated. Create a manager, initially managing no leases.
LeaseRenewalManager(Lease lease, long expiration, LeaseListener listener)
          Deprecated. Create a manager, initially managing a single lease.
 
Method Summary
 void cancel(Lease lease)
          Deprecated. Remove a lease from the managed set, and cancel it (only if it was in the managed set).
 void clear()
          Deprecated. Remove all leases from the managed set.
 long getExpiration(Lease lease)
          Deprecated. Return the current desired absolute expiration (which may be UNKNOWN) for the lease.
 void remove(Lease lease)
          Deprecated. Remove a lease from the managed set.
 void renewFor(Lease lease, long duration, LeaseListener listener)
          Deprecated. Add a lease to the managed set managed, renewed for a specific duration relative to now.
 void renewUntil(Lease lease, long expiration, LeaseListener listener)
          Deprecated. Add a lease to the managed set, renewed until a specific absolute expiration.
 void setExpiration(Lease lease, long expiration)
          Deprecated. Change the desired absolute expiration for a lease that is already managed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LeaseRenewalManager

public LeaseRenewalManager()
Deprecated. 
Create a manager, initially managing no leases.

LeaseRenewalManager

public LeaseRenewalManager(Lease lease,
                           long expiration,
                           LeaseListener listener)
Deprecated. 
Create a manager, initially managing a single lease. Equivalent to calling the no-parameter constructor and then calling renewUntil(lease, expiration, listener).
Parameters:
lease - the lease to renew
expiration - the desired absolute expiration of the lease, with ANY allowed
listener - the event listener for this lease, or null
Method Detail

renewFor

public void renewFor(Lease lease,
                     long duration,
                     LeaseListener listener)
Deprecated. 
Add a lease to the managed set managed, renewed for a specific duration relative to now. Equivalent to calling renewUntil(lease, duration + System.currentTimeMillis(), listener).
Parameters:
lease - the lease to renew
duration - the desired duration of the lease. An absolute expiration is computed by adding System.currentTimeMillis().
listener - the event listener for this lease, or null

renewUntil

public void renewUntil(Lease lease,
                       long expiration,
                       LeaseListener listener)
Deprecated. 
Add a lease to the managed set, renewed until a specific absolute expiration. If the lease is already managed, it is first removed, and is then added. The lease will remain in the managed set until either the desired expiration is reached, or the listener is called, or an explicit remove or cancel is done. If the desired expiration is earlier than the current actual expiration, the actual expiration is not changed. If the desired expiration is ANY, then renewals will be made forever with a requested duration of ANY.
Parameters:
lease - the lease to renew
expiration - the desired absolute expiration of the lease, with ANY allowed
listener - the event listener for this lease, or null

getExpiration

public long getExpiration(Lease lease)
                   throws UnknownLeaseException
Deprecated. 
Return the current desired absolute expiration (which may be UNKNOWN) for the lease.
Parameters:
lease - the lease

setExpiration

public void setExpiration(Lease lease,
                          long expiration)
                   throws UnknownLeaseException
Deprecated. 
Change the desired absolute expiration for a lease that is already managed. If the lease is already managed, equivalent to calling renewUntil(lease, expiration, listener) using the existing listener associated with the lease.
Parameters:
lease - the lease
expiration - the new desired absolute expiration for the lease

cancel

public void cancel(Lease lease)
            throws UnknownLeaseException,
                   java.rmi.RemoteException
Deprecated. 
Remove a lease from the managed set, and cancel it (only if it was in the managed set). Even if an exception is thrown from the cancel, the lease will have been removed.
Parameters:
lease - the lease

remove

public void remove(Lease lease)
            throws UnknownLeaseException
Deprecated. 
Remove a lease from the managed set.
Parameters:
lease - the lease

clear

public void clear()
Deprecated. 
Remove all leases from the managed set.


Copyright © 1999 Sun Microsystems, Inc. All rights reserved