All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class com.ibm.aglet.ReplySet

java.lang.Object
   |
   +----com.ibm.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.hasMoreFutureReplies()) {
       FutureReply future = set.getNextFutureReply();
       Object reply = future.getReply();
       System.out.println("No[" + i + "] = " + reply);
   }
 

See Also:
multicastMessage, Message, FutureReply

Constructor Index

 o ReplySet()
Constructs a ReplySet object.

Method Index

 o addFutureReply(FutureReply)
Adds the FutureReplyd object to this ReplySet.
 o areAllAvailable()
Checks if all FutureReply objects in this ReplySet have received replies.
 o countAvailable()
Counts the number of available replies in this ReplySet.
 o countUnavailable()
Counts the number of FutureReply objects which have no reply available.
 o done(FutureReply)
Is is not normally used by the aglet programmers.
 o getNextFutureReply()
Gets the next FutureReply whose reply is available.
 o hasMoreFutureReplies()
Checks if there are more FutureReply objects in this ReplySet object.
 o isAnyAvailable()
Checks if there is any FutureReply object whose reply is available in this ReplySet object.
 o waitForAllReplies()
Waits until the all replies are available.
 o waitForAllReplies(long)
Waits until the all replies are available
 o waitForNextFutureReply()
Waits until the next reply is available.
 o waitForNextFutureReply(long)
Waits until the next reply is available.

Constructors

 o ReplySet
 public ReplySet()
Constructs a ReplySet object.

Methods

 o hasMoreFutureReplies
 public synchronized boolean hasMoreFutureReplies()
Checks if there are more FutureReply objects in this ReplySet object.

Returns:
true if there are FutureReply objects
 o isAnyAvailable
 public boolean isAnyAvailable()
Checks if there is any FutureReply object whose reply is available in this ReplySet object.

Returns:
true if there are FutureReply objects whose reply is available.
 o 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
 o countAvailable
 public int countAvailable()
Counts the number of available replies in this ReplySet.

Returns:
the number of available replise
 o 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.
 o waitForNextFutureReply
 public synchronized void waitForNextFutureReply()
Waits until the next reply is available.

 o waitForNextFutureReply
 public synchronized void waitForNextFutureReply(long timeout)
Waits until the next reply is available.

Parameters:
timeout - the maximum time to wait in milliseconds.
 o waitForAllReplies
 public synchronized void waitForAllReplies()
Waits until the all replies are available.

 o waitForAllReplies
 public synchronized void waitForAllReplies(long timeout)
Waits until the all replies are available

Parameters:
timeout - the maximum time to wait in milliseconds.
 o getNextFutureReply
 public synchronized FutureReply getNextFutureReply()
Gets the next FutureReply whose reply is available.

Returns:
a FutureReply object whose reply is available.
 o addFutureReply
 public synchronized void addFutureReply(FutureReply reply)
Adds the FutureReplyd object to this ReplySet.

Parameters:
reply - the FutureReply to add.
 o 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