Examples of TransactionAttributeType


Examples of javax.ejb.TransactionAttributeType

                } else {
                    methodIntf = MethodIntf.BEAN;
                }
            }

            final TransactionAttributeType attr = component.getTransactionAttributeType(methodIntf, invocation.getMethod());
            if (attr != TransactionAttributeType.NOT_SUPPORTED && attr != TransactionAttributeType.REQUIRES_NEW) {
                throw EjbMessages.MESSAGES.transactionPropagationNotSupported();
            }
        }
        return invocation.proceed();
View Full Code Here

Examples of javax.ejb.TransactionAttributeType

    public TransactionAttributeType getTransactionAttributeType(final MethodIntf methodIntf, final Method method) {
        return getTransactionAttributeType(methodIntf, MethodIdentifier.getIdentifierForMethod(method));
    }

    public TransactionAttributeType getTransactionAttributeType(final MethodIntf methodIntf, final MethodIdentifier method) {
            TransactionAttributeType txAttr = txAttrs.get(new MethodTransactionAttributeKey(methodIntf, method));
            //fall back to type bean if not found
            if (txAttr == null && methodIntf != MethodIntf.BEAN) {
                txAttr = txAttrs.get(new MethodTransactionAttributeKey(MethodIntf.BEAN,method));
            }
            if (txAttr == null)
View Full Code Here

Examples of javax.ejb.TransactionAttributeType

            return;
        }

        String className = method.getDeclaringClass().getName();
        String methodName = method.getName();
        TransactionAttributeType txAttr = ejbComponentDescription.getTransactionAttributes().getAttribute(methodIntf, className, methodName, toString(method.getParameterTypes()));
        if (txAttr != TransactionAttributeType.REQUIRED) {
            txAttrs.put(new MethodTransactionAttributeKey(methodIntf, MethodIdentifier.getIdentifierForMethod(method)), txAttr);
        }
        Integer txTimeout = ejbComponentDescription.getTransactionTimeouts().getAttribute(methodIntf, className, methodName, toString(method.getParameterTypes()));
        if (txTimeout != null) {
View Full Code Here

Examples of javax.ejb.TransactionAttributeType

            final AssemblyDescriptorMetaData assemblyDescriptor = ejbJarMetadata.getAssemblyDescriptor();
            if (assemblyDescriptor != null) {
                final ContainerTransactionsMetaData containerTransactions = assemblyDescriptor.getContainerTransactionsByEjbName(componentConfiguration.getEJBName());
                if (containerTransactions != null) {
                    for (final ContainerTransactionMetaData containerTx : containerTransactions) {
                        final TransactionAttributeType txAttr = containerTx.getTransAttribute();
                        final Integer timeout = timeout(containerTx);
                        final MethodsMetaData methods = containerTx.getMethods();
                        for (final MethodMetaData method : methods) {
                            final String methodName = method.getMethodName();
                            final MethodIntf methodIntf = this.getMethodIntf(method.getMethodIntf());
View Full Code Here

Examples of javax.ejb.TransactionAttributeType

    }

    public Object processInvocation(InterceptorContext invocation) throws Exception {
        final EJBComponent component = (EJBComponent) invocation.getPrivateData(Component.class);
        final MethodIntf methodIntf = MethodIntfHelper.of(invocation);
        final TransactionAttributeType attr = component.getTransactionAttributeType(methodIntf, invocation.getMethod());
        final int timeoutInSeconds = component.getTransactionTimeout(methodIntf, invocation.getMethod());
        switch (attr) {
            case MANDATORY:
                return mandatory(invocation, component);
            case NEVER:
View Full Code Here

Examples of javax.ejb.TransactionAttributeType

        }

        @Override
        protected Interceptor create(Component component, InterceptorFactoryContext context) {
            final EJBComponent ejb = (EJBComponent) component;
            TransactionAttributeType txAttr;
            if (methodIdentifier == null) {
                txAttr = TransactionAttributeType.REQUIRED;
            } else {
                txAttr = ejb.getTransactionAttributeType(MethodIntf.BEAN, methodIdentifier);
            }
View Full Code Here

Examples of javax.ejb.TransactionAttributeType

      TransactionAttribute attr = (TransactionAttribute)container.resolveAnnotation(method, TransactionAttribute.class);
      if (attr == null)
      {
         attr =(TransactionAttribute)container.resolveAnnotation(TransactionAttribute.class);
      }
      TransactionAttributeType type = TransactionAttributeType.REQUIRED;
      if (attr != null) type = attr.value();
      return type == javax.ejb.TransactionAttributeType.REQUIRED;
   }
View Full Code Here

Examples of javax.ejb.TransactionAttributeType

    * @return the method transaction type
    */
   public TransactionAttributeType getMethodTransactionType(String methodName, Class<?>[] params, MethodInterfaceType iface)
   {
      // default value
      TransactionAttributeType result = null;

      ContainerTransactionsMetaData containerTransactions = getContainerTransactions();
      if (containerTransactions == null || containerTransactions.isEmpty())
         return result;

View Full Code Here

Examples of javax.ejb.TransactionAttributeType

   public TransactionAttributeType getMethodTransactionType(Method m, MethodInterfaceType iface)
   {
      if (m == null)
         return TransactionAttributeType.SUPPORTS;

      TransactionAttributeType result = null;
      if (methodTx != null)
      {
         result = methodTx.get(m);
         if (result != null)
            return result;
View Full Code Here

Examples of javax.ejb.TransactionAttributeType

    * @param iface the interface type
    * @return the method transaction type
    */
   public byte getMethodTransactionType(String methodName, Class[] params, InvocationType iface)
   {
      TransactionAttributeType type = getDelegate().getMethodTransactionType(methodName, params, invocationTypeToMethodInterfaceType(iface));
      return mapTransactionType(type);
   }
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.