public void close()

in src/main/java/com/aliyun/openservices/aliyun/log/producer/LogProducer.java [426:475]


  public void close(long timeoutMs) throws InterruptedException, ProducerException {
    if (timeoutMs < 0) {
      throw new IllegalArgumentException(
          "timeoutMs must be greater than or equal to 0, got " + timeoutMs);
    }
    ProducerException firstException = null;
    LOGGER.info("Closing the log producer, timeoutMs={}", timeoutMs);
    try {
      timeoutMs = closeMover(timeoutMs);
    } catch (ProducerException e) {
      firstException = e;
    }
    LOGGER.debug("After close mover, timeoutMs={}", timeoutMs);
    try {
      timeoutMs = closeIOThreadPool(timeoutMs);
    } catch (ProducerException e) {
      if (firstException == null) {
        firstException = e;
      }
    }
    LOGGER.debug("After close ioThreadPool, timeoutMs={}", timeoutMs);
    try {
      timeoutMs = closeTimeoutThreadPool(timeoutMs);
    } catch (ProducerException e) {
      if (firstException == null) {
        firstException = e;
      }
    }
    LOGGER.debug("After close timeoutThreadPool, timeoutMs={}", timeoutMs);
    try {
      timeoutMs = closeSuccessBatchHandler(timeoutMs);
    } catch (ProducerException e) {
      if (firstException == null) {
        firstException = e;
      }
    }
    LOGGER.debug("After close success batch handler, timeoutMs={}", timeoutMs);
    try {
      timeoutMs = closeFailureBatchHandler(timeoutMs);
    } catch (ProducerException e) {
      if (firstException == null) {
        firstException = e;
      }
    }
    LOGGER.debug("After close failure batch handler, timeoutMs={}", timeoutMs);
    if (firstException != null) {
      throw firstException;
    }
    LOGGER.info("The log producer has been closed");
  }