Exemplo n.º 1
0
  /** Write the message with attributes and set the result. */
  @Override
  public void run() throws IOException {
    MessageWriter writer = scon.startMessage(T_BINDER_UPDATE);
    writer.writeAttribute(A_PAGE_ID, pageId);
    if (isToRemovePage) {
      writer.writeAttribute(A_REMOVE, "YES");
    }
    addStandardAttributes(writer);
    writer.endElement();
    writer.close();
    Log.print("(TaskBinderUpdate.run) page=" + pageId + " isToRemovePage=" + isToRemovePage);

    Element reply = scon.receiveMessage();

    String ok = reply.getNodeName();

    if (!T_OK.equals(ok) && !T_FAIL.equals(ok)) {
      Log.quit("BatchBoundary unexpected message type: " + ok);
    }
  }
Exemplo n.º 2
0
  /** Write the message with attributes and set the result. */
  @Override
  public void run() throws IOException {

    MessageWriter writer = scon.startMessage(T_USERS_DATA);
    writer.encode(UsersData.class, usersData);
    writer.endElement();
    writer.close();

    Element reply = scon.receiveMessage();
    String ok = reply.getNodeName();
    // Log.print("T_USERS_DATA reply " + ok);
    setResult((Object) ok);

    if (!T_OK.equals(ok) && !T_FAIL.equals(ok)) {
      //    Log.quit("SendUsersData unexpected message type: "+ok);
      JOptionPane.showMessageDialog(
          null,
          "Duplicate User Id." + "\n\nPlease re-enter user data.",
          "Error",
          JOptionPane.ERROR_MESSAGE);
      return;
    }
  }