Package org.latte.scripting

Examples of org.latte.scripting.ScriptLoader


  private static final Logger LOG = Logger.getLogger(LatteServlet.class.getName());
  final private Scriptable parent;
  private Callable fn;

  public LatteServlet() throws Exception {
    ScriptLoader loader = new ScriptLoader();
    this.parent = loader.getRoot();

    loader.register("httpserver", new Callable() {
      public Object call(Context cx, Scriptable scope, Scriptable thisObj, Object[] params) {
        fn = (Callable)params[1]
        return null;
      }
    });

    ((Javascript)loader.get("init.js")).eval(null);
  }
View Full Code Here


    else {
      System.err.println("usage: org.latte.Run script [args]");
      System.exit(-1);
    }

    ScriptLoader loader  = new ScriptLoader();
    loader.register("httpserver", new HTTPServer())

    ((Javascript)loader.get(script)).eval(null);
  }
View Full Code Here

TOP

Related Classes of org.latte.scripting.ScriptLoader

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.