Package io.airlift.configuration

Examples of io.airlift.configuration.ConfigurationFactory$ConfigurationHolder


                .put("PumaReadService.thrift.client.socks-proxy", proxy.toString())
                .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


        if (config.displayUsage) {
            jCommander.usage();
        } else {
            injector = Guice.createInjector(
                    Stage.PRODUCTION,
                    new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    new LifeCycleModule(),
                    new ThriftCodecModule(),
                    new ThriftClientModule(),
                    new Module()
                    {
View Full Code Here

import java.util.concurrent.Executors;

public class NiftyLoadTester {

    public static void main(String[] args) throws Exception {
    ConfigurationFactory cf = new ConfigurationFactory(new ConfigurationLoader().loadProperties());
    AbstractModule exampleModule = new AbstractModule() {
      @Override
      public void configure() {
        ConfigurationModule.bindConfig(binder()).to(LoadTesterConfig.class);
        binder().bind(NiftyBootstrap.class).in(Singleton.class);
View Full Code Here

    public static void main(String[] args) throws Exception
    {
        // Configure netty logs to go to SLF4J
        InternalLoggerFactory.setDefaultFactory(new Slf4JLoggerFactory());

        ConfigurationFactory cf = new ConfigurationFactory(new ConfigurationLoader().loadProperties());
        AbstractModule exampleModule = new AbstractModule()
        {
            @Override
            public void configure()
            {
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

TOP

Related Classes of io.airlift.configuration.ConfigurationFactory$ConfigurationHolder

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.