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


Java CompositeFuture.all方法代码示例

本文整理汇总了Java中io.vertx.core.CompositeFuture.all方法的典型用法代码示例。如果您正苦于以下问题:Java CompositeFuture.all方法的具体用法?Java CompositeFuture.all怎么用?Java CompositeFuture.all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在io.vertx.core.CompositeFuture的用法示例。


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

示例1: closeServiceClients

import io.vertx.core.CompositeFuture; //导入方法依赖的package包/类
private CompositeFuture closeServiceClients() {

        Future<Void> messagingTracker = Future.future();
        if (messaging == null) {
            messagingTracker.complete();
        } else {
            messaging.shutdown(messagingTracker.completer());
        }

        Future<Void> registrationTracker = Future.future();
        if (registration == null) {
            registrationTracker.complete();
        } else {
            registration.shutdown(registrationTracker.completer());
        }

        Future<Void> credentialsTracker = Future.future();
        if (credentialsAuthProvider == null) {
            credentialsTracker.complete();
        } else {
            credentialsTracker = credentialsAuthProvider.stop();
        }
        return CompositeFuture.all(messagingTracker, registrationTracker, credentialsTracker);
    }
 
开发者ID:eclipse,项目名称:hono,代码行数:25,代码来源:AbstractProtocolAdapterBase.java

示例2: getCompositeFuture

import io.vertx.core.CompositeFuture; //导入方法依赖的package包/类
/**
 * Gets a composite future using a future for each verticle to be deployed. This composite
 * future is successful if all verticles deployed and fails if any verticle fails to deploy.
 * @return The composite future
 */
private CompositeFuture getCompositeFuture() {
    List<Future<String>> futures = new ArrayList<>();
    dependentsDeployment.getConfigurations().forEach(cfg -> futures.addAll(getFutures(cfg)));

    return CompositeFuture.all(new ArrayList<>(futures));
}
 
开发者ID:juanavelez,项目名称:vertx-dependent-verticle-deployer,代码行数:12,代码来源:DependentVerticleDeployer.java

示例3: startImport

import io.vertx.core.CompositeFuture; //导入方法依赖的package包/类
private CompositeFuture startImport(EthBlock fullBlock) {
    StorableBlock block = new StorableBlock(fullBlock.getBlock());
    listener.onImportStarted(block.getHash(), block.getNumber());
    return CompositeFuture.all(
            importBlocks(block),
            importTx(block, getTransactionList(fullBlock))
    );
}
 
开发者ID:codingchili,项目名称:ethereum-ingest,代码行数:9,代码来源:BlockService.java

示例4: deployServiceVerticles

import io.vertx.core.CompositeFuture; //导入方法依赖的package包/类
private CompositeFuture deployServiceVerticles() {
    final int maxInstances = config.getMaxInstances();

    @SuppressWarnings("rawtypes")
    final List<Future> deploymentTracker = new ArrayList<>();

    for (ObjectFactory<? extends AbstractServiceBase<?>> serviceFactory : serviceFactories) {

        AbstractServiceBase<?> serviceInstance = serviceFactory.getObject();

        healthCheckServer.registerHealthCheckResources(serviceInstance);

        final Future<String> deployTracker = Future.future();
        vertx.deployVerticle(serviceInstance, deployTracker.completer());
        deploymentTracker.add(deployTracker);

        for (int i = 1; i < maxInstances; i++) { // first instance has already been deployed
            serviceInstance = serviceFactory.getObject();
            log.debug("created new instance of service: {}", serviceInstance);
            final Future<String> tracker = Future.future();
            vertx.deployVerticle(serviceInstance, tracker.completer());
            deploymentTracker.add(tracker);
        }
    }

    return CompositeFuture.all(deploymentTracker);
}
 
开发者ID:eclipse,项目名称:hono,代码行数:28,代码来源:AbstractApplication.java

示例5: deployVerticles

import io.vertx.core.CompositeFuture; //导入方法依赖的package包/类
private Future deployVerticles(AbstractVerticle... verticles) {


        Stream<AbstractVerticle> stream = Arrays.stream(verticles);

        List<Future> futures = stream
                .map(verticle -> {

                    Future<String> future = Future.<String>future();

                    vertx.deployVerticle(verticle, future.completer());

                    return future;
                })
                .map(future -> (Future) future)
                .collect(toList());

        return CompositeFuture.all(futures);

    }
 
开发者ID:ftrossbach,项目名称:kiqr,代码行数:21,代码来源:RuntimeVerticle.java

示例6: start

import io.vertx.core.CompositeFuture; //导入方法依赖的package包/类
@Override
public void start(Future<Void> startPromise) {
    VertxResteasyDeployment deployment = new VertxResteasyDeployment();
    deployment.start();

    deployment.getProviderFactory().registerProvider(DefaultExceptionMapper.class);
    deployment.getProviderFactory().registerProvider(JacksonConfig.class);

    if (enableRbac) {
        log.info("Enabling RBAC for REST API");
        deployment.getProviderFactory().registerProviderInstance(new AuthInterceptor(kubernetes));
    } else {
        log.info("Disabling authentication and authorization for REST API");
        deployment.getProviderFactory().registerProviderInstance(new AllowAllAuthInterceptor());
    }

    deployment.getRegistry().addSingletonResource(new SwaggerSpecEndpoint());
    deployment.getRegistry().addSingletonResource(new HttpAddressService(addressSpaceApi));
    deployment.getRegistry().addSingletonResource(new HttpSchemaService());
    deployment.getRegistry().addSingletonResource(new HttpAddressSpaceService(addressSpaceApi, kubernetes.getNamespace()));
    deployment.getRegistry().addSingletonResource(new HttpHealthService());
    deployment.getRegistry().addSingletonResource(new HttpV1RootService());
    deployment.getRegistry().addSingletonResource(new HttpRootService());
    deployment.getRegistry().addSingletonResource(new HttpAddressRootService(addressSpaceApi));

    deployment.getRegistry().addSingletonResource(new OSBCatalogService(addressSpaceApi, kubernetes.getNamespace()));
    deployment.getRegistry().addSingletonResource(new OSBProvisioningService(addressSpaceApi, kubernetes.getNamespace()));
    deployment.getRegistry().addSingletonResource(new OSBBindingService(addressSpaceApi, kubernetes.getNamespace()));
    deployment.getRegistry().addSingletonResource(new OSBLastOperationService(addressSpaceApi, kubernetes.getNamespace()));

    VertxRequestHandler requestHandler = new VertxRequestHandler(vertx, deployment);

    Future<Void> secureReady = Future.future();
    Future<Void> openReady = Future.future();
    CompositeFuture readyFuture = CompositeFuture.all(secureReady, openReady);
    readyFuture.setHandler(result -> {
        if (result.succeeded()) {
            startPromise.complete();
        } else {
            startPromise.fail(result.cause());
        }
    });

    createSecureServer(requestHandler, secureReady);
    createOpenServer(requestHandler, openReady);
}
 
开发者ID:EnMasseProject,项目名称:enmasse,代码行数:47,代码来源:HTTPServer.java


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