public void run() { final DataByteArrayOutputStream baos = new DataByteArrayOutputStream(); try { baos.writeInt(0); // make space for the size field. baos.writeVarLong(correlation); } catch (IOException e) { // should not happen LOGGER.error("Failed to write to buffer",e); throw new RuntimeException(e); } // Lets decode the remaining args on the target's executor // to take cpu load off the ClassLoader loader = holder==null ? getClass().getClassLoader() : holder.loader; methodData.invocationStrategy.service(methodData.serializationStrategy, loader, methodData.method, svc, bais, baos, new Runnable() { public void run() { if(holder!=null) holder.factory.unget(); final Buffer command = baos.toBuffer(); // Update the size field. BufferEditor editor = command.buffer().bigEndianEditor(); editor.writeInt(command.length); queue().execute(new Runnable() { public void run() { transport.offer(command); } }); } }); } }
public void run() { final DataByteArrayOutputStream baos = new DataByteArrayOutputStream(); try { baos.writeInt(0); // make space for the size field. baos.writeVarLong(correlation); } catch (IOException e) { // should not happen throw new RuntimeException(e); } // Lets decode the remaining args on the target's executor // to take cpu load off the methodData.invocationStrategy.service(methodData.serializationStrategy, holder.loader, methodData.method, svc, bais, baos, new Runnable() { public void run() { holder.factory.unget(); final Buffer command = baos.toBuffer(); // Update the size field. BufferEditor editor = command.buffer().bigEndianEditor(); editor.writeInt(command.length); queue().execute(new Runnable() { public void run() { transport.offer(command); } }); } }); } };
baos.writeVarLong(correlation); writeBuffer(baos, service);
baos.writeVarLong(correlation); writeBuffer(baos, service);