Package com.sun.enterprise.module.single

Examples of com.sun.enterprise.module.single.StaticModulesRegistry


    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

        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

     */
    private static synchronized Habitat getManHabitat() {
        if (manHabitat != null)
            return manHabitat;
       
        ModulesRegistry registry = new StaticModulesRegistry(getModuleClassLoader());
        ServiceLocator serviceLocator = registry.createServiceLocator("default");
        manHabitat = serviceLocator.getService(Habitat.class);
        return manHabitat;
    }
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

            StartupContext startupContext = new ACCStartupContext();
            AbstractActiveDescriptor<?> startupContextDescriptor = BuilderHelper.createConstantDescriptor(startupContext);
            startupContextDescriptor.addContractType(StartupContext.class);
            config.addActiveDescriptor(startupContextDescriptor);
           
            ModulesRegistry modulesRegistry = new StaticModulesRegistry(ACCModulesManager.class.getClassLoader());
            config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(modulesRegistry));
           
            config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(
                    new ProcessEnvironment(ProcessEnvironment.ProcessType.ACC)));
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

                    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

        Thread.currentThread().setContextClassLoader(ecl);

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

View Full Code Here

    public static Habitat getNewHabitat() {

        Properties p = new Properties();
        p.put(com.sun.enterprise.glassfish.bootstrap.Constants.INSTALL_ROOT_PROP_NAME, System.getProperty("java.io.tmpdir"));
        p.put(com.sun.enterprise.glassfish.bootstrap.Constants.INSTANCE_ROOT_PROP_NAME, System.getProperty("java.io.tmpdir"));
        ModulesRegistry registry = new StaticModulesRegistry(Utils.class.getClassLoader(), new StartupContext(p));
        return registry.createHabitat("default");
    }
View Full Code Here

TOP

Related Classes of com.sun.enterprise.module.single.StaticModulesRegistry

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.