Beispiel #1
0
  private static void connectCallbackHandler(String moduleName, boolean isConnect) {
    Iterator iter = (isConnect ? connectHandlers.iterator() : disconnectHandlers.iterator());

    while (iter.hasNext()) {
      CONNECT_HANDLE_TYPE handler = (CONNECT_HANDLE_TYPE) iter.next();
      handler.handle(moduleName);
    }
  }
Beispiel #2
0
  private static boolean removeFromHandlerList(List list, Class handlerClass) {
    boolean found = false;
    Iterator iter = list.iterator();

    /* Do it this way because multiple handlers can be subscribed  */
    while (iter.hasNext() && !found) {
      found = (iter.next().getClass() == handlerClass);
      if (found) iter.remove();
    }
    return found;
  }
Beispiel #3
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);
    }
  }