Package com.sun.enterprise.module

Examples of com.sun.enterprise.module.ModulesRegistry


     * modules in the modules directory.
     */
    private static synchronized ServiceLocator getManHabitat() {
        if (manServiceLocator != null)
            return manServiceLocator;
        ModulesRegistry registry = new StaticModulesRegistry(getModuleClassLoader());
        manServiceLocator = registry.createServiceLocator("default");
        return manServiceLocator;
    }
View Full Code Here


                    new PrivilegedAction() {
                        @Override
                        public Object run() {
                            try {
                                URLClassLoader pl = new URLClassLoader(getJars(ext));
                                ModulesRegistry registry = new StaticModulesRegistry(pl);
                                locator = registry.createServiceLocator("default");
                                return pl;
                            } catch (IOException ex) {
                                // any failure here is fatal
                                LOG.log(Level.SEVERE, strings.getLocalString("modules.class.loader.failed", "Failed to create a ClassLoader for modules directory."), ex);
                            }
View Full Code Here

     * modules in the modules directory.
     */
    private static synchronized ServiceLocator getManHabitat() {
        if (manServiceLocator != null)
            return manServiceLocator;
        ModulesRegistry registry = new StaticModulesRegistry(getModuleClassLoader());
        manServiceLocator = registry.createServiceLocator("default");
        return manServiceLocator;
    }
View Full Code Here

    public static ServiceLocator getNewHabitat(String root) {
        Properties p = new Properties();
        p.put(com.sun.enterprise.glassfish.bootstrap.Constants.INSTALL_ROOT_PROP_NAME, root);
        p.put(com.sun.enterprise.glassfish.bootstrap.Constants.INSTANCE_ROOT_PROP_NAME, root);
        ModulesRegistry registry = new StaticModulesRegistry(Utils.class.getClassLoader(), new StartupContext(p));
        ServiceLocator defaultSL = registry.createServiceLocator("default");
        return defaultSL;
    }
View Full Code Here

        }
    }
   
    private void prepareHabitat() {
        // Bootstrap a hk2 environment.
        ModulesRegistry registry = new StaticModulesRegistry(getClass().getClassLoader());
        habitat = registry.createHabitat("default");

        StartupContext startupContext = new StartupContext();
        habitat.add(new ExistingSingletonInhabitant(startupContext));

        habitat.addComponent(null, new ProcessEnvironment(ProcessEnvironment.ProcessType.Other));
View Full Code Here

        }

        // Step 2. Setup the module subsystem.
        Main main = new EmbeddedMain(cl);
        SingleHK2Factory.initialize(cl);
        ModulesRegistry modulesRegistry = AbstractFactory.getInstance().createModulesRegistry();
        modulesRegistry.setParentClassLoader(cl);

        // Step 3. Create NonOSGIGlassFishRuntime
        GlassFishRuntime glassFishRuntime = new StaticGlassFishRuntime(main);
        logger.logp(Level.FINER, getClass().getName(), "build",
                "Created GlassFishRuntime {0} with InstallRoot {1}, Bootstrap Options {2}",
View Full Code Here

            final GlassFishProperties gfProps = new GlassFishProperties(cloned);
            setEnv(gfProps);

            final StartupContext startupContext = new StartupContext(gfProps.getProperties());
           
            ModulesRegistry modulesRegistry = SingleHK2Factory.getInstance().createModulesRegistry();

            ServiceLocator serviceLocator = main.createServiceLocator(modulesRegistry, startupContext, Arrays.asList((PopulatorPostProcessor)new EmbeddedInhabitantsParser(), new ContextDuplicatePostProcessor()), null);

            final ModuleStartup gfKernel = main.findStartupService(modulesRegistry, serviceLocator, null, startupContext);
            // create a new GlassFish instance
View Full Code Here

            final StartupContext startupContext = new StartupContext(gfProps.getProperties());
            final ServiceTracker hk2Tracker = new ServiceTracker(getBundleContext(), Main.class.getName(), null);
            hk2Tracker.open();
            final Main main = (Main) hk2Tracker.waitForService(0);
            hk2Tracker.close();
            final ModulesRegistry mr = ModulesRegistry.class.cast(getBundleContext().getService(getBundleContext().getServiceReference(ModulesRegistry.class.getName())));
            ServiceLocator serviceLocator = main.createServiceLocator(mr, startupContext, null, null);
            final ModuleStartup gfKernel = main.findStartupService(mr, serviceLocator, null, startupContext);
            GlassFish glassFish = createGlassFish(gfKernel, serviceLocator, gfProps.getProperties());
            gfs.add(glassFish);
            return glassFish;
View Full Code Here

        Thread.currentThread().setContextClassLoader(ecl);

        /*
         * Create a habitat that can load from the extension directory.
         */
        ModulesRegistry registry = new StaticModulesRegistry(ecl);
        final ServiceLocator serviceLocator = registry.createServiceLocator("default");
        habitat = serviceLocator.getService(Habitat.class);
        classPath =
                SmartFile.sanitizePaths(System.getProperty("java.class.path"));
        className = AsadminMain.class.getName();

View Full Code Here

     * modules in the modules directory.
     */
    private static synchronized ServiceLocator getManHabitat() {
        if (manHabitat != null)
            return manHabitat;
        ModulesRegistry registry = new StaticModulesRegistry(getModuleClassLoader());
        manHabitat = registry.createServiceLocator("default");
        return manHabitat;
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.module.ModulesRegistry

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.