[jboss-svn-commits] JBL Code SVN: r24696 - in labs/jbossesb/workspace/mlittle/legstar/product: rosetta/src/org/jboss/soa/esb/listeners/config and 11 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Jan 14 01:30:25 EST 2009


Author: jim.ma
Date: 2009-01-14 01:30:24 -0500 (Wed, 14 Jan 2009)
New Revision: 24696

Added:
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HttpListenerMapper.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpDispatchServlet.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpMessageComposer.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpRequestWrapper.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpServerDelegate.java
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/build.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/deployment.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbm-queue-service.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jboss-esb.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbossesb-properties.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jndi.properties
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/juddi.properties
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/lib/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/log4j.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/readme.txt
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/build.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/deployment.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jboss-esb.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jbossesb-properties.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jndi.properties
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/juddi.properties
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/lib/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/log4j.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/readme.txt
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/org/jboss/soa/esb/samples/quickstart/httplistener/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/org/jboss/soa/esb/samples/quickstart/httplistener/MyAction.java
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/org/jboss/soa/esb/samples/quickstart/httplistener/test/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/org/jboss/soa/esb/samples/quickstart/httplistener/test/SendEsbMessage.java
Removed:
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/TomcatListenerMapper.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatDispatchServlet.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatGatewayListener.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatMessageComposer.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatRequestWrapper.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatServer.java
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/build.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/deployment.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbm-queue-service.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jboss-esb.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbossesb-properties.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jndi.properties
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/juddi.properties
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/lib/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/log4j.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/readme.txt
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/build.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/deployment.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jboss-esb.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jbossesb-properties.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jndi.properties
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/juddi.properties
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/lib/
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/log4j.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/readme.txt
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/
Modified:
   labs/jbossesb/workspace/mlittle/legstar/product/etc/schemas/xml/jbossesb-1.0.1.xsd
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java
   labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/message/HttpMessageAwareListener.java
Log:
Renamed tomcat_provider,bus,listener to http_proider,bus and listener

Modified: labs/jbossesb/workspace/mlittle/legstar/product/etc/schemas/xml/jbossesb-1.0.1.xsd
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/etc/schemas/xml/jbossesb-1.0.1.xsd	2009-01-14 04:47:12 UTC (rev 24695)
+++ labs/jbossesb/workspace/mlittle/legstar/product/etc/schemas/xml/jbossesb-1.0.1.xsd	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1606,12 +1606,12 @@
 
 
 	<!-- 88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888
-		Tomcat Http Type Implementations.
+		Http Type Implementations.
 		88888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888888-->
-	<xsd:element name="tomcat-bus" substitutionGroup="jesb:bus">
+	<xsd:element name="http-bus" substitutionGroup="jesb:bus">
 		<xsd:annotation>
 			<xsd:documentation xml:lang="en">
-			     Tomcat Bus 
+			     Http Bus 
 			</xsd:documentation>
 		</xsd:annotation>
 		<xsd:complexType>
@@ -1629,11 +1629,11 @@
 			</xsd:complexContent>
 		</xsd:complexType>
 	</xsd:element>
-	<xsd:element name="tomcat-provider"
+	<xsd:element name="http-provider"
 		substitutionGroup="jesb:provider">
 		<xsd:annotation>
 			<xsd:documentation xml:lang="en">
-				Tomcat based http Provider.
+				Http Provider.
 			</xsd:documentation>
 		</xsd:annotation>
 		<xsd:complexType>
@@ -1642,7 +1642,7 @@
 					<xsd:attribute name="host" type="xsd:string" use="required">
 						<xsd:annotation>
 							<xsd:documentation xml:lang="en" >
-								Tomcat based Server bind address. When
+								Http Server based on JbossWeb bind address. When
 								not specified, defaults to
 								InetAddress.getLocalHost().getHostName().
 							</xsd:documentation>
@@ -1652,7 +1652,7 @@
 					<xsd:attribute name="port" type="xsd:int" use="required">
 						<xsd:annotation>
 							<xsd:documentation xml:lang="en">
-								Tomcat based http server listen port
+								Http server listening port
 							</xsd:documentation>
 						</xsd:annotation>
 					</xsd:attribute>
@@ -1661,11 +1661,11 @@
 			</xsd:complexContent>
 		</xsd:complexType>
 	</xsd:element>
-	<xsd:element name="tomcat-listener"
+	<xsd:element name="http-listener"
 		substitutionGroup="jesb:listener">
 		<xsd:annotation>
 			<xsd:documentation xml:lang="en">
-				Tomcat based http Listener.
+				http Listener.
 			</xsd:documentation>
 		</xsd:annotation>
 		<xsd:complexType>

Modified: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java	2009-01-14 04:47:12 UTC (rev 24695)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -29,6 +29,7 @@
 import org.jboss.soa.esb.dom.YADOMUtil;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.FsListenerDocument.FsListener;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.FtpListenerDocument.FtpListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.HttpListenerDocument.HttpListener;
 import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.JmsBusDocument.JmsBus;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.JmsJcaProviderDocument.JmsJcaProvider;
@@ -39,7 +40,6 @@
 import org.jboss.soa.esb.listeners.config.xbeanmodel.SqlListenerDocument.SqlListener;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.SqlProviderDocument.SqlProvider;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.ScheduledListenerDocument.ScheduledListener;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.TomcatListenerDocument.TomcatListener;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.*;
 import org.jboss.soa.esb.listeners.config.mappers.*;
 import org.jboss.soa.esb.listeners.ListenerTagNames;
@@ -205,8 +205,8 @@
             return;
         } else if (listener instanceof GroovyListenerDocument.GroovyListener) {
             listenerConfigTree = GroovyListenerMapper.map(root, (GroovyListenerDocument.GroovyListener)listener, model);
-		} else if (listener instanceof TomcatListener) {
-			listenerConfigTree = TomcatListenerMapper.map(root, (TomcatListener) listener, model);   
+		} else if (listener instanceof HttpListener) {
+			listenerConfigTree = HttpListenerMapper.map(root, (HttpListener) listener, model);   
 	    } else {
 			listenerConfigTree = UntypedListenerMapper.map(root, listener, model);
 		}

Modified: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java	2009-01-14 04:47:12 UTC (rev 24695)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -32,11 +32,11 @@
 import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.GroovyListenerDocument.GroovyListener;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.HibernateListenerDocument.HibernateListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.HttpListenerDocument.HttpListener;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.JbrListenerDocument.JbrListener;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.JmsListenerDocument.JmsListener;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.ServiceDocument.Service;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.SqlListenerDocument.SqlListener;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.TomcatListenerDocument.TomcatListener;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.Listener;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.JcaGatewayDocument;
 import org.jboss.soa.esb.listeners.config.xbeanmodel.AbstractScheduledListener;
@@ -140,8 +140,8 @@
             listenerConfig = SqlListenerMapper.map(root, (SqlListener) gateway, model);
         } else if (gateway instanceof JbrListener) {
             listenerConfig = JbrListenerMapper.map(root, (JbrListener) gateway, model);
-        } else if (gateway instanceof TomcatListener) {
-            listenerConfig = TomcatListenerMapper.map(root, (TomcatListener) gateway, model);    
+        } else if (gateway instanceof HttpListener) {
+            listenerConfig = HttpListenerMapper.map(root, (HttpListener) gateway, model);    
         } else if (gateway instanceof GroovyListener) {
             listenerConfig = GroovyListenerMapper.map(root, (GroovyListener) gateway, model);
         } else if (gateway instanceof HibernateListener) {

Copied: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HttpListenerMapper.java (from rev 24571, labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/TomcatListenerMapper.java)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HttpListenerMapper.java	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HttpListenerMapper.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.config.mappers;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.PropertyDocument.Property;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.HttpBusDocument.HttpBus;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.HttpListenerDocument.HttpListener;
+import org.jboss.soa.esb.listeners.config.xbeanmodel.HttpProviderDocument.HttpProvider;
+import org.jboss.soa.esb.listeners.gateway.HttpGatewayListener;
+import org.jboss.soa.esb.listeners.message.HttpMessageAwareListener;
+import org.w3c.dom.Element;
+
+/**
+ * Http listener mapper.
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpListenerMapper {
+	 /**
+     * Perform the Http listener mapping.
+     * @param root The "ConfigTree" configuration root node.
+     * @param listener http listener config.
+     * @param model The configuration model from which the mapping is being performed.
+     * @return The ConfigTree listener configuration node.
+     * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+     */
+    public static Element map(Element root, HttpListener listener, XMLBeansModel model) throws ConfigurationException {
+        Element listenerNode = YADOMUtil.addElement(root, "listener");
+        HttpBus bus;
+        HttpProvider provider;
+        
+        listenerNode.setAttribute("name", listener.getName());
+
+        try {
+            bus = (HttpBus) model.getBus(listener.getBusidref());
+        } catch (ClassCastException e) {
+            throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <http-listener> must reference a <http-bus>.");
+        }
+        try {
+            provider = (HttpProvider) model.getProvider(bus);
+            
+        } catch (ClassCastException e) {
+            throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <http-provider> instance.  Unexpected exception - this should have caused a validation error!");
+        }
+
+        // Map the standard listener attributes - common across all listener types...
+        MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+        // Map the <property> elements targeted at the listener - from the listener itself.
+        //MapperUtil.mapProperties(provider.getPropertyList(), listenerNode);
+        for(Property property : provider.getPropertyList()) {
+            Element propertyElement = listenerNode.getOwnerDocument().createElement("property");
+            MapperUtil.serialize(property, propertyElement);
+            listenerNode.appendChild(propertyElement);           
+         }
+        
+        
+        
+        
+        MapperUtil.mapProperties(bus.getPropertyList(), listenerNode);
+        MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+
+        if(listener.getIsGateway()) {
+            String host = provider.getHost();
+            int port = provider.getPort();
+            
+            listenerNode.setAttribute("gatewayClass", HttpGatewayListener.class.getName());
+			listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, Boolean.toString(listener.getIsGateway()));
+
+            if(host != null) {
+                listenerNode.setAttribute(HttpGatewayListener.SERVER_HOST_TAG, host);
+            }
+            listenerNode.setAttribute(HttpGatewayListener.REQUEST_CONTEXT_TAG, bus.getContext());
+            listenerNode.setAttribute(HttpGatewayListener.SERVER_PORT_TAG, Integer.toString(port));
+        } else {
+			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+
+			
+			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
+			//mapJmsEprProperties(eprNode, provider, messageFilter);
+			eprNode.setAttribute(ListenerTagNames.PROTOCOL_TAG, HTTPEpr.HTTP_PROTOCOL);
+             
+			eprNode.setAttribute(ListenerTagNames.HOST_TAG, provider.getHost());
+			
+			eprNode.setAttribute(ListenerTagNames.PORT_TAG, Integer.toString(provider.getPort()));
+			eprNode.setAttribute(ListenerTagNames.CONTEXT_TAG, bus.getContext());
+			
+			listenerNode.setAttribute(ListenerTagNames.LISTENER_CLASS_TAG, HttpMessageAwareListener.class.getName());
+			YADOMUtil.removeEmptyAttributes(eprNode);
+        }
+
+        return listenerNode;
+    }
+}

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/TomcatListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/TomcatListenerMapper.java	2009-01-14 04:47:12 UTC (rev 24695)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/TomcatListenerMapper.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,116 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.config.mappers;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.PropertyDocument.Property;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.TomcatBusDocument.TomcatBus;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.TomcatListenerDocument.TomcatListener;
-import org.jboss.soa.esb.listeners.config.xbeanmodel.TomcatProviderDocument.TomcatProvider;
-import org.jboss.soa.esb.listeners.gateway.TomcatGatewayListener;
-import org.jboss.soa.esb.listeners.message.HttpMessageAwareListener;
-import org.jboss.soa.esb.listeners.message.MessageAwareListener;
-import org.w3c.dom.Element;
-
-/**
- * Http listener mapper.
- * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
- */
-public class TomcatListenerMapper {
-	 /**
-     * Perform the Tomcat listener mapping.
-     * @param root The "ConfigTree" configuration root node.
-     * @param listener tomcat listener config.
-     * @param model The configuration model from which the mapping is being performed.
-     * @return The ConfigTree listener configuration node.
-     * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
-     */
-    public static Element map(Element root, TomcatListener listener, XMLBeansModel model) throws ConfigurationException {
-        Element listenerNode = YADOMUtil.addElement(root, "listener");
-        TomcatBus bus;
-        TomcatProvider provider;
-        
-        listenerNode.setAttribute("name", listener.getName());
-
-        try {
-            bus = (TomcatBus) model.getBus(listener.getBusidref());
-        } catch (ClassCastException e) {
-            throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <http-listener> must reference a <http-bus>.");
-        }
-        try {
-            provider = (TomcatProvider) model.getProvider(bus);
-            
-        } catch (ClassCastException e) {
-            throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <http-provider> instance.  Unexpected exception - this should have caused a validation error!");
-        }
-
-        // Map the standard listener attributes - common across all listener types...
-        MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
-        // Map the <property> elements targeted at the listener - from the listener itself.
-        //MapperUtil.mapProperties(provider.getPropertyList(), listenerNode);
-        for(Property property : provider.getPropertyList()) {
-            Element propertyElement = listenerNode.getOwnerDocument().createElement("property");
-            MapperUtil.serialize(property, propertyElement);
-            listenerNode.appendChild(propertyElement);           
-         }
-        
-        
-        
-        
-        MapperUtil.mapProperties(bus.getPropertyList(), listenerNode);
-        MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
-
-        if(listener.getIsGateway()) {
-            String host = provider.getHost();
-            int port = provider.getPort();
-            
-            listenerNode.setAttribute("gatewayClass", TomcatGatewayListener.class.getName());
-			listenerNode.setAttribute(ListenerTagNames.IS_GATEWAY_TAG, Boolean.toString(listener.getIsGateway()));
-
-            if(host != null) {
-                listenerNode.setAttribute(TomcatGatewayListener.SERVER_HOST_TAG, host);
-            }
-            listenerNode.setAttribute(TomcatGatewayListener.REQUEST_CONTEXT_TAG, bus.getContext());
-            listenerNode.setAttribute(TomcatGatewayListener.SERVER_PORT_TAG, Integer.toString(port));
-        } else {
-			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
-
-			
-			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
-			//mapJmsEprProperties(eprNode, provider, messageFilter);
-			eprNode.setAttribute(ListenerTagNames.PROTOCOL_TAG, HTTPEpr.HTTP_PROTOCOL);
-             
-			eprNode.setAttribute(ListenerTagNames.HOST_TAG, provider.getHost());
-			
-			eprNode.setAttribute(ListenerTagNames.PORT_TAG, Integer.toString(provider.getPort()));
-			eprNode.setAttribute(ListenerTagNames.CONTEXT_TAG, bus.getContext());
-			
-			listenerNode.setAttribute(ListenerTagNames.LISTENER_CLASS_TAG, HttpMessageAwareListener.class.getName());
-			YADOMUtil.removeEmptyAttributes(eprNode);
-        }
-
-        return listenerNode;
-    }
-}

