|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.inspirel.yami.IncomingMessage
public class IncomingMessage
Incoming message.
The handler allowing to inspect the details of the incoming message and sent back replies or rejection notifications.
The user code interacts with objects of this type mainly in callbacks that are provided during object registration and that are later called back when the incoming message arrives. The handler objects can be stored aside for further processing even after the callback returns, but should no be used after the agent itself is closed.
Note: The objects of this class are not supposed to be used from multiple threads.
Method Summary | |
---|---|
java.lang.String |
getMessageName()
Get the message name. |
java.lang.String |
getObjectName()
Get the destination object name. |
Parameters |
getParameters()
Get the message parameters (message body). |
byte[] |
getRawContent()
Get the message raw (binary) content. |
java.lang.String |
getSource()
Get the target name of the message sender (the message source). |
void |
reject(java.lang.String reason)
Send back the rejection (exception) notification with default (lowest) priority. |
void |
reject(java.lang.String reason,
int priority)
Send back the rejection (exception) notification with given priority. |
void |
reply(YAMISerializable replyBody)
Send back the reply with default (lowest) priority. |
void |
reply(YAMISerializable replyBody,
int priority)
Send back the reply with given priority. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public java.lang.String getSource()
public java.lang.String getObjectName()
public java.lang.String getMessageName()
public Parameters getParameters()
public byte[] getRawContent()
BadStateException
- if the agent was not configured
for raw content deliverypublic void reply(YAMISerializable replyBody) throws YAMIIOException
replyBody
- the content of the reply
(it can be null, in which case the empty object is sent)
YAMIIOException
- if the reply channel cannot be establishedpublic void reply(YAMISerializable replyBody, int priority) throws YAMIIOException
replyBody
- the content of the reply
(it can be null, in which case the empty object is sent)priority
- the priority of reply
YAMIIOException
- if the reply channel cannot be establishedpublic void reject(java.lang.String reason) throws YAMIIOException
reason
- arbitrary text that will be visible by the
original sender as a reason for rejection
YAMIIOException
- if the reply channel cannot be establishedpublic void reject(java.lang.String reason, int priority) throws YAMIIOException
reason
- arbitrary text that will be visible by the
original sender as a reason for rejectionpriority
- the priority of rejection
YAMIIOException
- if the reply channel cannot be established
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |