com.sun.jini.lease
Class AbstractLease

java.lang.Object
  |
  +--com.sun.jini.lease.AbstractLease
Direct Known Subclasses:
LandlordLease

public abstract class AbstractLease
extends java.lang.Object
implements Lease, java.io.Serializable

A base class for implementing lease objects. This class takes care of absolute vs relative time issues and implements some of the Lease methods. The subclass is responsible for implementing: doRenew, cancel, createLeaseMap, canBatch, hashCode, equals, and serialization of any subclass state.

See Also:
Serialized Form

Field Summary
protected  long expiration
          The lease expiration, in local absolute time.
protected  int serialFormat
          Serialization format for the expiration.
 
Constructor Summary
protected AbstractLease(long expiration)
          Construct a relative-format lease.
 
Method Summary
protected abstract  long doRenew(long duration)
          Renew the lease for a duration relative to now, and return the duration actually granted.
 long getExpiration()
          Return the lease expiration.
 int getSerialFormat()
          Return the serialization format for the expiration.
 void renew(long duration)
          Renew the lease for a duration relative to now.
 void setSerialFormat(int format)
          Set the serialization format for the expiration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

expiration

protected transient long expiration
The lease expiration, in local absolute time.

serialFormat

protected int serialFormat
Serialization format for the expiration.
Constructor Detail

AbstractLease

protected AbstractLease(long expiration)
Construct a relative-format lease.
Method Detail

getExpiration

public long getExpiration()
Return the lease expiration.
Specified by:
getExpiration in interface Lease

getSerialFormat

public int getSerialFormat()
Return the serialization format for the expiration.
Specified by:
getSerialFormat in interface Lease

setSerialFormat

public void setSerialFormat(int format)
Set the serialization format for the expiration.
Specified by:
setSerialFormat in interface Lease

renew

public void renew(long duration)
           throws UnknownLeaseException,
                  LeaseDeniedException,
                  java.rmi.RemoteException
Renew the lease for a duration relative to now.
Specified by:
renew in interface Lease

doRenew

protected abstract long doRenew(long duration)
                         throws UnknownLeaseException,
                                LeaseDeniedException,
                                java.rmi.RemoteException
Renew the lease for a duration relative to now, and return the duration actually granted.


Copyright © 1999 Sun Microsystems, Inc. All rights reserved