Show TOC Start of Content Area

Background documentation Types of Messages  Locate the document in its SAP Library 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:

RTMFSuccessMessage message = RTMFMessageFactory
    .getMessage(RTMFMessageType.
RTMFSuccessMessageType);

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.

Checking a Message's Type

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

if (message.getClass().equals(RTMFErrorMessage.class)) {

 

    // ... Error Routine

 

}

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

End of Content Area