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); } }
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; }
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); } }