Package com.sun.jini.landlord

Examples of com.sun.jini.landlord.LeasePeriodPolicy


        throws UnknownLeaseException, LeaseDeniedException
    {
  leaseLogger.entering("OutriggerServerImpl","renew");

  LeasedResource    resource;
  LeasePeriodPolicy policy;
 
  if (null != (resource = contents.getLeasedResource(cookie)))
      policy = entryLeasePolicy;
  else if (null !=
     (resource = (LeasedResource)eventRegistrations.get(cookie)))
      policy = eventLeasePolicy;
  else if (null !=
     (resource = (LeasedResource)contentsQueries.get(cookie)))
      policy = contentsLeasePolicy;
  else
      throw throwNewUnknownLeaseException(cookie);

  synchronized (resource) {
      if (resource.getExpiration() <= System.currentTimeMillis()) {
    // Lease has expired, don't renew
    throw throwNewUnknownLeaseException(cookie);
      }

      // No one can expire the lease, so it is safe to update.
      final LeasePeriodPolicy.Result r =
    policy.renew(resource, extension);

      if (log != null)
    log.renewOp((Uuid)cookie, r.expiration);

      resource.setExpiration(r.expiration);
View Full Code Here


        throws UnknownLeaseException, LeaseDeniedException
    {
  leaseLogger.entering("OutriggerServerImpl","renew");

  LeasedResource    resource;
  LeasePeriodPolicy policy;
 
  if (null != (resource = contents.getLeasedResource(cookie)))
      policy = entryLeasePolicy;
  else if (null !=
     (resource = (LeasedResource)eventRegistrations.get(cookie)))
      policy = eventLeasePolicy;
  else if (null !=
     (resource = (LeasedResource)contentsQueries.get(cookie)))
      policy = contentsLeasePolicy;
  else
      throw throwNewUnknownLeaseException(cookie);

  synchronized (resource) {
      if (resource.getExpiration() <= System.currentTimeMillis()) {
    // Lease has expired, don't renew
    throw throwNewUnknownLeaseException(cookie);
      }

      // No one can expire the lease, so it is safe to update.
      final LeasePeriodPolicy.Result r =
    policy.renew(resource, extension);

      if (log != null)
    log.renewOp((Uuid)cookie, r.expiration);

      resource.setExpiration(r.expiration);
View Full Code Here

        throws UnknownLeaseException, LeaseDeniedException
    {
  leaseLogger.entering("OutriggerServerImpl","renew");

  LeasedResource    resource;
  LeasePeriodPolicy policy;
 
  if (null != (resource = contents.getLeasedResource(cookie)))
      policy = entryLeasePolicy;
  else if (null !=
     (resource = (LeasedResource)eventRegistrations.get(cookie)))
      policy = eventLeasePolicy;
  else if (null !=
     (resource = (LeasedResource)contentsQueries.get(cookie)))
      policy = contentsLeasePolicy;
  else
      throw throwNewUnknownLeaseException(cookie);

  synchronized (resource) {
      if (resource.getExpiration() <= System.currentTimeMillis()) {
    // Lease has expired, don't renew
    throw throwNewUnknownLeaseException(cookie);
      }

      // No one can expire the lease, so it is safe to update.
      final LeasePeriodPolicy.Result r =
    policy.renew(resource, extension);

      if (log != null)
    log.renewOp((Uuid)cookie, r.expiration);

      resource.setExpiration(r.expiration);
View Full Code Here

        long DEFAULT_LEASE_TIME = TimeConstants.FIVE_MINUTES;
        /* 1 day max lease time */
        long DEFAULT_MAX_LEASE_TIME = TimeConstants.ONE_DAY;

        /* Get the Lease policy */
        LeasePeriodPolicy provisionerLeasePolicy =
            (LeasePeriodPolicy)Config.getNonNullEntry(config,
                                                      CONFIG_COMPONENT,
                                                      "provisionerLeasePeriodPolicy",
                                                      LeasePeriodPolicy.class,
                                                      new FixedLeasePeriodPolicy(DEFAULT_MAX_LEASE_TIME,
View Full Code Here

TOP

Related Classes of com.sun.jini.landlord.LeasePeriodPolicy

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.