示例#1
0
  @Override
  public void removeRoomTimer(Long rid) throws ServiceException, ServiceDaoException {

    log.info(rid + " time will be remove ");
    SendMessageTask sm2 = this.roomID_Message.get(rid);
    if (sm2 != null) {
      log.info(sm2.toString());
      sm2.cancel();
    }
    this.roomID_Message.remove(rid);

    log.info(rid + " time message remove sucdess");
  }
示例#2
0
  @Override
  public void nextMessage(Message m) {

    log.info("timer message " + m);
    if (this.roomID_Message.containsKey(Long.valueOf(m.getWhere()))) {

      SendMessageTask old = this.roomID_Message.get(Long.valueOf(m.getWhere()));
      if (old == null) {

      } else {
        log.info("remove old timer");
        old.cancel();
      }
    }
    SendMessageTask sm = new SendMessageTask(pushClient, m, droolsGameMessageService, roomService);
    sm.start();
    this.roomID_Message.put(Long.valueOf(m.getWhere()), sm);
  }