code: public DeviceData command_inout_reply(final DeviceProxy deviceProxy,
                                            final AsyncCallObject aco) throws DevFailed {
          DeviceData data;
          try {
              if (deviceProxy.device_5 != null) {
                  check_asynch_reply(deviceProxy, aco.request, aco.id, "command_inout_4");
              }
              else if (deviceProxy.device_4 != null) {
                  check_asynch_reply(deviceProxy, aco.request, aco.id, "command_inout_4");
              }
              else if (deviceProxy.device_2 != null) {
                  check_asynch_reply(deviceProxy, aco.request, aco.id, "command_inout_2");
              }
              else {
                  check_asynch_reply(deviceProxy, aco.request, aco.id, "command_inout");
              }
              // If no exception, extract the any from return value,
              final Any any = aco.request.return_value().extract_any();
  
              // And put it in a DeviceData object
              data = new DeviceData();
              data.insert(any);
          }
          catch (ConnectionFailed e) {
              try {
                  //  If failed, retrieve data from request object
                  final NVList args = aco.request.arguments();
                  String command = args.item(0).value().extract_string(); // get command name
                  DeviceData  argin = null;
                  if (args.count()>1) {
                      Any any = args.item(1).value().extract_any();
                      argin = new DeviceData(any);
                  }
                  //System.err.println(e.errors[0].desc);
  
                  //  And do the synchronous command
                  if (argin==null)
                      data = deviceProxy.command_inout(command);
                  else
                      data = deviceProxy.command_inout(command, argin);
              }
              catch (org.omg.CORBA.Bounds e1) {
                  System.err.println(e1);
                  throw e;
              }
          }
          ApiUtil.remove_async_request(aco.id);
  
          return data;
      }
docs: ==========================================================================