public class PendingMessage extends Object
Constructor and Description |
---|
PendingMessage()
Create a new PendingMessage.
|
PendingMessage(int messageId,
Message message)
Create a new PendingMessage.
|
PendingMessage(int messageId,
Message message,
ReplyCallback replyCallback)
Create a new PendingMessage.
|
Modifier and Type | Method and Description |
---|---|
void |
clear()
Clears the state of the message allowing the referenced objects to be
garbage collected.
|
Message |
getMessage()
Returns the sent message.
|
int |
getMessageId()
Returns the message id assigned to the sent message.
|
ReplyCallback |
getReplyCallback()
Returns the callback for the reply to the message.
|
long |
latency()
Determines the latency of the message in nano-seconds.
|
void |
set(int messageId,
Message message,
ReplyCallback replyCallback)
Sets the state of the pending message.
|
void |
set(PendingMessage other)
Sets the state of the pending message.
|
void |
timestampNow()
Sets the time stamp of the message to now.
|
public PendingMessage()
public PendingMessage(int messageId, Message message)
messageId
- The id assigned to the message.message
- The sent message.public PendingMessage(int messageId, Message message, ReplyCallback replyCallback)
messageId
- The id assigned to the message.message
- The sent message.replyCallback
- The callback for the reply to the message.public void clear()
public Message getMessage()
public int getMessageId()
public ReplyCallback getReplyCallback()
public long latency()
public void set(int messageId, Message message, ReplyCallback replyCallback)
messageId
- The id of the sent message.message
- The sent message.replyCallback
- The callback for the message. May be null.public void set(PendingMessage other)
other
- The pending message to copy from.public void timestampNow()
Copyright © 2011–2014 Allanbank Consulting, Inc.. All rights reserved.