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


Java Blocking类代码示例

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


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


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