Class cls = ClassLoaderUtil.loadClass(factoryClass, config.getClass());
Constructor con = cls.getConstructor(new Class[] { Config.class });
instance = (Factory)con.newInstance(new Config[] { config });
config.getServletContext().setAttribute(SITEMESH_FACTORY, instance);
} catch (InvocationTargetException e) {
throw new FactoryException("Cannot construct Factory : " + factoryClass, e.getTargetException());
} catch (Exception e) {
throw new FactoryException("Cannot construct Factory : " + factoryClass, e);
}
}
instance.refresh();
return instance;
}