|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.rim.device.api.io.messaging.MessageFuture
public final class MessageFuture
Provides a Future
, which allows an application to send a message and receive an object as a placeholder for
the reply. This allows an application to process addtional code after a Message
transmission, but before blocking
the execution thread. When the message response arrives, the data will populate the MessageFuture
.
Invoking either get
method in a MessageFuture
blocks thread execution until the
Message
is available.
Method Summary | ||
---|---|---|
Message |
get()
Return the Message encapsulated by this object. |
|
Message |
get(long timeout)
Returns the Message represented by this future. |
|
boolean |
isCancelled()
Indicates whether or not the message was cancelled. |
|
boolean |
isDone()
Indicates whether the response message was delivered. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public boolean isDone()
true
, invocation of the
get
method will return immmediately.
true
if MessageFuture
contains a message; false
otherwise.get
public boolean isCancelled()
true
if the message was cancelled; false
otherwise.public Message get() throws MessageFailureException
MessageFailureException
isDone
public Message get(long timeout) throws MessageFailureException
Message
represented by this future. If the message has not arrived yet, this call will
block the execution thread until the message arrives, or until the timeout
is reached.
timeout
- Maximum amount of time to wait for message to be delivered in milliseconds.
Message
if one was delivered within the timeout; otherwise null
.
MessageFailureException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright 1999-2010 Research In Motion Limited. 295 Phillip Street, Waterloo, Ontario, Canada, N2L 3W8. All Rights Reserved.
Copyright 1993-2003 Sun Microsystems, Inc. 901 San Antonio Road, Palo Alto, California, 94303, U.S.A. All Rights Reserved.
Copyright 2002-2003 Nokia Corporation All Rights Reserved.
Java is a trademark of Sun Microsystems, Inc.