Ejemplo n.º 1
0
  public static int subscribeData(String msgName, HANDLER_TYPE msgHandler, Class dataClass) {
    /* Do it this way because multiple handlers can be subscribed
    for the same message */
    String handlerName = msgName + msgHandler.getClass().getName();
    int handlerNum = ++handlerNumber;
    String hashKey = Integer.toString(handlerNum);

    msgHashTable.put(handlerName, hashKey);
    msgHashTable.put(hashKey, new handlerHashData(msgHandler, dataClass));

    return IPC_subscribe(msgName, handlerName, handlerNum);
  }
Ejemplo n.º 2
0
 public static int unsubscribe(String msgName, HANDLER_TYPE msgHandler) {
   return unsubscribe(msgName, msgHandler.getClass());
 }