/** * Swaps the state that makes this routable unique to another routable. The state is what identifies a routable for * message bus, so only one message can ever have the same state. This function must be called explicitly when * cloning and copying messages. * * @param rhs The routable to swap state with. */ public void swapState(Routable rhs) { Object context = this.context; this.context = rhs.context; rhs.context = context; callStack.swap(rhs.getCallStack()); trace.swap(rhs.getTrace()); }