code: public static Map<String, String> toMap(ServiceReference reference)
      {
          LOGGER.entering(CLASS_NAME, "toMap", reference);
  
          Map<String, String> result = new Hashtable<String, String>();
  
          for (String key : reference.getPropertyKeys())
          {
              result.put(key, reference.getProperty(key).toString());
          }
  
          LOGGER.exiting(CLASS_NAME, "toMap", result);
  
          return result;
      }
docs: Convert a {@link ServiceReference}'s attributes into a dictionary.
  
  @param reference the service reference to be converted
  @return a dictionary of the service reference's attributes