Package net.jini.core.lease

Examples of net.jini.core.lease.Lease.renew()


        for(int i=0;i<leaseList.size();i++) {
            Lease srvcLease = (Lease)(leaseList.get(i));
            logger.log(Level.FINE, "service lease["+i+"] changed to expire "
                              +"within "+(newLeaseDur/1000)+" second(s) -- "
                              +"simulates a down service");
            srvcLease.renew(newLeaseDur);
        }//end loop
        /* Remove all leases so we don't try to cancel them during shutdown. */
        leaseList.clear();
    }//end shortenLeases

View Full Code Here


    }

    // deal with renewing the lease
    if (renewalsLeft.get() > 0) {
        logger.log(Level.INFO, "Renewing set lease");
        eventLease.renew(setLeaseLength);
        setLeaseCurrentExpiration = eventLease.getExpiration();

        if (renewalsLeft.get() == 1) {
      synchronized (this) {
          setExpiration = eventLease.getExpiration();
View Full Code Here

  logger.log(Level.INFO, "Sleeping past expiration");
  Thread.sleep(DURATION);

  logger.log(Level.INFO, "Attempting to cancel lease");
  try {
      lease.renew(DURATION);
      throw new TestException( "Successfully renewed an expired lease");
  } catch (UnknownLeaseException ule) {
      logger.log(Level.INFO, "Caught expected exception upon renewal");
  }
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.