PageRenderTime 4297ms queryTime 127ms sortTime 1ms getByIdsTime 196ms findMatchingLines 189ms

100+ results results for 'com.google guice createinjector' (4297 ms)

Not the results you expected?
Module.html https://github.com/christophercurrie/Moogle-Muice.git | HTML | 280 lines
                    
137<CODE>static&nbsp;<A HREF="../../../../com/google/inject/Injector.html" title="interface in com.google.inject">Injector</A></CODE></FONT></TD>
                    
138<TD><CODE><B>Guice.</B><B><A HREF="../../../../com/google/inject/Guice.html#createInjector(com.google.inject.Module...)">createInjector</A></B>(<A HREF="../../../../com/google/inject/Module.html" title="interface in com.google.inject">Module</A>...&nbsp;modules)</CODE>
                    
139
                    
145<CODE>static&nbsp;<A HREF="../../../../com/google/inject/Injector.html" title="interface in com.google.inject">Injector</A></CODE></FONT></TD>
                    
146<TD><CODE><B>Guice.</B><B><A HREF="../../../../com/google/inject/Guice.html#createInjector(com.google.inject.Stage, com.google.inject.Module...)">createInjector</A></B>(<A HREF="../../../../com/google/inject/Stage.html" title="enum in com.google.inject">Stage</A>&nbsp;stage,
                    
147               <A HREF="../../../../com/google/inject/Module.html" title="interface in com.google.inject">Module</A>...&nbsp;modules)</CODE>
                    
174<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
                    
175<TH ALIGN="left" COLSPAN="2">Method parameters in <A HREF="../../../../com/google/inject/package-summary.html">com.google.inject</A> with type arguments of type <A HREF="../../../../com/google/inject/Module.html" title="interface in com.google.inject">Module</A></FONT></TH>
                    
176</TR>
                    
179<CODE>static&nbsp;<A HREF="../../../../com/google/inject/Injector.html" title="interface in com.google.inject">Injector</A></CODE></FONT></TD>
                    
180<TD><CODE><B>Guice.</B><B><A HREF="../../../../com/google/inject/Guice.html#createInjector(java.lang.Iterable)">createInjector</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;<A HREF="../../../../com/google/inject/Module.html" title="interface in com.google.inject">Module</A>&gt;&nbsp;modules)</CODE>
                    
181
                    
187<CODE>static&nbsp;<A HREF="../../../../com/google/inject/Injector.html" title="interface in com.google.inject">Injector</A></CODE></FONT></TD>
                    
188<TD><CODE><B>Guice.</B><B><A HREF="../../../../com/google/inject/Guice.html#createInjector(com.google.inject.Stage, java.lang.Iterable)">createInjector</A></B>(<A HREF="../../../../com/google/inject/Stage.html" title="enum in com.google.inject">Stage</A>&nbsp;stage,
                    
189               <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;<A HREF="../../../../com/google/inject/Module.html" title="interface in com.google.inject">Module</A>&gt;&nbsp;modules)</CODE>
                    
                
MethodInterceptionTest.java https://gitlab.com/metamorphiccode/guice | Java | 369 lines
                    
