Package com.technia.tif.enovia.messaging
Class MessageContextBase<T>
java.lang.Object
com.technia.tif.enovia.messaging.MessageContextBase<T>
- All Implemented Interfaces:
MessageContext<T>
Base implementation of
MessageContext.
This class provides basic storage for a Message and post processing
actions.
- Since:
- 2026.2.0
-
Nested Class Summary
Nested classes/interfaces inherited from interface com.technia.tif.enovia.messaging.MessageContext
MessageContext.AfterCompleteContext -
Constructor Summary
ConstructorsConstructorDescriptionMessageContextBase(T message) Creates a new message context for the given message.MessageContextBase(T message, Exception exception) Creates a new message context for the given message and exception. -
Method Summary
Modifier and TypeMethodDescriptionvoidafterComplete(Consumer<MessageContext.AfterCompleteContext> completionCallback) Sets a callback that is invoked when message processing is complete.List<com.technia.tif.enovia.job.request.JobRequest>Returns child job requests.Returns the callback that is invoked when message processing is complete.Returns the exception that occurred during message processing.Returns the message associated with this context.Returns a creator for creating a new child job.voidsetException(Exception exception) Sets the exception that occurred during message processing.voidsetMessage(T message) Sets the message associated with this context.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.technia.tif.enovia.messaging.MessageContext
resolveMessageText
-
Constructor Details
-
MessageContextBase
Creates a new message context for the given message. Sets the message associated with this context.- Parameters:
message- the received messagemessage- the message
-
MessageContextBase
Creates a new message context for the given message and exception.- Parameters:
message- the received messageexception- the caught exception
-
-
Method Details
-
setMessage
Sets the message associated with this context.- Parameters:
message- the message
-
getMessage
Returns the message associated with this context.- Specified by:
getMessagein interfaceMessageContext<T>- Returns:
- message the message
-
getCompletionCallback
Returns the callback that is invoked when message processing is complete.- Returns:
- the completion callback, or
nullif none is set
-
afterComplete
Sets a callback that is invoked when message processing is complete.- Specified by:
afterCompletein interfaceMessageContext<T>- Parameters:
completeCallback- the callback to invoke upon completion
-
getException
Returns the exception that occurred during message processing.- Specified by:
getExceptionin interfaceMessageContext<T>- Returns:
- the exception associated with the failure
-
setException
Sets the exception that occurred during message processing.- Parameters:
exception- the exception associated with the failure
-
newChildJob
Returns a creator for creating a new child job.- Specified by:
newChildJobin interfaceMessageContext<T>- Returns:
- the creator
-
getChildJobRequests
Returns child job requests.- Returns:
- the list containing child job requests.
-