private Collection<? extends Object> instantiateFactoryResources(String factoryClassName, Config config)
      throws InstantiationException {
    try {
      ResourceFactory factory = ReflectionUtil.getObj(factoryClassName, ResourceFactory.class);
      return factory.getResourceInstances(config);
    } catch (Exception e) {
      throw (InstantiationException)
          new InstantiationException("Unable to instantiate " + factoryClassName).initCause(e);
    }
  }
Passes the specified config to the specified factory to instantiate its resources.

@param factoryClassName  the name of a class that implements {@link ResourceFactory}
@param config            the config to pass to the factory
@return                  a collection of resources returned by the factory.
@throws InstantiationException
samza-rest/src/main/java/org/apache/samza/rest/SamzaRestApplication.java