[jboss-svn-commits] JBL Code SVN: r7292 - in labs/jbossesb/workspace/b_georges/product/core: listeners/src/org/jboss/internal/soa/esb/couriers listeners/src/org/jboss/soa/esb/actions listeners/src/org/jboss/soa/esb/couriers listeners/src/org/jboss/soa/esb/listeners/gateway listeners/src/org/jboss/soa/esb/listeners/message listeners/src/org/jboss/soa/esb/listeners/old listeners/tests/src/org/jboss/soa/esb/listeners/old rosetta/src/org/jboss/internal/soa/esb/util rosetta/src/org/jboss/soa/esb/util services/src/org/jboss/soa/esb/services/persistence services/src/org/jboss/soa/esb/services/registry services/tests/src/org/jboss/soa/esb/esb/persistence/tests services/tests/src/org/jboss/soa/esb/services/registry

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Wed Nov 1 16:26:35 EST 2006


Author: b_georges
Date: 2006-11-01 16:26:01 -0500 (Wed, 01 Nov 2006)
New Revision: 7292

Added:
   labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
   labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java
   labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java
   labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java
Modified:
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/FtpDownloader.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/FtpUploader.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/couriers/CourierFactory.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerController.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/easier2ReadExample.xml
   labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/old/RemoteDirectoryPoller.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/AbstractListenerUnitTest.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/DirectoryPollerUnitTest.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/GpListenerUnitTest.java
   labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/SqlTablePollerUnitTest.java
   labs/jbossesb/workspace/b_georges/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreType.java
   labs/jbossesb/workspace/b_georges/product/core/services/src/org/jboss/soa/esb/services/registry/JAXRRegistryImpl.java
   labs/jbossesb/workspace/b_georges/product/core/services/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java
   labs/jbossesb/workspace/b_georges/product/core/services/tests/src/org/jboss/soa/esb/services/registry/JAXRRegistryUnitTest.java
Log:
Refactored FtpClientUtil. Added RemoteFileSystem interface to support multiple implementation. Added RemoteFileSystemFactory. Moved EdtFtpImpl [ex FtpClientUtil] to internal.soa.esb.util

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -22,19 +22,31 @@
 
 package org.jboss.internal.soa.esb.couriers;
 
-import java.util.*;
-import javax.jms.*;
+import java.util.List;
+
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.Topic;
+import javax.jms.TopicConnection;
+import javax.jms.TopicConnectionFactory;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSession;
 import javax.naming.Context;
 
 import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.helpers.JMSEpr;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
 import org.jboss.soa.esb.couriers.Courier;
 import org.jboss.soa.esb.couriers.CourierException;
 import org.jboss.soa.esb.helpers.AppServerContext;