Copied: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpDispatchServlet.java (from rev 24571, labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatDispatchServlet.java)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpDispatchServlet.java	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpDispatchServlet.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,237 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import java.io.IOException;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.couriers.FaultMessageException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * This class is for dispatching the http request to ESB action process pipe
+ * line.By default, this servlet will be used to set to default servlet mapping
+ * in the created StandardContext.
+ * This class will also return the esb error message and error stack trace to client 
+ * 
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpDispatchServlet extends HttpServlet {
+	private static final long serialVersionUID = 1L;
+
+    private static final String METHOD_DELETE = "DELETE";
+    private static final String METHOD_HEAD = "HEAD";
+    private static final String METHOD_GET = "GET";
+    private static final String METHOD_OPTIONS = "OPTIONS";
+    private static final String METHOD_POST = "POST";
+    private static final String METHOD_PUT = "PUT";
+    private static final String METHOD_TRACE = "TRACE";
+	
+	/** If this a synchronous invocation * */
+	private boolean synchronous = true;
+	
+	/** asyncResponse file location */
+    private String asyncResponse = null;
+
+    private int serviceTimeout = 20000;
+	
+	/** Default allow http method list */
+    private String allowHttpMethods = "POST,GET";
+
+	/** ESB message delivery adapter */
+	public UncomposedMessageDeliveryAdapter messageDeliveryAdapter = null;
+
+	/**
+	 * Initilize method
+	 * 
+	 * @throws ServletException
+	 *             If error occured
+	 */
+	public void init() throws ServletException {
+		ConfigTree config = (ConfigTree) getServletContext().getAttribute(
+				"config");
+		synchronous = !config.getAttribute("synchronous", "true").equalsIgnoreCase("false");
+
+		serviceTimeout = Integer.parseInt(config.getAttribute("serviceTimeout", "20000"));
+
+		asyncResponse = config.getAttribute("asyncResponse");
+				
+		try {
+			messageDeliveryAdapter = UncomposedMessageDeliveryAdapter
+					.getGatewayDeliveryAdapter(config,
+							new HttpMessageComposer<HttpRequestWrapper>());
+		} catch (ConfigurationException e) {
+			throw new ServletException(e);
+		}
+		
+		if (config.getAttribute(ListenerTagNames.ALLOW_HTTP_METHOD) != null) {
+			allowHttpMethods = config.getAttribute(ListenerTagNames.ALLOW_HTTP_METHOD).toUpperCase();
+		}
+
+	}
+
+	/**
+	 * Service method to process the inboud servlet request and reply the http
+	 * servlet response
+	 * 
+	 * @param request
+	 *            HttpServlet request
+	 * @param response
+	 *            HttpServlet response
+	 * @param content
+	 * @throws ServletException
+	 *             For error occured during process
+	 */
+	protected void serveRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+        
+		String servletPath = request.getServletPath();
+		
+		//block the invalid request 
+		if (!"/".equals(servletPath)) {
+			response.setStatus(404);
+			return;
+		}
+		
+		HttpRequestWrapper wrapper = new HttpRequestWrapper(request, response);
+       
+		try {
+			if (synchronous) {
+				messageDeliveryAdapter.deliverSync(wrapper, serviceTimeout);
+			} else {
+				messageDeliveryAdapter.deliverAsync(wrapper);
+				if (asyncResponse != null) {			       
+					response.getOutputStream().write(StreamUtils.readStream(getClass().getResourceAsStream(asyncResponse)));			        
+				} 
+			}
+		} catch (FaultMessageException fme) {
+			Message faultMessage = fme.getReturnedMessage();
+			if (faultMessage != null) {
+				Object obj = faultMessage.getProperties().getProperty(HttpMessageComposer.HTTP_RESPONSE_STATUS);
+			    if (obj != null && obj instanceof Integer) {
+			    	response.setStatus((Integer)obj);
+			    } else {
+			    	response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+			    }
+			    
+			    fme.printStackTrace(response.getWriter());			    
+			}
+			
+		} catch (Exception ex) {
+			response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
+			ex.printStackTrace(response.getWriter());
+		} 
+
+	}
+	
+	@Override
+	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+		if (isSupportMethod(METHOD_GET)) {
+			serveRequest(request, response);
+		} else {
+			super.doGet(request, response);
+		}
+	}
+	
+	@Override
+	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+		if (isSupportMethod(METHOD_POST)) {
+			serveRequest(request, response);
+		} else {
+			super.doPost(request, response);
+		}
+	}
+	
+	@Override
+	protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+		if (isSupportMethod(METHOD_PUT)) {
+			serveRequest(request, response);
+		} else {
+			super.doPut(request, response);
+		}
+	}
+	@Override
+	protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
+		if (isSupportMethod(METHOD_DELETE)) {
+			serveRequest(request, response);
+		} else {
+			super.doDelete(request, response);
+		}
+	}
+	
+	 protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
+
+		boolean ALLOW_GET = isSupportMethod(METHOD_GET);
+		boolean ALLOW_HEAD = ALLOW_GET;
+		boolean ALLOW_POST = isSupportMethod(METHOD_POST);
+		boolean ALLOW_PUT = isSupportMethod(METHOD_PUT);
+		boolean ALLOW_DELETE = isSupportMethod(METHOD_DELETE);
+		boolean ALLOW_TRACE = true;
+		boolean ALLOW_OPTIONS = true;
+
+		String allow = null;
+		if (ALLOW_GET)
+			if (allow == null) allow = METHOD_GET;
+		if (ALLOW_HEAD)
+			if (allow == null) allow = METHOD_HEAD;
+			else
+				allow += ", " + METHOD_HEAD;
+		if (ALLOW_POST)
+			if (allow == null) allow = METHOD_POST;
+			else
+				allow += ", " + METHOD_POST;
+		if (ALLOW_PUT)
+			if (allow == null) allow = METHOD_PUT;
+			else
+				allow += ", " + METHOD_PUT;
+		if (ALLOW_DELETE)
+			if (allow == null) allow = METHOD_DELETE;
+			else
+				allow += ", " + METHOD_DELETE;
+		if (ALLOW_TRACE)
+			if (allow == null) allow = METHOD_TRACE;
+			else
+				allow += ", " + METHOD_TRACE;
+		if (ALLOW_OPTIONS)
+			if (allow == null) allow = METHOD_OPTIONS;
+			else
+				allow += ", " + METHOD_OPTIONS;
+
+		resp.setHeader("Allow", allow);
+	}
+	 
+	 
+	/**
+	 * Check if support this http method
+	 * @param http method name
+	 * @return true if supported or false if not supported
+	 */
+	private boolean isSupportMethod(String name) {
+		return allowHttpMethods.indexOf(name) >= 0;
+	}		
+}

Copied: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java (from rev 24603, labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatGatewayListener.java)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpGatewayListener.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,463 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import java.net.URI;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Set;
+
+import javax.management.InstanceNotFoundException;
+import javax.management.ObjectName;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.LinkRef;
+import javax.naming.NamingException;
+
+import org.apache.catalina.LifecycleException;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.core.StandardWrapper;
+import org.apache.catalina.deploy.LoginConfig;
+import org.apache.catalina.deploy.SecurityCollection;
+import org.apache.catalina.deploy.SecurityConstraint;
+import org.apache.catalina.loader.WebappLoader;
+import org.apache.catalina.startup.ContextConfig;
+import org.apache.log4j.Logger;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.naming.Util;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.RegistryFactory;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Tomcat Listener provids the functionality to pass the http request 
+ * to ESB service . 
+ * <p> This class will generate {@link org.apache.catalina.connector.Connector}, 
+ * {@link org.apache.catalina.core.StandardHost} and {@link org.apache.catalina.core.StandardContext} 
+ * for user defined http port, host and context. These generated tomcat components will be 
+ * attached to jboss embeded tomcat(aka jboss web). You can monitor and control these new generated
+ * components through jboss JMX console.  When this listener is stoped, these components will be 
+ * destoried automatically.
+ * 
+ * <p>The different tomcat listner can be started in same port with different context.for example: 
+ * <code> http://localhost:8765/jbossesb/servicecategory/servicename </code>
+ *
+ * <p>This class uses the {@link org.jboss.soa.esb.listeners.gateway.HttpMessageComposer}
+ * by default.
+ * @see org.jboss.soa.esb.listeners.gateway.HttpMessageComposer
+ * @see Torg.jboss.soa.esb.listeners.gateway.HttpDispatchServlet 
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpGatewayListener extends AbstractManagedLifecycle {
+
+	private static final long serialVersionUID = 1L;
+	
+	
+	private static Logger logger = Logger.getLogger(HttpGatewayListener.class);
+
+    
+	/**The tag used to read the host value from configuration */
+	public static String SERVER_HOST_TAG = "http_host";
+	
+	/**The tag used to read the port value from configuration */	
+	public static String SERVER_PORT_TAG = "http_port";
+	
+	/**The tag used to read the context value from configuration */	
+	public static String REQUEST_CONTEXT_TAG = "http_context";
+	
+	/**The tag used to read the dispatch servlet class name value from configuration */	
+	public static String DISPATCH_SERVLET_CLASS = "dispatch_servlet";
+	
+	/**Http host value*/
+	public String host = null;
+	
+	/**Http port value*/
+	public String port = null;
+	
+	/**listener contenxt */
+	public String httpContext = null;
+
+	/** Endpoint reference that presents this listener */
+	private EPR endpointReference = null;
+	
+	/**Service category*/
+	private String serviceCategory = null;
+	
+	/**Service name*/
+	private String serviceName = null;
+		
+	/**The new created tomcat standard context, it reprents a web app*/
+	private StandardContext ctx = null;
+			
+	/** The default servlet used to dispatch the http request to ESB service*/
+	private String dispatchServletClassName = TomcatDispatchServlet.class.getName();
+	
+	/** Protocol value */
+	private Object protocol = "http";
+	
+	/** Imply if the port number is the jboss.web used, if yes , the new created context will be attched to jboss web Servlet engine */
+	private boolean useJBossWebServletEngine = false;
+    
+	/**Constuct the TomcatGatewyListner
+	 * @param config The listener configuration
+	 * @throws ConfigurationException Exception during construction
+	 */
+	@SuppressWarnings("unchecked")
+	public HttpGatewayListener(ConfigTree config) throws ConfigurationException {
+		super(config);
+		host = config.getAttribute(SERVER_HOST_TAG);
+		port = config.getAttribute(SERVER_PORT_TAG);
+		httpContext = config.getAttribute(REQUEST_CONTEXT_TAG);		
+		serviceCategory = config.getAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG);
+		serviceName = config.getAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG);
+		
+		if (config.getAttribute(DISPATCH_SERVLET_CLASS) != null) {
+			dispatchServletClassName = config.getAttribute(DISPATCH_SERVLET_CLASS);
+		}
+				
+        boolean synchronous = !config.getAttribute("synchronous", "true").equalsIgnoreCase("false");
+        if (!synchronous) {
+			String asyncResponse = config.getAttribute("asyncResponse");
+			if (asyncResponse != null) {
+				if (ClassUtil.getResourceAsStream(asyncResponse, getClass()) == null) {
+					throw new ConfigurationException("Asynchronous response resource file '" + asyncResponse
+									+ "' not found on classpath.");
+				}
+			}
+		}
+        
+        //validate allow http method configuration
+        if (config.getAttribute(ListenerTagNames.ALLOW_HTTP_METHOD) != null) {
+        	String allowMethods = config.getAttribute(ListenerTagNames.ALLOW_HTTP_METHOD);
+        	String[] methods = allowMethods.split(",");
+        	List<String> standardMesthods = new ArrayList<String>();
+        	standardMesthods.add("GET");
+        	standardMesthods.add("POST");
+        	standardMesthods.add("DELETE");
+        	standardMesthods.add("PUT");
+        	standardMesthods.add("OPTIONS");
+        	standardMesthods.add("HEAD");
+        	standardMesthods.add("TRACE");
+        	
+        	for (String method : methods) {
+        		if (!standardMesthods.contains(method.toUpperCase())) {
+        			throw new ConfigurationException("Invalid allow http method configuration, please specify the specify method list with comma-separated(e.g. POST,GET,PUT,DELETE"); 
+        		}
+        	}
+        }
+        		
+		try {			
+			Set ports = HttpServerDelegate.getInstance().queryObjects("jboss.web:port="+ port+",type=Connector,*");
+			if (ports.size() > 0) {
+				Set hosts = HttpServerDelegate.getInstance().queryObjects("jboss.web:host=" + host +",type=Host");
+				if (hosts.isEmpty()) {
+					throw new ConfigurationException(new InstanceNotFoundException("ObjectName: "+ "jboss.web:host=" + host +",type=Host" + "Not found")); 
+				}
+				Set contexts = HttpServerDelegate.getInstance().queryObjects("jboss.web:host=" + host + ",path=" + httpContext + ",*");
+				if (contexts.size() > 0) {
+					throw new ConfigurationException("There is already an http context named " + httpContext + ", choose another one"); 
+				}
+				
+				//the created context will be attached jboss.web domain
+				useJBossWebServletEngine = true;
+			} else {
+				//if the port is not the jboss.web used, check if the http context name is duplicate
+				Set contexts = HttpServerDelegate.getInstance().queryObjects(HttpServerDelegate.DOMAIN_NAME + ":host=" + host + ",path=" + httpContext + ",*");
+				if (contexts.size() > 0) {
+					throw new ConfigurationException("There is already an http context named " + httpContext + ", choose another one"); 
+				}
+			}
+		} catch (Exception e) {
+			throw new ConfigurationException(e);
+		}
+		
+		//Check the http security configuration 
+		if (config.getAttribute(ListenerTagNames.AUTH_METHOD) != null) {
+			if (config.getAttribute(ListenerTagNames.SECURITY_DOMAIN) == null) {
+				throw new ConfigurationException("Security domain configuration for this context not found for http authentication method " + config.getAttribute(ListenerTagNames.AUTH_METHOD)); 
+			}
+			
+			if (config.getAttribute(ListenerTagNames.SECURITY_ROLE) == null) {
+				throw new ConfigurationException("Security role configuration for this context not found for http authentication method " + config.getAttribute(ListenerTagNames.AUTH_METHOD));  
+			}			
+        }
+	}
+
+	/*
+	 * Start the Tomcat listner
+	 * 
+	 * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doStart()
+	 */
+	protected void doStart() throws ManagedLifecycleException {
+
+		try {
+			startHttpServer();
+		} catch (Exception e) {
+			throw new ManagedLifecycleException(
+					"Failed to start Http gateway listener", e);
+		}
+		
+		try {
+			registerEndpoint();
+		} catch (Throwable t) {
+			logger.error("Unable to register service endpoint '" + endpointReference.getAddr().getAddress()
+                    + "' for service '" + serviceCategory + ":" + serviceName + "'.  Stopping Http Listener Server...", t);
+			try {
+				stopHttpServer();
+			} catch (Exception e) {
+				throw new ManagedLifecycleException(
+						"Failed to stop Http gateway listener", e);
+			}
+		} 
+	}
+
+	/*
+	 * Stop the tomcat listener
+	 * 
+	 * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doStop()
+	 */
+	protected void doStop() throws ManagedLifecycleException {
+		unregisterEndpoint();
+		try {
+			stopHttpServer();
+		} catch (Exception e) {
+			throw new ManagedLifecycleException(
+					"Failed to stop Http gateway listener", e);
+		}
+		
+		
+	}
+
+	/*
+	 * Initialize the tomcat listener
+	 * 
+	 * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doInitialise()
+	 */
+	protected void doInitialise() throws ManagedLifecycleException {
+		
+	}
+
+	/*
+	 * Destory the tomcat listener
+	 * 
+	 * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doDestroy()
+	 */
+	protected void doDestroy() throws ManagedLifecycleException {
+	}
+	
+	
+	
+	/**
+	 * Start the tomcat http server.It will check if it really needs to create
+	 * Tomcat connector and host. Then add these new tomcat component to tomcat Engine 
+	 * tree through JMX server.
+	 * @throws Exception For error during start tomcat context
+	 */
+	@SuppressWarnings("unchecked")
+	protected void startHttpServer() throws Exception {
+		
+		ctx = new StandardContext();
+		URL[] urls = new URL[]{};
+		URLClassLoader urlClassLoader = new URLClassLoader(urls, getClass().getClassLoader());
+		
+		WebappLoader loader = new WebappLoader(urlClassLoader);
+		ctx.setLoader(loader);
+		ContextConfig ctxCfg = new ContextConfig();
+		ctx.addLifecycleListener(ctxCfg);
+		
+		ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML");
+		ctx.setPath(httpContext);
+		ctx.setDocBase(".");
+		
+		
+		ClassLoader oldloader = Thread.currentThread().getContextClassLoader();
+		Thread.currentThread().setContextClassLoader(urlClassLoader);
+		initWebappDefaults(ctx);
+		Thread.currentThread().setContextClassLoader(oldloader);
+		String connectorName = HttpServerDelegate.DOMAIN_NAME + ":port=" + port + ",type=Connector,*";
+		
+		if (!useJBossWebServletEngine) {           
+			HttpServerDelegate.getInstance().createHost(host);
+
+			List<KeyValuePair> properties = getConfig().childPropertyList();
+			String maxThreads = getConfig().getAttribute(
+					ListenerTagNames.MAX_THREADS_TAG);
+			if (maxThreads != null) {
+				properties.add(new KeyValuePair("maxThreads", maxThreads));
+			}
+			HttpServerDelegate.getInstance().createConnector(port, properties);
+			HttpServerDelegate.getInstance().addContext(host, ctx);
+		} else {
+			//add it to jboss.web servlet engine
+			connectorName = "jboss.web:port=" + port + ",type=Connector,*";			
+			HttpServerDelegate.getInstance().addContext(new ObjectName("jboss.web:host=" + host + ",type=Host"), ctx);
+		}			
+		
+		Set connectors = HttpServerDelegate.getInstance().queryObjects(connectorName);
+		if (connectors.isEmpty()) {
+			throw new javax.management.InstanceNotFoundException("ObjectName: "+ connectorName + "Not found");
+		}
+		ObjectName obj = (ObjectName)connectors.iterator().next();
+		try {
+	        protocol = MBeanServerLocator.locateJBoss().getAttribute(obj, "scheme");
+		} catch (Exception e) {
+            //do nothing and use default http
+			protocol = "http";
+		} 
+
+	}
+
+    /**Register this endpoint
+     * @throws ConfigurationException For configuration error
+     * @throws RegistryException For registry error when register this EPR
+     */
+    private void registerEndpoint() throws ConfigurationException, RegistryException {
+    	try {
+			endpointReference = new EPR(new URI(protocol + "://"+ host + ":" + port + this.httpContext));
+		} catch (Exception e) {
+			throw new RegistryException("Tomcat gateway listener registration failed", e);
+		}
+    	String serviceDescription = getConfig().getAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG);
+        RegistryFactory.getRegistry().registerEPR(serviceCategory, serviceName, serviceDescription,
+                endpointReference, endpointReference.getAddr().getAddress());
+    }
+
+    /**Unregister this endpoint
+     */
+    private void unregisterEndpoint() {
+        try {
+            RegistryFactory.getRegistry().unRegisterEPR(serviceCategory, serviceName, endpointReference);
+        } catch (Throwable t) {
+            logger.error("Unable to unregister service endpoint '" + endpointReference.getAddr().getAddress()
+                    + "' for service '" + serviceCategory + ":" + serviceName + "'.", t);
+        }
+    }
+    
+	/**Stop tomcat server. It will destory the generated tomcat connector or host . 
+	 * Before do it , it will check if the reference count for it is zero .When there 
+	 * is no tomcat listner uses the generated host or connector, it will destory it 
+	 * @throws Exception For errors during stop tomcat connector or host
+	 */
+    @SuppressWarnings("unchecked")
+	public void stopHttpServer() throws Exception {
+		
+		//Destroy the created context     
+        if (!useJBossWebServletEngine) {
+        	 HttpServerDelegate.getInstance().destroyContext(host, port, httpContext);
+        } else {
+		     Set<ObjectName> contexts = HttpServerDelegate.getInstance().queryObjects("jboss.web:j2eeType=WebModule,name=//" + host + httpContext + ",*");
+		     for (ObjectName obName : contexts) {
+		        HttpServerDelegate.getInstance().destroyContext(obName);
+		     }
+	    }
+    }
+	
+	/**Get the uncomposed message delivery dapater
+	 * @return uncomposed message delivery adapter 
+	 * @throws ConfigurationException For configuation error 
+	 */
+	protected UncomposedMessageDeliveryAdapter createDeliveryAdapter()
+			throws ConfigurationException {
+		return UncomposedMessageDeliveryAdapter.getGatewayDeliveryAdapter(
+				getConfig(),
+				new HttpMessageComposer<HttpRequestWrapper>());
+	}
+
+	/**Initialize the StandardContext.By default it will uses 
+	 * {@link org.jboss.soa.esb.listeners.gateway.TomcatDefaultServlet} as default servlet mapping
+	 * @param ctx Created tomcat standard context
+	 * @throws Exception For errors during initialization
+	 */
+	protected void initWebappDefaults(StandardContext ctx) throws Exception {
+		if (isHttpAuthConfiured()) { 
+			
+			InitialContext iniCtx = new InitialContext();
+        	
+			Context envCtx;
+        	try {
+        		envCtx = (Context) iniCtx.lookup("java:comp/env");
+        	} catch (NamingException e) {
+        		envCtx = (Context) iniCtx.lookup("java:comp");
+        		envCtx = envCtx.createSubcontext("env");
+        	}
+        	
+        	String securityDomain = getConfig().getAttribute(ListenerTagNames.SECURITY_DOMAIN);
+        	Util.bind(envCtx, "security/securityMgr", new LinkRef(securityDomain));
+        	Util.bind(envCtx, "security/realmMapping", new LinkRef(securityDomain));
+        	Util.bind(envCtx, "security/security-domain", new LinkRef(securityDomain));
+        	Util.bind(envCtx, "security/subject", new LinkRef(securityDomain));
+		}
+		
+	    StandardWrapper sw = (StandardWrapper) ctx.createWrapper();
+		
+		sw.setServletClass(dispatchServletClassName);
+		sw.setName("default");
+		ctx.addChild(sw);
+		ctx.getServletContext().setAttribute("config", this.getConfig());
+
+		sw.addInitParameter("listings", "false");
+		sw.setLoadOnStartup(1);
+
+		try {
+			sw.start();
+		} catch (LifecycleException e) {
+			logger.error("Unexpected error when start the default servlet");
+			throw e;
+		}
+		ctx.addServletMapping("/", "default");
+		
+		
+		//Add security support 
+		if (isHttpAuthConfiured()) {
+			String securityRole = this.getConfig().getAttribute(ListenerTagNames.SECURITY_ROLE);
+			SecurityConstraint constraint = new SecurityConstraint();
+			constraint.addAuthRole(securityRole);
+			SecurityCollection collection = new SecurityCollection("all");
+			collection.addPattern("/*");
+			constraint.addCollection(collection);
+			ctx.addConstraint(constraint);
+
+			ctx.addSecurityRole(securityRole);
+
+			String authMethod = this.getConfig().getAttribute(ListenerTagNames.AUTH_METHOD);
+			LoginConfig config = new LoginConfig(authMethod, securityRole,
+					null, null);
+			ctx.setLoginConfig(config);
+		}
+	}
+	
+	private boolean isHttpAuthConfiured() {
+		if (getConfig().getAttribute(ListenerTagNames.AUTH_METHOD) != null) {
+			return true;
+		} 
+		return false;
+	}
+
+}
\ No newline at end of file

