Package com.netflix.governator.guice

Examples of com.netflix.governator.guice.BootstrapModule


    @Test
    public void shouldInitInterfaceInParallel() {
        Injector injector = LifecycleInjector.builder()
                .withPostInjectorAction(new BindingReport("Report"))
                .withMode(LifecycleInjectorMode.SIMULATED_CHILD_INJECTORS)
                .withAdditionalBootstrapModules(new BootstrapModule() {
                    @Override
                    public void configure(BootstrapBinder binder) {
                        binder.bindLifecycleListener().to(LoggingLifecycleListener.class);
                    }
                })
View Full Code Here


        Injector injector = lifecycleInjectorBuilder
            .ignoringAutoBindClasses(Collections.<Class<?>>singleton(ObjectWithCustomAutoBind.class))
            .withBootstrapModule
            (
                new BootstrapModule()
                {
                    @Override
                    public void configure(BootstrapBinder binder)
                    {
                        binder.bind(new TypeLiteral<AutoBindProvider<AutoBind>>(){}).toInstance(provider);
View Full Code Here

        @SuppressWarnings("RedundantCast")
        Injector injector = lifecycleInjectorBuilder
            .ignoringAutoBindClasses(Lists.newArrayList((Class<?>)SimpleAutoBind.class, (Class<?>)SimpleWithMultipleAutoBinds.class, (Class<?>)SimpleWithFieldAutoBind.class, (Class<?>)SimpleWithMethodAutoBind.class))
            .withBootstrapModule
            (
                new BootstrapModule()
                {
                    @Override
                    public void configure(BootstrapBinder binder)
                    {
                        binder.bind(new TypeLiteral<AutoBindProvider<CustomAutoBind>>(){}).to(CustomAutoBindProvider.class).asEagerSingleton();
View Full Code Here

        Injector injector = lifecycleInjectorBuilder
            .ignoringAutoBindClasses(Collections.<Class<?>>singleton(ObjectWithCustomAutoBind.class))
            .withBootstrapModule
            (
                new BootstrapModule()
                {
                    @Override
                    public void configure(BootstrapBinder binder)
                    {
                        binder.bind(new TypeLiteral<AutoBindProvider<AutoBind>>(){}).toInstance(provider);
View Full Code Here

        Injector injector = lifecycleInjectorBuilder
            .ignoringAutoBindClasses(Collections.<Class<?>>singleton(ObjectWithCustomAutoBind.class))
            .withBootstrapModule
            (
                new BootstrapModule()
                {
                    @Override
                    public void configure(BootstrapBinder binder)
                    {
                        binder.bind(new TypeLiteral<AutoBindProvider<AutoBind>>()
View Full Code Here

        Injector injector = lifecycleInjectorBuilder
            .ignoringAutoBindClasses(Collections.<Class<?>>singleton(ObjectWithCustomAutoBind.class))
            .withBootstrapModule
                (
                    new BootstrapModule()
                    {
                        @Override
                        public void configure(BootstrapBinder binder)
                        {
                            binder.bind(new TypeLiteral<AutoBindProvider<AutoBind>>(){}).toInstance(provider);
View Full Code Here

   
    @Test
    public void shouldUseOverrideModule() {
        Injector injector = LifecycleInjector.builder()
                .withRootModule(ConcurrencyModule.class)
                .withBootstrapModule(new BootstrapModule() {
                    @Override
                    public void configure(BootstrapBinder binder) {
                        binder.bind(ConcurrencyModule.class).toInstance(new ConcurrencyModule() {
                            @Override
                            protected void configure() {
View Full Code Here

    @Override
    public void configure(LifecycleInjectorBuilder builder) {
        builder.withMode(LifecycleInjectorMode.SIMULATED_CHILD_INJECTORS);
        if (null != karyonBootstrap) {
            builder.withAdditionalBootstrapModules(new BootstrapModule() {
                @Override
                public void configure(BootstrapBinder bootstrapBinder) {
                    bootstrapBinder.bind(KaryonBootstrap.class).toInstance(karyonBootstrap);
                }
            });
View Full Code Here

        propertiesLoader = null;
    }

    @Override
    public void configure(LifecycleInjectorBuilder builder) {
        builder.withAdditionalBootstrapModules(new BootstrapModule() {

            @Override
            public void configure(BootstrapBinder bootstrapBinder) {
                if (null != propertiesLoaderClass) {
                    bootstrapBinder.bind(PropertiesLoader.class).to(propertiesLoaderClass).asEagerSingleton();
View Full Code Here

        ConfigurationManager.getConfigInstance().setProperty("testnamespace.shouldFetchRegistry", "false");
        ConfigurationManager.getConfigInstance().setProperty("testnamespace.registration.enabled", "false");
        ConfigurationManager.getConfigInstance().setProperty("testnamespace.serviceUrl.default", "http://localhost:8080/");
       
        Injector injector = LifecycleInjector.builder()
                .withBootstrapModule(new BootstrapModule() {
                    @Override
                    public void configure(BootstrapBinder binder) {
                        binder.bind(String.class).annotatedWith(EurekaNamespace.class).toInstance("testnamespace.");
                    }
                })
View Full Code Here

TOP

Related Classes of com.netflix.governator.guice.BootstrapModule

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.