/** * Resets the state of this Unit of Work, by setting its phase to {@code NOT_STARTED}, replacing the message * of this Unit of Work with given {@code message}, and clearing its collection of registered handlers. * * @param message the new Message that is about to be processed. */ public void reset(T message) { if (processingContext == null) { processingContext = new MessageProcessingContext<>(message); } else { processingContext.reset(message); } setPhase(Phase.NOT_STARTED); resources().clear(); correlationDataProviders().clear(); }
/** * Resets the state of this Unit of Work, by setting its phase to {@code NOT_STARTED}, replacing the message * of this Unit of Work with given {@code message}, and clearing its collection of registered handlers. * * @param message the new Message that is about to be processed. */ public void reset(T message) { if (processingContext == null) { processingContext = new MessageProcessingContext<>(message); } else { processingContext.reset(message); } setPhase(Phase.NOT_STARTED); resources().clear(); correlationDataProviders().clear(); }
/** * Resets the state of this Unit of Work, by setting its phase to {@code NOT_STARTED}, replacing the message * of this Unit of Work with given {@code message}, and clearing its collection of registered handlers. * * @param message the new Message that is about to be processed. */ public void reset(T message) { if (processingContext == null) { processingContext = new MessageProcessingContext<>(message); } else { processingContext.reset(message); } setPhase(Phase.NOT_STARTED); resources().clear(); correlationDataProviders().clear(); }