Package org.grouplens.lenskit.util.io

Examples of org.grouplens.lenskit.util.io.CustomClassLoaderObjectInputStream


    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();
View Full Code Here

TOP

Related Classes of org.grouplens.lenskit.util.io.CustomClassLoaderObjectInputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.