Example #1
0
  /* Looks for finished send communications and updates the pending list. */
  private void testSendRequests() {
    if ((pendingSendRequest != null) && !pendingSendRequest.isEmpty()) {
      Request[] rS = new Request[pendingSendRequest.size()];
      rS = pendingSendRequest.keySet().toArray(rS);

      Status[] status = Request.Testsome(rS);
      for (int i = 0; i < status.length; i++) {
        pendingSendRequest.remove(rS[status[i].index]);
      }
    }
  }
Example #2
0
  /* Returns a list with the delayed migrants and updates the pending list. */
  private List<MigrationObject> testRecvRequests() {

    List<MigrationObject> delayedMigrants = new ArrayList<MigrationObject>();

    if (pendingRecvRequest != null) {
      Request[] rR = new Request[pendingRecvRequest.size()];
      rR = pendingRecvRequest.keySet().toArray(rR);

      Status[] status = Request.Testsome(rR);

      for (int i = 0; i < status.length; i++) {
        Request r = rR[status[i].index];
        MigrationObject delayedMigrant = ((MigrationObject[]) pendingRecvRequest.get(r))[0];
        if (delayedMigrant != null) {
          delayedMigrants.add(delayedMigrant);
        }
        pendingRecvRequest.remove(r);
      }
    }

    return delayedMigrants;
  }