[jboss-svn-commits] JBL Code SVN: r8774 - in labs/jbossesb/trunk: product/core/listeners/src/org/jboss/soa/esb/actions product/core/listeners/src/org/jboss/soa/esb/actions/converters product/core/listeners/src/org/jboss/soa/esb/actions/routing product/core/listeners/src/org/jboss/soa/esb/actions/templates product/core/listeners/src/org/jboss/soa/esb/listeners product/core/listeners/src/org/jboss/soa/esb/listeners/message product/core/listeners/tests/src/org/jboss/soa/esb/actions product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters product/core/listeners/tests/src/org/jboss/soa/esb/listeners product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message product/core/listeners/tests/src/org/jboss/soa/esb/util product/samples/quickstarts/transform_XML2XML_date_manipulation qa qa/junit/src/org/jboss/soa/esb/listeners qa/junit/src/org/jboss/soa/esb/listeners/message qa/junit/src/org/jboss/soa/esb/util

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Tue Jan 9 11:15:01 EST 2007


Author: tfennelly
Date: 2007-01-09 11:14:42 -0500 (Tue, 09 Jan 2007)
New Revision: 8774

Removed:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/AbstractFileAction.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionDefinition.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionDefinitionFactory.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/FtpDownloader.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/FtpUploader.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/converters/FileToByteArray.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/FileCopier.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/ObjectToFileWriter.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockFileAction.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/Lifecycle.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/AbstractListener.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/AbstractPassiveListener.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerController.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerFactory.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerService.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerServiceMBean.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/old/
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-01.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-02.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-03.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-04.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-05.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-06.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-07.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-08.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-09.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-10.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-11.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinitionFactoryUnitTest.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor1.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor2.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor3.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/FileToByteArrayUnitTest.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/ObjectToFileWriterUnitTest.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerUnitTest.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/ListenerConfig_01.xml
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/MockListener.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/old/
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/AbstractMockListner.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/ListenersManagerExecThread.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNonblockingListener.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockPoller.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/gateway/
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/HttpListenerConfig.xml
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/HttpListenerTest.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/ListenerUtils.java
   labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/NewListenerUtils.java
Modified:
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/State.java
   labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/HttpListener.java
   labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java
   labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/README.txt
   labs/jbossesb/trunk/qa/test.properties
