Package net.jini.lease

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


      logger.log(Level.FINE, "Creating lease with duration of " +
            renewGrant*3 + " milliseconds.");
      lease[i+1] =
    longLeaseProvider.createNewLease(owner,
             rstUtil.durToExp(renewGrant*3));
      set.renewFor(lease[i+1], Lease.FOREVER);
  }

  // allow the leases with lower duration times to expire
  rstUtil.waitForLeaseExpiration(lease[4],
      "for client leases with lower expiration times to expire.");
View Full Code Here


      leaseProvider.createNewLease(indefiniteOwner,
           rstUtil.durToExp(renewGrant));

  // start managing the lease for as long as we can
  logger.log(Level.FINE, "Adding managed lease to lease renewal set.");
  set.renewFor(testLease, Long.MAX_VALUE);
 
  // wait for the event to arrive
  long timeout = renewGrant * 2;
  boolean gotEvent = rstUtil.waitForRemoteEvents(rrl, 1, timeout);
  if (gotEvent == false) {
View Full Code Here

      long membershipDur = renewGrant * (i+1);
      // start managing the lease
      logger.log(Level.FINE, "Adding lease with membership of " +
            membershipDur + " milliseconds.");
      set.renewFor(testLease[i], membershipDur);
  }

  // take a snap shot of the leases (should have them all)
  Lease[] leaseArray01 = set.getLeases();

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

  logger.log(Level.FINE, "Creating lease #1 with duration of " +
        renewGrant + " milliseconds.");
  TestLease lease01 =
      leaseProvider.createNewLease(succeedingOwner,
           rstUtil.durToExp(renewGrant));
  set.renewFor(lease01, Long.MAX_VALUE);
 
  logger.log(Level.FINE, "Creating lease #2 with duration of " +
        renewGrant + " milliseconds.");
  TestLease lease02 =
      leaseProvider.createNewLease(succeedingOwner,
View Full Code Here

  logger.log(Level.FINE, "Creating lease #2 with duration of " +
        renewGrant + " milliseconds.");
  TestLease lease02 =
      leaseProvider.createNewLease(succeedingOwner,
           rstUtil.durToExp(renewGrant));
  set.renewFor(lease02, Long.MAX_VALUE);

  // create the lease to be managed
  long longerGrant = renewGrant * 2;
  logger.log(Level.FINE, "Creating lease #3 with duration of " +
        longerGrant + " milliseconds.");
View Full Code Here

  logger.log(Level.FINE, "Creating lease #3 with duration of " +
        longerGrant + " milliseconds.");
  TestLease lease03 =
      leaseProvider.createNewLease(failingOwner,
           rstUtil.durToExp(longerGrant));
  set.renewFor(lease03, Long.MAX_VALUE);

  // wait for the failing lease to renew
  rstUtil.waitForRemoteEvents(rrl, 1, longerGrant);

  // assert we only received 1 event
View Full Code Here

      leaseProvider.createNewLease(leaseOwner, Lease.FOREVER);

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

  // remove the lease
  Lease managedLease = set.remove(testLease);
  if (managedLease.equals(testLease) == false) {
      String message = "Lease removed does not match the lease\n" +
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.