code: @SuppressWarnings("unchecked")
  	protected <T> T newInstance(final String name, final Class<T> clazz) {
  		T r = null;
  		try {
  		   Class<?> loadedClass = getClass().getClassLoader().loadClass(name);
  		   r = (T) loadedClass.newInstance();
  		} catch(Exception e) {
  		    LoginException le = new LoginException(PicketBoxMessages.MESSAGES.failedToInstantiateClassMessage(clazz));
  		    le.initCause(e);
  		    setValidateError(le);
  		}
  		return r;
  	}
docs: Generic helper: Use JBoss SecurityActions to load a class, then create a new instance.
  
  @param <T> generic return type
  @param name FQCN of the class to instantiate.
  @param clazz Expected type, used for PicketBox logging.
  @return Insance. On error/exception, this method registers the
  exception via {{@link #setValidateError(Throwable)} and returns
  <code>null</code>.