Package org.jboss.metadata.ejb.spec

Examples of org.jboss.metadata.ejb.spec.MethodMetaData


/*  338 */     ContainerTransactionsMetaData containerTransactions = getContainerTransactions();
/*  339 */     if ((containerTransactions == null) || (containerTransactions.isEmpty())) {
/*  340 */       return result;
/*      */     }
/*  342 */     ContainerTransactionMetaData bestMatchTransaction = null;
/*  343 */     MethodMetaData bestMatch = null;
/*  344 */     for (ContainerTransactionMetaData transaction : containerTransactions)
/*      */     {
/*  346 */       MethodMetaData match = transaction.bestMatch(methodName, params, iface, bestMatch);
/*  347 */       if (match != bestMatch)
/*      */       {
/*  349 */         bestMatchTransaction = transaction;
/*  350 */         bestMatch = match;
/*      */       }
View Full Code Here


/* 62 */     Method method = null;
/* 63 */     if ((type instanceof Method)) {
/* 64 */       method = (Method)type;
/*    */     }
/* 66 */     String ejbName = (String)EjbNameThreadLocal.ejbName.get();
/* 67 */     MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method);
/* 68 */     MethodPermissionMetaData perm = new MethodPermissionMetaData();
/* 69 */     MethodsMetaData methods = perm.getMethods();
/* 70 */     if (methods == null)
/*    */     {
/* 72 */       methods = new MethodsMetaData();
/* 73 */       perm.setMethods(methods);
/*    */     }
/* 75 */     perm.setUnchecked(new EmptyMetaData());
/* 76 */     Descriptions descriptions = ProcessorUtils.getDescription("@PermitAll for: " + type);
/* 77 */     mmd.setDescriptions(descriptions);
/* 78 */     methods.add(mmd);
/* 79 */     metaData.add(perm);
/*    */   }
View Full Code Here

/*  92 */     return c;
/*     */   }
/*     */
/*     */   public static MethodMetaData createMethod(String ejbName, Method method)
/*     */   {
/*  97 */     MethodMetaData methodMetaData = new MethodMetaData();
/*  98 */     methodMetaData.setEjbName(ejbName);
/*  99 */     if (method == null) {
/* 100 */       methodMetaData.setMethodName("*");
/*     */     }
/*     */     else {
/* 103 */       methodMetaData.setMethodName(method.getName());
/* 104 */       MethodParametersMetaData methodParameters = getMethodParameters(method);
/* 105 */       if (methodParameters != null)
/* 106 */         methodMetaData.setMethodParams(methodParameters);
/*     */     }
/* 108 */     return methodMetaData;
/*     */   }
View Full Code Here

/* 63 */     Method method = null;
/* 64 */     if ((type instanceof Method)) {
/* 65 */       method = (Method)type;
/*    */     }
/* 67 */     String ejbName = (String)EjbNameThreadLocal.ejbName.get();
/* 68 */     MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method);
/* 69 */     MethodPermissionMetaData perm = new MethodPermissionMetaData();
/* 70 */     MethodsMetaData methods = perm.getMethods();
/* 71 */     if (methods == null)
/*    */     {
/* 73 */       methods = new MethodsMetaData();
/* 74 */       perm.setMethods(methods);
/*    */     }
/* 76 */     HashSet roles = new HashSet();
/* 77 */     for (String role : allowed.value())
/* 78 */       roles.add(role);
/* 79 */     perm.setRoles(roles);
/* 80 */     Descriptions descriptions = ProcessorUtils.getDescription("@RolesAllowed for: " + type);
/* 81 */     mmd.setDescriptions(descriptions);
/* 82 */     methods.add(mmd);
/* 83 */     metaData.add(perm);
/*    */   }
View Full Code Here

/* 66 */       metaData.setMethods(methods);
/*    */     }
/* 68 */     String ejbName = (String)EjbNameThreadLocal.ejbName.get();
/* 69 */     if (ejbName == null)
/* 70 */       ejbName = "*";
/* 71 */     MethodMetaData mmd = ProcessorUtils.createMethod(ejbName, method);
/* 72 */     Descriptions descriptions = ProcessorUtils.getDescription("@DenyAll for: " + method);
/* 73 */     mmd.setDescriptions(descriptions);
/* 74 */     log.trace("add " + mmd);
/* 75 */     methods.add(mmd);
/*    */   }
View Full Code Here

