Package org.jboss.as.server.moduleservice

Examples of org.jboss.as.server.moduleservice.ExtensionIndex


        if (extensionInfo == null) {
            return;
        }
        final ServiceController<?> extensionIndexController = phaseContext.getServiceRegistry().getRequiredService(
                Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX);
        final ExtensionIndex extensionIndexService = (ExtensionIndex) extensionIndexController.getValue();
        final ModuleIdentifier moduleIdentifier = deploymentUnit.getAttachment(Attachments.MODULE_IDENTIFIER);
        extensionIndexService.addDeployedExtension(moduleIdentifier, extensionInfo);
    }
View Full Code Here


            return;
        }
        // we need to remove the extension on undeploy
        final ServiceController<?> extensionIndexController = deploymentUnit.getServiceRegistry().getRequiredService(
                Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX);
        final ExtensionIndex extensionIndexService = (ExtensionIndex) extensionIndexController.getValue();
        final ModuleIdentifier moduleIdentifier = deploymentUnit.getAttachment(Attachments.MODULE_IDENTIFIER);

        extensionIndexService.removeDeployedExtension(extensionInfo.getName(), moduleIdentifier);

    }
View Full Code Here

    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        final ModuleLoader moduleLoader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
        final ServiceController<?> controller = phaseContext.getServiceRegistry().getRequiredService(Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX);
        final ExtensionIndex index = (ExtensionIndex) controller.getValue();
        final List<ResourceRoot> allResourceRoots = DeploymentUtils.allResourceRoots(deploymentUnit);
        final Set<ServiceName> nextPhaseDeps = new HashSet<ServiceName>();
        for (ResourceRoot resourceRoot : allResourceRoots) {
            final AttachmentList<ExtensionListEntry> entries = resourceRoot.getAttachment(Attachments.EXTENSION_LIST_ENTRIES);
            if (entries != null) {

                for (ExtensionListEntry entry : entries) {
                    final ModuleIdentifier extension = index.findExtension(entry.getName(), entry.getSpecificationVersion(),
                            entry.getImplementationVersion(), entry.getImplementationVendorId());

                    if (extension != null) {
                        moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, extension, false, false, true));
                        nextPhaseDeps.add(ServiceModuleLoader.moduleSpecServiceName(extension));
                        nextPhaseDeps.add(ServiceModuleLoader.moduleSpecServiceName(extension));
                    } else {
                        log.warnf("Could not find Extension-List entry " + entry + " referenced from " + resourceRoot);
                    }
                }
            }
        }

        final List<AdditionalModuleSpecification> additionalModules = deploymentUnit.getAttachment(Attachments.ADDITIONAL_MODULES);
        if (additionalModules != null) {
            for (AdditionalModuleSpecification additionalModule : additionalModules) {
                for (ResourceRoot resourceRoot : additionalModule.getResourceRoots()) {
                    final AttachmentList<ExtensionListEntry> entries = resourceRoot
                            .getAttachment(Attachments.EXTENSION_LIST_ENTRIES);
                    if (entries != null) {

                        for (ExtensionListEntry entry : entries) {
                            final ModuleIdentifier extension = index.findExtension(entry.getName(), entry
                                    .getSpecificationVersion(), entry.getImplementationVersion(), entry
                                    .getImplementationVendorId());
                            if (extension != null) {
                                moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, extension, false, false,
                                        true));
View Full Code Here

    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        final ModuleLoader moduleLoader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
        final ServiceController<?> controller = phaseContext.getServiceRegistry().getRequiredService(Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX);
        final ExtensionIndex index = (ExtensionIndex) controller.getValue();
        final List<ResourceRoot> allResourceRoots = DeploymentUtils.allResourceRoots(deploymentUnit);
        final Set<ServiceName> nextPhaseDeps = new HashSet<ServiceName>();
        for (ResourceRoot resourceRoot : allResourceRoots) {
            final AttachmentList<ExtensionListEntry> entries = resourceRoot.getAttachment(Attachments.EXTENSION_LIST_ENTRIES);
            if (entries != null) {

                for (ExtensionListEntry entry : entries) {
                    final ModuleIdentifier extension = index.findExtension(entry.getName(), entry.getSpecificationVersion(),
                            entry.getImplementationVersion(), entry.getImplementationVendorId());

                    if (extension != null) {
                        moduleSpecification.addDependency(new ModuleDependency(moduleLoader, extension, false, false, true));
                        nextPhaseDeps.add(ServiceModuleLoader.moduleSpecServiceName(extension));
                        nextPhaseDeps.add(ServiceModuleLoader.moduleSpecServiceName(extension));
                    } else {
                        log.warnf("Could not find Extension-List entry " + entry + " referenced from " + resourceRoot);
                    }
                }
            }
        }

        final List<AdditionalModuleSpecification> additionalModules = deploymentUnit.getAttachment(Attachments.ADDITIONAL_MODULES);
        if (additionalModules != null) {
            for (AdditionalModuleSpecification additionalModule : additionalModules) {
                for (ResourceRoot resourceRoot : additionalModule.getResourceRoots()) {
                    final AttachmentList<ExtensionListEntry> entries = resourceRoot
                            .getAttachment(Attachments.EXTENSION_LIST_ENTRIES);
                    if (entries != null) {

                        for (ExtensionListEntry entry : entries) {
                            final ModuleIdentifier extension = index.findExtension(entry.getName(), entry
                                    .getSpecificationVersion(), entry.getImplementationVersion(), entry
                                    .getImplementationVendorId());
                            if (extension != null) {
                                moduleSpecification.addDependency(new ModuleDependency(moduleLoader, extension, false, false,
                                        true));
View Full Code Here

    public void deploy(final DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        final ModuleLoader moduleLoader = deploymentUnit.getAttachment(Attachments.SERVICE_MODULE_LOADER);
        final ServiceController<?> controller = phaseContext.getServiceRegistry().getRequiredService(Services.JBOSS_DEPLOYMENT_EXTENSION_INDEX);
        final ExtensionIndex index = (ExtensionIndex) controller.getValue();
        final List<ResourceRoot> allResourceRoots = DeploymentUtils.allResourceRoots(deploymentUnit);
        final Set<ServiceName> nextPhaseDeps = new HashSet<ServiceName>();
        for (ResourceRoot resourceRoot : allResourceRoots) {
            final AttachmentList<ExtensionListEntry> entries = resourceRoot.getAttachment(Attachments.EXTENSION_LIST_ENTRIES);
            if (entries != null) {

                for (ExtensionListEntry entry : entries) {
                    final ModuleIdentifier extension = index.findExtension(entry.getName(), entry.getSpecificationVersion(),
                            entry.getImplementationVersion(), entry.getImplementationVendorId());

                    if (extension != null) {
                        moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, extension, false, false, true, false));
                        nextPhaseDeps.add(ServiceModuleLoader.moduleSpecServiceName(extension));
                        nextPhaseDeps.add(ServiceModuleLoader.moduleSpecServiceName(extension));
                    } else {
                        ServerLogger.DEPLOYMENT_LOGGER.cannotFindExtensionListEntry(entry, resourceRoot);
                    }
                }
            }
        }

        final List<AdditionalModuleSpecification> additionalModules = deploymentUnit.getAttachment(Attachments.ADDITIONAL_MODULES);
        if (additionalModules != null) {
            for (AdditionalModuleSpecification additionalModule : additionalModules) {
                for (ResourceRoot resourceRoot : additionalModule.getResourceRoots()) {
                    final AttachmentList<ExtensionListEntry> entries = resourceRoot
                            .getAttachment(Attachments.EXTENSION_LIST_ENTRIES);
                    if (entries != null) {

                        for (ExtensionListEntry entry : entries) {
                            final ModuleIdentifier extension = index.findExtension(entry.getName(), entry
                                    .getSpecificationVersion(), entry.getImplementationVersion(), entry
                                    .getImplementationVendorId());
                            if (extension != null) {
                                moduleSpecification.addLocalDependency(new ModuleDependency(moduleLoader, extension, false, false,
                                        true, false));
View Full Code Here

TOP

Related Classes of org.jboss.as.server.moduleservice.ExtensionIndex

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.