|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jboss.errai.bus.client.api.base.CommandMessage
org.jboss.errai.bus.client.api.base.ConversationMessage
public class ConversationMessage
A message that is automatically routed back to the originating bus of a reference message (usually called the incoming message). When a ConversationMessage is dispatched, it will only be delivered to the bus that the incoming message originated from.
public class SomeService implements MessageCallback { public void callback(CommandMessage message) { ConversationMessage.create(message) // create a ConversationMessage that // references the incoming message .setSubject("ClientService") // specify the service on the sending // bus that should receive the message .set("Text", "Hello, World!").sendNowWith(messageBusInstance); // send // the // message } }It is possible for a message sender to specify a
ReplyTo
message component, which by default will be used to route the message. We
refer to this as a sender-driven conversation as opposed to a
receiver-driven conversation which is demonstrated in the code
example above.
Method Summary | |
---|---|
static ConversationMessage |
create(Enum<?> commandType,
Message inReplyTo)
Creates a new ConversationMessage with the specified command type and reference message. |
static ConversationMessage |
create(Message inReplyTo)
Creates a new ConversationMessage using an incoming message as a reference. |
static ConversationMessage |
create(String commandType,
Message inReplyTo)
Creates a new ConversationMessage with the specified command type and reference message. |
Methods inherited from class org.jboss.errai.bus.client.api.base.CommandMessage |
---|
addAllParts, addAllProvidedParts, addResources, command, command, commit, copy, copy, copyResource, create, createWithParts, createWithParts, createWithParts, createWithPartsFromRawMap, errorsCall, get, get, getCommandType, getErrorCallback, getParts, getProvidedParts, getResource, getSubject, getValue, hasPart, hasPart, hasResource, isCommited, isFlagSet, remove, remove, sendNowWith, sendNowWith, set, set, setFlag, setParts, setProvidedPart, setProvidedPart, setResource, toString, toSubject, unsetFlag |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
---|
public static ConversationMessage create(Message inReplyTo)
inReplyTo
- the incoming message.
inReplyTo
message.public static ConversationMessage create(Enum<?> commandType, Message inReplyTo)
commandType
- The command type for this message. Command is an optional
extension for creating services that can respond to different
specific commands. Must not be null.inReplyTo
- the incoming message. Must not be null.public static ConversationMessage create(String commandType, Message inReplyTo)
commandType
- The command type for this message. Command is an optional
extension for creating services that can respond to different
specific commands. Must not be null.inReplyTo
- the incoming message. Must not be null.
|
Errai 3.0.1-SNAPSHOT | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |