@Override
protected void service(final HttpServletRequest req, final HttpServletResponse resp) throws IOException {
final String factoryClassName = getInitParameter(ODataServiceFactory.FACTORY_LABEL);
if (factoryClassName == null) {
throw new ODataRuntimeException("config missing: org.apache.olingo.odata2.processor.factory");
}
try {
ClassLoader cl = (ClassLoader) req.getAttribute(ODataServiceFactory.FACTORY_CLASSLOADER_LABEL);
if (cl == null) {
serviceFactory = (ODataServiceFactory) Class.forName(factoryClassName).newInstance();
} else {
serviceFactory = (ODataServiceFactory) Class.forName(factoryClassName, true, cl).newInstance();
}
} catch (Exception e) {
throw new ODataRuntimeException(e);
}
final String pathSplitAsString = getInitParameter(ODataServiceFactory.PATH_SPLIT_LABEL);
if (pathSplitAsString != null) {
pathSplit = Integer.parseInt(pathSplitAsString);
}