Package org.jboss.metadata.ejb.spec

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


        //now add the exceptions from the assembly descriptor
        EjbJarMetaData ejbJarMetaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
        if (ejbJarMetaData != null) {
            // process assembly-descriptor stuff
            AssemblyDescriptorMetaData assemblyDescriptor = ejbJarMetaData.getAssemblyDescriptor();
            if (assemblyDescriptor != null) {
                // process application-exception(s)
                ApplicationExceptionsMetaData ddAppExceptions = assemblyDescriptor.getApplicationExceptions();
                if (ddAppExceptions != null && !ddAppExceptions.isEmpty()) {
                    for (ApplicationExceptionMetaData applicationException : ddAppExceptions) {
                        String exceptionClassName = applicationException.getExceptionClass();
                        try {
                            final ClassIndex index = classIndex.classIndex(exceptionClassName);
View Full Code Here


        final String ejbName = componentConfiguration.getEJBName();
        final EjbJarMetaData metaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
        if (metaData == null) {
            return;
        }
        final AssemblyDescriptorMetaData assemblyDescriptor = metaData.getAssemblyDescriptor();
        if (assemblyDescriptor == null) {
            return;
        }
        final List<EJBBoundResourceAdapterBindingMetaData> resourceAdapterBindingDataList = assemblyDescriptor.getAny(EJBBoundResourceAdapterBindingMetaData.class);

        String configuredAdapterName = null;
        if (resourceAdapterBindingDataList != null) {
            for (EJBBoundResourceAdapterBindingMetaData resourceAdapterBindingData: resourceAdapterBindingDataList) {
                if ("*".equals(resourceAdapterBindingData.getEjbName()) && configuredAdapterName == null) {
View Full Code Here

        final String ejbName = description.getEJBName();
        final EjbJarMetaData metaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
        if (metaData == null) {
            return;
        }
        final AssemblyDescriptorMetaData assemblyDescriptor = metaData.getAssemblyDescriptor();
        if (assemblyDescriptor == null) {
            return;
        }
        // get the pool metadata
        final List<EJBBoundCacheMetaData> caches = assemblyDescriptor.getAny(EJBBoundCacheMetaData.class);

        String cacheName = null;
        if (caches != null) {
            for (final EJBBoundCacheMetaData cacheMetaData : caches) {
                // if this applies for all EJBs and if there isn't a pool name already explicitly specified
View Full Code Here

        final String ejbName = componentConfiguration.getEJBName();
        final EjbJarMetaData metaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
        if (metaData == null) {
            return;
        }
        final AssemblyDescriptorMetaData assemblyDescriptor = metaData.getAssemblyDescriptor();
        if (assemblyDescriptor == null) {
            return;
        }
        Boolean deliveryActive = null;
        final List<EJBBoundDeliveryActiveMetaData> deliveryActiveDataList = assemblyDescriptor.getAny(EJBBoundDeliveryActiveMetaData.class);
        if (deliveryActiveDataList != null) {
            for (EJBBoundDeliveryActiveMetaData deliveryActiveData : deliveryActiveDataList) {
                if ("*".equals(deliveryActiveData.getEjbName()) && deliveryActive == null) {
                    deliveryActive = deliveryActiveData.isDeliveryActive();
                } else if (ejbName.equals(deliveryActiveData.getEjbName())) {
View Full Code Here

        final String ejbName = description.getEJBName();
        final EjbJarMetaData metaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
        if (metaData == null) {
            return;
        }
        final AssemblyDescriptorMetaData assemblyDescriptor = metaData.getAssemblyDescriptor();
        if (assemblyDescriptor == null) {
            return;
        }
        // get the pool metadata
        final List<EJBBoundPoolMetaData> pools = assemblyDescriptor.getAny(EJBBoundPoolMetaData.class);

        String poolName = null;
        if (pools != null) {
            for (final EJBBoundPoolMetaData poolMetaData : pools) {
                // if this applies for all EJBs and if there isn't a pool name already explicitly specified
View Full Code Here

    protected void handleDeploymentDescriptor(final DeploymentUnit deploymentUnit, final DeploymentReflectionIndex deploymentReflectionIndex, final Class<?> componentClass, final EJBComponentDescription description) throws DeploymentUnitProcessingException {
        String securityDomain = getJBossAppSecurityDomain(deploymentUnit);
        String globalSecurityDomain = null;
        final EjbJarMetaData ejbJarMetaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
        if (ejbJarMetaData != null) {
            final AssemblyDescriptorMetaData assemblyMetadata = ejbJarMetaData.getAssemblyDescriptor();
            if (assemblyMetadata != null) {
                final List<EJBBoundSecurityMetaData> securityMetaDatas = assemblyMetadata.getAny(EJBBoundSecurityMetaData.class);
                if (securityMetaDatas != null) {
                    for (final EJBBoundSecurityMetaData securityMetaData : securityMetaDatas) {
                        if (securityMetaData.getEjbName().equals(description.getComponentName())) {
                            securityDomain = securityMetaData.getSecurityDomain();
                            break;
View Full Code Here

        //DO NOT USE componentConfiguration.getDescriptorData()
        //It will return null if there is no <enterprise-beans/> declaration even if there is an assembly descriptor entry

        EjbJarMetaData ejbJarMetadata = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
        if (ejbJarMetadata != null) {
            final AssemblyDescriptorMetaData assemblyDescriptor = ejbJarMetadata.getAssemblyDescriptor();
            if (assemblyDescriptor != null) {

                //handle exclude-list

                final ExcludeListMetaData excludeList = assemblyDescriptor.getExcludeListByEjbName(componentDescription.getEJBName());
                if (excludeList != null && excludeList.getMethods() != null) {
                    for (final MethodMetaData method : excludeList.getMethods()) {
                        final String methodName = method.getMethodName();
                        final MethodIntf defaultMethodIntf = (componentDescription instanceof MessageDrivenComponentDescription) ? MethodIntf.MESSAGE_ENDPOINT : MethodIntf.BEAN;
                        final MethodIntf methodIntf = this.getMethodIntf(method.getMethodIntf(), defaultMethodIntf);
                        if (methodName.equals("*")) {
                            componentDescription.getDescriptorMethodPermissions().setAttribute(methodIntf, null, EJBMethodSecurityAttribute.denyAll());
                        } else {

                            final MethodParametersMetaData methodParams = method.getMethodParams();
                            // update the session bean description with the tx attribute info
                            if (methodParams == null) {
                                componentDescription.getDescriptorMethodPermissions().setAttribute(methodIntf, EJBMethodSecurityAttribute.denyAll(), methodName);
                            } else {

                                componentDescription.getDescriptorMethodPermissions().setAttribute(methodIntf, EJBMethodSecurityAttribute.denyAll(), null, methodName, this.getMethodParams(methodParams));
                            }
                        }
                    }
                }

                //now handle method permissions
                final MethodPermissionsMetaData methodPermissions = assemblyDescriptor.getMethodPermissionsByEjbName(componentDescription.getEJBName());
                if (methodPermissions != null) {
                    for (final MethodPermissionMetaData methodPermissionMetaData : methodPermissions) {

                        final MethodsMetaData methods = methodPermissionMetaData.getMethods();
                        for (final MethodMetaData method : methods) {
View Full Code Here

        if (ejbJarMetadata != null) {

            boolean wildcardAttributeSet = false;
            boolean wildcardTimeoutSet = false;
            ContainerTransactionMetaData global = null;
            final AssemblyDescriptorMetaData assemblyDescriptor = ejbJarMetadata.getAssemblyDescriptor();
            if(assemblyDescriptor != null) {
                final ContainerTransactionsMetaData globalTransactions = assemblyDescriptor.getContainerTransactionsByEjbName("*");

                if (globalTransactions != null) {
                    if (globalTransactions.size() > 1) {
                        throw EjbLogger.ROOT_LOGGER.mustOnlyBeSingleContainerTransactionElementWithWildcard();
                    }
                    global = globalTransactions.iterator().next();
                    for(MethodMetaData method : global.getMethods()) {
                        if(!method.getMethodName().equals("*")) {
                            throw EjbLogger.ROOT_LOGGER.wildcardContainerTransactionElementsMustHaveWildcardMethodName();
                        }
                    }
                }
                final ContainerTransactionsMetaData containerTransactions = assemblyDescriptor.getContainerTransactionsByEjbName(componentDescription.getEJBName());
                if (containerTransactions != null) {
                    for (final ContainerTransactionMetaData containerTx : containerTransactions) {
                        final TransactionAttributeType txAttr = containerTx.getTransAttribute();
                        final Integer timeout = timeout(containerTx);
                        final MethodsMetaData methods = containerTx.getMethods();
View Full Code Here

        final EjbJarMetaData ejbJarMetaData = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_METADATA);
        if (ejbJarMetaData == null) {
            return;
        }
        // process assembly-descriptor stuff
        final AssemblyDescriptorMetaData assemblyDescriptor = ejbJarMetaData.getAssemblyDescriptor();
        if (assemblyDescriptor != null) {
            // get hold of the ejb jar description (to which we'll be adding this assembly description metadata)
            final EjbJarDescription ejbJarDescription = deploymentUnit.getAttachment(EjbDeploymentAttachmentKeys.EJB_JAR_DESCRIPTION);

            final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(Attachments.EE_MODULE_DESCRIPTION);

            // process security-role(s)
            this.processSecurityRoles(assemblyDescriptor.getSecurityRoles(), ejbJarDescription);

            final MessageDestinationsMetaData destinations = assemblyDescriptor.getMessageDestinations();
            if(destinations != null) {
                processMessageDestinations(destinations, eeModuleDescription);
            }
        }
View Full Code Here

         ejbJarMetaData.setEnterpriseBeans(new EnterpriseBeansMetaData());
     
      ejbJarMetaData.getEnterpriseBeans().add(beanMetaData);
      processClass(beanMetaData, beanClass);

      AssemblyDescriptorMetaData assembly = ejbJarMetaData.getAssemblyDescriptor();
      if(assembly == null)
      {
         assembly = new AssemblyDescriptorMetaData();
         ejbJarMetaData.setAssemblyDescriptor(assembly);
      }
      // @DeclareRoles
      SecurityRolesMetaData securityRoles = assembly.getSecurityRoles();
      if(securityRoles == null)
      {
         securityRoles = new SecurityRolesMetaData();
         assembly.setSecurityRoles(securityRoles);
      }
      super.processClass(securityRoles, beanClass);
      // @DenyAll
      ExcludeListMetaData excludes = assembly.getExcludeList();
      if(excludes == null)
      {
         excludes = new ExcludeListMetaData();
         assembly.setExcludeList(excludes);
      }
      super.processClass(excludes, beanClass);

      // @RolesAllowed, @PermitAll
      MethodPermissionsMetaData permissions = assembly.getMethodPermissions();
      if(permissions == null)
      {
         permissions = new MethodPermissionsMetaData();
         assembly.setMethodPermissions(permissions);
      }
      super.processClass(permissions, beanClass);

      // @Interceptors
      InterceptorBindingsMetaData interceptors = assembly.getInterceptorBindings();
      if(interceptors == null)
      {
         interceptors = new InterceptorBindingsMetaData();
         assembly.setInterceptorBindings(interceptors);
      }
      super.processClass(interceptors, beanClass);

      EjbNameThreadLocal.ejbName.set(null);
   }
View Full Code Here

TOP

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

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.