/** * Produces a string representation of the method currently being serviced * by this Handler. * @return A human-readable string representation of the method call. */ public long getRPCPacketLength() { if (getState() != State.RUNNING || packet == null) { // no RPC is currently running, or we don't have an RPC's packet info return -1L; } if (!(packet instanceof WritableWithSize)) { // the packet passed to us doesn't expose size information return -1L; } return ((WritableWithSize) packet).getWritableSize(); }