[jboss-svn-commits] JBL Code SVN: r15876 - in labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1: src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Oct 17 07:44:42 EDT 2007


Author: tfennelly
Date: 2007-10-17 07:44:42 -0400 (Wed, 17 Oct 2007)
New Revision: 15876

Modified:
   labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service1.groovy
   labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service2.groovy
   labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service3.groovy
   labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/MessageSpy.java
Log:
Updates to reflect new message stuff

Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service1.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service1.groovy	2007-10-17 10:59:50 UTC (rev 15875)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service1.groovy	2007-10-17 11:44:42 UTC (rev 15876)
@@ -2,10 +2,10 @@
 
 println "1********** Begin Service 1 ***********"
 
-println "In: " + new String(message.body.contents)
+println "In: " + new String(message.getBody().get())
 
-message.body.contents = ("Service 1 " + new String(message.body.contents)).getBytes()
+message.getBody().add("Service 1 " + new String(message.getBody().get()))
 
-println "Out: " + new String(message.body.contents)
+println "Out: " + message.getBody().get()
 
 println "************ End Service 1 ************"
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service2.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service2.groovy	2007-10-17 10:59:50 UTC (rev 15875)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service2.groovy	2007-10-17 11:44:42 UTC (rev 15876)
@@ -2,11 +2,11 @@
 
 println "2********** Begin Service 2 ***********"
 
-println "In: " + new String(message.body.contents)
+println "In: " + new String(message.getBody().get())
 
-message.body.contents = ("Service 2 " + new String(message.body.contents)).getBytes()
+message.getBody().add("Service 2 " + new String(message.getBody().get()))
 
-println "Out: " + new String(message.body.contents)
+println "Out: " + message.getBody().get()
 
 println "************ End Service 2 ************"
 

Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service3.groovy
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service3.groovy	2007-10-17 10:59:50 UTC (rev 15875)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/scripts/service3.groovy	2007-10-17 11:44:42 UTC (rev 15876)
@@ -2,9 +2,9 @@
 
 println "3********** Begin Service 3 ***********"
 
-println "In: " + new String(message.body.contents)
+println "In: " + new String(message.getBody().get())
 
-message.body.contents = ("Service 3 " + new String(message.body.contents)).getBytes()
+message.getBody().add("Service 3 " + new String(message.getBody().get()))
 
-println "Out: " + new String(message.body.contents)
+println "Out: " + message.getBody().get()
 println "************ End Service 3 ************"
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/MessageSpy.java
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/MessageSpy.java	2007-10-17 10:59:50 UTC (rev 15875)
+++ labs/jbossesb/trunk/product/samples/quickstarts/bpm_orchestration1/src/org/jboss/soa/esb/samples/quickstarts/bpm_orchestration1/esb_actions/MessageSpy.java	2007-10-17 11:44:42 UTC (rev 15876)
@@ -23,7 +23,6 @@
 
 import org.jboss.soa.esb.actions.AbstractActionLifecycle;
 import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
 import org.jboss.soa.esb.message.Message;
 import org.apache.log4j.Logger;
 
@@ -33,9 +32,13 @@
 	private Logger logger = Logger.getLogger(MessageSpy.class);
 	
 	  // modify to use the logger
-	public Message process(Message message) throws Exception {		
-		if (message.getBody() != null && message.getBody().getByteArray() != null) {
-			logger.info("Body: " + new String(message.getBody().getByteArray()));
+	public Message process(Message message) throws Exception {
+        Object payload = message.getBody().get();
+
+        if (payload instanceof byte[]) {
+            logger.info("Body: " + new String((byte[])message.getBody().get()));
+        } else if (payload instanceof String) {
+			logger.info("Body: " + message.getBody().get());
 		} else {
 			logger.info("Body Contents are NULL");
 		}




More information about the jboss-svn-commits mailing list