Copied: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpMessageComposer.java (from rev 24571, labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatMessageComposer.java)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpMessageComposer.java	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpMessageComposer.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,195 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import java.io.IOException;
+import java.util.Enumeration;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import org.apache.commons.beanutils.BeanUtils;
+import org.apache.tomcat.util.IntrospectionUtils;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.AbstractMessageComposer;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.MessagePayloadProxy;
+import org.jboss.soa.esb.message.MessagePayloadProxy.NullPayloadHandling;
+import org.jboss.soa.esb.message.body.content.BytesBody;
+/**
+ * TomcatMessageComposer class is used to compose the HttpServletRquest
+ * to ESB aware message and decompse the ESB aware message to HttpServletRespones 
+ * <p>
+ * This class will put the http request header and other requst information in ESB message properties with the key "RequestInfoMap".
+ * <p>If the request is the submitted from html form(with the <code>Content-Type: application/x-www-form-urlencoded</code>), HttpServletRequest.getParameterMap() result) 
+ * will be put in ESB message properties. The key for it is "RequestParamterMap". It put the the byte array read from request inputstream in message payload.
+ * <p>In decompose process, the header map in message properties will be added 
+ * in HttpServletResponse. The value for "ReponseStatus" store in ESB message properties will 
+ * put in the http response. The message payload byte[] or String object will be wrote to HttpServletResponse. 
+ * If the object in message payload is not byte[],it will throw exception when the ESB message
+ * is decomposed
+ *  
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpMessageComposer<T extends HttpRequestWrapper>
+		extends AbstractMessageComposer<T> {
+	
+	/** Request parameter map key in esb message properties */
+	public static final String HTTP_REQUEST_PARAMETER_MAP = "RequestParameterMap";
+	
+	/** Request information map key in esb message properties */
+	public static final String HTTP_REQUEST_INFO_MAP = "RequestInfoMap";
+	
+	/** Reponse header map key in esb message properties */
+	public static final String HTTP_RESPONSE_HEADER_MAP = "ResponseHeaderMap";
+	
+	/** Response status key in esb message properties */
+	public static final String HTTP_RESPONSE_STATUS = "ReponseStatus";
+
+	/** Message payload proxy */
+	private MessagePayloadProxy payloadProxy;
+
+	/* 
+	 * Method for configue the payload proxy 
+	 */
+	public void setConfiguration(ConfigTree config) {
+		super.setConfiguration(config);
+		payloadProxy = new MessagePayloadProxy(config, new String[] {
+				ActionUtils.POST_ACTION_DATA, Body.DEFAULT_LOCATION,
+				BytesBody.BYTES_LOCATION },
+				new String[] { ActionUtils.POST_ACTION_DATA });
+		payloadProxy.setNullSetPayloadHandling(NullPayloadHandling.LOG);
+	}
+
+	protected MessagePayloadProxy getPayloadProxy() {
+		return payloadProxy;
+	}
+
+	/* 
+	 *Method for populating the ESB aware message from a HttpServletRequest 	 
+	 */
+	@SuppressWarnings("unchecked")
+	protected void populateMessage(Message message, T requestWrapper)
+			throws MessageDeliverException {
+		HttpServletRequest request = requestWrapper.getRequest();
+		Map paraMap = request.getParameterMap();;
+		byte[] bodyBytes = null;
+		try {
+			bodyBytes = StreamUtils.readStream(request.getInputStream());
+		} catch (IOException e) {
+			throw new MessageDeliverException(
+					"Failed to read body data from http request", e);
+		}
+		//Set http request info
+		message.getProperties().setProperty(HTTP_REQUEST_INFO_MAP, getRequestInfo(request));
+		if (paraMap != null && paraMap.size() > 0) {
+		   message.getProperties().setProperty(this.HTTP_REQUEST_PARAMETER_MAP, paraMap);
+		}
+		payloadProxy.setPayload(message, bodyBytes);
+	}
+	
+	/* 
+	 * Method for decompsing a esb message to a HttpServletResponse
+	 */
+	@SuppressWarnings("unchecked")
+	public Object decompose(Message message, T requestWrapper) throws MessageDeliverException {
+        HttpServletResponse  httpResponse = (HttpServletResponse)requestWrapper.getResponse();
+        Object header = message.getProperties().getProperty(HTTP_RESPONSE_HEADER_MAP);
+        Object status = message.getProperties().getProperty(HTTP_RESPONSE_STATUS);
+        if (header != null) {
+        	Map headerMap = (Map)header;
+        	Iterator ite = headerMap.keySet().iterator();
+        	while (ite.hasNext()) {
+        		String name = (String)ite.next();
+        		String value = (String)headerMap.get(name);
+        		httpResponse.setHeader(name, value);
+        	}
+        	
+        }
+        if (status != null) {
+        	int reponseStatus = (Integer)status;
+        	httpResponse.setStatus(reponseStatus);	
+        }
+        
+		Object obj = payloadProxy.getPayload(message);
+		try {
+			if (obj instanceof String) {
+
+				requestWrapper.getResponse().getWriter().write((String) obj);
+
+			} else if (obj instanceof byte[]) {
+				requestWrapper.getResponse().getOutputStream().write(
+						(byte[]) obj);
+			} else {
+				throw new MessageDeliverException(
+						"Message payload is not byte array or String");
+			}
+		} catch (IOException e) {
+			throw new MessageDeliverException("Unexpected error when write the message to http response", e);
+		}
+		return requestWrapper.getResponse();
+	}
+
+	/**
+	 * Method for get request information from a servlet request
+	 * The result includes the http header and other servlet request information
+	 * @param request ServletRequest
+	 * @return Request information includes the http header and other information parsed by 
+	 *         servlet container from a servlet request
+	 */
+	public Map<String, Object> getRequestInfo(HttpServletRequest request) {
+        Map<String, Object> requestInfoMap = new HashMap<String, Object>();
+        requestInfoMap.put("authType", request.getAuthType());
+        requestInfoMap.put("characterEncoding", request.getCharacterEncoding());
+        requestInfoMap.put("contentType", request.getContentType());
+        requestInfoMap.put("contextPath", request.getContextPath());
+        requestInfoMap.put("localAddr", request.getLocalAddr());
+        requestInfoMap.put("localName", request.getLocalName());
+        requestInfoMap.put("method", request.getMethod());
+        requestInfoMap.put("pathInfo", request.getPathInfo());
+        requestInfoMap.put("protocol", request.getProtocol());
+        requestInfoMap.put("queryString", request.getQueryString());
+        requestInfoMap.put("remoteAddr", request.getRemoteAddr());
+        requestInfoMap.put("remoteHost", request.getRemoteHost());
+        requestInfoMap.put("remoteUser", request.getRemoteUser());
+        requestInfoMap.put("contentLength", Integer.toString(request.getContentLength()));
+        requestInfoMap.put("requestSessionId", request.getRequestedSessionId());
+        requestInfoMap.put("requestURI", request.getRequestURI());
+        requestInfoMap.put("schema", request.getScheme());
+        requestInfoMap.put("serverName", request.getServerName());
+        
+        //Add http header
+        Enumeration enumeration = request.getHeaderNames();
+		while (enumeration.hasMoreElements()) {
+			String name = (String) enumeration.nextElement();
+			String value = request.getHeader(name);
+			requestInfoMap.put(name, value);
+		}       
+        return requestInfoMap;
+	}
+}

Copied: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpRequestWrapper.java (from rev 24571, labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatRequestWrapper.java)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpRequestWrapper.java	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpRequestWrapper.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,46 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+/**
+ * This class wraps the HttpServletRequest and HttpServletResponse
+ * It will passed to TomcatMessageComposer to populate or decompose 
+ * an ESB message 
+ * 
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ */
+public class HttpRequestWrapper {
+	private HttpServletRequest request = null;
+	private HttpServletResponse response = null;
+	public HttpRequestWrapper(HttpServletRequest req, HttpServletResponse res) {
+		request = req;
+		response = res;
+	}
+	
+	public HttpServletRequest getRequest() {
+		return request;
+	}
+	
+	public HttpServletResponse getResponse() {
+		return response;
+	}
+}