/*  936 */     Class[] interfaces = this.ejbClass.getInterfaces();
/*  937 */     for (Class beanInterface : interfaces)
/*      */     {
/*  939 */       if (!beanInterface.equals(SessionBean.class))
/*      */         continue;
/*  941 */       MethodMetaData method = new MethodMetaData();
/*  942 */       method.setEjbName(container.getEjbName());
/*      */
/*  948 */       if (hasPublicMethod(this.ejbClass, "ejbCreate"))
/*      */       {
/*      */         Annotation annotation;
/*      */         Annotation annotation;
/*  950 */         if (isStateful)
/*      */         {
/*  952 */           annotation = new InitImpl();
/*      */         }
/*      */         else
/*      */         {
/*  956 */           annotation = new PostConstructImpl();
/*      */         }
/*  958 */         Class annotationClass = annotation.annotationType();
/*  959 */         method.setMethodName("ejbCreate");
/*  960 */         addAnnotations(annotationClass, annotation, container, method);
/*      */       }
/*      */
/*  963 */       Annotation annotation = new PostActivateImpl();
/*  964 */       Class annotationClass = PostActivate.class;
/*  965 */       method.setMethodName("ejbActivate");
/*  966 */       addAnnotations(annotationClass, annotation, container, method);
/*      */
/*  968 */       annotation = new PrePassivateImpl();
/*  969 */       annotationClass = PrePassivate.class;
/*  970 */       method.setMethodName("ejbPassivate");
/*  971 */       addAnnotations(annotationClass, annotation, container, method);
/*      */
/*  973 */       annotation = new PreDestroyImpl();
/*  974 */       annotationClass = PreDestroy.class;
/*  975 */       method.setMethodName("ejbRemove");
/*  976 */       addAnnotations(annotationClass, annotation, container, method);
/*      */
/*  978 */       annotation = new ResourceImpl();
/*  979 */       annotationClass = Resource.class;
/*  980 */       method.setMethodName("setSessionContext");
/*      */
/*  982 */       addAnnotations(annotationClass, annotation, container, method);
/*      */     }
/*      */   }
View Full Code Here

/*      */       {
/* 1455 */         addClassAnnotation(container, annotationClass, annotation);
/*      */       }
/*      */       else
/*      */       {
/* 1459 */         MethodMetaData method = new MethodMetaData();
/* 1460 */         method.setMethodName(xmlAnnotation.getInjectionTarget().getInjectionTargetName());
/* 1461 */         addAnnotations(annotationClass, annotation, container, method);
/*      */       }
/*      */     }
/*      */   }
View Full Code Here

/*      */     {
/* 1618 */       for (ResourceInjectionTargetMetaData ignore : enterpriseBean.getIgnoreDependency().getInjectionTargets())
/*      */       {
/* 1620 */         IgnoreDependencyImpl annotation = new IgnoreDependencyImpl();
/*      */
/* 1622 */         MethodMetaData method = new MethodMetaData();
/* 1623 */         method.setMethodName(ignore.getInjectionTargetName());
/*      */
/* 1625 */         addAnnotations(IgnoreDependency.class, annotation, container, method);
/*      */       }
/*      */     }
/*      */   }
View Full Code Here

    */
   private void addEjb21Annotations(EJBContainer container, boolean isStateful) throws Exception
   {
      if(javax.ejb.SessionBean.class.isAssignableFrom(ejbClass))
      {
         MethodMetaData method = new MethodMetaData();
         method.setEjbName(container.getEjbName());

         Annotation annotation;
         Class<? extends Annotation> annotationClass;
         // EJB3 4.6.2: The class may implement the ejbCreate method(s).
         // EJB3 4.6.4: The method must be declared as public.
         if(hasPublicMethod(ejbClass, "ejbCreate"))
         {
            if(isStateful)
            {
               annotation = new InitImpl();
            }
            else
            {
               annotation = new PostConstructImpl();
            }
            annotationClass = annotation.annotationType();
            method.setMethodName("ejbCreate");
            addAnnotations(annotationClass, annotation, container, method);
         }

         annotation = new PostActivateImpl();
         annotationClass = javax.ejb.PostActivate.class;
         method.setMethodName("ejbActivate");
         addAnnotations(annotationClass, annotation, container, method);

         annotation = new PrePassivateImpl();
         annotationClass = javax.ejb.PrePassivate.class;
         method.setMethodName("ejbPassivate");
         addAnnotations(annotationClass, annotation, container, method);

         annotation = new PreDestroyImpl();
         annotationClass = javax.annotation.PreDestroy.class;
         method.setMethodName("ejbRemove");
         addAnnotations(annotationClass, annotation, container, method);
           
         annotation = new ResourceImpl();
         annotationClass = Resource.class;
         method.setMethodName("setSessionContext");
         // TODO: set param?
         addAnnotations(annotationClass, annotation, container, method);
      }
   }
View Full Code Here

         {
            addClassAnnotation(container, annotationClass, annotation);
         }
         else
         {
            MethodMetaData method = new MethodMetaData();
            method.setMethodName(xmlAnnotation.getInjectionTarget().getInjectionTargetName());
            addAnnotations(annotationClass, annotation, container, method);
         }
      }
   }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ejb.spec.MethodMetaData

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.