[jboss-svn-commits] JBL Code SVN: r23801 - in labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener: src/org/jboss/soa/esb/samples/quickstart/tomcatlistener and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Nov 9 20:53:07 EST 2008


Author: jim.ma
Date: 2008-11-09 20:53:03 -0500 (Sun, 09 Nov 2008)
New Revision: 23801

Added:
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/src/org/jboss/soa/esb/samples/quickstart/tomcatlistener/MyAction2.java
Modified:
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/deployment.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jbm-queue-service.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jbmq-queue-service.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jboss-esb.xml
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/readme.txt
   labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/src/org/jboss/soa/esb/samples/quickstart/tomcatlistener/MyAction.java
Log:
Updated quickstart to demonstrate one port multiple services support

Modified: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/deployment.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/deployment.xml	2008-11-10 01:27:16 UTC (rev 23800)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/deployment.xml	2008-11-10 01:53:03 UTC (rev 23801)
@@ -1,4 +1,6 @@
 <jbossesb-deployment>
   <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatlistener_Request_esb</depends>
   <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatlistener_Request_esb_reply</depends>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatlistener_Request_esb1</depends>
+  <depends>jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatlistener_Request_esb1_reply</depends>
 </jbossesb-deployment>

Modified: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jbm-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jbm-queue-service.xml	2008-11-10 01:27:16 UTC (rev 23800)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jbm-queue-service.xml	2008-11-10 01:53:03 UTC (rev 23801)
@@ -13,4 +13,20 @@
 	<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_tomcatlistener_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_tomcatlistener_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>

Modified: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jbmq-queue-service.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jbmq-queue-service.xml	2008-11-10 01:27:16 UTC (rev 23800)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jbmq-queue-service.xml	2008-11-10 01:53:03 UTC (rev 23801)
@@ -13,4 +13,20 @@
       jboss.mq:service=DestinationManager
     </depends>
   </mbean>
+
+
+
+  <mbean code="org.jboss.mq.server.jmx.Queue"
+    name="jboss.esb.quickstart.destination:service=Queue,name=quickstart_tomcatlistener_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_tomcatlistener_Request_esb1_reply">
+    <depends optional-attribute-name="DestinationManager">
+      jboss.mq:service=DestinationManager
+    </depends>
+  </mbean>
 </server>

Modified: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jboss-esb.xml	2008-11-10 01:27:16 UTC (rev 23800)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/jboss-esb.xml	2008-11-10 01:53:03 UTC (rev 23801)
@@ -9,15 +9,26 @@
                       dest-name="queue/quickstart_tomcatlistener_Request_esb"
                   />
               </jms-bus>
+              <jms-bus busid="quickstartEsbChannel1">
+                  <jms-message-filter
+                      dest-type="QUEUE"
+                      dest-name="queue/quickstart_tomcatlistener_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="Keypass" value="changeit"/-->
-            <tomcat-bus busid="HTTP-1" context="/jbossesb/tomcat/listener" />
+            <property name="Keystore" value="./key/.keystore"/>
+            <property name="Keypass" value="changeit"/>
+            <property name="allowTrace" value="true"/-->
+            <tomcat-bus busid="HTTP-1" context="/jbossesb/tomcatlistener/serviceA" />
+
+            <tomcat-bus busid="HTTP-2" context="/jbossesb/tomcatlistener/serviceB" />
          </tomcat-provider>
       </providers>
                       
@@ -33,7 +44,6 @@
                     is-gateway="true">
                 <!--property name="synchronous" value="false"/>
                 <property name="asyncResponse" value="/response.txt"/-->
-
                </tomcat-listener>	
                 <jms-listener name="JMS-Gateway"
                 	busidref="quickstartEsbChannel" 
@@ -45,7 +55,32 @@
                    	process="displayMessage" 
                    	/>                       
             </actions>
-        </service>       
+        </service>
+
+
+        <service 
+        	category="tomcatListener" 
+        	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.tomcatlistener.MyAction2" 
+                   	process="displayMessage" 
+                   	/>                       
+            </actions>
+        </service>
+
       </services>
-     
 </jbossesb>

Modified: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/readme.txt
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/readme.txt	2008-11-10 01:27:16 UTC (rev 23800)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/readme.txt	2008-11-10 01:53:03 UTC (rev 23801)
@@ -1,7 +1,7 @@
 Overview:
 =========
   The purpose of the tomcat_listener quickstart sample is to demonstarte how to 
-  configue a tomcat listener to pass the http request into ESB service.
+  configue a tomcat listener to pass the http request into ESB service. 
   
 
 Running this quickstart:
@@ -12,6 +12,7 @@
 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/tomcat/listener"
+  2. Open the web brower and send http request to "http://localhost:8765/jbossesb/tomcatlistener/serviceA/" 
+     and "http://localhost:8765/jbossesb/tomcatlistener/serviceB/"
   3. Switch back to Application Server console to see the output from the ESB
   4. In this folder ("Window1"), type 'ant undeploy'.

Modified: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/src/org/jboss/soa/esb/samples/quickstart/tomcatlistener/MyAction.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/src/org/jboss/soa/esb/samples/quickstart/tomcatlistener/MyAction.java	2008-11-10 01:27:16 UTC (rev 23800)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/src/org/jboss/soa/esb/samples/quickstart/tomcatlistener/MyAction.java	2008-11-10 01:53:03 UTC (rev 23801)
@@ -41,7 +41,8 @@
 		System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
 		
 		System.out.println("------------Http Request Info-------------------"); 
-		Map<String, String> requestInfo = (Map<String, String>)message.getProperties().getProperty("RequestInfoMap");
+		Map requestInfo = (Map)message.getProperties().getProperty("RequestInfoMap");
+		requestInfo.get("Method");
 		Iterator<String> infoIte = requestInfo.keySet().iterator();
 		while(infoIte.hasNext()) {
 			String key = infoIte.next();
@@ -53,7 +54,7 @@
 		Object obj = message.getProperties().getProperty("RequestParameterMap");
 		
 		if (obj != null) {
-			Map<String, String> paraMap = (Map<String, String>)obj;
+			Map<String, Object> paraMap = (Map<String, Object>)obj;
 			Iterator<String> paraIte = paraMap.keySet().iterator();
 			while(paraIte.hasNext()) {
 				String key = paraIte.next();
@@ -66,7 +67,7 @@
 		System.out.println(new String((byte[])message.getBody().get()));
 		
 		System.out.println("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
-		message.getBody().add("This message is from ESB service");
+		message.getBody().add("This message is from ESB service 1");
 		return message;
 
 	}

Added: labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/src/org/jboss/soa/esb/samples/quickstart/tomcatlistener/MyAction2.java
===================================================================
--- labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/src/org/jboss/soa/esb/samples/quickstart/tomcatlistener/MyAction2.java	                        (rev 0)
+++ labs/jbossesb/workspace/mlittle/legstar/product/samples/quickstarts/tomcat_listener/src/org/jboss/soa/esb/samples/quickstart/tomcatlistener/MyAction2.java	2008-11-10 01:53:03 UTC (rev 23801)
@@ -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.tomcatlistener;
+
+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("&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&");
+		
+		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;
+
+	}
+
+}
\ No newline at end of file




More information about the jboss-svn-commits mailing list