Package dovetaildb.scriptbridge

Examples of dovetaildb.scriptbridge.RhinoScriptBridge$RhinoScriptFunction$RhinoScriptEnv


    System.exit(1);
  }
 
  public static void main(String[] argv) throws Exception {
   
    RhinoScriptBridge rhino = new RhinoScriptBridge();
    if (argv.length < 2) error("Specify a configuration file as the first argument");
    String configFilename = argv[1];
    String configContent = Util.readFully(new File(configFilename));
    Collection<Pair<String,String>> codeFiles = Util.literalList().a(
        new Pair<String,String>(configFilename, configContent)
    );

    //GrizzlyWebServer ws = new GrizzlyWebServer("/var/www");
    GrizzlyWebServer ws = new GrizzlyWebServer();
    DovetaildbServlet ddbServlet = new DovetaildbServlet();

    ServletAdapter sa = new ServletAdapter();
    sa.setServletInstance(ddbServlet);
    ws.addGrizzlyAdapter(sa, new String[]{"/"});

    Map<String,Object> env = Util.literalMap()
      .p("server", ws)
      .p("servlet", ddbServlet);
    rhino.makeEnvFromCodeExecution(codeFiles, env);

    /*
    // Add Comet Support
    ws.addAsyncFilter(new CometAsyncFilter());

View Full Code Here

TOP

Related Classes of dovetaildb.scriptbridge.RhinoScriptBridge$RhinoScriptFunction$RhinoScriptEnv

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.