Show TOC

Background documentationTypes of Messages Locate this document in the navigation structure

 

Different message types are represented by different Java classes, with RTMFMessage the parent class of all other message classes.

You can create the following types of messages by specifying an RTMFMessageType constant when creating the message:

Type of Message

Constant for Creating Message

Java Class

Standard

RTMFMessageType

RTMFMessage

Success

RTMFSuccessMessageType

RTMFSuccessMessage

Error

RTMFErrorMessageType

RTMFErrorMessage

For example, the following creates a success message:

Syntax Syntax

  1. RTMFSuccessMessage message = RTMFMessageFactory.getMessage(RTMFMessageType.RTMFSuccessMessageType);
End of the code.

Note Note

The RTMFClusterMessage message type, which is created with a standard constructor, is only available within an RTMF service. For more information, see Synchronizing Services.

End of the note.
Checking a Message's Type

To check a message's type, check the message's class, as follows:

Syntax Syntax

  1. if (message.getClass().equals(RTMFErrorMessage.class)) {
    
    
  2. 	// ... Error Routine
    
    
  3. }
End of the code.

In addition, the method getMessageType() returns the name of the object's class.