Type a Serializable request object with a pinned serialVersionUID
Type a Serializable request object with a pinned serialVersionUID
Answer
public class PrimeRequest implements Serializable { private static final long serialVersionUID = 1L; private final long low; private final long high; public PrimeRequest(long low, long high) { this.low = low; this.high = high; } }
Serializable is what lets this cross the wire; the explicit serialVersionUID stops an unrelated edit on one side from breaking deserialisation on the other. Final fields make the copy semantics harmless — there is nothing to mutate and expect back.
JDK javadoc java.rmi; java.io.Serializable