Copied: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpServerDelegate.java (from rev 24603, labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatServer.java)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpServerDelegate.java	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HttpServerDelegate.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,294 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2005-2006, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.Attribute;
+import javax.management.InstanceNotFoundException;
+import javax.management.MBeanServer;
+import javax.management.ObjectName;
+
+import org.apache.catalina.Container;
+import org.apache.catalina.connector.Connector;
+import org.apache.catalina.core.StandardContext;
+import org.apache.catalina.core.StandardEngine;
+import org.apache.catalina.core.StandardHost;
+import org.apache.catalina.core.StandardService;
+import org.apache.tomcat.util.IntrospectionUtils;
+import org.apache.tomcat.util.modeler.Registry;
+import org.jboss.mx.util.MBeanServerLocator;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.web.tomcat.security.JBossSecurityMgrRealm;
+
+/**
+ * This class creates and starts the jboss esb tomcat engine. The tomcat Connector 
+ * , Host , StandardContext are also can be created with this class. 
+ * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
+ *
+ */
+public class HttpServerDelegate {
+	/**Record the count that the same host name is referenced by other Tomcat listener instance */
+	public static Map<String, Integer> hostReference= new java.util.HashMap<String, Integer>(); 
+	
+	/**Record the count that the same connector/port is referenced by other Tomcat listener instance */
+	public static Map<String, Integer> connectorReference= new java.util.HashMap<String, Integer>(); 
+	
+	
+	/**JMX domain name for http listener*/
+	public static String DOMAIN_NAME = "jboss.esb.tomcat";
+    
+	/**MBean sever*/
+	private static MBeanServer mbeanServer = null;
+	
+	/**TomcatServer instance*/
+	private static HttpServerDelegate instance = null;
+	
+	private HttpServerDelegate() {
+		
+	}
+	
+	public static HttpServerDelegate getInstance() {
+		if (instance != null) {
+			return instance;
+		}
+		
+		synchronized(HttpServerDelegate.class) {
+			mbeanServer = MBeanServerLocator.locateJBoss();
+			instance = new HttpServerDelegate();
+			instance.createEngine();
+		}
+		return instance;
+		
+	}
+	
+	
+	/**
+	 * Create a tomcat engine and also register it in JMX server
+	 * If there is exception , it will throw RuntimeException 
+	 */
+	@SuppressWarnings("unchecked")
+	private void createEngine() {
+		try {
+			Set services = mbeanServer.queryMBeans(new ObjectName(DOMAIN_NAME
+					+ ":type=Service"), null);
+			if (services.size() == 0) {
+				StandardService service = new StandardService();
+				service.setName("jboss.esb.catalina");
+				Registry.getRegistry().registerComponent(service,
+						new ObjectName(DOMAIN_NAME + ":type=Service"), null);
+			}
+
+			Set engines = mbeanServer.queryMBeans(new ObjectName(DOMAIN_NAME
+					+ ":type=Engine"), null);
+			if (engines.size() == 0) {
+				StandardEngine engine = new StandardEngine();
+				
+				//Add JBossSecurityMgrRealm
+				JBossSecurityMgrRealm realm = new JBossSecurityMgrRealm(); 
+				realm.setCertificatePrincipal("org.jboss.security.auth.certs.SubjectDNMapping");
+				realm.setAllRolesMode("authOnly");
+								
+				engine.setRealm(realm);
+				Registry.getRegistry().registerComponent(realm,
+						new ObjectName(DOMAIN_NAME + ":type=Realm"), null);
+				
+				
+				engine.setDefaultHost("localhost");
+				engine.setDomain(DOMAIN_NAME);
+				engine.setName(DOMAIN_NAME + ".engine");
+				mbeanServer.setAttribute(new ObjectName(DOMAIN_NAME
+						+ ":type=Service"), new Attribute("container", engine));
+				Registry.getRegistry().registerComponent(engine,
+						new ObjectName(DOMAIN_NAME + ":type=Engine"), null);
+			}
+			mbeanServer.invoke(new ObjectName(DOMAIN_NAME + ":type=Service"),
+					"start", new Object[] {}, new String[] {});
+		} catch (Exception e) {
+			throw new RuntimeException("Failed to create tomcat engine in ESB", e);
+		}
+
+		
+	}
+	
+	/**
+	 * Add a tomcat StandardHost to tomcat engine
+	 * @param host host name
+	 * @throws Exception If there is error occured
+	 */
+	@SuppressWarnings("unchecked")
+	public void createHost(String host) throws Exception {
+		ObjectName hostName = new ObjectName(DOMAIN_NAME + ":host=" + host + ",type=Host");
+		ObjectName stardardEngineName = new ObjectName(DOMAIN_NAME + ":type=Engine");
+		
+		//Check if it needs to create host
+		Set hosts = mbeanServer.queryNames(hostName, null);
+		if (hosts.size() == 0) {
+			StandardHost newHost = new StandardHost();
+			newHost.setName(host);
+			mbeanServer.invoke(stardardEngineName, "addChild", new Object[] { newHost }, new String[] { Container.class .getName() });
+		    synchronized (hostReference) {
+				hostReference.put(host, 1);
+			}
+
+		} else {
+			updateReference(hostReference, host, 1);
+			
+		}
+	}
+	
+	/**
+	 * Add a tomcat Connector to tomcat Enginer/Service
+	 * @param port the connector port 
+	 * @param properties The properties to configure this connector 
+	 * @throws Exception when error is occured
+	 */
+	@SuppressWarnings("unchecked")
+	public void createConnector(String port, List<KeyValuePair> properties) throws Exception {
+		ObjectName standardServiceName = new ObjectName(DOMAIN_NAME + ":type=Service");
+		ObjectName connectorName = new ObjectName(DOMAIN_NAME + ":*,port=" + port + ",type=Connector");
+		Set connectors = mbeanServer.queryNames(connectorName, null);
+		if (connectors.size() == 0) {
+			Connector connector = null;
+			connector = new Connector("org.apache.coyote.http11.Http11Protocol");
+			connector.setPort(Integer.parseInt(port));
+			
+			for (KeyValuePair property : properties) {	           			
+				boolean effected = IntrospectionUtils.setProperty(connector, property.getKey(), property.getValue());
+				if (!effected) {
+					connector.setProperty(property.getKey(), property.getValue());
+				}
+			}		
+			mbeanServer.invoke(standardServiceName, "addConnector",
+					new Object[] { connector }, new String[] { Connector.class
+							.getName() });
+		    synchronized (connectorReference) {
+				connectorReference.put(port, 1);
+			}
+
+		} else {			
+			updateReference(connectorReference, port, 1);
+		}
+	}
+
+	
+	/**
+	 * Add a StandardContext to a specific host
+	 * @param host the host name
+	 * @param ctx new created StandardContext
+	 * @throws Exception when error occurs
+	 */
+	public void addContext(String host, StandardContext ctx) throws Exception {
+		ObjectName hostName = new ObjectName(DOMAIN_NAME + ":host=" + host + ",type=Host");
+		addContext(hostName, ctx);
+	}
+	
+	
+	public void addContext(ObjectName hostName, StandardContext ctx) throws Exception {
+		mbeanServer.invoke(hostName, "addChild", new Object[] { ctx }, new String[] { Container.class.getName() });
+
+	}
+	
+
+	/**
+	 * Destroy the created context. This method will also check if this context's parent StandardHost 
+	 * and Connector can be destroyed also. There are reference counters for Connector and Host 
+	 * @param host host name
+	 * @param port port number
+	 * @param httpContext the new created httpContext name
+	 * @throws Exception if failed to destroy
+	 */
+	@SuppressWarnings("unchecked")
+	public void destroyContext(String host, String port, String httpContext)
+			throws Exception {
+		ObjectName contextName = new ObjectName(DOMAIN_NAME
+				+ ":j2eeType=WebModule,name=//" + host + httpContext
+				+ ",*");
+		Set engines = mbeanServer.queryNames(contextName, null);
+		if (engines.isEmpty()) {
+			throw new InstanceNotFoundException("HttpContext:" + httpContext + "not found");
+		}
+		contextName = (ObjectName) engines.iterator().next();
+		mbeanServer.invoke(contextName, "destroy", new Object[] {},
+				new String[] {});
+
+		// Decrese the host and connector reference
+		updateReference(hostReference, host, -1);
+		updateReference(connectorReference, port, -1);
+
+		Object obj = hostReference.get(host);
+
+		if (obj != null && (Integer) obj == 0) {
+			ObjectName standardHostName = new ObjectName(DOMAIN_NAME + ":host="
+					+ host + ",type=Host");
+
+		    mbeanServer.invoke(standardHostName, "destroy", new Object[] {}, new String[] {});
+		}
+
+		obj = connectorReference.get(port);
+
+		if (obj != null && (Integer) obj == 0) {
+			ObjectName connectorName = new ObjectName(DOMAIN_NAME + ":port="
+					+ port + ",type=Connector");
+			mbeanServer.invoke(connectorName, "destroy", new Object[] {}, new String[] {});
+		}
+	}
+	
+	public void destroyContext(ObjectName contextName) throws Exception {
+		mbeanServer.invoke(contextName, "destroy", new Object[] {},
+				new String[] {});
+	}
+	
+
+	/**
+	 * Query objects
+	 * @param objectName
+	 * @return Set contains ObjectName
+	 * @throws Exception error occurs
+	 */
+	@SuppressWarnings("unchecked")
+	public Set queryObjects(String objectName) throws Exception {
+		ObjectName name = new ObjectName(objectName);
+		Set objects  = mbeanServer.queryNames(name, null);
+		return objects;
+	}
+	
+	/**Update the reference value
+	 * @param refrenceMap The reference map
+	 * @param key Update key
+	 * @param increment Update value
+	 */
+	@SuppressWarnings("unchecked")
+	public void updateReference(Map refrenceMap, String key , int increment) {
+		synchronized (refrenceMap) {
+			if (refrenceMap.get(key) != null) {
+				int count = (Integer) refrenceMap.get(key);
+				if (count == 0) {
+					return;
+				}
+				refrenceMap.put(key, count + increment);
+			}
+		}
+	}
+}
+
+

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatDispatchServlet.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatDispatchServlet.java	2009-01-14 04:47:12 UTC (rev 24695)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatDispatchServlet.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,237 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.gateway;
-
-import java.io.IOException;
-
-import javax.servlet.ServletException;
-import javax.servlet.http.HttpServlet;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.couriers.FaultMessageException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * This class is for dispatching the http request to ESB action process pipe
- * line.By default, this servlet will be used to set to default servlet mapping
- * in the created StandardContext.
- * This class will also return the esb error message and error stack trace to client 
- * 
- * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
- */
-public class TomcatDispatchServlet extends HttpServlet {
-	private static final long serialVersionUID = 1L;
-
-    private static final String METHOD_DELETE = "DELETE";
-    private static final String METHOD_HEAD = "HEAD";
-    private static final String METHOD_GET = "GET";
-    private static final String METHOD_OPTIONS = "OPTIONS";
-    private static final String METHOD_POST = "POST";
-    private static final String METHOD_PUT = "PUT";
-    private static final String METHOD_TRACE = "TRACE";
-	
-	/** If this a synchronous invocation * */
-	private boolean synchronous = true;
-	
-	/** asyncResponse file location */
-    private String asyncResponse = null;
-
-    private int serviceTimeout = 20000;
-	
-	/** Default allow http method list */
-    private String allowHttpMethods = "POST,GET";
-
-	/** ESB message delivery adapter */
-	public UncomposedMessageDeliveryAdapter messageDeliveryAdapter = null;
-
-	/**
-	 * Initilize method
-	 * 
-	 * @throws ServletException
-	 *             If error occured
-	 */
-	public void init() throws ServletException {
-		ConfigTree config = (ConfigTree) getServletContext().getAttribute(
-				"config");
-		synchronous = !config.getAttribute("synchronous", "true").equalsIgnoreCase("false");
-
-		serviceTimeout = Integer.parseInt(config.getAttribute("serviceTimeout", "20000"));
-
-		asyncResponse = config.getAttribute("asyncResponse");
-				
-		try {
-			messageDeliveryAdapter = UncomposedMessageDeliveryAdapter
-					.getGatewayDeliveryAdapter(config,
-							new TomcatMessageComposer<TomcatRequestWrapper>());
-		} catch (ConfigurationException e) {
-			throw new ServletException(e);
-		}
-		
-		if (config.getAttribute(ListenerTagNames.ALLOW_HTTP_METHOD) != null) {
-			allowHttpMethods = config.getAttribute(ListenerTagNames.ALLOW_HTTP_METHOD).toUpperCase();
-		}
-
-	}
-
-	/**
-	 * Service method to process the inboud servlet request and reply the http
-	 * servlet response
-	 * 
-	 * @param request
-	 *            HttpServlet request
-	 * @param response
-	 *            HttpServlet response
-	 * @param content
-	 * @throws ServletException
-	 *             For error occured during process
-	 */
-	protected void serveRequest(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-        
-		String servletPath = request.getServletPath();
-		
-		//block the invalid request 
-		if (!"/".equals(servletPath)) {
-			response.setStatus(404);
-			return;
-		}
-		
-		TomcatRequestWrapper wrapper = new TomcatRequestWrapper(request, response);
-       
-		try {
-			if (synchronous) {
-				messageDeliveryAdapter.deliverSync(wrapper, serviceTimeout);
-			} else {
-				messageDeliveryAdapter.deliverAsync(wrapper);
-				if (asyncResponse != null) {			       
-					response.getOutputStream().write(StreamUtils.readStream(getClass().getResourceAsStream(asyncResponse)));			        
-				} 
-			}
-		} catch (FaultMessageException fme) {
-			Message faultMessage = fme.getReturnedMessage();
-			if (faultMessage != null) {
-				Object obj = faultMessage.getProperties().getProperty(TomcatMessageComposer.HTTP_RESPONSE_STATUS);
-			    if (obj != null && obj instanceof Integer) {
-			    	response.setStatus((Integer)obj);
-			    } else {
-			    	response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-			    }
-			    
-			    fme.printStackTrace(response.getWriter());			    
-			}
-			
-		} catch (Exception ex) {
-			response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR);
-			ex.printStackTrace(response.getWriter());
-		} 
-
-	}
-	
-	@Override
-	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		if (isSupportMethod(METHOD_GET)) {
-			serveRequest(request, response);
-		} else {
-			super.doGet(request, response);
-		}
-	}
-	
-	@Override
-	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		if (isSupportMethod(METHOD_POST)) {
-			serveRequest(request, response);
-		} else {
-			super.doPost(request, response);
-		}
-	}
-	
-	@Override
-	protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		if (isSupportMethod(METHOD_PUT)) {
-			serveRequest(request, response);
-		} else {
-			super.doPut(request, response);
-		}
-	}
-	@Override
-	protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
-		if (isSupportMethod(METHOD_DELETE)) {
-			serveRequest(request, response);
-		} else {
-			super.doDelete(request, response);
-		}
-	}
-	
-	 protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
-
-		boolean ALLOW_GET = isSupportMethod(METHOD_GET);
-		boolean ALLOW_HEAD = ALLOW_GET;
-		boolean ALLOW_POST = isSupportMethod(METHOD_POST);
-		boolean ALLOW_PUT = isSupportMethod(METHOD_PUT);
-		boolean ALLOW_DELETE = isSupportMethod(METHOD_DELETE);
-		boolean ALLOW_TRACE = true;
-		boolean ALLOW_OPTIONS = true;
-
-		String allow = null;
-		if (ALLOW_GET)
-			if (allow == null) allow = METHOD_GET;
-		if (ALLOW_HEAD)
-			if (allow == null) allow = METHOD_HEAD;
-			else
-				allow += ", " + METHOD_HEAD;
-		if (ALLOW_POST)
-			if (allow == null) allow = METHOD_POST;
-			else
-				allow += ", " + METHOD_POST;
-		if (ALLOW_PUT)
-			if (allow == null) allow = METHOD_PUT;
-			else
-				allow += ", " + METHOD_PUT;
-		if (ALLOW_DELETE)
-			if (allow == null) allow = METHOD_DELETE;
-			else
-				allow += ", " + METHOD_DELETE;
-		if (ALLOW_TRACE)
-			if (allow == null) allow = METHOD_TRACE;
-			else
-				allow += ", " + METHOD_TRACE;
-		if (ALLOW_OPTIONS)
-			if (allow == null) allow = METHOD_OPTIONS;
-			else
-				allow += ", " + METHOD_OPTIONS;
-
-		resp.setHeader("Allow", allow);
-	}
-	 
-	 
-	/**
-	 * Check if support this http method
-	 * @param http method name
-	 * @return true if supported or false if not supported
-	 */
-	private boolean isSupportMethod(String name) {
-		return allowHttpMethods.indexOf(name) >= 0;
-	}		
-}

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatGatewayListener.java	2009-01-14 04:47:12 UTC (rev 24695)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatGatewayListener.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,463 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.gateway;
-
-import java.net.URI;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Set;
-
-import javax.management.InstanceNotFoundException;
-import javax.management.ObjectName;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.LinkRef;
-import javax.naming.NamingException;
-
-import org.apache.catalina.LifecycleException;
-import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.core.StandardWrapper;
-import org.apache.catalina.deploy.LoginConfig;
-import org.apache.catalina.deploy.SecurityCollection;
-import org.apache.catalina.deploy.SecurityConstraint;
-import org.apache.catalina.loader.WebappLoader;
-import org.apache.catalina.startup.ContextConfig;
-import org.apache.log4j.Logger;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.naming.Util;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * Tomcat Listener provids the functionality to pass the http request 
- * to ESB service . 
- * <p> This class will generate {@link org.apache.catalina.connector.Connector}, 
- * {@link org.apache.catalina.core.StandardHost} and {@link org.apache.catalina.core.StandardContext} 
- * for user defined http port, host and context. These generated tomcat components will be 
- * attached to jboss embeded tomcat(aka jboss web). You can monitor and control these new generated
- * components through jboss JMX console.  When this listener is stoped, these components will be 
- * destoried automatically.
- * 
- * <p>The different tomcat listner can be started in same port with different context.for example: 
- * <code> http://localhost:8765/jbossesb/servicecategory/servicename </code>
- *
- * <p>This class uses the {@link org.jboss.soa.esb.listeners.gateway.TomcatMessageComposer}
- * by default.
- * @see org.jboss.soa.esb.listeners.gateway.TomcatMessageComposer
- * @see Torg.jboss.soa.esb.listeners.gateway.TomcatDispatchServlet 
- * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
- */
-public class TomcatGatewayListener extends AbstractManagedLifecycle {
-
-	private static final long serialVersionUID = 1L;
-	
-	
-	private static Logger logger = Logger.getLogger(TomcatGatewayListener.class);
-
-    
-	/**The tag used to read the host value from configuration */
-	public static String SERVER_HOST_TAG = "http_host";
-	
-	/**The tag used to read the port value from configuration */	
-	public static String SERVER_PORT_TAG = "http_port";
-	
-	/**The tag used to read the context value from configuration */	
-	public static String REQUEST_CONTEXT_TAG = "http_context";
-	
-	/**The tag used to read the dispatch servlet class name value from configuration */	
-	public static String DISPATCH_SERVLET_CLASS = "dispatch_servlet";
-	
-	/**Http host value*/
-	public String host = null;
-	
-	/**Http port value*/
-	public String port = null;
-	
-	/**listener contenxt */
-	public String httpContext = null;
-
-	/** Endpoint reference that presents this listener */
-	private EPR endpointReference = null;
-	
-	/**Service category*/
-	private String serviceCategory = null;
-	
-	/**Service name*/
-	private String serviceName = null;
-		
-	/**The new created tomcat standard context, it reprents a web app*/
-	private StandardContext ctx = null;
-			
-	/** The default servlet used to dispatch the http request to ESB service*/
-	private String dispatchServletClassName = TomcatDispatchServlet.class.getName();
-	
-	/** Protocol value */
-	private Object protocol = "http";
-	
-	/** Imply if the port number is the jboss.web used, if yes , the new created context will be attched to jboss web Servlet engine */
-	private boolean useJBossWebServletEngine = false;
-    
-	/**Constuct the TomcatGatewyListner
-	 * @param config The listener configuration
-	 * @throws ConfigurationException Exception during construction
-	 */
-	@SuppressWarnings("unchecked")
-	public TomcatGatewayListener(ConfigTree config) throws ConfigurationException {
-		super(config);
-		host = config.getAttribute(SERVER_HOST_TAG);
-		port = config.getAttribute(SERVER_PORT_TAG);
-		httpContext = config.getAttribute(REQUEST_CONTEXT_TAG);		
-		serviceCategory = config.getAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG);
-		serviceName = config.getAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG);
-		
-		if (config.getAttribute(DISPATCH_SERVLET_CLASS) != null) {
-			dispatchServletClassName = config.getAttribute(DISPATCH_SERVLET_CLASS);
-		}
-				
-        boolean synchronous = !config.getAttribute("synchronous", "true").equalsIgnoreCase("false");
-        if (!synchronous) {
-			String asyncResponse = config.getAttribute("asyncResponse");
-			if (asyncResponse != null) {
-				if (ClassUtil.getResourceAsStream(asyncResponse, getClass()) == null) {
-					throw new ConfigurationException("Asynchronous response resource file '" + asyncResponse
-									+ "' not found on classpath.");
-				}
-			}
-		}
-        
-        //validate allow http method configuration
-        if (config.getAttribute(ListenerTagNames.ALLOW_HTTP_METHOD) != null) {
-        	String allowMethods = config.getAttribute(ListenerTagNames.ALLOW_HTTP_METHOD);
-        	String[] methods = allowMethods.split(",");
-        	List<String> standardMesthods = new ArrayList<String>();
-        	standardMesthods.add("GET");
-        	standardMesthods.add("POST");
-        	standardMesthods.add("DELETE");
-        	standardMesthods.add("PUT");
-        	standardMesthods.add("OPTIONS");
-        	standardMesthods.add("HEAD");
-        	standardMesthods.add("TRACE");
-        	
-        	for (String method : methods) {
-        		if (!standardMesthods.contains(method.toUpperCase())) {
-        			throw new ConfigurationException("Invalid allow http method configuration, please specify the specify method list with comma-separated(e.g. POST,GET,PUT,DELETE"); 
-        		}
-        	}
-        }
-        		
-		try {			
-			Set ports = TomcatServer.getInstance().queryObjects("jboss.web:port="+ port+",type=Connector,*");
-			if (ports.size() > 0) {
-				Set hosts = TomcatServer.getInstance().queryObjects("jboss.web:host=" + host +",type=Host");
-				if (hosts.isEmpty()) {
-					throw new ConfigurationException(new InstanceNotFoundException("ObjectName: "+ "jboss.web:host=" + host +",type=Host" + "Not found")); 
-				}
-				Set contexts = TomcatServer.getInstance().queryObjects("jboss.web:host=" + host + ",path=" + httpContext + ",*");
-				if (contexts.size() > 0) {
-					throw new ConfigurationException("There is already an http context named " + httpContext + ", choose another one"); 
-				}
-				
-				//the created context will be attached jboss.web domain
-				useJBossWebServletEngine = true;
-			} else {
-				//if the port is not the jboss.web used, check if the http context name is duplicate
-				Set contexts = TomcatServer.getInstance().queryObjects(TomcatServer.DOMAIN_NAME + ":host=" + host + ",path=" + httpContext + ",*");
-				if (contexts.size() > 0) {
-					throw new ConfigurationException("There is already an http context named " + httpContext + ", choose another one"); 
-				}
-			}
-		} catch (Exception e) {
-			throw new ConfigurationException(e);
-		}
-		
-		//Check the http security configuration 
-		if (config.getAttribute(ListenerTagNames.AUTH_METHOD) != null) {
-			if (config.getAttribute(ListenerTagNames.SECURITY_DOMAIN) == null) {
-				throw new ConfigurationException("Security domain configuration for this context not found for http authentication method " + config.getAttribute(ListenerTagNames.AUTH_METHOD)); 
-			}
-			
-			if (config.getAttribute(ListenerTagNames.SECURITY_ROLE) == null) {
-				throw new ConfigurationException("Security role configuration for this context not found for http authentication method " + config.getAttribute(ListenerTagNames.AUTH_METHOD));  
-			}			
-        }
-	}
-
-	/*
-	 * Start the Tomcat listner
-	 * 
-	 * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doStart()
-	 */
-	protected void doStart() throws ManagedLifecycleException {
-
-		try {
-			startHttpServer();
-		} catch (Exception e) {
-			throw new ManagedLifecycleException(
-					"Failed to start Http gateway listener", e);
-		}
-		
-		try {
-			registerEndpoint();
-		} catch (Throwable t) {
-			logger.error("Unable to register service endpoint '" + endpointReference.getAddr().getAddress()
-                    + "' for service '" + serviceCategory + ":" + serviceName + "'.  Stopping Http Listener Server...", t);
-			try {
-				stopHttpServer();
-			} catch (Exception e) {
-				throw new ManagedLifecycleException(
-						"Failed to stop Http gateway listener", e);
-			}
-		} 
-	}
-
-	/*
-	 * Stop the tomcat listener
-	 * 
-	 * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doStop()
-	 */
-	protected void doStop() throws ManagedLifecycleException {
-		unregisterEndpoint();
-		try {
-			stopHttpServer();
-		} catch (Exception e) {
-			throw new ManagedLifecycleException(
-					"Failed to stop Http gateway listener", e);
-		}
-		
-		
-	}
-
-	/*
-	 * Initialize the tomcat listener
-	 * 
-	 * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doInitialise()
-	 */
-	protected void doInitialise() throws ManagedLifecycleException {
-		
-	}
-
-	/*
-	 * Destory the tomcat listener
-	 * 
-	 * @see org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle#doDestroy()
-	 */
-	protected void doDestroy() throws ManagedLifecycleException {
-	}
-	
-	
-	
-	/**
-	 * Start the tomcat http server.It will check if it really needs to create
-	 * Tomcat connector and host. Then add these new tomcat component to tomcat Engine 
-	 * tree through JMX server.
-	 * @throws Exception For error during start tomcat context
-	 */
-	@SuppressWarnings("unchecked")
-	protected void startHttpServer() throws Exception {
-		
-		ctx = new StandardContext();
-		URL[] urls = new URL[]{};
-		URLClassLoader urlClassLoader = new URLClassLoader(urls, getClass().getClassLoader());
-		
-		WebappLoader loader = new WebappLoader(urlClassLoader);
-		ctx.setLoader(loader);
-		ContextConfig ctxCfg = new ContextConfig();
-		ctx.addLifecycleListener(ctxCfg);
-		
-		ctxCfg.setDefaultWebXml("org/apache/catalin/startup/NO_DEFAULT_XML");
-		ctx.setPath(httpContext);
-		ctx.setDocBase(".");
-		
-		
-		ClassLoader oldloader = Thread.currentThread().getContextClassLoader();
-		Thread.currentThread().setContextClassLoader(urlClassLoader);
-		initWebappDefaults(ctx);
-		Thread.currentThread().setContextClassLoader(oldloader);
-		String connectorName = TomcatServer.DOMAIN_NAME + ":port=" + port + ",type=Connector,*";
-		
-		if (!useJBossWebServletEngine) {           
-			TomcatServer.getInstance().createHost(host);
-
-			List<KeyValuePair> properties = getConfig().childPropertyList();
-			String maxThreads = getConfig().getAttribute(
-					ListenerTagNames.MAX_THREADS_TAG);
-			if (maxThreads != null) {
-				properties.add(new KeyValuePair("maxThreads", maxThreads));
-			}
-			TomcatServer.getInstance().createConnector(port, properties);
-			TomcatServer.getInstance().addContext(host, ctx);
-		} else {
-			//add it to jboss.web servlet engine
-			connectorName = "jboss.web:port=" + port + ",type=Connector,*";			
-			TomcatServer.getInstance().addContext(new ObjectName("jboss.web:host=" + host + ",type=Host"), ctx);
-		}			
-		
-		Set connectors = TomcatServer.getInstance().queryObjects(connectorName);
-		if (connectors.isEmpty()) {
-			throw new javax.management.InstanceNotFoundException("ObjectName: "+ connectorName + "Not found");
-		}
-		ObjectName obj = (ObjectName)connectors.iterator().next();
-		try {
-	        protocol = MBeanServerLocator.locateJBoss().getAttribute(obj, "scheme");
-		} catch (Exception e) {
-            //do nothing and use default http
-			protocol = "http";
-		} 
-
-	}
-
-    /**Register this endpoint
-     * @throws ConfigurationException For configuration error
-     * @throws RegistryException For registry error when register this EPR
-     */
-    private void registerEndpoint() throws ConfigurationException, RegistryException {
-    	try {
-			endpointReference = new EPR(new URI(protocol + "://"+ host + ":" + port + this.httpContext));
-		} catch (Exception e) {
-			throw new RegistryException("Tomcat gateway listener registration failed", e);
-		}
-    	String serviceDescription = getConfig().getAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG);
-        RegistryFactory.getRegistry().registerEPR(serviceCategory, serviceName, serviceDescription,
-                endpointReference, endpointReference.getAddr().getAddress());
-    }
-
-    /**Unregister this endpoint
-     */
-    private void unregisterEndpoint() {
-        try {
-            RegistryFactory.getRegistry().unRegisterEPR(serviceCategory, serviceName, endpointReference);
-        } catch (Throwable t) {
-            logger.error("Unable to unregister service endpoint '" + endpointReference.getAddr().getAddress()
-                    + "' for service '" + serviceCategory + ":" + serviceName + "'.", t);
-        }
-    }
-    
-	/**Stop tomcat server. It will destory the generated tomcat connector or host . 
-	 * Before do it , it will check if the reference count for it is zero .When there 
-	 * is no tomcat listner uses the generated host or connector, it will destory it 
-	 * @throws Exception For errors during stop tomcat connector or host
-	 */
-    @SuppressWarnings("unchecked")
-	public void stopHttpServer() throws Exception {
-		
-		//Destroy the created context     
-        if (!useJBossWebServletEngine) {
-        	 TomcatServer.getInstance().destroyContext(host, port, httpContext);
-        } else {
-		     Set<ObjectName> contexts = TomcatServer.getInstance().queryObjects("jboss.web:j2eeType=WebModule,name=//" + host + httpContext + ",*");
-		     for (ObjectName obName : contexts) {
-		        TomcatServer.getInstance().destroyContext(obName);
-		     }
-	    }
-    }
-	
-	/**Get the uncomposed message delivery dapater
-	 * @return uncomposed message delivery adapter 
-	 * @throws ConfigurationException For configuation error 
-	 */
-	protected UncomposedMessageDeliveryAdapter createDeliveryAdapter()
-			throws ConfigurationException {
-		return UncomposedMessageDeliveryAdapter.getGatewayDeliveryAdapter(
-				getConfig(),
-				new TomcatMessageComposer<TomcatRequestWrapper>());
-	}
-
-	/**Initialize the StandardContext.By default it will uses 
-	 * {@link org.jboss.soa.esb.listeners.gateway.TomcatDefaultServlet} as default servlet mapping
-	 * @param ctx Created tomcat standard context
-	 * @throws Exception For errors during initialization
-	 */
-	protected void initWebappDefaults(StandardContext ctx) throws Exception {
-		if (isHttpAuthConfiured()) { 
-			
-			InitialContext iniCtx = new InitialContext();
-        	
-			Context envCtx;
-        	try {
-        		envCtx = (Context) iniCtx.lookup("java:comp/env");
-        	} catch (NamingException e) {
-        		envCtx = (Context) iniCtx.lookup("java:comp");
-        		envCtx = envCtx.createSubcontext("env");
-        	}
-        	
-        	String securityDomain = getConfig().getAttribute(ListenerTagNames.SECURITY_DOMAIN);
-        	Util.bind(envCtx, "security/securityMgr", new LinkRef(securityDomain));
-        	Util.bind(envCtx, "security/realmMapping", new LinkRef(securityDomain));
-        	Util.bind(envCtx, "security/security-domain", new LinkRef(securityDomain));
-        	Util.bind(envCtx, "security/subject", new LinkRef(securityDomain));
-		}
-		
-	    StandardWrapper sw = (StandardWrapper) ctx.createWrapper();
-		
-		sw.setServletClass(dispatchServletClassName);
-		sw.setName("default");
-		ctx.addChild(sw);
-		ctx.getServletContext().setAttribute("config", this.getConfig());
-
-		sw.addInitParameter("listings", "false");
-		sw.setLoadOnStartup(1);
-
-		try {
-			sw.start();
-		} catch (LifecycleException e) {
-			logger.error("Unexpected error when start the default servlet");
-			throw e;
-		}
-		ctx.addServletMapping("/", "default");
-		
-		
-		//Add security support 
-		if (isHttpAuthConfiured()) {
-			String securityRole = this.getConfig().getAttribute(ListenerTagNames.SECURITY_ROLE);
-			SecurityConstraint constraint = new SecurityConstraint();
-			constraint.addAuthRole(securityRole);
-			SecurityCollection collection = new SecurityCollection("all");
-			collection.addPattern("/*");
-			constraint.addCollection(collection);
-			ctx.addConstraint(constraint);
-
-			ctx.addSecurityRole(securityRole);
-
-			String authMethod = this.getConfig().getAttribute(ListenerTagNames.AUTH_METHOD);
-			LoginConfig config = new LoginConfig(authMethod, securityRole,
-					null, null);
-			ctx.setLoginConfig(config);
-		}
-	}
-	
-	private boolean isHttpAuthConfiured() {
-		if (getConfig().getAttribute(ListenerTagNames.AUTH_METHOD) != null) {
-			return true;
-		} 
-		return false;
-	}
-
-}
\ No newline at end of file

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatMessageComposer.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatMessageComposer.java	2009-01-14 04:47:12 UTC (rev 24695)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatMessageComposer.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,195 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.gateway;
-
-import java.io.IOException;
-import java.util.Enumeration;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-
-import org.apache.commons.beanutils.BeanUtils;
-import org.apache.tomcat.util.IntrospectionUtils;
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.message.AbstractMessageComposer;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.MessagePayloadProxy;
-import org.jboss.soa.esb.message.MessagePayloadProxy.NullPayloadHandling;
-import org.jboss.soa.esb.message.body.content.BytesBody;
-/**
- * TomcatMessageComposer class is used to compose the HttpServletRquest
- * to ESB aware message and decompse the ESB aware message to HttpServletRespones 
- * <p>
- * This class will put the http request header and other requst information in ESB message properties with the key "RequestInfoMap".
- * <p>If the request is the submitted from html form(with the <code>Content-Type: application/x-www-form-urlencoded</code>), HttpServletRequest.getParameterMap() result) 
- * will be put in ESB message properties. The key for it is "RequestParamterMap". It put the the byte array read from request inputstream in message payload.
- * <p>In decompose process, the header map in message properties will be added 
- * in HttpServletResponse. The value for "ReponseStatus" store in ESB message properties will 
- * put in the http response. The message payload byte[] or String object will be wrote to HttpServletResponse. 
- * If the object in message payload is not byte[],it will throw exception when the ESB message
- * is decomposed
- *  
- * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
- */
-public class TomcatMessageComposer<T extends TomcatRequestWrapper>
-		extends AbstractMessageComposer<T> {
-	
-	/** Request parameter map key in esb message properties */
-	public static final String HTTP_REQUEST_PARAMETER_MAP = "RequestParameterMap";
-	
-	/** Request information map key in esb message properties */
-	public static final String HTTP_REQUEST_INFO_MAP = "RequestInfoMap";
-	
-	/** Reponse header map key in esb message properties */
-	public static final String HTTP_RESPONSE_HEADER_MAP = "ResponseHeaderMap";
-	
-	/** Response status key in esb message properties */
-	public static final String HTTP_RESPONSE_STATUS = "ReponseStatus";
-
-	/** Message payload proxy */
-	private MessagePayloadProxy payloadProxy;
-
-	/* 
-	 * Method for configue the payload proxy 
-	 */
-	public void setConfiguration(ConfigTree config) {
-		super.setConfiguration(config);
-		payloadProxy = new MessagePayloadProxy(config, new String[] {
-				ActionUtils.POST_ACTION_DATA, Body.DEFAULT_LOCATION,
-				BytesBody.BYTES_LOCATION },
-				new String[] { ActionUtils.POST_ACTION_DATA });
-		payloadProxy.setNullSetPayloadHandling(NullPayloadHandling.LOG);
-	}
-
-	protected MessagePayloadProxy getPayloadProxy() {
-		return payloadProxy;
-	}
-
-	/* 
-	 *Method for populating the ESB aware message from a HttpServletRequest 	 
-	 */
-	@SuppressWarnings("unchecked")
-	protected void populateMessage(Message message, T requestWrapper)
-			throws MessageDeliverException {
-		HttpServletRequest request = requestWrapper.getRequest();
-		Map paraMap = request.getParameterMap();;
-		byte[] bodyBytes = null;
-		try {
-			bodyBytes = StreamUtils.readStream(request.getInputStream());
-		} catch (IOException e) {
-			throw new MessageDeliverException(
-					"Failed to read body data from http request", e);
-		}
-		//Set http request info
-		message.getProperties().setProperty(HTTP_REQUEST_INFO_MAP, getRequestInfo(request));
-		if (paraMap != null && paraMap.size() > 0) {
-		   message.getProperties().setProperty(this.HTTP_REQUEST_PARAMETER_MAP, paraMap);
-		}
-		payloadProxy.setPayload(message, bodyBytes);
-	}
-	
-	/* 
-	 * Method for decompsing a esb message to a HttpServletResponse
-	 */
-	@SuppressWarnings("unchecked")
-	public Object decompose(Message message, T requestWrapper) throws MessageDeliverException {
-        HttpServletResponse  httpResponse = (HttpServletResponse)requestWrapper.getResponse();
-        Object header = message.getProperties().getProperty(HTTP_RESPONSE_HEADER_MAP);
-        Object status = message.getProperties().getProperty(HTTP_RESPONSE_STATUS);
-        if (header != null) {
-        	Map headerMap = (Map)header;
-        	Iterator ite = headerMap.keySet().iterator();
-        	while (ite.hasNext()) {
-        		String name = (String)ite.next();
-        		String value = (String)headerMap.get(name);
-        		httpResponse.setHeader(name, value);
-        	}
-        	
-        }
-        if (status != null) {
-        	int reponseStatus = (Integer)status;
-        	httpResponse.setStatus(reponseStatus);	
-        }
-        
-		Object obj = payloadProxy.getPayload(message);
-		try {
-			if (obj instanceof String) {
-
-				requestWrapper.getResponse().getWriter().write((String) obj);
-
-			} else if (obj instanceof byte[]) {
-				requestWrapper.getResponse().getOutputStream().write(
-						(byte[]) obj);
-			} else {
-				throw new MessageDeliverException(
-						"Message payload is not byte array or String");
-			}
-		} catch (IOException e) {
-			throw new MessageDeliverException("Unexpected error when write the message to http response", e);
-		}
-		return requestWrapper.getResponse();
-	}
-
-	/**
-	 * Method for get request information from a servlet request
-	 * The result includes the http header and other servlet request information
-	 * @param request ServletRequest
-	 * @return Request information includes the http header and other information parsed by 
-	 *         servlet container from a servlet request
-	 */
-	public Map<String, Object> getRequestInfo(HttpServletRequest request) {
-        Map<String, Object> requestInfoMap = new HashMap<String, Object>();
-        requestInfoMap.put("authType", request.getAuthType());
-        requestInfoMap.put("characterEncoding", request.getCharacterEncoding());
-        requestInfoMap.put("contentType", request.getContentType());
-        requestInfoMap.put("contextPath", request.getContextPath());
-        requestInfoMap.put("localAddr", request.getLocalAddr());
-        requestInfoMap.put("localName", request.getLocalName());
-        requestInfoMap.put("method", request.getMethod());
-        requestInfoMap.put("pathInfo", request.getPathInfo());
-        requestInfoMap.put("protocol", request.getProtocol());
-        requestInfoMap.put("queryString", request.getQueryString());
-        requestInfoMap.put("remoteAddr", request.getRemoteAddr());
-        requestInfoMap.put("remoteHost", request.getRemoteHost());
-        requestInfoMap.put("remoteUser", request.getRemoteUser());
-        requestInfoMap.put("contentLength", Integer.toString(request.getContentLength()));
-        requestInfoMap.put("requestSessionId", request.getRequestedSessionId());
-        requestInfoMap.put("requestURI", request.getRequestURI());
-        requestInfoMap.put("schema", request.getScheme());
-        requestInfoMap.put("serverName", request.getServerName());
-        
-        //Add http header
-        Enumeration enumeration = request.getHeaderNames();
-		while (enumeration.hasMoreElements()) {
-			String name = (String) enumeration.nextElement();
-			String value = request.getHeader(name);
-			requestInfoMap.put(name, value);
-		}       
-        return requestInfoMap;
-	}
-}

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatRequestWrapper.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatRequestWrapper.java	2009-01-14 04:47:12 UTC (rev 24695)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatRequestWrapper.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,46 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.gateway;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpServletResponse;
-/**
- * This class wraps the HttpServletRequest and HttpServletResponse
- * It will passed to TomcatMessageComposer to populate or decompose 
- * an ESB message 
- * 
- * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
- */
-public class TomcatRequestWrapper {
-	private HttpServletRequest request = null;
-	private HttpServletResponse response = null;
-	public TomcatRequestWrapper(HttpServletRequest req, HttpServletResponse res) {
-		request = req;
-		response = res;
-	}
-	
-	public HttpServletRequest getRequest() {
-		return request;
-	}
-	
-	public HttpServletResponse getResponse() {
-		return response;
-	}
-}

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatServer.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatServer.java	2009-01-14 04:47:12 UTC (rev 24695)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/TomcatServer.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,294 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated
- * by the @authors tag. All rights reserved.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2005-2006, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.gateway;
-
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.Attribute;
-import javax.management.InstanceNotFoundException;
-import javax.management.MBeanServer;
-import javax.management.ObjectName;
-
-import org.apache.catalina.Container;
-import org.apache.catalina.connector.Connector;
-import org.apache.catalina.core.StandardContext;
-import org.apache.catalina.core.StandardEngine;
-import org.apache.catalina.core.StandardHost;
-import org.apache.catalina.core.StandardService;
-import org.apache.tomcat.util.IntrospectionUtils;
-import org.apache.tomcat.util.modeler.Registry;
-import org.jboss.mx.util.MBeanServerLocator;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.web.tomcat.security.JBossSecurityMgrRealm;
-
-/**
- * This class creates and starts the jboss esb tomcat engine. The tomcat Connector 
- * , Host , StandardContext are also can be created with this class. 
- * @author <a href="mailto:ema at redhat.com">Jim Ma</a>
- *
- */
-public class TomcatServer {
-	/**Record the count that the same host name is referenced by other Tomcat listener instance */
-	public static Map<String, Integer> hostReference= new java.util.HashMap<String, Integer>(); 
-	
-	/**Record the count that the same connector/port is referenced by other Tomcat listener instance */
-	public static Map<String, Integer> connectorReference= new java.util.HashMap<String, Integer>(); 
-	
-	
-	/**JMX domain name for tomcat listener*/
-	public static String DOMAIN_NAME = "jboss.esb.tomcat";
-    
-	/**MBean sever*/
-	private static MBeanServer mbeanServer = null;
-	
-	/**TomcatServer instance*/
-	private static TomcatServer instance = null;
-	
-	private TomcatServer() {
-		
-	}
-	
-	public static TomcatServer getInstance() {
-		if (instance != null) {
-			return instance;
-		}
-		
-		synchronized(TomcatServer.class) {
-			mbeanServer = MBeanServerLocator.locateJBoss();
-			instance = new TomcatServer();
-			instance.createEngine();
-		}
-		return instance;
-		
-	}
-	
-	
-	/**
-	 * Create a tomcat engine and also register it in JMX server
-	 * If there is exception , it will throw RuntimeException 
-	 */
-	@SuppressWarnings("unchecked")
-	private void createEngine() {
-		try {
-			Set services = mbeanServer.queryMBeans(new ObjectName(DOMAIN_NAME
-					+ ":type=Service"), null);
-			if (services.size() == 0) {
-				StandardService service = new StandardService();
-				service.setName("jboss.esb.catalina");
-				Registry.getRegistry().registerComponent(service,
-						new ObjectName(DOMAIN_NAME + ":type=Service"), null);
-			}
-
-			Set engines = mbeanServer.queryMBeans(new ObjectName(DOMAIN_NAME
-					+ ":type=Engine"), null);
-			if (engines.size() == 0) {
-				StandardEngine engine = new StandardEngine();
-				
-				//Add JBossSecurityMgrRealm
-				JBossSecurityMgrRealm realm = new JBossSecurityMgrRealm(); 
-				realm.setCertificatePrincipal("org.jboss.security.auth.certs.SubjectDNMapping");
-				realm.setAllRolesMode("authOnly");
-								
-				engine.setRealm(realm);
-				Registry.getRegistry().registerComponent(realm,
-						new ObjectName(DOMAIN_NAME + ":type=Realm"), null);
-				
-				
-				engine.setDefaultHost("localhost");
-				engine.setDomain(DOMAIN_NAME);
-				engine.setName(DOMAIN_NAME + ".engine");
-				mbeanServer.setAttribute(new ObjectName(DOMAIN_NAME
-						+ ":type=Service"), new Attribute("container", engine));
-				Registry.getRegistry().registerComponent(engine,
-						new ObjectName(DOMAIN_NAME + ":type=Engine"), null);
-			}
-			mbeanServer.invoke(new ObjectName(DOMAIN_NAME + ":type=Service"),
-					"start", new Object[] {}, new String[] {});
-		} catch (Exception e) {
-			throw new RuntimeException("Failed to create tomcat engine in ESB", e);
-		}
-
-		
-	}
-	
-	/**
-	 * Add a tomcat StandardHost to tomcat engine
-	 * @param host host name
-	 * @throws Exception If there is error occured
-	 */
-	@SuppressWarnings("unchecked")
-	public void createHost(String host) throws Exception {
-		ObjectName hostName = new ObjectName(DOMAIN_NAME + ":host=" + host + ",type=Host");
-		ObjectName stardardEngineName = new ObjectName(DOMAIN_NAME + ":type=Engine");
-		
-		//Check if it needs to create host
-		Set hosts = mbeanServer.queryNames(hostName, null);
-		if (hosts.size() == 0) {
-			StandardHost newHost = new StandardHost();
-			newHost.setName(host);
-			mbeanServer.invoke(stardardEngineName, "addChild", new Object[] { newHost }, new String[] { Container.class .getName() });
-		    synchronized (hostReference) {
-				hostReference.put(host, 1);
-			}
-
-		} else {
-			updateReference(hostReference, host, 1);
-			
-		}
-	}
-	
-	/**
-	 * Add a tomcat Connector to tomcat Enginer/Service
-	 * @param port the connector port 
-	 * @param properties The properties to configure this connector 
-	 * @throws Exception when error is occured
-	 */
-	@SuppressWarnings("unchecked")
-	public void createConnector(String port, List<KeyValuePair> properties) throws Exception {
-		ObjectName standardServiceName = new ObjectName(DOMAIN_NAME + ":type=Service");
-		ObjectName connectorName = new ObjectName(DOMAIN_NAME + ":*,port=" + port + ",type=Connector");
-		Set connectors = mbeanServer.queryNames(connectorName, null);
-		if (connectors.size() == 0) {
-			Connector connector = null;
-			connector = new Connector("org.apache.coyote.http11.Http11Protocol");
-			connector.setPort(Integer.parseInt(port));
-			
-			for (KeyValuePair property : properties) {	           			
-				boolean effected = IntrospectionUtils.setProperty(connector, property.getKey(), property.getValue());
-				if (!effected) {
-					connector.setProperty(property.getKey(), property.getValue());
-				}
-			}		
-			mbeanServer.invoke(standardServiceName, "addConnector",
-					new Object[] { connector }, new String[] { Connector.class
-							.getName() });
-		    synchronized (connectorReference) {
-				connectorReference.put(port, 1);
-			}
-
-		} else {			
-			updateReference(connectorReference, port, 1);
-		}
-	}
-
-	
-	/**
-	 * Add a StandardContext to a specific host
-	 * @param host the host name
-	 * @param ctx new created StandardContext
-	 * @throws Exception when error occurs
-	 */
-	public void addContext(String host, StandardContext ctx) throws Exception {
-		ObjectName hostName = new ObjectName(DOMAIN_NAME + ":host=" + host + ",type=Host");
-		addContext(hostName, ctx);
-	}
-	
-	
-	public void addContext(ObjectName hostName, StandardContext ctx) throws Exception {
-		mbeanServer.invoke(hostName, "addChild", new Object[] { ctx }, new String[] { Container.class.getName() });
-
-	}
-	
-
-	/**
-	 * Destroy the created context. This method will also check if this context's parent StandardHost 
-	 * and Connector can be destroyed also. There are reference counters for Connector and Host 
-	 * @param host host name
-	 * @param port port number
-	 * @param httpContext the new created httpContext name
-	 * @throws Exception if failed to destroy
-	 */
-	@SuppressWarnings("unchecked")
-	public void destroyContext(String host, String port, String httpContext)
-			throws Exception {
-		ObjectName contextName = new ObjectName(DOMAIN_NAME
-				+ ":j2eeType=WebModule,name=//" + host + httpContext
-				+ ",*");
-		Set engines = mbeanServer.queryNames(contextName, null);
-		if (engines.isEmpty()) {
-			throw new InstanceNotFoundException("HttpContext:" + httpContext + "not found");
-		}
-		contextName = (ObjectName) engines.iterator().next();
-		mbeanServer.invoke(contextName, "destroy", new Object[] {},
-				new String[] {});
-
-		// Decrese the host and connector reference
-		updateReference(hostReference, host, -1);
-		updateReference(connectorReference, port, -1);
-
-		Object obj = hostReference.get(host);
-
-		if (obj != null && (Integer) obj == 0) {
-			ObjectName standardHostName = new ObjectName(DOMAIN_NAME + ":host="
-					+ host + ",type=Host");
-
-		    mbeanServer.invoke(standardHostName, "destroy", new Object[] {}, new String[] {});
-		}
-
-		obj = connectorReference.get(port);
-
-		if (obj != null && (Integer) obj == 0) {
-			ObjectName connectorName = new ObjectName(DOMAIN_NAME + ":port="
-					+ port + ",type=Connector");
-			mbeanServer.invoke(connectorName, "destroy", new Object[] {}, new String[] {});
-		}
-	}
-	
-	public void destroyContext(ObjectName contextName) throws Exception {
-		mbeanServer.invoke(contextName, "destroy", new Object[] {},
-				new String[] {});
-	}
-	
-
-	/**
-	 * Query objects
-	 * @param objectName
-	 * @return Set contains ObjectName
-	 * @throws Exception error occurs
-	 */
-	@SuppressWarnings("unchecked")
-	public Set queryObjects(String objectName) throws Exception {
-		ObjectName name = new ObjectName(objectName);
-		Set objects  = mbeanServer.queryNames(name, null);
-		return objects;
-	}
-	
-	/**Update the reference value
-	 * @param refrenceMap The reference map
-	 * @param key Update key
-	 * @param increment Update value
-	 */
-	@SuppressWarnings("unchecked")
-	public void updateReference(Map refrenceMap, String key , int increment) {
-		synchronized (refrenceMap) {
-			if (refrenceMap.get(key) != null) {
-				int count = (Integer) refrenceMap.get(key);
-				if (count == 0) {
-					return;
-				}
-				refrenceMap.put(key, count + increment);
-			}
-		}
-	}
-}
-
-

