Package org.jboss.metadata.ejb.jboss

Examples of org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData


   }
  
   @Test
   public void testNPE1() throws Throwable
   {
      JBossAssemblyDescriptorMetaData assemblyDescriptor = new JBossAssemblyDescriptorMetaData();
      //assemblyDescriptor.setApplicationExceptions(applicationExceptions);
     
      JBossSessionBeanMetaData enterpriseBean = new JBossSessionBeanMetaData();
      enterpriseBean.setName("MyStatefulBean");
     
View Full Code Here


   }

   private void addAssemblyAnnotations(EJBContainer container,
         JBossEnterpriseBeanMetaData enterpriseBean, String ejbName) throws Exception
   {
      JBossAssemblyDescriptorMetaData assembly = dd.getAssemblyDescriptor();
      if (assembly != null)
      {
         addExcludeAnnotations(container, assembly.getExcludeList(), ejbName);

//         addInterceptorBindingAnnotations(container, enterpriseBean, ejbName);
      }

      if (enterpriseBean instanceof JBossSessionBeanMetaData)
View Full Code Here

   }

   private void addSecurityAnnotations(EJBContainer container, JBossEnterpriseBeanMetaData enterpriseBean, String ejbName)
      throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException
   {
      JBossAssemblyDescriptorMetaData assembly = dd.getAssemblyDescriptor();
      if (assembly != null)
      {
         SecurityRolesMetaData securityRoles = assembly.getSecurityRoles();

         if (securityRoles != null && securityRoles.size() > 0)
         {
            List<String> roleList = new ArrayList<String>();
            for (SecurityRoleMetaData securityRole : securityRoles)
            {
               roleList.add(securityRole.getRoleName());

            }
            DeclareRolesImpl annotation = new DeclareRolesImpl(roleList.toArray(new String[roleList.size()]));
            addClassAnnotation(container, DeclareRoles.class, annotation);
         }

         MethodPermissionsMetaData methodPermissions = assembly.getMethodPermissions();
         if(methodPermissions != null)
         {
            for (MethodPermissionMetaData permission : methodPermissions)
            {
               for (MethodMetaData method : permission.getMethods())
View Full Code Here

               addAnnotations(TransactionTimeout.class, timeoutAnnotation, container, method.getMethodName(), null);
            }
         }
      }

      JBossAssemblyDescriptorMetaData descriptor = dd.getAssemblyDescriptor();
      if (descriptor != null && descriptor.getContainerTransactions() != null)
      {
         for(ContainerTransactionMetaData transaction : descriptor.getContainerTransactions())
         {
            for(MethodMetaData method : transaction.getMethods())
            {
               if (method.getEjbName().equals(ejbName))
               {
View Full Code Here

     
      for(MessageDestinationReferenceMetaData ref : refs)
      {
         if (ref.getMappedName() == null || ref.getMappedName().equals(""))
         {
            JBossAssemblyDescriptorMetaData descriptor = dd.getAssemblyDescriptor();
            if (descriptor != null)
            {
               MessageDestinationMetaData destination = descriptor.getMessageDestination(ref.getLink());
               if (destination != null)
               {
                  ref.setMappedName(destination.getJndiName());
               }
            }
View Full Code Here

/* 75 */     EJBContainer container = (EJBContainer)ejb.getAdvisor();
/*    */
/* 79 */     if (exceptionClass.isAnnotationPresent(ApplicationException.class)) {
/* 80 */       return (ApplicationException)exceptionClass.getAnnotation(ApplicationException.class);
/*    */     }
/* 82 */     JBossAssemblyDescriptorMetaData assembly = container.getAssemblyDescriptor();
/*    */
/* 84 */     if (assembly != null)
/*    */     {
/* 86 */       ApplicationExceptionsMetaData exceptions = assembly.getApplicationExceptions();
/* 87 */       if (exceptions != null)
/*    */       {
/* 89 */         for (ApplicationExceptionMetaData exception : exceptions)
/*    */         {
/* 91 */           if (exception.getExceptionClass().equals(exceptionClass.getName())) {
View Full Code Here

/*      */   }
/*      */
/*      */   private void addAssemblyAnnotations(EJBContainer container, JBossEnterpriseBeanMetaData enterpriseBean, String ejbName)
/*      */     throws Exception
/*      */   {
/*  990 */     JBossAssemblyDescriptorMetaData assembly = this.dd.getAssemblyDescriptor();
/*  991 */     if (assembly != null)
/*      */     {
/*  993 */       addExcludeAnnotations(container, assembly.getExcludeList(), ejbName);
/*      */
/*  995 */       addInterceptorBindingAnnotations(container, enterpriseBean, ejbName);
/*      */     }
/*      */
/*  998 */     if ((enterpriseBean instanceof JBossSessionBeanMetaData))
View Full Code Here

/*      */   }
/*      */
/*      */   private void addSecurityAnnotations(EJBContainer container, JBossEnterpriseBeanMetaData enterpriseBean, String ejbName)
/*      */     throws ClassNotFoundException, NoSuchMethodException, NoSuchFieldException
/*      */   {
/* 1054 */     JBossAssemblyDescriptorMetaData assembly = this.dd.getAssemblyDescriptor();
/*      */     Iterator i$;
/* 1055 */     if (assembly != null)
/*      */     {
/* 1057 */       SecurityRolesMetaData securityRoles = assembly.getSecurityRoles();
/*      */
/* 1059 */       if ((securityRoles != null) && (securityRoles.size() > 0))
/*      */       {
/* 1061 */         List roleList = new ArrayList();
/* 1062 */         for (SecurityRoleMetaData securityRole : securityRoles)
/*      */         {
/* 1064 */           roleList.add(securityRole.getRoleName());
/*      */         }
/*      */
/* 1067 */         DeclareRolesImpl annotation = new DeclareRolesImpl((String[])roleList.toArray(new String[roleList.size()]));
/* 1068 */         addClassAnnotation(container, DeclareRoles.class, annotation);
/*      */       }
/*      */
/* 1071 */       MethodPermissionsMetaData methodPermissions = assembly.getMethodPermissions();
/* 1072 */       if (methodPermissions != null)
/*      */       {
/* 1074 */         for (i$ = methodPermissions.iterator(); i$.hasNext(); ) { permission = (MethodPermissionMetaData)i$.next();
/*      */
/* 1076 */           for (MethodMetaData method : permission.getMethods())
View Full Code Here

/* 1160 */           addAnnotations(TransactionTimeout.class, timeoutAnnotation, container, method.getMethodName(), null);
/*      */         }
/*      */       }
/*      */     }
/*      */
/* 1165 */     JBossAssemblyDescriptorMetaData descriptor = this.dd.getAssemblyDescriptor();
/*      */     Iterator i$;
/* 1166 */     if ((descriptor != null) && (descriptor.getContainerTransactions() != null))
/*      */     {
/* 1168 */       for (i$ = descriptor.getContainerTransactions().iterator(); i$.hasNext(); ) { transaction = (ContainerTransactionMetaData)i$.next();
/*      */
/* 1170 */         for (MethodMetaData method : transaction.getMethods())
/*      */         {
/* 1172 */           if (method.getEjbName().equals(ejbName))
/*      */           {
View Full Code Here

/*      */     }
/* 1851 */     for (MessageDestinationReferenceMetaData ref : refs)
/*      */     {
/* 1853 */       if ((ref.getMappedName() == null) || (ref.getMappedName().equals("")))
/*      */       {
/* 1855 */         JBossAssemblyDescriptorMetaData descriptor = this.dd.getAssemblyDescriptor();
/* 1856 */         if (descriptor != null)
/*      */         {
/* 1858 */           MessageDestinationMetaData destination = descriptor.getMessageDestination(ref.getLink());
/* 1859 */           if (destination != null)
/*      */           {
/* 1861 */             ref.setMappedName(destination.getJndiName());
/*      */           }
/*      */         }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ejb.jboss.JBossAssemblyDescriptorMetaData

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.