Class aglet.ReplySet
All Packages Class Hierarchy This Package Previous Next Index
Class aglet.ReplySet
java.lang.Object
|
+----aglet.ReplySet
- public final class ReplySet
- extends Object
ReplySet is a container of the FutureReply objects by which the
each of FutureReply object can be retrieved as its reply become available.
ReplySet set = context.multicastMessage(new Message("multicast"));
set.addFutureReply( aglet.sendAsyncMessage(new Message("additional"));
int i = 0;
whlie(set.hasMoreFutureReply()) {
FutureReply future = set.getNextFutureReply();
Object reply = future.getReply();
System.out.println("No[" + i + "] = " + reply);
}
- See Also:
- multicastMessage, Message, FutureReply
-
ReplySet()
- Constructs a ReplySet object.
-
addFutureReply(FutureReply)
- Adds the FutureReplyd object to this ReplySet.
-
areAllAvailable()
- Checks if all FutureReply objects in this ReplySet have received
replies.
-
countAvailable()
- Counts the number of available replies in this ReplySet.
-
countUnavailable()
- Counts the number of FutureReply objects which have no reply
available.
-
done(FutureReply)
- Is is not normally used by the aglet programmers.
-
getNextFutureReply()
- Gets the next FutureReply whose reply is available.
-
hasMoreFutureReplies()
- Checks if there are more FutureReply objects in this ReplySet object.
-
isAnyAvailable()
- Checks if there are more than one FutureReply objects whose reply is
available in this ReplySet object.
-
waitForAllReplies()
- Waits until the all replies are available
-
waitForAllReplies(long)
- Waits until the all replies are available
-
waitForNextFutureReply()
- Waits until the next reply is available
-
waitForNextFutureReply(long)
- Waits until the next reply is available
ReplySet
public ReplySet()
- Constructs a ReplySet object.
hasMoreFutureReplies
public synchronized boolean hasMoreFutureReplies()
- Checks if there are more FutureReply objects in this ReplySet object.
- Returns:
- true if there are FutureReply objects
isAnyAvailable
public boolean isAnyAvailable()
- Checks if there are more than one FutureReply objects whose reply is
available in this ReplySet object.
- Returns:
- true if there are FutureReply objects whose reply is available.
areAllAvailable
public boolean areAllAvailable()
- Checks if all FutureReply objects in this ReplySet have received
replies.
- Returns:
- true if all replies of FutureReply objects are available
countAvailable
public int countAvailable()
- Counts the number of available replies in this ReplySet.
- Returns:
- the number of available replise
countUnavailable
public int countUnavailable()
- Counts the number of FutureReply objects which have no reply
available.
- Returns:
- the number of FutureReply which have no reply available.
waitForNextFutureReply
public synchronized void waitForNextFutureReply()
- Waits until the next reply is available
waitForNextFutureReply
public synchronized void waitForNextFutureReply(long timeout)
- Waits until the next reply is available
- Parameters:
- timeout - the maximum time to wait in milliseconds.
waitForAllReplies
public synchronized void waitForAllReplies()
- Waits until the all replies are available
waitForAllReplies
public synchronized void waitForAllReplies(long timeout)
- Waits until the all replies are available
- Parameters:
- timeout - the maximum time to wait in milliseconds.
getNextFutureReply
public synchronized FutureReply getNextFutureReply()
- Gets the next FutureReply whose reply is available.
- Returns:
- a FutureReply object whose reply is available.
addFutureReply
public synchronized void addFutureReply(FutureReply reply)
- Adds the FutureReplyd object to this ReplySet.
- Parameters:
- reply - the FutureReply to add.
done
public synchronized void done(FutureReply reply)
- Is is not normally used by the aglet programmers.
All Packages Class Hierarchy This Package Previous Next Index