Package org.glassfish.hk2.api

Examples of org.glassfish.hk2.api.DynamicConfiguration.commit()


             * from HK2's scan for services.  Then add in
             * an ACC ProcessEnvironment.
             */
            config.addUnbindFilter(BuilderHelper.createContractFilter(ProcessEnvironment.class.getName()));
           
            config.commit();
           
            config = dcs.createDynamicConfiguration();
           
            StartupContext startupContext = new ACCStartupContext();
            AbstractActiveDescriptor<?> startupContextDescriptor = BuilderHelper.createConstantDescriptor(startupContext);
View Full Code Here


            Logger logger = Logger.getLogger(Logger.GLOBAL_LOGGER_NAME);
            AbstractActiveDescriptor<Logger> di = BuilderHelper.createConstantDescriptor(logger);
            di.addContractType(Logger.class);
            config.addActiveDescriptor(di);
           
            config.commit();
       }
    }


    static ServiceLocator getHabitat() {
View Full Code Here

        config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(
                env.isEmbedded() ?
                new ProcessEnvironment(ProcessEnvironment.ProcessType.Embedded):
                new ProcessEnvironment(ProcessEnvironment.ProcessType.Server)));
        config.commit();

        // activate the run level services
        if (proceedTo(InitRunLevel.VAL, new InitActivator())) {
            if (proceedTo(StartupRunLevel.VAL, new StartupActivator())) {
                proceedTo(PostStartupRunLevel.VAL, new PostStartupActivator());
View Full Code Here

        DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
        DynamicConfiguration config = dcs.createDynamicConfiguration();

        ActiveDescriptor<?> activatorDescriptor = config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(activator));

        config.commit();

        try {
            runLevelController.proceedTo(runLevel);
        } catch (Exception e) {
            logger.log(Level.SEVERE, KernelLoggerInfo.shutdownRequired, e);
View Full Code Here

            shutdown();
            return false;
        } finally {
            config = dcs.createDynamicConfiguration();
            config.addUnbindFilter(BuilderHelper.createSpecificDescriptorFilter(activatorDescriptor));
            config.commit();
        }
        return !activator.isShutdown();
    }

View Full Code Here

                        "addingService", "registering service = {0}", object);
            }
           
            config.addActiveDescriptor(descriptor);

            config.commit();

            return descriptor;
        }

        public void modifiedService(ServiceReference reference, Object service) {
View Full Code Here

            };

            config.addUnbindFilter(filter);

            config.commit();
        }
    }
   
  public HK2Main() {
    super();
View Full Code Here

        config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(
                env.isEmbedded() ?
                new ProcessEnvironment(ProcessEnvironment.ProcessType.Embedded):
                new ProcessEnvironment(ProcessEnvironment.ProcessType.Server)));
        config.commit();

        // activate the run level services
        if (proceedTo(InitRunLevel.VAL, new InitActivator())) {
            if (proceedTo(StartupRunLevel.VAL, new StartupActivator())) {
                proceedTo(PostStartupRunLevel.VAL, new PostStartupActivator());
View Full Code Here

        DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
        DynamicConfiguration config = dcs.createDynamicConfiguration();

        ActiveDescriptor<?> activatorDescriptor = config.addActiveDescriptor(BuilderHelper.createConstantDescriptor(activator));

        config.commit();

        try {
            runLevelController.proceedTo(runLevel);
        } catch (Exception e) {
            logger.log(Level.SEVERE, "Shutdown required", e);
View Full Code Here

            shutdown();
            return false;
        } finally {
            config = dcs.createDynamicConfiguration();
            config.addUnbindFilter(BuilderHelper.createSpecificDescriptorFilter(activatorDescriptor));
            config.commit();
        }
        return !activator.isShutdown();
    }

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.