Package io.airlift.configuration

Examples of io.airlift.configuration.ConfigurationModule


      }
    };
    Guice.createInjector
      (
        Stage.PRODUCTION,
        new ConfigurationModule(cf),
        new ValidationErrorModule(new ConfigurationValidator(cf, null).validate(exampleModule)),
        new LifeCycleModule(),
        exampleModule,
        new NiftyModule() {
          @Override
View Full Code Here


                ConfigurationModule.bindConfig(binder()).to(LoadTesterConfig.class);
                binder().bind(NiftyBootstrap.class).in(Singleton.class);
            }
        };
        Guice.createInjector(Stage.PRODUCTION,
                             new ConfigurationModule(cf),
                             new ValidationErrorModule(new ConfigurationValidator(cf, null).validate(exampleModule)),
                             new LifeCycleModule(),
                             exampleModule,
                             new NiftyModule()
                             {
View Full Code Here

    @Test
    public void testThriftClientAndServerModules()
            throws Exception
    {
        Injector injector = Guice.createInjector(Stage.PRODUCTION,
                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                new ThriftCodecModule(),
                new ThriftClientModule(),
                new ThriftServerModule(),
                new JmxModule(),
                new MBeanModule(),
View Full Code Here

    @Test
    public void testThriftWithAnnotationBinding()
            throws Exception
    {
        Injector injector = Guice.createInjector(Stage.PRODUCTION,
                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                new ThriftCodecModule(),
                new ThriftClientModule(),
                new ThriftServerModule(),
                new Module()
                {
View Full Code Here

    @Test
    public void testThriftWithKeyBinding()
            throws Exception
    {
        Injector injector = Guice.createInjector(Stage.PRODUCTION,
                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                new ThriftCodecModule(),
                new ThriftClientModule(),
                new ThriftServerModule(),
                new Module()
                {
View Full Code Here

                .put("PumaReadService.thrift.client.write-timeout", "10s")
                .build();

        Injector injector = Guice.createInjector(
                Stage.PRODUCTION,
                new ConfigurationModule(new ConfigurationFactory(configMap)),
                new ThriftCodecModule(),
                new ThriftClientModule(),
                new Module() {
                    @Override
                    public void configure(Binder binder)
View Full Code Here

     */
    public void runGuiceServer() throws Exception
    {
        Injector injector = Guice.createInjector(
                Stage.PRODUCTION,
                new ConfigurationModule(new ConfigurationFactory(SERVER_CONFIGURATION)),
                new LifeCycleModule(),
                new ThriftCodecModule(),
                new ThriftServerModule(),
                new ThriftServerStatsModule(),
                new Fb303ServiceModule(App.class),
View Full Code Here

    private static final Logger LOG = LoggerFactory.getLogger(App.class);

    public static void main(String[] args) throws Exception {
        Injector serverInjector = Guice.createInjector(
                Stage.PRODUCTION,
                new ConfigurationModule(new ConfigurationFactory(SERVER_CONFIGURATION)),
                new LifeCycleModule(),
                new ThriftCodecModule(),
                new ThriftServerModule(),
                new ThriftServerStatsModule(),
                new Fb303ServiceModule(App.class),
                new MBeanModule(),
                new JmxModule(),
                new HeaderServerModule(),
                new AbstractModule() {
                    @Override
                    protected void configure() {
                        bind(OptionsSource.class).to(EmptyOptionsSource.class);

                        fb303SourceBinder(binder()).exportJmxUtils();
                        fb303SourceBinder(binder()).exportRuntimeMBeans();

                        bind(HeaderUsageExampleHandler.class).in(Scopes.SINGLETON);
                        thriftServerBinder(binder()).exportThriftService(HeaderUsageExampleHandler.class);
                    }
                }
        );

        Injector clientInjector = Guice.createInjector(
                Stage.PRODUCTION,
                new LifeCycleModule(),
                new ConfigurationModule(new ConfigurationFactory(CLIENT_CONFIGURATION)),
                new ThriftCodecModule(),
                new ThriftClientModule(),
                new AbstractModule() {
                    @Override
                    protected void configure() {
View Full Code Here

                "ExampleService.thrift.client.read-timeout", "1000ms"
        );
        Injector injector = Guice.createInjector(
                Stage.PRODUCTION,
                new LifeCycleModule(),
                new ConfigurationModule(new ConfigurationFactory(configuration)),
                new ThriftCodecModule(),
                new ThriftClientModule(),
                new Module()
                {
                    @Override
View Full Code Here

        // In this case, no child injector is needed because Jsr250 handles post-construct
        // exceptions gracefully by running the @PreDestroy for any injected instances
        Jsr250Injector injector = Jsr250.createInjector(
                Stage.PRODUCTION,
                new ConfigurationModule(new ConfigurationFactory(configuration)),
                new ThriftCodecModule(),
                new ThriftClientModule(),
                new Module()
                {
                    @Override
View Full Code Here

TOP

Related Classes of io.airlift.configuration.ConfigurationModule

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.