+import org.jboss.soa.esb.helpers.KeyValuePair;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.util.Util;
-import org.jboss.soa.esb.helpers.*;
 
 public class JmsCourier implements Courier 
 {
@@ -46,8 +58,9 @@
 	 * package protected constructor - Objects of Courier should only be instantiated by the Factory
 	 * @param epr
 	 */
-	public JmsCourier(EPR epr) throws CourierException
+	public JmsCourier(JMSEpr epr) throws CourierException
 	{
+		_epr	= epr;
 		_sleepForRetries	= 3000;
 
 		try 
@@ -74,7 +87,10 @@
 			try 
 			{
 				// obtain Serializable version of arg0 and package it in a jms ObjectMessage
-				sendMessage(_jmsSession.createObjectMessage(Util.serialize(message)));
+				ObjectMessage msg = _jmsSession.createObjectMessage(Util.serialize(message));
+				for (KeyValuePair kvp : _messageProperties)
+					msg.setStringProperty(kvp.getKey(), kvp.getValue());
+				sendMessage(msg);
 				return true;
 			}
 			catch (JMSException e)	{ jmsRetry(e); }

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/ActionUtils.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -36,7 +36,6 @@
 {
 	public  static final String BEFORE_ACTION="org.jboss.soa.esb.actions.current.before";
 	private static final String CURRENT_OBJECT="org.jboss.soa.esb.actions.current.after";
-	private static final String CONFIG_TREE	="org.jboss.soa.esb.helpers.ConfigTree";
 
     /**
      * Obtain the current object from standard spot within message 
@@ -64,7 +63,9 @@
     {
     	Body body = message.getBody();
     	body.remove(BEFORE_ACTION);
-    	body.add(BEFORE_ACTION,body.get(CURRENT_OBJECT));
+    	Object obj = body.get(CURRENT_OBJECT);
+    	if (null != obj)
+    		body.add(BEFORE_ACTION,obj);
     }
     /**
      * Put current object in standard spot within message
@@ -81,33 +82,6 @@
     	return oRet;
     }	
 
-    /**
-     * Put a Config tree in predefined spot for it in 'this'
-     * <br/>NULL values are not stored 
-     * @param message - to operate on
-     * @param tree - ConfigTree to store - Won't be stored if &lt;null&gt;
-     * @return ConfigTree previously stored
-     */
-    public static ConfigTree setConfigTree(Message message, ConfigTree tree)
-    {
-    	ConfigTree oRet = (ConfigTree)message.getBody().remove(CONFIG_TREE);
-    	if (null!=tree)
-    		message.getBody().add(CONFIG_TREE,tree);
-    	return oRet;
-    }	
-    /**
-     * Put a Config tree in predefined spot for it in 'this'
-     * <br/>NULL values are not stored 
-     * @param message - to operate on
-     * @param tree - ConfigTree to store - Won't be stored if &lt;null&gt;
-     * @return ConfigTree previously stored
-     */
-    public static ConfigTree getConfigTree(Message message)
-    {
-    	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");
@@ -121,5 +95,4 @@
     	}
     	return null;
     }
-    
 }

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/FtpDownloader.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/FtpDownloader.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/FtpDownloader.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -27,18 +27,19 @@
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.EdtFtpImpl;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.KeyValuePair;
 import org.jboss.soa.esb.listeners.old.GpListener;
 import org.jboss.soa.esb.listeners.old.RemoteDirectoryPoller;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.FtpClientUtil;
+import org.jboss.soa.esb.util.RemoteFileSystem;
 
 public class FtpDownloader extends AbstractFileAction 
 {
 	ConfigTree		_parms;
-	FtpClientUtil 	_ftpClient;
+	RemoteFileSystem 	_ftpClient;
 	String			_localDir;
 	RemoteDirectoryPoller.WorkingFile _workFile;
 	Logger			_logger = Logger.getLogger(this.getClass());
@@ -76,9 +77,9 @@
         		}
         	// end of kludge
 //        	System.out.println("Downloading "+_workFile);
-			_ftpClient = new FtpClientUtil(_parms,true);
-			_localDir = _parms.getAttribute(FtpClientUtil.PARMS_LOCAL_DIR);
-			String sFrom = FtpClientUtil.fileToFtpString(_workFile);
+			_ftpClient = new EdtFtpImpl(_parms,true);
+			_localDir = _parms.getAttribute(RemoteFileSystem.PARMS_LOCAL_DIR);
+			String sFrom = EdtFtpImpl.fileToFtpString(_workFile);
 			_ftpClient.downloadFile(sFrom,_workFile.getInputFile().getName());
 
 			if (_workFile.isPostDelete())

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/FtpUploader.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/FtpUploader.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/actions/FtpUploader.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -27,18 +27,19 @@
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.EdtFtpImpl;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.KeyValuePair;
 import org.jboss.soa.esb.listeners.old.DirectoryPoller;
 import org.jboss.soa.esb.listeners.old.GpListener;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.FtpClientUtil;
+import org.jboss.soa.esb.util.RemoteFileSystem;
 
 public class FtpUploader extends AbstractFileAction 
 {
 	ConfigTree		_parms;
-	FtpClientUtil 	_ftpClient;
+	RemoteFileSystem 	_ftpClient;
 	String			_remoteDir;
 	DirectoryPoller.WorkingFile _workFile;
 	Logger			_logger = Logger.getLogger(this.getClass());
@@ -68,8 +69,8 @@
         try 
 		{
         	System.out.println("FTP uploading "+obj);
-			_ftpClient = new FtpClientUtil(_parms,true);
-			_remoteDir = _parms.getAttribute(FtpClientUtil.PARMS_REMOTE_DIR);
+			_ftpClient = new EdtFtpImpl(_parms,true);
+			_remoteDir = _parms.getAttribute(RemoteFileSystem.PARMS_REMOTE_DIR);
 			_ftpClient.uploadFile(_workFile,_workFile.getInputFile().getName());
 
 			if (_workFile.isPostDelete())
@@ -99,7 +100,7 @@
 		return new StringBuilder()
 		.append(_workFile.getInputFile().toString())
 		.append("successfully uploaded to ").append(_remoteDir)
-		.append(" on ").append(_parms.getAttribute(FtpClientUtil.PARMS_FTP_SERVER))
+		.append(" on ").append(_parms.getAttribute(RemoteFileSystem.PARMS_FTP_SERVER))
 		.toString();
 	} //________________________________
 	
@@ -108,7 +109,7 @@
 		return new StringBuilder()
 		.append("Failed to upload ").append(_workFile.getInputFile().toString())
 		.append(" to ").append(_remoteDir)
-		.append(" on ").append(_parms.getAttribute(FtpClientUtil.PARMS_FTP_SERVER))
+		.append(" on ").append(_parms.getAttribute(RemoteFileSystem.PARMS_FTP_SERVER))
 		.toString();
 	} //________________________________
 	

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/couriers/CourierFactory.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/couriers/CourierFactory.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/couriers/CourierFactory.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -26,7 +26,7 @@
 
 import org.jboss.internal.soa.esb.couriers.JmsCourier;
 import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.helpers.*;
+import org.jboss.soa.esb.addressing.eprs.*;
 
 public class CourierFactory 
 {
@@ -44,7 +44,7 @@
 		{
 			String address = epr.getAddr().getAddress();
 			if (address.startsWith(JMSEpr.JMS_PROTOCOL))
-				return new JmsCourier(epr);
+				return new JmsCourier((JMSEpr)epr);
 		}
 		catch (URISyntaxException e) { throw new CourierException(e); }
 		throw new CourierException("Unknown protocol");

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -37,7 +37,7 @@
 
 import org.apache.log4j.Logger;
 import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.helpers.JMSEpr;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
 import org.jboss.soa.esb.couriers.Courier;
 import org.jboss.soa.esb.couriers.CourierException;
 import org.jboss.soa.esb.couriers.CourierFactory;

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -1,14 +1,14 @@
 package org.jboss.soa.esb.listeners.message;
 
-import java.lang.reflect.*;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
 
 import org.apache.log4j.Logger;
-
 import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.listeners.ListenerTagNames;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
 
 
 /**
@@ -27,13 +27,13 @@
      * @param message Message - The initial message to be run through the whole action 
      * class chain
      */
-    public ActionProcessingPipeline(Message message)
+    public ActionProcessingPipeline(Message message, ConfigTree config)
     	throws ConfigurationException
     {
-    	if (null==_message)
+    	if (null==message)
     		throw new IllegalArgumentException("Message must be not null");
         _message	= message;
-        _config		= ActionUtils.getConfigTree(_message);
+        _config		= config;
     	if (null==_config)
     		throw new IllegalArgumentException("Configuration needed for action classes");
     	_actionList = _config.getChildren(ListenerTagNames.ACTION_ELEMENT_TAG);
@@ -82,16 +82,15 @@
             	// The processing result of each action feeds into the processing of the next action...
                 try 
                 {
-                	// copy currentObject in Message body to 'previous' currentObject
-                	ActionUtils.copyCurrentToPrevious(_message);
                 	Message next = (Message)method.invoke(_currentProcessor,new Object[] {_message} );
                 	
-                    actionClassFinishedOk(oCurr);
+                    actionClassFinishedOk(oCurr,_message);
                     if(next==null)
                     {
                     	_logger.error(prematureTermination("returned <null> - Cannot continue"));
                     	return;
                     }
+                    _message = next;
                 }
                 catch (ClassCastException eCast)
                 {
@@ -99,10 +98,10 @@
                 	_logger.error(prematureTermination("returned a non Message Object)"));
                 	return;
                 }
-                catch (Exception e)
+                catch (InvocationTargetException e)
                 {
                 	// If action class threw exception, log and abort chain
-                    actionClassException(oCurr,e);
+                    actionClassException(oCurr,_message,e.getCause());
                     return;
                 }
             }
@@ -137,17 +136,17 @@
      * If 'current' action step was configured with a 'exceptionMethod' attribute
      * that method will be called with a single argument of type Exception 
      * @param tree ConfigTree - where to look for the exceptionMetod attribute
-     * @param thr Exception - to be used in invocation to method (if found)
+     * @param thrown Exception - to be used in invocation to method (if found)
      */
-    protected void actionClassException(ConfigTree tree, Exception thr)
+    protected void actionClassException(ConfigTree tree, Message msg,  Throwable thrown)
     {
-    	thr.printStackTrace();
+//    	thrown.printStackTrace();
     	String sMethod = obtainAttribute(tree,ListenerTagNames.EXCEPTION_METHOD_TAG,null);
     	if (null!=sMethod)
 	    	try
 	    	{
-	    		Method method = _currentClass.getMethod(sMethod,new Class[] {Exception.class});
-	    		method.invoke(_currentProcessor,new Object[] {thr} );
+	    		Method method = _currentClass.getMethod(sMethod,new Class[] {Message.class, Throwable.class});
+	    		method.invoke(_currentProcessor,new Object[] {msg, thrown} );
 	    	}
 	    	catch (NoSuchMethodException e) 	{_logger.error(e); }
 	    	catch (InvocationTargetException e) {_logger.error(e); }
@@ -159,14 +158,14 @@
      * that method will be called with no arguments 
      * @param tree ConfigTree - where to look for the okMetod attribute
      */
-    protected void actionClassFinishedOk(ConfigTree tree)
+    protected void actionClassFinishedOk(ConfigTree tree,Message msg)
     {
     	String sMethod = obtainAttribute(tree,ListenerTagNames.NORMAL_COMPLETION_METHOD_TAG,null);
     	if (null!=sMethod)
 	    	try
 	    	{
-	    		Method method = _currentClass.getMethod(sMethod,new Class[] {});
-	    		method.invoke(_currentProcessor,new Object[] {} );
+	    		Method method = _currentClass.getMethod(sMethod,new Class[] {Message.class});
+	    		method.invoke(_currentProcessor,new Object[] {msg} );
 	    	}
 	    	catch (NoSuchMethodException e) 	{_logger.error(e); }
 	    	catch (InvocationTargetException e) {_logger.error(e); }

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerController.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerController.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerController.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -32,9 +32,8 @@
 import org.apache.log4j.Logger;
 import org.jboss.internal.soa.esb.command.CommandQueue;
 import org.jboss.internal.soa.esb.command.CommandQueueException;
-import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.addressing.util.EPRManager;
-import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.common.Environment;
 import org.jboss.soa.esb.common.ModulePropertyManager;
 import org.jboss.soa.esb.helpers.ConfigTree;
@@ -258,12 +257,7 @@
 		String sEndT = p_oP.getAttribute(PARM_END_TIME);
 		m_lEndTime = (null == sEndT) ? Long.MAX_VALUE : s_oDateParse.parse(
 				sEndT).getTime();
-
-        // Read and initialise the action definitions...
-        ConfigTree actionConfig = p_oP.getFirstChild("Actions");
-        if(actionConfig == null) {
-            throw new ConfigurationException("No 'Actions' configuration.");
-        }        
+          
 	} // ________________________________
 
     /**
@@ -342,7 +336,8 @@
 
 		// Close the command queue...
 		try {
-			commandQueue.close();
+			if (null != commandQueue)
+				commandQueue.close();
 		} catch (CommandQueueException e) {
 			_logger.error("Error closing Command Queue.", e);
 		}
@@ -374,8 +369,8 @@
 			// No command queue nor topic - Just sleep until time
 			// exhausted, or thread interrupted
 			try {
-				if (lToGo > 0)
-					Thread.sleep(lToGo);
+				while ((lToGo=millisToWait()) > 0)
+					Thread.sleep(500);
 			} catch (InterruptedException e) {
 				m_lEndTime = 0; // mark as end requested and return
 			}
@@ -466,6 +461,11 @@
 		}
 	} // ________________________________
 
+	public void requestEnd() {
+		m_bEndRequested=true;
+		m_lEndTime = 0;
+	}
+	
 	/**
 	 * Accessor to determine if execution time is expired or shutdown requested
 	 * 
@@ -512,7 +512,7 @@
 		return (endNotRequested() && !timeToReload());
 	} // ________________________________
 	
-	private static EPRManager getEprManager()
+	public static EPRManager getEprManager()
 	{
 		PropertyManager manager = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE);
 		String sDir = manager.getProperty(Environment.REGISTRY_FILE_HELPER_DIR,".");	

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -22,6 +22,9 @@
 
 package org.jboss.soa.esb.listeners.message;
 
+import java.io.IOException;
+import java.io.Serializable;
+
 import javax.jms.JMSException;
 import javax.jms.MessageConsumer;
 import javax.jms.ObjectMessage;
@@ -31,15 +34,16 @@
 import javax.jms.QueueSession;
 import javax.jms.TopicSession;
 import javax.naming.Context;
+import javax.xml.parsers.ParserConfigurationException;
 
 import org.apache.log4j.Logger;
-
 import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
 import org.jboss.soa.esb.helpers.AppServerContext;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.addressing.helpers.JMSEpr;
+import org.jboss.soa.esb.util.Util;
+import org.xml.sax.SAXException;
 
 /**
  * Esb Message aware JMS queue listener.
@@ -82,13 +86,13 @@
 
     	while (_controller.continueLooping())
         {
-        	org.jboss.soa.esb.message.Message message = receiveEsbMessage(_controller.millisToWait());
+    		long lwait = _controller.millisToWait();
+    		org.jboss.soa.esb.message.Message message = (lwait > 0 ) ? receiveEsbMessage(100) : null;
         	if (null!=message)
         	{	
-        		ActionUtils.setConfigTree(message,_config);
         		ActionProcessingPipeline chain = null;
 
-        		try	{ chain = new ActionProcessingPipeline(message); }
+        		try	{ chain = new ActionProcessingPipeline(message,_config); }
         		catch (IllegalArgumentException e)	
         			{	_logger.error(e); 	continue; }
         		catch (ConfigurationException e)
@@ -98,7 +102,6 @@
         		new Thread(chain).start();
         	}
         }
-
     	_controller.unRegister(_eprName);
     	cleanup();
     } // _______________________________
@@ -143,6 +146,7 @@
         	_oQsess = _oQconn.createQueueSession(false,TopicSession.AUTO_ACKNOWLEDGE);
         	_oQconn.start();
         	_receiver = _oQsess.createReceiver(_oQueue, _sSelector);
+        	return;
         }
         catch (javax.naming.NamingException e)	{ thrown = e; }
         catch (JMSException e) 					{ thrown = e; }
@@ -153,7 +157,10 @@
     protected org.jboss.soa.esb.message.Message receiveEsbMessage(long millis)
     {
     	javax.jms.Message jmsMessage = null;
-        try {	jmsMessage = _receiver.receive(millis); }
+        try 
+		{	
+        	jmsMessage = _receiver.receive(millis);
+		}
         catch (JMSException oJ)
         {
         	_logger.error("JMS error on receive.  Attempting JMS Destination reconnect.", oJ);
@@ -181,7 +188,8 @@
         }
         try
         {
-        	return (org.jboss.soa.esb.message.Message)((ObjectMessage)jmsMessage).getObject();
+        	Serializable obj = (Serializable)((ObjectMessage)jmsMessage).getObject();
+        	return Util.deserialize(obj);
         } 
         catch (JMSException e1)
         { _logger.error("Failed to read Serialized Object from JMS message.", e1);
@@ -190,6 +198,15 @@
         catch (ClassCastException e2)
         { _logger.error("Object in JMS message is not a org.jboss.soa.esb.message.Message", e2);
         }
+        catch (IOException e3)
+        { _logger.error("Object in JMS message is not a Serializeable", e3);
+        }
+        catch (ParserConfigurationException e4)
+        { _logger.error("Object in JMS message has invalid XML", e4);
+        }
+        catch (SAXException e5)
+        { _logger.error("Object in JMS message has invalid XML", e5);
+        }
         return null;
     }
     

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/easier2ReadExample.xml
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/easier2ReadExample.xml	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/message/easier2ReadExample.xml	2006-11-01 21:26:01 UTC (rev 7292)
@@ -2,7 +2,7 @@
 	parameterReloadSecs="180"
 >
    <ListenJmsQueueExample
-    epr-name="myEprMnemonicName"
+    service-name="myEprMnemonicName"
    	listenerClass="org.jboss.soa.esb.message.listeners.JmsQueueListener"
 	connection-factory="ConnectionFactory"
 	destination-type="queue"

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/old/RemoteDirectoryPoller.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/old/RemoteDirectoryPoller.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/src/org/jboss/soa/esb/listeners/old/RemoteDirectoryPoller.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -28,11 +28,12 @@
 import java.util.List;
 
 import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.EdtFtpImpl;
 import org.jboss.soa.esb.actions.ActionDefinitionFactory;
 import org.jboss.soa.esb.actions.ActionProcessor;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.util.FtpClientUtil;
+import org.jboss.soa.esb.util.RemoteFileSystem;
 import org.jboss.soa.esb.util.Util;
 
 public class RemoteDirectoryPoller extends AbstractPoller
@@ -48,7 +49,7 @@
   
   private ConfigTree _params;
   private Logger	_logger = Logger.getLogger(this.getClass());
-  FtpClientUtil		_ftpClient;
+  RemoteFileSystem		_ftpClient;
 
   public RemoteDirectoryPoller(GpListener p_oDad, ConfigTree p_oParms,ActionDefinitionFactory actionDF)
   	throws Exception
@@ -82,7 +83,7 @@
 
 		try
 		{
-			_ftpClient	= new FtpClientUtil(_params,true);
+			_ftpClient	= new EdtFtpImpl(_params,true);
 			_ftpClient.remoteRename(oF,oCurr);
 		}
 		catch (Exception e)
@@ -104,11 +105,11 @@
 	protected List<Object> pollForCandidates()
 	{
 		List<Object> oRet = new ArrayList<Object>();
-		FtpClientUtil _ftpClient = null;
+		RemoteFileSystem _ftpClient = null;
 		try
 		{	
-			_ftpClient = new FtpClientUtil(_params,true);
-			_ftpClient.setRemoteDir(FtpClientUtil.fileToFtpString(m_oInpDir));
+			_ftpClient = new EdtFtpImpl(_params,true);
+			_ftpClient.setRemoteDir(EdtFtpImpl.fileToFtpString(m_oInpDir));
 			String[] sa = _ftpClient.getFileListFromRemoteDir(m_sInpSfx);
 			if (null!=sa)
 				for (String sCurr : sa)
@@ -175,17 +176,17 @@
       }
       
       
-      FtpClientUtil _ftpClient = new FtpClientUtil(_params,false);
+      RemoteFileSystem _ftpClient = new EdtFtpImpl(_params,false);
       _ftpClient.quit();
       
       //  Copy FTP parameters to be passed to the action class (inside the WorkingFile class)
       //  This is a kludge - we have to get back to this (ES)
       String[] sa = new String[] 
-      {FtpClientUtil.PARMS_FTP_SERVER
-      ,FtpClientUtil.PARMS_USER
-      ,FtpClientUtil.PARMS_PASSWD
-      ,FtpClientUtil.PARMS_PASSIVE
-      ,FtpClientUtil.PARMS_PORT
+      {RemoteFileSystem.PARMS_FTP_SERVER
+      ,RemoteFileSystem.PARMS_USER
+      ,RemoteFileSystem.PARMS_PASSWD
+      ,RemoteFileSystem.PARMS_PASSIVE
+      ,RemoteFileSystem.PARMS_PORT
       };
       for (String sProp : sa)
       {
@@ -259,25 +260,25 @@
         public boolean isPostDelete() { return postDelete; }
 
         public boolean localRenameToInput() { return super.renameTo(inputFile); }
-        public void remoteRenameToInput(FtpClientUtil util) throws Exception 
+        public void remoteRenameToInput(RemoteFileSystem util) throws Exception 
         {
             	util.remoteRename(this,inputFile);
         }
 
         public boolean localRenameToError() { return super.renameTo(errorFile); }
-        public void remoteRenameToError(FtpClientUtil util) throws Exception 
+        public void remoteRenameToError(RemoteFileSystem util) throws Exception 
         {
             	util.remoteRename(this,errorFile);
         }
 
         public boolean localRenameToOutput() { return renameTo(outputFile); }
-        public void remoteRenameToOutput(FtpClientUtil util) throws Exception
+        public void remoteRenameToOutput(RemoteFileSystem util) throws Exception
         {
         	util.remoteRename(this,outputFile);
         }
         
         public boolean localDelete() 	{return delete(); }
-        public void	   remoteDelete(FtpClientUtil util) throws Exception
+        public void	   remoteDelete(RemoteFileSystem util) throws Exception
         	{util.deleteRemoteFile(this.toString()); }
         
     }

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/AbstractListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/AbstractListenerUnitTest.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/AbstractListenerUnitTest.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -21,20 +21,18 @@
 
 package org.jboss.soa.esb.listeners.old;
 
+import junit.framework.TestCase;
+
 import org.jboss.soa.esb.actions.ActionDefinition;
 import org.jboss.soa.esb.actions.ActionDefinitionFactory;
 import org.jboss.soa.esb.actions.ActionProcessingException;
 import org.jboss.soa.esb.actions.ActionUtils;
 import org.jboss.soa.esb.actions.BaseTestActionProcessor;
 import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.old.AbstractListener;
-import org.jboss.soa.esb.listeners.old.GpListener;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.message.format.MessageFactory;
 import org.jboss.soa.esb.util.MockNonblockingListener;
 
-import junit.framework.TestCase;
-
 /**
  * AbstractListener tests.
  * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/DirectoryPollerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/DirectoryPollerUnitTest.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/DirectoryPollerUnitTest.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -22,7 +22,6 @@
 package org.jboss.soa.esb.listeners.old;
 
 import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.listeners.old.DirectoryPoller;
 
 /**
  * Test the DirectoryPoller

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/GpListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/GpListenerUnitTest.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/GpListenerUnitTest.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -27,7 +27,6 @@
 import org.jboss.soa.esb.actions.ToNowhereRouter;
 import org.jboss.soa.esb.common.tests.BaseTest;
 import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.old.GpListener;
 import org.jboss.soa.esb.util.ListenersManagerExecThread;
 import org.jboss.soa.esb.util.MockPoller;
 

Modified: labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/SqlTablePollerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/SqlTablePollerUnitTest.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/SqlTablePollerUnitTest.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -22,7 +22,6 @@
 package org.jboss.soa.esb.listeners.old;
 
 import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.listeners.old.SqlTablePoller;
 
 /**
  * Test the SqlTablePoller

Added: labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -0,0 +1,266 @@
+/*
+* 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.internal.soa.esb.util;
+
+import java.io.File;
+import java.util.List;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.util.RemoteFileSystem;
+
+import com.enterprisedt.net.ftp.FTPClient;
+import com.enterprisedt.net.ftp.FTPConnectMode;
+import com.enterprisedt.net.ftp.FTPTransferType;
+
+/**
+ * Simplified FTP transfers
+ * <p>Description:  Implements a simple set of FTP functionality
+ * Parameters to establish the FTP connection are provided at construction time
+ * and cannot change during the lifetime of the object
+ * <br/>Hides low level details.  Current implementation is based on the
+ * "Entreprise Distributed Technology edtFTPj" library
+ * but this can be changed with no impact to existing code, just by changing
+ * this class without modifying the signature of it's public methods
+ * </p>
+ */
+
+public class EdtFtpImpl implements RemoteFileSystem
+{
+  private static final String TMP_SUFFIX	= ".rosettaPart";
+
+  public enum XFER_TYPE
+  {ascii
+  ,binary
+  };
+
+  private ConfigTree	m_oParms;
+  private String    	m_sFtpServer  ,m_sUser        ,m_sPasswd;
+  private String    	m_sRemoteDir  ,m_sLocalDir;
+  private int			m_iPort;
+  private boolean		m_bPassive;
+  /* (non-Javadoc)
+ * @see org.jboss.soa.esb.util.RemoteFileSystem#getRemoteDir()
+ */
+public  String getRemoteDir()  { return m_sRemoteDir; }
+
+  private FTPClient  	m_oConn = new FTPClient();
+  private FTPTransferType m_oXferType = FTPTransferType.BINARY;
+
+  /**
+   * Checks validity and completeness of parameters, and keeps the info internally
+   * for subsequent FTP requests
+   * @param p_oP ConfigTree
+   * @throws Exception : if parameters are invalid or incomplete
+   * <li>Parameters: (XML attributes at the root level) </li>
+   * <li> ftpServer = name or IP of FTP server </li>
+   * <li> ftpUser = login ID for server </li>
+   * <li> ftpPassword </li>
+   * <li> localDirURI = absolute path in the local filesystem </li>
+   * <li> remoteDirURI = remote path is relative to ftp user home in remote
+   * computer </li>
+   */
+
+  public EdtFtpImpl (ConfigTree p_oP, boolean p_bConnect) throws Exception
+   { m_oParms = p_oP;
+   	 initialize(p_bConnect);
+   } //_________________________________
+
+  public EdtFtpImpl (List<KeyValuePair> attribs, boolean connect) throws Exception
+  {
+	  m_oParms = new ConfigTree("fromProps");
+	  for (KeyValuePair oCurr : attribs)
+		m_oParms.setAttribute(oCurr.getKey(),oCurr.getValue());
+	  initialize(connect);
+  } //__________________________________
+
+  private void initialize(boolean bConnect) throws Exception
+  {
+	     checkParms();
+	     if (bConnect)
+	     {
+		     m_oConn.setRemoteHost	(m_sFtpServer);
+		     m_oConn.setRemotePort(m_iPort);
+		     m_oConn.connect();
+		     for (int i1=0; i1<10 && ! m_oConn.connected(); i1++)
+		    	 Thread.sleep(200);
+		     if (! m_oConn.connected())
+		    	 throw new Exception("Can't connect to FTP server");
+		     m_oConn.user	      	(m_sUser);
+		     m_oConn.password		(m_sPasswd);
+		     m_oConn.setConnectMode	((m_bPassive) ? FTPConnectMode.PASV : FTPConnectMode.ACTIVE);
+	     }
+  } //__________________________________
+   /* (non-Javadoc)
+ * @see org.jboss.soa.esb.util.RemoteFileSystem#quit()
+ */
+   public void quit ()
+   { if (null != m_oConn)
+      try { m_oConn.quit(); }
+      catch (Exception e) {}
+   } //_________________________________
+
+   /* (non-Javadoc)
+ * @see org.jboss.soa.esb.util.RemoteFileSystem#deleteRemoteFile(java.lang.String)
+ */
+   public void deleteRemoteFile (String p_sFile) throws Exception
+   { m_oConn.delete(getRemoteDir()+"/"+new File(p_sFile).getName());
+   } //_________________________________
+
+   /* (non-Javadoc)
+ * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteDelete(java.io.File)
+ */
+public void remoteDelete (File p_oFile) throws Exception
+   { m_oConn.delete(fileToFtpString(p_oFile));
+   } //_________________________________
+
+   /* (non-Javadoc)
+ * @see org.jboss.soa.esb.util.RemoteFileSystem#getFileListFromRemoteDir(java.lang.String)
+ */
+   public String[] getFileListFromRemoteDir (String p_sSuffix) throws Exception
+   {
+	   String sSuffix = (null==p_sSuffix)?"*":"*"+p_sSuffix;
+	   return m_oConn.dir(sSuffix);
+   } //_________________________________
+
+   /* (non-Javadoc)
+ * @see org.jboss.soa.esb.util.RemoteFileSystem#setRemoteDir(java.lang.String)
+ */
+   public void setRemoteDir (String p_sDir) throws Exception
+   {
+	   m_oConn.chdir(p_sDir);
+   } //_________________________________
+
+   /* (non-Javadoc)
+ * @see org.jboss.soa.esb.util.RemoteFileSystem#renameInRemoteDir(java.lang.String, java.lang.String)
+ */
+   public void renameInRemoteDir (String p_sFrom, String p_sTo) throws Exception
+   {
+	 String sRmtFrom = new File(p_sFrom).getName();
+     String sRmtTo   = new File(p_sTo).getName();
+
+     try { m_oConn.rename   (getRemoteDir()+"/"+sRmtFrom,getRemoteDir()+"/"+sRmtTo); }
+     catch (Exception e)
+     {	String sMess = this.getClass().getSimpleName()
+    	 +" can't rename in remote directory <"
+    	 +e.getMessage()+">"
+    	 ;
+    	 throw new Exception(sMess);
+     }
+   } //_________________________________
+
+   /* (non-Javadoc)
+ * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteRename(java.io.File, java.io.File)
+ */
+public void remoteRename(File p_oFrom, File p_oTo) throws Exception
+   {
+     try { m_oConn.rename   (fileToFtpString(p_oFrom),fileToFtpString(p_oTo)); }
+     catch (Exception e)
+     {	String sMess = this.getClass().getSimpleName()
+    	 +" can't rename in remote directory <"
+    	 +e.getMessage()+">"
+    	 ;
+    	 throw new Exception(sMess);
+     }
+   } //_________________________________
+
+   /* (non-Javadoc)
+ * @see org.jboss.soa.esb.util.RemoteFileSystem#uploadFile(java.io.File, java.lang.String)
+ */
+   public void uploadFile (File p_oFile, String p_sRemoteName) throws Exception
+   {
+	 String sRemoteOK	= getRemoteDir() + "/" + p_sRemoteName;
+     String sRemoteTmp	= sRemoteOK+TMP_SUFFIX;
+     m_oConn.setType(m_oXferType);
+     m_oConn.put(fileToFtpString(p_oFile),sRemoteTmp);
+     m_oConn.rename(sRemoteTmp,sRemoteOK);
+   } //_________________________________
+
+   /* (non-Javadoc)
+ * @see org.jboss.soa.esb.util.RemoteFileSystem#downloadFile(java.lang.String, java.lang.String)
+ */
+   public void downloadFile (String p_sFile, String p_sFinalName)  throws Exception
+   {
+	 File oLocalDir = new File(m_sLocalDir);
+     File oLclFile= File.createTempFile("Rosetta_",TMP_SUFFIX,oLocalDir);
+
+     try { oLclFile.delete(); }
+     catch (Exception e) {}
+     m_oConn.setType(m_oXferType);
+     m_oConn.get(fileToFtpString(oLclFile),p_sFile);
+
+     File oNew = new File(oLocalDir,p_sFinalName);
+     if (oNew.exists()) oNew.delete();
+     oLclFile.renameTo(oNew);
+   } //_________________________________
+
+   // Beware !!!  The logic here seems wrong, but it works
+   //  It appears that there's some kind of bug in the edtftpj.jar library
+   //  The !XFER_TYPE.ascii.equals(p_oMode) should NOT be negated
+   //               But it works when negated (newlines from Unix to DOS)
+   private void setXferType (XFER_TYPE p_oMode)
+   {	m_oXferType = !XFER_TYPE.ascii.equals(p_oMode)
+	   		? FTPTransferType.ASCII : FTPTransferType.BINARY;
+   } //_________________________________
+
+   private void checkParms() throws Exception
+   {
+     m_sFtpServer  = m_oParms.getAttribute(PARMS_FTP_SERVER);
+     if (null==m_sFtpServer) throw new Exception ("No FTP server specified");
+
+     m_sUser       = m_oParms.getAttribute(PARMS_USER);
+     if (null==m_sUser) throw new Exception ("No username specified for FTP");
+
+     m_sPasswd     = m_oParms.getAttribute(PARMS_PASSWD);
+     if (null==m_sPasswd) throw new Exception ("No password specified for FTP");
+
+     m_sRemoteDir  = m_oParms.getAttribute(PARMS_REMOTE_DIR);
+     if (null==m_sRemoteDir)
+    	 m_sRemoteDir = "";
+
+     m_sLocalDir  = m_oParms.getAttribute(PARMS_LOCAL_DIR);
+     if (null==m_sLocalDir)
+    	 m_sLocalDir = ".";
+
+     String sAux	= m_oParms.getAttribute(PARMS_PORT);
+     m_iPort = (null==sAux) ? 21 : Integer.parseInt(sAux);
+
+     boolean bAscii = false;
+     sAux = m_oParms.getAttribute(PARMS_ASCII);
+     if (null!=sAux)
+    	 bAscii = Boolean.parseBoolean(sAux);
+     setXferType((bAscii)?XFER_TYPE.ascii:XFER_TYPE.binary);
+
+     m_bPassive = false;
+     sAux = m_oParms.getAttribute(PARMS_PASSIVE);
+     m_bPassive = (null!=sAux) && Boolean.parseBoolean(sAux);
+
+     return;
+   } //__________________________________
+
+   public static String fileToFtpString(File p_oF)
+	{
+		return(null==p_oF) ? null
+			: p_oF.toString().replace("\\","/");
+    } //________________________________
+
+} //____________________________________________________________________________

Added: labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -0,0 +1,120 @@
+/*
+* 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.util;
+
+import java.io.File;
+
+public interface RemoteFileSystem {
+
+	public static final String PARMS_FTP_SERVER = "ftpServer";
+
+	public static final String PARMS_USER = "ftpUser";
+
+	public static final String PARMS_PASSWD = "ftpPassword";
+
+	public static final String PARMS_PORT = "ftpPort";
+
+	public static final String PARMS_REMOTE_DIR = "ftpRemoteDir";
+
+	public static final String PARMS_LOCAL_DIR = "ftpLocalDir";
+
+	public static final String PARMS_ASCII = "ftpAscii";
+
+	public static final String PARMS_PASSIVE = "ftpPassive";
+
+	public String getRemoteDir();
+
+	/**
+	 * Terminates ftp session and frees resources
+	 * <li>Well behaved programs should make sure to call this method </li>
+	 */
+	public void quit(); //_________________________________
+
+	/**
+	 * Deletes specified file in remote directory
+	 * @param p_sFile String : filename to delete.  Method will attempt to delete
+	 * file with rightmost node of argument within remote directory specified in 'remoteDirURI'
+	 * @throws Exception : if ftp connection cannot be established, or file
+	 * cannot be deleted in remote directory
+	 */
+	public void deleteRemoteFile(String p_sFile) throws Exception; //_________________________________
+
+	public void remoteDelete(File p_oFile) throws Exception; //_________________________________
+
+	/**
+	 * Gets the list of files in the remote directory that end with arg0
+	 * @param p_sSuffix String : retrieve only files that end with that suffix - all files if null
+	 * @throws Exception : if ftp connection cannot be established, or problems encountered
+	 */
+	public String[] getFileListFromRemoteDir(String p_sSuffix) throws Exception; //_________________________________
+
+	/**
+	 * Change remote directory
+	 * @param p_sDir String : directory to set
+	 * @throws Exception : if ftp connection cannot be established, or problems encountered
+	 */
+	public void setRemoteDir(String p_sDir) throws Exception; //_________________________________
+
+	/**
+	 * Renames specified file in remote directory to specified new name
+	 * @param p_sFrom String : filename to rename
+	 * @param p_sTo String : new filename
+	 * @throws Exception : if ftp connection cannot be established, or file
+	 * cannot be renamed to new name in remote directory
+	 * <li>Method will attempt to rename file with rightmost node of argument
+	 * within remote directory specified in 'remoteDirURI', to new name inside
+	 * the SAME remote directory
+	 */
+	public void renameInRemoteDir(String p_sFrom, String p_sTo)
+			throws Exception; //_________________________________
+
+	public void remoteRename(File p_oFrom, File p_oTo) throws Exception; //_________________________________
+
+	/**
+	 * Uploads specified file from local directory (localDirURI) to remote
+	 * directory (remoteDirURI)
+	 * @param p_sFile String : filename to upload
+	 * @throws Exception : if ftp connection cannot be established, or file
+	 * cannot be uploaded
+	 * <li> local file will be renamed during transfer ('.xferNotReady' appended
+	 * to name)</li>
+	 * <li> upon successful completion. the suffix '.xferDone' will be appended
+	 * to the original filename </li>
+	 */
+	public void uploadFile(File p_oFile, String p_sRemoteName) throws Exception; //_________________________________
+
+	/**
+	 * Downloads specified file from remote directory (remoteDirURI) to local
+	 * directory (localDirURI)
+	 * @param p_sFile String : filename to download
+	 * @throws Exception : if ftp connection cannot be established, or file
+	 * cannot be downloaded
+	 * <li> local file is assigned a temporary name during transfer  </li>
+	 * <li> upon successful completion, local temporary file will be renamed to
+	 * name specified in argument, and suffix '.xferDone' will be appended
+	 * to the original filename in the remote directory </li>
+	 */
+	public void downloadFile(String p_sFile, String p_sFinalName)
+			throws Exception; //_________________________________
+
+}
\ No newline at end of file

Added: labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -0,0 +1,55 @@
+/*
+ * 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.util;
+
+import org.jboss.soa.esb.BaseException;
+
+/**
+ * Dispatch Exception.
+ * @author b_georges
+ * @since Version 4.0
+ */
+public class RemoteFileSystemException extends BaseException 
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     */
+    public RemoteFileSystemException(String message) { super(message); }
+
+    /**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     * @param cause Exception cause.
+     */
+    public RemoteFileSystemException(String message, Throwable cause) { super(message, cause); }
+
+    /**
+     * Construct an exception instance. 
+     * @param cause Exception cause.
+     */
+    public RemoteFileSystemException(Throwable cause) { super(cause); }
+}

Added: labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -0,0 +1,58 @@
+/*
+ * 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.util;
+
+import java.net.URISyntaxException;
+
+import org.jboss.internal.soa.esb.couriers.JmsCourier;
+import org.jboss.internal.soa.esb.util.EdtFtpImpl;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+
+public class RemoteFileSystemFactory 
+{
+	
+	//
+	private static final RemoteFileSystemFactory _instance = new RemoteFileSystemFactory();
+	
+	// private default constructor
+	private RemoteFileSystemFactory() {}
+
+	public static RemoteFileSystemFactory getInstance(Object obj)
+	{
+		return _instance;
+	}
+	
+	public static RemoteFileSystem getRemoteFileSystem() throws RemoteFileSystemException
+	{
+		try
+		{
+			// TODO fix this to work with EPR
+			//if FTPEpr
+			return new EdtFtpImpl();
+		}
+		catch (URISyntaxException e) { throw new RemoteFileSystemException(e); }
+		throw new RemoteFileSystemException("Unknown protocol");
+	}
+	
+}

Modified: labs/jbossesb/workspace/b_georges/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreType.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreType.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/services/src/org/jboss/soa/esb/services/persistence/MessageStoreType.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -26,7 +26,7 @@
  *
  */
 
-package org.jboss.internal.soa.esb.persistence.format;
+package org.jboss.soa.esb.services.persistence;
 
 import java.net.URI;
 

Modified: labs/jbossesb/workspace/b_georges/product/core/services/src/org/jboss/soa/esb/services/registry/JAXRRegistryImpl.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/services/src/org/jboss/soa/esb/services/registry/JAXRRegistryImpl.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/services/src/org/jboss/soa/esb/services/registry/JAXRRegistryImpl.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -53,7 +53,7 @@
 
 import org.apache.log4j.Logger;
 import org.apache.log4j.Priority;
-import org.jboss.internal.soa.esb.addressing.EPRHelper;
+import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.common.Configuration;
 /**

Modified: labs/jbossesb/workspace/b_georges/product/core/services/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/services/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/services/tests/src/org/jboss/soa/esb/esb/persistence/tests/MessageStoreUnitTest.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -37,7 +37,7 @@
 
 import junit.framework.TestCase;
 
-import org.jboss.internal.soa.esb.persistence.format.MessageStoreType;
+import org.jboss.soa.esb.services.persistence.MessageStoreType;
 import org.jboss.internal.soa.esb.persistence.format.db.DBConnectionManager;
 import org.jboss.soa.esb.common.Configuration;
 import org.jboss.soa.esb.common.tests.HsqldbUtil;

Modified: labs/jbossesb/workspace/b_georges/product/core/services/tests/src/org/jboss/soa/esb/services/registry/JAXRRegistryUnitTest.java
===================================================================
--- labs/jbossesb/workspace/b_georges/product/core/services/tests/src/org/jboss/soa/esb/services/registry/JAXRRegistryUnitTest.java	2006-11-01 21:19:50 UTC (rev 7291)
+++ labs/jbossesb/workspace/b_georges/product/core/services/tests/src/org/jboss/soa/esb/services/registry/JAXRRegistryUnitTest.java	2006-11-01 21:26:01 UTC (rev 7292)
@@ -52,7 +52,7 @@
 import org.apache.log4j.Logger;
 import org.apache.log4j.Priority;
 import org.apache.log4j.xml.DOMConfigurator;
-import org.jboss.internal.soa.esb.addressing.EPRHelper;
+import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.common.tests.HsqldbUtil;
 import org.jboss.soa.esb.common.tests.TestUtil;




More information about the jboss-svn-commits mailing list