src/main/java/org/apache/dubbo/remoting/etcd/jetcd/JEtcdClientWrapper.java
/**
     * try get client's shared channel, becase all fields is private on jetcd,
     * we must using it by reflect, in the future, jetcd may provider better tools.
     *
     * @param client get channel from current client
     * @return current connection channel
     */
try get client's shared channel, becase all fields is private on jetcd,
we must using it by reflect, in the future, jetcd may provider better tools.

@param client get channel from current client
@return current connection channel
try get client ' s shared channel becase all fields is private on jetcd we must using it by reflect in the future jetcd may provider better tools . @param client get channel from current client @return current connection channel
private ManagedChannel newChannel(Client client) {
        try {
            Field connectionField = client.getClass().getDeclaredField("connectionManager");
            if (!connectionField.isAccessible()) {
                connectionField.setAccessible(true);
            }
            Object connection = connectionField.get(client);
            Method channel = connection.getClass().getDeclaredMethod("getChannel");
            if (!channel.isAccessible()) {
                channel.setAccessible(true);
            }
            return (ManagedChannel) channel.invoke(connection);
        } catch (Exception e) {
            throw new RuntimeException("get connection channel failed from " + url.getBackupAddress(), e);
        }
    }
private ManagedChannel newChannel ( Client client ) { try { Field connectionField = client . getClass ( ) . getDeclaredField ( "connectionManager" ) ; if ( ! connectionField . isAccessible ( ) ) { connectionField . setAccessible ( true ) ; } Object connection = connectionField . get ( client ) ; Method channel = connection . getClass ( ) . getDeclaredMethod ( "getChannel" ) ; if ( ! channel . isAccessible ( ) ) { channel . setAccessible ( true ) ; } return ( ManagedChannel ) channel . invoke ( connection ) ; } catch ( Exception e ) { throw new RuntimeException ( "get connection channel failed from " + url . getBackupAddress ( ) , e ) ; } }
try get client's shared channel, becase all fields is private on jetcd,
 we must using it by reflect, in the future, jetcd may provider better tools.
try get client ' s shared channel becase all fields is private on jetcd we must using it by reflect in the future jetcd may provider better tools .