
com.google.gwt.inject.client.multibindings.RuntimeBindingsRegistryModule Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of gin Show documentation
Show all versions of gin Show documentation
GIN (GWT INjection) brings automatic dependency injection to Google Web Toolkit client-side code. GIN is built on top of Guice and uses (a subset of) Guice's binding language.
// Copyright 2011 Google Inc. All Rights Reserved.
package com.google.gwt.inject.client.multibindings;
import com.google.gwt.inject.client.multibindings.InternalModule.SingletonInternalModule;
import com.google.inject.Key;
import com.google.inject.Singleton;
/**
* A module to bind and expose {@link RuntimeBindingsRegistry} for a multibinding key.
*
* @param type of binding
*/
class RuntimeBindingsRegistryModule extends SingletonInternalModule {
public RuntimeBindingsRegistryModule(Key multibindingKey) {
super(multibindingKey);
}
@SuppressWarnings("unchecked")
@Override
protected void configure() {
// Safe to use unchecked RuntimeBindingsRegistry.class as its new instances are always a valid
// substitution for any RuntimeBindingsRegistry.
bindAndExpose(bindingsRegistry()).to(RuntimeBindingsRegistry.class).in(Singleton.class);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy