home *** CD-ROM | disk | FTP | other *** search
/ Java 1.2 How-To / JavaHowTo.iso / 3rdParty / jbuilder / unsupported / JDK1.2beta3 / SOURCE / SRC.ZIP / java / rmi / dgc / Lease.java < prev    next >
Encoding:
Java Source  |  1998-03-20  |  1.3 KB  |  54 lines

  1. /*
  2.  * @(#)Lease.java    1.5 98/03/18
  3.  *
  4.  * Copyright 1996, 1997 by Sun Microsystems, Inc.,
  5.  * 901 San Antonio Road, Palo Alto, California, 94303, U.S.A.
  6.  * All rights reserved.
  7.  *
  8.  * This software is the confidential and proprietary information
  9.  * of Sun Microsystems, Inc. ("Confidential Information").  You
  10.  * shall not disclose such Confidential Information and shall use
  11.  * it only in accordance with the terms of the license agreement
  12.  * you entered into with Sun.
  13.  */
  14. package java.rmi.dgc;
  15.  
  16. /**
  17.  * A lease contains a unique VM identifier and a lease duration. A
  18.  * Lease object is used to request and grant leases to remote object
  19.  * references.
  20.  */
  21. public final class Lease implements java.io.Serializable {
  22.  
  23.     private VMID vmid;
  24.     private long value;
  25.     /** indicate compatibility with JDK 1.1.x version of class */
  26.     private static final long serialVersionUID = -5713411624328831948L;
  27.  
  28.     /**
  29.      * Constructs a lease with a specific VMID and lease duration. The
  30.      * vmid may be null.
  31.      */
  32.     public Lease(VMID id, long duration) 
  33.     {
  34.     vmid = id;
  35.     value = duration;
  36.     }
  37.  
  38.     /**
  39.      * Returns the client VMID associated with the lease.
  40.      */
  41.     public VMID getVMID() 
  42.     {
  43.     return vmid;
  44.     }
  45.  
  46.     /**
  47.      * Returns the lease duration.
  48.      */
  49.     public long getValue() 
  50.     {
  51.     return value;
  52.     }
  53. }
  54.