Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.sun.jini.lease
Class AbstractLease

    java.lang.Object
      com.sun.jini.lease.AbstractLease

All Implemented Interfaces:
  Lease, Serializable

Direct Known Subclasses:
  LandlordLease

public abstract class AbstractLease
extends Object
implements Lease, 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.

Fields inherited from interface net.jini.core.lease.Lease
`ABSOLUTE, ANY, DURATION, FOREVER`

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`

Methods inherited from interface net.jini.core.lease.Lease
`canBatch, cancel, createLeaseMap`

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`
  Returns:
    a long value in milliseconds from the beginning of the epoch relative to the local clock that represents the absolute time that the lease will expire.

### getSerialFormat

    public int getSerialFormat()

  Return the serialization format for the expiration.

  Specified by:
    `getSerialFormat` in interface `Lease`
  Returns:
    an `int` representing the serial format value
  See Also:
    `Lease.setSerialFormat(int)`

### setSerialFormat

    public void setSerialFormat(int format)

  Set the serialization format for the expiration.

  Specified by:
    `setSerialFormat` in interface `Lease`
  Parameters:
    `format` - DURATION or ABSOLUTE
  See Also:
    `Lease.getSerialFormat()`

### renew

    public void renew(long duration)
               throws UnknownLeaseException,
                      LeaseDeniedException,
                      RemoteException

  Renew the lease for a duration relative to now.

  Specified by:
    `renew` in interface `Lease`
  Parameters:
    `duration` - the requested duration in milliseconds
  Throws:
    `UnknownLeaseException` - the lease being renewed is unknown to the lease grantor
    `LeaseDeniedException` - the lease grantor is unable or unwilling to renew the lease
    `RemoteException`

### doRenew

    protected abstract long doRenew(long duration)
                             throws UnknownLeaseException,
                                    LeaseDeniedException,
                                    RemoteException

  Renew the lease for a duration relative to now, and return the duration actually granted.

  Throws:
    `UnknownLeaseException`
    `LeaseDeniedException`
    `RemoteException`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004 Sun Microsystems, Inc. All rights reserved