Package org.jboss.modules

Examples of org.jboss.modules.ModuleLoader.loadModule()


        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


        File modulesDir = new File(jbossHomeDir + "/modules");
        final ModuleLoader moduleLoader = InitialModuleLoaderFactory.getModuleLoader(modulesDir, systemPackages);

        // Initialize the Logging system
        ModuleIdentifier logModuleId = ModuleIdentifier.create("org.jboss.logmanager");
        ModuleClassLoader logModuleClassLoader = moduleLoader.loadModule(logModuleId).getClassLoader();
        ClassLoader ctxClassLoader = Thread.currentThread().getContextClassLoader();
        try {
            Thread.currentThread().setContextClassLoader(logModuleClassLoader);
            systemProps.setProperty("java.util.logging.manager", "org.jboss.logmanager.LogManager");
            if (LogManager.getLogManager().getClass() == LogManager.class) {
View Full Code Here

        __redirected.__JAXPRedirected.changeAll(ModuleIdentifier.fromString("javax.xml.jaxp-provider"), moduleLoader);

        // Load the server Module and get its ClassLoader
        final ModuleIdentifier serverModuleId = ModuleIdentifier.create("org.jboss.as.server");
        final Module serverModule = moduleLoader.loadModule(serverModuleId);
        final ModuleClassLoader serverModuleClassLoader = serverModule.getClassLoader();

        Class<?> embeddedStandAloneServerFactoryClass = serverModuleClassLoader.loadClass("org.jboss.as.server.EmbeddedStandAloneServerFactory");
        Method createMethod = embeddedStandAloneServerFactoryClass.getMethod("create", File.class, ModuleLoader.class, Properties.class, Map.class);
        final StandaloneServer standaloneServer = (StandaloneServer) createMethod.invoke(null, jbossHomeDir, moduleLoader, systemProps, systemEnv);
View Full Code Here

         for (PluginEntry plugin : toLoad)
         {
            try
            {
               Module module = moduleLoader.loadModule(ModuleIdentifier.fromString(plugin.toModuleId()));
               composite.add(module.getClassLoader());
            }
            catch (Exception e)
            {
               System.out.println("Failed loading: " + plugin);
View Full Code Here

               System.out.println("Failed loading: " + plugin);
               e.printStackTrace();
            }
         }

         Module forge = moduleLoader.loadModule(ModuleIdentifier.fromString("org.jboss.forge:main"));

         composite.add(forge.getClassLoader());
         Thread.currentThread().setContextClassLoader(composite);
      }
      catch (Exception e)
View Full Code Here

     */
    protected synchronized ResourceLoaderSpec getSeamIntResourceLoader() throws DeploymentUnitProcessingException {
        try {
            if (seamIntResourceLoader == null) {
                final ModuleLoader moduleLoader = Module.getBootModuleLoader();
                Module extModule = moduleLoader.loadModule(EXT_CONTENT_MODULE);
                URL url = extModule.getExportedResource(SEAM_INT_JAR);
                if (url == null)
                    throw new DeploymentUnitProcessingException("No Seam Integration jar present: " + extModule);

                File file = new File(url.toURI());
View Full Code Here

        SecurityActions.setSystemProperty(SERVER_TEMP_DIR, serverTempDir.getAbsolutePath());

        // Register the vfs module as URLStreamHandlerFactory
        try {
            ModuleLoader bootLoader = Module.getBootModuleLoader();
            Module vfsModule = bootLoader.loadModule(ModuleIdentifier.create(VFS_MODULE_IDENTIFIER));
            Module.registerURLStreamHandlerFactoryModule(vfsModule);
        } catch (Exception ex) {
            log.errorf(ex, "Cannot add module '%s' as URLStreamHandlerFactory provider", VFS_MODULE_IDENTIFIER);
        }
    }
View Full Code Here

        }
        if (configurationPersisterFactory == null) {
            throw new IllegalArgumentException("configurationPersisterFactory is null");
        }
        try {
            Module.registerURLStreamHandlerFactoryModule(moduleLoader.loadModule(ModuleIdentifier.create("org.jboss.vfs")));
        } catch (ModuleLoadException e) {
            throw new IllegalArgumentException("VFS is not available from the configured module loader");
        }
        final FutureServiceContainer future = new FutureServiceContainer(container);
        final ServiceTarget tracker = container.subTarget();
View Full Code Here

                // Attempt to load the module from the modules hierarchy
                Module module = null;
                try {
                    ModuleLoader moduleLoader = Module.getBootModuleLoader();
                    module = moduleLoader.loadModule(moduleId);
                } catch (ModuleLoadException ex) {
                    throw MESSAGES.startFailedCannotResolveInitialCapability(ex, identifier);
                }
                if (module != null) {
                    OSGiMetaData metadata = getModuleMetadata(module);
View Full Code Here

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

TOP
Copyright © 2018 www.massapi.com. 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.