ServletContext servletContext) {
Object object = newInstance(className);
if (object instanceof ObjectFactory) {
ObjectFactory factory = (ObjectFactory) object;
factory.init(servletContext);
return factory;
} else {
throw new IllegalStateException("ObjectFactory must implements ["
+ ObjectFactory.class.getName() + "]");
}