com.alibaba.dubbo.common.logger.Logger.warn()方法的使用及代码示例

x33g5p2x  于2022-01-23 转载在 其他  
字(4.7k)|赞(0)|评价(0)|浏览(225)

本文整理了Java中com.alibaba.dubbo.common.logger.Logger.warn()方法的一些代码示例,展示了Logger.warn()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Logger.warn()方法的具体详情如下:
包路径:com.alibaba.dubbo.common.logger.Logger
类名称:Logger
方法名:warn

Logger.warn介绍

[英]输出警告信息
[中]输出警告信息

代码示例

代码示例来源:origin: com.alibaba/dubbo

@Override
public void warn(Throwable e) {
  try {
    logger.warn(e);
  } catch (Throwable t) {
  }
}

代码示例来源:origin: com.alibaba/dubbo

public static boolean initConsumerModel(String serviceName, ConsumerModel consumerModel) {
  if (consumedServices.putIfAbsent(serviceName, consumerModel) != null) {
    logger.warn("Already register the same consumer:" + serviceName);
    return false;
  }
  return true;
}

代码示例来源:origin: com.alibaba/dubbo

public static void initProviderModel(String serviceName, ProviderModel providerModel) {
  if (providedServices.put(serviceName, providerModel) != null) {
    logger.warn("already register the provider service: " + serviceName);
    return;
  }
}

代码示例来源:origin: linux-china/dubbo3

private void stopHeartbeatTimer() {
  try {
    ScheduledFuture<?> timer = heatbeatTimer;
    if (timer != null && ! timer.isCancelled()) {
      timer.cancel(true);
    }
  } catch (Throwable t) {
    logger.warn(t.getMessage(), t);
  } finally {
    heatbeatTimer =null;
  }
}

代码示例来源:origin: linux-china/dubbo3

private void stopHeartbeatTimer() {
  try {
    ScheduledFuture<?> timer = heatbeatTimer;
    if (timer != null && ! timer.isCancelled()) {
      timer.cancel(true);
    }
  } catch (Throwable t) {
    logger.warn(t.getMessage(), t);
  } finally {
    heatbeatTimer =null;
  }
}

代码示例来源:origin: com.alibaba/dubbo

private void stopHeartbeatTimer() {
  try {
    ScheduledFuture<?> timer = heartbeatTimer;
    if (timer != null && !timer.isCancelled()) {
      timer.cancel(true);
    }
  } catch (Throwable t) {
    logger.warn(t.getMessage(), t);
  } finally {
    heartbeatTimer = null;
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
protected void doClose() throws Throwable {
  try {
    transport.stop();
  } catch (Throwable e) {
    logger.warn(e.getMessage(), e);
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
public void close() {
  if (closed) {
    return;
  }
  closed = true;
  try {
    doClose();
  } catch (Throwable t) {
    logger.warn(t.getMessage(), t);
  }
}

代码示例来源:origin: com.alibaba/dubbo

private synchronized void destroyConnectStatusCheckCommand() {
  try {
    if (reconnectExecutorFuture != null && !reconnectExecutorFuture.isDone()) {
      reconnectExecutorFuture.cancel(true);
      reconnectExecutorService.purge();
    }
  } catch (Throwable e) {
    logger.warn(e.getMessage(), e);
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
protected void doDisConnect() throws Throwable {
  try {
    NettyChannel.removeChannelIfDisconnected(channel);
  } catch (Throwable t) {
    logger.warn(t.getMessage());
  }
}

代码示例来源:origin: linux-china/dubbo3

@Override
protected void doDisConnect() throws Throwable {
  try {
    NettyChannel.removeChannelIfDisconnected(channel);
  } catch (Throwable t) {
    logger.warn(t.getMessage());
  }
}

代码示例来源:origin: com.alibaba/dubbo-common

public static void warn(Logger logger, Throwable e) {
  if (logger == null) {
    return;
  }
  if (logger.isWarnEnabled()) {
    logger.warn(e);
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
protected void doDisConnect() throws Throwable {
  try {
    NettyChannel.removeChannelIfDisconnected(channel);
  } catch (Throwable t) {
    logger.warn(t.getMessage());
  }
}

代码示例来源:origin: com.alibaba/dubbo

public void shutdown() {
  try {
    running = false;
    jedis.disconnect();
  } catch (Throwable t) {
    logger.warn(t.getMessage(), t);
  }
}

代码示例来源:origin: com.alibaba/dubbo

public static void warn(Logger logger, Throwable e) {
  if (logger == null) {
    return;
  }
  if (logger.isWarnEnabled()) {
    logger.warn(e);
  }
}

代码示例来源:origin: com.alibaba/dubbo

private void checkQueueLength() {
    if (connectionExecutor.getQueue().size() > queuewarninglimit) {
      logger.warn(new IllegalThreadStateException("connectionordered channel handler `queue size: " + connectionExecutor.getQueue().size() + " exceed the warning limit number :" + queuewarninglimit));
    }
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
public void destroy() {
  super.destroy();
  try {
    retryFuture.cancel(true);
  } catch (Throwable t) {
    logger.warn(t.getMessage(), t);
  }
  ExecutorUtil.gracefulShutdown(retryExecutor, retryPeriod);
}

代码示例来源:origin: com.alibaba/dubbo

@Override
protected void doClose() throws Throwable {
  try {
    if (acceptor != null) {
      acceptor.unbind(getBindAddress());
    }
  } catch (Throwable e) {
    logger.warn(e.getMessage(), e);
  }
}

代码示例来源:origin: com.alibaba/dubbo

@Override
  public void run() {
    try {
      client = listenableFutureTask.get();
      client.subscribeStateChanges(listener);
    } catch (InterruptedException e) {
      logger.warn(Thread.currentThread().getName() + " was interrupted unexpectedly, which may cause unpredictable exception!");
    } catch (ExecutionException e) {
      logger.error("Got an exception when trying to create zkclient instance, can not connect to zookeeper server, please check!", e);
    }
  }
});

代码示例来源:origin: com.alibaba/dubbo

@Override
public void destroy() {
  super.destroy();
  try {
    zkClient.close();
  } catch (Exception e) {
    logger.warn("Failed to close zookeeper client " + getUrl() + ", cause: " + e.getMessage(), e);
  }
}

相关文章