public CacheRpcCommand readObject(ObjectInput input) throws IOException, ClassNotFoundException {
byte type = input.readByte();
byte methodId = (byte) input.readShort();
String cacheName = input.readUTF();
ComponentRegistry registry = gcr.getNamedComponentRegistry(cacheName);
StreamingMarshaller marshaller;
if (registry == null) {
// Even though the command is directed at a cache, it could happen
// that the cache is not yet started, so fallback on global marshaller.
marshaller = gcr.getComponent(
StreamingMarshaller.class, KnownComponentNames.GLOBAL_MARSHALLER);
} else {
marshaller = registry.getComponent(
StreamingMarshaller.class, KnownComponentNames.CACHE_MARSHALLER);
}
byte[] paramsRaw = new byte[UnsignedNumeric.readUnsignedInt(input)];
// This is not ideal cos it forces the code to read all parameters into