java.rmi.dgc

Class Lease

Implemented Interfaces:
Serializable

public final class Lease
extends Object
implements Serializable

A lease contains a unique VM identifier and a lease duration. A Lease object is used to request and grant leases to remote object references.
See Also:
Serialized Form

Constructor Summary

Lease(VMID id, long duration)
Constructs a lease with a specific VMID and lease duration.

Method Summary

VMID
getVMID()
Returns the client VMID associated with the lease.
long
getValue()
Returns the lease duration.

Methods inherited from class java.lang.Object

clone, equals, extends Object> getClass, finalize, hashCode, notify, notifyAll, toString, wait, wait, wait

Constructor Details

Lease

public Lease(VMID id,
             long duration)
Constructs a lease with a specific VMID and lease duration. The vmid may be null.
Parameters:
id - VMID associated with this lease
duration - lease duration
Usages and Demos :

View More Examples of Lease(VMID id,long duration)
   1:         long leaseValue = LEASE_VALUE;
   2:     lease = new Lease(vmid, leaseValue);
   3:         synchronized(leaseCache){
   4:             LeaseRecord lr = (LeaseRecord)leaseCache.get(vmid);
   5:             if (lr != null)

View Full Code Here

Method Details

getVMID

public VMID getVMID()
Returns the client VMID associated with the lease.
Returns:
client VMID
Usages and Demos :

View More Examples of getVMID()
   1: import java.rmi.dgc.DGC;
   2: import java.rmi.dgc.Lease;
   3: import java.rmi.dgc.VMID;
   4:         ...
   5: 
   6: public Lease dirty(ObjID[] ids, long sequenceNum, Lease lease) throws RemoteException {
   7:         ...
   8:     VMID vmid = lease.getVMID();
   9:         if (vmid == null)

View Full Code Here

getValue

public long getValue()
Returns the lease duration.
Returns:
lease duration