return namedClass.newInstance();
} catch (ClassNotFoundException e) {
if(returnNull) {
return null;
}
throw new TilesException("Unable to resolve factory class: '" + className + "'");
} catch (IllegalAccessException e) {
throw new TilesException("Unable to access factory class: '" + className + "'");
} catch (InstantiationException e) {
throw new TilesException("Unable to instantiate factory class: '"
+ className + "'. Make sure that this class has a default constructor");
} finally {
Thread.currentThread().setContextClassLoader(original);
}
}