Changeset 9d8cd3850dffe388cb5b8c8a3b937922330b067f
- Timestamp:
- 06/29/10 16:27:34
(3 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
| r87e81f6 |
r9d8cd38 |
|
| 59 | 59 | R_CLASS = $(R_JAVA:.java=.class) |
|---|
| 60 | 60 | |
|---|
| 61 | | J_JAVA = com/omniti/jezebel/Jezebel.java |
|---|
| | 61 | J_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 |
|---|
| 62 | 69 | |
|---|
| 63 | 70 | J_CLASS = $(J_JAVA:.java=.class) |
|---|
| … | … | |
| 69 | 76 | lib/commons-cli-1.1.jar lib/commons-logging-1.1.1.jar |
|---|
| 70 | 77 | |
|---|
| 71 | | J_SUPPORT=lib/log4j-1.2.15.jar |
|---|
| | 78 | J_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 |
|---|
| 72 | 82 | |
|---|
| 73 | 83 | all: reconnoiter.jar jezebel.jar |
|---|
| 74 | 84 | @chmod 755 run-iep.sh |
|---|
| | 85 | @chmod 755 jezebel |
|---|
| 75 | 86 | |
|---|
| 76 | 87 | reconnoiter.jar: $(R_JAVA) |
|---|
| r87e81f6 |
r9d8cd38 |
|
| 1 | 1 | package com.omniti.jezebel; |
|---|
| 2 | 2 | |
|---|
| | 3 | import org.mortbay.jetty.Handler; |
|---|
| | 4 | import org.mortbay.jetty.handler.AbstractHandler; |
|---|
| | 5 | import org.mortbay.jetty.Request; |
|---|
| | 6 | import org.mortbay.jetty.Server; |
|---|
| | 7 | import org.mortbay.jetty.servlet.Context; |
|---|
| | 8 | import org.mortbay.jetty.servlet.ServletHolder; |
|---|
| | 9 | import org.apache.log4j.BasicConfigurator; |
|---|
| | 10 | import org.apache.log4j.Logger; |
|---|
| | 11 | import org.apache.commons.cli.Options; |
|---|
| | 12 | import org.apache.commons.cli.CommandLine; |
|---|
| | 13 | import org.apache.commons.cli.CommandLineParser; |
|---|
| | 14 | import org.apache.commons.cli.ParseException; |
|---|
| | 15 | import org.apache.commons.cli.PosixParser; |
|---|
| | 16 | import com.omniti.jezebel.JezebelResmon; |
|---|
| | 17 | import com.omniti.jezebel.JezebelDispatch; |
|---|
| | 18 | |
|---|
| 3 | 19 | public 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(); } |
|---|
| 5 | 50 | } |
|---|
| 6 | 51 | } |
|---|