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.addUnbindFilter(BuilderHelper.createContractFilter(ProgramOptions.class.getName()));
        ActiveDescriptor<ProgramOptions> desc = BuilderHelper.createConstantDescriptor(
                options, null, ProgramOptions.class);
        config.addActiveDescriptor(desc);

        config.commit();
    }

    /**
     * Read commands from the specified BufferedReader and execute them. If
     * printPrompt is set, prompt first.
View Full Code Here

        DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
        DynamicConfiguration config = dcs.createDynamicConfiguration();
       
        config.addActiveDescriptor(EvilService.class);
       
        config.commit()// This will throw a MultiException
    }
   
    /**
     * Mallory cannot un-advertise ServiceLocator!
     */
 
View Full Code Here

        DynamicConfigurationService dcs = locator.getService(DynamicConfigurationService.class);
        DynamicConfiguration config = dcs.createDynamicConfiguration();
       
        config.addUnbindFilter(unbindFilter);
       
        config.commit()// This will throw a MultiException
    }
   
    /**
     * Tries to instantiate a service with an illegal injection point
     */
 
View Full Code Here

        DynamicConfiguration dc = dcs.createDynamicConfiguration();

        locator.inject(binder);
        binder.bind(dc);

        dc.commit();
    }

}
View Full Code Here

        DynamicConfiguration dc = dcs.createDynamicConfiguration();

        locator.inject(binder);
        binder.bind(dc);

        dc.commit();
    }

}
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

            }
        });

        config.bind(descriptor, false);
        config.commit();
    }
   
    /**
     * This method will add the ability to use the {@link Immediate} scope to
     * the given locator.  If the locator already has a {@link Context} implementation
View Full Code Here

        for (Binder binder : binders) {
            binder.bind(config);
        }

        config.commit();
    }

    /**
     * This method will create or find a ServiceLocator with the given name and
     * bind all of the binders given together in a single config transaction.
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.