Package javax.ejb

Examples of javax.ejb.AccessTimeout


      AccessTimeoutMetaData accessTimeoutMetaData = sessionBean.getAccessTimeout();
      if (accessTimeoutMetaData == null)
      {
         return null;
      }
      AccessTimeout accessTimeout = new AccessTimeoutImpl(accessTimeoutMetaData.getTimeout(), accessTimeoutMetaData
            .getUnit());
      return annotationClass.cast(accessTimeout);
   }
View Full Code Here


      // method "*"
      if (accessTimeoutMetaData == null)
      {
         return null;
      }
      AccessTimeout accessTimeout = new AccessTimeoutImpl(accessTimeoutMetaData.getTimeout(), accessTimeoutMetaData
            .getUnit());
      return annotationClass.cast(accessTimeout);
   }
View Full Code Here

      AccessTimeoutMetaData accessTimeoutMetaData = sessionBean.getAccessTimeout();
      if (accessTimeoutMetaData == null)
      {
         return null;
      }
      AccessTimeout accessTimeout = new AccessTimeoutImpl(accessTimeoutMetaData.getTimeout(), accessTimeoutMetaData
            .getUnit());
      return annotationClass.cast(accessTimeout);
   }
View Full Code Here

      // method "*"
      if (accessTimeoutMetaData == null)
      {
         return null;
      }
      AccessTimeout accessTimeout = new AccessTimeoutImpl(accessTimeoutMetaData.getTimeout(), accessTimeoutMetaData
            .getUnit());
      return annotationClass.cast(accessTimeout);
   }
View Full Code Here

    }

    @Override
    public AccessTimeout getAccessTimeout(Method method) {
        EJBBusinessMethod beanMethod = new EJBBusinessMethod(method.getName(), method.getParameterTypes());
        AccessTimeout accessTimeout = this.methodAccessTimeouts.get(beanMethod);
        if (accessTimeout != null) {
            return accessTimeout;
        }
        // check bean level access timeout
        if (this.beanLevelAccessTimeout != null) {
View Full Code Here

    @Override
    public AccessTimeout getDefaultAccessTimeout() {
        // TODO: This has to be configurable.
        // Currently defaults to 5 minutes
        return new AccessTimeout() {
            @Override
            public long value() {
                return 5;
            }
View Full Code Here

                mergedBean.setBeanLevelLockType(originalBeanLockType);
            }
        }

        // access timeout
        AccessTimeout overrideAccessTimeout = override.getBeanLevelAccessTimeout();
        if (overrideAccessTimeout != null) {
            mergedBean.setBeanLevelAccessTimeout(overrideAccessTimeout);
        } else {
            AccessTimeout originalAccessTimeout = original.getBeanLevelAccessTimeout();
            if (originalAccessTimeout != null) {
                mergedBean.setBeanLevelAccessTimeout(originalAccessTimeout);
            }
        }
View Full Code Here

    public Object processInvocation(InterceptorContext context) throws Exception {
        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());
        }

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

     * @param configuration the component configuration
     */
    protected SessionBeanComponent(final SessionBeanComponentConfiguration configuration) {
        super(configuration);

        AccessTimeout accessTimeout = configuration.getBeanLevelAccessTimeout();
        // TODO: the configuration should always have an access timeout
        if (accessTimeout == null) {
            accessTimeout = new AccessTimeout() {
                @Override
                public long value() {
                    return 5;
                }

View Full Code Here

            return;
        }

        for (AnnotationInstance annotationInstance : annotations) {
            AnnotationTarget target = annotationInstance.target();
            AccessTimeout accessTimeout = this.getAccessTimeout(annotationInstance);
            if (target instanceof ClassInfo) {
                // bean level
                componentDescription.setBeanLevelAccessTimeout(accessTimeout);
                logger.debug("Bean " + componentDescription.getEJBName() + " marked for access timeout: " + accessTimeout);
            } else if (target instanceof MethodInfo) {
View Full Code Here

TOP

Related Classes of javax.ejb.AccessTimeout

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.