[jboss-svn-commits] JBL Code SVN: r7408 - labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Nov 5 09:13:45 EST 2006


Author: estebanschifman
Date: 2006-11-05 09:13:44 -0500 (Sun, 05 Nov 2006)
New Revision: 7408

Modified:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
Log:
'process' attribute in ConfigTree can now contain a comma separated list of method names for each <action> element

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java	2006-11-05 03:05:33 UTC (rev 7407)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java	2006-11-05 14:13:44 UTC (rev 7408)
@@ -70,40 +70,42 @@
             	_currentIndex++;
             	String attrName = ListenerTagNames.ACTION_CLASS_TAG;
             	_currentAction = oCurr.getAttribute(attrName);
-            	
+            	_currentClass = Class.forName(_currentAction);
+            	Constructor oConst = _currentClass.getConstructor(new Class[] {ConfigTree.class});
+            	_currentProcessor = oConst.newInstance(_config);
+
             	attrName	= ListenerTagNames.PROCESS_METHOD_TAG;
-            	String sProcessMethod = obtainAttribute(oCurr,attrName,attrName);
+            	String[] saMethodList = obtainAttribute(oCurr,attrName,attrName).split(",");
 
-            	_currentClass = Class.forName(_currentAction);
-            	Constructor oConst = _currentClass.getConstructor(new Class[] {ConfigTree.class});
-            	_currentProcessor = oConst.newInstance(_config);            	
-            	Method method = _currentClass.getMethod(sProcessMethod,new Class[] {Message.class});
-            	
-            	// The processing result of each action feeds into the processing of the next action...
-                try 
-                {
-                	Message next = (Message)method.invoke(_currentProcessor,new Object[] {_message} );
-                	
-                    actionClassFinishedOk(oCurr,_message);
-                    if(next==null)
-                    {
-                    	_logger.error(prematureTermination("returned <null> - Cannot continue"));
-                    	return;
-                    }
-                    _message = next;
-                }
-                catch (ClassCastException eCast)
-                {
-                	// If action class returns non Message, log and abort chain
-                	_logger.error(prematureTermination("returned a non Message Object)"));
-                	return;
-                }
-                catch (InvocationTargetException e)
-                {
-                	// If action class threw exception, log and abort chain
-                    actionClassException(oCurr,_message,e.getCause());
-                    return;
-                }
+            	for (String currMethod : saMethodList)
+            	{
+	            	Method method = _currentClass.getMethod(currMethod,new Class[] {Message.class});
+	            	
+	            	// The processing result of each action feeds into the processing of the next action...
+	                try 
+	                {
+	                	Message next = (Message)method.invoke(_currentProcessor,new Object[] {_message} );
+	                    if(next==null)
+	                    {
+	                    	_logger.warn(prematureTermination("returned <null> - Cannot continue"));
+	                    	return;
+	                    }
+	                    _message = next;
+	                }
+	                catch (ClassCastException eCast)
+	                {
+	                	// If action class returns non Message, log and abort chain
+	                	_logger.error(prematureTermination("returned a non Message Object)"));
+	                	return;
+	                }
+	                catch (InvocationTargetException e)
+	                {
+	                	// If action class threw exception, log and abort chain
+	                    actionClassException(oCurr,_message,e.getCause());
+	                    return;
+	                }
+            	}            	
+                actionClassFinishedOk(oCurr,_message);
             }
             // notification of action chain end can be done with a no-operation action class
             // with a proper ListenerPropertyNames.ACTION_NORMAL_COMPLETION_CALLBACK method




More information about the jboss-svn-commits mailing list