code: public String[] getServices(Database database, String servicename, String instname)
              throws DevFailed {
          Vector<String> v = new Vector<String>();
          char separ;
  
          //	Read Service property
          DbDatum datum = get_property(database, TangoConst.CONTROL_SYSTEM,
                  TangoConst.SERVICE_PROP_NAME, true);
          if (!datum.is_empty()) {
              String[] services = datum.extractStringArray();
  
              //	Build filter
              String target = servicename.toLowerCase();
              if (!instname.equals("*")) {
                  target += "/" + instname.toLowerCase();
                  separ = ':';
              } else
                  separ = '/';
  
              //	Search with filter
              int start;
              for (String service : services) {
                  start = service.indexOf(separ);
                  if (start>0) {
                      String startLine =
                              service.substring(0, start).toLowerCase();
                      if (startLine.equals(target))
                          v.add(service.substring(
                                  service.indexOf(':') + 1));
                  }
              }
          }
          String[] result = new String[v.size()];
          for (int i = 0 ; i<v.size() ; i++)
              result[i] = v.get(i);
          return result;
      }
docs: ===================================================================