code: public String[] query_device() throws DevFailed {
          Util.out4.println("In QueryDevice command");
  
          final int nb_class = class_list.size();
          final Vector tmp_name = new Vector();
  
          for (int i = 0; i < nb_class; i++) {
              final int nb_dev = ((DeviceClass) class_list.elementAt(i)).get_device_list().size();
              for (int j = 0; j < nb_dev; j++) {
                  tmp_name.addElement(((DeviceImpl) ((DeviceClass) class_list.elementAt(i))
                          .get_device_list().elementAt(j)).get_name());
              }
          }
  
          String[] ret = null;
          try {
              ret = new String[tmp_name.size()];
  
              for (int i = 0; i < tmp_name.size(); i++) {
                  ret[i] = (String) tmp_name.elementAt(i);
              }
          } catch (final BAD_OPERATION ex) {
              Util.out3.println("Memory Allocation error in DServer.query_device method");
              Except.throw_exception("API_MemoryAllocation", "Can't allocate memory in server",
                      "DServer.query_device");
          }
          return ret;
      }
docs: -----------------------------------------------------------------------------