[jboss-svn-commits] JBL Code SVN: r6814 - labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/actions

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sun Oct 15 22:51:47 EDT 2006


Author: estebanschifman
Date: 2006-10-15 22:51:45 -0400 (Sun, 15 Oct 2006)
New Revision: 6814

Modified:
   labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java
Log:
Add methods to deal with NotificationList

Modified: labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java
===================================================================
--- labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java	2006-10-16 01:50:48 UTC (rev 6813)
+++ labs/jbossesb/workspace/eschifman/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java	2006-10-16 02:51:45 UTC (rev 6814)
@@ -21,9 +21,15 @@
  */
 
 package org.jboss.soa.esb.actions;
+
+import java.io.IOException;
+import org.apache.log4j.Logger;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.DomElement;
 import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.notification.NotificationList;
+import org.xml.sax.SAXException;
 
 /**
  * Contains utility methods for actions 
@@ -104,5 +110,31 @@
     {
     	ConfigTree oRet = (ConfigTree)message.getBody().get(CONFIG_TREE);
     	return (null==oRet)?new ConfigTree("mock"):oRet;
-    }	
+    }
+    
+    public static NotificationList getNotifyList(ConfigTree tree, String type)
+    {
+    	ConfigTree[] array = tree.getChildren("NotificationList");
+    	for (ConfigTree curr : array)
+    	{
+    		String sType = curr.getAttribute(NotificationList.TYPE);
+    		if (null==sType)
+    			continue;
+    		if (type.toLowerCase().startsWith(sType.toLowerCase()))
+    			return notifListfromConfig(curr);
+    	}
+    	return null;
+    }
+    
+    //TODO  this is temporary until NotificationList extends ConfigTree (not DomElement)
+    public static NotificationList notifListfromConfig(ConfigTree tree)
+    {
+    	Exception thrown = null;
+    	try { return new NotificationList(DomElement.fromXml(tree.toXml())); }
+    	catch (Exception e) 	{thrown = e;}
+    	Logger.getLogger(ActionUtils.class).error(thrown);
+    	return null;
+    }
+
+
 }




More information about the jboss-svn-commits mailing list