code: @SuppressWarnings("unchecked")
  	public static Object instantiateInstanceWithClientConfig(String className, IClientConfig clientConfig) 
      		throws InstantiationException, IllegalAccessException, ClassNotFoundException {
      	Class clazz = Class.forName(className);
      	if (IClientConfigAware.class.isAssignableFrom(clazz)) {
      		IClientConfigAware obj = (IClientConfigAware) clazz.newInstance();
      		obj.initWithNiwsConfig(clientConfig);
      		return obj;
      	} else {
      		try {
      		    if (clazz.getConstructor(IClientConfig.class) != null) {
      		    	return clazz.getConstructor(IClientConfig.class).newInstance(clientConfig);
      		    }
      		} catch (NoSuchMethodException ignored) {
      		    // OK for a class to not take an IClientConfig
      		} catch (SecurityException | IllegalArgumentException | InvocationTargetException e) { 
      		    logger.warn("Error getting/invoking IClientConfig constructor of {}", className, e);
      		}    		
      	}
      	logger.warn("Class " + className + " neither implements IClientConfigAware nor provides a constructor with IClientConfig as the parameter. Only default constructor will be used.");
      	return clazz.newInstance();
      }
docs: Creates instance related to client framework using reflection. It first checks if the object is an instance of
  {@link IClientConfigAware} and if so invoke {@link IClientConfigAware#initWithNiwsConfig(IClientConfig)}. If that does not
  apply, it tries to find if there is a constructor with {@link IClientConfig} as a parameter and if so invoke that constructor. If neither applies,
  it simply invokes the no-arg constructor and ignores the clientConfig parameter.
  
  @param className Class name of the object
  @param clientConfig IClientConfig object used for initialization.