Modified: labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/message/HttpMessageAwareListener.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/message/HttpMessageAwareListener.java	2009-01-14 04:47:12 UTC (rev 24695)
+++ labs/jbossesb/workspace/mlittle/legstar/product/rosetta/src/org/jboss/soa/esb/listeners/message/HttpMessageAwareListener.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -39,7 +39,7 @@
 import org.jboss.soa.esb.helpers.KeyValuePair;
 import org.jboss.soa.esb.listeners.ListenerTagNames;
 import org.jboss.soa.esb.listeners.ListenerUtil;
-import org.jboss.soa.esb.listeners.gateway.TomcatServer;
+import org.jboss.soa.esb.listeners.gateway.HttpServerDelegate;
 import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
 import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
 
@@ -116,10 +116,10 @@
 	 */
 	@SuppressWarnings("unchecked")
 	protected void startHttpServer() throws Exception {	
-        TomcatServer.getInstance().createHost(host);
+        HttpServerDelegate.getInstance().createHost(host);
 		List<KeyValuePair> properties = getConfig().childPropertyList();
 		//TODO:add maxThreads option
-		TomcatServer.getInstance().createConnector(port, properties);
+		HttpServerDelegate.getInstance().createConnector(port, properties);
 		
 		ctx = new StandardContext();
 		ctx.setLoader(new WebappLoader(getClass().getClassLoader()));
@@ -132,7 +132,7 @@
 		ctx.setDocBase(".");
 		ctx.getServletContext().setAttribute("config", this.getConfig());
 		initWebappDefaults(ctx);
-		TomcatServer.getInstance().addContext(host, ctx);
+		HttpServerDelegate.getInstance().addContext(host, ctx);
 	}
 		
      protected void initWebappDefaults(StandardContext ctx) throws Exception {
@@ -152,6 +152,6 @@
 	}	
 		
 	public void stopHttpServer() throws Exception {
-        TomcatServer.getInstance().destroyContext(host, port, httpContext);
+        HttpServerDelegate.getInstance().destroyContext(host, port, httpContext);
 	}
 }

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway (from rev 24571, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway)

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/build.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/build.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/build.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,10 +0,0 @@
-<project name="Quickstart_tomcat_gateway" default="run" basedir=".">
-	
-	<description> 
-		${ant.project.name}
-		${line.separator}
-	</description>
-	
-	<!-- Import the base Ant build script... -->
-	<import file="../conf/base-build.xml"/> 	
-</project>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/build.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/build.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/build.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/build.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,10 @@
+<project name="Quickstart_http_gateway" default="run" basedir=".">
+	
+	<description> 
+		${ant.project.name}
+		${line.separator}
+	</description>
+	
+	<!-- Import the base Ant build script... -->
+	<import file="../conf/base-build.xml"/> 	
+</project>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/deployment.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/deployment.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/deployment.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,6 +0,0 @@
-<jbossesb-deployment>
-  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb</depends>
-  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb_reply</depends>
-  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb1</depends>
-  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb1_reply</depends>
-</jbossesb-deployment>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/deployment.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/deployment.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/deployment.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/deployment.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,6 @@
+<jbossesb-deployment>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb</depends>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb_reply</depends>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1</depends>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1_reply</depends>
+</jbossesb-deployment>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/jbm-queue-service.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbm-queue-service.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-  <mbean code="org.jboss.jms.server.destination.QueueService"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb"
-    xmbean-dd="xmdesc/Queue-xmbean.xml">
-	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-	<depends>jboss.messaging:service=PostOffice</depends>
-  </mbean>
-  
-  <mbean code="org.jboss.jms.server.destination.QueueService"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb_reply"
-    xmbean-dd="xmdesc/Queue-xmbean.xml">
-	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-	<depends>jboss.messaging:service=PostOffice</depends>
-  </mbean>
-
-
-
-  <mbean code="org.jboss.jms.server.destination.QueueService"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb1"
-    xmbean-dd="xmdesc/Queue-xmbean.xml">
-	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-	<depends>jboss.messaging:service=PostOffice</depends>
-  </mbean>
-  
-  <mbean code="org.jboss.jms.server.destination.QueueService"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb1_reply"
-    xmbean-dd="xmdesc/Queue-xmbean.xml">
-	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
-	<depends>jboss.messaging:service=PostOffice</depends>
-  </mbean>
-</server>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbm-queue-service.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/jbm-queue-service.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbm-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbm-queue-service.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb_reply"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+
+
+
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+  
+  <mbean code="org.jboss.jms.server.destination.QueueService"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1_reply"
+    xmbean-dd="xmdesc/Queue-xmbean.xml">
+	<depends optional-attribute-name="ServerPeer">jboss.messaging:service=ServerPeer</depends>
+	<depends>jboss.messaging:service=PostOffice</depends>
+  </mbean>
+</server>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/jbmq-queue-service.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<server>
-  <mbean code="org.jboss.mq.server.jmx.Queue"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb">
-    <depends optional-attribute-name="DestinationManager">
-      jboss.mq:service=DestinationManager
-    </depends>
-  </mbean>
-  
-  <mbean code="org.jboss.mq.server.jmx.Queue"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb_reply">
-    <depends optional-attribute-name="DestinationManager">
-      jboss.mq:service=DestinationManager
-    </depends>
-  </mbean>
-
-
-
-  <mbean code="org.jboss.mq.server.jmx.Queue"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb1">
-    <depends optional-attribute-name="DestinationManager">
-      jboss.mq:service=DestinationManager
-    </depends>
-  </mbean>
-  
-  <mbean code="org.jboss.mq.server.jmx.Queue"
-    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatgateway_Request_esb1_reply">
-    <depends optional-attribute-name="DestinationManager">
-      jboss.mq:service=DestinationManager
-    </depends>
-  </mbean>
-</server>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/jbmq-queue-service.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbmq-queue-service.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,32 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<server>
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+  
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb_reply">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+
+
+
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+  
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_httpgateway_Request_esb1_reply">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
+</server>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/jboss-esb.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jboss-esb.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,93 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
-
-    <providers>
-          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
-              <jms-bus busid="quickstartEsbChannel">
-                  <jms-message-filter
-                      dest-type="QUEUE"
-                      dest-name="queue/quickstart_tomcatgateway_Request_esb"
-                  />
-              </jms-bus>
-              <jms-bus busid="quickstartEsbChannel1">
-                  <jms-message-filter
-                      dest-type="QUEUE"
-                      dest-name="queue/quickstart_tomcatgateway_Request_esb1"
-                  />
-              </jms-bus>
-          </jms-provider>   
-          
-         <tomcat-provider name="HTTP" host="localhost" port="8765">
-            <!--property name="maxThreads" value="150"/>
-            <property name="scheme" value="https"/>
-            <property name="secure" value="true"/>
-            <property name="SSLEnabled" value="true"/>
-            <property name="Keystore" value="./key/.keystore"/>
-            <property name="Keystore" value="./key/.keystore"/>
-            <property name="Keypass" value="changeit"/>
-            <property name="allowTrace" value="true"/-->
-            <tomcat-bus busid="HTTP-1" context="/jbossesb/tomcatgateway/serviceA">
-              <property name="authMethod" value="BASIC"/>
-              <property name="securityDomain" value="java:/jaas/jmx-console"/>
-              <property name="securityRole" value="JBossAdmin"/>
-            </tomcat-bus>
-            <tomcat-bus busid="HTTP-2" context="/jbossesb/tomcatgateway/serviceB">
-              <property name="authMethod" value="BASIC"/>
-              <property name="securityDomain" value="java:/jaas/messaging"/>
-              <property name="securityRole" value="esbrole"/>
-            </tomcat-bus>
-         </tomcat-provider>
-      </providers>
-                      
-      <services>
-        <service 
-        	category="tomcatgateway" 
-        	name="service" 
-        	description="Hello World">
-            <listeners>                
-                <tomcat-listener name="A1-HTTP"
-                    busidref="HTTP-1"
-                    maxThreads="100"
-                    is-gateway="true">
-                <!--property name="synchronous" value="false"/>
-                <property name="asyncResponse" value="/response.txt"/-->
-               </tomcat-listener>	
-                <jms-listener name="JMS-Gateway"
-                	busidref="quickstartEsbChannel" 
-                	/>    
-            </listeners>
-            <actions mep="RequestResponse">
-                   <action name="action1" 
-                   	class="org.jboss.soa.esb.samples.quickstart.tomcatgateway.MyAction" 
-                   	process="displayMessage" 
-                   	/>                       
-            </actions>
-        </service>
-
-
-        <service 
-        	category="tomcatgateway" 
-        	name="service2" 
-        	description="Hello World2">
-            <listeners>                
-                <tomcat-listener name="A2-HTTP"
-                    busidref="HTTP-2"
-                    maxThreads="10"
-                    is-gateway="true">
-                <!--property name="synchronous" value="false"/>
-                <property name="asyncResponse" value="/response.txt"/-->
-               </tomcat-listener>	
-                <jms-listener name="JMS-Gateway1"
-                	busidref="quickstartEsbChannel1" 
-                	/>    
-            </listeners>
-            <actions mep="RequestResponse">
-                   <action name="action1" 
-                   	class="org.jboss.soa.esb.samples.quickstart.tomcatgateway.MyAction2" 
-                   	process="displayMessage" 
-                   	/>                       
-            </actions>
-        </service>
-
-      </services>
-</jbossesb>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jboss-esb.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/jboss-esb.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jboss-esb.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jboss-esb.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,93 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+    <providers>
+          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory">
+              <jms-bus busid="quickstartEsbChannel">
+                  <jms-message-filter
+                      dest-type="QUEUE"
+                      dest-name="queue/quickstart_httpgateway_Request_esb"
+                  />
+              </jms-bus>
+              <jms-bus busid="quickstartEsbChannel1">
+                  <jms-message-filter
+                      dest-type="QUEUE"
+                      dest-name="queue/quickstart_httpgateway_Request_esb1"
+                  />
+              </jms-bus>
+          </jms-provider>   
+          
+         <http-provider name="HTTP" host="localhost" port="8765">
+            <!--property name="maxThreads" value="150"/>
+            <property name="scheme" value="https"/>
+            <property name="secure" value="true"/>
+            <property name="SSLEnabled" value="true"/>
+            <property name="Keystore" value="./key/.keystore"/>
+            <property name="Keystore" value="./key/.keystore"/>
+            <property name="Keypass" value="changeit"/>
+            <property name="allowTrace" value="true"/-->
+            <http-bus busid="HTTP-1" context="/jbossesb/httpgateway/serviceA">
+              <!--property name="authMethod" value="BASIC"/>
+              <property name="securityDomain" value="java:/jaas/jmx-console"/>
+              <property name="securityRole" value="JBossAdmin"/-->
+            </http-bus>
+            <http-bus busid="HTTP-2" context="/jbossesb/httpgateway/serviceB">
+              <!--property name="authMethod" value="BASIC"/>
+              <property name="securityDomain" value="java:/jaas/messaging"/>
+              <property name="securityRole" value="esbrole"/-->
+            </http-bus>
+         </http-provider>
+      </providers>
+                      
+      <services>
+        <service 
+        	category="httpgateway" 
+        	name="service" 
+        	description="Hello World">
+            <listeners>                
+                <http-listener name="A1-HTTP"
+                    busidref="HTTP-1"
+                    maxThreads="100"
+                    is-gateway="true">
+                <!--property name="synchronous" value="false"/>
+                <property name="asyncResponse" value="/response.txt"/-->
+               </http-listener>	
+                <jms-listener name="JMS-Gateway"
+                	busidref="quickstartEsbChannel" 
+                	/>    
+            </listeners>
+            <actions mep="RequestResponse">
+                   <action name="action1" 
+                   	class="org.jboss.soa.esb.samples.quickstart.httpgateway.MyAction" 
+                   	process="displayMessage" 
+                   	/>                       
+            </actions>
+        </service>
+
+
+        <service 
+        	category="httpgateway" 
+        	name="service2" 
+        	description="Hello World2">
+            <listeners>                
+                <http-listener name="A2-HTTP"
+                    busidref="HTTP-2"
+                    maxThreads="10"
+                    is-gateway="true">
+                <!--property name="synchronous" value="false"/>
+                <property name="asyncResponse" value="/response.txt"/-->
+               </http-listener>	
+                <jms-listener name="JMS-Gateway1"
+                	busidref="quickstartEsbChannel1" 
+                	/>    
+            </listeners>
+            <actions mep="RequestResponse">
+                   <action name="action1" 
+                   	class="org.jboss.soa.esb.samples.quickstart.httpgateway.MyAction2" 
+                   	process="displayMessage" 
+                   	/>                       
+            </actions>
+        </service>
+
+      </services>
+</jbossesb>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/jbossesb-properties.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbossesb-properties.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  JBoss, Home of Professional Open Source
-  Copyright 2006, JBoss Inc., and others contributors as indicated 
-  by the @authors tag. All rights reserved. 
-  See the copyright.txt in the distribution for a
-  full listing of individual contributors. 
-  This copyrighted material is made available to anyone wishing to use,
-  modify, copy, or redistribute it subject to the terms and conditions
-  of the GNU Lesser General Public License, v. 2.1.
-  This program is distributed in the hope that it will be useful, but WITHOUT A 
-  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
-  PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
-  You should have received a copy of the GNU Lesser General Public License,
-  v.2.1 along with this distribution; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
-  MA  02110-1301, USA.
-  
-  (C) 2005-2006,
-  @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
-  These options are described in the JBossESB manual.
-  Defaults are provided here for convenience only.
- 
-  Please read through this file prior to using the system, and consider
-  updating the specified entries.
--->
-<esb
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
-    <properties name="core">
-		<property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
-		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
-		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
-        <property name="jboss.esb.invm.scope.default" value="NONE"/>
-    </properties>
-    <properties name="registry">      
-    	<property name="org.jboss.soa.esb.registry.queryManagerURI"     		
-    		value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>    		
-    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"     		
-    		value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
-    	<property name="org.jboss.soa.esb.registry.implementationClass" 
-    		value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
-    	<property name="org.jboss.soa.esb.registry.factoryClass" 
-    		value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
-    	<property name="org.jboss.soa.esb.registry.user" 
-    		value="jbossesb"/>
-    	<property name="org.jboss.soa.esb.registry.password" 
-    	  value="password"/>
-    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
-    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
-    		value="org.apache.ws.scout.transport.RMITransport"/>
-    </properties>
-    <properties name="transports" depends="core">
-    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
-    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
-    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
-    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
-    </properties>
-    <properties name="connection">
-    	<property name="min-pool-size" value="5"/>
-    	<property name="max-pool=size" value="10"/>
-    	<property name="blocking-timeout-millis" value="5000"/>
-    	<property name="abandoned-connection-timeout" value="10000"/>
-    	<property name="abandoned-connection-time-interval" value="30000"/>
-    </properties>
-    <properties name="dbstore">
-		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
-		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
-		<property name="org.jboss.soa.esb.persistence.db.user" 			value="sa"/>
-		<property name="org.jboss.soa.esb.persistence.db.pwd" 			value=""/>		
-		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
-		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"	value="2"/>
-		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"	value="5"/>
-		<!--table managed by pool to test for valid connections - created by pool automatically -->
-		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>
-		<!-- # of milliseconds to timeout waiting for a connection from pool -->
-		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
-                <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
-    </properties>
-    <properties name="messagerouting">
-    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
-    </properties>
-</esb>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbossesb-properties.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbossesb-properties.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jbossesb-properties.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, JBoss Inc., and others contributors as indicated 
+  by the @authors tag. All rights reserved. 
+  See the copyright.txt in the distribution for a
+  full listing of individual contributors. 
+  This copyrighted material is made available to anyone wishing to use,
+  modify, copy, or redistribute it subject to the terms and conditions
+  of the GNU Lesser General Public License, v. 2.1.
+  This program is distributed in the hope that it will be useful, but WITHOUT A 
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+  PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+  MA  02110-1301, USA.
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+  These options are described in the JBossESB manual.
+  Defaults are provided here for convenience only.
+ 
+  Please read through this file prior to using the system, and consider
+  updating the specified entries.
+-->
+<esb
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+    <properties name="core">
+		<property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+        <property name="jboss.esb.invm.scope.default" value="NONE"/>
+    </properties>
+    <properties name="registry">      
+    	<property name="org.jboss.soa.esb.registry.queryManagerURI"     		
+    		value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>    		
+    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"     		
+    		value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+    	<property name="org.jboss.soa.esb.registry.implementationClass" 
+    		value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.factoryClass" 
+    		value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.user" 
+    		value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.registry.password" 
+    	  value="password"/>
+    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
+    		value="org.apache.ws.scout.transport.RMITransport"/>
+    </properties>
+    <properties name="transports" depends="core">
+    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+    </properties>
+    <properties name="connection">
+    	<property name="min-pool-size" value="5"/>
+    	<property name="max-pool=size" value="10"/>
+    	<property name="blocking-timeout-millis" value="5000"/>
+    	<property name="abandoned-connection-timeout" value="10000"/>
+    	<property name="abandoned-connection-time-interval" value="30000"/>
+    </properties>
+    <properties name="dbstore">
+		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
+		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
+		<property name="org.jboss.soa.esb.persistence.db.user" 			value="sa"/>
+		<property name="org.jboss.soa.esb.persistence.db.pwd" 			value=""/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"	value="5"/>
+		<!--table managed by pool to test for valid connections - created by pool automatically -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>
+		<!-- # of milliseconds to timeout waiting for a connection from pool -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
+                <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+    </properties>
+    <properties name="messagerouting">
+    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+    </properties>
+</esb>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jndi.properties
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/jndi.properties	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jndi.properties	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jndi.properties (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/jndi.properties)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jndi.properties	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/jndi.properties	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/juddi.properties
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/juddi.properties	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/juddi.properties	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any 
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct 
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
- 
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-  

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/juddi.properties (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/juddi.properties)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/juddi.properties	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/juddi.properties	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any 
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct 
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+ 
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+  

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/lib (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/lib)

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/log4j.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/log4j.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/log4j.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  Log4j Configuration                                                  -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
-   | For more configuration infromation and examples see the Jakarta Log4j
-   | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
-   <!-- ============================== -->
-   <!-- Append messages to the console -->
-   <!-- ============================== -->
-
-   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
-      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-      <param name="Target" value="System.out"/>
-      <param name="Threshold" value="INFO"/>
-
-      <layout class="org.apache.log4j.PatternLayout">
-         <!-- The default pattern: Date Priority [Category] Message\n -->
-         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
-      </layout>
-   </appender>
-
-   <!-- ================================= -->
-   <!-- Preserve messages in a local file -->
-   <!-- ================================= -->
-
-   <!-- A size based file rolling appender -->
-   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
-     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-     <param name="File" value="./listener.log"/>
-     <param name="Append" value="false"/>
-     <param name="MaxFileSize" value="500KB"/>
-     <param name="MaxBackupIndex" value="1"/>
-
-     <layout class="org.apache.log4j.PatternLayout">
-       <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
-     </layout>	    
-   </appender>
-
-   <!-- ================ -->
-   <!-- Limit categories -->
-   <!-- ================ -->
-
-   <category name="org.jboss">
-      <priority value="WARN"/>
-   </category>
-   <category name="org.jboss.soa.esb">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.jboss.internal.soa.esb">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.apache">
-      <priority value="ERROR"/>
-   </category>
-   <category name="quickstart">
-      <priority value="DEBUG"/>
-   </category>
-   <!-- ======================= -->
-   <!-- Setup the Root category -->
-   <!-- ======================= -->
-
-   <root>
-      <appender-ref ref="CONSOLE"/>
-      <appender-ref ref="FILE"/>
-   </root>
-
-</log4j:configuration>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/log4j.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/log4j.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/log4j.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/log4j.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A size based file rolling appender -->
+   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="./listener.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+     </layout>	    
+   </appender>
+
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <category name="org.jboss">
+      <priority value="WARN"/>
+   </category>
+   <category name="org.jboss.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.jboss.internal.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.apache">
+      <priority value="ERROR"/>
+   </category>
+   <category name="quickstart">
+      <priority value="DEBUG"/>
+   </category>
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+</log4j:configuration>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/readme.txt
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/readme.txt	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/readme.txt	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,18 +0,0 @@
-Overview:
-=========
-  The purpose of the tomcat_gateway quickstart sample is to demonstarte how to 
-  configue a tomcat gateway to pass the http request into ESB service. 
-  
-
-Running this quickstart:
-========================
-  Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
-  and a more detailed descripton of the different ways to run the quickstarts.
-
-To Run '.esb' archive mode:
-===========================
-  1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
-  2. Open the web brower and send http request to "http://localhost:8765/jbossesb/tomcatgateway/serviceA/" 
-     and "http://localhost:8765/jbossesb/tomcatgateway/serviceB/"
-  3. Switch back to Application Server console to see the output from the ESB
-  4. In this folder ("Window1"), type 'ant undeploy'.

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/readme.txt (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/readme.txt)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/readme.txt	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/readme.txt	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,18 @@
+Overview:
+=========
+  The purpose of the http_gateway quickstart sample is to demonstarte how to 
+  configue a http gateway to pass the http request into ESB service. 
+  
+
+Running this quickstart:
+========================
+  Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+  and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run '.esb' archive mode:
+===========================
+  1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+  2. Open the web brower and send http request to "http://localhost:8765/jbossesb/httpgateway/serviceA/" 
+     and "http://localhost:8765/jbossesb/httpgateway/serviceB/"
+  3. Switch back to Application Server console to see the output from the ESB
+  4. In this folder ("Window1"), type 'ant undeploy'.

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_gateway/src)

