Package ch.grengine.code

Examples of ch.grengine.code.SingleSourceCode


    @Override
    public SingleSourceCode getUpToDateCode(final Source source) throws CompileException {

        State stateNow = state;
       
        SingleSourceCode code = stateNow.cache.get(source);
        if (code != null && code.getLastModifiedAtCompileTime() == source.getLastModified()) {
            return code;
        }
       
        synchronized(this) {
            // prevent multiple compilations
            code = stateNow.cache.get(source);
            if (code != null && code.getLastModifiedAtCompileTime() == source.getLastModified()) {
                return code;
            }
            Compiler compiler = compilerFactory.newCompiler(stateNow.parent);
            code = (SingleSourceCode)compiler.compile(SourcesUtil.sourceToSources(source, compilerFactory));
            stateNow.cache.put(source, code);
View Full Code Here


                return BytecodeClassLoader.loadMainClassBySource(staticTopLoader, source);
            }
        }

        // load from top code cache
        SingleSourceCode code = topCodeCache.getUpToDateCode(source);
        BytecodeClassLoader topLoader = topLoaders.get(source);
        if (topLoader == null || ((SingleSourceCode)topLoader.getCode()).getLastModifiedAtCompileTime()
                != code.getLastModifiedAtCompileTime()) {
            topLoader = new BytecodeClassLoader(this, topLoadMode, code);
            topLoaders.put(source, topLoader);
        }
        return topLoader.loadMainClass(source);
    }
View Full Code Here

                return BytecodeClassLoader.loadClassBySourceAndName(staticTopLoader, source, name);
            }
        }

        // load from top code cache
        SingleSourceCode code = topCodeCache.getUpToDateCode(source);
        BytecodeClassLoader topLoader = topLoaders.get(source);
        if (topLoader == null || ((SingleSourceCode)topLoader.getCode()).getLastModifiedAtCompileTime()
                != code.getLastModifiedAtCompileTime()) {
            topLoader = new BytecodeClassLoader(this, topLoadMode, code);
            topLoaders.put(source, topLoader);
        }
        return topLoader.loadClass(source, name);
    }
View Full Code Here

TOP

Related Classes of ch.grengine.code.SingleSourceCode

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.