ibis.mpj
Class Request

java.lang.Object
  extended by ibis.mpj.Request
Direct Known Subclasses:
Prequest

public class Request
extends Object

Request class for basic point-to-point communication.


Constructor Summary
Request()
           
 
Method Summary
 boolean isVoid()
           
 void setIbisMPJComm(IbisMPJComm ibisMPJComm)
           
 Status test()
          Returns a status object if the operation identified by the request is complete, or a null reference otherwise.
static Status[] testAll(Request[] arrayOfRequests)
          Tests for completion of all of the operations associated with active requests.
static Status testAny(Request[] arrayOfRequests)
          Tests for completion of either one or none of the operations associated with active requests.
static Status[] testSome(Request[] arrayOfRequests)
          Behaves like waitSome, except that it returns immediately.
 Status Wait()
          Blocks until the operation identified by the request is complete.
static Status[] waitAll(Request[] arrayOfRequests)
          Blocks until all of the operations associated with the active requests in the array have completed.
static Status waitAny(Request[] arrayOfRequests)
          Blocks until one of the operations associated with the active requests in the array has completed.
static Status[] waitSome(Request[] arrayOfRequests)
          Blocks until at least one of the operations associated with the active requests in the array has completed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Request

public Request()
Method Detail

setIbisMPJComm

public void setIbisMPJComm(IbisMPJComm ibisMPJComm)

Wait

public Status Wait()
            throws MPJException
Blocks until the operation identified by the request is complete. After the call returns, the request object becomes inactive.

Returns:
status object
Throws:
MPJException

test

public Status test()
            throws MPJException
Returns a status object if the operation identified by the request is complete, or a null reference otherwise. After the call, if the operation is complete (ie, if the return value of test is non-null), the request object becomes an inactive request.

Returns:
status object
Throws:
MPJException

isVoid

public boolean isVoid()
               throws MPJException
Throws:
MPJException

waitAny

public static Status waitAny(Request[] arrayOfRequests)
                      throws MPJException
Blocks until one of the operations associated with the active requests in the array has completed. The corresponding element of arrayOfRequests becomes inactive.

Parameters:
arrayOfRequests - array of requests
Returns:
status object
Throws:
MPJException

testAny

public static Status testAny(Request[] arrayOfRequests)
                      throws MPJException
Tests for completion of either one or none of the operations associated with active requests. If some request completed, the index in arrayOfRequests of that request can be obtained from the status object. If no request completed, testAny returns a null reference.

Parameters:
arrayOfRequests - array of requests
Returns:
status object or null reference
Throws:
MPJException

waitAll

public static Status[] waitAll(Request[] arrayOfRequests)
                        throws MPJException
Blocks until all of the operations associated with the active requests in the array have completed. The result array will be the same size as arrayOfRequests. On exit, requests become inactive. If the input value of arrayOfRequests contains any inactive requests, corresponding elements of the result array will contain null status references.

Parameters:
arrayOfRequests - array of requests
Returns:
array of status objects, or a null reference
Throws:
MPJException

testAll

public static Status[] testAll(Request[] arrayOfRequests)
                        throws MPJException
Tests for completion of all of the operations associated with active requests. If all operations have completed, the exit values of the argument array and the result array are as for waitAll. If any operation has not completed, the result value is null and no element of the argument array is modified.

Parameters:
arrayOfRequests - array of requests
Returns:
array of status objects, or a null reference
Throws:
MPJException

waitSome

public static Status[] waitSome(Request[] arrayOfRequests)
                         throws MPJException
Blocks until at least one of the operations associated with the active requests in the array has completed. The correspondig element in arrayOfRequests becomes inactive. If arrayOfRequests list contains no active requests, waitSome immediately returns a null reference.

Parameters:
arrayOfRequests - array of requests
Returns:
array of status objects, or a null reference
Throws:
MPJException

testSome

public static Status[] testSome(Request[] arrayOfRequests)
                         throws MPJException
Behaves like waitSome, except that it returns immediately. If no operation has completed, testSome returns an array of length zero and elements of arrayOfRequests are unchanged. Otherwise, arguments and return value are as for waitSome.

Parameters:
arrayOfRequests - array of requests
Returns:
array of status objects, or a null reference
Throws:
MPJException


The Ibis project