Package net.jini.core.lease

Examples of net.jini.core.lease.Lease


    "\nas expected but the instances are different.";
      throw new TestException(message);
  }

  // Assert that getLease() returns the one we expect
  Lease managedLease = rfe.getLease();
  if (managedLease.equals(lease) == false) {
      String message = "The getLease() method did not return\n" +
    "the expected lease.";
      throw new TestException(message);
  }
    }
View Full Code Here


        EventLogIterator iter = persistent?
      eventLogFactory.iterator(uuid,
          getEventLogPath(persistenceDirectory, uuid)):
      eventLogFactory.iterator(uuid);
        ServiceRegistration reg = new ServiceRegistration(uuid, iter);
        Lease l = null;
        try {
      Result r =
          leasePolicy.grant(reg, duration);
      reg.setExpiration(r.expiration);
            l = leaseFactory.newLease(uuid, r.expiration);
View Full Code Here

  List acc = new java.util.LinkedList();
  if (proxy instanceof JavaSpace05) {
    MatchSet set =
      ((JavaSpace05) proxy).contents(Collections.singleton(null),
             null, Lease.ANY, Integer.MAX_VALUE);
    Lease lease = set.getLease();
    if (lease != null) {
      lease = (Lease) browser.leasePreparer.prepareProxy(lease);
      browser.leaseMgr.renewUntil(lease, Lease.ANY, null);
    }
    try {
View Full Code Here

         * involves remote calls, lease proxies should be prepared before
         * management of the associated leases begins. This allows one to
         * verify trust in the lease, and ensures that the appropriate
         * constraints are attached to the lease.
         */
        Lease eventLease = e.getLease();
        eventLease = (Lease)eventLeasePreparer.prepareProxy(eventLease);
        logger.log(Level.FINEST, "ServiceDiscoveryManager - proxy to event "
                   +"registration lease prepared: {0}", eventLease);
        /* Management the lease on the event registration */
        leaseRenewalMgr.renewFor(eventLease,
View Full Code Here

        EventLogIterator iter = persistent?
      eventLogFactory.iterator(uuid,
          getEventLogPath(persistenceDirectory, uuid)):
      eventLogFactory.iterator(uuid);
        ServiceRegistration reg = new ServiceRegistration(uuid, iter);
        Lease l = null;
        try {
      Result r =
          leasePolicy.grant(reg, duration);
      reg.setExpiration(r.expiration);
            l = leaseFactory.newLease(uuid, r.expiration);
View Full Code Here

        public void notify(LeaseRenewalEvent e) {
                Throwable ex = e.getException();
    if ( (ex == null) || (ex instanceof UnknownLeaseException) ) {
                    synchronized(joinSet) {
                        removeTasks(ProxyReg.this);
                        Lease expiredLease = e.getLease();
                        // Maybe re-register
                        int indx = joinSet.indexOf(ProxyReg.this);
                        if(indx >= 0) {//new proxyReg/old ProxyReg.this in set
                            ProxyReg curProxyReg = (ProxyReg)joinSet.get(indx);
                            if(expiredLease.equals(curProxyReg.serviceLease)) {
                                // Okay to re-register
                                addTask(new LeaseExpireNotifyTask
                                                (ProxyReg.this,
                                                 (Entry[])lookupAttr.clone()));
                            }//endif
View Full Code Here

         * involves remote calls, lease proxies should be prepared before
         * management of the associated leases begins. This allows one to
         * verify trust in the lease, and ensures that the appropriate
         * constraints are attached to the lease.
         */
        Lease eventLease = e.getLease();
        eventLease = (Lease)eventLeasePreparer.prepareProxy(eventLease);
        logger.log(Level.FINEST, "ServiceDiscoveryManager - proxy to event "
                   +"registration lease prepared: {0}", eventLease);
        /* Management the lease on the event registration */
        leaseRenewalMgr.renewFor(eventLease,
View Full Code Here

        EventLogIterator iter = persistent?
      eventLogFactory.iterator(uuid,
          getEventLogPath(persistenceDirectory, uuid)):
      eventLogFactory.iterator(uuid);
        ServiceRegistration reg = new ServiceRegistration(uuid, iter);
        Lease l = null;
        try {
      Result r =
          leasePolicy.grant(reg, duration);
      reg.setExpiration(r.expiration);
            l = leaseFactory.newLease(uuid, r.expiration);
View Full Code Here

  LeaseRenewalSet set = lrs.createLeaseRenewalSet(renewSetDur);
  set = prepareSet(set);
  lrm.renewFor(prepareLease(set.getRenewalSetLease()), renewSetDur, null);

  // create a test lease to be managed and add to renewal set
  Lease testLease[] = new Lease[3];
  for (int i = 0; i < 3; ++i) {
      logger.log(Level.FINE, "Creating the lease to be managed.");
      logger.log(Level.FINE, "Duration == " + renewGrant);
      testLease[i] = leaseProvider.createNewLease
    (leaseOwner, rstUtil.durToExp(renewGrant));
View Full Code Here

  // capture the two event whose sequence numbers overlap
  RenewalFailureEvent evt01 = (RenewalFailureEvent) evtArr01[evtIndex01];
  RenewalFailureEvent evt02 = (RenewalFailureEvent) evtArr02[evtIndex02];
 
  // they are the same if the leases that failed are the same
  Lease lease01 = evt01.getLease();
  Lease lease02 = evt02.getLease();

  // return the truth of the matter
  return lease01.equals(lease02) == false;
    }
View Full Code Here

TOP

Related Classes of net.jini.core.lease.Lease

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.