Package com.sun.jini.test.share

Examples of com.sun.jini.test.share.LeaseBackEndImpl


     * @exception RemoteException
     *          when construction of the Landlord fails.
     *
     */
    public TestLeaseProvider(int leaseCount) throws RemoteException {
  leaseBackEnd = new LeaseBackEndImpl(leaseCount);
    }
View Full Code Here


     * @exception RemoteException
     *          when construction of the Landlord fails.
     */
    public TestLeaseProvider(int leaseCount, Class factoryClass)
         throws RemoteException {
  leaseBackEnd = new LeaseBackEndImpl(leaseCount, factoryClass);
    }
View Full Code Here

  setKeep = prepareSet(setKeep);
  Lease expsLease = setExpire.getRenewalSetLease();
        expsLease = (Lease) getConfig().prepare(
            "test.normLeasePreparer", expsLease);

  final LeaseBackEndImpl backend = new LeaseBackEndImpl(leaseCount);

  for (int i=0; i<leaseCount; i+=2) {
      long initExpiration = System.currentTimeMillis() + renewGrant;
      LeaseOwner o = new ForeverOwner(initExpiration, renewGrant,
          latencySlop, Lease.FOREVER, this, true, getConfig());
      Lease l = backend.newLease(o, initExpiration);
      setKeep.renewFor(l, Lease.FOREVER);

      initExpiration = System.currentTimeMillis() + renewGrant;
      o = new ExpiryOwner(initExpiration, renewGrant,
          latencySlop, Lease.FOREVER, this, true, getConfig(), expsLease);
      l = backend.newLease(o, initExpiration);
      long delta = System.currentTimeMillis() - setCreation;
      System.out.println("Delta => " + delta);
      setExpire.renewFor(l, Lease.FOREVER);
  }

  // Sleep until the first lease expires + its initial length, or we
  // detect a failure
  synchronized (this) {
      while (true) {
    LeaseOwner[] owners = backend.getOwners();

    // See if there have been any failures
    for (int i=0; i<owners.length; i++) {
        final TrackingOwner owner = (TrackingOwner)owners[i];
        final String rslt = owner.didPass();
View Full Code Here

TOP

Related Classes of com.sun.jini.test.share.LeaseBackEndImpl

Copyright © 2018 www.massapicom. 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.