Log:
removed dead code from the listener package

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/AbstractFileAction.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/AbstractFileAction.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/AbstractFileAction.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,77 +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;
-
-import java.io.File;
-
-import org.jboss.soa.esb.message.Message;
-
-/**
- * <p/>
- * Extend this class if you need to implement an action class intended to process one file at a time.
- * <p/>
- * See {@link org.jboss.soa.esb.actions.routing.FileCopier} as an example.
- * <p/>
- * This class are stateful.
- * @author Esteban.
- */
-public abstract class AbstractFileAction implements ActionProcessor {
-    
-    /**
-     * Files processed by action classes
-     * need to be renamed during processing to disable other listeners (or other
-     * threads launched by the same listener that started this thread) to pick
-     * up the same file <br/>Once processing ends a suffix will be added to the
-     * name of the original file that has been processed. The suffix will be
-     * different according to the result of processing (OK or Exception). Files
-     * could be moved to different directories as well <br/> Parameters for
-     * these options can be provided at run time in the ConfigTree (arg 0 in
-     * constructor)
-     * @param message The message payload to be processed.
-     * @return The processing result.
-     * @throws ActionProcessingException Exception during payload processing.
-     */
-    public final Message process(Message message) throws ActionProcessingException {
-    	
-    	Object oCurr = ActionUtils.getTaskObject(message);
-        if(!(oCurr instanceof File)) {
-            throw new ActionProcessingException
-            	("Message current object for processing by " + getClass().getName() 
-                + " should have been preprocessed to a " + File.class.getName() 
-                + " instance.");
-        }
-        
-        // Call the implementing class to process the file message...
-        ActionUtils.setTaskObject(message,process((File)oCurr));
-        return message;
-    }
-
-    /**
-     * Process the file message object.
-     * @param file The file to be processed.
-     * @return The processing result.
-     * @throws ActionProcessingException Exception while processing file.
-     */
-    protected abstract Object process(File file) throws ActionProcessingException;
-
-} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionDefinition.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionDefinition.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionDefinition.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,106 +0,0 @@
-package org.jboss.soa.esb.actions;
-
-import java.lang.reflect.Constructor;
-import java.util.List;
-
-import org.jboss.soa.esb.helpers.KeyValuePair;
-
-/**
- * Action Definition.
- * <p/>
- * An Action is defined by "name", an action "processor" instance to perform the processing action, plus 
- * properties to the processing action to be supplued to the processor instance.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ActionDefinition {
-    
-    private String name;
-    private String processor;
-    private List<KeyValuePair> properties;
-    private boolean isSingleton = true;
-    private ActionProcessor singletonInstance = null;
-
-    /**
-     * Private constructor.
-     * @param name The action name.
-     * @param processor The action processor runtime class.
-     * @param properties Action properties list.  An empty list for an action with no defined properties.
-     */
-    protected ActionDefinition(String name, String processor, List<KeyValuePair> properties) {
-        this.name = name;
-        this.processor = processor;
-        this.properties = properties;
-        
-        String isSingletonProp = KeyValuePair.getValue("singleton", properties);
-        isSingleton = (isSingletonProp == null || !isSingletonProp.equals("false"));
-    }
-    
-    /**
-     * Get the action name.
-     * @return The action name.
-     */
-    public String getName() {
-        return name;
-    }
-    
-    /**
-     * Get the action processor instance.
-     * @return The Action Processor.
-     */
-    public ActionProcessor getProcessor() {
-        if(!isSingleton) {
-            return createActionProcessor();
-        } else {
-            if(singletonInstance == null) {
-                singletonInstance = createActionProcessor();
-            }
-            return singletonInstance;
-        }
-    }
-    
-    /**
-     * Get the action properties to be supplied to the action processor.
-     * @return The configured action properties. An empty list for an action with no defined properties.
-     */
-    public List<KeyValuePair> getProperties() {
-        return properties;
-    }
-
-    /**
-     * Create the action processor instance.
-     * <p/>
-     * See the {@link ActionProcessor} regarding reflective construction rules.
-     * @return The action processor instance.
-     */
-    private ActionProcessor createActionProcessor() {
-        Class<? extends ActionProcessor> runtimeClass;
-        Class[] NONDEFAULT_SIG = new Class[] {String.class, List.class};
-        Constructor nonDefaultConstructor;
-        
-        // Get the runtime class...
-        try {
-            runtimeClass = Class.forName(processor).asSubclass(ActionProcessor.class);
-        } catch (ClassNotFoundException e) {
-            throw new IllegalStateException("Action Processor class " + processor + " not found in classpath.", e);
-        } catch (ClassCastException e) {
-            throw new IllegalStateException("Action Processor class " + processor + " does not implement " + ActionProcessor.class.getName(), e);
-        }            
-        
-        // Construct it...
-        try {
-            nonDefaultConstructor = runtimeClass.getConstructor(NONDEFAULT_SIG);
-            return (ActionProcessor) nonDefaultConstructor.newInstance(new Object[] {name, properties});
-        } catch (NoSuchMethodException e1) {
-            try {
-                return runtimeClass.newInstance();
-            } catch (InstantiationException e) {
-                throw new IllegalStateException("No appropriate constructor found on processor class [" + processor + "].  See " + ActionProcessor.class.getName() + " Javadoc.", e);
-            } catch (Exception e) {
-                throw new IllegalStateException("Unexpected exception.  Unable to construct processor class instance [" + processor + "] using default constructor.", e);
-            }
-        } catch (Exception e) {
-            throw new IllegalStateException("Unexpected exception.  Unable to construct processor class instance [" + processor + "] using non-default constructor.", e);
-        }
-    }
-}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionDefinitionFactory.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionDefinitionFactory.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/ActionDefinitionFactory.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,189 +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;
-
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-
-/**
- * Action Definition Factory.
- * <p/>
- * Note, much of the logic in this class could easily be replaced through the use of an IoC container.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ActionDefinitionFactory {
-
-    /**
-     * Class Logger.
-     */
-    private static Logger logger = Logger.getLogger(ActionDefinitionFactory.class);
-    /**
-     * Action Definition table.
-     */
-    private Hashtable<String, ActionDefinition> actionDefinitions = new Hashtable<String, ActionDefinition>();
-
-    /**
-     * Construct a factory instance.
-     * @param config ActionDefinition configuration.
-     * @throws ConfigurationException Invalid configuration.
-     */
-    public ActionDefinitionFactory(ConfigTree config) throws ConfigurationException {
-        if(config == null || !config.getName().equals("Actions")) {
-            throw new ConfigurationException("No 'Actions' configuration.");
-        }
-        
-        // Read the processor alias and action def configurations from the XML configuration...
-        ConfigTree processorAliasConfig = config.getFirstChild("ProcessorAliases");
-        ConfigTree[] actions = config.getChildren("Action");
-        if(processorAliasConfig == null) {
-            throw new ConfigurationException("No 'Actions/ProcessorAliases' configuration.");
-        }
-        if(actions == null || actions.length == 0) {
-            throw new ConfigurationException("No 'Actions/Action' configurations.");
-        }
-        
-        // Initialise the Action Definition table..
-        Hashtable<String, String> processorClasses = getProcessorClasses(processorAliasConfig);
-        initialiseActionDefinitions(actions, processorClasses);
-        logger.info("ActionDefinition Factory initialisation complete.");
-    }
-    
-    /**
-     * Get the action definition for the specified action name.
-     * @param actionName The action name.
-     * @return The action definition.
-     */
-    public ActionDefinition getInstance(String actionName) {
-        if(actionName == null || actionName.trim().equals("")) {
-            throw new IllegalArgumentException("Null or empty 'actionName' arg in method call.");
-        }
-
-        return actionDefinitions.get(actionName);
-    }
-
-    /**
-     * Initialise the Action Definitions.
-     * @param actions Action Definition configurations.
-     * @param processorClasses Processor classes keyed by alias name.
-     * @throws ConfigurationException 
-     */
-    private void initialiseActionDefinitions(ConfigTree[] actions, Hashtable<String, String> processorClasses) throws ConfigurationException {
-        if(processorClasses == null || processorClasses.isEmpty()) {
-            throw new ConfigurationException("No action processor classes defined.");
-        }
-        
-        for(ConfigTree action : actions) {
-            String name = action.getAttribute("name");
-            String processorAlias = action.getAttribute("processor");
-            String processorClass;
-            List<KeyValuePair> properties;
-
-            // Check the required attributes...
-            if(name == null || name.trim().equals("")) {
-                throw new ConfigurationException("Actions/Action has no 'name' defined.");
-            }
-            if(processorAlias == null || processorAlias.trim().equals("")) {
-                throw new ConfigurationException("Actions/Action [" + name + "] has no 'processor' defined.");
-            }
-            processorClass = processorClasses.get(processorAlias);
-            if(processorClass == null) {
-                throw new ConfigurationException("No action processor class defined for processor alias [" + processorAlias + "] set on action [" + name + "].");
-            }
-
-            // Get any properties defined on the action...
-            properties = getProperties(action);
-            
-            // Create the action definition and store it against it's name...
-            actionDefinitions.put(name, new ActionDefinition(name, processorClass, properties));
-            logger.info("Added ActionDefinition [" + name + "] for processor [" + processorAlias + ":" + processorClass + "]. Num properties: " + properties.size());
-        }
-    }
-
-    /**
-     * Get the processor runtime classes.
-     * @param processorAliasConfig Alias configs.
-     * @return Processor runtime classs 
-     * @throws ConfigurationException Bad configuration.
-     */
-    private Hashtable<String, String> getProcessorClasses(ConfigTree processorAliasConfig) throws ConfigurationException {
-        ConfigTree[] aliases = processorAliasConfig.getChildren("Alias");
-        Hashtable<String, String> processorClasses = new Hashtable<String, String>();
-        
-        if(aliases == null) {
-            throw new ConfigurationException("No 'Actions/ProcessorAliases/Alias' configurations.");
-        }
-        
-        for(ConfigTree alias : aliases) {
-            String name = alias.getAttribute("name");
-            String className = alias.getAttribute("class");
-    
-            // Check the required attributes...
-            if(name == null || name.trim().equals("")) {
-                throw new ConfigurationException("Actions/ProcessorAliases/Alias has no 'name' defined.");
-            }
-            if(className == null || className.trim().equals("")) {
-                throw new ConfigurationException("Actions/ProcessorAliases/Alias [" + name + "] has no 'class' defined.");
-            }
-            processorClasses.put(name, className);
-            logger.info("Added alias [" + name + "] for ActionProcessor class [" + className + "].");
-        }
-        
-        return processorClasses;
-    }
-
-    /**
-     * Get the properties defined on the supplied 'Action' configuration.
-     * @param action The action configuration element.
-     * @return A list of property {@link KeyValuePair} instances.  An empty list list is returned
-     * if no properties are defined on the action.
-     * @throws ConfigurationException A property name or value is empty or undefined.
-     */
-    private List<KeyValuePair> getProperties(ConfigTree action) throws ConfigurationException {
-        ConfigTree[] properties = action.getChildren("property");
-        List<KeyValuePair> propertyList = new ArrayList<KeyValuePair>();
-        
-        for(ConfigTree property : properties) {
-            String name = property.getAttribute("name");
-            String value = property.getAttribute("value");
-
-            // Check the required attributes...
-            if(name == null || name.trim().equals("")) {
-                throw new ConfigurationException("Actions/Action/property has no 'name' defined. Action [" + action.getAttribute("name") + "].");
-            }
-            if(value == null || value.trim().equals("")) {
-                throw new ConfigurationException("Actions/Action/property has no 'value' defined. Action [" + action.getAttribute("name") + "], Property [" + name + "].");
-            }
-            
-            propertyList.add(new KeyValuePair(name, value));
-        }
-
-        return propertyList;
-    }
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/FtpDownloader.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/FtpDownloader.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/FtpDownloader.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,123 +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;
-
-import java.io.File;
-import java.io.Serializable;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-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;
-
-public class FtpDownloader extends AbstractFileAction 
-{
-	ConfigTree		_parms;
-	FtpClientUtil 	_ftpClient;
-	String			_localDir;
-	RemoteDirectoryPoller.WorkingFile _workFile;
-	Logger			_logger = Logger.getLogger(this.getClass());
-	
-    /**
-     * Public constructor.
-     * @param actionName Action name.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-	public FtpDownloader(String actionName, List<KeyValuePair> properties)
-	{	_parms	= new ConfigTree("fromProps");
-	  	for (KeyValuePair oCurr : properties)
-	  		_parms.setAttribute(oCurr.getKey(),oCurr.getValue());
-	} //________________________________
-
-	@Override
-	public Object process(File obj) throws ActionProcessingException
-	{
-        try { _workFile = (RemoteDirectoryPoller.WorkingFile)obj; }
-        catch(ClassCastException e) 
-        {
-        	throw new ActionProcessingException
-        		("Argument must be an instance of "+ _workFile.getClass().getName(),e);
-        }
-
-        try 
-		{
-        	// Kludge to obtain ftp arguments from message - not quite nice...  (ES)
-        	if (null!=_workFile.getFtpProps())
-        		for (KeyValuePair kvp : _workFile.getFtpProps())
-        		{
-        			String sVal = kvp.getValue();
-        			_parms.setAttribute(kvp.getKey(),(null==sVal)?"":sVal);
-        		}
-        	// 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.downloadFile(sFrom,_workFile.getInputFile().getName());
-
-			if (_workFile.isPostDelete())
-				_ftpClient.remoteDelete(_workFile);
-			else
-				_workFile.remoteRenameToOutput(_ftpClient);
-			
-			GpListener.notifyOK(_parms,getOkNotification(null));
-			return _workFile;
-		}
-        catch (Exception e)
-        {
-			GpListener.notifyError(_parms,e,getErrorNotification(null));
-			try { _workFile.remoteRenameToInput(_ftpClient); }
-			catch (Exception e2) { /* not much we can do if can't rename back to input */}
-        	throw new ActionProcessingException(e);
-		}
-		finally 
-		{	
-			if (null!=_ftpClient)
-				_ftpClient.quit();
-			_ftpClient = null;
-		}
-	} //________________________________
-
-	public Serializable getOkNotification(Message message) 
-	{
-		return new StringBuilder()
-		.append(_workFile.getInputFile().toString())
-		.append("successfully downloaded to ").append(_localDir)
-		.toString();
-	} //________________________________
-	
-	public Serializable getErrorNotification(Message message) 
-	{
-		return new StringBuilder()
-		.append("Failed to download ").append(_workFile.getInputFile().toString())
-		.append(" to ").append(_localDir)
-		.toString();
-	} //________________________________
-	
-} //____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/FtpUploader.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/FtpUploader.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/FtpUploader.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,114 +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;
-
-import java.io.File;
-import java.io.Serializable;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-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;
-
-public class FtpUploader extends AbstractFileAction 
-{
-	ConfigTree		_parms;
-	FtpClientUtil 	_ftpClient;
-	String			_remoteDir;
-	DirectoryPoller.WorkingFile _workFile;
-	Logger			_logger = Logger.getLogger(this.getClass());
-
-	/**
-     * Public constructor.
-     * @param actionName String - Action name.
-     * @param properties List<KeyValuePair> - Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-	public FtpUploader(String actionName, List<KeyValuePair> properties)
-	{	_parms	= new ConfigTree("fromProps");
-	  	for (KeyValuePair oCurr : properties)
-	  		_parms.setAttribute(oCurr.getKey(),oCurr.getValue());
-	} //________________________________
-
-	@Override
-	public Object process(File obj) throws ActionProcessingException
-	{
-        try { _workFile = (DirectoryPoller.WorkingFile)obj; }
-        catch(ClassCastException e) 
-        {
-        	throw new ActionProcessingException
-        		("Argument must be an instance of "+ _workFile.getClass().getName(),e);
-        }
-
-        try 
-		{
-			_ftpClient = new FtpClientUtil(_parms,true);
-			_remoteDir = _parms.getAttribute(FtpClientUtil.PARMS_REMOTE_DIR);
-			_ftpClient.uploadFile(_workFile,_workFile.getInputFile().getName());
-
-			if (_workFile.isPostDelete())
-				_workFile.delete();
-			else
-				_workFile.renameToOutputFile();
-			
-			GpListener.notifyOK(_parms,getOkNotification(null));
-			return _workFile;
-		}
-        catch (Exception e)
-        {
-			GpListener.notifyError(_parms,e,getErrorNotification(null));
-			_workFile.renameToError();
-        	throw new ActionProcessingException(e);
-		}
-		finally 
-		{	
-			if (null!=_ftpClient)
-				_ftpClient.quit();
-			_ftpClient = null;
-		}
-	} //________________________________
-
-	public Serializable getOkNotification(Message message) 
-	{
-		return new StringBuilder()
-		.append(_workFile.getInputFile().toString())
-		.append("successfully uploaded to ").append(_remoteDir)
-		.append(" on ").append(_parms.getAttribute(FtpClientUtil.PARMS_FTP_SERVER))
-		.toString();
-	} //________________________________
-	
-	public Serializable getErrorNotification(Message message) 
-	{
-		return new StringBuilder()
-		.append("Failed to upload ").append(_workFile.getInputFile().toString())
-		.append(" to ").append(_remoteDir)
-		.append(" on ").append(_parms.getAttribute(FtpClientUtil.PARMS_FTP_SERVER))
-		.toString();
-	} //________________________________
-	
-} //____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/converters/FileToByteArray.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/converters/FileToByteArray.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/converters/FileToByteArray.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,97 +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.converters;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.Serializable;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.AbstractFileAction;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * File data to byte array reader {@link org.jboss.soa.esb.actions.ActionProcessor}.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class FileToByteArray extends AbstractFileAction {
-    
-    /**
-     * Logger.
-     */
-    private static Logger logger = Logger.getLogger(FileToByteArray.class);
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.AbstractFileAction#process(java.io.File)
-     */
-    @Override
-    protected Object process(File file) throws ActionProcessingException {
-        ByteArrayOutputStream outputBuffer = new ByteArrayOutputStream();
-        FileInputStream fileInputStream = null;
-        
-        try {
-            fileInputStream = new FileInputStream(file);
-        } catch (FileNotFoundException e) {
-            throw new ActionProcessingException("IOException reading file contents. File not found.", e);
-        }
-        
-        try {
-            byte[] readBuffer = new byte[512];
-            int readCount = 0;
-            
-            while((readCount = fileInputStream.read(readBuffer)) != -1) {
-                outputBuffer.write(readBuffer, 0, readCount);
-            }            
-        } catch (IOException e) {
-            throw new ActionProcessingException("IOException reading file contents.", e);
-        } finally {
-            try {
-                fileInputStream.close();
-            } catch (IOException e) {
-                logger.warn("Error closing input file.", e);
-            }
-        }
-        
-        return outputBuffer.toByteArray();
-    }
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#getOkNotification(java.lang.Object)
-     */
-    public Serializable getOkNotification(Message message) {
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#getErrorNotification(java.lang.Object)
-     */
-    public Serializable getErrorNotification(Message message) {
-        return null;
-    }
-
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/FileCopier.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/FileCopier.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/FileCopier.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,150 +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.routing;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.AbstractFileAction;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.listeners.old.DirectoryPoller.WorkingFile;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * File copy action.
- * <p/>
- * Copy the file specified by the "fileParams" arg in {@link #process(File)} to the location specified by the 
- * action config properties.
- * <p/>
- * Sample Action Configuration:
- * <pre>
- * &lt;Action name="Copy-To-XXX" processor="FileCopier"&gt;
- *     &lt;property name="copyToDirURI" value="file:///..." /&gt;
- *     &lt;property name="copyToSuffix" value=".fileCopierOutput" /&gt;
- * &lt;/Action&gt;
- * </pre>
- * 
- * @author Esteban
- */
-public class FileCopier extends AbstractFileAction {
-    
-    private static Logger logger = Logger.getLogger(FileCopier.class);
-    
-    private static final String TMP_SUFFIX = ".notReady";
-
-    private static final String PARMS_OUTDIR = "copyToDirURI";
-
-    private static final String PARMS_OUTSFX = "copyToSuffix";
-
-    private File outputDir;
-    private String copyToSuffix;
-
-    /**
-     * Public constructor.
-     * @param actionName Action name.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public FileCopier(String actionName, List<KeyValuePair> properties) throws URISyntaxException {
-        String outputDirParam = KeyValuePair.getValue(PARMS_OUTDIR, properties);
-        
-        try {
-            outputDir = new File(new URI(outputDirParam));
-        } catch(Exception e) {
-            outputDir = new File(outputDirParam);
-        }
-        copyToSuffix = KeyValuePair.getValue(PARMS_OUTSFX, properties, ".copy");
-    } // __________________________________
-
-    public Object process(File file) throws ActionProcessingException {
-        WorkingFile workingFile;
-        
-        try {
-            workingFile = (WorkingFile)file;
-        } catch(ClassCastException e) {
-            throw new ActionProcessingException("File must be an instance of " + WorkingFile.class.getName());
-        }
-        
-        File outputFile = new File(outputDir, workingFile.getInputFile().getName() + copyToSuffix);
-        
-        try {
-            File tempFile = File.createTempFile(workingFile.getName(), TMP_SUFFIX, outputDir);
-            FileInputStream inputFileStream = new FileInputStream(workingFile);
-            FileOutputStream outputFileStream;
-            
-            outputFileStream = new FileOutputStream(tempFile);
-    
-            // Perform Copy
-            byte[] ba = new byte[1024];
-            while (true) {
-                int iQ = inputFileStream.read(ba);
-                
-                if (iQ < 0) {
-                    break;
-                }
-    
-                outputFileStream.write(ba, 0, iQ);
-            }
-            // Close
-            inputFileStream.close();
-            outputFileStream.close();
-    
-            // Rename
-            outputFile.delete();
-            tempFile.renameTo(outputFile);
-            
-            if(logger.isDebugEnabled()) {
-                logger.debug("Successfully copied file " + workingFile.getAbsolutePath() + " to file " + outputFile.getAbsolutePath());
-            }
-        } catch(IOException e) {
-            throw new ActionProcessingException("IOException copying " + workingFile.getAbsolutePath() + " to " + outputFile.getAbsolutePath(), e);
-        }
-        
-        return workingFile;
-    } // __________________________________
-
-    public Serializable getOkNotification(Message message) {
-    	Object currentObject = ActionUtils.getTaskObject(message);
-
-    	return "File " + ((WorkingFile)currentObject).getInputFile().getAbsolutePath()
-                + " successfully copied to all destination";
-    }
-
-    public Serializable getErrorNotification(Message message) {
-    	Object currentObject = ActionUtils.getTaskObject(message);
-
-    	return "File " + ((WorkingFile)currentObject).getInputFile().getAbsolutePath()
-                + " to configured destination";
-    }
-
-} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/ObjectToFileWriter.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/ObjectToFileWriter.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/routing/ObjectToFileWriter.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,177 +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.routing;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.Serializable;
-import java.net.URI;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionProcessor;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Object to file writing processor.
- * <p/>
- * Writes an Object to a file based on the "file" property specified by the action configuration.  This "file"
- * property can specify a file or directory.  If the file is a directory, the class generates a file name based
- * on the return from a call to {@link java.util.UUID#randomUUID()} and the file extension value specified in
- * the "ext" property (default of "obj").
- * <p/>
- * If the message is a byte array it's writen to the file as is, otherwise the toString method is called on the
- * message object and the resulting String bytes are writen to the file based on the "encoding" specified in the action
- * configuration (see below).
- * <p/>
- * Sample Action Configuration:
- * <pre>
- * &lt;Action name="Write-To-X-File" processor="ObjectToFileWriter"&gt;
- *     &lt;property name="file" value="file:///..." /&gt; &lt;!-- File/Directory name. Supports URI or non-URI based names. --&gt;
- *     &lt;property name="append" value="true/false" /&gt; &lt;!-- Only relevant if the file is not a directory. Default of "false". --&gt;
- *     &lt;property name="ext" value="dat" /&gt; &lt;!-- Only relevant if the file is a directory. Default of "obj". --&gt;
- *     &lt;property name="encoding" value="UTF-8" /&gt; &lt;!-- Default of "UTF-8". --&gt;
- * &lt;/Action&gt;
- * </pre>
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ObjectToFileWriter implements ActionProcessor {
-
-    public static final String FILE_NAME = "file";
-    public static final String FILE_APPEND = "append";
-    public static final String FILE_EXT = "ext";
-    public static final String FILE_ENC = "encoding";
-    private static Logger logger = Logger.getLogger(ObjectToFileWriter.class);
-    
-    private String actionName;
-    private File file;
-    private boolean append;
-    private String ext;
-    private String encoding;
-    
-    /**
-     * Public constructor.
-     * @param actionName Action name.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public ObjectToFileWriter(String actionName, List<KeyValuePair> properties) throws ConfigurationException {
-        String fileName = KeyValuePair.getValue(FILE_NAME, properties);
-        
-        this.actionName = actionName;
-        
-        if(fileName == null || fileName.trim().equals("")) {
-            throw new ConfigurationException("Action [" + actionName + "] must specify a '" + FILE_NAME + "' property specifying the name of the output file.");
-        }
-        try {
-            // try it as a URI first...
-            file = new File(new URI(fileName));
-        } catch (Exception e) {
-            // ok, just interpret it as being relative to the cwd...
-            file = new File(fileName);
-        }
-        append = KeyValuePair.getBooleanValue(FILE_APPEND, properties, false);
-        ext = KeyValuePair.getValue(FILE_EXT, properties, "obj");
-        encoding = KeyValuePair.getValue(FILE_ENC, properties, "UTF-8");
-    }
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
-     */
-    public Message process(Message message) throws ActionProcessingException {
-        synchronized(file) {
-            File outputFile = getOutputFile();
-            FileOutputStream fileOutputStream = null;
-            FileWriter fileWriter = null;
-
-            try {
-                fileWriter = new FileWriter(outputFile, append);
-                fileOutputStream = new FileOutputStream(outputFile, append);
-            } catch (IOException e) {
-                throw new ActionProcessingException("Action " + actionName + " failed.  Unable to open output file " + outputFile.getAbsolutePath());
-            }
-            
-            Object oCurr = ActionUtils.getTaskObject(message);
-            try {
-                if(oCurr instanceof byte[]) {
-                    fileOutputStream.write((byte[])oCurr);
-                } else {
-                    fileOutputStream.write(oCurr.toString().getBytes(encoding));
-                }
-                fileOutputStream.flush();
-            } catch (IOException e) {
-                throw new ActionProcessingException("Action " + actionName + " failed.  Unable to write to output file " + outputFile.getAbsolutePath(), e);
-            } finally {
-                try {
-                    fileWriter.close();
-                } catch (IOException e) {
-                    logger.warn("Exception on closing file " + file.getAbsolutePath(), e);
-                }
-            }
-        }
-        return message;
-    }
-
-    /**
-     * Get the output file.
-     * @return Output file.
-     */
-    private File getOutputFile() {
-        if(file.isDirectory()) {
-            UUID randomUUID = UUID.randomUUID();
-            File randomFile = new File(file, randomUUID.toString() + "." + ext);
-            
-            if(randomFile.exists()) {
-                return getOutputFile();
-            }
-            
-            return randomFile;
-        } else {
-            return file;
-        }
-    }
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#getOkNotification(java.lang.Object)
-     */
-    public Serializable getOkNotification(Message message) {
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#getErrorNotification(java.lang.Object)
-     */
-    public Serializable getErrorNotification(Message message) {
-        return null;
-    }
-
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockFileAction.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockFileAction.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/actions/templates/MockFileAction.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,74 +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.File;
-import java.io.Serializable;
-import java.text.SimpleDateFormat;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.AbstractFileAction;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-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 MockFileAction extends AbstractFileAction 
-{
-    private static Logger logger = Logger.getLogger(MockFileAction.class);
-	
-	@Override
-	public Object process(File file) throws ActionProcessingException 
-	{
-        logger.info("processObject was called with <<" + file.getAbsolutePath() + ">>");
-        return file;
-	} //________________________________
-	
-	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)
-		+">";
-	} //________________________________
-	
-} //____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/Lifecycle.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/Lifecycle.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/Lifecycle.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,35 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated 
- * by the @authors tag. All rights reserved. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.listeners;
-
-/**
- * ESB listener component lifecycle interface.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public interface Lifecycle {
-
-	/**
-	 * Get the state of the listener component.
-	 * @return The state of the component.
-	 */
-	public abstract State getState();	
-}
\ No newline at end of file

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/State.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/State.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/State.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -34,30 +34,6 @@
 
 	private int m_iCompletionCode = 0;
 	private Throwable m_oThrowable = null;
-	
-	/**
-	 * Block until the state of the supplied listener component transitions to a state of "Ready".
-	 */
-	public static void waitUntilReady(Lifecycle owner) {
-		if(owner == null || owner.getState() == null) {
-			throw new IllegalArgumentException("Null or stateless 'owner' arg in method call.");
-		}
-		
-		long mark = System.currentTimeMillis();
-		while(owner.getState().isGettingReady()) {
-			if(System.currentTimeMillis() - mark > 2000) {
-				logger.info("Waiting on listener component [" + owner.getClass().getName() + "] to transition to a state of 'Ready'.  Current state is '" + owner.getState() + "'.");
-				mark = System.currentTimeMillis();
-			}
-			
-			try {
-				Thread.sleep(100);
-			} catch (InterruptedException e) {
-				logger.error("Interrupted while waiting for state to transition to 'Ready'.", e);
-			}
-		}
-		logger.info("Listener component [" + owner.getClass().getName() + "] is now in a state of 'Ready'.");
-	}
 
 	/**
 	 * Is this state instance in one of the states leading up to (but not including) the "Ready" state.

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/AbstractListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/AbstractListener.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/AbstractListener.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,142 +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.listeners.message;
-
-import java.util.concurrent.ExecutorService;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.Lifecycle;
-import org.jboss.soa.esb.listeners.State;
-
-/**
- * Base class for listener implementations which will be responsible for implementing some sort of
- * blocking receive whithin the {@link #listen()} method.
- * <p/>
- * Note that the {@link java.lang.Runnable#run()} method has been made final in this class.  This is to
- * enable capture of Thread termination, graceful or otherwise, and to reflect the status change in the
- * lifecycle state of the listener.
- * <p/>
- * The effective "run" method for implementations of this class is the {@link #listen()} method.
- * 
- * @author <a href="mailto:johan.kumps at telenet.be">Johan Kumps</a>
- *
- */
-public abstract class AbstractListener implements Runnable, Lifecycle {
-
-	/* The logger for this class */
-	protected Logger logger = Logger.getLogger(AbstractListener.class);
-
-	/* The configuration to be used by this listener*/
-	protected ConfigTree _config = null;
-
-	/* The listener controller*/
-	protected EsbListenerController _controller = null;
-
-	/**
-	 * Listener lifecycle state.
-	 */
-	private State state = State.Uninitialised;
-
-	/* The default number of thread in the action pipeline execution thread pool */
-	protected int m_iMaxThr = 1;
-
-	/* The maximum number of threads in the action processing thread pool */
-	protected int m_iUpperThreadLimit = 10; // just in case - override if you
-
-	/* The name of the attribute in the configuration containing the number of threads in the pool*/
-	public static final String PARM_MAX_THREADS = "maxThreads";
-
-	/* The thread pool executing the action processing pipeline*/
-	protected ExecutorService pipelineExecutorPool = null;
-
-	/**
-	 * Constructor configuring this listener instance and thread pool executing the
-	 * action processing pipeline.
-	 *  
-	 * @param controller the EsbListenerController instance controlling this listener
-	 * @param configTree the configuration for this listener instance
-	 */
-	protected AbstractListener(EsbListenerController controller,
-			ConfigTree configTree) {
-		this._controller = controller;
-		this._config = configTree;
-
-		// The number of threads configured
-		String maxThreads = this._config.getAttribute(PARM_MAX_THREADS);
-		if (maxThreads != null) {
-			int iMax = Integer.parseInt(maxThreads);
-			this.m_iMaxThr = Math.min(iMax, m_iUpperThreadLimit);
-			if (this.logger.isInfoEnabled()){
-				this.logger.info("Action processing pipeline will be handled by " + m_iMaxThr + " threads.");
-			}			
-		} else {
-			this.logger.warn("Attribute maxThreads has not been set. Action pipeline will be processed by only one thread");
-		}
-//		this.pipelineExecutorPool = Executors.newFixedThreadPool(m_iMaxThr);
-	}
-
-    /**
-     * Get the listener lifecycle state.
-     * @return The state of the listener.
-     */
-    public final State getState() {
-    	return state;
-    }
-
-    /**
-     * Set the listener lifecycle state.
-     * @param state The new state of the listener.
-     */
-    protected final void setState(State state) {
-    	this.state = state;
-    }
-	
-	/* (non-Javadoc)
-	 * @see java.lang.Runnable#run()
-	 */
-	public final void run() {
-		Throwable thrown = null;
-		
-		try {
-			listen();
-		} catch(Throwable t) {
-			thrown = t;
-		} finally {
-			if(thrown != null) {
-				state = State.Exception_thrown;
-				state.setThrowable(thrown);
-				logger.error("Listener [" + getClass().getName() + "] terminated abnormally.  Configuration:\n" + _config.toXml(), thrown);
-			} else {
-				state = State.Done_OK;
-				logger.info("Listener [" + getClass().getName() + "] has shutdown.");
-			}
-		}
-	}
-	
-	/**
-	 * Listen for messages.
-	 * <p/>
-	 * This method is effectively the "run" method for the listener.
-	 */
-	public abstract void listen();
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/AbstractPassiveListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/AbstractPassiveListener.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/AbstractPassiveListener.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,44 +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.listeners.message;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-/**
- * Base class to be implmented by listener implementations which use a channel implementation 
- * doing the listening stuff like periodically receiving on a queue.
- * 
- * @author <a href="mailto:johan.kumps at telenet.be">Johan Kumps</a>
- *
- */
-public abstract class AbstractPassiveListener extends AbstractListener{
-
-	protected AbstractPassiveListener(EsbListenerController controller, ConfigTree configTree) {
-		super(controller, configTree);
-	}
-
-	public void listen() {
-		//nothing to be done here because channel implementation is taking care of
-		// blocking receive stuff
-	}
-
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerController.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerController.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerController.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,171 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated 
- * by the @authors tag. All rights reserved. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.listeners.message;
-
-import java.text.SimpleDateFormat;
-import java.util.Map;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.Lifecycle;
-import org.jboss.soa.esb.services.registry.RegistryException;
-
-/**
- * EsbListenerController interface.
- * <p/>
- * An implementation of this intervace controls the lifecycle of a set of ESB Aware listeners.  Instance
- * creation should be managed via the {@link org.jboss.soa.esb.listeners.message.EsbListenerControllerFactory}
- * class.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public interface EsbListenerController extends Lifecycle {
-
-	public static final String PARM_RELOAD_SECS = "parameterReloadSecs";
-
-	public static final String PARM_END_TIME = "endTime";
-
-	// Attribute name that denotes listener class to be instantiated in a child
-	// thread
-	// This attribute is not in the root node but in first level child
-	// ConfigTrees
-	public static final String PARM_LISTENER_CLASS = "listenerClass";
-
-	/**
-	 * Obtain a shallow copy of needed atributes in this object's last loaded
-	 * parameter tree <p/>The local bject is cloned so child threads can use it
-	 * as they choose to without interfering with the environment
-	 * <p />
-	 * Listener processes controlled by this object should keep a reference to
-	 * this object at construction time, and not call this method again unless
-	 * they specifically need updated values. Parameter reload could have
-	 * happened since last call
-	 * 
-	 * @return Map - a shallow copy of the attributes Map
-	 */
-	@SuppressWarnings("unchecked")
-	public abstract Map<String, Object> getControllerAttributes();
-
-	public static final SimpleDateFormat s_oDateParse = new SimpleDateFormat(
-			"yyyyMMdd hh:mm:ss");
-
-	/**
-	 * Check to see if all needed parameters are there, and assign default
-	 * values to some of them
-	 * 
-	 * @param p_oP
-	 *            ConfigTree - Where to look for the mandatory/optional
-	 *            configuration attributes
-	 * @throws Exception -
-	 *             If attributes are wrong or not enough for a proper runtime
-	 *             configuration
-	 */
-	public abstract void checkParms(ConfigTree p_oP) throws Exception;
-
-	/**
-	 * Main execution loop <p/> Will continue to run until either <p/>a) run
-	 * time is expired <p/>b) quiesce command is received in command queue
-	 * <p/>For every child element that contains a PARM_LISTENER_CLASS
-	 * attribute, this method will try to launch a child thread instantiating an
-	 * object of that class, and will call it's run() method <p/>Once all child
-	 * processes are trigered, the main thread will either <p/>1) wait for a
-	 * message in the command queue (if one was configured) until next reload or
-	 * end of run period expired <p/>or 2) Just sleep if there's no command
-	 * queue to listen on
-	 */
-	public abstract void run();
-
-	public abstract void requestEnd();
-
-	/**
-	 * Accessor to determine if execution time is expired or shutdown requested
-	 * 
-	 * @return boolean if processing has to stop (all child threads will be
-	 *         allowed to finish)
-	 */
-	public abstract boolean endRequested();
-
-	/**
-	 * Accessor to determine if execution time is not expired, and no shutdown
-	 * request received
-	 * 
-	 * @return boolean - true if run time has not expired and quiesce has not
-	 *         been requested
-	 */
-	public abstract boolean endNotRequested();
-
-	/**
-	 * Provide a common accessor to determine if parameters have to be reloaded
-	 * <p/> For child threads this means thread execution has to end
-	 * </p>
-	 * Child processes should only call this method when they are idle (as
-	 * opposed to in the middle of executing a unit of work)
-	 * 
-	 * @return boolean - true if it's time to reload parameters
-	 */
-	public abstract boolean isReloadNeeded();
-
-	/**
-	 * Helper accessor for child processes that provides info to determine if
-	 * they can continue with yet another execution cycle
-	 * 
-	 * @return boolean - true if runtime is not expired and not time yet to
-	 *         reload parameters
-	 */
-	public abstract boolean continueLooping(); // ________________________________
-
-	public abstract long millisToWait();
-	
-	/**
-	 * @deprecated use register (ConfigTree config, EPR address) instead.
-	 * @param name
-	 * @param address
-	 */
-	public abstract void register(String name, EPR address); // ________________________________
-
-	/**
-	 * @deprecated use unRegister (String serviceCategoryName, String serviceName, EPR epr) instead.
-	 * @param name
-	 */
-	public abstract void unRegister(String name); // ________________________________
-
-	/**
-	 * Register an EPR in the registry.
-	 * 
-	 * @param config - a config tree containing the deployment-configuration of the service.
-	 * @param epr - the epr (EndPoint Reference) of the service.
-	 * 
-	 * @throws RegistryException
-	 */
-	public abstract void register(ConfigTree config, EPR epr)
-			throws RegistryException;
-
-	/**
-	 * Unregister the EPR from the registry.
-	 * 
-	 * @param serviceCategoryName - name of the category of the service ('Content Based Routing')
-	 * @param serviceName         - name of the service ("
-	 * @param epr
-	 * @throws RegistryException
-	 */
-	public abstract void unRegister(String serviceCategoryName, String serviceName, EPR epr) throws RegistryException;
-
-}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerFactory.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerFactory.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerFactory.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,649 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated 
- * by the @authors tag. All rights reserved. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.listeners.message;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Constructor;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.concurrent.ConcurrentHashMap;
-
-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.addressing.EPR;
-import org.jboss.soa.esb.addressing.util.EPRManager;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.State;
-import org.jboss.soa.esb.parameters.ParamRepositoryException;
-import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
-import org.jboss.soa.esb.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
-import org.jboss.soa.esb.util.Util;
-import org.xml.sax.SAXException;
-
-import com.arjuna.common.util.propertyservice.PropertyManager;
-
-/**
- * {@link org.jboss.soa.esb.listeners.message.EsbListenerController} Factory class.
- * <p/>
- * Control construction and launching of the {@link org.jboss.soa.esb.listeners.message.EsbListenerController}
- * implementation.  The factory methods will not return until the controller is up and running completely, with
- * all managed listeners fully initalised.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class EsbListenerControllerFactory 
-{
-	private static Map<String,Long> _paramFileTimeStamps=new ConcurrentHashMap<String,Long>();
-	private static String _sRldSecs=null;
-	private static String _parametersName;
-
-	/**
-	 * Create an instance of EsbListenerController from a named configuration stored in the
-	 * paramater repository.
-	 * @param parameterName The parameter name.
-	 * @return The controller instance.
-	 * @throws Exception Failed to create controller instance.
-	 */
-	public static EsbListenerController getInstance(String parameterName) throws Exception {
-		EsbListenerControllerImpl controller =  new EsbListenerControllerImpl(parameterName);
-		_parametersName = parameterName;
-		return startController(controller);
-	}
-	
-	/**
-	 * Create an instance of EsbListenerController directly from a configuration tree.
-	 * @param config The configuration tree from which to construct the controller instance.
-	 * @return The controller instance.
-	 * @throws Exception Failed to create controller instance.
-	 */
-	public static EsbListenerController getInstance(ConfigTree config) throws Exception {
-		EsbListenerControllerImpl controller =  new EsbListenerControllerImpl(config);
-		return startController(controller);
-	}
-
-	/**
-	 * Start the controller and wait for it to initialise.
-	 * @param controller The controller.
-	 * @return The controller.
-	 */
-	private static EsbListenerController startController(EsbListenerControllerImpl controller) {
-		// Start the controller and wait for it to transition to a state of "Ready".
-		new Thread(controller).start();
-		State.waitUntilReady(controller);
-				
-		return controller;
-	}
-
-	/**
-	 * Controlling class that will launch 'message aware' listener child threads for supported
-	 * transport listener classes, as indicated in the configuration XML tree used in the constructor
-	 * If you use the 'main' method, configuration file is expected in arg[0]
-	 * 
-	 * <p />
-	 * Can be launched as uppermost controller (it has a main(args) method)
-	 * <p />
-	 * Also implements Runnable, and can thus be launched in a child thread from an
-	 * upper controlling process
-	 * <p />
-	 * Listens on a JMS queue (with an optional message selector) for commands (e.g.
-	 * Quiesce, Reload Parameters, Set End Time, etc.)
-	 * <p />
-	 * Parameter reloading can also be set using the PARM_RELOAD_SECS attribute
-	 * <p />
-	 * End time for this instance can also be set using the PARM_END_TIME attribute
-	 * <p />
-	 * 
-	 * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
-	 * @since Version 4.0
-	 */
-	public static class EsbListenerControllerImpl implements Runnable, EsbListenerController {
-	
-		private static Logger _logger = Logger.getLogger(EsbListenerControllerImpl.class);
-	
-		public static void main(String[] args) throws Exception {
-			EsbListenerControllerImpl oProc = new EsbListenerControllerImpl(args[0]);
-			oProc.run();
-			State oS = oProc.getState();
-	
-			if (null != oS.getThrowable()) {
-				_logger.error("EsbListenerControllerImpl <" + args[0] + "> FAILED\n", oS
-						.getThrowable());
-			}
-			System.exit(oS.getCompletionCode());
-		} // ________________________________
-	
-		private Object _synchReload = new Short((short)0);
-		protected int m_iDfltReloadMillis = 180000 // default interval between
-													// parameter reloads
-		;
-	
-		private String m_sParmsName;
-		private ConfigTree m_oParms;
-		private Object _registrySynch = new Object();
-	
-		private HashMap<String, Object> m_oAtts;
-	
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#getControllerAttributes()
-		 */
-		@SuppressWarnings("unchecked")
-		public Map<String, Object> getControllerAttributes() {
-			return (Map<String, Object>) m_oAtts.clone();
-		}
-	
-		private boolean m_bReloadRequested, m_bEndRequested;
-	
-		private long m_lNextReload = Long.MAX_VALUE;
-	
-		private long m_lEndTime = Long.MAX_VALUE;
-	
-		private State m_oState = State.Uninitialised;
-	
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#getState()
-		 */
-		public State getState() {
-			return m_oState;
-		}
-	
-		private CommandQueue commandQueue;
-		private static CommandQueue defaultCommandQueue = null;
-		
-		/**
-		 * Construct a Listener Manager from the named repository based
-		 * configuration.
-		 * 
-		 * @param p_sParameterName
-		 *            Name of the Repository entry containing the configuration.
-		 * @throws Exception
-		 *             Unable to load/use the named configuration.
-		 */
-		private EsbListenerControllerImpl(String p_sParameterName) throws Exception {		
-			this(EsbListenerControllerImpl.getListenerConfig(p_sParameterName));
-			m_sParmsName = p_sParameterName;
-		}
-	
-		/**
-		 * Construct a Listener Controller using the specified listener configuration.
-		 * 
-		 * @param config
-		 *            The configuration.
-		 * @throws Exception
-		 *             Unable to load/use the supplied configuration.
-		 */
-		private EsbListenerControllerImpl(ConfigTree config) throws Exception {
-			m_oParms = config;
-			m_oState = State.Loading_parameters;
-	
-			try {	checkParms(m_oParms); }
-			catch (Exception e) 
-			{
-				String configSource = config.getAttribute("configSource");
-	
-				m_oState = State.Exception_thrown;
-				m_oState.setThrowable(e);
-				_logger.fatal("Listener configuration and startup error.  Config Source: "
-										+ (configSource != null ? configSource
-												: "unknown"), e);
-	
-				throw e;
-			}
-		}
-	
-		/**
-		 * Load the named listener configuration from the configured parameter
-		 * repository.
-		 * 
-		 * @param reposParam
-		 *            The name of the repository entry containing the Listener
-		 *            configuration.
-		 * @return Listener Configuration as {@link ConfigTree}.
-		 * @throws IOException
-		 *             Unable to access the repository.
-		 * @throws ParamRepositoryException
-		 *             Unable to access the configuration in the repository.
-		 * @throws SAXException
-		 *             Unable to parse the configuration.
-		 */
-		private static ConfigTree getListenerConfig(String reposParam)
-				throws IOException, ParamRepositoryException, SAXException {		
-			String sXml = ParamRepositoryFactory.getInstance().get(reposParam);
-			ConfigTree config = ConfigTree.fromXml(sXml);
-	
-			config.setAttribute("configSource", "param-repository:" + reposParam);
-	
-			return config;
-		}
-	
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#checkParms(org.jboss.soa.esb.helpers.ConfigTree)
-		 */
-		public void checkParms(ConfigTree p_oP) throws Exception 
-		{
-			// We've just loaded - set to false until next reload requested
-			m_bReloadRequested = false;
-			if (null!=_parametersName)
-			{
-				File file = new File(_parametersName);
-				if (file.exists())
-					_paramFileTimeStamps.put(_parametersName, file.lastModified());
-			}
-			
-
-			commandQueue = createCommandQueue(p_oP);
-	
-			// Open the command queue...
-			if (null!=commandQueue)
-				commandQueue.open(p_oP);
-	
-			setNextReloadTime(p_oP);
-
-			// if PARM_END_TIME not set try to run forever
-			// not a good practice if command queue is not set
-			// Expected date format is "yyyyMMdd hh:mm:ss"
-			String sEndT = p_oP.getAttribute(PARM_END_TIME);
-			m_lEndTime = (null == sEndT) ? Long.MAX_VALUE : s_oDateParse.parse(
-					sEndT).getTime();
-	          
-		} // ________________________________
-	
-		private void setNextReloadTime(ConfigTree tree)
-		{
-			// if RELOAD_SECONDS_TAG not set, and no command queue
-			// then reload every 10 minutes
-			// If there is a command queue, run until command is received
-
-			_sRldSecs = tree.getAttribute(EsbListenerController.PARM_RELOAD_SECS);
-			synchronized (_synchReload) 
-			{
-				m_lNextReload = (null != _sRldSecs) 
-				? System.currentTimeMillis() + 1000 * Long.parseLong(_sRldSecs)
-				: (null == commandQueue) 
-						? Long.MAX_VALUE 
-						: System.currentTimeMillis() + m_iDfltReloadMillis;
-			}
-			
-			
-		    if (null==_sRldSecs)
-		    {
-		    	String sMsg = (null==commandQueue)
-		    		? " -  Using default of "+_sRldSecs
-		    		: " - Listener will run until stopped by command sent to queue";
-		    	_logger.warn("No value specified for: "+EsbListenerController.PARM_RELOAD_SECS + sMsg);
-		    }
-
-		} //________________________________
-
-	    /**
-	     * Factory method for creating the command queue.
-	     * @param config EsbListenerControllerImpl config.
-	     * @return EsbListenerControllerImpl CommandQueue instance.
-	     */
-		private CommandQueue createCommandQueue(ConfigTree config) {
-			String commandQueueClass = config.getAttribute("command-queue-class");
-			
-			if(commandQueueClass != null) {
-				try {
-					return (CommandQueue) Class.forName(commandQueueClass).newInstance();
-				} catch (Exception e) {
-					_logger.error("Failed to instantiate CommandQueue ["+ commandQueueClass + "].  Defaulting to no Command Queue", e);
-				}
-			}
-				
-			return defaultCommandQueue;
-		}
-	
-		/**
-		 * Allows a default command queue to be set statically for all EsbListenerControllerImpl instances.
-		 * @param defaultCommandQueue The defaultCommandQueue to set.
-		 */
-		public static void setDefaultCommandQueue(CommandQueue defaultCommandQueue) {
-			EsbListenerControllerImpl.defaultCommandQueue = defaultCommandQueue;
-		}
-	
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#run()
-		 */
-		public void run() 
-		{
-			boolean relaunch = true;
-			while (endNotRequested()) 
-			{
-				m_oState = State.Running;
-				if (relaunch)
-					for (ConfigTree oCurr : m_oParms.getAllChildren()) 
-					{
-						String sClass = oCurr.getAttribute(PARM_LISTENER_CLASS);
-						if (Util.isNullString(sClass))
-							continue;
-						tryToLaunchChildListener(oCurr, sClass);
-					}
-				m_oState = State.Ready;
-	
-				waitForCmdOrSleep();
-	
-				if (endRequested()) {
-					break;
-				}
-
-				relaunch = false;
-				if (m_sParmsName != null && isReloadNeeded()) 
-					try 
-					{
-						m_oState = State.Loading_parameters;
-						_logger
-								.info("Reloading parameters _____________________________________________________");
-						ConfigTree oNew = EsbListenerControllerImpl.getListenerConfig(m_sParmsName);
-						checkParms(oNew);
-						m_oParms = oNew;
-						relaunch = true;
-					} 
-					catch (Exception e) 
-					{
-						_logger.error("Failed to reload parameters"
-								+ " - Continuing with cached version", e);
-					}
-			}
-			// m_oState = State.Shutting_down;
-	
-			m_oState = State.Done_OK;
-			m_oState.setCompletionCode(0);
-			_logger
-					.info("Finishing_____________________________________________________");
-	
-			// Close the command queue...
-			try {
-				if (null != commandQueue)
-					commandQueue.close();
-			} catch (CommandQueueException e) {
-				_logger.error("Error closing Command Queue.", e);
-			}
-		} // ________________________________
-	
-		private void tryToLaunchChildListener(ConfigTree p_oP, String p_sClassName) {
-			try 
-			{
-				Class oListener = Class.forName(p_sClassName);
-				Constructor oConst = oListener.getConstructor(new Class[] {EsbListenerController.class, ConfigTree.class});
-				AbstractListener listener = (AbstractListener) oConst.newInstance(new Object[] { this,p_oP});
-				new Thread(listener).start();
-				// Wait for the listener it to transition to a state of "Ready".
-				State.waitUntilReady(listener);
-			}
-			catch (Throwable e) 
-			{
-				_logger.error("Cannot launch <" + p_sClassName + ">\n", e);
-			}
-		} // ________________________________
-	
-		public long millisToWait()
-		{
-			synchronized (_synchReload)
-			{
-				return Math.min(m_lNextReload, m_lEndTime) - System.currentTimeMillis();
-			}
-		} // ________________________________
-	
-		private void waitForCmdOrSleep() {
-			long lToGo = millisToWait();
-	
-			if (null == commandQueue) {
-				_logger.debug("About to sleep " + lToGo);
-				// No command queue nor topic - Just sleep until time
-				// exhausted, or thread interrupted
-				try {
-					while ((lToGo=millisToWait()) > 0)
-						Thread.sleep(500);
-				} catch (InterruptedException e) {
-					m_lEndTime = 0; // mark as end requested and return
-				}
-				return;
-			}
-	
-			// Wait for commands until time exhausted or command received
-			// Note that received commands might change time variables (reload/end)
-			// that's why time to go is recalculated on each cycle
-			while ((lToGo = millisToWait()) > 0) {
-				try {
-					_logger.info("Waiting for command ... timeout=" + lToGo + " millis");
-	
-					String oM = commandQueue.receiveCommand(lToGo);
-					if (null == oM) {
-						return;
-					}
-					processCommand(oM);
-					if (endRequested() || isReloadNeeded()) {
-						break;
-					}
-				} catch (CommandQueueException eJ) {
-					_logger.info("receive on command queue failed", eJ);
-				}
-			}
-		} // ________________________________
-	
-		/**
-		 * Processes the command that has been received in the command queue (or
-		 * topic) <p/>m_bEndRequested, m_bReloadRequested, and m_lEndTime could be
-		 * changed
-		 * 
-		 * <p/> <p/><TABLE border="1"> <COLGROUP> <COL width="200"/> <COL
-		 * width="400"/> </COLGROUP>
-		 * <TR>
-		 * <TD align="center">message text</TD>
-		 * <TD align="center">effect</TD>
-		 * </TR>
-		 * <TR>
-		 * <TD>shutdown*</TD>
-		 * <TD>End time will be immediately set to 'now' - quiesce process will
-		 * start - Child threads will be allowed to finish normally</TD>
-		 * </TR>
-		 * <TR>
-		 * <TD>reload param*</TD>
-		 * <TD>Parameters will be immediately reloaded, and listener reconfigured
-		 * with new values</TD>
-		 * </TR>
-		 * <TR>
-		 * <TD>endTime yyyyMMdd hh:mm:ss</TD>
-		 * <TD>End time will be set to new value. If hh:mm:ss is not supplied =>
-		 * end of day assumed (23:59:59)</TD>
-		 * </TR>
-		 * </TABLE> * startsWith() <p/>
-		 * 
-		 * @param p_oMsg
-		 *            Message received from the command queue.
-		 * 
-		 */
-		private void processCommand(String sTxt) {
-			if (null == sTxt)
-				return;
-			
-			String sLow = sTxt.trim().toLowerCase();
-			if (sLow.startsWith("shutdown")) {
-				m_bEndRequested = true;
-				_logger.info("Shutdown has been requested");
-				return;
-			}
-			if (sLow.startsWith("reload param")) {
-				m_bReloadRequested = true;
-				_logger
-						.info("Request for parameter reload has been received");
-				return;
-			}
-			String[] sa = sLow.split("\\s+");
-			if (sa.length > 1 && "endtime".equals(sa[0])) {
-				try {
-					String sDate = sa[1];
-					String sTime = (sa.length < 3 || null == sa[2]) ? "23:59:59"
-							: sa[2];
-					Date oEnd = s_oDateParse.parse(sDate + " " + sTime);
-					_logger.info("New end date set to : " + oEnd);
-					m_lEndTime = oEnd.getTime();
-				} catch (Exception eDat) {
-					_logger.info("Problems with endTime command", eDat);
-				}
-			}
-		} // ________________________________
-	
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#requestEnd()
-		 */
-		public void requestEnd() {
-			m_bEndRequested=true;
-			m_lEndTime = 0;
-		}
-		
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#endRequested()
-		 */
-		public boolean endRequested() {
-			return m_bEndRequested || System.currentTimeMillis() >= m_lEndTime;
-		}
-	
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#endNotRequested()
-		 */
-		public boolean endNotRequested() {
-			return !endRequested();
-		}
-	
-		public boolean isReloadNeeded()
-		{
-			// command to reload was received - force reload
-			if (m_bReloadRequested)
-				return refreshNextReload();
-
-			// Still not time to reload
-			if (System.currentTimeMillis() < m_lNextReload)
-				return false;
-			
-			if (null==_parametersName)
-				return refreshNextReload();
-			
-			File paramFile = new File(_parametersName);
-			if (! paramFile.exists())
-				return refreshNextReload();
-			
-//			check the TS on the file.
-			Long previousTimeStamp	= _paramFileTimeStamps.get(_parametersName);
-			if (null==previousTimeStamp)
-				return refreshNextReload();
-
-
-			Long currentTimeStamp	= paramFile.lastModified();
-			if (! previousTimeStamp.equals(currentTimeStamp))
-				return refreshNextReload();
-
-			setNextReloadTime(m_oParms);
-			return false;
-		}
-		
-		private boolean refreshNextReload()
-		{
-			setNextReloadTime(m_oParms);
-			return true;
-		}
-
-	
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#continueLooping()
-		 */
-		public boolean continueLooping() {
-			return (endNotRequested() && !isReloadNeeded());
-		} // ________________________________
-		
-		public static EPRManager getEprManager()
-		{
-			PropertyManager manager = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE);
-			String sDir = manager.getProperty(Environment.REGISTRY_FILE_HELPER_DIR,".");	
-			return EPRManager.getInstance(sDir);
-		}
-		
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#register(java.lang.String, org.jboss.soa.esb.addressing.EPR)
-		 */
-		public void register (String name, EPR address)
-		{
-			try { getEprManager().saveEPR(name,address); }
-			catch (IOException e)
-			{
-				_logger.fatal("Cannot register service",e);
-			}
-		} // ________________________________
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#unRegister(java.lang.String)
-		 */
-		public void unRegister (String name)
-		{
-			try { getEprManager().removeEPR(name); }
-			catch (IOException e)
-			{
-				_logger.fatal("Cannot un-register service",e);
-			}
-		} // ________________________________
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#register(org.jboss.soa.esb.helpers.ConfigTree, org.jboss.soa.esb.addressing.EPR)
-		 */
-		public void register(ConfigTree config , EPR epr) throws RegistryException
-		{
-			String serviceCategoryName = config.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
-			String serviceName         = config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
-			if ("eprManager".equalsIgnoreCase(serviceCategoryName))
-			{
-					register(serviceName,epr);
-					return;
-			}
-			String serviceDescription  = config.getAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG);
-			String eprDescription      = config.getAttribute(ListenerTagNames.EPR_DESCRIPTION_TAG);
-			Registry registry = RegistryFactory.getRegistry();
-			synchronized (_registrySynch)
-			{
-				registry.registerEPR(serviceCategoryName, serviceName, serviceDescription, epr, eprDescription);
-			}
-		}
-		/* (non-Javadoc)
-		 * @see org.jboss.soa.esb.listeners.message.EsbListenerController#unRegister(java.lang.String, java.lang.String, org.jboss.soa.esb.addressing.EPR)
-		 */
-		public void unRegister(String serviceCategoryName, String serviceName , EPR epr) throws RegistryException
-		{
-			if ("eprManager".equalsIgnoreCase(serviceCategoryName))
-			{
-					unRegister(serviceName);
-					return;
-			}
-			Registry registry = RegistryFactory.getRegistry();
-			synchronized (_registrySynch)
-			{
-				registry.unRegisterEPR(serviceCategoryName, serviceName, epr);
-			}
-		}
-	
-	
-	} // ____________________________________________________________________________
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerService.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerService.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerService.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,72 +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.listeners.message;
-
-import java.net.URI;
-
-import org.apache.log4j.Logger;
-import org.jboss.system.ServiceMBeanSupport;
-/**
- * Service to manage the Listener when deployed to the appserver.
- * 
- * @author Kurt Stam
- *
- */
-public class EsbListenerControllerService extends ServiceMBeanSupport implements EsbListenerControllerServiceMBean
-{
-	private EsbListenerController	_esbListController;
-	private Logger _logger = Logger.getLogger(this.getClass());
-	private String messageAwareConfigFile="jbossesb-listener.xml";
-	/**
-	 * Starts the listeners.
-	 */
-	protected void startService() throws Exception 
-	{
-		_logger.info("starting message aware listener with config file " + messageAwareConfigFile);
-		String confDir = System.getProperty("jboss.server.config.url");
-		URI uri = new URI(confDir);
-		confDir = uri.getPath();
-		String configFile = confDir + messageAwareConfigFile;
-		System.setProperty("juddi.propertiesFile", confDir + "juddi.properties");
-		_esbListController = EsbListenerControllerFactory.getInstance(configFile);
-	}
-	/**
-	 * Stops the listeners.
-	 */
-	protected void stopService() throws Exception 
-	{
-		_logger.info("shutting down message aware listener...");
-		_esbListController.requestEnd();
-	}
-	/**
-	 * Gets the listener config file. The name of the file is set in the jboss-service.xml.
-	 */
-	public String getMessageAwareConfigFile() {
-		return messageAwareConfigFile;
-	}
-	/**
-	 * Sets the listener config file.
-	 */
-	public void setMessageAwareConfigFile(String messageAwareConfigFile) {
-		this.messageAwareConfigFile = messageAwareConfigFile;
-	}
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerServiceMBean.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerServiceMBean.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerServiceMBean.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,35 +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.listeners.message;
-
-import org.jboss.system.ServiceMBean;
-/**
- * 
- * @author Kurt Stam
- *
- */
-public interface EsbListenerControllerServiceMBean extends ServiceMBean
-{
-//	Configure getters and setters for the configFile attribute
-	String getMessageAwareConfigFile();
-	void setMessageAwareConfigFile(String messageAwareConfigFile);
-}

Modified: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/HttpListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/HttpListener.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/HttpListener.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -32,7 +32,9 @@
 import org.jboss.remoting.transport.Connector;
 import org.jboss.soa.esb.ConfigurationException;
 import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.AbstractManagedListener;
 import org.jboss.soa.esb.listeners.ListenerInitializationException;
+import org.jboss.soa.esb.listeners.ListenerManager;
 import org.jboss.soa.esb.listeners.State;
 import org.jboss.soa.esb.message.Message;
 
@@ -57,7 +59,7 @@
  * @author <a href="mailto:johan.kumps at telenet.be">Johan Kumps</a>
  * 
  */
-public class HttpListener extends AbstractPassiveListener implements ServerInvocationHandler {
+public class HttpListener extends AbstractManagedListener implements ServerInvocationHandler {
 
 	/* The logger for this class */
 	protected Logger logger = Logger.getLogger(HttpListener.class);
@@ -88,7 +90,7 @@
 	 * @param actionDefinitionFactory
 	 * @throws Exception
 	 */
-	public HttpListener(EsbListenerController esbListenerController,
+	public HttpListener(ListenerManager esbListenerController,
 			ConfigTree configuration) throws ConfigurationException,
 			ListenerInitializationException {
 		super(esbListenerController, configuration);
@@ -189,8 +191,6 @@
 	 * Check for mandatory and optional attributes in parameter tree
 	 */
 	private void checkParams() throws ConfigurationException {
-		setState(State.Loading_parameters);
-		
 		// listener url
 		this.listenHttpUrl = this._config.getAttribute(LISTEN_HTTP_URL);
 		if (this.listenHttpUrl == null) {
@@ -222,7 +222,6 @@
 	 *             when something goes wrong during remoting deamon startup
 	 */
 	private void initServer() throws ListenerInitializationException {
-		setState(State.Running);
 		try {
 			InvokerLocator locator = new InvokerLocator(this.listenHttpUrl);
 			if (this.logger.isInfoEnabled()) {
@@ -244,11 +243,42 @@
 		} catch (Throwable thrown) {
 			State newState = State.Exception_thrown;
 			newState.setThrowable(thrown);
-			setState(newState);
 			throw new ListenerInitializationException(thrown.getMessage(), thrown);
 		}
+	}
 
-		setState(State.Ready);
+	@Override
+	public void waitForEventAndProcess(long maxWaitMillis) {
+		// Not using this method in this AbstractManagedListener.
+		try {
+			Thread.sleep(maxWaitMillis);
+		} catch (InterruptedException e) {
+			logger.error("Unexpected interrupt exception.", e);
+		}
 	}
 
+	/* (non-Javadoc)
+	 * @see org.jboss.soa.esb.listeners.AbstractManagedListener#isMessageAware()
+	 */
+	@Override
+	public boolean isMessageAware() {
+		return true;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.jboss.soa.esb.listeners.AbstractManagedListener#initializeRun()
+	 */
+	@Override
+	public boolean initializeRun() {
+		return false;
+	}
+
+	/* (non-Javadoc)
+	 * @see org.jboss.soa.esb.listeners.AbstractManagedListener#finalizeRun()
+	 */
+	@Override
+	public boolean finalizeRun() {
+		return false;
+	}
+	
 }

Deleted: labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/src/org/jboss/soa/esb/listeners/message/JmsQueueListener.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,307 +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.listeners.message;
-
-import java.io.IOException;
-import java.io.Serializable;
-
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSession;
-import javax.jms.TopicSession;
-import javax.naming.Context;
-import javax.naming.NamingException;
-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.ConfigTree;
-import org.jboss.soa.esb.helpers.NamingContext;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.State;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.util.Util;
-import org.xml.sax.SAXException;
-
-/**
- * Esb Message aware JMS queue listener.
- * <p/> Expects an Object message whose getObject() method returns an org.jboss.soa.esb.message.Message
- * <br/>Clones the 'static' ConfigTree with which this listener was created, and stores the cloned tree 
- * inside the Message (to enable all actions in the chain to use the configuration)  
- * <br/>Instantiates and runs a new ActionProcessingPipeline on the received esb Message (augmented with 
- * ConfigTree) that will in turn instantiate and run all action classes in the chain 
- * 
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- */
-
-public class JmsQueueListener extends AbstractListener
-{
-	
-	/**
-	 * public constructor
-	 * @param controller EsbListenerController - the controlling process
-	 * @param config ConfigTree - Containing 'static' configuration for this instance
-	 * @throws Exception
-	 */
-    public JmsQueueListener(EsbListenerController controller, ConfigTree config) 
-    	throws ConfigurationException 
-    {
-    	super(controller, config);
-    	_iSleepForRetry		= 3;
-    	checkMyParms();
-    } // _______________________________
-    
-    /**
-     * Loops until controlling process determines
-     * <br/>Waits for JMS Object messages containing ESB messages
-     * <br/>When one is received, instantiates an action processing pipeline to process it
-     * <br/>Pipeline is started in new Thread
-     */
-    public void listen()
-    {
-    	setState(State.Running);
-    	
-        _logger.debug("run() method of "+this.getClass().getSimpleName()
-        		+" started on thread "+Thread.currentThread().getName());
-    	 try { _controller.register(_config,_epr); }
-    	 catch (RegistryException re) 
-    	 {
-     		_logger.fatal("Could not register service " + re.getLocalizedMessage(),re);
-    	 }
-
-    	 setState(State.Ready);
-    	while (_controller.continueLooping())
-        {
-    		long lwait = _controller.millisToWait();
-    		org.jboss.soa.esb.message.Message message = (lwait > 0 ) ? receiveEsbMessage(100) : null;
-        	if (null!=message)
-        	{	
-        		ActionProcessingPipeline chain = null;
-
-        		try	{ chain = new ActionProcessingPipeline(message,_config); }
-        		catch (IllegalArgumentException e)	
-        			{	_logger.error(e); 	continue; }
-        		catch (ConfigurationException e)
-    				{	_logger.error(e); 	continue; }
-
-//	        		this.pipelineExecutorPool.submit(chain);
-        		new Thread(chain).start();
-        		
-        		// Delete me - If I check the following line of code in, it's an accident!!
-        		try {
-					Thread.sleep(1000);
-				} catch (InterruptedException e) {
-					// TODO Auto-generated catch block
-					e.printStackTrace();
-				}
-        	}
-        }
-    	try { _controller.unRegister(_eprCategoryName, _eprName, _epr); }
-	   	catch (RegistryException re) 
-	   	{
-	   		_logger.warn("Could not un register service " + re.getLocalizedMessage());
-	   		//TODO   The problem is still here...  Look into it for GA
-	   	}
-    	cleanup();
-        _logger.debug("run() method of "+this.getClass().getSimpleName()
-        		+" finished on thread "+Thread.currentThread().getName());
-    } // _______________________________
-    
-    /**
-     * Check for mandatory and optional attributes in parameter tree
-     * 
-     * @throws Exception -
-     *             if mandatory atts are not right or actionClass not in
-     *             classpath
-     */
-    protected void checkMyParms() throws ConfigurationException 
-    {
-    	setState(State.Loading_parameters);
-    	
-        // Default value of obtainAttribute is null - Exception will be thrown
-        _queueName		= obtainAttribute(JMSEpr.DESTINATION_NAME_TAG, null);
-
-        _eprCategoryName= obtainAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG,null);
-        _eprName		= obtainAttribute(ListenerTagNames.SERVICE_NAME_TAG,null);
-
-        // No problem if selector is null - everything in queue will be returned
-        _sSelector = _config.getAttribute(JMSEpr.MESSAGE_SELECTOR_TAG);
-    	_logger.debug("No value specified for: "+JMSEpr.MESSAGE_SELECTOR_TAG
-    			+" - All messages in queue will be received by this listener");
-
-        _oQconn = null;
-        _oQsess = null;
-        _oQueue = null;
-
-        _jndiURL = obtainAttribute	(JMSEpr.JNDI_URL_TAG	,"localhost");
-        if (null==_config.getAttribute(JMSEpr.JNDI_URL_TAG))
-        	_logger.debug("No value specified for "+JMSEpr.JNDI_URL_TAG+" attribute"
-        			+" -  Using default of: '"+_jndiURL+"'");
-        _jndiContextFactory = obtainAttribute	(JMSEpr.JNDI_CONTEXT_FACTORY_TAG	,NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
-        if (null==_config.getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG))
-        	_logger.debug("No value specified for "+JMSEpr.JNDI_CONTEXT_FACTORY_TAG+" attribute"
-        			+" -  Using default of: '"+_jndiContextFactory+"'");
-        _jndiPkgPrefix = obtainAttribute	(JMSEpr.JNDI_PKG_PREFIX_TAG	,NamingContext.JBOSS_URL_PKG_PREFIX);
-        if (null==_config.getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG))
-        	_logger.debug("No value specified for "+JMSEpr.JNDI_PKG_PREFIX_TAG+" attribute"
-        			+" -  Using default of: '"+_jndiPkgPrefix+"'");
-        
-        _jndiCtx = NamingContext.getServerContext(_jndiURL,_jndiContextFactory,_jndiPkgPrefix);
-
-        _jmsFactoryClass = obtainAttribute(JMSEpr.CONNECTION_FACTORY_TAG, "ConnectionFactory");
-        if (null==_config.getAttribute(JMSEpr.CONNECTION_FACTORY_TAG))
-        	_logger.debug("No value specified for "+JMSEpr.CONNECTION_FACTORY_TAG+" attribute"
-        			+" -  Using default of: '"+_jmsFactoryClass+"'");
-        _epr = new JMSEpr(JMSEpr.QUEUE_TYPE,_queueName,_jmsFactoryClass
-        				,_jndiURL,_jndiContextFactory,_jndiPkgPrefix,_sSelector);
-
-		Exception thrown = null;
-        try
-        {
-        	Object tmp = _jndiCtx.lookup(_jmsFactoryClass);
-        	QueueConnectionFactory qcf = (QueueConnectionFactory) tmp;
-
-        	_oQconn = qcf.createQueueConnection();
-        	_oQsess = _oQconn.createQueueSession(false,TopicSession.AUTO_ACKNOWLEDGE);
-        	try {
-        		_oQueue = (Queue) _jndiCtx.lookup(_queueName);
-        	} catch (NamingException ne) {
-        		_oQueue = _oQsess.createQueue(_queueName);
-        	}
-        	_oQconn.start();
-        	_receiver = _oQsess.createReceiver(_oQueue, _sSelector);
-        	return;
-        }
-        catch (javax.naming.NamingException e)	{ thrown = e; }
-        catch (JMSException e) 					{ thrown = e; }
-        throw new ConfigurationException(thrown);
-
-    } // ________________________________
-
-    protected org.jboss.soa.esb.message.Message receiveEsbMessage(long millis)
-    {
-    	javax.jms.Message jmsMessage = null;
-        try 
-		{	
-        	jmsMessage = _receiver.receive(millis);
-		}
-        catch (JMSException oJ)
-        {
-        	_logger.error("JMS error on receive.  Attempting JMS Destination reconnect.", oJ);
-        	for (int i1 = 0; i1 < 3; i1++)
-        		// try to reconnect to the queue
-        		try { checkMyParms(); } 
-        		catch (Exception e)
-        		{
-        			_logger.error("Reconnecting to Queue", e);
-        			try {	Thread.sleep(_iSleepForRetry); }
-        			catch (InterruptedException e1)
-        			{ // Just return after logging
-        				_logger.error("Unexpected thread interupt exception.", e);
-        				return null;
-                    }
-                 }
-        }
-        if (null == jmsMessage)
-        	return null;
-
-        if (!(jmsMessage instanceof ObjectMessage))
-        {
-        	_logger.error("Unsupported JMS message type: " + jmsMessage.getClass().getName());
-        	return null;
-        }
-        try
-        {
-        	Serializable obj = (Serializable)((ObjectMessage)jmsMessage).getObject();
-        	return Util.deserialize(obj);
-        } 
-        catch (JMSException e1)
-        { _logger.error("Failed to read Serialized Object from JMS message.", e1);
-          return null;
-        }
-        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;
-    }
-    
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.listeners.AbstractListener#close()
-     */
-
-    protected void cleanup() 
-    {
-        if (null != _oQsess)
-            try { _oQsess.close(); }
-            catch (Exception e1) {/* Tried my best - Just continue */ }
-        if (null != _oQconn)
-            try { _oQconn.close(); }
-        	catch (Exception e2) {/* Tried my best - Just continue */ }
-    }
-
-    protected String obtainAttribute(String p_sAtt, String p_sDefault)
-		throws ConfigurationException 
-	{
-    	_logger.info("Reading value for " + p_sAtt);
-    	String sVal = _config.getAttribute(p_sAtt);
-    	if ((null == sVal) && (null == p_sDefault))
-    		throw new ConfigurationException("Missing or invalid <" + p_sAtt + "> attribute");
-	
-    	return (null != sVal) ? sVal : p_sDefault;
-	} // ________________________________
-
-    protected String            _eprCategoryName;
-    protected String			_eprName;
-    protected JMSEpr			_epr;
-    protected MessageConsumer 	_receiver;
-    protected boolean 			_bError = false;
-    protected QueueConnection	_oQconn;
-    protected QueueSession		_oQsess;
-    protected Queue 			_oQueue;
-    protected String	_queueName
-    					,_sSelector
-    					,_jndiURL
-    					,_jndiContextFactory
-    					,_jndiPkgPrefix
-    					,_jmsFactoryClass
-    ;
-    protected Context			_jndiCtx;
-    protected int				_iSleepForRetry;
-
-    protected static transient Logger _logger = Logger.getLogger(JmsQueueListener.class);
-} 

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-01.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-01.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-01.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,16 +0,0 @@
-	<Actions>
-		<Action name="ActionA" processor="TestActionProcessor1">
-			<property name="param1" value="val1" />
-			<property name="param2" value="val2" />
-			<property name="param3" value="val3" />
-		</Action>
-		<Action name="ActionB" processor="TestActionProcessor1">
-			<property name="param1" value="val2" />
-		</Action>
-		<Action name="ActionC" processor="TestActionProcessor2" />
-
-		<ProcessorAliases>
-			<Alias name="TestActionProcessor1" class="org.jboss.soa.esb.actions.TestActionProcessor1" />
-			<Alias name="TestActionProcessor2" class="org.jboss.soa.esb.actions.TestActionProcessor2" />
-		</ProcessorAliases>
-	</Actions>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-02.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-02.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-02.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,9 +0,0 @@
-	<Actions>
-		<Action name="" processor="TestActionProcessor1">
-			<property name="param1" value="val1" />
-		</Action>
-
-		<ProcessorAliases>
-			<Alias name="TestActionProcessor1" class="org.jboss.soa.esb.actions.TestActionProcessor1" />
-		</ProcessorAliases>
-	</Actions>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-03.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-03.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-03.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,9 +0,0 @@
-	<Actions>
-		<Action name="ActionA" processor="">
-			<property name="param1" value="val1" />
-		</Action>
-
-		<ProcessorAliases>
-			<Alias name="TestActionProcessor1" class="org.jboss.soa.esb.actions.TestActionProcessor1" />
-		</ProcessorAliases>
-	</Actions>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-04.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-04.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-04.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,9 +0,0 @@
-	<Actions>
-		<Action name="ActionA" processor="TestActionProcessor1">
-			<property name="" value="val1" />
-		</Action>
-
-		<ProcessorAliases>
-			<Alias name="TestActionProcessor1" class="org.jboss.soa.esb.actions.TestActionProcessor1" />
-		</ProcessorAliases>
-	</Actions>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-05.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-05.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-05.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,9 +0,0 @@
-	<Actions>
-		<Action name="ActionA" processor="TestActionProcessor1">
-			<property name="param1" value="" />
-		</Action>
-
-		<ProcessorAliases>
-			<Alias name="TestActionProcessor1" class="org.jboss.soa.esb.actions.TestActionProcessor1" />
-		</ProcessorAliases>
-	</Actions>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-06.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-06.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-06.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,9 +0,0 @@
-	<Actions>
-		<Action name="ActionA" processor="UnknownHandle1">
-			<property name="param1" value="val1" />
-		</Action>
-
-		<ProcessorAliases>
-			<Alias name="TestActionProcessor1" class="org.jboss.soa.esb.actions.TestActionProcessor1" />
-		</ProcessorAliases>
-	</Actions>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-07.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-07.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-07.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,9 +0,0 @@
-	<Actions>
-		<Action name="ActionA" processor="TestActionProcessor1">
-			<property name="param1" value="val1" />
-		</Action>
-
-		<ProcessorAliases>
-			<Alias name="" class="org.jboss.soa.esb.actions.TestActionProcessor1" />
-		</ProcessorAliases>
-	</Actions>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-08.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-08.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-08.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,6 +0,0 @@
-	<Actions>
-
-		<ProcessorAliases>
-			<Alias name="TestActionProcessor1" class="org.jboss.soa.esb.actions.TestActionProcessor1" />
-		</ProcessorAliases>
-	</Actions>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-09.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-09.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-09.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,5 +0,0 @@
-	<Actions>
-		<Action name="ActionA" processor="TestActionProcessor1">
-			<property name="param1" value="val1" />
-		</Action>
-	</Actions>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-10.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-10.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-10.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,8 +0,0 @@
-	<Actions>
-		<Action name="ActionA" processor="TestActionProcessor1">
-			<property name="param1" value="val1" />
-		</Action>
-
-		<ProcessorAliases>
-		</ProcessorAliases>
-	</Actions>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-11.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-11.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinition-Config-11.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,9 +0,0 @@
-	<Actions>
-		<Action name="ActionA" processor="TestActionProcessor1">
-			<property name="param1" value="val1" />
-		</Action>
-
-		<ProcessorAliases>
-			<Alias name="TestActionProcessor1" class="org.jboss.soa.esb.actions.TestActionProcessor1" />
-		</ProcessorAliases>
-	</Actions>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinitionFactoryUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinitionFactoryUnitTest.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/ActionDefinitionFactoryUnitTest.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,90 +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;
-
-import java.io.IOException;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.xml.sax.SAXException;
-
-/**
- * Unit tests for the ActionDefinitionFactory class.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ActionDefinitionFactoryUnitTest extends TestCase {
-
-    public void test_good_config() throws SAXException, IOException, ConfigurationException {
-        ConfigTree config = ConfigTree.fromInputStream(getClass().getResourceAsStream("ActionDefinition-Config-01.xml"));
-        ActionDefinitionFactory factory = new ActionDefinitionFactory(config);
-
-        // ActionProcessor Impl with a non-default public constructor 
-        ActionDefinition actionDef = factory.getInstance("ActionA");
-        assertEquals("ActionA", actionDef.getName());
-        List<KeyValuePair> properties = actionDef.getProperties();
-        assertEquals(3, properties.size());
-        TestActionProcessor1 processor1 = (TestActionProcessor1) actionDef.getProcessor();
-        assertEquals(actionDef.getName(), processor1.name);
-        assertEquals(properties, processor1.properties);
-        
-        actionDef = factory.getInstance("ActionB");
-        assertEquals("ActionB", actionDef.getName());
-        properties = actionDef.getProperties();
-        assertEquals(1, properties.size());
-        processor1 = (TestActionProcessor1) actionDef.getProcessor();
-        assertEquals(actionDef.getName(), processor1.name);
-        assertEquals(properties, processor1.properties);
-
-        // ActionProcessor Impl with a non-default public constructor 
-        actionDef = factory.getInstance("ActionC");
-        assertEquals("ActionC", actionDef.getName());
-        //TestActionProcessor2 processor2 = (TestActionProcessor2) actionDef.getProcessor();
-    }
-
-    public void test_bad_config() throws SAXException, IOException, ConfigurationException {
-        test_bad_config("ActionDefinition-Config-02.xml", "Actions/Action has no 'name' defined.");
-        test_bad_config("ActionDefinition-Config-03.xml", "Actions/Action [ActionA] has no 'processor' defined.");
-        test_bad_config("ActionDefinition-Config-04.xml", "Actions/Action/property has no 'name' defined. Action [ActionA]");
-        test_bad_config("ActionDefinition-Config-05.xml", "Actions/Action/property has no 'value' defined. Action [ActionA]");
-        test_bad_config("ActionDefinition-Config-06.xml", "No action processor class defined for processor alias");
-        test_bad_config("ActionDefinition-Config-07.xml", "Actions/ProcessorAliases/Alias has no 'name' defined");
-        test_bad_config("ActionDefinition-Config-08.xml", "No 'Actions/Action' configurations");
-        test_bad_config("ActionDefinition-Config-09.xml", "No 'Actions/ProcessorAliases' configuration");
-        test_bad_config("ActionDefinition-Config-10.xml", "No action processor classes defined");
-    }
-    
-    private void test_bad_config(String configName, String exceptionMsg) throws SAXException, IOException, ConfigurationException {
-        ConfigTree config = ConfigTree.fromInputStream(getClass().getResourceAsStream(configName));
-        try {
-            new ActionDefinitionFactory(config);
-            fail("Expected ConfigurationException");
-        } catch(ConfigurationException e) {
-            assertTrue("Expected config exception statrting with [" + exceptionMsg + "].  Instead, go [" + e.getMessage() + "]", e.getMessage().startsWith(exceptionMsg));
-        }
-    }
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor1.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor1.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor1.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,55 +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;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-
-public class TestActionProcessor1 extends BaseTestActionProcessor {
-    
-	private static Logger logger = Logger.getLogger(TestActionProcessor1.class);
-    public String name;
-    public List<KeyValuePair> properties;
-
-	public TestActionProcessor1(String name, List<KeyValuePair> properties) {
-        this.name = name;
-        this.properties = properties;
-	}
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#processAction(java.lang.Object)
-     */
-    public Message process(Message message) throws ActionProcessingException {
-    	logger.info("Processing action [" + name + "]: " + ActionUtils.getTaskObject(message));
-        return super.process(message);
-    }
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor2.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor2.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor2.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,45 +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;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-
-public class TestActionProcessor2 extends BaseTestActionProcessor {
-
-	private static Logger logger = Logger.getLogger(TestActionProcessor2.class);
-	
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#processAction(java.lang.Object)
-     */
-    public Message process(Message message) throws ActionProcessingException {
-    	logger.info("Processing action: " + ActionUtils.getTaskObject(message));
-        return super.process(message);
-    }
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor3.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor3.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/TestActionProcessor3.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,45 +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;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-
-public class TestActionProcessor3 extends BaseTestActionProcessor {
-
-	public TestActionProcessor3(String name) {
-		System.out.println("Instantiate action handler: " + name);
-	}
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#processAction(java.lang.Object)
-     */
-    public Message process(Message message) throws ActionProcessingException {
-        System.out.println("processAction: " + ActionUtils.getTaskObject(message));
-        return super.process(message);
-    }
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/FileToByteArrayUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/FileToByteArrayUnitTest.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/FileToByteArrayUnitTest.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,66 +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.converters;
-
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.actions.ActionProcessingException;
-
-/**
- * FileToByteArray unit tests.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class FileToByteArrayUnitTest extends TestCase {
-
-    private File testFile = null;
-    private String FILE_CONTENTS = "this is the file contents!";
-    
-    @Override
-    protected void setUp() throws Exception {
-        testFile = new File("FileToByteArrayUnitTest.tst");
-
-        FileWriter fileWriter = new FileWriter(testFile);
-
-        fileWriter.write(FILE_CONTENTS);
-        fileWriter.flush();
-        fileWriter.close();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        testFile.delete();
-    }
-
-    public void test() throws IOException, ActionProcessingException {
-        FileToByteArray fileToByteArray = new FileToByteArray();
-        byte[] fileContent = (byte[])fileToByteArray.process(testFile);
-        
-        assertEquals(FILE_CONTENTS, new String(fileContent));
-    }
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/ObjectToFileWriterUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/ObjectToFileWriterUnitTest.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/actions/converters/ObjectToFileWriterUnitTest.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,112 +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.converters;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.actions.routing.ObjectToFileWriter;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-/**
- * Unit tests for ObjectToFileWriter.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ObjectToFileWriterUnitTest extends TestCase {
-
-    private static final String A_STRING = "write something to file";
-    private File file = new File("./ObjectToFileWriter.tst");
-    private List<KeyValuePair> properties;
-
-    @Override
-    protected void setUp() throws Exception {
-        properties = new ArrayList<KeyValuePair>();
-    }
-
-    @Override
-    protected void tearDown() throws Exception {
-        file.delete();
-    }
-
-    public void test_writeWithNoAppend() throws ConfigurationException, ActionProcessingException {
-        properties.add(new KeyValuePair("file", file.getPath()));
-
-        // Write something fo file and check it was written..
-        writeAndCheck(A_STRING, A_STRING);
-        // And do it all again to make sure the contents are not appended i.e. the file is overwritten...
-        writeAndCheck(A_STRING, A_STRING);
-    }
-
-    public void test_writeWithBytes() throws ConfigurationException, ActionProcessingException, UnsupportedEncodingException {
-        properties.add(new KeyValuePair("file", file.getPath()));
-
-        // Write bytes to the file...
-        writeAndCheck(A_STRING.getBytes("UTF-8"), A_STRING);
-    }
-
-    public void test_writeWithAppend() throws ConfigurationException, ActionProcessingException {
-        properties.add(new KeyValuePair("file", file.getPath()));
-        properties.add(new KeyValuePair("append", "true"));
-
-        //On windows the file does not get deleted sometimes. Let's clean it out
-        //in that case.
-        try { new FileOutputStream(file).close();}
-        catch (IOException e) { }
-
-        // Write something to file and check it was written..
-        writeAndCheck(A_STRING, A_STRING);
-        // And do it all again to make sure the contents are appended i.e. the file is not overwritten...
-        writeAndCheck(A_STRING, A_STRING + A_STRING);
-    }
-
-
-    private void writeAndCheck(Object objectToWrite, String expected) throws ConfigurationException, ActionProcessingException {
-        // Use the ObjectToFileWriter to write something to file...
-        ObjectToFileWriter fileWriter = new ObjectToFileWriter("ObjectToFileWriter-Test", properties);
-        Message oMsg = MessageFactory.getInstance().getMessage();
-        ActionUtils.setTaskObject(oMsg,objectToWrite);
-        fileWriter.process(oMsg);
-
-        // Use the FileToByteArray processor to read the file contents back...
-        oMsg = MessageFactory.getInstance().getMessage();
-        ActionUtils.setTaskObject(oMsg,file);
-        new FileToByteArray().process(oMsg);
-        byte[] fileContent = (byte[])ActionUtils.getTaskObject(oMsg);
-
-        // Make sure the contents are as expected...
-        String fileContentString = new String(fileContent);
-        assertEquals(expected, fileContentString);
-    }
-}

Modified: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -39,7 +39,6 @@
 import org.jboss.soa.esb.common.tests.BaseTest;
 import org.jboss.soa.esb.helpers.ConfigTree;
 import org.jboss.soa.esb.listeners.ListenerManager;
-import org.jboss.soa.esb.listeners.message.EsbListenerController;
 import org.jboss.soa.esb.message.Message;
 import org.jboss.soa.esb.testutils.FileUtil;
 import org.jboss.soa.esb.testutils.HsqldbUtil;
@@ -176,8 +175,6 @@
 
 	static File _returnFile = new File(TMP_DIR, "ListenerManagerOutput.txt");
 
-	EsbListenerController _esbListController;
-
 	ListenerManager _manager;
 
 	private static String mDbDriver;

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerUnitTest.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerUnitTest.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/EsbListenerControllerUnitTest.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,59 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated 
- * by the @authors tag. All rights reserved. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.listeners.message;
-
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-/**
- * EsbListenerController unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class EsbListenerControllerUnitTest extends TestCase {
-
-	/* (non-Javadoc)
-	 * @see junit.framework.TestCase#setUp()
-	 */
-	@Override
-	protected void setUp() throws Exception {
-		MockRegistry.install();
-	}
-
-	/* (non-Javadoc)
-	 * @see junit.framework.TestCase#tearDown()
-	 */
-	@Override
-	protected void tearDown() throws Exception {
-		MockRegistry.uninstall();
-	}
-	
-	public void test() throws Exception {
-		ConfigTree listenerConfig = ConfigTree.fromInputStream(getClass().getResourceAsStream("ListenerConfig_01.xml"));
-		
-		// Get the controller instance - the 4 listeners should be started.
-		EsbListenerControllerFactory.getInstance(listenerConfig);
-		assertEquals(3, MockListener.startedListeners.size());
-		
-	}
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/ListenerConfig_01.xml
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/ListenerConfig_01.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/ListenerConfig_01.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,37 +0,0 @@
-<ListenerConfig>
-
-	<MockListener
-		service-category="Category1"
-		service-name="Service1"
-		service-description="Blah"
-		listenerClass="org.jboss.soa.esb.listeners.message.MockListener"
-		wait="1000"
-	>
-	</MockListener>
-	<MockListener
-		service-category="Category1"
-		service-name="Service2"
-		service-description="Blah"
-		listenerClass="org.jboss.soa.esb.listeners.message.MockListener"
-		wait="2000"
-	>
-	</MockListener>
-	<MockListener
-		service-category="Category2"
-		service-name="Service1"
-		service-description="Blah"
-		listenerClass="org.jboss.soa.esb.listeners.message.MockListener"
-		throw-exception="true"
-	>
-	</MockListener>
-	<MockListener
-		service-category="Category2"
-		service-name="Service2"
-		service-description="Blah"
-		listenerClass="org.jboss.soa.esb.listeners.message.MockListener"
-		wait="1000"
-		lock="true"
-	>
-	</MockListener>
-   
-</ListenerConfig>

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/MockListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/MockListener.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/listeners/message/MockListener.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated 
- * by the @authors tag. All rights reserved. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.listeners.message;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.listeners.State;
-
-/**
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MockListener extends AbstractListener {
-
-	public static List<MockListener> startedListeners = new ArrayList<MockListener>();
-	private List<KeyValuePair> properties;
-	
-	/**
-	 * @param controller
-	 * @param configTree
-	 */
-	public MockListener(EsbListenerController controller, ConfigTree configTree) {
-		super(controller, configTree);
-		properties = configTree.attributesAsList();
-	}
-
-	public void listen() {
-		if(KeyValuePair.getBooleanValue("throw-exception", properties, false)) {
-			throw new RuntimeException("Exception from MockListener.");
-		}
-		
-		long wait = (long)KeyValuePair.getDoubleValue("wait", properties, 1000);
-		try {
-			Thread.sleep(wait);
-		} catch (InterruptedException e) {
-			TestCase.fail(e.getMessage());
-		}
-		
-		startedListeners.add(this);
-		setState(State.Ready);
-	}
-
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/AbstractMockListner.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/AbstractMockListner.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/AbstractMockListner.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,85 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated 
- * by the @authors tag. All rights reserved. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.util;
-
-import java.util.List;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-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.listeners.old.AbstractListener;
-import org.jboss.soa.esb.listeners.old.GpListener;
-
-/**
- * Abstract Mock Listener implementation.
- * <p/>
- * Leaves you to implement the receive method in whatever way suits.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class AbstractMockListner extends AbstractListener {
-
-	private static Logger logger = Logger.getLogger(AbstractMockListner.class);
-	public List<MessageInError> messagesInError = new Vector<MessageInError>();
-	public List<Object> messagesCompleted = new Vector<Object>();
-	
-	public AbstractMockListner(GpListener p_oDad, ConfigTree p_oParms, ActionDefinitionFactory actionDefinitionFactory) throws Exception {
-		super(p_oDad, p_oParms, actionDefinitionFactory);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.jboss.soa.esb.listeners.AbstractListener#processingError(java.lang.Object, org.jboss.soa.esb.actions.ActionProcessor, java.lang.Throwable)
-	 */
-	@Override
-	protected void processingError(Object initialMsg, ActionProcessor processor, Throwable error) {
-		logger.info("Received 'processingError' event. Message [" + initialMsg + "], ActionProcessor [" + processor + "], Throwable [" + error + "]", error);
-		messagesInError.add(new MessageInError(initialMsg, processor, error));
-	}
-
-	/* (non-Javadoc)
-	 * @see org.jboss.soa.esb.listeners.AbstractListener#processingComplete(java.lang.Object)
-	 */
-	@Override
-	protected void processingComplete(Object initialMsg) {
-		logger.info("Received 'processingComplete' event. Message [" + initialMsg + "]");
-		messagesCompleted.add(initialMsg);
-	}
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.listeners.AbstractListener#close()
-     */
-    @Override
-    protected void close() {
-    }
-
-	public class MessageInError {
-		public Object initialMsg; 
-		public ActionProcessor processor; 
-		public Throwable error;
-		public MessageInError(Object initialMsg, ActionProcessor processor, Throwable error) {
-			this.initialMsg = initialMsg;
-			this.processor = processor;
-			this.error = error;
-		}
-	}
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/ListenersManagerExecThread.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/ListenersManagerExecThread.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/ListenersManagerExecThread.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,90 +0,0 @@
-package org.jboss.soa.esb.util;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.listeners.old.GpListener;
-
-public class ListenersManagerExecThread extends Thread {
-	
-	private static Logger logger = Logger.getLogger(ListenersManagerExecThread.class);
-	private GpListener listenersManager;
-
-	public ListenersManagerExecThread(GpListener listenersManager) {
-		super(listenersManager);
-		this.listenersManager = listenersManager;
-	}
-
-	@Override
-	public synchronized void start() {
-		logger.info("Waiting on Listener Manager the start...");
-		super.start();
-		while(listenersManager.getState() != GpListener.State.Running) {
-			try {
-				sleep(50);
-			} catch (InterruptedException e) {
-				throw new IllegalStateException("Unexpected Thread Interrupt exception.", e);
-			}
-			if(listenersManager.getState() == GpListener.State.Exception_thrown) {
-				Exception e = listenersManager.getState().getException();
-				logger.error("Failed to start the Listener Manager!", e);
-				TestCase.fail(e.getMessage());
-			}
-		}
-		logger.info("Listener Manager running (Thread: " + getName() + ")!  Note this does not mean all the Listeners are up and running!");
-	}
-
-
-	/**
-	 * Get the {@link GpListener} Listeners Manager class executing in this thread.
-	 * @return The listenersManager property value.
-	 */
-	public GpListener getListenersManager() {
-		return listenersManager;
-	}
-
-	/**
-	 * Assert that the listener Manager is in an Exception state..
-	 */
-	public void asserttInException() {
-		if(listenersManager.getState() != GpListener.State.Exception_thrown) {
-			String errorMsg = "GpListener not in Exception state.  Listener Manager Thread: " + this.getName();
-			logger.error(errorMsg);
-			TestCase.fail(errorMsg);
-		}
-	}
-
-	/**
-	 * Assert that the listener Manager is not in an Exception state..
-	 */
-	public void assertNotInException() {
-		if(listenersManager.getState() == GpListener.State.Exception_thrown) {
-			String errorMsg = "GpListener in Exception state.  See log.  Listener Manager Thread: " + this.getName();
-			logger.error(errorMsg, listenersManager.getState().getException());
-			TestCase.fail(errorMsg);
-		}
-	}
-
-	/**
-	 * Assert that the listener Manager has shutdown.
-	 * @param maxWait The maximum length of time (ms) to wait for shutdown before failing the test.
-	 */
-	public void assertShutdownOK(long maxWait) {
-		long endTime = System.currentTimeMillis() + maxWait;
-		
-		while(System.currentTimeMillis() < endTime) {
-			if(listenersManager.getState() == GpListener.State.Done_OK) {
-				logger.info("Shutdown was successful.  Listener Manager Thread: " + this.getName());
-				return;
-			}
-			try {
-				Thread.sleep(100);
-			} catch (InterruptedException e) {
-				logger.error("Thread interupt...", e);
-			}
-		}
-		String errorMsg = "GpListener failed to shutdown as requested.  Waited for " + maxWait + "ms.  Listener Manager Thread: " + this.getName();
-		logger.error(errorMsg);
-		TestCase.fail(errorMsg);
-	}
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNonblockingListener.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNonblockingListener.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockNonblockingListener.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,52 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and others contributors as indicated 
- * by the @authors tag. All rights reserved. 
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors. 
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A 
- * 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,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
- * MA  02110-1301, USA.
- * 
- * (C) 2005-2006,
- * @author JBoss Inc.
- */
-
-package org.jboss.soa.esb.util;
-
-import org.jboss.soa.esb.actions.ActionDefinitionFactory;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.old.GpListener;
-
-/**
- * Non blocking mock Listener implementation.
- * <p/>
- * "Real" listener implementations need to perform blocking receives.  This can make testing
- * a little awkward, especially where the listener is just one of thee test fixtures.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MockNonblockingListener extends AbstractMockListner {
-
-	public Object[] messages;
-	
-	public MockNonblockingListener(GpListener p_oDad, ConfigTree p_oParms,
-			ActionDefinitionFactory actionDefinitionFactory) throws Exception {
-		super(p_oDad, p_oParms, actionDefinitionFactory);
-	}
-
-	/* (non-Javadoc)
-	 * @see org.jboss.soa.esb.listeners.AbstractListener#receive()
-	 */
-	@Override
-	protected Object[] receive() {
-		return messages;
-	}
-
-}

Deleted: labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockPoller.java
===================================================================
--- labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockPoller.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/core/listeners/tests/src/org/jboss/soa/esb/util/MockPoller.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,107 +0,0 @@
-package org.jboss.soa.esb.util;
-
-import java.util.Arrays;
-import java.util.List;
-import java.util.Queue;
-import java.util.Vector;
-import java.util.concurrent.ConcurrentLinkedQueue;
-
-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.listeners.old.AbstractPoller;
-import org.jboss.soa.esb.listeners.old.GpListener;
-
-/**
- * Simple Mock {@link org.jboss.soa.esb.listeners.old.AbstractPoller} implementation that can be used for testing.
- * <p/>
- * Maintains a static in-memory queue into which objects can be dropped for processing by the configured action handler.
- * @author tfennelly
- */
-public class MockPoller extends AbstractPoller {
-
-	private static Queue<Object> queue = new ConcurrentLinkedQueue<Object>();
-	public List<MessageInError> messagesInError = new Vector<MessageInError>();
-	public List<Object> messagesCompleted = new Vector<Object>();
-	
-	public MockPoller(GpListener p_oDad, ConfigTree p_oParms, ActionDefinitionFactory actionDefinitionFactory) throws Exception {
-		super(p_oDad, p_oParms, actionDefinitionFactory);
-        m_iPollMillis = 250;
-	}
-	
-	/**
-	 * Add an object for processing by the configured action handler.
-     * <p/>
-     * Blocks indefinitely until the message is consumed.
-	 * @param actionObject The Object instance for processing.
-	 */
-	public static void addToQueue(Object actionObject) {
-		synchronized (queue) {
-			queue.add(actionObject);
-		}
-        while(!queue.isEmpty()) {
-            try {
-                Thread.sleep(100);
-            } catch (InterruptedException e) {
-                throw new IllegalStateException("Unexpected thread interupt.", e);
-            }
-        }
-	}
-	
-	public static void clearQueue() {
-		synchronized (queue) {
-			queue.clear();			
-		}
-	}
-
-	@Override
-	protected List<Object> pollForCandidates() {
-		// This method is called periodically by the AbstractPoller. 
-		synchronized (queue) {
-			List<Object> actionObjects = Arrays.asList(queue.toArray());
-			queue.clear();			
-			return actionObjects;
-		}
-	}
-
-	@Override
-	protected Object preProcess(Object actionObject) {
-		// Called by the AbstractPoller for each of the objects returned to it be the above pollForCandidates method.
-		// Just return the object to be processed by the action class that's configured on the listener.
-		return actionObject;
-	}
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.listeners.AbstractListener#close()
-     */
-    @Override
-    protected void close() {
-    }
-
-	/* (non-Javadoc)
-	 * @see org.jboss.soa.esb.listeners.AbstractListener#processingError(java.lang.Object, org.jboss.soa.esb.actions.ActionProcessor, java.lang.Throwable)
-	 */
-	@Override
-	protected void processingError(Object initialMsg, ActionProcessor processor, Throwable error) {
-		messagesInError.add(new MessageInError(initialMsg, processor, error));
-	}
-
-	/* (non-Javadoc)
-	 * @see org.jboss.soa.esb.listeners.AbstractListener#processingComplete(java.lang.Object)
-	 */
-	@Override
-	protected void processingComplete(Object initialMsg) {
-		messagesCompleted.add(initialMsg);
-	}
-
-	public class MessageInError {
-		public Object initialMsg; 
-		public ActionProcessor processor; 
-		public Throwable error;
-		public MessageInError(Object initialMsg, ActionProcessor processor, Throwable error) {
-			this.initialMsg = initialMsg;
-			this.processor = processor;
-			this.error = error;
-		}
-	}
-}

Modified: labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/README.txt
===================================================================
--- labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/README.txt	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/product/samples/quickstarts/transform_XML2XML_date_manipulation/README.txt	2007-01-09 16:14:42 UTC (rev 8774)
@@ -3,7 +3,7 @@
     This is another simple example of how to manually define and apply a Message Transformation
     within JBoss ESB 4.0GA.  
     
-    This Quickstart is an extension of the "transformation_simple" Quickstart, demonstrating how 
+    This Quickstart is an extension of the "transformation_XML2XML_simple" Quickstart, demonstrating how 
     JBoss ESB Transformations can simplify your XSLT transformations by combining the
     power of XSLT with Java.  In this Quickstart, we use Java to perform the ugly string manipulation
     on the SampleOrder date field (see OrderDate.java) and use XSLT for what it's good at i.e.

Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/HttpListenerConfig.xml
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/HttpListenerConfig.xml	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/HttpListenerConfig.xml	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,13 +0,0 @@
-<JBossESB parameterReloadSecs="60000"
-		commandConnFactoryClass="ConnectionFactory"
-	commandJndiType="jboss"
-	commandJndiURL="localhost"
-	commandIsTopic="false"
-	messageSelector="gpMsgSelector='HttpListener'"
-	commandJndiName="queue/A"
-	>
-
-	<HttpListenerTest listenerClass="org.jboss.soa.esb.listeners.message.HttpListener" maxThreads="10">
-		<action name="MessageBox" class="org.jboss.soa.esb.listeners.message.MessageBox" />
-	</HttpListenerTest>	
-</JBossESB>
\ No newline at end of file

Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/HttpListenerTest.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/HttpListenerTest.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/listeners/message/HttpListenerTest.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,91 +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.listeners.message;
-
-import junit.framework.TestCase;
-
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessageType;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-import org.jboss.soa.esb.util.ClassUtils;
-import org.jboss.soa.esb.util.JMSClientUtil;
-import org.jboss.soa.esb.util.NewListenerUtils;
-
-/**
- * QA Tests for the JmsQueueListener.
- *
- */
-public class HttpListenerTest extends TestCase  {
-
-    private NewListenerUtils.ListenersManagerTestWrapper listenersMgr;
-
-    protected void setUp() throws Exception {
-        // Start the listener...
-        listenersMgr = NewListenerUtils.startListeners(TestEnvironmentUtil.getUserDir("qa") + 
-        		"junit/src" + ClassUtils.toResourcePath(getClass().getPackage()) + "/HttpListenerConfig.xml");
-    }
-
-    public void test() throws Throwable {
-    	Thread.sleep(1000);
-        // There should have been no exceptions...
-        listenersMgr.assertNotInException();
-
-        MessageBox.messages.clear();
-        
-        // Check did the messagebox recevive the message from the JMSListener...
-        MessageBox.assertMessageCount(0, 10000);      
-        
-        String locatorURI = "http://localhost:5400";
-		InvokerLocator locator = new InvokerLocator(locatorURI);
-
-		Client remotingClient = new Client(locator);
-		remotingClient.connect();
-		
-		String payload = "Hello is anyone there?";
-		
-		// Message creation...
-		 Message msg = MessageFactory.getInstance().getMessage(
-		 MessageType.JAVA_SERIALIZED);
-		 ActionUtils.setTaskObject(msg,payload);
-
-		remotingClient.invoke(msg, null);		
-		
-		// Check did the messagebox recevive the message from the JMSListener...
-        MessageBox.assertMessageCount(1, 10000);         
-        
-        //Send a Shutdown message to the command queue...
-        JMSClientUtil.sendMessageToQueue("shutdown", JMSClientUtil.QUEUE.A, new KeyValuePair[] {new KeyValuePair("gpMsgSelector", "HttpListener")});
-        listenersMgr.assertShutdownOK(10000);
-        
-        // There should have been no exceptions...
-        listenersMgr.assertNotInException();
-
-    }
-
-    protected void tearDown() throws Exception {
-    }
-}

Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/ListenerUtils.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/ListenerUtils.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/ListenerUtils.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,197 +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.util;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.command.JmsCommandQueue;
-import org.jboss.internal.soa.esb.parameters.ParamFileRepository;
-import org.jboss.soa.esb.listeners.old.GpListener;
-import org.jboss.soa.esb.parameters.ParamRepositoryException;
-import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-
-/**
- * Listener utility methods.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class ListenerUtils {
-
-	private static final String CONFIG_TMP_EXT = ".conftmp";
-	private static Logger logger = Logger.getLogger(ListenerUtils.class);
-
-	/**
-	 * Start a list of Listeners based on the supplied configuration.
-	 * <p/>
-	 * Note the root of the file repos is the root of the junit/src folder.
-	 * @param paramName Config classpath.
-	 * @return Thread of execution for this Listener configs.
-	 */
-	public static ListenersManagerExecThread startListeners(String paramName) throws Exception {
-		ListenersManagerExecThread manager;
-		
-		manager = new ListenersManagerExecThread(createGpListener(paramName));
-		
-		logger.info("Waiting on Listener Manager the start...");
-		manager.start();
-		while(manager.listenersManager.getState() != GpListener.State.Running) {
-			Thread.sleep(50);
-			if(manager.listenersManager.getState() == GpListener.State.Exception_thrown) {
-				Exception e = manager.listenersManager.getState().getException();
-				logger.error("Failed to start the Listener Manager!", e);
-				TestCase.fail(e.getMessage());
-			}
-		}
-		logger.info("Listener Manager running (Thread: " + manager.getName() + ")!  Note this does not mean all the Listeners are up and running!");
-		
-		return manager;
-	}
-
-	/**
-	 * Create an instance of the {@link GpListener} and instruct it to read the specified configuration
-	 * from the ParamRepository.
-	 * <p/>
-	 * Note the root of the file repos is the root of the junit/src folder.
-	 * @param paramName Config classpath.
-	 * @return The {@link GpListener} instance.
-	 */
-	public static GpListener createGpListener(String paramName) throws Exception {		
-		paramName = fixUpConfig(paramName);
-		GpListener.setDefaultCommandQueue(new JmsCommandQueue());
-		return new GpListener(paramName);
-	}
-	
-	/**
-	 * Just performs a token replacement on "@qa.build@", "@db.*@" etc tokens in the Listener config and
-	 * creates a new repository entry for the Listener Manager to read from..
-	 * @param paramName Input config paramName.
-	 * @return The file handle for the new "fixed up" config.
-	 */
-	@SuppressWarnings("unused") //I take it this will be used in the near future?
-	private static String fixUpConfig(String paramName) throws ParamRepositoryException, IOException {
-		ParamFileRepository repos = (ParamFileRepository)ParamRepositoryFactory.getInstance();
-		File fixedupFile = null;
-		File paramFile = repos.toParamFile(paramName);
-		if ("qa/".equals(TestEnvironmentUtil.getUserDir("qa"))) {
-			paramName = System.getProperty("user.dir") + "/qa/junit/src" + paramName;
-			fixedupFile = new File(paramName + CONFIG_TMP_EXT);
-		} else {
-			fixedupFile = new File(paramFile.getAbsolutePath() + CONFIG_TMP_EXT);
-		}
-		String configXml = repos.get(paramName);
-		System.out.println("Path=" + paramFile.getAbsolutePath());
-		System.out.println("Path=" + paramFile.getAbsolutePath());
-		FileOutputStream fixedUpFileStream = new FileOutputStream(fixedupFile);
-		paramName+=CONFIG_TMP_EXT;
-		try {
-			// Replace all the "@qa.build@" tokens with the qa "build" dirs file URI, and write to file...
-			configXml = configXml.replaceAll("@qa.build@", FileUtils.getEnvBuildDir().toURI().toString());
-			// Replace all the "@db.*@" tokens with the settings from the deployment.properties...
-			configXml = configXml.replaceAll("@db.driver@", DbUtils.dbDriver);
-			configXml = configXml.replaceAll("@db.url@", DbUtils.dbUrl);
-			configXml = configXml.replaceAll("@db.user@", DbUtils.dbUser);
-			configXml = configXml.replaceAll("@db.password@", DbUtils.dbPassword);
-			configXml = configXml.replaceAll("@tmp.dir@", System.getProperty("java.io.tmpdir","/tmp"));
-
-			// Write the fixed up config ro a new file - this new file will be used as the listener config!
-			fixedUpFileStream.write(configXml.getBytes());
-		} finally {
-			fixedUpFileStream.flush();
-			fixedUpFileStream.close();
-		}		
-		
-		return paramName;
-	}
-	
-
-	/**
-	 * Execution thread for the Listener Manager. 
-	 * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
-	 */
-	public static class ListenersManagerExecThread extends Thread {
-		
-		private GpListener listenersManager;
-
-		private ListenersManagerExecThread(GpListener listenersManager) {
-			super(listenersManager);
-			this.listenersManager = listenersManager;
-		}
-
-		/**
-		 * Get the {@link GpListener} Listeners Manager class executing in this thread.
-		 * @return The listenersManager property value.
-		 */
-		public GpListener getListenersManager() {
-			return listenersManager;
-		}
-
-		/**
-		 * Assert that the listener Manager is in an Exception state..
-		 */
-		public void asserttInException() {
-			if(listenersManager.getState() != GpListener.State.Exception_thrown) {
-				String errorMsg = "ListenerManager not in Exception state.  Listener Manager Thread: " + this.getName();
-				logger.error(errorMsg);
-				TestCase.fail(errorMsg);
-			}
-		}
-
-		/**
-		 * Assert that the listener Manager is not in an Exception state..
-		 */
-		public void assertNotInException() {
-			if(listenersManager.getState() == GpListener.State.Exception_thrown) {
-				String errorMsg = "ListenerManager in Exception state.  See log.  Listener Manager Thread: " + this.getName();
-				logger.error(errorMsg, listenersManager.getState().getException());
-				TestCase.fail(errorMsg);
-			}
-		}
-
-		/**
-		 * Assert that the listener Manager has shutdown.
-		 * @param maxWait The maximum length of time (ms) to wait for shutdown before failing the test.
-		 */
-		public void assertShutdownOK(long maxWait) {
-			long endTime = System.currentTimeMillis() + maxWait;
-			
-			while(System.currentTimeMillis() < endTime) {
-				if(listenersManager.getState() == GpListener.State.Done_OK) {
-					logger.info("Shutdown was successful.  Listener Manager Thread: " + this.getName());
-					return;
-				}
-				try {
-					Thread.sleep(100);
-				} catch (InterruptedException e) {
-					logger.error("Thread interupt...", e);
-				}
-			}
-			String errorMsg = "ListenerManager failed to shutdown as requested.  Waited for " + maxWait + "ms.  Listener Manager Thread: " + this.getName();
-			logger.error(errorMsg);
-			TestCase.fail(errorMsg);
-		}
-	}
-}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/NewListenerUtils.java
===================================================================
--- labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/NewListenerUtils.java	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/qa/junit/src/org/jboss/soa/esb/util/NewListenerUtils.java	2007-01-09 16:14:42 UTC (rev 8774)
@@ -1,177 +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.util;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.command.JmsCommandQueue;
-import org.jboss.internal.soa.esb.parameters.ParamFileRepository;
-import org.jboss.soa.esb.listeners.State;
-import org.jboss.soa.esb.listeners.message.EsbListenerController;
-import org.jboss.soa.esb.listeners.message.EsbListenerControllerFactory;
-import org.jboss.soa.esb.listeners.message.EsbListenerControllerFactory.EsbListenerControllerImpl;
-import org.jboss.soa.esb.parameters.ParamRepositoryException;
-import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
-
-/**
- * Listener utility methods.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class NewListenerUtils {
-
-	private static final String CONFIG_TMP_EXT = ".conftmp";
-	private static Logger logger = Logger.getLogger(NewListenerUtils.class);
-
-	/**
-	 * Start a list of Listeners based on the supplied configuration.
-	 * <p/>
-	 * Note the root of the file repos is the root of the junit/src folder.
-	 * @param paramName Config classpath.
-	 * @return Thread of execution for this Listener configs.
-	 */
-	public static ListenersManagerTestWrapper startListeners(String paramName) throws Exception {
-		EsbListenerController controller;
-		
-		controller = createEsbListenerController(paramName);
-		
-		logger.info("Waiting on Listener Controller the start...");
-		State.waitUntilReady(controller);
-		logger.info("Listener Controller running and ready to receive messages!");
-		
-		return new ListenersManagerTestWrapper(controller);
-	}
-
-	/**
-	 * Create an instance of the {@link EsbListenerController} and instruct it to read the specified configuration
-	 * from the ParamRepository.
-	 * <p/>
-	 * Note the root of the file repos is the root of the junit/src folder.
-	 * @param paramName Config classpath.
-	 * @return The {@link EsbListenerController} instance.
-	 */
-	public static EsbListenerController createEsbListenerController(String paramName) throws Exception {		
-		//fixUpConfig(paramName);
-		EsbListenerControllerImpl.setDefaultCommandQueue(new JmsCommandQueue());
-		return EsbListenerControllerFactory.getInstance(paramName);
-	}
-	
-	/**
-	 * Just performs a token replacement on "@qa.build@", "@db.*@" etc tokens in the Listener config and
-	 * creates a new repository entry for the Listener Manager to read from..
-	 * @param paramName Input config paramName.
-	 * @return The file handle for the new "fixed up" config.
-	 */
-	@SuppressWarnings("unused") //I take it this will be used in the near future?
-	private static File fixUpConfig(String paramName) throws ParamRepositoryException, IOException {
-		ParamFileRepository repos = (ParamFileRepository)ParamRepositoryFactory.getInstance();
-		String configXml = repos.get(paramName);
-		File paramFile = repos.toParamFile(paramName);
-		File fixedupFile = new File(paramFile.getAbsolutePath() + CONFIG_TMP_EXT);
-		FileOutputStream fixedUpFileStream = new FileOutputStream(fixedupFile);
-		
-		try {
-			// Replace all the "@qa.build@" tokens with the qa "build" dirs file URI, and write to file...
-			configXml = configXml.replaceAll("@qa.build@", FileUtils.getEnvBuildDir().toURI().toString());
-			// Replace all the "@db.*@" tokens with the settings from the deployment.properties...
-			configXml = configXml.replaceAll("@db.driver@", DbUtils.dbDriver);
-			configXml = configXml.replaceAll("@db.url@", DbUtils.dbUrl);
-			configXml = configXml.replaceAll("@db.user@", DbUtils.dbUser);
-			configXml = configXml.replaceAll("@db.password@", DbUtils.dbPassword);
-
-			// Write the fixed up config ro a new file - this new file will be used as the listener config!
-			fixedUpFileStream.write(configXml.getBytes());
-		} finally {
-			fixedUpFileStream.flush();
-			fixedUpFileStream.close();
-		}		
-		
-		return fixedupFile;
-	}
-	
-
-	public static class ListenersManagerTestWrapper {
-		
-		private EsbListenerController listenersManager;
-
-		private ListenersManagerTestWrapper(EsbListenerController listenersManager) {
-			this.listenersManager = listenersManager;
-		}
-
-		/**
-		 * Get the {@link EsbListenerController} Listeners Manager class executing in this thread.
-		 * @return The listenersManager property value.
-		 */
-		public EsbListenerController getListenersManager() {
-			return listenersManager;
-		}
-
-		/**
-		 * Assert that the listener Manager is in an Exception state..
-		 */
-		public void asserttInException() {
-			if(listenersManager.getState() != State.Exception_thrown) {
-				String errorMsg = "ListenerManager not in Exception state.  Listener Manager Thread: " + listenersManager;
-				logger.error(errorMsg);
-				TestCase.fail(errorMsg);
-			}
-		}
-
-		/**
-		 * Assert that the listener Manager is not in an Exception state..
-		 */
-		public void assertNotInException() {
-			if(listenersManager.getState() == State.Exception_thrown) {
-				String errorMsg = "ListenerManager in Exception state.  See log.  Listener Manager Thread: " + listenersManager;
-				logger.error(errorMsg, listenersManager.getState().getThrowable());
-				TestCase.fail(errorMsg);
-			}
-		}
-
-		/**
-		 * Assert that the listener Manager has shutdown.
-		 * @param maxWait The maximum length of time (ms) to wait for shutdown before failing the test.
-		 */
-		public void assertShutdownOK(long maxWait) {
-			long endTime = System.currentTimeMillis() + maxWait;
-			
-			while(System.currentTimeMillis() < endTime) {
-				if(listenersManager.getState() == State.Done_OK) {
-					logger.info("Shutdown was successful.  Listener Manager Thread: " + listenersManager);
-					return;
-				}
-				try {
-					Thread.sleep(100);
-				} catch (InterruptedException e) {
-					logger.error("Thread interupt...", e);
-				}
-			}
-			String errorMsg = "ListenerManager failed to shutdown as requested.  Waited for " + maxWait + "ms.  Listener Manager Thread: " + listenersManager;
-			logger.error(errorMsg);
-			TestCase.fail(errorMsg);
-		}
-	}
-}
\ No newline at end of file

Modified: labs/jbossesb/trunk/qa/test.properties
===================================================================
--- labs/jbossesb/trunk/qa/test.properties	2007-01-09 15:41:53 UTC (rev 8773)
+++ labs/jbossesb/trunk/qa/test.properties	2007-01-09 16:14:42 UTC (rev 8774)
@@ -5,4 +5,6 @@
 ###################################################################################################
 
 org.jboss.soa.esb.jndi.server.type=jboss
-org.jboss.soa.esb.jndi.server.url=localhost
\ No newline at end of file
+org.jboss.soa.esb.jndi.server.url=localhost
+
+# tests.exclude=**/CbrProxy*Test.java
\ No newline at end of file




More information about the jboss-svn-commits mailing list