Package org.jboss.metadata.ear.spec

Examples of org.jboss.metadata.ear.spec.EarMetaData


     * @param deploymentUnit The deployment unit
     */
    private String getApplicationName(DeploymentUnit deploymentUnit) {
        final DeploymentUnit parentDU = deploymentUnit.getParent();
        if (parentDU == null) {
            final EarMetaData earMetaData = deploymentUnit.getAttachment(org.jboss.as.ee.structure.Attachments.EAR_METADATA);
            if (earMetaData != null) {
                final String overriddenAppName = earMetaData.getApplicationName();
                if (overriddenAppName == null) {
                    return this.getEarName(deploymentUnit);
                }
                return overriddenAppName;
            } else {
View Full Code Here


public class EarMessageDestinationProcessor implements DeploymentUnitProcessor {
    @Override
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        if (DeploymentTypeMarker.isType(DeploymentType.EAR, deploymentUnit)) {
            final EarMetaData metadata = deploymentUnit.getAttachment(Attachments.EAR_METADATA);
            final EEModuleDescription eeModuleDescription = deploymentUnit.getAttachment(org.jboss.as.ee.component.Attachments.EE_MODULE_DESCRIPTION);

            if (metadata != null) {

                if (metadata.getEarEnvironmentRefsGroup() != null) {
                    if (metadata.getEarEnvironmentRefsGroup().getMessageDestinations() != null) {
                        for (final MessageDestinationMetaData destination : metadata.getEarEnvironmentRefsGroup().getMessageDestinations()) {
                            //TODO: should these be two separate metadata attributes?
                            if (destination.getJndiName() != null) {
                                eeModuleDescription.addMessageDestination(destination.getName(), destination.getJndiName());
                            } else if (destination.getLookupName() != null) {
                                eeModuleDescription.addMessageDestination(destination.getName(), destination.getLookupName());
View Full Code Here

            }
        }
        //Let us look at the ear metadata also
        DeploymentUnit parent = deploymentUnit.getParent();
        if (parent != null) {
            final EarMetaData earMetaData = parent.getAttachment(Attachments.EAR_METADATA);
            if (earMetaData != null) {
                SecurityRolesMetaData earSecurityRolesMetaData = earMetaData.getSecurityRoles();
                SecurityRolesMetaDataMerger.merge(roleMappings, roleMappings, earSecurityRolesMetaData);
            }
        }
        // add it to the EJB component description
        ejbComponentDescription.setSecurityRoles(roleMappings);
View Full Code Here

     */
    private String getJBossAppSecurityDomain(final DeploymentUnit deploymentUnit) {
        String securityDomain = null;
        DeploymentUnit parent = deploymentUnit.getParent();
        if (parent != null) {
            final EarMetaData jbossAppMetaData = parent.getAttachment(Attachments.EAR_METADATA);
            if (jbossAppMetaData instanceof JBossAppMetaData) {
                securityDomain = ((JBossAppMetaData) jbossAppMetaData).getSecurityDomain();
            }
        }
        return securityDomain;
View Full Code Here

        }

        //merge security roles from the ear
        DeploymentUnit parent = deploymentUnit.getParent();
        if (parent != null) {
            final EarMetaData earMetaData = parent.getAttachment(org.jboss.as.ee.structure.Attachments.EAR_METADATA);
            if (earMetaData != null) {
                SecurityRolesMetaData earSecurityRolesMetaData = earMetaData.getSecurityRoles();
                if(earSecurityRolesMetaData != null) {
                    if(mergedMetaData.getSecurityRoles() == null) {
                        mergedMetaData.setSecurityRoles(new SecurityRolesMetaData());
                    }
                    SecurityRolesMetaDataMerger.merge(mergedMetaData.getSecurityRoles(), mergedMetaData.getSecurityRoles(), earSecurityRolesMetaData);
View Full Code Here

        final DeploymentUnit parent = deploymentUnit.getParent();
        if(parent == null || !DeploymentTypeMarker.isType(DeploymentType.EAR, parent)) {
            return// Only care if this war is nested in an EAR
        }

        final EarMetaData earMetaData = parent.getAttachment(Attachments.EAR_METADATA);
        if(earMetaData == null) {
            return; // Nothing to see here
        }

        final ModulesMetaData modulesMetaData = earMetaData.getModules();
        if(modulesMetaData != null) for(ModuleMetaData moduleMetaData : modulesMetaData) {
            if(Web.equals(moduleMetaData.getType()) && moduleMetaData.getFileName().equals(deploymentRoot.getRootName())) {
                String contextRoot = WebModuleMetaData.class.cast(moduleMetaData.getValue()).getContextRoot();

                if(contextRoot == null && (warMetaData.getJbossWebMetaData() == null || warMetaData.getJbossWebMetaData().getContextRoot() == null)) {
View Full Code Here

            final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
            inputFactory.setXMLResolver(NoopXmlResolver.create());
            XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(inputStream);
            final JBossAppMetaData appMetaData = JBossAppMetaDataParser.parse(xmlReader);
            if (appMetaData != null) {
                final EarMetaData earMetaData = deploymentUnit.getAttachment(Attachments.EAR_METADATA);
                if(earMetaData != null) {
                    JBossAppMetaDataMerger.merge(appMetaData, null, earMetaData);
                }
                deploymentUnit.putAttachment(Attachments.JBOSS_APP_METADATA, appMetaData);
            }
View Full Code Here

        try {
            inputStream = applicationXmlFile.openStream();
            final XMLInputFactory inputFactory = XMLInputFactory.newInstance();
            inputFactory.setXMLResolver(NoopXmlResolver.create());
            XMLStreamReader xmlReader = inputFactory.createXMLStreamReader(inputStream);
            final EarMetaData earMetaData = EarMetaDataParser.parse(xmlReader);
            if (earMetaData != null) {
                deploymentUnit.putAttachment(Attachments.EAR_METADATA, earMetaData);
                if(earMetaData instanceof Ear6xMetaData) {
                    Ear6xMetaData metaData = (Ear6xMetaData)earMetaData;
                    if(metaData.getEarEnvironmentRefsGroup() != null) {
View Full Code Here

      return unmarshal(EarMetaData.class);
   }

   public void testNoDtd() throws Exception
   {
      EarMetaData result = unmarshal();
      assertEquals("JBossTest Web Container Testsuite", result.getDescriptionGroup().getDisplayName());
      ModulesMetaData modules = result.getModules();
      assertNotNull(modules);
      assertEquals(1, modules.size());
      ModuleMetaData module = modules.get(0);
      assertEquals("manifest-web.war", module.getFileName());
      WebModuleMetaData webModule = (WebModuleMetaData) module.getValue();
View Full Code Here

      WebModuleMetaData webModule = (WebModuleMetaData) module.getValue();
      assertEquals("/manifest", webModule.getContextRoot());
   }
   public void testVersion14() throws Exception
   {
      EarMetaData result = unmarshal();
      assertEquals("application_1_4-id", result.getId());
      assertEquals("1.4", result.getVersion());
      assertFalse(result.isEE13());
      assertTrue(result.isEE14());
      assertFalse(result.isEE5());
   }
View Full Code Here

TOP

Related Classes of org.jboss.metadata.ear.spec.EarMetaData

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.