Package org.jboss.as.server.deployment.module

Examples of org.jboss.as.server.deployment.module.ModuleSpecification


        return false;
    }

    private void addXTSModuleDependency(final DeploymentUnit unit) {
        final ModuleLoader moduleLoader = Module.getBootModuleLoader();
        final ModuleSpecification moduleSpec = unit.getAttachment(Attachments.MODULE_SPECIFICATION);
        moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, XTS_MODULE, false, false, false, false));
    }
View Full Code Here


        moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, XTS_MODULE, false, false, false, false));
    }

    private void addTXFModuleDependency(final DeploymentUnit unit) {
        final ModuleLoader moduleLoader = Module.getBootModuleLoader();
        final ModuleSpecification moduleSpec = unit.getAttachment(Attachments.MODULE_SPECIFICATION);
        moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, TXF_MODULE, false, false, false, false));
    }
View Full Code Here

    @Override
    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final ResourceRoot deploymentRoot = deploymentUnit.getAttachment(Attachments.DEPLOYMENT_ROOT);
        final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        final ModuleLoader moduleLoader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
        final ModuleIdentifier moduleIdentifier = deploymentUnit.getAttachment(Attachments.MODULE_IDENTIFIER);

        // non-spec behavior: always process permissions declared in META-INF/jboss-permissions.xml.
        VirtualFile jbossPermissionsXML = deploymentRoot.getRoot().getChild(JBOSS_PERMISSIONS_XML);
        if (jbossPermissionsXML.exists() && jbossPermissionsXML.isFile()) {
            List<PermissionFactory> factories = this.parsePermissions(jbossPermissionsXML, moduleLoader, moduleIdentifier);
            for (PermissionFactory factory : factories) {
                moduleSpecification.addPermissionFactory(factory);
            }
            // add the permissions specified in the minimum set.
            for (PermissionFactory factory : this.minPermissions) {
                moduleSpecification.addPermissionFactory(factory);
            }
        }

        // spec compliant behavior: only top-level deployments are processed (sub-deployments inherit permissions
        // defined at the .ear level, if any).
        else {
            if (deploymentUnit.getParent() == null) {
                VirtualFile permissionsXML = deploymentRoot.getRoot().getChild(PERMISSIONS_XML);
                if (permissionsXML.exists() && permissionsXML.isFile()) {
                    // parse the permissions and attach them in the deployment unit.
                    List<PermissionFactory> factories = this.parsePermissions(permissionsXML, moduleLoader, moduleIdentifier);
                    for (PermissionFactory factory : factories) {
                        moduleSpecification.addPermissionFactory(factory);
                    }
                }
                // add the minimum set of permissions to top-level deployments - sub-deployments will inherit them automatically.
                for (PermissionFactory factory : this.minPermissions) {
                    moduleSpecification.addPermissionFactory(factory);
                }
            } else {
                ModuleSpecification parentSpecification = deploymentUnit.getParent().getAttachment(Attachments.MODULE_SPECIFICATION);
                List<PermissionFactory> factories = parentSpecification.getPermissionFactories();
                if (factories != null && factories.size() > 0) {
                    // parent deployment contains permissions: subdeployments inherit those permissions.
                    for (PermissionFactory factory : factories) {
                        moduleSpecification.addPermissionFactory(factory);
                    }
View Full Code Here

    public static final ModuleIdentifier JMS_API = ModuleIdentifier.create("javax.jms.api");

    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();

        final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        final ModuleLoader moduleLoader = Module.getBootModuleLoader();

        addDependency(moduleSpecification, moduleLoader, JMS_API);

        if (WeldDeploymentMarker.isPartOfWeldDeployment(deploymentUnit)) {
View Full Code Here

    private static final ModuleIdentifier JSR77_API = ModuleIdentifier.create("javax.management.j2ee.api");
    @Override
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit unit = phaseContext.getDeploymentUnit();
        final ModuleLoader moduleLoader = Module.getBootModuleLoader();
        final ModuleSpecification moduleSpec = unit.getAttachment(Attachments.MODULE_SPECIFICATION);
        moduleSpec.addSystemDependency(new ModuleDependency(moduleLoader, JSR77_API, false, true, true, false));

    }
View Full Code Here

    @Override
    public void deploy(DeploymentPhaseContext phaseContext) {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();

        final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        final ModuleLoader moduleLoader = Module.getBootModuleLoader();

        moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, API, true, false, false, false));
        moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, SINGLETON, true, false, false, false));
    }
View Full Code Here

    /**
     * Add dependencies for modules required for JPA deployments
     */
    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        final ModuleLoader moduleLoader = Module.getBootModuleLoader();

        // all applications get the javax.persistence module added to their deplyoment by default
        addDependency(moduleSpecification, moduleLoader, deploymentUnit, JAVAX_PERSISTENCE_API_ID);

View Full Code Here

        }
        return defaultProviderCount;
    }

    private void addHibernate3AdaptorToDeployment(final ModuleLoader moduleLoader, final DeploymentUnit deploymentUnit) {
        final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        try {
            final Module module = moduleLoader.loadModule(HIBERNATE_3_PROVIDER);
            //use a trick to get to the root of the class loader
            final URL url = module.getClassLoader().getResource(HIBERNATE3_PROVIDER_ADAPTOR.replace('.', '/') + ".class");

            final URLConnection connection = url.openConnection();
            if (!(connection instanceof JarURLConnection)) {
                throw JpaLogger.ROOT_LOGGER.invalidUrlConnection("hibernate 3", connection);
            }

            final JarFile jarFile = ((JarURLConnection) connection).getJarFile();

            moduleSpecification.addResourceLoader(ResourceLoaderSpec.createResourceLoaderSpec(ResourceLoaders.createJarResourceLoader("hibernate3integration", jarFile)));

            // hack in the dependencies which are part of hibernate3integration
            // TODO:  do this automatically (adding dependencies found in HIBERNATE_3_PROVIDER).
            addDependency(moduleSpecification, moduleLoader, deploymentUnit, JBOSS_AS_NAMING_ID, JBOSS_JANDEX_ID);
        } catch (ModuleLoadException e) {
View Full Code Here

        return service.getName();
    }

    private void addDependency(DeploymentPhaseContext phaseContext, ServiceName federationServiceName) {
        DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        ModuleLoader moduleLoader = Module.getBootModuleLoader();

        moduleSpecification.addSystemDependency(new ModuleDependency(moduleLoader, MODULE_ORG_PICKETLINK, false, false, true, false));

        phaseContext.addDeploymentDependency(federationServiceName, DEPLOYMENT_ATTACHMENT_KEY);
    }
View Full Code Here

        if (deploymentRoot == null) {
            return;
        }

        // set the child first behaviour
        final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        if (moduleSpecification == null) {
            return;
        }
        moduleSpecification.setPrivateModule(true);

        // other sub deployments should not have access to classes in the war module
        PrivateSubDeploymentMarker.mark(deploymentUnit);

        // OSGi WebApp deployments (WAB) may use the deployment root if they don't use WEB-INF/classes already
View Full Code Here

TOP

Related Classes of org.jboss.as.server.deployment.module.ModuleSpecification

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.