67  public void testSharedProxyClasses() {
                    
68    Injector injector = Guice.createInjector(new AbstractModule() {
                    
69      protected void configure() {
                    
151    final MethodInterceptor returnNullInterceptor = new ReturnNullInterceptor();
                    
152    Injector injector = Guice.createInjector(new AbstractModule() {
                    
153      protected void configure() {
                    
203  public void testNotInterceptedMethodsInInterceptedClassDontAddFrames() {
                    
204    Injector injector = Guice.createInjector(new AbstractModule() {
                    
205      protected void configure() {
                    
256  public void testInterceptingNonBridgeWorks() {
                    
257    Injector injector = Guice.createInjector(new AbstractModule() {
                    
258      @Override
                    
317  public void testDeDuplicateInterceptors() throws Exception {
                    
318    Injector injector = Guice.createInjector(new AbstractModule() {
                    
319      @Override protected void configure() {
                    
                
VAppHandlerTest.java https://github.com/dmitrib/jclouds.git | Java | 184 lines
                    
43
                    
44import com.google.common.collect.ImmutableListMultimap;
                    
45import com.google.common.collect.ImmutableSet;
                    
45import com.google.common.collect.ImmutableSet;
                    
46import com.google.common.collect.ListMultimap;
                    
47import com.google.inject.AbstractModule;
                    
47import com.google.inject.AbstractModule;
                    
48import com.google.inject.Guice;
                    
49import com.google.inject.name.Names;
                    
61   protected void setUpInjector() {
                    
62      injector = Guice.createInjector(new SaxParserModule(), new AbstractModule() {
                    
63
                    
                
CommaFeedApplication.java https://gitlab.com/gmi7/commafeed | Java | 174 lines
                    
48import com.commafeed.frontend.session.SessionHelperFactoryProvider;
                    
49import com.google.inject.Guice;
                    
50import com.google.inject.Injector;
                    
50import com.google.inject.Injector;
                    
51import com.google.inject.Key;
                    
52import com.google.inject.TypeLiteral;
                    
110		// guice init
                    
111		Injector injector = Guice.createInjector(new CommaFeedModule(hibernateBundle.getSessionFactory(), config, environment.metrics()));
                    
112
                    
                
TestLifeCycleManager.java https://gitlab.com/CORP-RESELLER/airlift | Java | 328 lines
                    
20import com.google.inject.CreationException;
                    
21import com.google.inject.Guice;
                    
22import com.google.inject.Injector;
                    
124        };
                    
125        Injector injector = Guice.createInjector(
                    
126                Stage.PRODUCTION,
                    
249    {
                    
250        Injector injector = Guice.createInjector(
                    
251                Stage.PRODUCTION,
                    
275    {
                    
276        Injector injector = Guice.createInjector(
                    
277                Stage.PRODUCTION,
                    
314        };
                    
315        Injector injector = Guice.createInjector(
                    
316                Stage.PRODUCTION,
                    
                
ModuleAnnotatedMethodScannerTest.java https://gitlab.com/metamorphiccode/guice | Java | 394 lines
                    
62    };
                    
63    Injector injector = Guice.createInjector(module, NamedMunger.module());
                    
64
                    
248  public void testPrivateModuleInheritScanner_usingPrivateModule() {
                    
249    Injector injector = Guice.createInjector(NamedMunger.module(), new PrivateModule() {
                    
250      @Override protected void configure() {}
                    
259  public void testPrivateModule_skipSourcesWithinPrivateModule() {
                    
260    Injector injector = Guice.createInjector(NamedMunger.module(), new PrivateModule() {
                    
261      @Override protected void configure() {
                    
317  public void testPrivateModuleInheritScanner_skipSourcesFromPrivateBinder2() {
                    
318    Injector injector = Guice.createInjector(NamedMunger.module(), new AbstractModule() {
                    
319      @Override protected void configure() {
                    
332  public void testPrivateModuleScannersDontImpactSiblings_usingPrivateModule() {
                    
333    Injector injector = Guice.createInjector(new PrivateModule() {
                    
334      @Override protected void configure() {
                    
                
VAppHandlerTest.java https://github.com/dmitrib/jclouds.git | Java | 196 lines
                    
20
                    
21import static com.google.common.collect.Iterables.find;
                    
22import static org.testng.Assert.assertEquals;
                    
45
                    
46import com.google.common.collect.ImmutableList;
                    
47import com.google.common.collect.ImmutableSet;
                    
47import com.google.common.collect.ImmutableSet;
                    
48import com.google.common.collect.Iterables;
                    
49import com.google.common.collect.Lists;
                    
50import com.google.inject.AbstractModule;
                    
51import com.google.inject.Guice;
                    
52import com.google.inject.name.Names;
                    
65   protected void setUpInjector() {
                    
66      injector = Guice.createInjector(new SaxParserModule(), new AbstractModule() {
                    
67
                    
                
ParentInjectorTest.java https://gitlab.com/metamorphiccode/guice | Java | 331 lines
                    
93  public void testBindingsInherited() {
                    
94    Injector parent = Guice.createInjector(bindsB);
                    
95    Injector child = parent.createChildInjector();
                    
99  public void testGetParent() {
                    
100    Injector top = Guice.createInjector(bindsA);
                    
101    Injector middle = top.createChildInjector(bindsB);
                    
165  public void testTypeConvertersConflicting() {
                    
166    Injector parent = Guice.createInjector(bindListConverterModule);
                    
167    Injector child = parent.createChildInjector(bindListConverterModule, bindStringNamedB);
                    
177  public void testInjectorInjectionSpanningInjectors() {
                    
178    Injector parent = Guice.createInjector();
                    
179    Injector child = parent.createChildInjector(new AbstractModule() {
                    
253  public void testErrorInParentAndChild() {
                    
254    Injector parent = Guice.createInjector();
                    
255    Injector childInjector = parent.createChildInjector();
                    
                
LimeTestUtils.java https://github.com/WIZARDISHUNGRY/limewire.git | Java | 318 lines
                    
29import com.google.inject.AbstractModule;
                    
30import com.google.inject.Guice;
                    
31import com.google.inject.Injector;
                    
171    
                    
172    public static Injector createInjector(Stage stage, Class<? extends ActivityCallback> callbackClass, Module...modules) {
                    
173        Module combinedReplacements = Modules.combine(modules);
                    
175        Module replaced = Modules.override(combinedOriginals).with(combinedReplacements);
                    
176        return Guice.createInjector(stage, replaced);
                    
177    }
                    
179    /**
                    
180     * Wraps {@link #createInjector(Module, Class) createInjector(Module, ActivityCallbackStub.class)}.
                    
181     */
                    
208    /**
                    
209     * Wraps {@link #createInjectorAndStart(Module, Class) createInjectorAndStart(Module, ActivityCallbackStub.class)}.
                    
210     */
                    
                
LocalToJpaDataMigratorTest.java https://gitlab.com/unofficial-mirrors/eclipse-che | Java | 300 lines
                    
12
                    
13import com.google.common.collect.ImmutableMap;
                    
14import com.google.gson.Gson;
                    
15import com.google.gson.JsonElement;
                    
16import com.google.gson.JsonObject;
                    
17import com.google.gson.JsonPrimitive;
                    
18import com.google.gson.JsonSerializationContext;
                    
19import com.google.gson.JsonSerializer;
                    
20import com.google.inject.AbstractModule;
                    
20import com.google.inject.AbstractModule;
                    
21import com.google.inject.Guice;
                    
22import com.google.inject.Injector;
                    
104        factory = new LocalStorageFactory(workingDir.toString());
                    
105        injector = Guice.createInjector(Stage.PRODUCTION, new AbstractModule() {
                    
106            @Override
                    
                
ProvidesIntoTest.java https://gitlab.com/metamorphiccode/guice | Java | 373 lines
                    
49  public void testAnnotation() throws Exception {
                    
50    Injector injector = Guice.createInjector(MultibindingsScanner.asModule(), new AbstractModule() {
                    
51      @Override protected void configure() {}
                    
297    try {
                    
298      Guice.createInjector(MultibindingsScanner.asModule(), m);
                    
299      fail();
                    
312    try {
                    
313      Guice.createInjector(MultibindingsScanner.asModule(), m);
                    
314      fail();
                    
339    try {
                    
340      Guice.createInjector(MultibindingsScanner.asModule(), m);
                    
341      fail();
                    
364    try {
                    
365      Guice.createInjector(MultibindingsScanner.asModule(), m);
                    
366      fail();
                    
                
BTSwarmCoordinatorTest.java https://github.com/r3n/limewire5-ruby.git | Java | 352 lines
                    
26
                    
27import com.google.inject.Guice;
                    
28import com.google.inject.Injector;
                    
77    protected void setUp() throws Exception {
                    
78        injector = Guice.createInjector(new LimeWireCoreModule(ActivityCallbackStub.class));
                    
79        metaInfoFactory = injector.getInstance(BTMetaInfoFactory.class);
                    
                
PackageFilterTests.java https://github.com/manzke/guice-automatic-injection.git | Java | 145 lines
                    
25import com.google.inject.ConfigurationException;
                    
26import com.google.inject.Guice;
                    
27import com.google.inject.Injector;
                    
40	public void createDynamicModule() {
                    
41		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
42			PackageFilter.create(PackageFilterTests.class)));
                    
63	public void createTestInterface() {
                    
64		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
65			PackageFilter.create(PackageFilterTests.class)));
                    
76	public void createSecondTestInterface() {
                    
77		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
78			PackageFilter.create(PackageFilterTests.class)));
                    
89	public void createAllInterfaces() {
                    
90		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
91			PackageFilter.create(PackageFilterTests.class)));
                    
                
AutobindTests.java https://github.com/manzke/guice-automatic-injection.git | Java | 145 lines
                    
25import com.google.inject.ConfigurationException;
                    
26import com.google.inject.Guice;
                    
27import com.google.inject.Injector;
                    
40	public void createDynamicModule() {
                    
41		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
42			PackageFilter.create(AutobindTests.class, false)));
                    
63	public void createTestInterface() {
                    
64		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
65			PackageFilter.create(AutobindTests.class, false)));
                    
76	public void createSecondTestInterface() {
                    
77		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
78			PackageFilter.create(AutobindTests.class, false)));
                    
89	public void createAllInterfaces() {
                    
90		Injector injector = Guice.createInjector(new TestStartupModule(SonatypeScanner.class,
                    
91			PackageFilter.create(AutobindTests.class, false)));
                    
                
SiteProgram.java https://gitlab.com/chenfengxu/gerrit | Java | 266 lines
                    
41import com.google.inject.CreationException;
                    
42import com.google.inject.Guice;
                    
43import com.google.inject.Injector;
                    
157    modules.add(configModule);
                    
158    Injector cfgInjector = Guice.createInjector(sitePathModule, configModule);
                    
159    Config cfg = cfgInjector.getInstance(Key.get(Config.class, GerritServerConfig.class));
                    
171    DataSourceType dst =
                    
172        Guice.createInjector(new DataSourceModule(), configModule, sitePathModule)
                    
173            .getInstance(Key.get(DataSourceType.class, Names.named(dbType.toLowerCase())));
                    
187    try {
                    
188      return Guice.createInjector(PRODUCTION, modules);
                    
189    } catch (CreationException ce) {
                    
243    modules.add(new DataSourceModule());
                    
244    Injector i = Guice.createInjector(modules);
                    
245    List<Binding<DataSourceType>> dsTypeBindings =
                    
                
AbstractLdapSynchronizer.java https://gitlab.com/gesnaud/xivo-lib-ldap | Java | 252 lines
                    
29
                    
30import com.google.inject.Guice;
                    
31import com.google.inject.Inject;
                    
31import com.google.inject.Inject;
                    
32import com.google.inject.Injector;
                    
33
                    
60        AbstractLDAPModule module = getModuleInstance(moduleClass, parsing);
                    
61        Injector injector = Guice.createInjector(module);
                    
62        AbstractLdapSynchronizer synchronizer = injector.getInstance(AbstractLdapSynchronizer.class);
                    
                
Activator.java https://github.com/peterlynch/spice.git | Java | 244 lines
                    
12 */
                    
13package org.sonatype.guice.bean.containers;
                    
14
                    
31import org.sonatype.guice.bean.binders.SpaceModule;
                    
32import org.sonatype.guice.bean.binders.WireModule;
                    
33import org.sonatype.guice.bean.locators.DefaultBeanLocator;
                    
33import org.sonatype.guice.bean.locators.DefaultBeanLocator;
                    
34import org.sonatype.guice.bean.locators.MutableBeanLocator;
                    
35import org.sonatype.guice.bean.reflect.BundleClassSpace;
                    
38import com.google.inject.Binder;
                    
39import com.google.inject.Guice;
                    
40import com.google.inject.Injector;
                    
185            final ClassSpace space = new BundleClassSpace( bundle );
                    
186            injector = Guice.createInjector( new WireModule( this, new SpaceModule( space ) ) );
                    
187            final Dictionary<Object, Object> metadata = new Hashtable<Object, Object>();
                    
                
VDCHandlerTest.java https://github.com/goodwink/jclouds.git | Java | 193 lines
                    
36import com.google.common.collect.ImmutableSet;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
49      InputStream is = getClass().getResourceAsStream("/vdc.xml");
                    
50      Injector injector = Guice.createInjector(new SaxParserModule());
                    
51      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
95      InputStream is = getClass().getResourceAsStream("/vdc-1net.xml");
                    
96      Injector injector = Guice.createInjector(new SaxParserModule());
                    
97      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
120      InputStream is = getClass().getResourceAsStream("/vdc-failed.xml");
                    
121      Injector injector = Guice.createInjector(new SaxParserModule());
                    
122      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
139      InputStream is = getClass().getResourceAsStream("/vdc-saved.xml");
                    
140      Injector injector = Guice.createInjector(new SaxParserModule());
                    
141      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
                
TransferRequestIntegrationTest.java https://gitlab.com/metamorphiccode/guice | Java | 215 lines
                    
16
                    
17package com.google.inject.servlet;
                    
18
                    
18
                    
19import com.google.common.collect.ImmutableMap;
                    
20import com.google.inject.AbstractModule;
                    
20import com.google.inject.AbstractModule;
                    
21import com.google.inject.Guice;
                    
22import com.google.inject.Injector;
                    
69  public void testTransferNonHttpRequest() throws Exception {
                    
70    final Injector injector = Guice.createInjector(new AbstractModule() {
                    
71      @Override protected void configure() {
                    
99  public void testTransferNonHttpRequest_closeable() throws Exception {
                    
100    final Injector injector = Guice.createInjector(new AbstractModule() {
                    
101      @Override protected void configure() {
                    
                
TestThriftClientAndServerModules.java https://gitlab.com/mayakarya/swift | Java | 312 lines
                    
39import com.google.inject.BindingAnnotation;
                    
40import com.google.inject.Guice;
                    
41import com.google.inject.Injector;
                    
91        final List<Object> eventHandlerContexts = newArrayList();
                    
92        Injector injector = Guice.createInjector(Stage.PRODUCTION,
                    
93                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    
158    {
                    
159        Injector injector = Guice.createInjector(Stage.PRODUCTION,
                    
160                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    
205    {
                    
206        Injector injector = Guice.createInjector(Stage.PRODUCTION,
                    
207                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    
271
                    
272        Injector injector = Guice.createInjector(
                    
273                Stage.PRODUCTION,
                    
                
MyApp.java https://github.com/leoneu/s4-piper.git | Java | 152 lines
                    
25
                    
26import com.google.inject.Guice;
                    
27import com.google.inject.Injector;
                    
134
                    
135        Injector injector = Guice.createInjector(new Module());
                    
136        MyApp myApp = injector.getInstance(MyApp.class);
                    
                
VarargsFilterDispatchIntegrationTest.java https://gitlab.com/metamorphiccode/guice | Java | 182 lines
                    
1package com.google.inject.servlet;
                    
2
                    
7
                    
8import com.google.inject.Guice;
                    
9import com.google.inject.Injector;
                    
9import com.google.inject.Injector;
                    
10import com.google.inject.Key;
                    
11import com.google.inject.Singleton;
                    
47  public final void testDispatchRequestToManagedPipeline() throws ServletException, IOException {
                    
48    final Injector injector = Guice.createInjector(new ServletModule() {
                    
49
                    
87  public final void testDispatchThatNoFiltersFire() throws ServletException, IOException {
                    
88    final Injector injector = Guice.createInjector(new ServletModule() {
                    
89
                    
128
                    
129    final Injector injector = Guice.createInjector(new ServletModule() {
                    
130
                    
                
PluginGuiceEnvironment.java https://gitlab.com/chenfengxu/gerrit | Java | 648 lines
                    
19import static com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicMapsOf;
                    
20import static com.google.gerrit.extensions.registration.PrivateInternals_DynamicTypes.dynamicSetsOf;
                    
21
                    
36import com.google.gerrit.extensions.webui.WebUiPlugin;
                    
37import com.google.gerrit.index.IndexCollection;
                    
38import com.google.gerrit.metrics.MetricMaker;
                    
43import com.google.inject.Binding;
                    
44import com.google.inject.Guice;
                    
45import com.google.inject.Inject;
                    
67/**
                    
68 * Tracks Guice bindings that should be exposed to loaded plugins.
                    
69 *
                    
115    this.copyConfigModule = ccm;
                    
116    this.copyConfigKeys = Guice.createInjector(ccm).getAllBindings().keySet();
                    
117    this.serverMetrics = serverMetrics;
                    
                
BaseInit.java https://gitlab.com/chenfengxu/gerrit | Java | 525 lines
                    
19import static com.google.inject.Scopes.SINGLETON;
                    
20import static com.google.inject.Stage.PRODUCTION;
                    
21
                    
40import com.google.gerrit.server.config.SitePaths;
                    
41import com.google.gerrit.server.git.GitRepositoryManager;
                    
42import com.google.gerrit.server.index.IndexModule;
                    
56import com.google.inject.CreationException;
                    
57import com.google.inject.Guice;
                    
58import com.google.inject.Inject;
                    
59import com.google.inject.Injector;
                    
60import com.google.inject.Module;
                    
61import com.google.inject.Provider;
                    
299    try {
                    
300      return Guice.createInjector(PRODUCTION, m).getInstance(SiteInit.class);
                    
301    } catch (CreationException ce) {
                    
                
TestHttpServerModule.java https://gitlab.com/github-cloud-corp/airlift | Java | 379 lines
                    
27import com.google.inject.Binder;
                    
28import com.google.inject.Guice;
                    
29import com.google.inject.Injector;
                    
121        ConfigurationFactory configFactory = new ConfigurationFactory(properties);
                    
122        Injector injector = Guice.createInjector(new HttpServerModule(),
                    
123                new NodeModule(),
                    
149        ConfigurationFactory configFactory = new ConfigurationFactory(properties);
                    
150        Injector injector = Guice.createInjector(new HttpServerModule(),
                    
151                new NodeModule(),
                    
190        ConfigurationFactory configFactory = new ConfigurationFactory(properties);
                    
191        Injector injector = Guice.createInjector(new HttpServerModule(),
                    
192                new NodeModule(),
                    
264        ConfigurationFactory configFactory = new ConfigurationFactory(properties);
                    
265        Injector injector = Guice.createInjector(new HttpServerModule(),
                    
266                new NodeModule(),
                    
                
ConfigurationFactoryTest.java https://gitlab.com/github-cloud-corp/airlift | Java | 464 lines
                    
20import com.google.inject.CreationException;
                    
21import com.google.inject.Guice;
                    
22import com.google.inject.Injector;
                    
22import com.google.inject.Injector;
                    
23import com.google.inject.Module;
                    
24import com.google.inject.spi.Message;
                    
113        TestMonitor monitor = new TestMonitor();
                    
114        Injector injector = createInjector(properties, monitor, new Module()
                    
115        {
                    
137        TestMonitor monitor = new TestMonitor();
                    
138        Injector injector = createInjector(properties, monitor, new Module()
                    
139        {
                    
297        List<Message> messages = new ConfigurationValidator(configurationFactory, null).validate(module);
                    
298        return Guice.createInjector(new ConfigurationModule(configurationFactory), module, new ValidationErrorModule(messages));
                    
299    }
                    
                
Init.java https://gitlab.com/chenfengxu/gerrit | Java | 257 lines
                    
19import com.google.gerrit.common.IoUtil;
                    
20import com.google.gerrit.common.PageLinks;
                    
21import com.google.gerrit.common.PluginData;
                    
21import com.google.gerrit.common.PluginData;
                    
22import com.google.gerrit.pgm.init.BaseInit;
                    
23import com.google.gerrit.pgm.init.Browser;
                    
25import com.google.gerrit.pgm.init.api.ConsoleUI;
                    
26import com.google.gerrit.pgm.util.ErrorLogFile;
                    
27import com.google.gerrit.server.config.GerritServerConfigModule;
                    
31import com.google.inject.AbstractModule;
                    
32import com.google.inject.Guice;
                    
33import com.google.inject.Inject;
                    
140    modules.add(new GerritServerConfigModule());
                    
141    Guice.createInjector(modules).injectMembers(this);
                    
142    start(run);
                    
                
Struts2Factory.java https://gitlab.com/metamorphiccode/guice | Java | 231 lines
                    
20import com.google.inject.Binder;
                    
21import com.google.inject.Injector;
                    
22import com.google.inject.internal.Annotations;
                    
39/**
                    
40 * Cleanup up version from Bob's GuiceObjectFactory. Now works properly with
                    
41 * GS2 and fixes several bugs.
                    
50  private static final String ERROR_NO_INJECTOR =
                    
51      "Cannot find a Guice injector.  Are you sure you registered a GuiceServletContextListener "
                    
52    + "that uses the Struts2GuicePluginModule in your application's web.xml?";
                    
53
                    
54  private static @com.google.inject.Inject Injector injector;
                    
55
                    
63
                    
64  @Inject(value = "guice.module", required = false)
                    
65  void setModule(String moduleClassName) {
                    
                
Injectors.java https://gitlab.com/matticala/apache-camel | Java | 457 lines
                    
32import com.google.inject.Binding;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Injector;
                    
34import com.google.inject.Injector;
                    
35import com.google.inject.Key;
                    
36import com.google.inject.Module;
                    
43import com.google.inject.matcher.Matcher;
                    
44import com.google.inject.name.Names;
                    
45import com.google.inject.util.Modules;
                    
46
                    
47import org.apache.camel.guice.jndi.GuiceInitialContextFactory;
                    
48import org.apache.camel.guice.jndi.internal.Classes;
                    
98        }
                    
99        Injector injector = Guice.createInjector(Modules.override(modules)
                    
100                .with(overridingModules));
                    
                
methods_index_changes.html https://github.com/christophercurrie/Moogle-Muice.git | HTML | 145 lines
                    
60<i>createInjector</i><br>
                    
61&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Module[])" class="hiddenlink" target="rightframe">type&nbsp;
                    
62(<code>Module[]</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
63</A></nobr><br>
                    
64&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Stage, com.google.inject.Module[])" class="hiddenlink" target="rightframe">type&nbsp;
                    
65(<code>Stage, Module[]</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
66</A></nobr><br>
                    
67&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Stage, java.lang.Iterable<? extends com.google.inject.Module>)" class="hiddenlink" target="rightframe">type&nbsp;
                    
68(<code>Stage, Iterable&lt;Module&gt;</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
69</A></nobr><br>
                    
70&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(java.lang.Iterable<? extends com.google.inject.Module>)" class="hiddenlink" target="rightframe">type&nbsp;
                    
71(<code>Iterable&lt;Module&gt;</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
96()</A></nobr><br>
                    
97<nobr><A HREF="com.google.inject.Binder.html#com.google.inject.Binder.getProvider_changed(com.google.inject.Key<T>)" class="hiddenlink" target="rightframe">getProvider
                    
98(<code>Key&lt;T&gt;</code>)</A></nobr><br>
                    
                
RestfulJsonPeopleTest.java https://github.com/thesmith/bbc-shindig-example.git | Java | 262 lines
                    
40
                    
41import bbc.social.shindig.example.GuiceModule;
                    
42
                    
42
                    
43import com.google.common.collect.Lists;
                    
44import com.google.common.collect.Maps;
                    
44import com.google.common.collect.Maps;
                    
45import com.google.inject.Guice;
                    
46import com.google.inject.Injector;
                    
46import com.google.inject.Injector;
                    
47import com.google.inject.Key;
                    
48import com.google.inject.TypeLiteral;
                    
65  protected void setUp() throws Exception {
                    
66    Injector injector = Guice.createInjector(new PropertiesModule(),
                    
67        new GuiceModule());
                    
                
InjectorTest.java https://gitlab.com/metamorphiccode/guice | Java | 413 lines
                    
59
                    
60    Injector injector = Guice.createInjector(new AbstractModule() {
                    
61      protected void configure() {
                    
205  public void testInjectStatics() throws CreationException {
                    
206    Guice.createInjector(new AbstractModule() {
                    
207      protected void configure() {
                    
219    try {
                    
220      Guice.createInjector(new AbstractModule() {
                    
221        protected void configure() {
                    
250  public void testPrivateInjection() throws CreationException {
                    
251    Injector injector = Guice.createInjector(new AbstractModule() {
                    
252      protected void configure() {
                    
319    try {
                    
320      Guice.createInjector().getInstance(Money.class);
                    
321      fail();
                    
                
ServerPlugin.java https://gitlab.com/chenfengxu/gerrit | Java | 313 lines
                    
19import com.google.gerrit.common.Nullable;
                    
20import com.google.gerrit.extensions.registration.RegistrationHandle;
                    
21import com.google.gerrit.extensions.registration.ReloadableRegistrationHandle;
                    
21import com.google.gerrit.extensions.registration.ReloadableRegistrationHandle;
                    
22import com.google.gerrit.lifecycle.LifecycleManager;
                    
23import com.google.gerrit.server.PluginUser;
                    
24import com.google.gerrit.server.util.RequestContext;
                    
25import com.google.inject.Guice;
                    
26import com.google.inject.Injector;
                    
26import com.google.inject.Injector;
                    
27import com.google.inject.Module;
                    
28import java.io.IOException;
                    
259    modules.add(new ServerPluginInfoModule(this, env.getServerMetrics()));
                    
260    return Guice.createInjector(modules);
                    
261  }
                    
                
GuiceCamelContext.java https://gitlab.com/matticala/apache-camel | Java | 176 lines
                    
16 */
                    
17package org.apache.camel.guice;
                    
18
                    
26
                    
27import com.google.inject.Binding;
                    
28import com.google.inject.Inject;
                    
32import org.apache.camel.TypeConverter;
                    
33import org.apache.camel.guice.impl.GuiceInjector;
                    
34import org.apache.camel.guice.inject.Injectors;
                    
48 * It is recommended you use this implementation with the
                    
49 * <a href="http://code.google.com/p/guiceyfruit/wiki/GuiceyJndi">Guicey JNDI Provider</a>
                    
50 *
                    
56    @Inject
                    
57    public GuiceCamelContext(com.google.inject.Injector injector) {
                    
58        this.injector = injector;
                    
                
ThrowingProviderTest.java https://gitlab.com/metamorphiccode/guice | Java | 878 lines
                    
66  private final TestScope testScope = new TestScope();
                    
67  private Injector bindInjector = Guice.createInjector(new AbstractModule() {
                    
68    protected void configure() {
                    
368    try {
                    
369      Guice.createInjector(new AbstractModule() {
                    
370        protected void configure() {
                    
390    try {
                    
391      bindInjector = Guice.createInjector(new AbstractModule() {
                    
392        protected void configure() {
                    
406    try {
                    
407      Guice.createInjector(new AbstractModule() {
                    
408        protected void configure() {
                    
426  public void testDependencies_Bind() {
                    
427    bindInjector = Guice.createInjector(new AbstractModule() {
                    
428      protected void configure() {
                    
                
CheckedProviderTest.java https://gitlab.com/metamorphiccode/guice | Java | 1486 lines
                    
30import com.google.inject.CreationException;
                    
31import com.google.inject.Guice;
                    
32import com.google.inject.Inject;
                    
320    final MockRemoteProvider<Foo> mockRemoteProviderB = new MockRemoteProvider<Foo>();
                    
321    providesInjector = Guice.createInjector(new AbstractModule() {
                    
322      @Override
                    
354  public void testAnnotations_Cxtor() throws Exception {
                    
355    cxtorInjector = Guice.createInjector(new AbstractModule() {
                    
356      @Override
                    
415
                    
416    bindInjector = Guice.createInjector(new AbstractModule() {
                    
417      @Override
                    
432    try {
                    
433      Guice.createInjector(new AbstractModule() {
                    
434        @Override
                    
                
BoundFieldModuleTest.java https://gitlab.com/metamorphiccode/guice | Java | 753 lines
                    
295    try {
                    
296      Guice.createInjector(module);
                    
297      fail();
                    
332    BoundFieldModule module = BoundFieldModule.of(instance);
                    
333    Injector injector = Guice.createInjector(module);
                    
334
                    
458    try {
                    
459      Guice.createInjector(module);
                    
460      fail();
                    
470    BoundFieldModule module = BoundFieldModule.of(instance);
                    
471    Injector injector = Guice.createInjector(module);
                    
472
                    
482    BoundFieldModule module = BoundFieldModule.of(instance);
                    
483    Injector injector = Guice.createInjector(module);
                    
484
                    
                
ServletTest.java https://gitlab.com/metamorphiccode/guice | Java | 471 lines
                    
32import com.google.inject.CreationException;
                    
33import com.google.inject.Guice;
                    
34import com.google.inject.Inject;
                    
277
                    
278    GuiceFilter filter = new GuiceFilter();
                    
279    filter.doFilter(newFakeHttpServletRequest(), newFakeHttpServletResponse(), new FilterChain() {
                    
339
                    
340    GuiceFilter filter = new GuiceFilter();
                    
341    final boolean[] invoked = new boolean[1];
                    
360
                    
361    GuiceFilter filter = new GuiceFilter();
                    
362    final boolean[] invoked = new boolean[1];
                    
385
                    
386    GuiceFilter filter = new GuiceFilter();
                    
387    final boolean[] invoked = new boolean[1];
                    
                
SpiUtils.java https://gitlab.com/metamorphiccode/guice | Java | 1117 lines
                    
21import static com.google.inject.multibindings.MapBinder.mapOfJavaxProviderOf;
                    
22import static com.google.inject.multibindings.MapBinder.mapOfProviderOf;
                    
23import static com.google.inject.multibindings.MapBinder.mapOfSetOfProviderOf;
                    
48import com.google.common.collect.ImmutableSet;
                    
49import com.google.common.collect.Lists;
                    
50import com.google.common.collect.Maps;
                    
54import com.google.inject.Binding;
                    
55import com.google.inject.Guice;
                    
56import com.google.inject.Injector;
                    
70import com.google.inject.spi.ProviderKeyBinding;
                    
71import com.google.inject.spi.ProviderLookup;
                    
72
                    
131      int expectedMapBindings, MapResult... results) {
                    
132    Injector injector = Guice.createInjector(modules);
                    
133    Visitor<T> visitor = new Visitor<T>();
                    
                
OptionalBinderTest.java https://gitlab.com/metamorphiccode/guice | Java | 1241 lines
                    
36import com.google.inject.CreationException;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
224    };
                    
225    Injector injector = Guice.createInjector(module);
                    
226    assertEquals("a", injector.getInstance(String.class));
                    
263    };
                    
264    Injector injector = Guice.createInjector(module);
                    
265    assertEquals("a", injector.getInstance(String.class));
                    
305    };
                    
306    Injector injector = Guice.createInjector(module);
                    
307    assertEquals("b", injector.getInstance(String.class));
                    
361
                    
362    Injector injector = Guice.createInjector(module1, module2, module3);
                    
363    assertEquals("b", injector.getInstance(String.class));
                    
                
MultibinderTest.java https://gitlab.com/metamorphiccode/guice | Java | 1221 lines
                    
41import com.google.inject.CreationException;
                    
42import com.google.inject.Guice;
                    
43import com.google.inject.Injector;
                    
119
                    
120    Injector injector = Guice.createInjector(abc, de);
                    
121    Key<Set<String>> setKey = Key.get(setOfString);
                    
141    };
                    
142    Injector injector = Guice.createInjector(module);
                    
143
                    
163    };
                    
164    Injector injector = Guice.createInjector(module);
                    
165
                    
188    };
                    
189    Injector injector = Guice.createInjector(module);
                    
190
                    
                
MapBinderTest.java https://gitlab.com/metamorphiccode/guice | Java | 1032 lines
                    
39import com.google.inject.CreationException;
                    
40import com.google.inject.Guice;
                    
41import com.google.inject.Inject;
                    
234    };
                    
235    Injector injector = Guice.createInjector(module);
                    
236
                    
262    };
                    
263    Injector injector = Guice.createInjector(module);
                    
264
                    
297    };
                    
298    Injector injector = Guice.createInjector(module);
                    
299
                    
326    };
                    
327    Injector injector = Guice.createInjector(module);
                    
328
                    
                
FactoryProviderTest.java https://gitlab.com/metamorphiccode/guice | Java | 840 lines
                    
90  public void testAssistedFactoryWithAnnotations() {
                    
91    Injector injector = Guice.createInjector(new AbstractModule() {
                    
92      @Override
                    
322  public void testTypeTokenProviderInjection() {
                    
323    Injector injector = Guice.createInjector(new AbstractModule() {
                    
324      @Override
                    
359  public void testAssistInjectionInNonPublicConstructor() {
                    
360    Injector injector = Guice.createInjector(new AbstractModule() {
                    
361      @Override
                    
377  public void testExceptionDuringConstruction() {
                    
378    Injector injector = Guice.createInjector(new AbstractModule() {
                    
379      @Override
                    
424  public void testConstructorExceptionsAreThrownByFactory() {
                    
425    Injector injector = Guice.createInjector(new AbstractModule() {
                    
426      @Override
                    
                
FactoryProvider2Test.java https://gitlab.com/metamorphiccode/guice | Java | 1220 lines
                    
50  public void testAssistedFactory() {
                    
51    Injector injector = Guice.createInjector(new AbstractModule() {
                    
52      @Override
                    
356  public void testAssistInjectionInNonPublicConstructor() {
                    
357    Injector injector = Guice.createInjector(new AbstractModule() {
                    
358      @Override
                    
375  public void testExceptionDuringConstruction() {
                    
376    Injector injector = Guice.createInjector(new AbstractModule() {
                    
377      @Override
                    
413  public void testConstructorExceptionsAreThrownByFactory() {
                    
414    Injector injector = Guice.createInjector(new AbstractModule() {
                    
415      @Override
                    
440  public void testWildcardGenerics() {
                    
441    Injector injector = Guice.createInjector(new AbstractModule() {
                    
442      @Override
                    
                
FactoryModuleBuilderTest.java https://gitlab.com/metamorphiccode/guice | Java | 540 lines
                    
56    try {
                    
57      Guice.createInjector(new AbstractModule() {
                    
58        @Override
                    
274    try {
                    
275      Injector injector = Guice.createInjector(new AbstractModule() {
                    
276        @Override
                    
295  public void testMultipleReturnTypes() {
                    
296    Injector injector = Guice.createInjector(new AbstractModule() {
                    
297      @Override
                    
313  public void testParameterizedClassesWithNoImplements() {
                    
314    Injector injector = Guice.createInjector(new AbstractModule() {
                    
315      @Override
                    
327    try {
                    
328      Guice.createInjector(new AbstractModule() {
                    
329        @Override
                    
                
OverrideModuleTest.java https://gitlab.com/metamorphiccode/guice | Java | 731 lines
                    
20import static com.google.inject.Asserts.assertContains;
                    
21import static com.google.inject.Guice.createInjector;
                    
22import static com.google.inject.name.Names.named;
                    
33import com.google.inject.Exposed;
                    
34import com.google.inject.Guice;
                    
35import com.google.inject.Injector;
                    
365    value.set("B");
                    
366    Injector injector = Guice.createInjector(overridden);
                    
367    assertEquals("B", injector.getInstance(Key.get(String.class, named("original"))));
                    
413    // override forwards
                    
414    Injector injector = Guice.createInjector(Modules.override(exposes5and6).with(exposes15));
                    
415    assertEquals(15, injector.getInstance(Integer.class).intValue());
                    
418    // and in reverse order
                    
419    Injector reverse = Guice.createInjector(Modules.override(exposes15).with(exposes5and6));
                    
420    assertEquals(5, reverse.getInstance(Integer.class).intValue());
                    
                
SpiBindingsTest.java https://gitlab.com/metamorphiccode/guice | Java | 463 lines
                    
26import com.google.inject.Binding;
                    
27import com.google.inject.Guice;
                    
28import com.google.inject.Inject;
                    
28import com.google.inject.Inject;
                    
29import com.google.inject.Injector;
                    
30import com.google.inject.Key;
                    
244  public void testConvertedConstantBinding() {
                    
245    Injector injector = Guice.createInjector(new AbstractModule() {
                    
246      protected void configure() {
                    
265  public void testProviderBinding() {
                    
266    Injector injector = Guice.createInjector(new AbstractModule() {
                    
267      protected void configure() {
                    
356    
                    
357    final Injector injector = Guice.createInjector(new AbstractModule() {
                    
358      protected void configure() {
                    
                
ProviderMethodsTest.java https://gitlab.com/metamorphiccode/guice | Java | 952 lines
                    
72  public void testProviderMethods() {
                    
73    Injector injector = Guice.createInjector(this);
                    
74
                    
361
                    
362    Injector injector = Guice.createInjector(module);
                    
363
                    
383    try {
                    
384      Guice.createInjector(new AbstractModule() {
                    
385        @Override protected void configure() {}
                    
398    AtomicReference<Logger> loggerRef = new AtomicReference<Logger>();
                    
399    Injector injector = Guice.createInjector(new FooModule(loggerRef));
                    
400
                    
435    };
                    
436    Injector injector = Guice.createInjector(m1, m2);
                    
437
                    
                
WeakKeySetTest.java https://gitlab.com/metamorphiccode/guice | Java | 528 lines
                    
31import com.google.inject.Binding;
                    
32import com.google.inject.Guice;
                    
33import com.google.inject.Injector;
                    
33import com.google.inject.Injector;
                    
34import com.google.inject.Key;
                    
35import com.google.inject.Scope;
                    
336  public void testWeakKeySet_integration() {
                    
337    Injector parentInjector = Guice.createInjector(new AbstractModule() {
                    
338          @Override protected void configure() {
                    
358  public void testWeakKeySet_integration_multipleChildren() {
                    
359    Injector parentInjector = Guice.createInjector(new AbstractModule() {
                    
360          @Override protected void configure() {
                    
398  public void testWeakKeySet_integration_multipleChildren_overlappingKeys() {
                    
399    Injector parentInjector = Guice.createInjector(new AbstractModule() {
                    
400          @Override protected void configure() {
                    
                
TypeListenerTest.java https://gitlab.com/metamorphiccode/guice | Java | 710 lines
                    
96
                    
97    Guice.createInjector(new AbstractModule() {
                    
98      @Override protected void configure() {
                    
288    try {
                    
289      Guice.createInjector(new AbstractModule() {
                    
290        @Override protected void configure() {
                    
315
                    
316    Injector injector = Guice.createInjector(new AbstractModule() {
                    
317      @Override protected void configure() {
                    
375
                    
376    Guice.createInjector(new AbstractModule() {
                    
377      @Override protected void configure() {
                    
413  public void testLookupsPostCreate() {
                    
414    Injector injector = Guice.createInjector(new AbstractModule() {
                    
415      @Override protected void configure() {
                    
                
TypeConversionTest.java https://gitlab.com/metamorphiccode/guice | Java | 495 lines
                    
92  public void testConstantInjection() throws CreationException {
                    
93    Injector injector = Guice.createInjector(new AbstractModule() {
                    
94      @Override protected void configure() {
                    
123  public void testConstantInjectionWithExplicitBindingsRequired() throws CreationException {
                    
124    Injector injector = Guice.createInjector(new AbstractModule() {
                    
125      @Override protected void configure() {
                    
194  public void testInvalidCharacter() throws CreationException {
                    
195    Injector injector = Guice.createInjector(new AbstractModule() {
                    
196      @Override protected void configure() {
                    
236  public void testToInstanceIsTreatedLikeConstant() throws CreationException {
                    
237    Injector injector = Guice.createInjector(new AbstractModule() {
                    
238      @Override protected void configure() {
                    
387
                    
388    Injector injector = Guice.createInjector(new AbstractModule() {
                    
389      @Override protected void configure() {
                    
                
ScopesTest.java https://gitlab.com/metamorphiccode/guice | Java | 1192 lines
                    
133        Guice.createInjector().getInstance(AnnotatedSingleton.class),
                    
134        Guice.createInjector().getInstance(AnnotatedSingleton.class));
                    
135  }
                    
255  public void testSingletonsInDevelopmentStage() {
                    
256    Guice.createInjector(Stage.DEVELOPMENT, singletonsModule);
                    
257
                    
326    try {
                    
327      Guice.createInjector(new OuterDeprecatedModule());
                    
328      fail();
                    
399  public void testNullScopedAsASingleton() {
                    
400    Injector injector = Guice.createInjector(new AbstractModule() {
                    
401      @Override
                    
424  public void testSingletonAnnotationOnParameterizedType() {
                    
425    Injector injector = Guice.createInjector();
                    
426    assertSame(injector.getInstance(new Key<Injected<String>>() {}),
                    
                
ProvisionListenerTest.java https://gitlab.com/metamorphiccode/guice | Java | 796 lines
                    
51  public void testExceptionInListenerBeforeProvisioning() {
                    
52    Injector injector = Guice.createInjector(new AbstractModule() {
                    
53      @Override
                    
277    final Counter count2 = new Counter();
                    
278    Injector injector = Guice.createInjector(new AbstractModule() {
                    
279      @Override
                    
302    final Capturer capturer = new Capturer();
                    
303    Injector injector = Guice.createInjector(new AbstractModule() {
                    
304      @Override
                    
362    final Counter counter = new Counter();
                    
363    Injector injector = Guice.createInjector(new AbstractModule() {
                    
364      @Override
                    
383  public void testCallingBindingDotGetProviderDotGet() {
                    
384    Injector injector = Guice.createInjector(new AbstractModule() {
                    
385      @Override
                    
                
ProvisionExceptionTest.java https://gitlab.com/metamorphiccode/guice | Java | 470 lines
                    
150    try {
                    
151      Guice.createInjector().getInstance(A.class);
                    
152      fail();
                    
183  public void testInjectInnerClass() throws Exception {
                    
184    Injector injector = Guice.createInjector();
                    
185    try {
                    
197
                    
198    Injector injector = Guice.createInjector();
                    
199    try {
                    
339  public void testDuplicatesDifferentInstances() {
                    
340    Injector injector = Guice.createInjector(new AbstractModule() {
                    
341      @Override protected void configure() {}
                    
359  public void testMultipleDuplicatesDifferentInstaces() {
                    
360    Injector injector = Guice.createInjector(new AbstractModule() {
                    
361      @Override protected void configure() {}
                    
                
PrivateModuleTest.java https://gitlab.com/metamorphiccode/guice | Java | 564 lines
                    
43  public void testBasicUsage() {
                    
44    Injector injector = Guice.createInjector(new AbstractModule() {
                    
45      @Override protected void configure() {
                    
77  public void testWithoutPrivateModules() {
                    
78    Injector injector = Guice.createInjector(new AbstractModule() {
                    
79      @Override protected void configure() {
                    
257  public void testNestedPrivateInjectors() {
                    
258    Injector injector = Guice.createInjector(new PrivateModule() {
                    
259      @Override public void configure() {
                    
274  public void testInstallingRegularModulesFromPrivateModules() {
                    
275    Injector injector = Guice.createInjector(new PrivateModule() {
                    
276      @Override public void configure() {
                    
392  public void testDependenciesBetweenPrivateAndPublicWithPrivateEagerSingleton() {
                    
393    Injector injector = Guice.createInjector(
                    
394        new AbstractModule() {
                    
                
JitBindingsTest.java https://gitlab.com/metamorphiccode/guice | Java | 731 lines
                    
176  public void testLinkedProviderBindingWorks() {
                    
177    Injector injector = Guice.createInjector(new AbstractModule() {
                    
178      @Override
                    
192    try {
                    
193      Guice.createInjector(new AbstractModule() {
                    
194        @Override
                    
279  public void testProvidedBy() {
                    
280    Injector injector = Guice.createInjector(new AbstractModule() {
                    
281      @Override
                    
403    try {
                    
404      Guice.createInjector(new AbstractModule() {
                    
405        protected void configure() {
                    
422    
                    
423    Injector injector = Guice.createInjector(new AbstractModule() {
                    
424      protected void configure() {
                    
                
DuplicateBindingsTest.java https://gitlab.com/metamorphiccode/guice | Java | 576 lines
                    
100    
                    
101    Guice.createInjector(
                    
102        new ScopedModule(Scopes.NO_SCOPE, foo, pFoo, pclFoo, clFoo, cFoo),
                    
107  public void testSameScopeAnnotationIgnored() {
                    
108    Guice.createInjector(
                    
109        new AnnotatedScopeModule(Singleton.class, foo, pFoo, pclFoo, clFoo, cFoo),
                    
178    try {
                    
179      Guice.createInjector(new ThrowingModule(), new ThrowingModule());
                    
180      fail("expected exception");
                    
189  public void testChildInjectorDuplicateParentFail() {
                    
190    Injector injector = Guice.createInjector(
                    
191        new SimpleModule(foo, pFoo, pclFoo, clFoo, cFoo)
                    
294    b.equality = "test";
                    
295    Guice.createInjector(new AbstractModule() {
                    
296      @Override
                    
                
CircularDependencyTest.java https://gitlab.com/metamorphiccode/guice | Java | 652 lines
                    
47      throws CreationException {
                    
48    Injector injector = Guice.createInjector(new AbstractModule() {
                    
49      @Override
                    
217    try {
                    
218      Guice.createInjector(new AbstractModule() {
                    
219        @Override protected void configure() {}
                    
232    try {
                    
233      Guice.createInjector(new AbstractModule() {
                    
234        @Override protected void configure() {
                    
496  public void testPrivateModulesDontTriggerCircularErrorsInProviders() {
                    
497    Injector injector = Guice.createInjector(new AbstractModule() {
                    
498      @Override
                    
544  public void testCustomScopeCircularProxies() {
                    
545    Injector injector = Guice.createInjector(new AbstractModule() {
                    
546      @Override
                    
                
BindingTest.java https://gitlab.com/metamorphiccode/guice | Java | 503 lines
                    
126  public void testScopeIsAppliedToKeyNotTarget() {
                    
127    Injector injector = Guice.createInjector(new AbstractModule() {
                    
128      protected void configure() {
                    
195  private void assertBindingSucceeds(final Class<?> clazz) {
                    
196    assertNotNull(Guice.createInjector().getInstance(clazz));
                    
197  }
                    
266    try {
                    
267      Guice.createInjector(new AbstractModule() {
                    
268        protected void configure() {
                    
292
                    
293    Injector injector = Guice.createInjector(new AbstractModule() {
                    
294      protected void configure() {
                    
421  public void testGetAllServletBindings() throws Exception {
                    
422    Injector injector = Guice.createInjector(new AbstractModule() {
                    
423      protected void configure() {
                    
                
BinderTestSuite.java https://gitlab.com/metamorphiccode/guice | Java | 769 lines
                    
16
                    
17package com.google.inject;
                    
18
                    
18
                    
19import static com.google.inject.Asserts.assertContains;
                    
20import static com.google.inject.name.Names.named;
                    
24
                    
25import com.google.common.collect.ImmutableList;
                    
26import com.google.common.collect.Lists;
                    
26import com.google.common.collect.Lists;
                    
27import com.google.inject.binder.AnnotatedBindingBuilder;
                    
28import com.google.inject.binder.ScopedBindingBuilder;
                    
399      nextId.set(101);
                    
400      return Guice.createInjector(modules);
                    
401    }
                    
                
BinderTest.java https://gitlab.com/metamorphiccode/guice | Java | 634 lines
                    
149    try {
                    
150      Guice.createInjector(new AbstractModule() {
                    
151        @Override public void configure() {
                    
282    // passes because duplicates are ignored
                    
283    injector = Guice.createInjector(new AbstractModule() {
                    
284      @Override
                    
325    try {
                    
326      Guice.createInjector(new ParentModule());
                    
327      fail();
                    
397  public void testUntargettedBinding() {
                    
398    Injector injector = Guice.createInjector(new AbstractModule() {
                    
399      @Override
                    
418  public void testPartialInjectorGetInstance() {
                    
419    Injector injector = Guice.createInjector();
                    
420    try {
                    
                
Errors.java https://gitlab.com/metamorphiccode/guice | Java | 870 lines
                    
18
                    
19import com.google.common.base.Equivalence;
                    
20import com.google.common.base.Objects;
                    
28import com.google.inject.CreationException;
                    
29import com.google.inject.Guice;
                    
30import com.google.inject.Key;
                    
33import com.google.inject.Provides;
                    
34import com.google.inject.ProvisionException;
                    
35import com.google.inject.Scope;
                    
139   * same message for both bind time errors:
                    
140   * <pre><code>Guice.createInjector(new AbstractModule() {
                    
141   *   public void configure() {
                    
145   * ...and at provide-time errors:
                    
146   * <pre><code>Guice.createInjector().getInstance(Runnable.class);</code></pre>
                    
147   * Otherwise we need to know who's calling when resolving a just-in-time
                    
                
GuiceInjectorBuilder.scala https://gitlab.com/KiaraGrouwstra/playframework | Scala | 343 lines
                    
137      }
                    
138      val guiceInjector = Guice.createInjector(stage, applicationModule())
                    
139      guiceInjector.getInstance(classOf[PlayInjector])
                    
226    case playModule: PlayModule => fromPlayModule(playModule)
                    
227    case guiceModule: GuiceModule => fromGuiceModule(guiceModule)
                    
228    case unknown => throw new PlayException(
                    
248
                    
249  implicit def fromGuiceModule(guiceModule: GuiceModule): GuiceableModule = fromGuiceModules(Seq(guiceModule))
                    
250
                    
250
                    
251  implicit def fromGuiceModules(guiceModules: Seq[GuiceModule]): GuiceableModule = new GuiceableModule {
                    
252    def guiced(env: Environment, conf: Configuration): Seq[GuiceModule] = guiceModules
                    
252    def guiced(env: Environment, conf: Configuration): Seq[GuiceModule] = guiceModules
                    
253    def disable(classes: Seq[Class[_]]): GuiceableModule = fromGuiceModules(filterOut(classes, guiceModules))
                    
254    override def toString = s"GuiceableModule(${guiceModules.mkString(", ")})"
                    
                
package-info.java https://github.com/imyousuf/jersey.git | Java | 188 lines
                    
44 * Guice support is enabled by referencing the Guice filter
                    
45 * {@link com.google.inject.servlet.GuiceFilter} and an application
                    
46 * specific {@link javax.servlet.ServletContextListener} that extends from
                    
46 * specific {@link javax.servlet.ServletContextListener} that extends from
                    
47 * {@link com.google.inject.servlet.GuiceServletContextListener} in the web.xml.
                    
48 * For example, the web.xml may be as follows:
                    
100 * <code>GuiceResource</code> will be managed according to the scope declared
                    
101 * using Guice defined scopes. For example the <code>GuiceResource</code>
                    
102 * could be as follows:
                    
144 * 
                    
145 *     public class GuiceServletConfig extends GuiceServletContextListener {
                    
146 * 
                    
148 *         protected Injector getInjector() {
                    
149 *             return Guice.createInjector(new JerseyServletModule() {
                    
150 * 
                    
                
BindDriveDataToPlainTextStringTest.java https://github.com/bosschaert/jclouds.git | Java | 87 lines
                    
38
                    
39import com.google.common.base.Function;
                    
40import com.google.common.collect.ImmutableSet;
                    
41import com.google.inject.AbstractModule;
                    
42import com.google.inject.Guice;
                    
43import com.google.inject.TypeLiteral;
                    
51
                    
52   private static final BindDriveDataToPlainTextString FN = Guice.createInjector(new AbstractModule() {
                    
53
                    
                
methods_index_all.html https://github.com/christophercurrie/Moogle-Muice.git | HTML | 341 lines
                    
67<i>createInjector</i><br>
                    
68&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Module[])" class="hiddenlink" target="rightframe">type&nbsp;
                    
69(<code>Module[]</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
70</A></nobr><br>
                    
71&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Stage, com.google.inject.Module[])" class="hiddenlink" target="rightframe">type&nbsp;
                    
72(<code>Stage, Module[]</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
73</A></nobr><br>
                    
74&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Stage, java.lang.Iterable<? extends com.google.inject.Module>)" class="hiddenlink" target="rightframe">type&nbsp;
                    
75(<code>Stage, Iterable&lt;Module&gt;</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
76</A></nobr><br>
                    
77&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(java.lang.Iterable<? extends com.google.inject.Module>)" class="hiddenlink" target="rightframe">type&nbsp;
                    
78(<code>Iterable&lt;Module&gt;</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
192</A></nobr><br>
                    
193&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Key.html#com.google.inject.Key.ofType_added(com.google.inject.TypeLiteral<T>)" class="hiddenlink" target="rightframe">type&nbsp;<b>
                    
194(<code>TypeLiteral&lt;T&gt;</code>)</b>&nbsp;in&nbsp;com.google.inject.Key
                    
                
alldiffs_index_changes.html https://github.com/christophercurrie/Moogle-Muice.git | HTML | 468 lines
                    
118<i>createInjector</i><br>
                    
119&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Module[])" class="hiddenlink" target="rightframe">type&nbsp;
                    
120(<code>Module[]</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
122<!-- Method createInjector -->
                    
123&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Stage, com.google.inject.Module[])" class="hiddenlink" target="rightframe">type&nbsp;
                    
124(<code>Stage, Module[]</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
126<!-- Method createInjector -->
                    
127&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Stage, java.lang.Iterable<? extends com.google.inject.Module>)" class="hiddenlink" target="rightframe">type&nbsp;
                    
128(<code>Stage, Iterable&lt;Module&gt;</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
130<!-- Method createInjector -->
                    
131&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(java.lang.Iterable<? extends com.google.inject.Module>)" class="hiddenlink" target="rightframe">type&nbsp;
                    
132(<code>Iterable&lt;Module&gt;</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
233<!-- Class GuiceObjectFactory -->
                    
234<A HREF="com.google.inject.struts2.GuiceObjectFactory.html" class="hiddenlink" target="rightframe">GuiceObjectFactory</A><br>
                    
235<!-- Class InjectionPoint -->
                    
                
alldiffs_index_all.html https://github.com/christophercurrie/Moogle-Muice.git | HTML | 824 lines
                    
161<!-- Method continueRequest -->
                    
162<nobr><A HREF="com.google.inject.servlet.ServletScopes.html#com.google.inject.servlet.ServletScopes.continueRequest_added(java.util.concurrent.Callable<T>, java.util.Map<com.google.inject.Key<?>, java.lang.Object>)" class="hiddenlink" target="rightframe"><b>continueRequest</b>
                    
163(<code>Callable&lt;T&gt;, Map&lt;Key&lt;?&gt;, Object&gt;</code>)</A></nobr><br>
                    
167<i>createInjector</i><br>
                    
168&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Module[])" class="hiddenlink" target="rightframe">type&nbsp;
                    
169(<code>Module[]</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
171<!-- Method createInjector -->
                    
172&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Stage, com.google.inject.Module[])" class="hiddenlink" target="rightframe">type&nbsp;
                    
173(<code>Stage, Module[]</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
175<!-- Method createInjector -->
                    
176&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(com.google.inject.Stage, java.lang.Iterable<? extends com.google.inject.Module>)" class="hiddenlink" target="rightframe">type&nbsp;
                    
177(<code>Stage, Iterable&lt;Module&gt;</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
179<!-- Method createInjector -->
                    
180&nbsp;&nbsp;<nobr><A HREF="com.google.inject.Guice.html#com.google.inject.Guice.createInjector_changed(java.lang.Iterable<? extends com.google.inject.Module>)" class="hiddenlink" target="rightframe">type&nbsp;
                    
181(<code>Iterable&lt;Module&gt;</code>)&nbsp;in&nbsp;com.google.inject.Guice
                    
                
Injector.html https://github.com/christophercurrie/Moogle-Muice.git | HTML | 333 lines
                    
144<CODE>static&nbsp;<A HREF="../../../../com/google/inject/Injector.html" title="interface in com.google.inject">Injector</A></CODE></FONT></TD>
                    
145<TD><CODE><B>Guice.</B><B><A HREF="../../../../com/google/inject/Guice.html#createInjector(java.lang.Iterable)">createInjector</A></B>(<A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;? extends <A HREF="../../../../com/google/inject/Module.html" title="interface in com.google.inject">Module</A>&gt;&nbsp;modules)</CODE>
                    
146
                    
152<CODE>static&nbsp;<A HREF="../../../../com/google/inject/Injector.html" title="interface in com.google.inject">Injector</A></CODE></FONT></TD>
                    
153<TD><CODE><B>Guice.</B><B><A HREF="../../../../com/google/inject/Guice.html#createInjector(com.google.inject.Module...)">createInjector</A></B>(<A HREF="../../../../com/google/inject/Module.html" title="interface in com.google.inject">Module</A>...&nbsp;modules)</CODE>
                    
154
                    
160<CODE>static&nbsp;<A HREF="../../../../com/google/inject/Injector.html" title="interface in com.google.inject">Injector</A></CODE></FONT></TD>
                    
161<TD><CODE><B>Guice.</B><B><A HREF="../../../../com/google/inject/Guice.html#createInjector(com.google.inject.Stage, java.lang.Iterable)">createInjector</A></B>(<A HREF="../../../../com/google/inject/Stage.html" title="enum in com.google.inject">Stage</A>&nbsp;stage,
                    
162               <A HREF="http://java.sun.com/j2se/1.5.0/docs/api/java/lang/Iterable.html?is-external=true" title="class or interface in java.lang">Iterable</A>&lt;? extends <A HREF="../../../../com/google/inject/Module.html" title="interface in com.google.inject">Module</A>&gt;&nbsp;modules)</CODE>
                    
170<CODE>static&nbsp;<A HREF="../../../../com/google/inject/Injector.html" title="interface in com.google.inject">Injector</A></CODE></FONT></TD>
                    
171<TD><CODE><B>Guice.</B><B><A HREF="../../../../com/google/inject/Guice.html#createInjector(com.google.inject.Stage, com.google.inject.Module...)">createInjector</A></B>(<A HREF="../../../../com/google/inject/Stage.html" title="enum in com.google.inject">Stage</A>&nbsp;stage,
                    
172               <A HREF="../../../../com/google/inject/Module.html" title="interface in com.google.inject">Module</A>...&nbsp;modules)</CODE>
                    
200<TR BGCOLOR="#CCCCFF" CLASS="TableSubHeadingColor">
                    
201<TH ALIGN="left" COLSPAN="2">Methods in <A HREF="../../../../com/google/inject/servlet/package-summary.html">com.google.inject.servlet</A> that return <A HREF="../../../../com/google/inject/Injector.html" title="interface in com.google.inject">Injector</A></FONT></TH>
                    
202</TR>
                    
                
ImplicitBindingTest.java https://gitlab.com/metamorphiccode/guice | Java | 403 lines
                    
76  public void testBindingOverridesImplementedBy() {
                    
77    Injector injector = Guice.createInjector(new AbstractModule() {
                    
78      @Override
                    
92    try {
                    
93      Guice.createInjector().getInstance(Key.get(I.class, Names.named("i")));
                    
94      fail();
                    
121  public void testCircularJitBindingsLeaveNoResidue() {
                    
122    Injector injector = Guice.createInjector(new AbstractModule() {
                    
123      @Override
                    
380  public void testImplementedByEnum() {
                    
381    Injector injector = Guice.createInjector();
                    
382    try {
                    
396  public void testImplicitJdkBindings() {
                    
397    Injector injector = Guice.createInjector();
                    
398    // String has a public nullary constructor, so Guice will call it.
                    
                
ApplicationProcessorSpec.scala https://gitlab.com/zhaosheng/snagajob | Scala | 111 lines
                    
1import com.google.inject.{AbstractModule, Guice}
                    
2import com.google.inject.name.Names
                    
3import main.scala._
                    
4import net.codingwell.scalaguice.ScalaModule
                    
5import org.scalatest._
                    
8
                    
9  val injector = Guice.createInjector(new ApplicationProcessorTestModule())
                    
10  import net.codingwell.scalaguice.InjectorExtensions._
                    
                
VMHandlerTest.java https://github.com/adiantum/jclouds.git | Java | 132 lines
                    
22
                    
23import com.google.inject.Guice;
                    
24import com.google.inject.Injector;
                    
34      InputStream is = getClass().getResourceAsStream("/vm.xml");
                    
35      Injector injector = Guice.createInjector(new SaxParserModule());
                    
36      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
                
ProjectTypeTest.java https://gitlab.com/gaal/che-core | Java | 371 lines
                    
13import com.google.inject.AbstractModule;
                    
14import com.google.inject.Guice;
                    
15import com.google.inject.Injector;
                    
15import com.google.inject.Injector;
                    
16import com.google.inject.multibindings.Multibinder;
                    
17import org.eclipse.che.api.core.NotFoundException;
                    
42        // Bind components
                    
43        injector = Guice.createInjector(new AbstractModule() {
                    
44            @Override
                    
                
ParentInjectorTest.java https://github.com/peterlynch/spice.git | Java | 310 lines
                    
78  public void testGetParent() {
                    
79    Injector top = Guice.createInjector(bindsA);
                    
80    Injector middle = top.createChildInjector(bindsB);
                    
87  public void testChildBindingsNotVisibleToParent() {
                    
88    Injector parent = Guice.createInjector();
                    
89    parent.createChildInjector(bindsB);
                    
144  public void testTypeConvertersConflicting() {
                    
145    Injector parent = Guice.createInjector(bindListConverterModule);
                    
146    Injector child = parent.createChildInjector(bindListConverterModule, bindStringNamedB);
                    
156  public void testInjectorInjectionSpanningInjectors() {
                    
157    Injector parent = Guice.createInjector();
                    
158    Injector child = parent.createChildInjector(new AbstractModule() {
                    
219  public void testErrorInParentButOkayInChild() {
                    
220    Injector parent = Guice.createInjector();
                    
221    Injector childInjector = parent.createChildInjector(new AbstractModule() {
                    
                
NestSlashKeysTest.java https://github.com/jclouds/legacy-jclouds-chef.git | Java | 121 lines
                    
33
                    
34import com.google.common.base.Supplier;
                    
35import com.google.common.base.Suppliers;
                    
35import com.google.common.base.Suppliers;
                    
36import com.google.common.collect.ImmutableMultimap;
                    
37import com.google.inject.AbstractModule;
                    
37import com.google.inject.AbstractModule;
                    
38import com.google.inject.Guice;
                    
39import com.google.inject.Injector;
                    
53   protected void setUpInjector() throws IOException {
                    
54      Injector injector = Guice.createInjector(new AbstractModule() {
                    
55         @Override
                    
                
OpenIdUserModuleTest.html https://github.com/slspeek/FSpotCloudSite.git | HTML | 42 lines
                    
16<a class="jxr_linenumber" name="6" href="#6">6</a>   
                    
17<a class="jxr_linenumber" name="7" href="#7">7</a>   <strong class="jxr_keyword">import</strong> com.google.inject.Guice;
                    
18<a class="jxr_linenumber" name="8" href="#8">8</a>   <strong class="jxr_keyword">import</strong> com.google.inject.Injector;
                    
35<a class="jxr_linenumber" name="25" href="#25">25</a>      <strong class="jxr_keyword">public</strong> <strong class="jxr_keyword">void</strong> testConfigure() {
                    
36<a class="jxr_linenumber" name="26" href="#26">26</a>          Injector injector = Guice.createInjector(<strong class="jxr_keyword">new</strong> OpenIdUserModule());
                    
37<a class="jxr_linenumber" name="27" href="#27">27</a>      }
                    
                
GitblitContext.java https://gitlab.com/tigefa/gitblit | Java | 511 lines
                    
43import com.gitblit.extensions.LifeCycleListener;
                    
44import com.gitblit.guice.CoreModule;
                    
45import com.gitblit.guice.WebModule;
                    
62import com.google.inject.AbstractModule;
                    
63import com.google.inject.Guice;
                    
64import com.google.inject.Injector;
                    
64import com.google.inject.Injector;
                    
65import com.google.inject.servlet.GuiceServletContextListener;
                    
66
                    
77 */
                    
78public class GitblitContext extends GuiceServletContextListener {
                    
79
                    
126	protected Injector getInjector() {
                    
127		return Guice.createInjector(getModules());
                    
128	}
                    
                
GuiceServletConfig.java https://github.com/bosschaert/jclouds.git | Java | 121 lines
                    
41import com.google.common.collect.ImmutableMap;
                    
42import com.google.common.collect.ImmutableSet;
                    
43import com.google.common.io.Closeables;
                    
43import com.google.common.io.Closeables;
                    
44import com.google.inject.Guice;
                    
45import com.google.inject.Injector;
                    
47import com.google.inject.TypeLiteral;
                    
48import com.google.inject.servlet.GuiceServletContextListener;
                    
49import com.google.inject.servlet.ServletModule;
                    
55 */
                    
56public class GuiceServletConfig extends GuiceServletContextListener {
                    
57
                    
95   protected Injector getInjector() {
                    
96      return Guice.createInjector(new ServletModule() {
                    
97         @Override
                    
                
BindGroupToUpdateRequestJsonPayloadTest.java https://github.com/jclouds/legacy-jclouds-chef.git | Java | 90 lines
                    
34
                    
35import com.google.common.collect.ImmutableSet;
                    
36import com.google.inject.AbstractModule;
                    
36import com.google.inject.AbstractModule;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
47
                    
48   private Injector injector = Guice.createInjector(new AbstractModule() {
                    
49      @Override
                    
                
Activator.java https://github.com/svenefftinge/Xtext-2.0-released-source-code.git | Java | 313 lines
                    
6import static com.google.inject.util.Modules.override;
                    
7import static com.google.inject.Guice.createInjector;
                    
8
                    
13
                    
14import com.google.inject.Injector;
                    
15import com.google.inject.Module;
                    
79	protected void registerInjectorFor(String language) throws Exception {
                    
80		injectors.put(language, createInjector(
                    
81		  override(override(getRuntimeModule(language)).with(getSharedStateModule())).with(getUiModule(language))));
                    
                
CommonDaoWriteTest.java https://github.com/saumitra123/smart-dao.git | Java | 290 lines
                    
21import com.google.inject.AbstractModule;
                    
22import com.google.inject.Guice;
                    
23import com.google.inject.Inject;
                    
23import com.google.inject.Inject;
                    
24import com.google.inject.Injector;
                    
25import com.google.inject.PrivateModule;
                    
26import com.google.inject.Scopes;
                    
27import com.google.inject.Singleton;
                    
28import com.google.inject.TypeLiteral;
                    
28import com.google.inject.TypeLiteral;
                    
29import com.google.inject.name.Named;
                    
30import com.google.inject.name.Names;
                    
102     */
                    
103    injector = Guice.createInjector(new TestModule(), new TestNoModule(), new TestOpModule(), new TestPesModule());
                    
104    commonDaos = injector.getInstance(CommonDaos.class);
                    
                
BindInstantiateVAppTemplateParamsToXmlPayloadTest.java https://github.com/ahgittin/legacy-jclouds.git | Java | 102 lines
                    
38import org.jclouds.util.Strings2;
                    
39import org.nnsoft.guice.rocoto.Rocoto;
                    
40import org.nnsoft.guice.rocoto.configuration.ConfigurationModule;
                    
43import com.google.common.base.Supplier;
                    
44import com.google.common.base.Suppliers;
                    
45import com.google.common.collect.HashMultimap;
                    
45import com.google.common.collect.HashMultimap;
                    
46import com.google.common.collect.ImmutableList;
                    
47import com.google.common.collect.Maps;
                    
49import com.google.common.collect.Multimaps;
                    
50import com.google.inject.Guice;
                    
51import com.google.inject.Injector;
                    
60public class BindInstantiateVAppTemplateParamsToXmlPayloadTest {
                    
61   Injector injector = Guice.createInjector(Rocoto.expandVariables(new ConfigurationModule() {
                    
62
                    
                
NamesTest.java https://gitlab.com/metamorphiccode/guice | Java | 112 lines
                    
17
                    
18package com.google.inject.name;
                    
19
                    
24import com.google.inject.AbstractModule;
                    
25import com.google.inject.Guice;
                    
26import com.google.inject.Injector;
                    
62
                    
63    Injector injector = Guice.createInjector(new AbstractModule() {
                    
64      protected void configure() {
                    
76
                    
77    Injector injector = Guice.createInjector(new AbstractModule() {
                    
78      protected void configure() {
                    
95
                    
96    Injector injector = Guice.createInjector(new AbstractModule() {
                    
97      protected void configure() {
                    
                
TypeListenerTest.java https://github.com/peterlynch/spice.git | Java | 649 lines
                    
91
                    
92    Guice.createInjector(new AbstractModule() {
                    
93      protected void configure() {
                    
275    try {
                    
276      Guice.createInjector(new AbstractModule() {
                    
277        protected void configure() {
                    
302
                    
303    Injector injector = Guice.createInjector(new AbstractModule() {
                    
304      protected void configure() {
                    
361
                    
362    Guice.createInjector(new AbstractModule() {
                    
363      protected void configure() {
                    
399  public void testLookupsPostCreate() {
                    
400    Injector injector = Guice.createInjector(new AbstractModule() {
                    
401      protected void configure() {
                    
432
                    
433    Injector injector = Guice.createInjector(new Abstra
                    
                
ScopesTest.java https://github.com/peterlynch/spice.git | Java | 577 lines
                    
115        Guice.createInjector().getInstance(AnnotatedSingleton.class),
                    
116        Guice.createInjector().getInstance(AnnotatedSingleton.class));
                    
117  }
                    
119  public void testOverriddingAnnotation() {
                    
120    Injector injector = Guice.createInjector(new AbstractModule() {
                    
121      protected void configure() {
                    
210  public void testSingletonsInProductionStage() {
                    
211    Guice.createInjector(Stage.PRODUCTION, singletonsModule);
                    
212
                    
221  public void testSingletonsInDevelopmentStage() {
                    
222    Guice.createInjector(Stage.DEVELOPMENT, singletonsModule);
                    
223
                    
344  public void testSingletonAnnotationOnParameterizedType() {
                    
345    Injector injector = Guice.createInjector();
                    
346    assertSame(injector.getInstance(new Key<Injected<String>>() {}),
                    
                
PrivateModuleTest.java https://github.com/peterlynch/spice.git | Java | 449 lines
                    
106    try {
                    
107      Guice.createInjector(new AbstractModule() {
                    
108        protected void configure() {
                    
120  public void testPrivateModulesAndProvidesMethods() {
                    
121    Injector injector = Guice.createInjector(new AbstractModule() {
                    
122      protected void configure() {
                    
248  public void testNestedPrivateInjectors() {
                    
249    Injector injector = Guice.createInjector(new PrivateModule() {
                    
250      public void configure() {
                    
265  public void testInstallingRegularModulesFromPrivateModules() {
                    
266    Injector injector = Guice.createInjector(new PrivateModule() {
                    
267      public void configure() {
                    
428  public void testSpiAccess() {
                    
429    Injector injector = Guice.createInjector(new PrivateModule() {
                    
430          public void configure() {
                    
                
OverrideModuleTest.java https://github.com/peterlynch/spice.git | Java | 512 lines
                    
19import static com.google.inject.Asserts.assertContains;
                    
20import static com.google.inject.Guice.createInjector;
                    
21import static com.google.inject.name.Names.named;
                    
216
                    
217    Guice.createInjector(module);
                    
218    assertTrue(scope.used);
                    
413
                    
414    injector = Guice.createInjector(Modules.override(EMPTY_MODULE).with(exposes5));
                    
415    assertEquals(5, injector.getInstance(Integer.class).intValue());
                    
433
                    
434    injector = Guice.createInjector(Modules.override(binds15).with(exposes5));
                    
435    assertEquals(5, injector.getInstance(Integer.class).intValue());
                    
438
                    
439    injector = Guice.createInjector(Modules.override(exposes5).with(binds15));
                    
440    assertEquals(15, injector.getInstance(Integer.class).intValue());
                    
                
DuplicateBindingsTest.java https://github.com/peterlynch/spice.git | Java | 422 lines
                    
79  public void testSameScopeInstanceIgnored() {
                    
80    Guice.createInjector(
                    
81        new ScopedModule(Scopes.SINGLETON, foo, pFoo, pclFoo, clFoo, cFoo),
                    
84    
                    
85    Guice.createInjector(
                    
86        new ScopedModule(Scopes.NO_SCOPE, foo, pFoo, pclFoo, clFoo, cFoo),
                    
113    try {
                    
114      Guice.createInjector(
                    
115          new SimpleModule(foo, pFoo, pclFoo, clFoo, cFoo),
                    
157    try {
                    
158      Guice.createInjector(new ThrowingModule(), new ThrowingModule());
                    
159      fail("expected exception");
                    
209        try {
                    
210          Guice.createInjector(Elements.getModule(Arrays.asList(e1, e2)));
                    
211          if(e1 != e2) {
                    
                
BindingTest.java https://github.com/peterlynch/spice.git | Java | 498 lines
                    
50  public void testExplicitCyclicDependency() {
                    
51    Guice.createInjector(new AbstractModule() {
                    
52      protected void configure() {
                    
191  private void assertBindingSucceeds(final Class<?> clazz) {
                    
192    assertNotNull(Guice.createInjector().getInstance(clazz));
                    
193  }
                    
196    try {
                    
197      Guice.createInjector().getInstance(clazz);
                    
198      fail();
                    
207    try {
                    
208      Guice.createInjector().getInstance(TooManyConstructors.class);
                    
209      fail();
                    
287
                    
288    Injector injector = Guice.createInjector(new AbstractModule() {
                    
289      protected void configure() {
                    
                
BinderTestSuite.java https://github.com/peterlynch/spice.git | Java | 766 lines
                    
16
                    
17package com.google.inject;
                    
18
                    
18
                    
19import static com.google.inject.Asserts.assertContains;
                    
20import com.google.inject.binder.AnnotatedBindingBuilder;
                    
20import com.google.inject.binder.AnnotatedBindingBuilder;
                    
21import com.google.inject.binder.ScopedBindingBuilder;
                    
22import com.google.inject.internal.util.ImmutableList;
                    
22import com.google.inject.internal.util.ImmutableList;
                    
23import com.google.inject.internal.util.Lists;
                    
24import com.google.inject.name.Named;
                    
396      nextId.set(101);
                    
397      return Guice.createInjector(modules);
                    
398    }
                    
                
BinderTest.java https://github.com/peterlynch/spice.git | Java | 448 lines
                    
176    try {
                    
177      Guice.createInjector(new AbstractModule() {
                    
178        @Override public void configure() {
                    
201    try {
                    
202      Guice.createInjector(new AbstractModule() {
                    
203        @Override public void configure() {
                    
324    try {
                    
325      Guice.createInjector(new AbstractModule() {
                    
326        protected void configure() {
                    
340    try {
                    
341      Guice.createInjector(new AbstractModule() {
                    
342        protected void configure() {
                    
357    try {
                    
358      Guice.createInjector(new AbstractModule() {
                    
359        protected void configure() {
                    
                
Errors.java https://github.com/peterlynch/spice.git | Java | 698 lines
                    
21import com.google.inject.Key;
                    
22import com.google.inject.MembersInjector;
                    
23import com.google.inject.Provider;
                    
27import com.google.inject.internal.util.ImmutableList;
                    
28import com.google.inject.internal.util.ImmutableSet;
                    
29import com.google.inject.internal.util.Lists;
                    
30import com.google.inject.internal.util.SourceProvider;
                    
31import com.google.inject.internal.util.StackTraceElements;
                    
32import com.google.inject.spi.Dependency;
                    
118   * same message for both bind time errors:
                    
119   * <pre><code>Guice.createInjector(new AbstractModule() {
                    
120   *   public void configure() {
                    
124   * ...and at provide-time errors:
                    
125   * <pre><code>Guice.createInjector().getInstance(Runnable.class);</code></pre>
                    
126   * Otherwise we need to know who's calling when resolving a just-in-time
                    
                
VDCHandlerTest.java https://github.com/aledsage/jclouds-legacy.git | Java | 81 lines
                    
36import com.google.common.collect.ImmutableMap;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.Injector;
                    
49      InputStream is = getClass().getResourceAsStream("/vdc.xml");
                    
50      Injector injector = Guice.createInjector(new SaxParserModule());
                    
51      Factory factory = injector.getInstance(ParseSax.Factory.class);
                    
                
Initializer.java https://github.com/WIZARDISHUNGRY/limewire.git | Java | 634 lines
                    
51import com.google.inject.AbstractModule;
                    
52import com.google.inject.Guice;
                    
53import com.google.inject.Injector;
                    
53import com.google.inject.Injector;
                    
54import com.google.inject.Stage;
                    
55import com.limegroup.gnutella.ActiveLimeWireCheck;
                    
357        stopwatch.reset();
                    
358        Injector injector = Guice.createInjector(Stage.PRODUCTION, new LimeWireModule(), new AbstractModule() {
                    
359            @Override
                    
367    
                    
368    /** Wires together remaining non-Guiced pieces. */
                    
369    private void glueCore(LimeWireCore limeWireCore) {
                    
                
JpaFlatFormDaoTest.java https://github.com/gatherdata/gather-data.git | Java | 171 lines
                    
44
                    
45import com.google.inject.Guice;
                    
46import com.google.inject.Inject;
                    
46import com.google.inject.Inject;
                    
47import com.google.inject.Injector;
                    
48
                    
63        // guice up the instance
                    
64        Injector injector = Guice.createInjector(new JpaTestingModule());
                    
65        injector.injectMembers(dao);
                    
                
MembersInjectorTest.java https://gitlab.com/metamorphiccode/guice | Java | 401 lines
                    
59
                    
60    Guice.createInjector(new AbstractModule() {
                    
61      @Override protected void configure() {
                    
178    try {
                    
179      Guice.createInjector(new AbstractModule() {
                    
180        protected void configure() {
                    
248  public void testGettingAnnotatedMembersInjector() {
                    
249    Injector injector = Guice.createInjector();
                    
250    try {
                    
332    final ParallelMemberInjectionCallback2 c2 = new ParallelMemberInjectionCallback2();
                    
333    Guice.createInjector(new AbstractModule() {
                    
334      @Override
                    
358    final RecursiveMemberInjection rmi = new RecursiveMemberInjection();
                    
359    Guice.createInjector(new AbstractModule() {
                    
360      @Override
                    
                
GuiceServletConfig.java https://github.com/csamuel/jclouds.git | Java | 141 lines
                    
45import com.google.appengine.api.labs.taskqueue.TaskOptions.Method;
                    
46import com.google.appengine.repackaged.com.google.common.base.Splitter;
                    
47import com.google.common.collect.ImmutableSet;
                    
49import com.google.common.io.Closeables;
                    
50import com.google.inject.Guice;
                    
51import com.google.inject.Injector;
                    
54import com.google.inject.name.Names;
                    
55import com.google.inject.servlet.GuiceServletContextListener;
                    
56import com.google.inject.servlet.ServletModule;
                    
62 */
                    
63public class GuiceServletConfig extends GuiceServletContextListener {
                    
64   public static final String PROPERTY_BLOBSTORE_CONTEXTS = "blobstore.contexts";
                    
120   protected Injector getInjector() {
                    
121      return Guice.createInjector(new ServletModule() {
                    
122         @Override
                    
                
ErrorHandlerImplTest.html https://github.com/slspeek/FSpotCloudSite.git | HTML | 57 lines
                    
15<a class="jxr_linenumber" name="5" href="#5">5</a>   
                    
16<a class="jxr_linenumber" name="6" href="#6">6</a>   <strong class="jxr_keyword">import</strong> com.google.inject.Guice;
                    
17<a class="jxr_linenumber" name="7" href="#7">7</a>   <strong class="jxr_keyword">import</strong> com.google.inject.Injector;
                    
38<a class="jxr_linenumber" name="28" href="#28">28</a>  		report = mock(HeavyReport.<strong class="jxr_keyword">class</strong>);
                    
39<a class="jxr_linenumber" name="29" href="#29">29</a>  		injector = Guice.createInjector(<strong class="jxr_keyword">new</strong> HeavyReportModule(report));
                    
40<a class="jxr_linenumber" name="30" href="#30">30</a>  		action = <strong class="jxr_keyword">new</strong> ThrowingAction(<span class="jxr_string">"Demian"</span>);
                    
                
BTDownloaderImplTest.java https://github.com/r3n/limewire5-ruby.git | Java | 395 lines
                    
13
                    
14import com.google.inject.Guice;
                    
15import com.google.inject.Injector;
                    
15import com.google.inject.Injector;
                    
16import com.google.inject.Stage;
                    
17import com.limegroup.gnutella.ActivityCallbackAdapter;
                    
358        AssertComparisons.assertTrue(torrentFile.exists());
                    
359        Injector injector = Guice.createInjector(Stage.PRODUCTION, new LimeWireCoreModule(
                    
360                ActivityCallbackAdapter.class));
                    
                
DefaultBindingContractGeneratorSetup.java https://github.com/andrearn/org.fornax.soa.xtextservicerepository.git | Java | 258 lines
                    
25
                    
26import com.google.common.collect.Maps;
                    
27import com.google.inject.AbstractModule;
                    
27import com.google.inject.AbstractModule;
                    
28import com.google.inject.Guice;
                    
29import com.google.inject.Injector;
                    
29import com.google.inject.Injector;
                    
30import com.google.inject.TypeLiteral;
                    
31import com.google.inject.name.Names;
                    
49	public Injector createInjectorAndDoEMFRegistration() {
                    
50		Injector injector = Guice.createInjector (Modules2.mixin (
                    
51				new BaseDslGeneratorModule (),
                    
                
InstantiateVAppTemplateOptionsTest.java https://github.com/bmabey/jclouds.git | Java | 123 lines
                    
35import com.google.common.collect.Iterables;
                    
36import com.google.inject.Guice;
                    
37import com.google.inject.Injector;
                    
46
                    
47   Injector injector = Guice.createInjector(new SaxParserModule());
                    
48
                    
                
TestOverrideMethodFilterInHttpServer.java https://gitlab.com/vectorci/airlift | Java | 290 lines
                    
18import com.google.inject.Binder;
                    
19import com.google.inject.Guice;
                    
20import com.google.inject.Module;
                    
275    {
                    
276        return Guice.createInjector(
                    
277                new TestingNodeModule(),
                    
                
docdiffs_index.html https://github.com/christophercurrie/Moogle-Muice.git | HTML | 91 lines
                    
49<br>
                    
50<A NAME="com.google.inject.Guice!class"></A>&nbsp;&nbsp;Class <a href="docdiffs_com.google.inject.html#com.google.inject.Guice!class">Guice</a><br>
                    
51&nbsp;&nbsp;&nbsp;&nbsp;Method <a href="docdiffs_com.google.inject.html#com.google.inject.Guice.dmethod.createInjector(Iterable&lt;Module&gt;)">createInjector(Iterable&lt;Module&gt;)</a><br>
                    
51&nbsp;&nbsp;&nbsp;&nbsp;Method <a href="docdiffs_com.google.inject.html#com.google.inject.Guice.dmethod.createInjector(Iterable&lt;Module&gt;)">createInjector(Iterable&lt;Module&gt;)</a><br>
                    
52&nbsp;&nbsp;&nbsp;&nbsp;Method <a href="docdiffs_com.google.inject.html#com.google.inject.Guice.dmethod.createInjector(Module[])">createInjector(Module[])</a><br>
                    
53&nbsp;&nbsp;&nbsp;&nbsp;Method <a href="docdiffs_com.google.inject.html#com.google.inject.Guice.dmethod.createInjector(Stage, Iterable&lt;Module&gt;)">createInjector(Stage, Iterable&lt;Module&gt;)</a><br>
                    
53&nbsp;&nbsp;&nbsp;&nbsp;Method <a href="docdiffs_com.google.inject.html#com.google.inject.Guice.dmethod.createInjector(Stage, Iterable&lt;Module&gt;)">createInjector(Stage, Iterable&lt;Module&gt;)</a><br>
                    
54&nbsp;&nbsp;&nbsp;&nbsp;Method <a href="docdiffs_com.google.inject.html#com.google.inject.Guice.dmethod.createInjector(Stage, Module[])">createInjector(Stage, Module[])</a><br>
                    
55<br>
                    
63<br>
                    
64<A NAME="com.google.inject.assistedinject.FactoryProvider!class"></A>&nbsp;&nbsp;Class <a href="docdiffs_com.google.inject.assistedinject.html#com.google.inject.assistedinject.FactoryProvider!class">FactoryProvider</a><br>
                    
65<br>
                    
66<A NAME="com.google.inject.multibindings!package"></A>Package <b>com.google.inject.multibindings</b><br>
                    
67<A NAME="com.google.inject.multibindings.MapBinder!class"></A>&nbsp;&nbsp;Class <a href="docdiffs_com.google.inject.multibindings.html#com.google.inject.multibindings.MapBinder!class">MapBinder</a><br>
                    
68<br>
                    
                
ToIteratorOfListPageExpectTest.java git://github.com/jclouds/jclouds.git | Java | 184 lines
                    
44import com.google.common.collect.ImmutableList;
                    
45import com.google.inject.Guice;
                    
46
                    
49
                    
50   private final Json json = Guice.createInjector(new GsonModule(), new GoogleComputeEngineParserModule())
                    
51         .getInstance(Json.class);
                    
                
ExtensionSpiTest.java https://github.com/sonatype/sisu-guice.git | Java | 293 lines
                    
16
                    
17package com.google.inject.servlet;
                    
18
                    
19import static com.google.inject.servlet.UriPatternType.REGEX;
                    
20import static com.google.inject.servlet.UriPatternType.SERVLET;
                    
21
                    
21
                    
22import com.google.common.collect.ImmutableList;
                    
23import com.google.common.collect.ImmutableMap;
                    
24import com.google.inject.Binding;
                    
25import com.google.inject.Guice;
                    
26import com.google.inject.Injector;
                    
66    int count = 0;
                    
67    Injector injector = Guice.createInjector(new Module());
                    
68    for (Binding binding : injector.getBindings().values()) {
                    
                
NamesTest.java https://github.com/peterlynch/spice.git | Java | 109 lines
                    
17
                    
18package com.google.inject.name;
                    
19
                    
22import static com.google.inject.Asserts.assertEqualsBothWays;
                    
23import com.google.inject.Guice;
                    
24import com.google.inject.Injector;
                    
59
                    
60    Injector injector = Guice.createInjector(new AbstractModule() {
                    
61      protected void configure() {
                    
73
                    
74    Injector injector = Guice.createInjector(new AbstractModule() {
                    
75      protected void configure() {
                    
92
                    
93    Injector injector = Guice.createInjector(new AbstractModule() {
                    
94      protected void configure() {
                    
                
OSGiTestActivator.java https://gitlab.com/metamorphiccode/guice | Java | 511 lines
                    
16
                    
17package com.googlecode.guice.bundle;
                    
18
                    
18
                    
19import static com.google.inject.name.Names.named;
                    
20
                    
21import com.google.inject.AbstractModule;
                    
22import com.google.inject.Guice;
                    
23import com.google.inject.Inject;
                    
486
                    
487    Injector injector = Guice.createInjector(new TestModule(bundle));
                    
488/*if[AOP]*/
                    
488/*if[AOP]*/
                    
489    Injector aopInjector = Guice.createInjector(new TestModule(bundle), new InterceptorModule());
                    
490/*end[AOP]*/
                    
                
CatalogItemHandlerTest.java https://github.com/ahgittin/legacy-jclouds.git | Java | 88 lines
                    
36import com.google.common.collect.ImmutableSortedMap;
                    
37import com.google.inject.Guice;
                    
38import com.google.inject.name.Names;
                    
51   protected void setUpInjector() {
                    
52      injector = Guice.createInjector(new SaxParserModule() {
                    
53         @Override
                    
                
BundleActivation.java https://github.com/sonatype/sonatype-peaberry.git | Java | 193 lines
                    
29import com.google.inject.Binding;
                    
30import com.google.inject.Guice;
                    
31import com.google.inject.Injector;
                    
31import com.google.inject.Injector;
                    
32import com.google.inject.Key;
                    
33import com.google.inject.Module;
                    
34import com.google.inject.Scope;
                    
35import com.google.inject.Scopes;
                    
36import com.google.inject.Singleton;
                    
36import com.google.inject.Singleton;
                    
37import com.google.inject.spi.BindingScopingVisitor;
                    
38
                    
159    injector =
                    
160        Guice.createInjector(Peaberry.osgiModule(bundle.getBundleContext()), Reflection
                    
161            .create(moduleClass));
                    
                
Initializer.java https://github.com/r3n/limewire5-ruby.git | Java | 645 lines
                    
53import com.google.inject.AbstractModule;
                    
54import com.google.inject.Guice;
                    
55import com.google.inject.Inject;
                    
55import com.google.inject.Inject;
                    
56import com.google.inject.Injector;
                    
57import com.google.inject.Provider;
                    
57import com.google.inject.Provider;
                    
58import com.google.inject.Stage;
                    
59import com.limegroup.gnutella.ActiveLimeWireCheck;
                    
368        stopwatch.reset();
                    
369        Injector injector = Guice.createInjector(Stage.PRODUCTION, new LimeWireModule(), new AbstractModule() {
                    
370            @Override
                    
                
TestConfig.java https://gitlab.com/CORP-RESELLER/airlift | Java | 141 lines
                    
17
                    
18import com.google.common.collect.ImmutableMap;
                    
19import com.google.common.collect.ImmutableMap.Builder;
                    
19import com.google.common.collect.ImmutableMap.Builder;
                    
20import com.google.inject.Binder;
                    
21import com.google.inject.CreationException;
                    
21import com.google.inject.CreationException;
                    
22import com.google.inject.Guice;
                    
23import com.google.inject.Injector;
                    
23import com.google.inject.Injector;
                    
24import com.google.inject.Module;
                    
25import com.google.inject.spi.Message;
                    
92        List<Message> messages = new ConfigurationValidator(configurationFactory, null).validate(module);
                    
93        return Guice.createInjector(new ConfigurationModule(configurationFactory), module, new ValidationErrorModule(messages));
                    
94    }
                    
                
ParseContainerCDNMetadataListFromJsonResponseTest.java https://github.com/mattiasholmqvist/jclouds.git | Java | 69 lines
                    
35import com.google.common.collect.ImmutableSortedSet;
                    
36import com.google.inject.Guice;
                    
37import com.google.inject.Injector;
                    
37import com.google.inject.Injector;
                    
38import com.google.inject.Key;
                    
39import com.google.inject.TypeLiteral;
                    
47public class ParseContainerCDNMetadataListFromJsonResponseTest {
                    
48   Injector i = Guice.createInjector(new GsonModule());
                    
49
                    
                
CatalogHandlerTest.java https://github.com/dmitrib/jclouds.git | Java | 143 lines
                    
33
                    
34import com.google.inject.Guice;
                    
35import com.google.inject.Injector;
                    
50      InputStream is = getClass().getResourceAsStream("/catalog.xml");
                    
51      injector = Guice.createInjector(new SaxParserModule());
                    
52      factory = injector.getInstance(ParseSax.Factory.class);
                    
                
com.google.inject.Guice.html https://github.com/christophercurrie/Moogle-Muice.git | HTML | 134 lines
                    
51</H2>
                    
52Documentation <a href="docdiffs_com.google.inject.html#com.google.inject.Guice!class">changed</a> from <A HREF="http://google-guice.googlecode.com/svn/trunk/latest-api-diffs/2.0/javadoc/com/google/inject/Guice.html" target="_self"><tt>old</tt></A> to <A HREF="http://google-guice.googlecode.com/svn/trunk/latest-api-diffs/3.0/javadoc/com/google/inject/Guice.html" target="_self"><tt>new</tt></A>. 
                    
53<a NAME="constructors"></a>
                    
66  <TD VALIGN="TOP" WIDTH="30%">
                    
67Documentation <a href="docdiffs_com.google.inject.html#com.google.inject.Guice.dmethod.createInjector(Module[])">changed</a> from <A HREF="http://google-guice.googlecode.com/svn/trunk/latest-api-diffs/2.0/javadoc/com/google/inject/Guice.html#createInjector(com.google.inject.Module[])" target="_self"><tt>old</tt></A> to <A HREF="http://google-guice.googlecode.com/svn/trunk/latest-api-diffs/3.0/javadoc/com/google/inject/Guice.html#createInjector(com.google.inject.Module[])" target="_self"><tt>new</tt></A>.<br>  </TD>
                    
68  <TD VALIGN="TOP">Creates an injector for the given set of modules.</TD>
                    
75  <TD VALIGN="TOP" WIDTH="30%">
                    
76Documentation <a href="docdiffs_com.google.inject.html#com.google.inject.Guice.dmethod.createInjector(Stage, Module[])">changed</a> from <A HREF="http://google-guice.googlecode.com/svn/trunk/latest-api-diffs/2.0/javadoc/com/google/inject/Guice.html#createInjector(com.google.inject.Stage, com.google.inject.Module[])" target="_self"><tt>old</tt></A> to <A HREF="http://google-guice.googlecode.com/svn/trunk/latest-api-diffs/3.0/javadoc/com/google/inject/Guice.html#createInjector(com.google.inject.Stage, com.google.inject.Module[])" target="_self"><tt>new</tt></A>.<br>  </TD>
                    
77  <TD VALIGN="TOP">Creates an injector for the given set of modules, in a given development
                    
85  <TD VALIGN="TOP" WIDTH="30%">
                    
86Documentation <a href="docdiffs_com.google.inject.html#com.google.inject.Guice.dmethod.createInjector(Stage, Iterable&lt;Module&gt;)">changed</a> from <A HREF="http://google-guice.googlecode.com/svn/trunk/latest-api-diffs/2.0/javadoc/com/google/inject/Guice.html#createInjector(com.google.inject.Stage, java.lang.Iterable<? extends com.google.inject.Module>)" target="_self"><tt>old</tt></A> to <A HREF="http://google-guice.googlecode.com/svn/trunk/latest-api-diffs/3.0/javadoc/com/google/inject/Guice.html#createInjector(com.google.inject.Stage, java.lang.Iterable<? extends com.google.inject.Module>)" target="_self"><tt>new</tt></A>.<br>  </TD>
                    
87  <TD VALIGN="TOP">Creates an injector for the given set of modules, in a given development
                    
95  <TD VALIGN="TOP" WIDTH="30%">
                    
96Documentation <a href="docdiffs_com.google.inject.html#com.google.inject.Guice.dmethod.createInjector(Iterable&lt;Module&gt;)">changed</a> from <A HREF="http://google-guice.googlecode.com/svn/trunk/latest-api-diffs/2.0/javadoc/com/google/inject/Guice.html#createInjector(java.lang.Iterable<? extends com.google.inject.Module>)" target="_self"><tt>old</tt></A> to <A HREF="http://google-guice.googlecode.com/svn/trunk/latest-api-diffs/3.0/javadoc/com/google/inject/Guice.html#createInjector(java.lang.Iterable<? extends com.google.inject.Module>)" target="_self"><tt>new</tt></A>.<br>  </TD>
                    
97  <TD VALIGN="TOP">Creates an injector for the given set of modules.</TD>
                    
                
SpiBindingsTest.java https://github.com/peterlynch/spice.git | Java | 388 lines
                    
21import com.google.inject.Binding;
                    
22import com.google.inject.Guice;
                    
23import com.google.inject.Inject;
                    
27import com.google.inject.Provider;
                    
28import com.google.inject.Scope;
                    
29import com.google.inject.Scopes;
                    
237  public void testConvertedConstantBinding() {
                    
238    Injector injector = Guice.createInjector(new AbstractModule() {
                    
239      protected void configure() {
                    
258  public void testProviderBinding() {
                    
259    Injector injector = Guice.createInjector(new AbstractModule() {
                    
260      protected void configure() {
                    
347  public void checkInjector(Module module, ElementVisitor<?>... visitors) {
                    
348    Injector injector = Guice.createInjector(module);
                    
349
                    
                
BindDriveToPlainTextStringTest.java https://github.com/chmouel/jclouds.git | Java | 92 lines
                    
39
                    
40import com.google.common.base.Function;
                    
41import com.google.common.collect.ImmutableMap;
                    
41import com.google.common.collect.ImmutableMap;
                    
42import com.google.common.collect.ImmutableSet;
                    
43import com.google.inject.AbstractModule;
                    
43import com.google.inject.AbstractModule;
                    
44import com.google.inject.Guice;
                    
45import com.google.inject.TypeLiteral;
                    
53
                    
54   private static final BindDriveToPlainTextString FN = Guice.createInjector(new AbstractModule() {
                    
55
                    
                
BoundFieldModule.java https://gitlab.com/metamorphiccode/guice | Java | 385 lines
                    
16
                    
17package com.google.inject.testing.fieldbinder;
                    
18
                    
20import com.google.common.base.Preconditions;
                    
21import com.google.inject.Binder;
                    
22import com.google.inject.BindingAnnotation;
                    
23import com.google.inject.Module;
                    
24import com.google.inject.Provider;
                    
25import com.google.inject.TypeLiteral;
                    
25import com.google.inject.TypeLiteral;
                    
26import com.google.inject.binder.AnnotatedBindingBuilder;
                    
27import com.google.inject.binder.LinkedBindingBuilder;
                    
89 *   {@literal @}Before public void setUp() {
                    
90 *     Guice.createInjector(BoundFieldModule.of(this)).injectMembers(this);
                    
91 *   }
                    
                
MultibindTests.java https://github.com/manzke/guice-automatic-injection.git | Java | 209 lines
                    
30import com.google.inject.ConfigurationException;
                    
31import com.google.inject.Guice;
                    
32import com.google.inject.Injector;
                    
41	public void createDynamicModule() {
                    
42		Injector injector = Guice.createInjector(StartupModule.create(ReflectionsScanner.class,
                    
43			PackageFilter.create(MultibindTests.class)));
                    
78	public void createFirstContainer() {
                    
79		Injector injector = Guice.createInjector(StartupModule.create(ReflectionsScanner.class,
                    
80			PackageFilter.create(MultibindTests.class)));
                    
94	public void createSecondTestInterface() {
                    
95		Injector injector = Guice.createInjector(StartupModule.create(ReflectionsScanner.class,
                    
96			PackageFilter.create(MultibindTests.class)));
                    
110	public void createAllInterfaces() {
                    
111		Injector injector = Guice.createInjector(StartupModule.create(ReflectionsScanner.class,
                    
112			PackageFilter.create(MultibindTests.class)));
                    
                
TestHttpServiceSelectorBinder.java https://gitlab.com/github-cloud-corp/airlift | Java | 194 lines
                    
21import com.google.inject.Binder;
                    
22import com.google.inject.Guice;
                    
23import com.google.inject.Injector;
                    
45    {
                    
46        Injector injector = Guice.createInjector(
                    
47                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    
122    {
                    
123        Injector injector = Guice.createInjector(
                    
124                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    
147    {
                    
148        Injector injector = Guice.createInjector(
                    
149                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    
172    {
                    
173        Injector injector = Guice.createInjector(
                    
174                new ConfigurationModule(new ConfigurationFactory(ImmutableMap.<String, String>of())),
                    
                
 

Source

Language