本文整理了Java中org.infinispan.commons.util.Util.rewrapAsCacheException()
方法的一些代码示例,展示了Util.rewrapAsCacheException()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.rewrapAsCacheException()
方法的具体详情如下:
包路径:org.infinispan.commons.util.Util
类名称: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);
}
}
内容来源于网络,如有侵权,请联系作者删除!