[jboss-svn-commits] JBL Code SVN: r8853 - in labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions: templates and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Jan 15 08:29:55 EST 2007


Author: estebanschifman
Date: 2007-01-15 08:29:49 -0500 (Mon, 15 Jan 2007)
New Revision: 8853

Removed:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/AbstractSqlRowAction.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockMessageAction.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockSqlRowAction.java
Modified:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/CbrProxyAction.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockAction.java
Log:
Cleanup old style actions (pre CR2)

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/AbstractSqlRowAction.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/AbstractSqlRowAction.java	2007-01-15 13:26:47 UTC (rev 8852)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/AbstractSqlRowAction.java	2007-01-15 13:29:49 UTC (rev 8853)
@@ -1,51 +0,0 @@
-package org.jboss.soa.esb.actions;
-
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Abstract SQL Row action.
- * <p/>
- * Convienience class for processing messages from the {@link org.jboss.soa.esb.listeners.old.SqlTablePoller} listener.
- * Implementing classes receive a single row resultset through their implementation of the {@link #process(Map)}
- * method.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public abstract class AbstractSqlRowAction implements ActionProcessor {
-
-    protected Logger logger;
-
-    protected AbstractSqlRowAction(String actionName,
-            List<KeyValuePair> properties) throws Exception {
-
-        logger = Logger.getLogger(getClass());
-    }
-
-    public final Message process(Message message) throws ActionProcessingException {
-    	Object oCurr = ActionUtils.getTaskObject(message);
-        if (!(oCurr instanceof Map)) {
-            throw new ActionProcessingException(
-                    "Message object for processing by "
-                            + getClass().getName()
-                            + " should have been preprocessed and supplied as a "
-                            + Map.class.getName() + " instance.");
-        }
-        ActionUtils.setTaskObject(message,process((Map)oCurr));
-        return message;
-    } // ________________________________
-
-    /**
-     * Process the SQL poll resultset.
-     * 
-     * @param resultSet SQL Poller resultset.
-     * @return Processing result.
-     */
-    protected abstract Object process(Map resultSet) throws ActionProcessingException;
-
-}

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/CbrProxyAction.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/CbrProxyAction.java	2007-01-15 13:26:47 UTC (rev 8852)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/CbrProxyAction.java	2007-01-15 13:29:49 UTC (rev 8853)
@@ -22,7 +22,6 @@
 
 package org.jboss.soa.esb.actions;
 
-import java.io.Serializable;
 import java.net.URISyntaxException;
 import java.util.Collection;
 import java.util.Iterator;
@@ -56,7 +55,7 @@
  * @author kstam at redhat.com
  * 
  */
-public class CbrProxyAction implements ActionProcessor
+public class CbrProxyAction
 {
 	private static Logger _logger = Logger.getLogger(CbrProxyAction.class);
 	/** Collection of EPRS for the Content Based Router */
@@ -249,12 +248,4 @@
     	
     }
     
-	public Serializable getErrorNotification(Message message) {
-		// TODO Auto-generated method stub
-		return null;
-	}
-	public Serializable getOkNotification(Message message) {
-		// TODO Auto-generated method stub
-		return null;
-	}
 } 
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockAction.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockAction.java	2007-01-15 13:26:47 UTC (rev 8852)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockAction.java	2007-01-15 13:29:49 UTC (rev 8853)
@@ -22,13 +22,13 @@
 
 package org.jboss.soa.esb.actions.templates;
 
-import java.io.Serializable;
+import java.io.IOException;
 import java.text.SimpleDateFormat;
 
 import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.ActionProcessor;
 import org.jboss.soa.esb.actions.ActionUtils;
 import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.Util;
 
 
 /**
@@ -39,17 +39,23 @@
  * @author Esteban
  * 
  */
