예제 #1
0
  private static void fdCallbackHandler(int fd) {
    FD_HANDLER_TYPE handler = (FD_HANDLER_TYPE) fdHashTable.get(Integer.toString(fd));

    if (handler != null) {
      handler.handle(fd);
    } else System.out.println("Ooops -- no handler for fd");
  }
예제 #2
0
  private static void timerCallbackHandler(int handlerNum, long currentTime, long scheduledTime) {
    TIMER_HANDLER_TYPE handler =
        (TIMER_HANDLER_TYPE) timerHashTable.get(Integer.toString(handlerNum));

    if (handler != null) {
      handler.handle(currentTime, scheduledTime);
    } else System.out.println("Ooops -- no handler for timer");
  }
예제 #3
0
  private static void queryNotifyCallbackHandler(int handlerNum, int msgInstance, int byteArray) {
    String hashKey = Integer.toString(handlerNum);
    handlerHashData handlerData = (handlerHashData) msgHashTable.get(hashKey);

    msgHashTable.remove(hashKey);
    if (handlerData != null) {
      Object object;
      try {
        object =
            unmarshallMsgData(
                IPC_msgInstanceFormatter(msgInstance), byteArray, handlerData.dataClass);
        handlerData.handler.handle(new MSG_INSTANCE(msgInstance), object);
      } catch (Exception e) {
        handleException("queryNotifyCallbackHandler", IPC_msgInstanceName(msgInstance), e);
      }
    } else
      System.out.println(
          "Ooops -- no query notification handler for " + IPC_msgInstanceName(msgInstance));
  }
예제 #4
0
  private static void changeCallbackHandler(String msgName, int numHandlers) {
    List handlerList = (List) handlerChangeHashTable.get(msgName);
    if (handlerList == null) {
      System.out.println("Ooops -- no change handlers for message " + msgName);
      return;
    }
    Iterator iter = handlerList.iterator();

    while (iter.hasNext()) {
      ((CHANGE_HANDLE_TYPE) iter.next()).handle(msgName, numHandlers);
    }
  }
예제 #5
0
  private static void msgCallbackHandler(int handlerNum, int msgInstance, int byteArray) {
    handlerHashData handlerData = (handlerHashData) msgHashTable.get(Integer.toString(handlerNum));

    if (handlerData != null) {
      Object object;
      try {
        int formatter = IPC_msgInstanceFormatter(msgInstance);
        object = unmarshallMsgData(formatter, byteArray, handlerData.dataClass);
        handlerData.handler.handle(new MSG_INSTANCE(msgInstance), object);
      } catch (Exception e) {
        handleException("msgCallbackHandler", IPC_msgInstanceName(msgInstance), e);
      }
    } else System.out.println("Ooops -- no handler for " + IPC_msgInstanceName(msgInstance));
  }