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

Java Blocking类代码示例

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

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



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

示例1: handle

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
public void handle(Context context) throws Exception {
    try {
        Blocking.get(
                () -> config.authenticate(injector, config.getInput(context))
        ).onError(t -> {
            if (t.getClass().equals(AuthenticationFailed.class)) {
                AuthenticationFailed failure = (AuthenticationFailed) t;
                context.getResponse().status(failure.getHttpStatus()).send(failure.getMessage());
            }
        }).then(claims -> {
            String token = jwtSigner.sign(claims.toMap());
            context.render(Jackson.json(token));
        });
    } catch (ParserException e) {
        LOGGER.info("Failed to parse Credential", e);
        context.getResponse().status(400).send();
    }
}
 
开发者ID:ylemoigne,项目名称:ratpack-jwtauth,代码行数:20,代码来源:LoginHandler.java


示例2: backoff

import ratpack.exec.Blocking; //导入依赖的package包/类
public Promise<Void> backoff() {
    return Blocking.op(() -> {
        log.debug("Circuit is OPEN.  Waiting...");
        Thread.sleep(waitTime());
        mark();
    }).promise();
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:8,代码来源:ExponentialBackoff.java


示例3: awaitShutdown

import ratpack.exec.Blocking; //导入依赖的package包/类
private Operation awaitShutdown() {
    return Blocking.op(() -> {
        synchronized (mutex) {
            try {
                mutex.wait();
            } catch (InterruptedException e) {
                //Intentionally left blank
            }
        }
    });
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:12,代码来源:ConsumerAction.java


示例4: createTopic

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<CreateTopicResult> createTopic(CreateTopicRequest request) {
    LOG.trace("creating sns topic request={}", request);
    return Blocking.get(() -> sns().createTopic(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:8,代码来源:DefaultSnsService.java


示例5: subscribe

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<SubscribeResult> subscribe(SubscribeRequest request) {
    LOG.trace("subscribing to sns topic request={}", request);
    return Blocking.get(() -> sns().subscribe(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:8,代码来源:DefaultSnsService.java


示例6: publish

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<PublishResult> publish(PublishRequest request) {
    LOG.trace("publishing to sns topic request={}", request);
    return Blocking.get(() -> sns().publish(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:8,代码来源:DefaultSnsService.java


示例7: deleteTopic

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<DeleteTopicResult> deleteTopic(DeleteTopicRequest request) {
    LOG.debug("deleting sns topic request={}", request);
    return Blocking.get(() -> sns().deleteTopic(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:8,代码来源:DefaultSnsService.java


示例8: addPermission

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<AddPermissionResult> addPermission(
    String topicArn,
    String label,
    List<String> aWSAccountIds,
    List<String> actionNames
) {
    return Blocking.get(() -> sns().addPermission(topicArn, label, actionNames, actionNames))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:12,代码来源:DefaultSnsService.java


示例9: checkIfPhoneNumberIsOptedOut

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<CheckIfPhoneNumberIsOptedOutResult> checkIfPhoneNumberIsOptedOut(
    CheckIfPhoneNumberIsOptedOutRequest request
) {
    return Blocking.get(() -> sns().checkIfPhoneNumberIsOptedOut(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:9,代码来源:DefaultSnsService.java


示例10: confirmSubscription

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<ConfirmSubscriptionResult> confirmSubscription(
    String topicArn,
    String token,
    String authenticateOnUnsubscribe
) {
    return Blocking.get(() -> sns().confirmSubscription(topicArn, token, authenticateOnUnsubscribe))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:11,代码来源:DefaultSnsService.java


示例11: createPlatformApplication

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<CreatePlatformApplicationResult> createPlatformApplication(
    CreatePlatformApplicationRequest request
) {
    return Blocking.get(() -> sns().createPlatformApplication(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:9,代码来源:DefaultSnsService.java


示例12: deletePlatformApplication

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<DeletePlatformApplicationResult> deletePlatformApplication(
    DeletePlatformApplicationRequest request
) {
    return Blocking.get(() -> sns().deletePlatformApplication(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:9,代码来源:DefaultSnsService.java


示例13: getPlatformApplicationAttributes

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<GetPlatformApplicationAttributesResult> getPlatformApplicationAttributes(
    GetPlatformApplicationAttributesRequest request
) {
    return Blocking.get(() -> sns().getPlatformApplicationAttributes(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:9,代码来源:DefaultSnsService.java


示例14: getSubscriptionAttributes

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<GetSubscriptionAttributesResult> getSubscriptionAttributes(
    GetSubscriptionAttributesRequest request
) {
    return Blocking.get(() -> sns().getSubscriptionAttributes(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:9,代码来源:DefaultSnsService.java


示例15: listEndpointsByPlatformApplication

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<ListEndpointsByPlatformApplicationResult> listEndpointsByPlatformApplication(
    ListEndpointsByPlatformApplicationRequest request
) {
    return Blocking.get(() -> sns().listEndpointsByPlatformApplication(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:9,代码来源:DefaultSnsService.java


示例16: setPlatformApplicationAttributes

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<SetPlatformApplicationAttributesResult> setPlatformApplicationAttributes(
    SetPlatformApplicationAttributesRequest request
) {
    return Blocking.get(() -> sns().setPlatformApplicationAttributes(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:9,代码来源:DefaultSnsService.java


示例17: setSubscriptionAttributes

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<SetSubscriptionAttributesResult> setSubscriptionAttributes(
    SetSubscriptionAttributesRequest request
) {
    return Blocking.get(() -> sns().setSubscriptionAttributes(request))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:9,代码来源:DefaultSnsService.java


示例18: setTopicAttributes

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
@SuppressWarnings("unchecked")
public Promise<SetTopicAttributesResult> setTopicAttributes(
    String topicArn,
    String attributeName,
    String attributeValue
) {
    return Blocking.get(() -> sns().setTopicAttributes(topicArn, attributeName, attributeValue))
        .transform(breaker);
}
 
开发者ID:SmartThingsOSS,项目名称:ratpack-sqs,代码行数:11,代码来源:DefaultSnsService.java


示例19: addBook

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
public Operation addBook(Book book) {
  // TODO - Implement addBook function
  // Hint - checkout Blocking#op(Block) to see how to integrate blocking code with Ratpack
  // Hint - checkout DSLContext#newRecord(Table, Object)
  // Hint - lab07.jooq.tables.Book.BOOK is the representation for the underlying `book` table
  return Blocking.op(() -> create.newRecord(BOOK, book).store());
}
 
开发者ID:danveloper,项目名称:hands-on-ratpack-java,代码行数:9,代码来源:DefaultBookRepository.java


示例20: getBooks

import ratpack.exec.Blocking; //导入依赖的package包/类
@Override
public Promise<List<Book>> getBooks() {
  // TODO - Implement getBooks function
  // Hint - checkout Blocking#get(Block) to see how to integrate blocking code with Ratpack
  // Hint - lab07.jooq.tables.Book.BOOK is the representation for the underlying `book` table
  // Hint - checkout DSLContext#select() and ResultQuery#fetchInto(Class)
  return Blocking.get(() ->
    create.select().from(BOOK).fetchInto(Book.class)
  );
}
 
开发者ID:danveloper,项目名称:hands-on-ratpack-java,代码行数:11,代码来源:DefaultBookRepository.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java RegisterTCP类代码示例发布时间:2022-05-22
下一篇:
Java SegmentTemplate类代码示例发布时间: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