예제 #1
0
 private WebSocketReplyData subscribe(int requestId) {
   CommandHistoryRequestManager chrm = processor.getCommandHistoryManager();
   if (chrm != null) {
     subscriptionId = chrm.subscribeCommandHistory(null, 0, this);
   }
   return toAckReply(requestId);
 }
예제 #2
0
 /** called when the socket is closed */
 @Override
 public void quit() {
   if (subscriptionId == -1) return;
   CommandHistoryRequestManager chrm = processor.getCommandHistoryManager();
   if (chrm != null) {
     chrm.unsubscribeCommandHistory(subscriptionId);
   }
 }
예제 #3
0
  public void switchYProcessor(YProcessor c) throws YProcessorException {
    if (subscriptionId == -1) return;

    CommandHistoryRequestManager chrm = processor.getCommandHistoryManager();
    CommandHistoryFilter filter = null;
    if (chrm != null) {
      filter = chrm.unsubscribeCommandHistory(subscriptionId);
    }

    this.processor = c;

    if (processor.hasCommanding()) {
      chrm = processor.getCommandHistoryManager();
      if (filter != null) {
        chrm.addSubscription(filter, this);
      } else {
        chrm.subscribeCommandHistory(null, 0, this);
      }
    }
  }