本文整理汇总了Java中play.api.Configuration类的典型用法代码示例。如果您正苦于以下问题:Java Configuration类的具体用法?Java Configuration怎么用?Java Configuration使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Configuration类属于play.api包,在下文中一共展示了Configuration类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: bindings
import play.api.Configuration; //导入依赖的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.Configuration; //导入依赖的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: ApplicationStart
import play.api.Configuration; //导入依赖的package包/类
@Inject
public ApplicationStart(Clock clock, ApplicationLifecycle appLifecycle, final Configuration configuration, final Database dbSource)
throws GroundException {
this.start = clock.instant();
Logger.info("Ground Postgres: Starting application at " + this.start);
Logger.info("Queries will Cache for {} seconds.", configuration.underlying().getString("ground.cache.expire.secs"));
System.setProperty("ground.cache.expire.secs", configuration.underlying().getString("ground.cache.expire.secs"));
appLifecycle.addStopHook(
() -> {
Instant stop = clock.instant();
Long runningTime = stop.getEpochSecond() - this.start.getEpochSecond();
Logger.info("Ground Postgres: Stopping application at " + clock.instant() + " after " + runningTime + "s.");
return CompletableFuture.completedFuture(null);
});
}
示例4: bindings
import play.api.Configuration; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(Environment environment, Configuration configuration) {
return seq(
bind(AuthorizationHandler.class).toSelf().eagerly(),
bind(HandlerCache.class).to(DeadboltCache.class).eagerly()
);
}
示例5: bindings
import play.api.Configuration; //导入依赖的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.Configuration; //导入依赖的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.Configuration; //导入依赖的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.Configuration; //导入依赖的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.Configuration; //导入依赖的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.Configuration; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(final Environment environment, final Configuration configuration) {
return seq(bind(HandlebarsApi.class).toSelf());
}
示例11: bindings
import play.api.Configuration; //导入依赖的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.Configuration; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(final Environment environment, final Configuration configuration) {
return seq(bind(AmazonS3ModuleInitializer.class).toSelf().eagerly());
}