Package com.google.inject

Examples of com.google.inject.PrivateBinder.install()


        {
            @Override
            public void configure(Binder binder)
            {
                PrivateBinder privateBinder = binder.newPrivateBinder();
                privateBinder.install(createModule(Config1.class, null));
                privateBinder.bind(ExposeConfig.class).in(Scopes.SINGLETON);
                privateBinder.expose(ExposeConfig.class);
            }
        };
        Injector injector = createInjector(properties, module);
View Full Code Here


        {
            @Override
            public void configure(Binder binder)
            {
                PrivateBinder privateBinder = binder.newPrivateBinder();
                privateBinder.install(createModule(Config1.class, null));
                privateBinder.bind(ExposeConfig.class).annotatedWith(named("no-prefix")).to(ExposeConfig.class).in(Scopes.SINGLETON);
                privateBinder.expose(Key.get(ExposeConfig.class, named("no-prefix")));

                privateBinder = binder.newPrivateBinder();
                privateBinder.install(createModule(Config1.class, "prefix"));
View Full Code Here

                privateBinder.install(createModule(Config1.class, null));
                privateBinder.bind(ExposeConfig.class).annotatedWith(named("no-prefix")).to(ExposeConfig.class).in(Scopes.SINGLETON);
                privateBinder.expose(Key.get(ExposeConfig.class, named("no-prefix")));

                privateBinder = binder.newPrivateBinder();
                privateBinder.install(createModule(Config1.class, "prefix"));
                privateBinder.bind(ExposeConfig.class).annotatedWith(named("prefix")).to(ExposeConfig.class).in(Scopes.SINGLETON);
                privateBinder.expose(Key.get(ExposeConfig.class, named("prefix")));
            }

        };
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.