当前位置: 首页>>代码示例>>Java>>正文


Java ScopedBindingBuilder.asEagerSingleton方法代码示例

本文整理汇总了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);
    }
  }
}
 
开发者ID:immutables,项目名称:miscellaneous,代码行数:17,代码来源:Providers.java

示例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);
  }
}
 
开发者ID:jooby-project,项目名称:jooby,代码行数:24,代码来源:ApiTool.java

示例3: applyTo

import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
@Override
public void applyTo(ScopedBindingBuilder scopedBindingBuilder) {
  scopedBindingBuilder.asEagerSingleton();
}
 
开发者ID:google,项目名称:guice,代码行数:5,代码来源:Scoping.java

示例4: configure

import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
@Override
void configure(ScopedBindingBuilder sbb) {
  sbb.asEagerSingleton();
}
 
开发者ID:google,项目名称:guice,代码行数:5,代码来源:BinderTestSuite.java

示例5: applyTo

import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
@Override public void applyTo(ScopedBindingBuilder scopedBindingBuilder) {
  scopedBindingBuilder.asEagerSingleton();
}
 
开发者ID:cgruber,项目名称:guice-old,代码行数:4,代码来源:Scoping.java

示例6: configure

import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
void configure(ScopedBindingBuilder sbb) {
  sbb.asEagerSingleton();
}
 
开发者ID:cgruber,项目名称:guice-old,代码行数:4,代码来源:BinderTestSuite.java

示例7: applyTo

import com.google.inject.binder.ScopedBindingBuilder; //导入方法依赖的package包/类
public void applyTo(ScopedBindingBuilder scopedBindingBuilder) {
  scopedBindingBuilder.asEagerSingleton();
}
 
开发者ID:utopiazh,项目名称:google-guice,代码行数:4,代码来源:Scoping.java


注:本文中的com.google.inject.binder.ScopedBindingBuilder.asEagerSingleton方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。