Package net.jini.core.lease

Examples of net.jini.core.lease.UnknownLeaseException


  // Has the lease expired?
  if (expiration < now) {
      if (!ensureCurrent(now))
    setRsltIfNeeded("Renwal service let lease expire");
      throw new UnknownLeaseException("Lease expired");
  }

  // Have the asked for the right renewal?
 
  // Are they supposted to ask for Lease.ANY, and if they
View Full Code Here


        concurrentObj.priorityWriteLock();
        try {
            RegistrationInfo regInfo
                   = (RegistrationInfo)(registrationByID.get(registrationID));
            if(regInfo == null) {
                throw new UnknownLeaseException
                                 ("\n    Invalid registration ID on call to "
                                  +"cancelLease() method"
                                  +"\n    The lease may have expired or been "
                                  +"cancelled");
            }//endif
View Full Code Here

        concurrentObj.writeLock();
        try {
            RegistrationInfo regInfo
                   = (RegistrationInfo)(registrationByID.get(registrationID));
            if(regInfo == null) {
                throw new UnknownLeaseException
                                 ("\n    Invalid registration ID on call to "
                                  +"cancelLease() method"
                                  +"\n    The lease may have expired or been "
                                  +"cancelled");
            }//endif
View Full Code Here

            throw new IllegalArgumentException("non-positive lease duration");
        }//endif
        if (    (regInfo == null)
             || ( !(regInfo.leaseID).equals(leaseID) )
             || (regInfo.leaseExpiration <= curTime) ) {
            throw new UnknownLeaseException();
        }//endif
        if(    (duration > leaseBound)
      && (duration > (regInfo.leaseExpiration - curTime)) ) {
            duration = Math.max( (regInfo.leaseExpiration - curTime),
                                 leaseBound );
View Full Code Here

    private void cancelLeaseDo(RegistrationInfo regInfo, Uuid leaseID)
                                     throws UnknownLeaseException, IOException
    {
        long curTime = System.currentTimeMillis();
        if ( (regInfo == null) || (regInfo.leaseExpiration <= curTime) ) {
            throw new UnknownLeaseException();
        }//endif
        removeRegistration(regInfo);
        /* wake up thread if this might be the (only) earliest time */
        if (regInfo.leaseExpiration == minExpiration) {
            concurrentObj.waiterNotify(leaseExpireThreadSyncObj);
View Full Code Here

       // create an owner for the lease that will renewal successfully
       succeedingOwner = new OpCountingOwner(renewGrant);
      
       // create an owner for the lease that will throw a definite exception
       String testName = "AssocRenewalFailSetTest";
       Exception except = new UnknownLeaseException(testName);
       failingOwner = new FailingOpCountingOwner(except, 0, renewGrant*2);

       // logs events as they arrive
       rrl = new RememberingRemoteListener(getExporter());

View Full Code Here

      // Registration doesn't exist or has expired
      if(leaseLogger.isLoggable(Level.FINEST)) {
                leaseLogger.log(Level.FINEST,
        "Lease for {0} was NOT renewed", cookie);
      }
      throw new UnknownLeaseException("Not managing requested lease");
  }

  if(leaseLogger.isLoggable(Level.FINEST)) {
            leaseLogger.log(Level.FINEST,
          "Lease for {0} was renewed", cookie);
View Full Code Here

                expirationLogger.log(Level.FINEST, "Iterator notified");
            }
           
  } catch (ThrowThis tt) {
      // Registration doesn't exist or has expired
      throw new UnknownLeaseException("Not managing requested lease");
  }
      if(leaseLogger.isLoggable(Level.FINEST)) {
            leaseLogger.log(Level.FINEST,
          "Lease cancelled for: {0}", cookie);
      }
View Full Code Here

  // Has the lease expired?
  if (!ensureCurrent(now)) {
      setRsltIfNeeded("Renwal service let lease expire, " +
          (now - expiration) + " ms late");
      throw new UnknownLeaseException("Lease expired");
  }

  // Have the asked for the right renewal?
  if (!isValidExtension(extension))
      throw new LeaseDeniedException("Did not ask for right extension");
View Full Code Here

    /** Log and throw a new UnknownLeaseException */
    private UnknownLeaseException throwNewUnknownLeaseException(
            Object cookie)
  throws UnknownLeaseException
    {
  final UnknownLeaseException ule = new UnknownLeaseException();
  if (leaseLogger.isLoggable(Levels.FAILED)) {
      leaseLogger.log(Levels.FAILED, "unable to find lease for " +
          cookie, ule);
  }

View Full Code Here

TOP

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

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.