Examples of renewFor()


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

      leaseProvider.createNewLease(leaseOwner, Lease.FOREVER);

  /* assert that using a membership duration of 0
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, 0);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += " with a 0 membership duration has failed.";
      throw new TestException(message, ex);
View Full Code Here

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

  }     

  /* assert that using a membership duration of -99 (negative test)
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, -99);
      // success, keep on trucking ... 
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a negative membership duration has ";
      message += "failed.";
View Full Code Here

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

  }
 
  /* assert that using a membership duration of Lease.ANY
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, Lease.ANY);
      set.remove(testLease);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a Lease.ANY membership duration\n";
View Full Code Here

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

  }     

  /* assert that using a membership duration of Lease.FOREVER
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, Lease.FOREVER);
      set.remove(testLease);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a Lease.FOREVER membership duration\n";
View Full Code Here

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

  }     

  /* assert that using a membership duration of Long.MAX_VALUE
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, Long.MAX_VALUE);
      set.remove(testLease);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a Long.MAX_VALUE membership duration\n";
View Full Code Here

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

  }     

  /* assert that using a membership duration of 1 (edge case)
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, 1);
      set.remove(testLease);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a 1 millisecond membership duration\n";
View Full Code Here

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

  }     

  /* assert that using a membership duration of 30000 (normal case)
     does NOT generate an IllegalArgumentException */
  try {
      set.renewFor(testLease, 30000L);
      set.remove(testLease);
      // success, keep on trucking ...
  } catch (IllegalArgumentException ex) {
      String message = "An attempt to add a client lease\n";
      message += "with a 30000 millisecond membership duration\n";
View Full Code Here

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

  rstUtil.waitForLeaseExpiration(testLease,
               "for client lease to expire.");

  /* this should trigger an immediate renewal failure event.
     (implementation dependent? I think so.) */
  set.renewFor(testLease, Lease.FOREVER);

  // wait for an event to arrive
  rstUtil.waitForRemoteEvents(rrl, 1, 30000L);

  // assert we received exactly one event
View Full Code Here

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

      leaseProvider.createNewLease(leaseOwner, Lease.FOREVER);

  // start managing the lease for the base membership time
  logger.log(Level.FINE, "Adding lease with membership of " +
        membershipDuration + " milliseconds");
  set.renewFor(testLease, membershipDuration);

  // wait for 1/2 the membership time
  long sleepTime = membershipDuration / 2;
  rstUtil.sleepAndTell(sleepTime, "1/2 lease membership duration.");
View Full Code Here

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

  // now add the lease again doubling the membership duration
  long doubleDuration = membershipDuration * 2;
  logger.log(Level.FINE, "Adding lease with membership of " +
        doubleDuration + " milliseconds");
  set.renewFor(testLease, doubleDuration);

  // sleep for 3/4 of the doubled membershipDuration
  sleepTime = doubleDuration * 3 / 4;
  rstUtil.sleepAndTell(sleepTime, "3/4 lease membership duration.");

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.