net.yudichev.jiotty.common.varstore.VarStoreModule Maven / Gradle / Ivy
package net.yudichev.jiotty.common.varstore;
import net.yudichev.jiotty.common.inject.BaseLifecycleComponentModule;
import net.yudichev.jiotty.common.inject.ExposedKeyModule;
import javax.inject.Singleton;
import static com.google.common.base.Preconditions.checkNotNull;
public final class VarStoreModule extends BaseLifecycleComponentModule implements ExposedKeyModule {
private final String applicationName;
public VarStoreModule(String applicationName) {
this.applicationName = checkNotNull(applicationName);
}
@Override
protected void configure() {
bindConstant().annotatedWith(VarStoreImpl.AppName.class).to(applicationName);
bind(getExposedKey()).to(VarStoreImpl.class).in(Singleton.class);
expose(getExposedKey());
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy