com.google.gwt.inject.client.multibindings.RuntimeBindingsRegistryModule Maven / Gradle / Ivy
// 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