Documentation of 'edu.rit.mp.IORequest' Java class
IORequest
edu.rit.mp

Class IORequest



  • public class IORequest
    extends java.lang.Object
    Class IORequest encapsulates the state of a message being sent or received in the Message Protocol (MP).

    Class ChannelGroup's non-blocking sendNoWait() method includes an IORequest argument. This allows the caller to initiate the send operation and continue processing while the channel group sends the message in a separate thread. To wait for the message to be sent, the caller must call the IORequest object's waitForFinish() method.

    Class ChannelGroup's non-blocking receiveNoWait() method includes an IORequest argument. This allows the caller to initiate the receive operation and continue processing while the channel group receives the message in a separate thread. To wait for the message to be received, the caller must call the IORequest object's waitForFinish() method, which returns a Status object giving the results of the receive operation.

    • Constructor Summary

      Constructors 
      Constructor and Description
      IORequest()
      Construct a new I/O request object.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      boolean isFinished()
      Determine if this I/O request has finished.
      java.lang.String toString()
      Returns a string version of this I/O request.
      Status waitForFinish()
      Wait until the send or receive operation corresponding to this I/O request has finished.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • IORequest

        public IORequest()
        Construct a new I/O request object.
    • Method Detail

      • isFinished

        public boolean isFinished()
                           throws java.io.IOException
        Determine if this I/O request has finished.
        Returns:
        False if this I/O request has not finished, true if this I/O request has finished successfully.
        Throws:
        java.io.IOException - Thrown if this I/O request has finished and an I/O error occurred.
      • waitForFinish

        public Status waitForFinish()
                             throws java.io.IOException
        Wait until the send or receive operation corresponding to this I/O request has finished. For a receive operation, a Status object containing the results of the receive operation is returned; for a send operation, null is returned.
        Returns:
        Receive status for a receive operation, or null for a send operation.
        Throws:
        java.io.IOException - Thrown if an I/O error occurred.
      • toString

        public java.lang.String toString()
        Returns a string version of this I/O request.
        Overrides:
        toString in class java.lang.Object
        Returns:
        String version.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.