code: public static SocketFactory getSocketFactoryFromProperty(
        Configuration conf, String propValue) {
  
      try {
        Class<?> theClass = conf.getClassByName(propValue);
        return (SocketFactory) ReflectionUtils.newInstance(theClass, conf);
  
      } catch (ClassNotFoundException cnfe) {
        throw new RuntimeException("Socket Factory class not found: " + cnfe);
      }
    }
docs: Get the socket factory corresponding to the given proxy URI. If the
  given proxy URI corresponds to an absence of configuration parameter,
  returns null. If the URI is malformed raises an exception.
  
  @param propValue the property which is the class name of the
  SocketFactory to instantiate; assumed non null and non empty.
  @return a socket factory as defined in the property value.