code: public boolean isConnectionHandleAlive(ThriftConnectionHandle<T> connection) {
  		boolean result = false;
  		boolean logicallyClosed = connection.logicallyClosed.get();
  		try {
  			connection.logicallyClosed.compareAndSet(true, false);
  
  			// 反射调用ping方法
  			T client = null;
  			if (this.thriftServiceType == ThriftServiceType.SINGLE_INTERFACE) {
  				client = connection.getClient();
  			} else {
  				Map<String, T> muiltServiceClients = connection.getMuiltServiceClients();
  				if (muiltServiceClients.size() == 0) { // 没有可用的客户端 直接返回
  					return false;
  				}
  				Iterator<T> iterator = muiltServiceClients.values().iterator();
  				if (iterator.hasNext()) {
  					client = iterator.next();
  				} else {
  					return false;
  				}
  			}
  			try {
  				Method method = client.getClass().getMethod("ping");
  				method.invoke(client);
  			} catch (Exception e) {
  				return false;
  			}
  
  			result = true;
  		} finally {
  			connection.logicallyClosed.set(logicallyClosed);
  			connection.setConnectionLastResetInMs(System.currentTimeMillis());
  		}
  		return result;
  	}
docs: 判断连接代理类是否可用的方法
  
  @param connection
  需要检测的连接代理类对象
  @return true为可用 false为不可用