本文整理汇总了Java中play.api.Environment类的典型用法代码示例。如果您正苦于以下问题:Java Environment类的具体用法?Java Environment怎么用?Java Environment使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Environment类属于play.api包,在下文中一共展示了Environment类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindings
import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
Binding<EbeanServer> ebeanBinding = bind(EbeanServer.class)
.qualifiedWith(PushServicesEbeanServer.class)
.toProvider(PushServicesEbeanServerProvider.class);
Binding<ApplicationLifecycleListener> lifecycleBinding = bind(ApplicationLifecycleListener.class)
.toProvider(PushApplicationLifecycleProvider.class)
.eagerly();
Binding<TaskQueueScheduler> taskqueueBinding = bind(TaskQueueScheduler.class)
.toSelf();
return seq(ebeanBinding, lifecycleBinding, taskqueueBinding);
}
示例2: bindings
import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
GlobalParams.AWS_ACCESS_KEY = Scala.orNull(configuration.getString("AWS_ACCESS_KEY", scala.Option.empty()));
GlobalParams.AWS_SECRET_KEY = Scala.orNull(configuration.getString("AWS_SECRET_KEY", scala.Option.empty()));
GlobalParams.AWS_S3_BUCKET = Scala.orNull(configuration.getString("AWS_S3_BUCKET", scala.Option.empty()));
String accessKey = GlobalParams.AWS_ACCESS_KEY;
String secretKey = GlobalParams.AWS_SECRET_KEY;
s3Bucket = GlobalParams.AWS_S3_BUCKET;
if ((accessKey != null) && (secretKey != null)) {
awsCredentials = new BasicAWSCredentials(accessKey, secretKey);
amazonS3 = new AmazonS3Client(awsCredentials);
Logger.info("Using S3 Bucket: " + s3Bucket);
}
return seq(
bind(S3Plugin.class).to(S3PluginImpl.class)
);
}
示例3: bindings
import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
return seq(
bind(AuthorizationHandler.class).toSelf().eagerly(),
bind(HandlerCache.class).to(DeadboltCache.class).eagerly()
);
}
示例4: redisTest_000_binding
import play.api.Environment; //导入依赖的package包/类
/**
* @since 16.11.13
*/
@Test
public void redisTest_000_binding() {
final Module module = new PlayRedisModule();
Assert.assertEquals(1,
module.bindings(
mock(Environment.class),
this.application.configuration().getWrappedConfiguration()
).length()
);
}
示例5: bindings
import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(final Environment environment,
final Configuration configuration)
{
return seq(bind(TemplateFailureListener.class).to(MyCustomTemplateFailureListener.class).in(Singleton.class),
bind(HandlerCache.class).to(MyHandlerCache.class).in(Singleton.class));
}
示例6: bindings
import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
return seq(
bind(DynamicEvolutions.class).to(EbeanDynamicEvolutions.class).eagerly(),
bind(EbeanConfig.class).toProvider(DefaultEbeanConfig.EbeanConfigParser.class).eagerly()
);
}
示例7: bindings
import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
return seq(
bind(Graylog2Component.class).to(Graylog2Impl.class).in(Singleton.class)
);
}
示例8: bindings
import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(final Environment environment, final Configuration configuration) {
return seq(bind(HandlerCache.class).to(MyHandlerCache.class).in(Singleton.class));
}
示例9: bindings
import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(final Environment environment,
final Configuration configuration) {
return seq(bind(HandlerCache.class).to(MyHandlerCache.class).in(Singleton.class));
}
示例10: bindings
import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(final Environment environment, final Configuration configuration) {
return seq(bind(HandlebarsApi.class).toSelf());
}
示例11: bindings
import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(final Environment environment, final Configuration configuration) {
return seq(bind(PlayRedis.class).to(PlayRedisImpl.class));
}
示例12: bindings
import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(final Environment environment, final Configuration configuration) {
return seq(bind(AmazonS3ModuleInitializer.class).toSelf().eagerly());
}