Package javax.ejb

Examples of javax.ejb.TransactionAttribute


    this.eme = eme;
    this.transaction = new UserTransactionSupport(eme);
  }

  @Override public synchronized Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
    TransactionAttribute ta = method.getAnnotation(TransactionAttribute.class);
    boolean auto = ta != null && (ta.value() == TransactionAttributeType.REQUIRES_NEW ||
      ta.value() == TransactionAttributeType.REQUIRED || ta.value() == TransactionAttributeType.MANDATORY);
    boolean began = false;
    if (auto && !transaction.isActive()) {
      began = true;
      transaction.begin();
    }
View Full Code Here


      ejbClassImpl.addAnnotation(XaAnnotation.createBeanManaged());
    }
    */

    if (tm == null || tm.value() == TransactionManagementType.CONTAINER) {
      TransactionAttribute ann
        = ejbClass.getAnnotation(TransactionAttribute.class);

      if (ann == null) {
        // ejb/1100
        ejbClass.addAnnotation(new TransactionAttributeLiteral(REQUIRED));
View Full Code Here

   
    if (!_isContainerTransaction) {
      ejbClassImpl.addAnnotation(new TransactionManagementLiteral(BEAN));
    }

    TransactionAttribute ann
      = ejbClass.getAnnotation(TransactionAttribute.class);

    if (ann == null) {
      // ejb/1100
      ejbClassImpl.addAnnotation(new TransactionAttributeLiteral(REQUIRED));
View Full Code Here

            setRemoteWrapper(new ApiClass(ifs[0]));
        }
        */
      }

      TransactionAttribute xa = type.getAnnotation(TransactionAttribute.class);
      if (xa != null) {
        MethodSignature sig = new MethodSignature();
        sig.setMethodName("*");

        EjbMethodPattern<X> pattern = createMethod(sig);
View Full Code Here

  private void configureXA(AnnotatedMethod<?> apiMethod)
  {
    if (_transactionType == null)
      return;

    Annotation ann = new TransactionAttribute() {
        public Class annotationType() { return TransactionAttribute.class; }
        public TransactionAttributeType value() { return _transactionType; }
      };

    ((AnnotatedMethodImpl<?>) apiMethod).addAnnotation(ann);
View Full Code Here

    _javaMethod = method.getJavaMember();
  }
 
  public static ConfigProgram create(AnnotatedMethod<?> method)
  {
    TransactionAttribute xaAttr
      = method.getAnnotation(TransactionAttribute.class);
   
    TransactionAttribute xaClassAttr
      = method.getDeclaringType().getAnnotation(TransactionAttribute.class);
   
    TransactionAttributeType xaType = null;
   
    if (xaClassAttr != null)
      xaType = xaClassAttr.value();
   
    if (xaAttr != null)
      xaType = xaAttr.value();
   
    if (xaType == null)
View Full Code Here

    // XXX: 4.0.7
    for (AspectGenerator<X> bizMethod : getMethods()) {
      AnnotatedMethod<?> method = bizMethod.getMethod();
     
      TransactionAttribute xa;
     
      xa = method.getAnnotation(TransactionAttribute.class);
     
      if (xa == null)
        xa = method.getDeclaringType().getAnnotation(TransactionAttribute.class);
     
      if (xa != null && REQUIRED.equals(xa.value())) {
        addXaMethods(out, method.getJavaMember());
      }
    }

    out.popDepth();
View Full Code Here

   }

   @Override
   public TransactionAttributeType getTransactionAttribute()
   {
      TransactionAttribute tx = (TransactionAttribute) getAdvisor().resolveAnnotation(TransactionAttribute.class);
     
      TransactionAttributeType value = TransactionAttributeType.REQUIRED;
      if (tx != null && tx.value() != null)
      {
         value = tx.value();
      }

      // Note that the container must start a new transaction if the REQUIRED (Required) transaction
      // attribute is used. This guarantees, for example, that the transactional behavior of the PostConstruct
      // method is the same regardless of whether it is initialized eagerly at container startup time or as a side
View Full Code Here

      }
   }
  
   protected static TransactionAttributeType getTxType(Advisor advisor, Method method)
   {
      TransactionAttribute tx = (TransactionAttribute) advisor.resolveAnnotation(method, TransactionAttribute.class);

      if (tx == null)
         tx = (TransactionAttribute) advisor.resolveAnnotation(TransactionAttribute.class);

      TransactionAttributeType value = TransactionAttributeType.REQUIRED;
      if (tx != null && tx.value() != null)
      {
         value = tx.value();
      }

      return value;
   }
View Full Code Here

      return annotation.value();
   }

   public void process(T bean, E element)
   {
      TransactionAttribute annotation = finder.getAnnotation(element, TransactionAttribute.class);
      if(annotation == null)
         return;
     
      IEjbJarMetaData ejbJarMetaData = bean.getEjbJarMetaData();
     
View Full Code Here

TOP

Related Classes of javax.ejb.TransactionAttribute

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.