Package net.jini.lease

Examples of net.jini.lease.LeaseRenewalSet.renewFor()


      logger.log(Level.FINE, "Adding long owner lease #" + i +
            " to renewal set.\n" +
            "Renew duration = " + renewDuration +
            " milliseconds.\n" +
            "Membership = Long.MAX_VALUE");
      set.renewFor(longLease[i], Long.MAX_VALUE, renewDuration);

  }

  // sleep past the short membership duration
  long sleepTime = shortMembership + (shortMembership / 4);
View Full Code Here


  // start managing the lease
  logger.log(Level.FINE, "Adding lease with membership of " +
        "Lease.FOREVER");
  long time01 = System.currentTimeMillis();
  set.renewFor(testLease, Lease.FOREVER);

  // Assert that the managed lease has original expiration time
  Lease managedLease = set.remove(testLease);
  long time02 = System.currentTimeMillis();
  long actualExpTime = managedLease.getExpiration();
View Full Code Here

  // start managing the lease
  long membershipDuration = renewGrant + (renewGrant / 2);
  logger.log(Level.FINE, "Adding lease with membership of " +
        membershipDuration + " millseconds.");
  set.renewFor(testLease, membershipDuration);

  // wait for client lease to become renewed
  rstUtil.waitForLeaseExpiration(testLease,
               "for client lease to renew.");
View Full Code Here

  // start managing the lease
  long membershipDur = renewGrant / 2;
  logger.log(Level.FINE, "Adding lease with membership of " +
        membershipDur + " milliseconds.");
  long startTrip = System.currentTimeMillis();
  set.renewFor(testLease, membershipDur);
  long endTrip = System.currentTimeMillis();
  // widen roundtrip to eliminate intermittent failures
  long roundTrip = (endTrip - startTrip) * 10;

  // sleep until the membership duration almost expires
View Full Code Here

        renewGrant + " milliseconds.");
  Lease passFailLease =
      leaseProvider.createNewLease(owner,
           rstUtil.durToExp(renewGrant));
  initialExpiration = passFailLease.getExpiration();
  set.renewFor(passFailLease, Lease.FOREVER);

  // wait for the failure event to roll in ...
  rstUtil.waitForRemoteEvents(rrl, 1, renewGrant * 2);

  // we should have a failure event on record
View Full Code Here

      lease[i] =
    leaseProvider.createNewLease(owner,
               rstUtil.durToExp(duration));
      logger.log(Level.FINE, "Adding lease #" + i + " to renewal set " +
            "with membership duration = Lease.FOREVER.");
      set.renewFor(lease[i], Lease.FOREVER);
  }

  // wait for the listener to receive four events.
  long timeOut = duration;
  rstUtil.waitForRemoteEvents(rrl01, 4, timeOut);
View Full Code Here

 
  // add lease01 to set01 and lease02 to set02
  logger.log(Level.FINE, "Adding lease #1 to set #1");
  set01.renewFor(lease01, Long.MAX_VALUE);
  logger.log(Level.FINE, "Adding lease #2 to set #2");
  set02.renewFor(lease02, Long.MAX_VALUE);
 
  /* wait for the expiration warning events to arrive.
     By the time they do, all RenewalFailureEvents should also
     have arrived. */
  rstUtil.waitForRemoteEvents(normalListener01, 1, renewSetDur);
View Full Code Here

        renewGrant + " milliseconds.");
  TestLease lease04 =
      leaseProvider.createNewLease(failingOwner,
           rstUtil.durToExp(renewGrant));
  logger.log(Level.FINE, "Adding lease #4 to set #2");
  set02.renewFor(lease04, Long.MAX_VALUE);
 
  /*
   * Wait until the expiration warning event rolls in.
   * By that time the renewal failure event should also have arrived.
   */
 
View Full Code Here

  TestLease testLease =
      leaseProvider.createNewLease(rstUtil.durToExp(duration));

  // start managing the lease for as long as we can
  logger.log(Level.FINE, "Adding managed lease to lease renewal set.");
  set.renewFor(testLease, Lease.FOREVER);
 
  // remove the lease and make certain it is the same one we added
  logger.log(Level.FINE, "Removing the managed lease from the set.");
  Lease managedLease = set.remove(testLease);
  if (managedLease.equals(testLease) == false) {
View Full Code Here

  long originalExpTime = testLease.getExpiration();

  // start managing the lease
  logger.log(Level.FINE, "Adding lease with membership of " +
        "Long.MAX_VALUE");
  set.renewFor(testLease, Long.MAX_VALUE);

  // sleep until the test lease expires
  long sleepTime = renewGrant * 2;
  logger.log(Level.FINE, "Sleeping for " + sleepTime + " milliseconds");
  Thread.sleep(sleepTime);
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.