(ComponentDefinitionsFactory) factoryClass.newInstance();
factory.initFactory(servletContext, properties);
return factory;
} catch (ClassCastException ex) { // Bad classname
throw new DefinitionsFactoryException(
"Error - createDefinitionsFactory : Factory class '"
+ classname
+ " must implements 'ComponentDefinitionsFactory'.",
ex);
} catch (ClassNotFoundException ex) { // Bad classname
throw new DefinitionsFactoryException(
"Error - createDefinitionsFactory : Bad class name '"
+ classname
+ "'.",
ex);
} catch (InstantiationException ex) { // Bad constructor or error
throw new DefinitionsFactoryException(ex);
} catch (IllegalAccessException ex) {
throw new DefinitionsFactoryException(ex);
}
}