|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectasynctcp.ASyncTCPMessageHandle
public class ASyncTCPMessageHandle
A handle to a Message
object either currently or previously
enqueued for delivery over TCP.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface async.common.MessageHandle |
---|
MessageHandle.MessageState |
Method Summary | |
---|---|
boolean |
cancel()
Cancels the delivery of this message to the remote host, provided that it is still enqueued and is not in the process of being sent or has been sent already. |
Connection |
getConnection()
Returns the Connection in which the message is enqueued or
currently being sent across. |
long |
getEnqueuedTime()
Returns the time, in milliseconds, at which this message was enqueued for delivery. |
MessageHandleListener |
getListener()
Retrieves the listener for this message. |
Message |
getMessage()
Returns the message for which this MessageHandle instance
is a handle. |
ASyncTCPMessageQueue |
getMessageQueue()
Returns the message queue in which this message handle is or was once enqueued. |
int |
getQueuePosition()
Returns the position of this message in whatever queue it belongs to, provided the state of this handle is ENQUEUED . |
long |
getSendingTime()
Returns the time, in milliseconds, at which this message began sending. |
long |
getSentTime()
Returns the time, in milliseconds, at which this message was sent in its entirety. |
MessageHandle.MessageState |
getState()
Returns the state of this message. |
boolean |
moveBackward()
Moves this message one position backward in the queue. |
boolean |
moveForward()
Moves this message one position forward in the queue. |
MessageHandleListener |
setListener(MessageHandleListener _mhl)
Sets mhl as the listener on this message. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public MessageHandle.MessageState getState()
MessageHandle
getState
in interface MessageHandle
public Message getMessage()
MessageHandle
MessageHandle
instance
is a handle.
getMessage
in interface MessageHandle
public ASyncTCPMessageQueue getMessageQueue()
MessageHandle
getMessageQueue
in interface MessageHandle
public boolean cancel()
MessageHandle
cancel
in interface MessageHandle
true
if this message was enqueued but is now
canceled, false
otherwisepublic int getQueuePosition()
MessageHandle
ENQUEUED
. The next
message to be sent in a queue has a position of 0
.
getQueuePosition
in interface MessageHandle
-1
if not enqueuedpublic long getEnqueuedTime()
MessageHandle
getEnqueuedTime
in interface MessageHandle
public long getSendingTime()
MessageHandle
getSendingTime
in interface MessageHandle
public long getSentTime()
MessageHandle
getSentTime
in interface MessageHandle
-1
if it has
not yet been sentpublic MessageHandleListener getListener()
MessageHandle
getListener
in interface MessageHandle
null
if
there is no listenerpublic MessageHandleListener setListener(MessageHandleListener _mhl)
MessageHandle
mhl
as the listener on this message. The listener can
later be retrieved via the getListener
method. Only one
listener may be set at a time; invoking this method causes any previous
listener to be discarded. The current listener may be discarded by
passing in null
.
setListener
in interface MessageHandle
_mhl
- the new listener for this message
null
public boolean moveForward()
MessageHandle
false
.
moveForward
in interface MessageHandle
true
if this message is moved forward in the
queue, false
otherwisepublic boolean moveBackward()
MessageHandle
false
.
moveBackward
in interface MessageHandle
true
if this message is moved backward in the
queue, false
otherwisepublic Connection getConnection()
Connection
in which the message is enqueued or
currently being sent across.
Connection
object this message is enqueued or
sending across, null
otherwise
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |