Examples of unit()


Examples of javax.ejb.AccessTimeout.unit()

        final StatefulSessionComponent component = getComponent(context, StatefulSessionComponent.class);
        final StatefulSessionComponentInstance instance = getComponentInstance(context);

        // TODO: per method
        AccessTimeout timeout = component.getAccessTimeout();
        boolean acquired = lock.tryLock(timeout.value(), timeout.unit());
        if(!acquired) {
            throw new ConcurrentAccessTimeoutException("EJB 3.1 FR 4.3.14.1 concurrent access timeout on " + context
                 + " - could not obtain lock within " + timeout.value() + timeout.unit());
        }
View Full Code Here

Examples of javax.ejb.AccessTimeout.unit()

        // TODO: per method
        AccessTimeout timeout = component.getAccessTimeout();
        boolean acquired = lock.tryLock(timeout.value(), timeout.unit());
        if(!acquired) {
            throw new ConcurrentAccessTimeoutException("EJB 3.1 FR 4.3.14.1 concurrent access timeout on " + context
                 + " - could not obtain lock within " + timeout.value() + timeout.unit());
        }

        TransactionSynchronizationRegistry transactionSynchronizationRegistry = component.getTransactionSynchronizationRegistry();
        Object currentTransactionKey = transactionSynchronizationRegistry.getTransactionKey();
        if(transactionKey != null) {
View Full Code Here

Examples of javax.ejb.AccessTimeout.unit()

                    // are overridden and applies the correct .xml overriding semantics.
                    if(!matchesExistingAccessTimeoutMethod(annMethod, sessionDesc)) {
                     
                        MethodDescriptor newMethodDesc = new MethodDescriptor(annMethod);
                        sessionDesc.addAccessTimeoutMethod(newMethodDesc, timeout.value(),
                                                             timeout.unit());
                    }
                }
            }
        }
View Full Code Here

Examples of javax.ejb.AccessTimeout.unit()

            // descriptor, set it.
            if( !matchesExistingAccessTimeoutMethod(m, ejbDesc) ) {

                MethodDescriptor newMethodDesc = new MethodDescriptor(m);
                    ejbDesc.addAccessTimeoutMethod(newMethodDesc, timeoutAnn.value(),
                                                   timeoutAnn.unit());
            }
        }

    }
View Full Code Here

Examples of javax.ejb.AccessTimeout.unit()

        if (log.isTraceEnabled()) {
            log.trace("Trying to acquire lock: " + lock + " for stateful component instance: " + instance + " during invocation: " + context);
        }
        // we obtain a lock in this synchronization interceptor because the lock needs to be tied to the synchronization
        // so that it can released on the tx synchronization callbacks
        boolean acquired = lock.tryLock(timeout.value(), timeout.unit());
        if (!acquired) {
            throw new ConcurrentAccessTimeoutException("EJB 3.1 FR 4.3.14.1 concurrent access timeout on " + context
                    + " - could not obtain lock within " + timeout.value() + timeout.unit());
        }
        if (log.isTraceEnabled()) {
View Full Code Here

Examples of javax.ejb.AccessTimeout.unit()

        // we obtain a lock in this synchronization interceptor because the lock needs to be tied to the synchronization
        // so that it can released on the tx synchronization callbacks
        boolean acquired = lock.tryLock(timeout.value(), timeout.unit());
        if (!acquired) {
            throw new ConcurrentAccessTimeoutException("EJB 3.1 FR 4.3.14.1 concurrent access timeout on " + context
                    + " - could not obtain lock within " + timeout.value() + timeout.unit());
        }
        if (log.isTraceEnabled()) {
            log.trace("Acquired lock: " + lock + " for stateful component instance: " + instance + " during invocation: " + context);
        }
View Full Code Here

Examples of javax.ejb.AccessTimeout.unit()

      TimeUnit unit = TimeUnit.MINUTES;
      AccessTimeout timeout = getAccessTimeout(invocation);
      if(timeout != null)
      {
         time = timeout.value();
         unit = timeout.unit();
      }
      boolean success = lock.tryLock(time, unit);
      if(!success)
         throw new ConcurrentAccessTimeoutException("EJB 3.1 PFD2 4.8.5.5.1 concurrent access timeout on " + invocation);
      try
View Full Code Here

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

Examples of javax.ejb.AccessTimeout.unit()

                  + " 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

Examples of javax.ejb.AccessTimeout.unit()

      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
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.