Пример #1
0
  @Override
  public void send(Requestable<? extends Response> request) throws IOException {
    synchronized (_monitor) {
      if (isNew()) {
        start();
      }
    }

    if (isClose()) {
      logger.debug("{} Send message,but closed", _key.toString());
      throw new IOException("Session already closed,not send message.");
    }
    if (isAccess(request.getMessageType())) {
      _messageProcess.sendProcess(this, request, _generator);
      if (isRequestMessage(request.getMessageType())) {
        _lastClientRequestTime = System.currentTimeMillis();
        heartbeatTouch();
      }
    } else {
      logger.debug("{} not access cti server.", _key.toString());
      throw new SessionAccessException(_key);
    }
  }
Пример #2
0
 @Override
 protected boolean isSend(Requestable<? extends Response> request) {
   return CallHold.isRequest(request.getMessageType());
 }