private LenskitRecommenderEngine loadInternal(InputStream stream) throws IOException, RecommenderConfigurationException {
logger.debug("using classloader {}", classLoader);
DAGNode<Component, Dependency> graph;
// And load the stream once we've wrapped it appropriately.
ObjectInputStream in = new CustomClassLoaderObjectInputStream(
LKFileUtils.transparentlyDecompress(stream), classLoader);
try {
ClassLoaderContext ctx = null;
if (classLoader != null) {
// Grapht will automatically use the context class loader, set it up
ctx = ClassLoaders.pushContext(classLoader);
}
try {
graph = readGraph(in);
} finally {
if (ctx != null) {
ctx.pop();
}
}
} catch (ClassNotFoundException e) {
throw new RecommenderConfigurationException(e);
} finally {
in.close();
}
if (!configurations.isEmpty()) {
logger.info("rewriting with {} configurations", configurations.size());
RecommenderGraphBuilder rgb = new RecommenderGraphBuilder();