Added: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.httpgateway;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MyAction extends AbstractActionLifecycle {
+
+	protected ConfigTree _config;
+
+	public MyAction(ConfigTree config) {
+		_config = config;
+	}
+
+	public Message displayMessage(Message message) throws Exception {
+
+		System.out.println("&&&&&&&&&&&&&&&& MyAction &&&&&&&&&&&&&&&&&&&&&");
+		
+		System.out.println("------------Http Request Info-------------------"); 
+		Map requestInfo = (Map)message.getProperties().getProperty("RequestInfoMap");
+		requestInfo.get("Method");
+		Iterator<String> infoIte = requestInfo.keySet().iterator();
+		while(infoIte.hasNext()) {
+			String key = infoIte.next();
+			System.out.println(key + " : " + requestInfo.get(key));
+		}
+		
+		
+		System.out.println("------------Http Prameter Map-------------------"); 
+		Object obj = message.getProperties().getProperty("RequestParameterMap");
+		
+		if (obj != null) {
+			Map<String, Object> paraMap = (Map<String, Object>)obj;
+			Iterator<String> paraIte = paraMap.keySet().iterator();
+			while(paraIte.hasNext()) {
+				String key = paraIte.next();
+				System.out.println(key + " : " + paraMap.get(key));
+			}
+		}
+		
+		
+		System.out.println("------------Http Request body -------------------");
+		System.out.println(new String((byte[])message.getBody().get()));
+		
+		System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+		message.getBody().add("This message is from ESB service 1");
+		return message;
+
+	}
+
+}

Added: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_gateway/src/org/jboss/soa/esb/samples/quickstart/httpgateway/MyAction2.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.httpgateway;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MyAction2 extends AbstractActionLifecycle {
+
+	protected ConfigTree _config;
+
+	public MyAction2(ConfigTree config) {
+		_config = config;
+	}
+
+	public Message displayMessage(Message message) throws Exception {
+
+		
+		System.out.println("&&&&&&&&&&&&&&&& MyAction2 &&&&&&&&&&&&&&&&&&&&&");
+		
+		System.out.println("------------Http Request Info-------------------"); 
+		Map requestInfo = (Map)message.getProperties().getProperty("RequestInfoMap");
+		requestInfo.get("Method");
+		Iterator<String> infoIte = requestInfo.keySet().iterator();
+		while(infoIte.hasNext()) {
+			String key = infoIte.next();
+			System.out.println(key + " : " + requestInfo.get(key));
+		}
+		
+		
+		System.out.println("------------Http Prameter Map-------------------"); 
+		Object obj = message.getProperties().getProperty("RequestParameterMap");
+		
+		if (obj != null) {
+			Map<String, Object> paraMap = (Map<String, Object>)obj;
+			Iterator<String> paraIte = paraMap.keySet().iterator();
+			while(paraIte.hasNext()) {
+				String key = paraIte.next();
+				System.out.println(key + " : " + paraMap.get(key));
+			}
+		}
+		
+		
+		System.out.println("------------Http Request body -------------------");
+		System.out.println(new String((byte[])message.getBody().get()));
+		
+		System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+		message.getBody().add("This message is from ESB service 2");
+		return message;
+
+	}
+
+}

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener (from rev 24571, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener)

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/build.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/build.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/build.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,20 +0,0 @@
-<project name="Quickstart_tomcat_listener" default="run" basedir=".">
-	
-	<description> 
-		${ant.project.name}
-		${line.separator}
-	</description>
-	
-	<!-- Import the base Ant build script... -->
-	<import file="../conf/base-build.xml"/>
-	<target name="sendesb" depends="compile"
-		description="Will send an esb Message">
-		<echo>Runs Test ESB Message Sender</echo>
-		<java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.tomcatlistener.test.SendEsbMessage" failonerror="true">
-			<arg value="tomcatListener"/> <!--  service category -->
-			<arg value="service"/>  <!--  service name -->
-			<arg value="Hello World - Straight to Tomcat ESB listener - no Gateway"/> <!--  Message text -->
-			<classpath refid="exec-classpath"/>
-		</java>
-	</target> 	
-</project>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/build.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/build.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/build.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/build.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,20 @@
+<project name="Quickstart_http_listener" default="run" basedir=".">
+	
+	<description> 
+		${ant.project.name}
+		${line.separator}
+	</description>
+	
+	<!-- Import the base Ant build script... -->
+	<import file="../conf/base-build.xml"/>
+	<target name="sendesb" depends="compile"
+		description="Will send an esb Message">
+		<echo>Runs Test ESB Message Sender</echo>
+		<java fork="yes" classname="org.jboss.soa.esb.samples.quickstart.httplistener.test.SendEsbMessage" failonerror="true">
+			<arg value="httplistener"/> <!--  service category -->
+			<arg value="service"/>  <!--  service name -->
+			<arg value="Hello World - Straight to HTTP ESB listener - no Gateway"/> <!--  Message text -->
+			<classpath refid="exec-classpath"/>
+		</java>
+	</target> 	
+</project>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/deployment.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/deployment.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/deployment.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,2 +0,0 @@
-<jbossesb-deployment>
-</jbossesb-deployment>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/deployment.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/deployment.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/deployment.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/deployment.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,2 @@
+<jbossesb-deployment>
+</jbossesb-deployment>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jboss-esb.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jboss-esb.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,29 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
-
-    <providers>           
-         <tomcat-provider name="HTTP" host="localhost" port="8765">
-            <tomcat-bus busid="HTTP-1" context="/jbossesb/tomcatlistener" />
-         </tomcat-provider>
-      </providers>
-                      
-      <services>
-        <service 
-        	category="tomcatListener" 
-        	name="service" 
-        	description="Hello World">
-            <listeners>                
-                <tomcat-listener name="A1-HTTP"
-                    busidref="HTTP-1"
-                    maxThreads="5">
-               </tomcat-listener>	
-            </listeners>
-            <actions mep="RequestResponse">
-                   <action name="action1" 
-                   	class="org.jboss.soa.esb.samples.quickstart.tomcatlistener.MyAction" 
-                   	process="displayMessage" 
-                   	/>                       
-            </actions>
-        </service>
-      </services>
-</jbossesb>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jboss-esb.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jboss-esb.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jboss-esb.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jboss-esb.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,29 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" parameterReloadSecs="5">
+
+    <providers>           
+         <http-provider name="HTTP" host="localhost" port="8765">
+            <http-bus busid="HTTP-1" context="/jbossesb/httplistener" />
+         </http-provider>
+      </providers>
+                      
+      <services>
+        <service 
+        	category="httplistener" 
+        	name="service" 
+        	description="Hello World">
+            <listeners>                
+                <http-listener name="A1-HTTP"
+                    busidref="HTTP-1"
+                    maxThreads="5">
+               </http-listener>	
+            </listeners>
+            <actions mep="RequestResponse">
+                   <action name="action1" 
+                   	class="org.jboss.soa.esb.samples.quickstart.httplistener.MyAction" 
+                   	process="displayMessage" 
+                   	/>                       
+            </actions>
+        </service>
+      </services>
+</jbossesb>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jbossesb-properties.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jbossesb-properties.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jbossesb-properties.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,86 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  JBoss, Home of Professional Open Source
-  Copyright 2006, JBoss Inc., and others contributors as indicated 
-  by the @authors tag. All rights reserved. 
-  See the copyright.txt in the distribution for a
-  full listing of individual contributors. 
-  This copyrighted material is made available to anyone wishing to use,
-  modify, copy, or redistribute it subject to the terms and conditions
-  of the GNU Lesser General Public License, v. 2.1.
-  This program is distributed in the hope that it will be useful, but WITHOUT A 
-  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
-  PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
-  You should have received a copy of the GNU Lesser General Public License,
-  v.2.1 along with this distribution; if not, write to the Free Software
-  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
-  MA  02110-1301, USA.
-  
-  (C) 2005-2006,
-  @author JBoss Inc.
--->
-<!-- $Id: jbossesb-unittest-properties.xml $ -->
-<!--
-  These options are described in the JBossESB manual.
-  Defaults are provided here for convenience only.
- 
-  Please read through this file prior to using the system, and consider
-  updating the specified entries.
--->
-<esb
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
-    <properties name="core">
-		<property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
-		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
-		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
-        <property name="jboss.esb.invm.scope.default" value="NONE"/>
-    </properties>
-    <properties name="registry">      
-    	<property name="org.jboss.soa.esb.registry.queryManagerURI"     		
-    		value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>    		
-    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"     		
-    		value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
-    	<property name="org.jboss.soa.esb.registry.implementationClass" 
-    		value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
-    	<property name="org.jboss.soa.esb.registry.factoryClass" 
-    		value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
-    	<property name="org.jboss.soa.esb.registry.user" 
-    		value="jbossesb"/>
-    	<property name="org.jboss.soa.esb.registry.password" 
-    	  value="password"/>
-    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
-    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
-    		value="org.apache.ws.scout.transport.RMITransport"/>
-    </properties>
-    <properties name="transports" depends="core">
-    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
-    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
-    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
-    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
-    </properties>
-    <properties name="connection">
-    	<property name="min-pool-size" value="5"/>
-    	<property name="max-pool=size" value="10"/>
-    	<property name="blocking-timeout-millis" value="5000"/>
-    	<property name="abandoned-connection-timeout" value="10000"/>
-    	<property name="abandoned-connection-time-interval" value="30000"/>
-    </properties>
-    <properties name="dbstore">
-		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
-		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
-		<property name="org.jboss.soa.esb.persistence.db.user" 			value="sa"/>
-		<property name="org.jboss.soa.esb.persistence.db.pwd" 			value=""/>		
-		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
-		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"	value="2"/>
-		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"	value="5"/>
-		<!--table managed by pool to test for valid connections - created by pool automatically -->
-		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>
-		<!-- # of milliseconds to timeout waiting for a connection from pool -->
-		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
-                <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
-    </properties>
-    <properties name="messagerouting">
-    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
-    </properties>
-</esb>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jbossesb-properties.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jbossesb-properties.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jbossesb-properties.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jbossesb-properties.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,86 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, JBoss Inc., and others contributors as indicated 
+  by the @authors tag. All rights reserved. 
+  See the copyright.txt in the distribution for a
+  full listing of individual contributors. 
+  This copyrighted material is made available to anyone wishing to use,
+  modify, copy, or redistribute it subject to the terms and conditions
+  of the GNU Lesser General Public License, v. 2.1.
+  This program is distributed in the hope that it will be useful, but WITHOUT A 
+  WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+  PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+  You should have received a copy of the GNU Lesser General Public License,
+  v.2.1 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+  MA  02110-1301, USA.
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+<!-- $Id: jbossesb-unittest-properties.xml $ -->
+<!--
+  These options are described in the JBossESB manual.
+  Defaults are provided here for convenience only.
+ 
+  Please read through this file prior to using the system, and consider
+  updating the specified entries.
+-->
+<esb
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+    <properties name="core">
+		<property name="org.jboss.soa.esb.jndi.server.type" value="jboss"/>
+		<property name="org.jboss.soa.esb.jndi.server.url" value="localhost"/>
+		<property name="org.jboss.soa.esb.persistence.connection.factory" 	value="org.jboss.internal.soa.esb.persistence.format.MessageStoreFactoryImpl"/>
+        <property name="jboss.esb.invm.scope.default" value="NONE"/>
+    </properties>
+    <properties name="registry">      
+    	<property name="org.jboss.soa.esb.registry.queryManagerURI"     		
+    		value="jnp://localhost:1099/InquiryService?org.apache.juddi.registry.rmi.Inquiry#inquire"/>    		
+    	<property name="org.jboss.soa.esb.registry.lifeCycleManagerURI"     		
+    		value="jnp://localhost:1099/PublishService?org.apache.juddi.registry.rmi.Publish#publish" />
+    	<property name="org.jboss.soa.esb.registry.implementationClass" 
+    		value="org.jboss.internal.soa.esb.services.registry.JAXRRegistryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.factoryClass" 
+    		value="org.apache.ws.scout.registry.ConnectionFactoryImpl"/>
+    	<property name="org.jboss.soa.esb.registry.user" 
+    		value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.registry.password" 
+    	  value="password"/>
+    	<!-- the following parameter is scout specific to set the type of communication between scout and the UDDI (embedded, rmi, soap) -->
+    	<property name="org.jboss.soa.esb.scout.proxy.transportClass" 
+    		value="org.apache.ws.scout.transport.RMITransport"/>
+    </properties>
+    <properties name="transports" depends="core">
+    	<property name="org.jboss.soa.esb.mail.smtp.host" value="localhost"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.user" value="jbossesb"/>
+    	<property name="org.jboss.soa.esb.mail.smtp.password" value=""/>
+    	<property name="org.jboss.soa.esb.mail.smtp.port" value="25"/>
+    </properties>
+    <properties name="connection">
+    	<property name="min-pool-size" value="5"/>
+    	<property name="max-pool=size" value="10"/>
+    	<property name="blocking-timeout-millis" value="5000"/>
+    	<property name="abandoned-connection-timeout" value="10000"/>
+    	<property name="abandoned-connection-time-interval" value="30000"/>
+    </properties>
+    <properties name="dbstore">
+		<property name="org.jboss.soa.esb.persistence.db.connection.url" 	value="jdbc:hsqldb:hsql://localhost:9001/"/>
+		<property name="org.jboss.soa.esb.persistence.db.jdbc.driver" 		value="org.hsqldb.jdbcDriver"/>
+		<property name="org.jboss.soa.esb.persistence.db.user" 			value="sa"/>
+		<property name="org.jboss.soa.esb.persistence.db.pwd" 			value=""/>		
+		<property name="org.jboss.soa.esb.persistence.db.pool.initial.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.min.size"	value="2"/>
+		<property name="org.jboss.soa.esb.persistence.db.pool.max.size"	value="5"/>
+		<!--table managed by pool to test for valid connections - created by pool automatically -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.test.table"	value="pooltest"/>
+		<!-- # of milliseconds to timeout waiting for a connection from pool -->
+		<property name="org.jboss.soa.esb.persistence.db.pool.timeout.millis"	value="5000"/> 
+                <property name="org.jboss.soa.esb.persistence.db.conn.manager" value="org.jboss.internal.soa.esb.persistence.manager.StandaloneConnectionManager"/>
+    </properties>
+    <properties name="messagerouting">
+    	<property name="org.jboss.soa.esb.routing.cbrClass" value="org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter"/>
+    </properties>
+</esb>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jndi.properties
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jndi.properties	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jndi.properties	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,5 +0,0 @@
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-java.naming.factory.url.pkgs=org.jnp.interfaces
-

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jndi.properties (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jndi.properties)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jndi.properties	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/jndi.properties	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,5 @@
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+java.naming.factory.url.pkgs=org.jnp.interfaces
+

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/juddi.properties
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/juddi.properties	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/juddi.properties	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any 
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct 
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=com.mysql.jdbc.Driver
-juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
-juddi.jdbcUsername=root
-juddi.jdbcPassword=admin
-# jUDDI DataSource to use
-# juddi.dataSource=java:comp/env/jdbc/MySqlDS
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
- 
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-  

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/juddi.properties (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/juddi.properties)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/juddi.properties	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/juddi.properties	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any 
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct 
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=com.mysql.jdbc.Driver
+juddi.jdbcUrl=jdbc:mysql://localhost:3306/juddi
+juddi.jdbcUsername=root
+juddi.jdbcPassword=admin
+# jUDDI DataSource to use
+# juddi.dataSource=java:comp/env/jdbc/MySqlDS
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+ 
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+  

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/lib (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/lib)

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/log4j.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/log4j.xml	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/log4j.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,79 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  Log4j Configuration                                                  -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
-
-<!--
-   | For more configuration infromation and examples see the Jakarta Log4j
-   | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
-   <!-- ============================== -->
-   <!-- Append messages to the console -->
-   <!-- ============================== -->
-
-   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
-      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-      <param name="Target" value="System.out"/>
-      <param name="Threshold" value="INFO"/>
-
-      <layout class="org.apache.log4j.PatternLayout">
-         <!-- The default pattern: Date Priority [Category] Message\n -->
-         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
-      </layout>
-   </appender>
-
-   <!-- ================================= -->
-   <!-- Preserve messages in a local file -->
-   <!-- ================================= -->
-
-   <!-- A size based file rolling appender -->
-   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
-     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-     <param name="File" value="./listener.log"/>
-     <param name="Append" value="false"/>
-     <param name="MaxFileSize" value="500KB"/>
-     <param name="MaxBackupIndex" value="1"/>
-
-     <layout class="org.apache.log4j.PatternLayout">
-       <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
-     </layout>	    
-   </appender>
-
-   <!-- ================ -->
-   <!-- Limit categories -->
-   <!-- ================ -->
-
-   <category name="org.jboss">
-      <priority value="WARN"/>
-   </category>
-   <category name="org.jboss.soa.esb">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.jboss.internal.soa.esb">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.apache">
-      <priority value="ERROR"/>
-   </category>
-   <category name="quickstart">
-      <priority value="DEBUG"/>
-   </category>
-   <!-- ======================= -->
-   <!-- Setup the Root category -->
-   <!-- ======================= -->
-
-   <root>
-      <appender-ref ref="CONSOLE"/>
-      <appender-ref ref="FILE"/>
-   </root>
-
-</log4j:configuration>

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/log4j.xml (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/log4j.xml)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/log4j.xml	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/log4j.xml	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,79 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.5 2005/09/15 09:31:02 dimitris Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+      <param name="Target" value="System.out"/>
+      <param name="Threshold" value="INFO"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%t][%c{1}] %m%n"/>
+      </layout>
+   </appender>
+
+   <!-- ================================= -->
+   <!-- Preserve messages in a local file -->
+   <!-- ================================= -->
+
+   <!-- A size based file rolling appender -->
+   <appender name="FILE" class="org.jboss.logging.appender.RollingFileAppender">
+     <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+     <param name="File" value="./listener.log"/>
+     <param name="Append" value="false"/>
+     <param name="MaxFileSize" value="500KB"/>
+     <param name="MaxBackupIndex" value="1"/>
+
+     <layout class="org.apache.log4j.PatternLayout">
+       <param name="ConversionPattern" value="%d %-5p [%t][%c] %m%n"/>
+     </layout>	    
+   </appender>
+
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <category name="org.jboss">
+      <priority value="WARN"/>
+   </category>
+   <category name="org.jboss.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.jboss.internal.soa.esb">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.apache">
+      <priority value="ERROR"/>
+   </category>
+   <category name="quickstart">
+      <priority value="DEBUG"/>
+   </category>
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+      <appender-ref ref="FILE"/>
+   </root>
+
+</log4j:configuration>

Deleted: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/readme.txt
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/readme.txt	2009-01-07 07:07:07 UTC (rev 24571)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/readme.txt	2009-01-14 06:30:24 UTC (rev 24696)
@@ -1,17 +0,0 @@
-Overview:
-=========
-  The purpose of the tomcat_listener quickstart sample is to demonstarte how to 
-  configue a tomcat listener. 
-  
-
-Running this quickstart:
-========================
-  Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
-  and a more detailed descripton of the different ways to run the quickstarts.
-
-To Run '.esb' archive mode:
-===========================
-  1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
-  2. type 'ant sendesb' to send ESB message to tomcat listener.
-  3. Switch back to Application Server console to see the output from the ESB
-  4. In this folder ("Window1"), type 'ant undeploy'.

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/readme.txt (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/readme.txt)
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/readme.txt	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/readme.txt	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,17 @@
+Overview:
+=========
+  The purpose of the tomcat_listener quickstart sample is to demonstarte how to 
+  configue a tomcat listener. 
+  
+
+Running this quickstart:
+========================
+  Please refer to 'ant help-quickstarts' for prerequisites about the quickstarts
+  and a more detailed descripton of the different ways to run the quickstarts.
+
+To Run '.esb' archive mode:
+===========================
+  1. In a command terminal window in this folder ("Window1"), type 'ant deploy'.
+  2. type 'ant sendesb' to send ESB message to http listener.
+  3. Switch back to Application Server console to see the output from the ESB
+  4. In this folder ("Window1"), type 'ant undeploy'.

Copied: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src (from rev 24695, labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/src)

Added: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/org/jboss/soa/esb/samples/quickstart/httplistener/MyAction.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/org/jboss/soa/esb/samples/quickstart/httplistener/MyAction.java	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/org/jboss/soa/esb/samples/quickstart/httplistener/MyAction.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,52 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+package org.jboss.soa.esb.samples.quickstart.httplistener;
+
+import java.util.Iterator;
+import java.util.Map;
+
+import org.jboss.soa.esb.actions.AbstractActionLifecycle;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MyAction extends AbstractActionLifecycle {
+
+	protected ConfigTree _config;
+
+	public MyAction(ConfigTree config) {
+		_config = config;
+	}
+
+	public Message displayMessage(Message message) throws Exception {
+
+		
+		System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+
+		System.out.println("------------Http Request body -------------------");
+		System.out.println(message.getBody().get());
+		
+		System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+		message.getBody().add("Reponse :" + message.getBody().get());
+		return message;
+
+	}
+
+}

Added: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/org/jboss/soa/esb/samples/quickstart/httplistener/test/SendEsbMessage.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/org/jboss/soa/esb/samples/quickstart/httplistener/test/SendEsbMessage.java	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/http_listener/src/org/jboss/soa/esb/samples/quickstart/httplistener/test/SendEsbMessage.java	2009-01-14 06:30:24 UTC (rev 24696)
@@ -0,0 +1,50 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.samples.quickstart.httplistener.test;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.client.ServiceInvoker;
+
+public class SendEsbMessage 
+{
+    public static void main(String args[]) throws Exception
+    {
+//      Setting the ConnectionFactory such that it will use scout
+        System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
+        
+    	if (args.length < 3)
+    	{
+    		System.out.println("Usage SendEsbMessage <category> <name> <text to send>");
+    	}
+    	
+    	Message esbMessage = MessageFactory.getInstance().getMessage();
+
+    	esbMessage.getBody().add(args[2]);
+    	
+        Message msg = new ServiceInvoker(args[0], args[1]).deliverSync(esbMessage, 20000);
+        System.out.println(msg.getBody().get());
+    	
+    }
+    
+}




More information about the jboss-svn-commits mailing list