org.infinispan.commons.util.Util.rewrapAsCacheException()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(2.3k)|赞(0)|评价(0)|浏览(130)

本文整理了Java中org.infinispan.commons.util.Util.rewrapAsCacheException()方法的一些代码示例,展示了Util.rewrapAsCacheException()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.rewrapAsCacheException()方法的具体详情如下:
包路径:org.infinispan.commons.util.Util
类名称:Util
方法名:rewrapAsCacheException

Util.rewrapAsCacheException介绍

暂无

代码示例

代码示例来源:origin: org.infinispan/infinispan-core

@Override
public final Map<Address, Response> invokeRemotely(Map<Address, ReplicableCommand> rpcs, RpcOptions options) {
 try {
   rpcs.forEach((address, command) -> setTopologyId(command));
   return CompletableFutures.await(
    invokeCommands(rpcs.keySet(), rpcs::get, MapResponseCollector.validOnly(rpcs.size()), options)
      .toCompletableFuture());
 } catch (ExecutionException | InterruptedException e) {
   throw Util.rewrapAsCacheException(e);
 }
}

代码示例来源:origin: org.infinispan/infinispan-core

@Override
public Map<Address, Response> invokeRemotely(Collection<Address> recipients, ReplicableCommand rpcCommand,
                      ResponseMode mode, long timeout, ResponseFilter responseFilter,
                      DeliverOrder deliverOrder, boolean anycast) throws Exception {
 Collection<Address> targets = recipients != null ? recipients : members;
 MapResponseCollector collector = MapResponseCollector.ignoreLeavers(shouldIgnoreLeavers(mode), targets.size());
 CompletableFuture<Map<Address, Response>> rpcFuture = blockRequest(rpcCommand, collector);
 if (mode.isAsynchronous()) {
   return Collections.emptyMap();
 } else {
   try {
    return rpcFuture.get(10, TimeUnit.SECONDS);
   } catch (ExecutionException e) {
    throw Util.rewrapAsCacheException(e.getCause());
   }
 }
}

代码示例来源:origin: org.infinispan/infinispan-server-hotrod

/**
* Rollbacks a transaction that is remove in all the cluster members.
*/
public final void rollbackRemoteTransaction(GlobalTransaction gtx) {
 RpcManager rpcManager = cache.getRpcManager();
 CommandsFactory factory = cache.getComponentRegistry().getCommandsFactory();
 try {
   RollbackCommand rollbackCommand = factory.buildRollbackCommand(gtx);
   rollbackCommand.setTopologyId(rpcManager.getTopologyId());
   CompletionStage<Void> cs = rpcManager
      .invokeCommandOnAll(rollbackCommand, validOnly(), rpcManager.getSyncRpcOptions());
   factory.initializeReplicableCommand(rollbackCommand, false);
   rollbackCommand.invokeAsync().join();
   cs.toCompletableFuture().join();
 } catch (Throwable throwable) {
   throw Util.rewrapAsCacheException(throwable);
 } finally {
   forgetTransaction(gtx, rpcManager, factory);
 }
}

相关文章