Package org.jboss.metadata.ejb.jboss

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


   }

   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

   {
      if (exceptionClass.isAnnotationPresent(ApplicationException.class))
         return true;
     
      // FIXME: use annotation only. Duplicate of TxUtil.getApplicationException, must move to EJBContainer.
      JBossAssemblyDescriptorMetaData assembly = container.getAssemblyDescriptor();
      if (assembly != null)
      {
         ApplicationExceptionsMetaData exceptions = assembly.getApplicationExceptions();
         if (exceptions != null && exceptions.size() > 0)
         {
            for(ApplicationExceptionMetaData exception : exceptions)
            {
               if (exception.getExceptionClass().equals(exceptionClass.getName()))
View Full Code Here

               log.error(message);
               throw new SecurityException(message);
            }
           
            //Specify any Deployment Level Mapping of Principal - role names
            JBossAssemblyDescriptorMetaData jmd = container.getAssemblyDescriptor();
            if(jmd != null)
            {
               Map<String,Set<String>> principalRoleMap = jmd.getPrincipalVersusRolesMap();
               SecurityRolesAssociation.setSecurityRoles(principalRoleMap);
            }
            InvokerLocator locator = (InvokerLocator) invocation.getMetaData(InvokeRemoteInterceptor.REMOTING,
                  InvokeRemoteInterceptor.INVOKER_LOCATOR);
View Full Code Here

         return null;
     
      String runAsPrincipal = runAs.value();
      Set<String> extraRoles = new HashSet<String>();
     
      JBossAssemblyDescriptorMetaData ad = container.getAssemblyDescriptor();
      if(ad != null && runAsPrincipal != null)
      {
         extraRoles.addAll(ad.getSecurityRoleNamesByPrincipal(runAsPrincipal));
      }
     
      return new RunAsIdentity(runAs.value(), runAsPrincipal, extraRoles);
   }
View Full Code Here

      else
      {
         interceptors.add(SBI); // clone?
      }

      JBossAssemblyDescriptorMetaData assemblyDescriptor = jbmd.getAssemblyDescriptor();
      if (assemblyDescriptor == null)
      {
         assemblyDescriptor = new JBossAssemblyDescriptorMetaData();
         jbmd.setAssemblyDescriptor(assemblyDescriptor);
      }
      InterceptorBindingsMetaData interceptorBindings = assemblyDescriptor.getInterceptorBindings();
      if (interceptorBindings == null)
      {
         interceptorBindings = new InterceptorBindingsMetaData();
         assemblyDescriptor.setInterceptorBindings(interceptorBindings);
      }
      // Add this as the first binding in the list so that it is called first...
      interceptorBindings.add(0, IBMD); // clone?
     
      // Check to see there is a defined order; if we aren't first, warn
View Full Code Here

   public static JBossSessionBeanMetaData createMockBeanMetaData()
   {
      JBossMetaData metaData = new JBossMetaData();
      JBossEnterpriseBeansMetaData enterpriseBeans = new JBossEnterpriseBeansMetaData();
      metaData.setEnterpriseBeans(enterpriseBeans);
      metaData.setAssemblyDescriptor(new JBossAssemblyDescriptorMetaData());
      JBossSessionBeanMetaData sessionBeanMetaData = new JBossSessionBeanMetaData();
      sessionBeanMetaData.setEnterpriseBeansMetaData(enterpriseBeans);
      return sessionBeanMetaData;
   }
View Full Code Here

   public static JBossSessionBeanMetaData createMockBeanMetaData()
   {
      JBossMetaData metaData = new JBossMetaData();
      JBossEnterpriseBeansMetaData enterpriseBeans = new JBossEnterpriseBeansMetaData();
      metaData.setEnterpriseBeans(enterpriseBeans);
      metaData.setAssemblyDescriptor(new JBossAssemblyDescriptorMetaData());
      JBossSessionBeanMetaData sessionBeanMetaData = new JBossSessionBeanMetaData();
      sessionBeanMetaData.setEnterpriseBeansMetaData(enterpriseBeans);
      return sessionBeanMetaData;
   }
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

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.