-public class MockAction implements ActionProcessor {
+public class MockAction 
+{
     /**
      * Class Logger.
      */
     private static Logger logger = Logger.getLogger(MockAction.class);
 
-    public Message process(Message message) {
-    	Object oCurr = ActionUtils.getTaskObject(message);
-    	if (null==oCurr)
+    public Message process(Message message) 
+    {
+    	Object oCurr = null;
+    	if (null==message)
     		oCurr = "null";
-        logger.info("process was called with <<" + oCurr.toString() + ">>");
+    	else
+	    	try { oCurr = Util.serialize(message); }
+	    	catch (Exception e) 
+	    		{ oCurr = message.toString();}
+        logger.info(getStamp() + " process was called with <<" + oCurr.toString() + ">>");
         return message;
     } // ________________________________
 
@@ -60,16 +66,4 @@
         return s_oTS.format(new java.util.Date(System.currentTimeMillis()));
     }
 
-    public Serializable getOkNotification(Message message) {
-    	Object oCurr = ActionUtils.getTaskObject(message);
-        return getStamp() + " Notif OK - <"
-                + ((null == oCurr) ? "null" : oCurr.toString()) + ">";
-    } // ________________________________
-
-    public Serializable getErrorNotification(Message message) {
-    	Object oCurr = ActionUtils.getTaskObject(message);
-        return getStamp() + " Notif ERROR - <"
-                + ((null == oCurr) ? "null" : message.toString()) + ">";
-    } // ________________________________
-
 } // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockMessageAction.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockMessageAction.java	2007-01-15 13:26:47 UTC (rev 8852)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockMessageAction.java	2007-01-15 13:29:49 UTC (rev 8853)
@@ -1,137 +0,0 @@
-/*
- * 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.actions.templates;
-
-import java.text.SimpleDateFormat;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.notification.NotificationList;
-
-
-/**
- * Use this class to tune your XML configurations <p/>Once your config works
- * with this dummy class, you can switch to your own action class <p/>You will
- * have to implement these three methods in your own action class
- * 
- * @author Esteban
- * 
- */
-public class MockMessageAction
-{
-	protected Message 		_message;
-	protected ConfigTree	_config;
-	
-    public MockMessageAction(ConfigTree config) { _config = config; } 
-    public Message noOperation(Message message) { return message; } 
-    
-    public Message process(Message message) 
-    {
-    	_message = message;
-    	Object oCurr = ActionUtils.getTaskObject(message);
-    	if (null==oCurr)
-    		oCurr = "null";
-        _logger.info(getStamp()+" process was called with <<" + oCurr.toString() + ">>");
-        return message;
-    } // ________________________________
-
-
-    public Message process222(Message message) 
-    {
-    	_message = message;
-    	Object oCurr = ActionUtils.getTaskObject(message);
-    	if (null==oCurr)
-    		oCurr = "null";
-        _logger.info(getStamp()+" process222 was called with <<" + oCurr.toString() + ">>");
-        return message;
-    } // ________________________________
-
-    private static final SimpleDateFormat s_oTS 
-    	= new SimpleDateFormat("yyyy/MM/dd hh:mm:ss.SSS");
-
-    private String getStamp()
-    	{ return s_oTS.format(new java.util.Date(System.currentTimeMillis())); }
-
-    private static Logger _logger = Logger.getLogger(MockMessageAction.class);
-    
-    public void myOkMethod1()
-    {
-    	String sMsg = new StringBuilder(getStamp())
-    	.append(" MockAction.myOkMethod1 was called ")
-    	.append(_message)
-    	.toString();
-    	_logger.info(sMsg);
-    	@SuppressWarnings("unused") 
-    	NotificationList nl = ActionUtils.getNotifyList(_config,"ok");
-    	// Here you can send notifications to everybody
-    }
-
-    public void myMethod2()
-    {
-    	String sMsg = new StringBuilder(getStamp())
-    	.append(" Method2 Method2 Method2 Method2 Method2  CALLED ")
-    	.append(_message)
-    	.toString();
-    	_logger.info(sMsg);
-    	@SuppressWarnings("unused") 
-    	NotificationList nl = ActionUtils.getNotifyList(_config,"ok");
-    	// Here you can send notifications to everybody
-    }
-
-    public void endOfChainNotification()
-    {
-    	String sMsg = new StringBuilder(getStamp())
-    	.append(" End of action chain reached - Bye bye")
-    	.toString();
-    	_logger.info(sMsg);
-    	@SuppressWarnings("unused") 
-    	NotificationList nl = ActionUtils.getNotifyList(_config,"ok");
-    	// Here you can send notifications to everybody
-    }
-
-    public Message justThrow(Message message) throws Exception 
-    {
-    	throw new MockException("Mock exception thrown at "+getStamp());
-    } // ________________________________
-    
-    @SuppressWarnings("serial")
-	private class MockException extends Exception
-    {
-    	MockException(String str) { super(str); }
-    }
-
-    public void exceptionCallback1(Exception e)
-    {
-    	String sMsg = new StringBuilder(getStamp())
-    	.append(" MockExceptionTrower.exceptionCallback1  CALLED ")
-    	.append(_message)
-    	.toString();
-    	_logger.fatal(sMsg,e);
-    	@SuppressWarnings("unused") 
-    	NotificationList nl = ActionUtils.getNotifyList(_config,"err");
-    	// Here you can send notifications to everybody
-    }
-    
-} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockSqlRowAction.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockSqlRowAction.java	2007-01-15 13:26:47 UTC (rev 8852)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockSqlRowAction.java	2007-01-15 13:29:49 UTC (rev 8853)
@@ -1,84 +0,0 @@
-/*
- * 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.actions.templates;
-
-import java.io.Serializable;
-import java.text.SimpleDateFormat;
-import java.util.List;
-import java.util.Map;
-import java.util.Vector;
-
-import org.jboss.soa.esb.actions.AbstractSqlRowAction;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Use this class to tune your XML configurations
- * <p/>Once your config works with this dummy class, you can
- * switch to your own action class
- * <p/>You will have to implement these three methods 
- * in your own action class
- * 
- * @author Esteban
- *
- */
-public class MockSqlRowAction extends AbstractSqlRowAction 
-{
-    
-    public static List<Map> params = new Vector<Map>();
-
-    public MockSqlRowAction(String actionName, List<KeyValuePair> properties) throws Exception {
-        super(actionName, properties);
-    }
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.AbstractSqlRowAction#processSQL()
-     */
-    @Override
-    protected Object process(Map resultSet) {
-        logger.info("processResultset was called with <<"
-                + resultSet.toString()+">>");
-        params.add(resultSet);
-        
-        return resultSet;
-    }
-	
-	private SimpleDateFormat s_oTS = new SimpleDateFormat("yyyy/MM/dd hh:mm:ss.SSS");
-	private String getStamp() 
-		{ return s_oTS.format(new java.util.Date(System.currentTimeMillis())); }
-
-	public Serializable getOkNotification(Message message)
-	{
-		return getStamp()+" Notif OK - <"
-		+ActionUtils.getTaskObject(message)
-		+">";
-	} //________________________________
-
-	public Serializable getErrorNotification(Message message)
-	{
-		return getStamp()+" Notif ERROR - <"
-		+ActionUtils.getTaskObject(message)
-		+">";
-	} //________________________________
-} //____________________________________________________________________________




More information about the jboss-svn-commits mailing list