code: @SuppressWarnings("unchecked")
  	static AbstractScheduler loadScheduler(final String schedulerClassName, final DeploymentManager deploymentManager,
  			final InstanceManager instanceManager) {
  
  		Class<? extends AbstractScheduler> schedulerClass;
  		try {
  			schedulerClass = (Class<? extends AbstractScheduler>) Class.forName(schedulerClassName);
  		} catch (ClassNotFoundException e) {
  			LOG.error("Cannot find class " + schedulerClassName + ": " + StringUtils.stringifyException(e));
  			return null;
  		}
  
  		Constructor<? extends AbstractScheduler> constructor;
  
  		try {
  
  			Class<?>[] constructorArgs = { DeploymentManager.class, InstanceManager.class };
  			constructor = schedulerClass.getConstructor(constructorArgs);
  		} catch (NoSuchMethodException e) {
  			LOG.error("Cannot create scheduler: " + StringUtils.stringifyException(e));
  			return null;
  		} catch (SecurityException e) {
  			LOG.error("Cannot create scheduler: " + StringUtils.stringifyException(e));
  			return null;
  		}
  
  		AbstractScheduler scheduler;
  
  		try {
  			scheduler = constructor.newInstance(deploymentManager, instanceManager);
  		} catch (InstantiationException e) {
  			LOG.error("Cannot create scheduler: " + StringUtils.stringifyException(e));
  			return null;
  		} catch (IllegalAccessException e) {
  			LOG.error("Cannot create scheduler: " + StringUtils.stringifyException(e));
  			return null;
  		} catch (IllegalArgumentException e) {
  			LOG.error("Cannot create scheduler: " + StringUtils.stringifyException(e));
  			return null;
  		} catch (InvocationTargetException e) {
  			LOG.error("Cannot create scheduler: " + StringUtils.stringifyException(e));
  			return null;
  		}
  
  		return scheduler;
  	}
docs: Tries to locate a class with given name and to
  instantiate a {@link AbstractScheduler} object from it.
  
  @param schedulerClassName
  the name of the class to instantiate the scheduler object from
  @param deploymentManager
  the deployment manager which shall be passed on to the scheduler
  @param instanceManager
  the instance manager which shall be passed on to the scheduler
  @return the {@link AbstractScheduler} object instantiated from the class with the provided name