Package io.airlift.bootstrap

Examples of io.airlift.bootstrap.Bootstrap


    @BeforeMethod
    public void setup()
            throws Exception
    {
        Bootstrap app = new Bootstrap(
                new TestingNodeModule(),
                new TestingHttpServerModule(),
                new JsonModule(),
                new JmxHttpRpcModule(TheServlet.class),
                new Module()
                {
                    @Override
                    public void configure(Binder binder)
                    {
                        binder.bind(MBeanServer.class).toInstance(platformMBeanServer);
                        binder.bind(TestMBean.class).in(Scopes.SINGLETON);
                    }
                });

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .initialize();

        lifeCycleManager = injector.getInstance(LifeCycleManager.class);
View Full Code Here


    @BeforeMethod
    public void setup()
            throws Exception
    {
        Bootstrap app = new Bootstrap(
                new TestingNodeModule(),
                new InMemoryEventModule(),
                new TestingHttpServerModule(),
                new JsonModule(),
                new JaxrsModule(true),
                new MainModule());

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .initialize();

        lifeCycleManager = injector.getInstance(LifeCycleManager.class);
View Full Code Here

    @BeforeMethod
    public void setup()
            throws Exception
    {
        Bootstrap app = new Bootstrap(
                new TestingNodeModule(),
                new TestingHttpServerModule(),
                new JsonModule(),
                new JaxrsModule(true),
                new JmxHttpModule(),
                new JmxModule(),
                new MainModule());

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .initialize();

        lifeCycleManager = injector.getInstance(LifeCycleManager.class);
View Full Code Here

    private final static Logger log = Logger.get(Main.class);

    public static void main(String[] args)
            throws Exception
    {
        Bootstrap app = new Bootstrap(
                new NodeModule(),
                new DiscoveryModule(),
                new HttpServerModule(),
                new JsonModule(),
                new JaxrsModule(true),
                new MBeanModule(),
                new JmxModule(),
                new JmxHttpModule(),
                new JmxHttpRpcModule(),
                new LogJmxModule(),
                new HttpEventModule(),
                new TraceTokenModule(),
                new MainModule());

        try {
            Injector injector = app.strictConfig().initialize();
            injector.getInstance(Announcer.class).start();
        }
        catch (Throwable e) {
            log.error(e);
            System.exit(1);
View Full Code Here

            modules.add(new TestingDiscoveryModule());
        }

        modules.addAll(additionalModules);

        Bootstrap app = new Bootstrap(modules.build());

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(serverProperties.build())
                .initialize();
View Full Code Here

    @Test
    public void testGuiceInjection()
        throws Exception
    {
        Bootstrap bootstrap = new Bootstrap(new Module() {

            @Override
            public void configure(Binder binder)
            {
                bindConfig(binder).to(ThriftClientConfig.class);
            }
        });

        Map<String, String> properties = ImmutableMap.of();

        Injector injector = bootstrap.doNotInitializeLogging()
                        .strictConfig()
                        .setRequiredConfigurationProperties(properties)
                        .initialize();

        ThriftClientConfig clientConfig = injector.getInstance(ThriftClientConfig.class);
View Full Code Here

    @Test
    public void testGuiceInjection()
            throws Exception
    {
        Bootstrap bootstrap = new Bootstrap(new AbstractModule() {
            @Override
            protected void configure()
            {
                bindConfig(binder()).to(ThriftServerConfig.class);
            }
        });

        Map<String, String> properties = ImmutableMap.of();

        Injector injector =
                bootstrap.doNotInitializeLogging()
                .strictConfig()
                .setRequiredConfigurationProperties(properties)
                .initialize();

        ThriftServerConfig config = injector.getInstance(ThriftServerConfig.class);
View Full Code Here

        }
        else {
            modules.add(new TestingDiscoveryModule());
        }

        Bootstrap app = new Bootstrap(modules.build());

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(serverProperties.build())
                .initialize();
View Full Code Here

            modules.add(new TestingDiscoveryModule());
        }

        modules.addAll(additionalModules);

        Bootstrap app = new Bootstrap(modules.build());

        Injector injector = app
                .strictConfig()
                .doNotInitializeLogging()
                .setRequiredConfigurationProperties(serverProperties.build())
                .initialize();
View Full Code Here

                new EmbeddedDiscoveryModule(),
                new ServerMainModule());

        modules.addAll(getAdditionalModules());

        Bootstrap app = new Bootstrap(modules.build());

        try {
            Injector injector = app.strictConfig().initialize();

            if (!FloatingDecimal.isPatchInstalled()) {
                log.warn("FloatingDecimal patch not installed. Parallelism will be diminished when parsing/formatting doubles");
            }
View Full Code Here

TOP

Related Classes of io.airlift.bootstrap.Bootstrap

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.