
org.infinispan.commands.remote.SingleRpcCommand Maven / Gradle / Ivy
package org.infinispan.commands.remote;
import java.io.IOException;
import java.io.ObjectInput;
import java.io.ObjectOutput;
import java.util.concurrent.CompletableFuture;
import org.infinispan.commands.ReplicableCommand;
import org.infinispan.context.InvocationContext;
import org.infinispan.util.ByteString;
/**
* Aggregates a single command for replication.
*
* @author [email protected]
*/
public class SingleRpcCommand extends BaseRpcInvokingCommand {
public static final int COMMAND_ID = 1;
private ReplicableCommand command;
private SingleRpcCommand() {
super(null); // For command id uniqueness test
}
public SingleRpcCommand(ByteString cacheName, ReplicableCommand command) {
super(cacheName);
this.command = command;
}
public SingleRpcCommand(ByteString cacheName) {
super(cacheName);
}
@Override
public byte getCommandId() {
return COMMAND_ID;
}
@Override
public void writeTo(ObjectOutput output) throws IOException {
output.writeObject(command);
}
@Override
public void readFrom(ObjectInput input) throws IOException, ClassNotFoundException {
command = (ReplicableCommand) input.readObject();
}
@Override
public Object perform(InvocationContext ctx) throws Throwable {
throw new UnsupportedOperationException();
}
@Override
public CompletableFuture
© 2015 - 2025 Weber Informatics LLC | Privacy Policy