Package io.apigee.trireme.core.internal

Examples of io.apigee.trireme.core.internal.ModuleRegistry


    public Scriptable registerExports(Context cx, Scriptable global, NodeRuntime runtime)
        throws InvocationTargetException, IllegalAccessException, InstantiationException
    {
        Scriptable natives = cx.newObject(global);

        ModuleRegistry registry = ((ScriptRunner)runtime).getRegistry();
        for (String name : registry.getCompiledModuleNames()) {
            Script script = registry.getCompiledModule(name);
            String fileName = '/' + script.getClass().getName().replace(".", "/") + ".js";

            InputStream in = script.getClass().getResourceAsStream(fileName);
            if (in == null) {
                continue;
View Full Code Here


        ServiceLoader<NodeImplementation> impls = ServiceLoader.load(NodeImplementation.class);
        for (NodeImplementation impl : impls) {
            if (log.isDebugEnabled()) {
                log.debug("Discovered Node version {}", impl.getVersion());
            }
            versions.add(new NodeVersion(impl.getVersion(), new ModuleRegistry(impl)));
        }
    }
View Full Code Here

    /**
     * Return the default implementation version.
     */
    public String getDefaultNodeVersion()
    {
        ModuleRegistry reg = versions.match(DEFAULT_NODE_VERSION);
        if (reg == null) {
            return null;
        }
        return reg.getImplementation().getVersion();
    }
View Full Code Here

     * </p>
     */
    public ScriptFuture execute()
        throws NodeException
    {
        ModuleRegistry registry = getRegistry();

        if ((scriptFile == null) && (script == null)) {
            runner = new ScriptRunner(this, env, sandbox, args, forceRepl);
        } else if (scriptFile == null) {
            runner = new ScriptRunner(this, env, sandbox, scriptName, script, args);
View Full Code Here

        throws NodeException
    {
        if (scriptFile == null) {
            throw new NodeException("Modules must be specified as a file name and not as a string");
        }
        ModuleRegistry registry = getRegistry();

        runner = new ScriptRunner(this, env, sandbox, scriptName,
                                  makeModuleScript(), args);
        runner.setParentProcess((ProcessWrap.ProcessImpl)parentProcess);
        runner.setRegistry(registry);
View Full Code Here

    }

    private ModuleRegistry getRegistry()
        throws NodeException
    {
        ModuleRegistry registry = env.getRegistry(nodeVersion);
        if (registry == null) {
            throw new NodeException("No available Node.js implementation matches version " + nodeVersion);
        }
        return registry;
    }
View Full Code Here

TOP

Related Classes of io.apigee.trireme.core.internal.ModuleRegistry

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.