• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java Binding类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中play.api.inject.Binding的典型用法代码示例。如果您正苦于以下问题:Java Binding类的具体用法?Java Binding怎么用?Java Binding使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Binding类属于play.api.inject包,在下文中一共展示了Binding类的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: bindings

import play.api.inject.Binding; //导入依赖的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: startApplicationTest

import play.api.inject.Binding; //导入依赖的package包/类
@BeforeClass
public static void startApplicationTest() {
    // Mock the router binding.
    Binding<Router> routesBindingOverride = new BindingKey<>(Router.class)
            .toProvider(MockRouterProvider.class)
            .eagerly();

    application = new GuiceApplicationBuilder()
            .in(Mode.TEST)
            .configure("db.pushservices.name", "pushservices")
            .configure("db.pushservices.driver", "org.postgresql.Driver")
            .configure("db.pushservices.connectionTimeout", "10 seconds")
            .configure("db.pushservices.url", "jdbc:postgresql://localhost:5432/pushservices")
            .configure("db.pushservices.username", "YOUR_USERNAME")
            .configure("db.pushservices.password", "YOUR_PASSWORD")
            .overrides(routesBindingOverride)
            .build();
}
 
开发者ID:splendidbits,项目名称:play-pushservices,代码行数:19,代码来源:PushServicesApplicationTest.java


示例3: bindings

import play.api.inject.Binding; //导入依赖的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


示例4: bindings

import play.api.inject.Binding; //导入依赖的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


示例5: bindings

import play.api.inject.Binding; //导入依赖的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.inject.Binding; //导入依赖的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.inject.Binding; //导入依赖的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.inject.Binding; //导入依赖的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.inject.Binding; //导入依赖的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.inject.Binding; //导入依赖的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.inject.Binding; //导入依赖的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.inject.Binding; //导入依赖的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.inject.Binding类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java WithoutJenkins类代码示例发布时间:2022-05-22
下一篇:
Java OFSwitchHandshakeHandler类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap