home *** CD-ROM | disk | FTP | other *** search
/ Symantec Visual Cafe for Java 2.5 / symantec-visual-cafe-2.5-database-dev-edition.iso / VPage / Java.bin / CLASSES.ZIP / sun / rmi / transport / LeaseInfo.class (.txt) < prev    next >
Encoding:
Java Class File  |  1997-07-08  |  1.5 KB  |  45 lines

  1. package sun.rmi.transport;
  2.  
  3. import java.rmi.dgc.VMID;
  4. import java.rmi.server.LogStream;
  5. import java.util.Enumeration;
  6. import java.util.Vector;
  7.  
  8. class LeaseInfo {
  9.    VMID vmid;
  10.    long expiration;
  11.    Vector notifyList = new Vector();
  12.  
  13.    LeaseInfo(VMID var1, long var2) {
  14.       this.vmid = var1;
  15.       this.expiration = System.currentTimeMillis() + var2;
  16.    }
  17.  
  18.    synchronized void renew(long var1) {
  19.       long var3 = System.currentTimeMillis() + var1;
  20.       if (var3 > this.expiration) {
  21.          this.expiration = var3;
  22.       }
  23.  
  24.    }
  25.  
  26.    boolean expired(long var1) {
  27.       if (this.expiration >= var1) {
  28.          return false;
  29.       } else {
  30.          if (DGCImpl.logLevel >= 10) {
  31.             LogStream.log("dgc").println("LeaseInfo.expired: " + this.vmid);
  32.          }
  33.  
  34.          Enumeration var3 = this.notifyList.elements();
  35.  
  36.          while(var3.hasMoreElements()) {
  37.             Target var4 = (Target)var3.nextElement();
  38.             var4.vmidDead(this.vmid);
  39.          }
  40.  
  41.          return true;
  42.       }
  43.    }
  44. }
  45.