Package net.jini.lease

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


  // 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


  logger.log(Level.FINE, "Creating lease #1 with duration of " +
        renewGrant + " milliseconds.");
  TestLease lease01 =
      leaseProvider.createNewLease(failingOwner,
           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(failingOwner,
View Full Code Here

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

  logger.log(Level.FINE, "Creating lease #3 with duration of " +
        renewGrant + " milliseconds.");
  TestLease lease03 =
      leaseProvider.createNewLease(failingOwner,
View Full Code Here

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

  // sleep until the leases have expired.
  rstUtil.waitForRemoteEvents(rrl, 3, renewGrant * 2);

  // ensure that we have exactly 3 events
View Full Code Here

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

  // wait until the test leases have expired
  rstUtil.waitForRemoteEvents(rrl, NUMBER_OF_TEST_LEASES,
            renewGrant * 2);
 
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

  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

      leaseProvider.createNewLease(leaseOwner, Lease.FOREVER);

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

  logger.log(Level.FINE, "Adding normal lease #2 with membership of " +
        "Lease.FOREVER");
  set.renewFor(testLease02, Lease.FOREVER);
View Full Code Here

        "Lease.FOREVER");
  set.renewFor(testLease01, Lease.FOREVER);

  logger.log(Level.FINE, "Adding normal lease #2 with membership of " +
        "Lease.FOREVER");
  set.renewFor(testLease02, Lease.FOREVER);

  logger.log(Level.FINE, "Adding normal lease #3 with membership of " +
        "Lease.FOREVER");
  set.renewFor(testLease03, Lease.FOREVER);
View Full Code Here

        "Lease.FOREVER");
  set.renewFor(testLease02, Lease.FOREVER);

  logger.log(Level.FINE, "Adding normal lease #3 with membership of " +
        "Lease.FOREVER");
  set.renewFor(testLease03, Lease.FOREVER);

  // create 2 unreadable test leases to be managed
  logger.log(Level.FINE, "Creating an unreadable lease #1 to be" +
        " managed.");
  logger.log(Level.FINE, "Duration == Lease.FOREVER");
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.