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


Java Environment类代码示例

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

示例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)
    );
}
 
开发者ID:webinerds,项目名称:s3-proxy-chunk-upload,代码行数:21,代码来源:S3Module.java

示例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()
    );
}
 
开发者ID:CSCfi,项目名称:exam,代码行数:8,代码来源:DeadboltHook.java

示例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()
    );
}
 
开发者ID:0xbaadf00d,项目名称:play-redis-module,代码行数:14,代码来源:RedisTest.java

示例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));
}
 
开发者ID:play2-maven-plugin,项目名称:play2-maven-test-projects,代码行数:8,代码来源:CustomDeadboltHook.java

示例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()
    );
}
 
开发者ID:playframework,项目名称:play-ebean,代码行数:8,代码来源:EbeanModule.java

示例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)
    );
}
 
开发者ID:tochkak,项目名称:play-graylog2,代码行数:7,代码来源:Graylog2Module.java

示例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));
}
 
开发者ID:Vadus,项目名称:songs_play,代码行数:5,代码来源:MyCustomDeadboltHook.java

示例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));
}
 
开发者ID:kurator-org,项目名称:kurator-web,代码行数:6,代码来源:CustomDeadboltHook.java

示例10: bindings

import play.api.Environment; //导入依赖的package包/类
@Override
public Seq<Binding<?>> bindings(final Environment environment, final Configuration configuration) {
  return seq(bind(HandlebarsApi.class).toSelf());
}
 
开发者ID:andriykuba,项目名称:play-handlebars,代码行数:5,代码来源:HandlebarsModule.java

示例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));
}
 
开发者ID:0xbaadf00d,项目名称:play-redis-module,代码行数:5,代码来源:PlayRedisModule.java

示例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());
}
 
开发者ID:0xbaadf00d,项目名称:play-s3-module,代码行数:5,代码来源:AmazonS3Module.java


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