本文整理汇总了Java中com.google.inject.binder.ScopedBindingBuilder.asEagerSingleton方法的典型用法代码示例。如果您正苦于以下问题:Java ScopedBindingBuilder.asEagerSingleton方法的具体用法?Java ScopedBindingBuilder.asEagerSingleton怎么用?Java ScopedBindingBuilder.asEagerSingleton使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.google.inject.binder.ScopedBindingBuilder
的用法示例。
在下文中一共展示了ScopedBindingBuilder.asEagerSingleton方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindFutureProvider
import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
void bindFutureProvider(PrivateBinder binder) {
binder = binder.withSource(source);
ScopedBindingBuilder scoper = binder.bind(bindingKey).toProvider(this);
if (isVoid(method)) {
scoper.asEagerSingleton();
} else {
if (scopeAnnotation != null) {
scoper.in(scopeAnnotation);
}
if (exposedBinding) {
binder.expose(bindingKey);
}
}
}
示例2: configure
import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
@Override public void configure(final Env env, final Config conf, final Binder binder)
throws Exception {
boolean dev = env.name().equals("dev");
ScopedBindingBuilder provider = binder.bind(M)
.toProvider(APIProvider.class);
if (!dev) {
provider.asEagerSingleton();
}
Path dir = Optional.ofNullable(basedir).orElse(Paths.get(conf.getString("user.dir")));
ApiParser parser = new ApiParser(dir, filter);
customizer.forEach(parser::modify);
binder.bind(ApiParser.class).toInstance(parser);
String contextPath = conf.getString("application.path");
if (swaggerOptions != null) {
swagger(contextPath, env.router(), swaggerOptions, swagger);
}
if (ramlOptions != null) {
raml(contextPath, env.router(), ramlOptions, raml);
}
}
示例3: applyTo
import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
@Override
public void applyTo(ScopedBindingBuilder scopedBindingBuilder) {
scopedBindingBuilder.asEagerSingleton();
}
示例4: configure
import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
@Override
void configure(ScopedBindingBuilder sbb) {
sbb.asEagerSingleton();
}
示例5: applyTo
import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
@Override public void applyTo(ScopedBindingBuilder scopedBindingBuilder) {
scopedBindingBuilder.asEagerSingleton();
}
示例6: configure
import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
void configure(ScopedBindingBuilder sbb) {
sbb.asEagerSingleton();
}
示例7: applyTo
import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
public void applyTo(ScopedBindingBuilder scopedBindingBuilder) {
scopedBindingBuilder.asEagerSingleton();
}