![JAR search and dependency download from the Maven repository](/logo.png)
org.infinispan.server.resp.commands.Resp3Command Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of infinispan-server-resp Show documentation
Show all versions of infinispan-server-resp Show documentation
Infinispan Resp Protocol Server
package org.infinispan.server.resp.commands;
import java.util.List;
import java.util.concurrent.CompletionException;
import java.util.concurrent.CompletionStage;
import org.infinispan.commons.CacheException;
import org.infinispan.server.resp.Resp3Handler;
import org.infinispan.server.resp.RespErrorUtil;
import org.infinispan.server.resp.RespRequestHandler;
import io.netty.channel.ChannelHandlerContext;
public interface Resp3Command {
CompletionStage perform(Resp3Handler handler, ChannelHandlerContext ctx, List arguments);
default CompletionStage handleException(Resp3Handler handler, Throwable t) {
Throwable ex = t;
if (t instanceof CompletionException) {
ex = t.getCause();
}
if (ex instanceof CacheException) {
ex = ex.getCause();
}
if (ex instanceof ClassCastException) {
RespErrorUtil.wrongType(handler.allocator());
return handler.myStage();
}
if (ex instanceof IndexOutOfBoundsException) {
RespErrorUtil.indexOutOfRange(handler.allocator());
return handler.myStage();
}
throw new RuntimeException(t);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy