Package org.jboss.modules

Examples of org.jboss.modules.ModuleLoader$MXBeanImpl


        // Install STDIO context selector
        StdioContext.setStdioContextSelector(new LogContextStdioContextSelector(StdioContext.getStdioContext()));

        // Load logging API modules
        try {
            final ModuleLoader moduleLoader = Module.forClass(LoggingExtension.class).getModuleLoader();
            for (ModuleIdentifier moduleIdentifier : LOGGING_API_MODULES) {
                try {
                    CONTEXT_SELECTOR.addLogApiClassLoader(moduleLoader.loadModule(moduleIdentifier).getClassLoader());
                } catch (Throwable ignore) {
                    // ignore
                }
            }
        } catch (Exception ignore) {
View Full Code Here


            String extramodules = (String) props.get(PROP_JBOSS_OSGI_SYSTEM_MODULES_EXTRA);
            if (extramodules != null)
                sysmodules += "," + extramodules;

            // Add a dependency on the default framework modules
            ModuleLoader bootLoader = Module.getBootModuleLoader();
            PathFilter acceptAll = PathFilters.acceptAll();
            for (String modid : sysmodules.split(",")) {
                modid = modid.trim();
                if (modid.length() > 0) {
                    ModuleIdentifier identifier = ModuleIdentifier.create(modid);
                    specBuilder.addDependency(DependencySpec.createModuleDependencySpec(acceptAll, acceptAll, bootLoader, identifier, false));
                }
            }

            specBuilder.setModuleClassLoaderFactory(new BundleReferenceClassLoader.Factory(systemBundle));

            try {
                final ModuleSpec moduleSpec = specBuilder.create();
                ModuleLoader moduleLoader = new ModuleLoader() {

                    @Override
                    protected ModuleSpec findModule(ModuleIdentifier identifier) throws ModuleLoadException {
                        return (moduleSpec.getModuleIdentifier().equals(identifier) ? moduleSpec : null);
                    }

                    @Override
                    public String toString() {
                        return "FrameworkModuleLoader";
                    }
                };
                return moduleLoader.loadModule(specBuilder.getIdentifier());
            } catch (ModuleLoadException ex) {
                throw new IllegalStateException(ex);
            }
        }
View Full Code Here

                return installBundleFromURL(bundleManager, bundleURL, startLevel);
            }

            // Attempt to load the module from the modules hirarchy
            try {
                ModuleLoader moduleLoader = Module.getBootModuleLoader();
                Module module = moduleLoader.loadModule(moduleId);
                OSGiMetaData metadata = getModuleMetadata(module);
                return bundleManager.registerModule(serviceTarget, module, metadata);
            } catch (ModuleLoadException e) {
                ROOT_LOGGER.debugf("Cannot load module: %s", moduleId);
            }
View Full Code Here

            final HandlerConfiguration configuration;

            if (moduleName != null) {
                // Check if this is a log4j appender
                final ModuleLoader moduleLoader = ModuleLoader.forClass(HandlerOperations.class);
                final ModuleIdentifier id = ModuleIdentifier.create(moduleName);
                try {
                    final Class<?> actualClass = Class.forName(className, false, moduleLoader.loadModule(id).getClassLoader());
                    if (Appender.class.isAssignableFrom(actualClass)) {
                        // Check for construction parameters
                        if (constructionProperties == null) {
                            logContextConfiguration.addPojoConfiguration(moduleName, className, name);
                        } else {
View Full Code Here

        //TODO: we should do that same check that is done in com.sun.faces.config.FacesInitializer
        //and only add the dependency if JSF is actually needed

        final DeploymentUnit topLevelDeployment = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent();
        final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        final ModuleLoader moduleLoader = Module.getBootModuleLoader();

        String defaultJsfVersion = JSFModuleIdFactory.getInstance().getDefaultSlot();
        String jsfVersion = JsfVersionMarker.getVersion(topLevelDeployment);
        if (!moduleIdFactory.isValidJSFSlot(jsfVersion)) {
            JSFLogger.ROOT_LOGGER.unknownJSFVersion(jsfVersion, defaultJsfVersion);
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();
        addDependency(moduleSpecification, moduleLoader, JAVAX_PERSISTENCE_API_ID);

        if (!JPADeploymentMarker.isJPADeployment(deploymentUnit)) {
            log.infof("added javax.persistence.api dependency to %s", deploymentUnit.getName());
            return; // Skip if there are no persistence use in the deployment
View Full Code Here

     * @throws DeploymentUnitProcessingException
     *
     */
    private PersistenceProviderAdaptor loadPersistenceAdapterModule(String persistenceProviderClass, String adapterModule) throws
            DeploymentUnitProcessingException {
        final ModuleLoader moduleLoader = Module.getBootModuleLoader();
        PersistenceProviderAdaptor persistenceProviderAdaptor = null;

        if (adapterModule == null) {
            adapterModule = Configuration.ADAPTER_MODULE_DEFAULT;
        }

        if (persistenceProviderClass == null) {
            persistenceProviderClass = Configuration.PROVIDER_CLASS_DEFAULT;
        }

        try {

            Module module = moduleLoader.loadModule(ModuleIdentifier.fromString(adapterModule));
            final ServiceLoader<PersistenceProviderAdaptor> serviceLoader =
                    module.loadService(PersistenceProviderAdaptor.class);
            if (serviceLoader != null) {
                for (PersistenceProviderAdaptor adaptor : serviceLoader) {
                    if (persistenceProviderAdaptor != null) {
View Full Code Here

        PersistenceProvider provider = getProviderByName(pu, persistenceProviderModule);

        // if we haven't loaded the provider yet, load it
        if (provider == null) {
            if (persistenceProviderModule != null) {
                final ModuleLoader moduleLoader = Module.getBootModuleLoader();
                Module module = null;
                try {
                    module = moduleLoader.loadModule(ModuleIdentifier.fromString(persistenceProviderModule));
                } catch (ModuleLoadException e) {
                    throw new DeploymentUnitProcessingException("persistence provider module load error "
                            + persistenceProviderModule + " (class " + persistenceProviderClassName + ")", e);
                }
                final ServiceLoader<PersistenceProvider> serviceLoader =
View Full Code Here

    public void deploy(DeploymentPhaseContext phaseContext) throws DeploymentUnitProcessingException {
        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        final DeploymentUnit topLevelDeployment = deploymentUnit.getParent() == null ? deploymentUnit : deploymentUnit.getParent();
        final ModuleSpecification moduleSpecification = deploymentUnit.getAttachment(Attachments.MODULE_SPECIFICATION);
        final ModuleLoader moduleLoader = Module.getBootModuleLoader();

        //we always make the JSF api available
        final String jsfVersion = JsfVersionMarker.getVersion(topLevelDeployment);

        if(jsfVersion.equals(JsfVersionMarker.JSF_1_2)) {
View Full Code Here

        final DeploymentUnit deploymentUnit = phaseContext.getDeploymentUnit();
        if (!isWSDeployment(deploymentUnit)) {
            return;
        }

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

        ModuleDependency asilDependency = new ModuleDependency(moduleLoader, ASIL, false, true, true);
        ModuleDependency hackyDependency = applyCXFExtensionImportFilters(asilDependency); // TODO: remove hack
        moduleSpecification.addDependency(hackyDependency); // TODO: use asilDependency instead
View Full Code Here

TOP

Related Classes of org.jboss.modules.ModuleLoader$MXBeanImpl

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.