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());