code: public CommandInfo command_query(final DeviceProxy deviceProxy,
                                       final String commandName) throws DevFailed {
  
          build_connection(deviceProxy);
  
          CommandInfo info = null;
          if (deviceProxy.url.protocol == TANGO) {
              // try 2 times for reconnection if requested
              final int retries = deviceProxy.transparent_reconnection ? 2 : 1;
              for (int i=0 ; i<retries ; i++) {
              try {
                  // Check IDL version
                  if (deviceProxy.device_2 != null) {
                      final DevCmdInfo_2 tmp = deviceProxy.device_2.command_query_2(commandName);
                      info = new CommandInfo(tmp);
                  } else {
                      final DevCmdInfo tmp = deviceProxy.device.command_query(commandName);
                      info = new CommandInfo(tmp);
                  }
              } catch (final Exception e) {
                  manageExceptionReconnection(deviceProxy, retries, i, e, this.getClass()
                      + ".command_query");
              }
              }
          } else {
              // TACO device
              info = deviceProxy.taco_device.commandQuery(commandName);
          }
          return info;
      }
docs: ===========================================================