code: private Dictionary<String, Object> getServiceProperties(ServiceReference<ResourceFactory> ref) {
          String[] keys = ref.getPropertyKeys();
          Dictionary<String, Object> properties = new Hashtable<String, Object>(keys.length);
          for (String key : keys) {
              if (!key.equals(ResourceFactory.JNDI_NAME) &&
                  !key.equals(ResourceFactory.CREATES_OBJECT_CLASS)) {
                  properties.put(key, ref.getProperty(key));
              }
          }
  
          properties.put(ResourceFactory.class.getName(), "true");
          properties.put(JNDI_SERVICENAME, ref.getProperty(ResourceFactory.JNDI_NAME));
  
          return properties;
      }
docs: Gets an array of resource service properties from a {@link ResourceFactory} service reference.
  
  @param ref a ResourceFactory service reference
  @return service properties