| Commit in servicemix/tooling/servicemix-web on MAIN | |||
| src/webapp/bullet.gif | [binary] | added 1.1 | |
| /mktree.js | +177 | added 1.1 | |
| /mktree.css | +21 | added 1.1 | |
| /minus.gif | [binary] | added 1.1 | |
| /plus.gif | [binary] | added 1.1 | |
| /mbeans.jsp | +23 | added 1.1 | |
| /index.html | +12 | -41 | 1.1 -> 1.2 |
| /portfolio.html | -77 | 1.1 removed | |
| /chat.js | -55 | 1.1 removed | |
| /util.js | -35 | 1.1 removed | |
| /portfolio.js | -32 | 1.1 removed | |
| /chat.html | -20 | 1.1 removed | |
| /webmq.js | -132 | 1.1 removed | |
| /send.html | -27 | 1.1 removed | |
| maven.xml | +18 | 1.1 -> 1.2 | |
| src/test/java/org/servicemix/web/JettyServer.java | +50 | added 1.1 | |
| +301 | -419 | ||
added an initial spike of the JMX console for ServiceMix
servicemix/tooling/servicemix-web/src/webapp
mktree.js added at 1.1
diff -N mktree.js --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mktree.js 12 Sep 2005 16:25:44 -0000 1.1 @@ -0,0 +1,177 @@
+// ===================================================================
+// Author: Matt Kruse <[EMAIL PROTECTED]>
+// WWW: http://www.mattkruse.com/
+//
+// NOTICE: You may use this code for any purpose, commercial or
+// private, without any further permission from the author. You may
+// remove this notice from your final code if you wish, however it is
+// appreciated by the author if at least my web site address is kept.
+//
+// You may *NOT* re-distribute this code in any way except through its
+// use. That means, you can include it in your product, or your web
+// site, or any other form where the code is actually being used. You
+// may not put the plain _javascript_ up on your site for download or
+// include it in your _javascript_ libraries for download.
+// If you wish to share this code with others, please just point them
+// to the URL instead.
+// Please DO NOT link directly to my .js files from your site. Copy
+// the files to your server and use them there. Thank you.
+// ===================================================================
+
+// HISTORY
+// ------------------------------------------------------------------
+// December 9, 2003: Added script to the _javascript_ Toolbox
+// December 10, 2003: Added the preProcessTrees variable to allow user
+// to turn off automatic conversion of UL's onLoad
+// March 1, 2004: Changed it so if a <li> has a class already attached
+// to it, that class won't be erased when initialized. This allows
+// you to set the state of the tree when painting the page simply
+// by setting some <li>'s class name as being "liOpen" (see example)
+/*
+This code is inspired by and extended from Stuart Langridge's aqlist code:
+ http://www.kryogenix.org/code/browser/aqlists/
+ Stuart Langridge, November 2002
+ [EMAIL PROTECTED]
+ Inspired by Aaron's labels.js (http://youngpup.net/demos/labels/)
+ and Dave Lindquist's menuDropDown.js (http://www.gazingus.org/dhtml/?id=109)
+*/
+
+// Automatically attach a listener to the window onload, to convert the trees
+addEvent(window,"load",convertTrees);
+
+// Utility function to add an event listener
+function addEvent(o,e,f){
+ if (o.addEventListener){ o.addEventListener(e,f,true); return true; }
+ else if (o.attachEvent){ return o.attachEvent("on"+e,f); }
+ else { return false; }
+}
+
+// utility function to set a global variable if it is not already set
+function setDefault(name,val) {
+ if (typeof(window[name])=="undefined" || window[name]==null) {
+ window[name]=val;
+ }
+}
+
+// Full expands a tree with a given ID
+function expandTree(treeId) {
+ var ul = document.getElementById(treeId);
+ if (ul == null) { return false; }
+ expandCollapseList(ul,nodeOpenClass);
+}
+
+// Fully collapses a tree with a given ID
+function collapseTree(treeId) {
+ var ul = document.getElementById(treeId);
+ if (ul == null) { return false; }
+ expandCollapseList(ul,nodeClosedClass);
+}
+
+// Expands enough nodes to expose an LI with a given ID
+function expandToItem(treeId,itemId) {
+ var ul = document.getElementById(treeId);
+ if (ul == null) { return false; }
+ var ret = expandCollapseList(ul,nodeOpenClass,itemId);
+ if (ret) {
+ var o = document.getElementById(itemId);
+ if (o.scrollIntoView) {
+ o.scrollIntoView(false);
+ }
+ }
+}
+
+// Performs 3 functions:
+// a) Expand all nodes
+// b) Collapse all nodes
+// c) Expand all nodes to reach a certain ID
+function expandCollapseList(ul,cName,itemId) {
+ if (!ul.childNodes || ul.childNodes.length==0) { return false; }
+ // Iterate LIs
+ for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
+ var item = ul.childNodes[itemi];
+ if (itemId!=null && item.id==itemId) { return true; }
+ if (item.nodeName == "LI") {
+ // Iterate things in this LI
+ var subLists = false;
+ for (var sitemi=0;sitemi<item.childNodes.length;sitemi++) {
+ var sitem = item.childNodes[sitemi];
+ if (sitem.nodeName=="UL") {
+ subLists = true;
+ var ret = expandCollapseList(sitem,cName,itemId);
+ if (itemId!=null && ret) {
+ item.className=cName;
+ return true;
+ }
+ }
+ }
+ if (subLists && itemId==null) {
+ item.className = cName;
+ }
+ }
+ }
+}
+
+// Search the document for UL elements with the correct CLASS name, then process them
+function convertTrees() {
+ setDefault("treeClass","mktree");
+ setDefault("nodeClosedClass","liClosed");
+ setDefault("nodeOpenClass","liOpen");
+ setDefault("nodeBulletClass","liBullet");
+ setDefault("nodeLinkClass","bullet");
+ setDefault("preProcessTrees",true);
+ if (preProcessTrees) {
+ if (!document.createElement) { return; } // Without createElement, we can't do anything
+ uls = document.getElementsByTagName("ul");
+ for (var uli=0;uli<uls.length;uli++) {
+ var ul=uls[uli];
+ if (ul.nodeName=="UL" && ul.className==treeClass) {
+ processList(ul);
+ }
+ }
+ }
+}
+
+// Process a UL tag and all its children, to convert to a tree
+function processList(ul) {
+ if (!ul.childNodes || ul.childNodes.length==0) { return; }
+ // Iterate LIs
+ for (var itemi=0;itemi<ul.childNodes.length;itemi++) {
+ var item = ul.childNodes[itemi];
+ if (item.nodeName == "LI") {
+ // Iterate things in this LI
+ var subLists = false;
+ for (var sitemi=0;sitemi<item.childNodes.length;sitemi++) {
+ var sitem = item.childNodes[sitemi];
+ if (sitem.nodeName=="UL") {
+ subLists = true;
+ processList(sitem);
+ }
+ }
+ var s= document.createElement("SPAN");
+ var t= '\u00A0'; //
+ s.className = nodeLinkClass;
+ if (subLists) {
+ // This LI has UL's in it, so it's a +/- node
+ if (item.className==null || item.className=="") {
+ item.className = nodeClosedClass;
+ }
+ // If it's just text, make the text work as the link also
+ if (item.firstChild.nodeName=="#text") {
+ t = t+item.firstChild.nodeValue;
+ item.removeChild(item.firstChild);
+ }
+ s. () {
+ this.parentNode.className = (this.parentNode.className==nodeOpenClass) ? nodeClosedClass : nodeOpenClass;
+ return false;
+ }
+ }
+ else {
+ // No sublists, so it's just a bullet node
+ item.className = nodeBulletClass;
+ s. () { return false; }
+ }
+ s.appendChild(document.createTextNode(t));
+ item.insertBefore(s,item.firstChild);
+ }
+ }
+}
servicemix/tooling/servicemix-web/src/webapp
mktree.css added at 1.1
diff -N mktree.css --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mktree.css 12 Sep 2005 16:25:44 -0000 1.1 @@ -0,0 +1,21 @@
+/* Put this inside a @media qualifier so Netscape 4 ignores it */
[EMAIL PROTECTED] screen, print {
+ /* Turn off list bullets */
+ ul.mktree li { list-style: none; }
+ /* Control how "spaced out" the tree is */
+ ul.mktree, ul.mktree ul , ul.mktree li { margin-left:10px; padding:0px; }
+ /* Provide space for our own "bullet" inside the LI */
+ ul.mktree li .bullet { padding-left: 15px; }
+ /* Show "bullets" in the links, depending on the class of the LI that the link's in */
+ ul.mktree li.liOpen .bullet { cursor: pointer; background: url(minus.gif) center left no-repeat; }
+ ul.mktree li.liClosed .bullet { cursor: pointer; background: url(plus.gif) center left no-repeat; }
+ ul.mktree li.liBullet .bullet { cursor: default; background: url(bullet.gif) center left no-repeat; }
+ /* Sublists are visible or not based on class of parent LI */
+ ul.mktree li.liOpen ul { display: block; }
+ ul.mktree li.liClosed ul { display: none; }
+ /* Format menu items differently depending on what level of the tree they are in */
+ ul.mktree li { font-size: 12pt; }
+ ul.mktree li ul li { font-size: 10pt; }
+ ul.mktree li ul li ul li { font-size: 8pt; }
+ ul.mktree li ul li ul li ul li { font-size: 6pt; }
+}
servicemix/tooling/servicemix-web/src/webapp
mbeans.jsp added at 1.1
diff -N mbeans.jsp --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ mbeans.jsp 12 Sep 2005 16:25:44 -0000 1.1 @@ -0,0 +1,23 @@
+<[EMAIL PROTECTED] contentType="text/html; charset=ISO-8859-1" %> +<html> +<head> +<title>MBeans</title> +<link rel="stylesheet" href="" type="text/css"> +<link rel="stylesheet" href="" type="text/css"> +<base target="detail"> +</head> + +<body> +<script src="" language="_javascript_"></script> + +<h1>MBeans</h1> + +<ul class="mktree"> +<jsp:include page="jmx/"> + <jsp:param name="style" value="html"/> +</jsp:include> + +</ul> + +</body> +</html>
servicemix/tooling/servicemix-web/src/webapp
diff -u -r1.1 -r1.2 --- index.html 12 Sep 2005 08:44:18 -0000 1.1 +++ index.html 12 Sep 2005 16:25:44 -0000 1.2 @@ -1,46 +1,17 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html> <head>
- <title>ActiveMQ Web Connector</title> - <link rel="stylesheet" href="" type="text/css">
+<title>JMX Console</title> +<link rel="stylesheet" href="" type="text/css">
</head>
-<body> -<h1>ActiveMQ Web Connector</h1>
+<FRAMESET cols="20%, 80%"> + <FRAME name="tree" src=""> +<!-- + <FRAMESET rows="100, 200"> + <FRAME src=""> + </FRAMESET> + --> + <FRAME name="detail" src=""> +</FRAMESET>
-<p> -This service allows you to send messages to the JMS network using a -normal HTTP POST and to receive messages from a destination using a -HTTP GET. -</p> - -<h2>Market data example</h2> - -<p> -<a href="">Market data publisher</a> starts publishing -some mock market data prices -</p> - -<p> -<a href="">Porfolio</a> example shows how you could make an interactive trading portfolio which -updates in real time as the market prices change -</p> - -<h2>Chat example</h2> - -<p> -<a href="">Chat room</a> example shows how you can use Streamlets and ActiveMQ to create a simple chat room -</p> - -<h2>Simple Form based browser example</h2> - -<p> -<a href="">Send a message</a> -</p> - -<p> -<a href="">Receive a message</a> -</p> - -</body> -</html>
\ No newline at end of file
+</html>
servicemix/tooling/servicemix-web/src/webapp
portfolio.html removed after 1.1
diff -N portfolio.html --- portfolio.html 12 Sep 2005 08:44:18 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,77 +0,0 @@
-<html>
- <head>
- <title>My Portfolio</title>
- <link rel="stylesheet" href="" type="text/css">
- <style>
- .stocks { border: 1 solid black; }
- .stocks td, .stocks th { width: 200; text-align: right; }
- .stocks .up { background-color: #9f9; }
- .stocks .down { background-color: #f99; }
- </style>
- </head>
- <body >
-
- <h1>My Portfolio</h1>
-
- <p>
- This example displays an example stock portfolio.
- In a real system this page would be generated dynamically based on the
- users current stock portfolio
- </p>
-
- <table class="stocks">
- <tr>
- <th>Stock</th>
- <th>Description</th>
- <th>Amount</th>
- <th>Price</th>
- <th>Value</th>
- <th>Cost</th>
- <th>P & L</th>
- </tr>
- <tr id="IBMW">
- <td>IBMW</td>
- <td>IBM Stock</td>
- <td id="amount">1000</td>
- <td id="price"></td>
- <td id="value"></td>
- <td id="cost">19000</td>
- <td id="pl"></td>
- </tr>
- <tr id="MSFT">
- <td>MSFT</td>
- <td>Microsoft</td>
- <td id="amount">6000</td>
- <td id="price"></td>
- <td id="value"></td>
- <td id="cost">22000</td>
- <td id="pl"></td>
- </tr>
- <tr id="BEAS">
- <td>BEAS</td>
- <td>BEA Stock</td>
- <td id="amount">1100</td>
- <td id="price"></td>
- <td id="value"></td>
- <td id="cost">12342</td>
- <td id="pl"></td>
- </tr>
- <tr id="SUNW">
- <td>SUNW</td>
- <td>Sun Microsystems Inc</td>
- <td id="amount">3000</td>
- <td id="price"></td>
- <td id="value"></td>
- <td id="cost">7700</td>
- <td id="pl"></td>
- </tr>
- </table>
-
- <div id="stuff"></div>
-
- <script src="" language="_javascript_1.2"></script>
- <script src="" language="_javascript_1.2"></script>
- <script src="" language="_javascript_1.2"></script>
-
- </body>
-</html>
\ No newline at end of file
servicemix/tooling/servicemix-web/src/webapp
chat.js removed after 1.1
diff -N chat.js --- chat.js 12 Sep 2005 08:44:18 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,55 +0,0 @@
-// -----------------
-// Original code by Joe Walnes
-// -----------------
-
-function chooseNickName() {
- var newNickName = prompt("Please choose a nick name", nickName)
- if (newNickName) {
- connection.sendMessage(chatTopic, "<message type='status'>" + nickName + " is now known as " + newNickName + "</message>")
- nickName = newNickName
- }
-}
-
-// when user clicks 'send', broadcast a message
-function saySomething() {
- var text = document.getElementById("userInput").value
- connection.sendMessage(chatTopic, "<message type='chat' from='" + nickName + "'>" + text + "</message>")
- document.getElementById("userInput").value = ""
-}
-
-// when message is received from topic, display it in chat log
-function receiveMessage(message) {
- var root = message.documentElement
- var chatLog = document.getElementById("chatLog")
-
- var type = root.getAttribute('type')
- if (type == 'status') {
- chatLog.value += "*** " + elementText(root) + "\n"
- }
- else if (type == 'chat') {
- chatLog.value += "<" + root.getAttribute('from') + "> " + elementText(root) + "\n"
- }
- else {
- chatLog.value += "*** Unknown type: " + type + " for: " + root + "\n"
- }
-}
-
-// returns the text of an XML element
-function elementText(element) {
- var answer = ""
- var node = element.firstChild
- while (node != null) {
- var tmp = node.nodeValue
- if (tmp != null) {
- answer += tmp
- }
- node = node.nextSibling
- }
- return answer
-}
-
-var connection = new Connection("jms/FOO/BAR")
-var chatTopic = "FOO.BAR"
-connection.addMessageListener(chatTopic, receiveMessage)
-var nickName = "unknown"
-document.getElementById("chatLog").value = ''
servicemix/tooling/servicemix-web/src/webapp
util.js removed after 1.1
diff -N util.js --- util.js 12 Sep 2005 08:44:18 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,35 +0,0 @@
-/// -----------------
-// Original code by Joe Walnes
-// -----------------
-
-/*** Convenience methods, added as mixins to standard classes (object prototypes) ***/
-
-/**
- * Return number as fixed number of digits.
- */
-//Number.prototype.fixedDigits = function(digits) {
-function fixedDigits(t, digits) {
- return (t.toFixed) ? t.toFixed(digits) : this
-}
-
-/**
- * Find direct child of an element, by id.
- */
-// Element.prototype.find = function(id) {
-function find(t, id) {
- for (i = 0; i < t.childNodes.length; i++) {
- var child = t.childNodes[i]
- if (child.id == id) {
- return child
- }
- }
- return null
-}
-
-/**
- * Return the text contents of an element as a floating point number.
- */
-//Element.prototype.asFloat = function() {
-function asFloat(t) {
- return parseFloat(t.innerHTML)
-}
servicemix/tooling/servicemix-web/src/webapp
portfolio.js removed after 1.1
diff -N portfolio.js --- portfolio.js 12 Sep 2005 08:44:18 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,32 +0,0 @@
-// updates the portfolio row for a given message and symbol
-function updatePortfolioRow(message, destination) {
-
- var priceMessage = message.documentElement
-
- var price = parseFloat(priceMessage.getAttribute('bid'))
- var symbol = priceMessage.getAttribute('stock')
- var movement = priceMessage.getAttribute('movement')
- if (movement == null) {
- movement = 'up'
- }
-
- var row = document.getElementById(symbol)
-
- // perform portfolio calculations
- var value = asFloat(find(row, 'amount')) * price
- var pl = value - asFloat(find(row, 'cost'))
-
- // now lets update the HTML DOM
- find(row, 'price').innerHTML = fixedDigits(price, 2)
- find(row, 'value').innerHTML = fixedDigits(value, 2)
- find(row, 'pl').innerHTML = fixedDigits(pl, 2)
- find(row, 'price').className = movement
- find(row, 'pl').className = pl >= 0 ? 'up' : 'down'
-}
-
-var connection = new Connection("jms/STOCKS/*")
-
-function subscribe() {
- connection.addMessageListener(/^STOCKS\..*$/, updatePortfolioRow)
-}
-
servicemix/tooling/servicemix-web/src/webapp
chat.html removed after 1.1
diff -N chat.html --- chat.html 12 Sep 2005 08:44:18 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,20 +0,0 @@
-<html> - <head> - <title>Chat</title> - <link rel="stylesheet" href="" type="text/css"> - </head> - <body > - - <h1>Chat Example</h1> - - Welcome to this little chat example<br><br> - - <textarea id="chatLog" rows="20" cols="100"></textarea><br> - Type here: <input id="userInput" type="text" size="70"> - <button default="true">Send</button> - <button >Choose NickName</button> - - <script src="" lanaguage="_javascript_1.2"></script> - <script src="" language="_javascript_1.2"></script> - </body> -</html>
\ No newline at end of file
servicemix/tooling/servicemix-web/src/webapp
webmq.js removed after 1.1
diff -N webmq.js --- webmq.js 12 Sep 2005 08:44:18 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,132 +0,0 @@
-// -----------------
-// Original code by Joe Walnes
-// -----------------
-
-function Connection(webmqUrl, id) {
- this.messageListeners = new Array()
- this.webmqUrl = webmqUrl
- if (id == null) {
- // TODO use secure random id generation
- id = Math.round(Math.random() * 100000000)
- }
- this.id = id
- // TODO don't start anything until document has finished loading
- var http = this.createHttpControl()
- this.getNextMessageAndLoop(webmqUrl, id, http)
-}
-
-Connection.prototype.getNextMessageAndLoop = function(webmqUrl, id, http) {
- http.open("GET", webmqUrl + "?id=" + id + "&xml=true", true)
- var connection = this
- http. {
- if (http.readyState == 4) {
- var ok
- try {
- ok = http.status && http.status == 200
- }
- catch (e) {
- ok = false // sometimes accessing the http.status fields causes errors in firefox. dunno why. -joe
- }
- if (ok) {
- connection.processIncomingMessage(http)
- }
- // why do we have to create a new instance?
- // this is not required on firefox but is on mozilla
- //http.abort()
- http = connection.createHttpControl()
- connection.getNextMessageAndLoop(webmqUrl, id, http)
- }
- }
- http.send(null)
-}
-
-Connection.prototype.sendMessage = function(destination, message) {
- // TODO should post via body rather than URL
- // TODO specify destination in message
- var http = this.createHttpControl()
- http.open("POST", this.webmqUrl + "?id=" + this.id + "&body=" + message, true)
- http.send(null)
-}
-
-Connection.prototype.processIncomingMessage = function(http) {
- var destination = http.getResponseHeader("destination")
- var message = http.responseXML
- if (message == null) {
- message = http.responseText
- }
- //alert(message.responseText)
- for (var j = 0; j < this.messageListeners.length; j++) {
- var registration = this.messageListeners[j]
- if (registration.matcher(destination)) {
- registration.messageListener(message, destination)
- }
- }
-}
-
-Connection.prototype.addMessageListener = function(matcher, messageListener) {
- var wrappedMatcher
- if (matcher.constructor == RegExp) {
- wrappedMatcher = function(destination) {
- return matcher.test(destination)
- }
- }
- else if (matcher.constructor == String) {
- wrappedMatcher = function(destination) {
- return matcher == destination
- }
- }
- else {
- wrappedMatcher = matcher
- }
- this.messageListeners[this.messageListeners.length] = { matcher: wrappedMatcher, messageListener: messageListener }
-}
-
-Connection.prototype.createHttpControl = function() {
- // for details on using XMLHttpRequest see
- // http://webfx.eae.net/dhtml/xmlextras/xmlextras.html
- try {
- if (window.XMLHttpRequest) {
- var req = new XMLHttpRequest()
-
- // some older versions of Moz did not support the readyState property
- // and the onreadystate event so we patch it!
- if (req.readyState == null) {
- req.readyState = 1
- req.addEventListener("load", function () {
- req.readyState = 4
- if (typeof req. "function") {
- req.onreadystatechange()
- }
- }, false)
- }
-
- return req
- }
- if (window.ActiveXObject) {
- return new ActiveXObject(this.getControlPrefix() + ".XmlHttp")
- }
- }
- catch (ex) {}
- // fell through
- throw new Error("Your browser does not support XmlHttp objects")
-}
-
-Connection.prototype.getControlPrefix = function() {
- if (this.prefix) {
- return this.prefix
- }
-
- var prefixes = ["MSXML2", "Microsoft", "MSXML", "MSXML3"]
- var o, o2
- for (var i = 0; i < prefixes.length; i++) {
- try {
- // try to create the objects
- o = new ActiveXObject(prefixes[i] + ".XmlHttp")
- o2 = new ActiveXObject(prefixes[i] + ".XmlDom")
- return this.prefix = prefixes[i]
- }
- catch (ex) {}
- }
- throw new Error("Could not find an installed XML parser")
-}
-
servicemix/tooling/servicemix-web/src/webapp
send.html removed after 1.1
diff -N send.html --- send.html 12 Sep 2005 08:44:18 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,27 +0,0 @@
-<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> -<html> -<head> - <title>Send a JMS Message</title> - <link rel="stylesheet" href="" type="text/css"> -</head> - -<body> -<h1>Send a JMS Message</h1> - -<form action="" method="post"> - <p> - <label for="">Message body: </label> - </p> - <p> - <textarea name="body" rows="30" cols="80"> -Enter some text here for the message body... - </textarea> - </p> - <p> - <input type="submit" value="Send"/> - <input type="reset"/> - </p> -</form> - -</body> -</html>
\ No newline at end of file
servicemix/tooling/servicemix-web
diff -u -r1.1 -r1.2 --- maven.xml 12 Sep 2005 08:44:18 -0000 1.1 +++ maven.xml 12 Sep 2005 16:25:44 -0000 1.2 @@ -2,5 +2,23 @@
<!-- we want the code to be built as a jar not a war --> <goal name="default" prereqs="jar:install"/>
+ + <goal name="run" prereqs="setclasspath" + description="Runs the Web Application in an embedded Jetty server"> + + <echo>Running the Web Application</echo> + + <java classname="org.servicemix.web.JettyServer" fork="yes" maxmemory="100M"> + <classpath refid="test.classpath"/> + </java> + </goal>
+ <goal name="setclasspath" prereqs="test:compile">
+ <path id="test.classpath">
+ <pathelement path="${maven.build.dest}"/>
+ <pathelement path="target/classes"/>
+ <pathelement path="target/test-classes"/>
+ <path refid="maven.dependency.classpath"/>
+ </path>
+ </goal>
</project>
servicemix/tooling/servicemix-web/src/test/java/org/servicemix/web
JettyServer.java added at 1.1
diff -N JettyServer.java --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ JettyServer.java 12 Sep 2005 16:25:44 -0000 1.1 @@ -0,0 +1,50 @@
+package org.servicemix.web;
+/**
+ *
+ * Copyright 2005 LogicBlaze, Inc. http://www.logicblaze.com
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ **/
+
+import org.mortbay.http.SocketListener;
+import org.mortbay.jetty.Server;
+
+/**
+ * A simple bootstrap class for starting Jetty in your IDE using the local web application.
+ *
+ * @version $Revision$
+ */
+public class JettyServer {
+
+ public static final int PORT = 8080;
+
+ public static final String WEBAPP_DIR = "src/webapp";
+
+ public static final String WEBAPP_CTX = "/";
+
+ public static void main(String[] args) throws Exception {
+ int port = PORT;
+ if (args.length > 0) {
+ String text = args[0];
+ port = Integer.parseInt(text);
+ }
+ System.out.println("Starting Web Server on port: " + port);
+ Server server = new Server();
+ SocketListener listener = new SocketListener();
+ listener.setPort(port);
+ server.addWebApplication(WEBAPP_CTX, WEBAPP_DIR);
+ server.addListener(listener);
+ server.start();
+ }
+}
