Changeset 9d8cd3850dffe388cb5b8c8a3b937922330b067f

Show
Ignore:
Timestamp:
06/29/10 16:27:34 (4 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1277828854 +0000
git-parent:

[87e81f647416d292a4ea85d05fb65dbf34183f16]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1277828854 +0000
Message:

basic concept works, refs #295

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/java/Makefile.in

    r87e81f6 r9d8cd38  
    5959R_CLASS = $(R_JAVA:.java=.class) 
    6060 
    61 J_JAVA = com/omniti/jezebel/Jezebel.java 
     61J_JAVA = com/omniti/jezebel/Jezebel.java \ 
     62        com/omniti/jezebel/JezebelDispatch.java \ 
     63        com/omniti/jezebel/JezebelCheck.java \ 
     64        com/omniti/jezebel/JezebelClassLoader.java \ 
     65        com/omniti/jezebel/JezebelResmon.java \ 
     66        com/omniti/jezebel/Resmon.java \ 
     67        com/omniti/jezebel/ResmonResult.java \ 
     68        com/omniti/jezebel/SampleCheck.java 
    6269 
    6370J_CLASS = $(J_JAVA:.java=.class) 
     
    6976        lib/commons-cli-1.1.jar lib/commons-logging-1.1.1.jar 
    7077 
    71 J_SUPPORT=lib/log4j-1.2.15.jar 
     78J_SUPPORT=lib/log4j-1.2.15.jar \ 
     79        lib/jetty-6.1.20.jar lib/servlet-api-2.5-20081211.jar \ 
     80        lib/jetty-util-6.1.20.jar lib/commons-logging-1.1.1.jar \ 
     81        lib/commons-cli-1.1.jar 
    7282 
    7383all:    reconnoiter.jar jezebel.jar 
    7484        @chmod 755 run-iep.sh 
     85        @chmod 755 jezebel 
    7586 
    7687reconnoiter.jar:        $(R_JAVA) 
  • src/java/com/omniti/jezebel/Jezebel.java

    r87e81f6 r9d8cd38  
    11package com.omniti.jezebel; 
    22 
     3import org.mortbay.jetty.Handler; 
     4import org.mortbay.jetty.handler.AbstractHandler; 
     5import org.mortbay.jetty.Request; 
     6import org.mortbay.jetty.Server; 
     7import org.mortbay.jetty.servlet.Context; 
     8import org.mortbay.jetty.servlet.ServletHolder; 
     9import org.apache.log4j.BasicConfigurator; 
     10import org.apache.log4j.Logger; 
     11import org.apache.commons.cli.Options; 
     12import org.apache.commons.cli.CommandLine; 
     13import org.apache.commons.cli.CommandLineParser; 
     14import org.apache.commons.cli.ParseException; 
     15import org.apache.commons.cli.PosixParser; 
     16import com.omniti.jezebel.JezebelResmon; 
     17import com.omniti.jezebel.JezebelDispatch; 
     18 
    319public class Jezebel { 
    4   static final void main(String args[]) { 
     20  static Logger logger = Logger.getLogger(Jezebel.class.getName()); 
     21 
     22  static final public void main(String args[]) { 
     23    String port; 
     24    Server server; 
     25    CommandLine cmd = null; 
     26    CommandLineParser parser = new PosixParser(); 
     27    Options o = new Options(); 
     28 
     29    BasicConfigurator.configure(); 
     30 
     31    o.addOption("p", true, "port"); 
     32    try { 
     33      cmd = parser.parse(o, args); 
     34    } 
     35    catch (ParseException exp ) { 
     36      System.err.println( "Parsing failed.  Reason: " + exp.getMessage() ); 
     37      System.exit(-1); 
     38    } 
     39 
     40    port = cmd.getOptionValue("p"); 
     41    if(port == null) port = "8083"; 
     42    server = new Server(new Integer(port)); 
     43    Context root = new Context(server, "/", Context.SESSIONS); 
     44    root.addServlet(new ServletHolder(new JezebelResmon()), "/resmon"); 
     45    root.addServlet(new ServletHolder(new JezebelDispatch()), "/dispatch/*"); 
     46 
     47    logger.info("Starting server on port " + port); 
     48    try { server.start(); } 
     49    catch (Exception e) { e.printStackTrace(); } 
    550  } 
    651}