Package javax.ejb

Examples of javax.ejb.AccessTimeout.unit()


         if (timeout.value() < 0)
         {
            // for any negative value of timeout, we just default to max timeout val and max timeout unit.
            // violation of spec! But we don't want to wait indefinitely.
            logger.info("Ignoring a negative @AccessTimeout value: " + timeout.value() + " and timeout unit: "
                  + timeout.unit().name() + ". Will default to timeout value: " + DEFAULT_MAX_TIMEOUT_VALUE
                  + " and timeout unit: " + DEFAULT_MAX_TIMEOUT_UNIT.name());
         }
         else
         {
            time = timeout.value();
View Full Code Here


                  + " and timeout unit: " + DEFAULT_MAX_TIMEOUT_UNIT.name());
         }
         else
         {
            time = timeout.value();
            unit = timeout.unit();
         }
      }
      boolean success = lock.tryLock(time, unit);
      if(!success)
      {
View Full Code Here

      Lock lock = getLock(lockableComponent, invokedMethod);
      // the default access timeout (will be used in the absence of any explicit access timeout value for the invoked method)
      AccessTimeout defaultAccessTimeout = lockableComponent.getDefaultAccessTimeout();
      // set to the default values
      long time = defaultAccessTimeout.value();
      TimeUnit unit = defaultAccessTimeout.unit();

      AccessTimeout accessTimeoutOnMethod = lockableComponent.getAccessTimeout(invokedMethod);
      if (accessTimeoutOnMethod != null)
      {
         if (accessTimeoutOnMethod.value() < 0)
View Full Code Here

         if (accessTimeoutOnMethod.value() < 0)
         {
            // for any negative value of timeout, we just default to max timeout val and max timeout unit.
            // violation of spec! But we don't want to wait indefinitely.
            logger.debug("Ignoring a negative @AccessTimeout value: " + accessTimeoutOnMethod.value() + " and timeout unit: "
                    + accessTimeoutOnMethod.unit().name() + ". Will default to timeout value: " + defaultAccessTimeout.value()
                    + " and timeout unit: " + defaultAccessTimeout.unit().name());
         }
         else
         {
            // use the explicit access timeout values specified on the method
View Full Code Here

         }
         else
         {
            // use the explicit access timeout values specified on the method
            time = accessTimeoutOnMethod.value();
            unit = accessTimeoutOnMethod.unit();
         }
      }
      // try getting the lock
      boolean success = lock.tryLock(time, unit);
      if (!success)
View Full Code Here

                      apiMethod, apiClass,
                      implementationMethod, implementationClass);

    if (accessTimeoutAttribute != null) {
      _lockTimeout = accessTimeoutAttribute.timeout();
      _lockTimeoutUnit = accessTimeoutAttribute.unit();
    }
  }

  /**
   * Generates the class prologue.
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.