[jboss-svn-commits] JBL Code SVN: r12753 - in labs/jbossesb/trunk: IDE/JBossIDE and 143 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu Jun 21 17:23:32 EDT 2007


Author: beve
Date: 2007-06-21 17:23:20 -0400 (Thu, 21 Jun 2007)
New Revision: 12753

Added:
   labs/jbossesb/trunk/IDE/JBossIDE/product/
   labs/jbossesb/trunk/IDE/JBossIDE/product/.classpath
   labs/jbossesb/trunk/IDE/JBossIDE/product/.project
   labs/jbossesb/trunk/product/rosetta/
   labs/jbossesb/trunk/product/rosetta/ant.bat
   labs/jbossesb/trunk/product/rosetta/build.xml
   labs/jbossesb/trunk/product/rosetta/src/
   labs/jbossesb/trunk/product/rosetta/src/org/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueue.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueueException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/InMemoryCommandQueue.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/DeliverOnlyCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/PickUpOnlyCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandler.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandlerFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FtpFileHandler.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/LocalFileHandler.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIServiceMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/DefaultMessageURIGenerator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/JcrMessageURIGenerator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification/MacroExpander.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager/ConnectionManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ActionContractPublisher.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractInfo.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractPublisher.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publish.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publisher.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/ConnectionException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/MockRegistryImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap/OGNLUtils.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty/Base64.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpUtils.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/StreamUtils.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/BaseException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ConfigurationException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/FatalError.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/MarshalException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ProtocolNotSupportedException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/SendFailedException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/UnmarshalException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionLifecycle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionPipelineProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycleException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionPipelineProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingFaultException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionUtils.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BeanConfiguredAction.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BusinessRulesProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedWiretap.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/MessageFilter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/SystemPrintln.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/AbstractObjectXStream.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ByteArrayToString.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectInvoke.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToCSVString.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToXStream.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/XStreamToObject.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/FileNameGeneratorAction.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AbstractFileNamingStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AddTimestampNamingStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/ChangeSuffixNamingStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/FileNamingStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/GroovyNamingStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/EchoRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockAction.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockComposer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/MalformedEPRException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFileReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFtpReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultSftpReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/TagNames.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/Courier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierCollection.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTimeoutException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/TwoWayCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/FilterManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/InputOutputFilter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/dom/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/Email.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/KeyValuePair.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SimpleDataSource.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlDbTable.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlField.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleIdentity.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/LifecycleUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerInitializationException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/StandAloneBootStrapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/State.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FsListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/GroovyListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JcaGatewayMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/NotificationMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/UntypedListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerServiceMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GroovyGateway.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategyException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCache.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts/MessageInjectionConsole.groovy
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JmsEndpoint.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractManagedLifecycle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractThreadedManagedLifecycle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleEventListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleStateEvent.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadEventListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadState.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadStateEvent.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/AbstractMessageComposer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionBeanConfigurator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BasicMessageComposer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanConfigActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageComposer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliverException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionLifecycleProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionPipelineProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/UncomposedMessageDeliveryAdapter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors/Factory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Attachment.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Context.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Fault.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Header.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Message.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Properties.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessagePlugin.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageType.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties/MessagePropertyFacade.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/MessageURIGenerator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/URIGenerationException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockAction.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyQueues.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyTopics.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepository.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/J2eeConnectionManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/StandaloneConnectionManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/Encryption.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/EncryptionFailedException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/NotificationManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStore.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStoreException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/Registry.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouterException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/CBRException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/BeanConfigurator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocatorSorter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/
   labs/jbossesb/trunk/product/rosetta/tests/build.xml
   labs/jbossesb/trunk/product/rosetta/tests/resources/
   labs/jbossesb/trunk/product/rosetta/tests/resources/device-profile.xml
   labs/jbossesb/trunk/product/rosetta/tests/resources/etc/
   labs/jbossesb/trunk/product/rosetta/tests/resources/etc/jbossesb-test-properties.xml
   labs/jbossesb/trunk/product/rosetta/tests/resources/etc/log4j.xml
   labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.properties
   labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.script
   labs/jbossesb/trunk/product/rosetta/tests/src/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourier.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourierFactory.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FtpFileHandlerIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/ContractInfoUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/OGNLUtilsUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/ognl-test-01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/EdtFtpImplUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddableException.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddedServer.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/EmbeddedFtpServer.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/FtpTestUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/NoConfigFileFtpServer.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/StreamUtils.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/W3CDomUtils.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/MockPojoAction.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/NotificationList_01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/TestBean.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ByteArrayToStringUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/LongToDateConverter.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectInvokeTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToCSVStringUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToXStreamUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/StringToLongConverter.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/XStreamToObjectUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/EchoRouterUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/HttpRouterUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/test.groovy
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates/MockActionUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFileReplyToEprUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFtpReplyToEprIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/EmailUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/FTPUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/HTTPUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JDBCUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRManagerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/MockDataSource.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/ConfigTreeUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/EmailUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/KeyValuePairUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_02.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_03.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile1.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile2.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile3.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile4.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/LifecycleUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerConfigUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFTPIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StandAloneBootStrapperUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StateUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockContractPublisher.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MyPublishedAction.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapperTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_readonly.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerBaseTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JMSGatewayListenerIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/juddi-unittest.properties
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/testgateway.groovy
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/juddi-unittest.properties
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/EsbLifecycleListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/config-01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFile.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFtp.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJdbc.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ErrorActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapterUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionInfo.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessor.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessorFailure.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessor.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorConstructorFailure.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorFailure.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessorFailure.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/NPEActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/MessageMapperTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/TestPojo.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ExampleObject.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/MessageUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest_expected1.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest_testfile1.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTableUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTable_testfile1.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget2.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/TestParamRepo.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/DummyUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/RegistryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/juddi-unittest.properties
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/HsqldbUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StdOut2Log4jFilter.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StringUtils.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/jboss-esb.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/ClassUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/StreamUtilsUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/UtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java
Removed:
   labs/jbossesb/trunk/IDE/JBossIDE/core_src_plus_tests.classpath
   labs/jbossesb/trunk/IDE/JBossIDE/product/.classpath
   labs/jbossesb/trunk/IDE/JBossIDE/product/.project
   labs/jbossesb/trunk/product/core/
   labs/jbossesb/trunk/product/rosetta/ant.bat
   labs/jbossesb/trunk/product/rosetta/build.xml
   labs/jbossesb/trunk/product/rosetta/src/
   labs/jbossesb/trunk/product/rosetta/src/org/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueue.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueueException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/InMemoryCommandQueue.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/DeliverOnlyCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/PickUpOnlyCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandler.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandlerFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FtpFileHandler.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/LocalFileHandler.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIServiceMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/DefaultMessageURIGenerator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/JcrMessageURIGenerator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification/MacroExpander.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager/ConnectionManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ActionContractPublisher.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractInfo.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractPublisher.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publish.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publisher.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/ConnectionException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/MockRegistryImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap/OGNLUtils.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty/Base64.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpUtils.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/StreamUtils.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/BaseException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ConfigurationException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/FatalError.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/MarshalException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ProtocolNotSupportedException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/SendFailedException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/UnmarshalException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionLifecycle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionPipelineProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycleException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionPipelineProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingFaultException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionUtils.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BeanConfiguredAction.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BusinessRulesProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedWiretap.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/MessageFilter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/SystemPrintln.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/AbstractObjectXStream.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ByteArrayToString.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectInvoke.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToCSVString.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToXStream.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/XStreamToObject.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/FileNameGeneratorAction.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AbstractFileNamingStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AddTimestampNamingStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/ChangeSuffixNamingStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/FileNamingStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/GroovyNamingStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/EchoRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockAction.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockComposer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/MalformedEPRException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFileReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFtpReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultSftpReplyToEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/TagNames.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/Courier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierCollection.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTimeoutException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/TwoWayCourier.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/FilterManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/InputOutputFilter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/dom/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/Email.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/KeyValuePair.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SimpleDataSource.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlDbTable.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlField.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleIdentity.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/LifecycleUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerInitializationException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/StandAloneBootStrapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/State.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorImpl.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FsListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/GroovyListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JcaGatewayMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/NotificationMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/UntypedListenerMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerServiceMBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GroovyGateway.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategyException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCache.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts/MessageInjectionConsole.groovy
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JmsEndpoint.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractManagedLifecycle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractThreadedManagedLifecycle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleEventListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleStateEvent.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadEventListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadState.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadStateEvent.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/AbstractMessageComposer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionBeanConfigurator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BasicMessageComposer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanConfigActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageComposer.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliverException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionLifecycleProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionPipelineProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/UncomposedMessageDeliveryAdapter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors/Factory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Attachment.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Context.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Fault.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Header.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Message.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Properties.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessagePlugin.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageType.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties/MessagePropertyFacade.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/MessageURIGenerator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/URIGenerationException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockAction.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockListener.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyQueues.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyTopics.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepository.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/J2eeConnectionManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/StandaloneConnectionManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/Encryption.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/EncryptionFailedException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/NotificationManager.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStore.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStoreException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/Registry.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouterException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/CBRException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationService.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/BeanConfigurator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocator.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocatorSorter.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystem.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java
   labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/
   labs/jbossesb/trunk/product/rosetta/tests/build.xml
   labs/jbossesb/trunk/product/rosetta/tests/resources/
   labs/jbossesb/trunk/product/rosetta/tests/resources/device-profile.xml
   labs/jbossesb/trunk/product/rosetta/tests/resources/etc/
   labs/jbossesb/trunk/product/rosetta/tests/resources/etc/jbossesb-test-properties.xml
   labs/jbossesb/trunk/product/rosetta/tests/resources/etc/log4j.xml
   labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.properties
   labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.script
   labs/jbossesb/trunk/product/rosetta/tests/src/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourier.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourierFactory.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FtpFileHandlerIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/ContractInfoUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/OGNLUtilsUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/ognl-test-01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/EdtFtpImplUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddableException.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddedServer.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/EmbeddedFtpServer.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/FtpTestUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/NoConfigFileFtpServer.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/StreamUtils.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/W3CDomUtils.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/MockPojoAction.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/NotificationList_01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/TestBean.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ByteArrayToStringUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/LongToDateConverter.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectInvokeTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToCSVStringUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToXStreamUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/StringToLongConverter.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/XStreamToObjectUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/EchoRouterUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/HttpRouterUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/test.groovy
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates/MockActionUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFileReplyToEprUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFtpReplyToEprIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/EmailUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/FTPUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/HTTPUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JDBCUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRManagerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/MockDataSource.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/ConfigTreeUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/EmailUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/KeyValuePairUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_02.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_03.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile1.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile2.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile3.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile4.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/LifecycleUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerConfigUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFTPIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StandAloneBootStrapperUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StateUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockContractPublisher.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MyPublishedAction.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapperTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_readonly.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerBaseTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JMSGatewayListenerIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/juddi-unittest.properties
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/testgateway.groovy
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/juddi-unittest.properties
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/EsbLifecycleListenerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/config-01.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFile.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFtp.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJdbc.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ErrorActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapterUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionInfo.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessor.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessorFailure.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessor.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorConstructorFailure.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorFailure.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessorFailure.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/NPEActionProcessor.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/MessageMapperTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/TestPojo.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ExampleObject.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/MessageUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest_expected1.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest_testfile1.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTableUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTable_testfile1.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget2.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/TestParamRepo.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/DummyUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/RegistryUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/juddi-unittest.properties
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/HsqldbUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StdOut2Log4jFilter.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StringUtils.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/jboss-esb.xml
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/ClassUtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/StreamUtilsUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/UtilUnitTest.java
   labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java
Modified:
   labs/jbossesb/trunk/Developer.txt
   labs/jbossesb/trunk/product/.classpath
   labs/jbossesb/trunk/product/Developer.txt
   labs/jbossesb/trunk/product/build.xml
Log:
Merge from workspace/dbevenius/trunk 12715:12752 . Work for JIRA JBESB-509, Change source tree structure


Modified: labs/jbossesb/trunk/Developer.txt
===================================================================
--- labs/jbossesb/trunk/Developer.txt	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/Developer.txt	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,13 +1,99 @@
-The structure of the distribution is as follows:
+Project directory structure
+===========================
+product -	contains the JBossESB product codebase, including unit tests.
+qa -		contains the QA infrastructure for JBossESB.
 
-product:	contains the JBossESB product codebase, including unit tests.
-qa:			contains the QA infrastructure for JBossESB.
 
-Eclipse developers, there is IDE/JBossIDE directory with the .classpath. Copy that onto the root;
+IDE
+===
+Eclipse developers, there is IDE/JBossIDE/product directory with the .classpath. Copy that onto the root(product folder);
 it assumes you have the entire project checked out.
+The product/services directory contains several sub-projects that have their own src and test folders. Each
+of these should be imported as projects in eclipse. A good way to keep different branches separate is to use
+working sets in Eclipse.
 
+Development
+===========
 If you have svn commit rights, then try to do your work within the workspace area first, before
 committing it to the trunk. We have a continuous integration build process that runs against the
-trunk whenever it is updated.
+trunk whenever it is updated. See 'Subversion Guidelines' for more information.
 
+Coding guidelines
+=================
 NOTE: you must ensure that all source files have the standard JBoss copyright at the start.
+
+Subversion Guidelines 
+=====================
+Simple bug fixes may be performed on the trunk, but anything else should
+be done in a personal workspace. The following text will describe how to
+create a personal workspace, how to merge changes from main into your
+workspace, and also how to merge changes from your workspace into the trunk.
+
+
+	Creating a personal workspace
+	==============================
+	1) svn mkdir https://svn.labs.jboss.com/labs/jbossesb/workspace/yourName
+	2) svn copy https://svn.labs.jboss.com/labs/jbossesb/trunk https://svn.labs.jboss.com/labs/jbossesb/workspace/yourName/branchName
+	3) svn co https://svn.labs.jboss.com/labs/jbossesb/workspace/yourName/branchName [<some local folder>]
+
+	Step 1 is simply creating a directory where we can store as many workspaces as we want.
+	Step 2 is making a copy of the main trunk to a folder name of your choice (branchName). This step can be repeated whenever 
+	you have the need to work on a separate branch, for example if you need to address a bug and do not want to disturb your 
+	current workspace with the changes.
+	Step 3 is just a normal checkout of the workspace just copied.
+
+
+	Merging changes from the trunk to your private workspace
+	========================================================
+	Change directory to the local working copy of your workspace prior to performing the commands below. 
+
+	 1) svn merge -r initial_revision:$HEAD https://svn.labs.jboss.com/labs/jbossesb/trunk
+	 2) resolve conflicts, run tests...
+	 3) svn ci -m 'Merge from main initial_revision:$HEAD'
+	
+	* initial_revision - is the revision given to your branch by the svn copy command in step 2 of 'Creating a 
+	  personal workspace'. You can use the command 'svn log --stop-on-copy' from within your working
+	  copy to display this revision number.
+	* $HEAD is not a valid value, but specified in this way to indicate that you should use the actual value of 
+	  the revision you want. This can be found by running 'svn update' from within the workspace copy
+	  of the main trunk. This is important, especially in the commit log message.
+
+	Next time you want to update your working branch you can use the log command and grep like this:
+	 svn log | grep -A 1 -B 3 'Merge from main' 
+	This will display the list of merges that have been preformed previously. The next merge should use
+	the value of the lastest merge's $HEAD value instead of the initial_revison number above.
+
+
+	Merging changes from your private workspace to the trunk
+	========================================================
+	Change directory to your working copy of the trunk prior to performing the commands below.
+
+	1) svn merge -r last_merge_commit_revision:$HEAD https://svn.labs.jboss.com/labs/jbossesb/workspace/yourName/branchName
+	2) Make sure you run the unit tests in the product directory and also the tests in the qa directory.
+	3) svn commit -m 'Merge from workspace/yourName/branchName last_merge_commit_revision:$HEAD'
+
+	* last_merge_commit_revision - If this is the first time you are merging your workspace branch with main
+	  then this will be the revision given to your branch by the svn copy command in step 2 of 'Creating a 
+	  personal workspace'. You can use the command 'svn log --stop-on-copy' from within your working
+	  copy to display this revision number.
+	  If this is not the first time you can run the following command from within your copy of the main trunks
+	  workspace:
+	   svn log | grep -A 1 -B 3 'Merge from workspace/yourName/branchName'
+	  This will give you a list all the merges that you have performed, BUT you should not use the revision numbers
+	  in this message, but instead the revision number of the commit for the entry, which is specified in the first column
+	  and the number is prefixed with an 'r', like r17.
+
+	* $HEAD is not a valid value, but specified in this way to indicate that you should use the actual value of 
+	  the revision you want. This can be found by running 'svn update' from with the workspace copy
+	  of the main trunk. This is important especially in the commit log message.
+	
+	Deleting your workspace 
+	=======================
+	You can delete branches that you have created when they are no longer needed.
+	1) svn list https://svn.labs.jboss.com/labs/jbossesb/workspace/yourName
+	2) svn delete https://svn.labs.jboss.com/labs/jbossesb/workspace/yourName/branchName
+
+	Step 1 is simply listing your branches.
+
+	The branch is missing from the HEAD revision but can be resurrected.
+

Deleted: labs/jbossesb/trunk/IDE/JBossIDE/core_src_plus_tests.classpath
===================================================================
--- labs/jbossesb/trunk/IDE/JBossIDE/core_src_plus_tests.classpath	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/IDE/JBossIDE/core_src_plus_tests.classpath	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,145 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry kind="lib" path="lib/ext/milyn-smooks-misc-0.2.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/milyn-smooks-templating-0.2.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/milyn-commons-0.9-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="lib/ext/milyn-smooks-core-0.9-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="lib/ext/milyn-smooks-javabean-0.3-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="etc/test/resources/log4j/dev"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/rosetta/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="services/jbpm/src/test/java"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="services/jbpm/src/main/java"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/services/tests/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/rosetta/tests/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/listeners/tests/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/services/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/listeners/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="services/jbrules/src/main/java"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="services/jbrules/src/test/java"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="services/soapui-client/src/main/java"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="services/soapui-client/src/test/java"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="tools/console/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="tools/console/test"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="lib" path="lib/ext/activation.jar"/>
-	<classpathentry kind="lib" path="lib/ext/antlr-2.7.6.jar"/>
-	<classpathentry kind="lib" path="lib/ext/antlr-3.0ea8.jar"/>
-	<classpathentry kind="lib" path="lib/ext/c3p0-0.9.1-pre9.jar"/>
-	<classpathentry kind="lib" path="lib/ext/commons-collections-2.0.jar"/>
-	<classpathentry kind="lib" path="lib/ext/commons-collections-3.2.jar"/>
-	<classpathentry kind="lib" path="lib/ext/commons-dbcp-1.2.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/commons-lang-2.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/commons-logging.jar"/>
-	<classpathentry kind="lib" path="lib/ext/emma_ant.jar"/>
-	<classpathentry kind="lib" path="lib/ext/emma.jar"/>
-	<classpathentry kind="lib" path="lib/ext/groovy-all-1.0.jar"/>
-	<classpathentry kind="lib" path="lib/ext/hsqldb.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jakarta-oro-2.0.8.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jaxr-api-1.0-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jbossall-client.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jboss-system.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jbossts-common.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jsch-0.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/juddi-1.0-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="lib/ext/juddi-client-1.0-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="lib/ext/junit-4.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/log4j.jar"/>
-	<classpathentry kind="lib" path="lib/ext/mail.jar"/>
-	<classpathentry kind="lib" path="lib/ext/mockejb.jar"/>
-	<classpathentry kind="lib" path="lib/ext/ognl-2.6.9.jar"/>
-	<classpathentry kind="lib" path="lib/ext/opencsv-1.6.jar"/>
-	<classpathentry kind="lib" path="lib/ext/properties-plugin.jar"/>
-	<classpathentry kind="lib" path="lib/ext/scout-1.0-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="lib/ext/stax-api-1.0.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/stringtemplate-2.3b6.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xalan-2.7.0.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xbean.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xercesImpl-2.7.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xml-apis-1.3.02.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xmlpublic.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xstream-1.1.3.jar"/>
-	<classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.0.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jboss.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jackrabbit-api-1.2.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jackrabbit-core-1.2.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jcr-1.0.jar"/>
-	<classpathentry kind="lib" path="lib/ext/commons-io-1.3.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jbossws-core.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jackrabbit-jcr-commons-1.2.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/lucene-core-2.0.0.jar"/>
-	<classpathentry kind="lib" path="lib/ext/edtftpj-1.5.4.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/backport-util-concurrent-2.2.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/ftplet-api-1.0-incubator-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/ftpserver-admin-gui-1.0-incubator-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/ftpserver-core-1.0-incubator-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/mina-core-1.0.2.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/mina-filter-ssl-1.0.2.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/slf4j-api-1.3.0.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/slf4j-log4j12-1.3.0.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/asm.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/commons-collections.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/commons-logging.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/dom4j.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/hibernate3.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/jbpm-identity.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/jbpm-jpdl.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/activation.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/ant.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/ant-antlr-1.6.5.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/ant-launcher.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/antlr-2.7.6.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/antlr-3.0ea8.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/ant-nodeps.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/commons-beanutils-1.7.0.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/commons-codec-1.3.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/commons-collections-3.1.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/commons-digester-1.6.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/commons-el-1.0.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/commons-jci-core-1.0-406301.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/commons-jci-janino-2.4.3.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/commons-lang-2.1.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/commons-logging-api-1.0.4.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/drools-compiler-3.0.5.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/drools-core-3.0.5.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/el-api.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/el-ri.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/hibernate-all.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/hsqldb.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/itext-1.4.7.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/janino-2.4.3.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/javax.servlet.jsp.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jboss-aop-jdk50.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jboss-cache-jdk50.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jboss-ejb3-all.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jboss-seam.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jboss-seam-debug.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jboss-seam-mail.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jboss-seam-pdf.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jboss-seam-ui.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jbpm-3.1.4.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jgroups.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jsf-facelets.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/jstl-1.1.0.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/mail.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/myfaces-api-1.1.4.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/myfaces-impl-1.1.4.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/portlet-api-lib.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/servlet-api.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/stringtemplate-2.3b6.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/testng-4.5.1-jdk15.jar"/>
-	<classpathentry kind="lib" path="tools/console/lib/thirdparty-all.jar"/>
-	<classpathentry kind="lib" path="lib/ext/wstx-lgpl-3.2.1.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/commons-codec-1.2.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/commons-httpclient-3.0.1.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/commons-logging-1.0.4.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/jboss-system.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/jboss-system-client.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/jsr173_1.0_api-xmlbeans-2.2.0.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/looks-2.1.2.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/ognl-2.6.9.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/soapui-1.7.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/soapui-xmlbeans-1.7.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/wsdl4j-1.6.2.jar"/>
-	<classpathentry kind="lib" path="services/soapui-client/src/lib/xbean-2.2.0.jar"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>

Copied: labs/jbossesb/trunk/IDE/JBossIDE/product (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/IDE/JBossIDE/product)

Deleted: labs/jbossesb/trunk/IDE/JBossIDE/product/.classpath
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/IDE/JBossIDE/product/.classpath	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/IDE/JBossIDE/product/.classpath	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,71 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<classpath>
-	<classpathentry excluding="**/.svn/" kind="src" path="rosetta/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="rosetta/tests/src"/>
-	<classpathentry kind="lib" path="etc/test/resources/log4j/dev"/>
-	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
-	<classpathentry kind="lib" path="lib/ext/activation.jar"/>
-	<classpathentry kind="lib" path="lib/ext/antlr-2.7.6.jar"/>
-	<classpathentry kind="lib" path="lib/ext/commons-collections-3.2.jar"/>
-	<classpathentry kind="lib" path="lib/ext/commons-lang-2.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/emma_ant.jar"/>
-	<classpathentry kind="lib" path="lib/ext/emma.jar"/>
-	<classpathentry kind="lib" path="lib/ext/groovy-all-1.0.jar"/>
-	<classpathentry kind="lib" path="lib/ext/hsqldb.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jaxr-api-1.0-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jbossall-client.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jboss-system.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jbossts-common.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jsch-0.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/juddi-1.0-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="lib/ext/juddi-client-1.0-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="lib/ext/junit-4.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/log4j.jar"/>
-	<classpathentry kind="lib" path="lib/ext/mail.jar"/>
-	<classpathentry kind="lib" path="lib/ext/mockejb.jar"/>
-	<classpathentry kind="lib" path="lib/ext/ognl-2.6.9.jar"/>
-	<classpathentry kind="lib" path="lib/ext/opencsv-1.6.jar"/>
-	<classpathentry kind="lib" path="lib/ext/properties-plugin.jar"/>
-	<classpathentry kind="lib" path="lib/ext/scout-1.0-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="lib/ext/stax-api-1.0.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xalan-2.7.0.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xbean.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xercesImpl-2.7.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xml-apis-1.3.02.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xmlpublic.jar"/>
-	<classpathentry kind="lib" path="lib/ext/xstream-1.1.3.jar"/>
-	<classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.0.1.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jboss.jar"/>
-	<classpathentry kind="lib" path="lib/ext/commons-io-1.3.jar"/>
-	<classpathentry kind="lib" path="lib/ext/edtftpj-1.5.4.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/backport-util-concurrent-2.2.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/ftplet-api-1.0-incubator-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/ftpserver-admin-gui-1.0-incubator-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/ftpserver-core-1.0-incubator-SNAPSHOT.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/mina-core-1.0.2.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/mina-filter-ssl-1.0.2.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/slf4j-api-1.3.0.jar"/>
-	<classpathentry kind="lib" path="ftp/lib/slf4j-log4j12-1.3.0.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/asm.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/dom4j.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/hibernate3.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/jbpm-identity.jar"/>
-	<classpathentry kind="lib" path="services/jbpm/lib/ext/jbpm-jpdl.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jgroups-all.jar"/>
-	<classpathentry kind="lib" path="lib/ext/cache.jar"/>
-	<classpathentry kind="lib" path="lib/ext/standalone/c3p0-0.9.1-pre9.jar"/>
-	<classpathentry kind="lib" path="lib/ext/antlr-3.0b7.jar"/>
-	<classpathentry kind="lib" path="lib/ext/asm.jar"/>
-	<classpathentry kind="lib" path="lib/ext/cglib-2.1_3.jar"/>
-	<classpathentry kind="lib" path="lib/ext/commons-httpclient.jar"/>
-	<classpathentry kind="lib" path="lib/ext/commons-logging-1.0.4.jar"/>
-	<classpathentry kind="lib" path="lib/ext/hibernate3.jar"/>
-	<classpathentry kind="lib" path="lib/ext/javassist.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jboss-aop-jdk50.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jboss-messaging-client.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jboss-remoting.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jbossweb.jar"/>
-	<classpathentry kind="lib" path="lib/ext/stringtemplate-3.0.jar"/>
-	<classpathentry kind="lib" path="lib/ext/trove.jar"/>
-	<classpathentry kind="output" path="bin"/>
-</classpath>

Copied: labs/jbossesb/trunk/IDE/JBossIDE/product/.classpath (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/IDE/JBossIDE/product/.classpath)
===================================================================
--- labs/jbossesb/trunk/IDE/JBossIDE/product/.classpath	                        (rev 0)
+++ labs/jbossesb/trunk/IDE/JBossIDE/product/.classpath	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,71 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+	<classpathentry excluding="**/.svn/" kind="src" path="rosetta/src"/>
+	<classpathentry excluding="**/.svn/" kind="src" path="rosetta/tests/src"/>
+	<classpathentry kind="lib" path="etc/test/resources/log4j/dev"/>
+	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+	<classpathentry kind="lib" path="lib/ext/activation.jar"/>
+	<classpathentry kind="lib" path="lib/ext/antlr-2.7.6.jar"/>
+	<classpathentry kind="lib" path="lib/ext/commons-collections-3.2.jar"/>
+	<classpathentry kind="lib" path="lib/ext/commons-lang-2.1.jar"/>
+	<classpathentry kind="lib" path="lib/ext/emma_ant.jar"/>
+	<classpathentry kind="lib" path="lib/ext/emma.jar"/>
+	<classpathentry kind="lib" path="lib/ext/groovy-all-1.0.jar"/>
+	<classpathentry kind="lib" path="lib/ext/hsqldb.jar"/>
+	<classpathentry kind="lib" path="lib/ext/jaxr-api-1.0-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/ext/jbossall-client.jar"/>
+	<classpathentry kind="lib" path="lib/ext/jboss-system.jar"/>
+	<classpathentry kind="lib" path="lib/ext/jbossts-common.jar"/>
+	<classpathentry kind="lib" path="lib/ext/jsch-0.1.jar"/>
+	<classpathentry kind="lib" path="lib/ext/juddi-1.0-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/ext/juddi-client-1.0-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/ext/junit-4.1.jar"/>
+	<classpathentry kind="lib" path="lib/ext/log4j.jar"/>
+	<classpathentry kind="lib" path="lib/ext/mail.jar"/>
+	<classpathentry kind="lib" path="lib/ext/mockejb.jar"/>
+	<classpathentry kind="lib" path="lib/ext/ognl-2.6.9.jar"/>
+	<classpathentry kind="lib" path="lib/ext/opencsv-1.6.jar"/>
+	<classpathentry kind="lib" path="lib/ext/properties-plugin.jar"/>
+	<classpathentry kind="lib" path="lib/ext/scout-1.0-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="lib/ext/stax-api-1.0.1.jar"/>
+	<classpathentry kind="lib" path="lib/ext/xalan-2.7.0.jar"/>
+	<classpathentry kind="lib" path="lib/ext/xbean.jar"/>
+	<classpathentry kind="lib" path="lib/ext/xercesImpl-2.7.1.jar"/>
+	<classpathentry kind="lib" path="lib/ext/xml-apis-1.3.02.jar"/>
+	<classpathentry kind="lib" path="lib/ext/xmlpublic.jar"/>
+	<classpathentry kind="lib" path="lib/ext/xstream-1.1.3.jar"/>
+	<classpathentry kind="lib" path="build/jbossesb/lib/jbossesb-config-model-1.0.1.jar"/>
+	<classpathentry kind="lib" path="lib/ext/jboss.jar"/>
+	<classpathentry kind="lib" path="lib/ext/commons-io-1.3.jar"/>
+	<classpathentry kind="lib" path="lib/ext/edtftpj-1.5.4.jar"/>
+	<classpathentry kind="lib" path="ftp/lib/backport-util-concurrent-2.2.jar"/>
+	<classpathentry kind="lib" path="ftp/lib/ftplet-api-1.0-incubator-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="ftp/lib/ftpserver-admin-gui-1.0-incubator-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="ftp/lib/ftpserver-core-1.0-incubator-SNAPSHOT.jar"/>
+	<classpathentry kind="lib" path="ftp/lib/mina-core-1.0.2.jar"/>
+	<classpathentry kind="lib" path="ftp/lib/mina-filter-ssl-1.0.2.jar"/>
+	<classpathentry kind="lib" path="ftp/lib/slf4j-api-1.3.0.jar"/>
+	<classpathentry kind="lib" path="ftp/lib/slf4j-log4j12-1.3.0.jar"/>
+	<classpathentry kind="lib" path="services/jbpm/lib/ext/asm.jar"/>
+	<classpathentry kind="lib" path="services/jbpm/lib/ext/dom4j.jar"/>
+	<classpathentry kind="lib" path="services/jbpm/lib/ext/hibernate3.jar"/>
+	<classpathentry kind="lib" path="services/jbpm/lib/ext/jbpm-identity.jar"/>
+	<classpathentry kind="lib" path="services/jbpm/lib/ext/jbpm-jpdl.jar"/>
+	<classpathentry kind="lib" path="lib/ext/jgroups-all.jar"/>
+	<classpathentry kind="lib" path="lib/ext/cache.jar"/>
+	<classpathentry kind="lib" path="lib/ext/standalone/c3p0-0.9.1-pre9.jar"/>
+	<classpathentry kind="lib" path="lib/ext/antlr-3.0b7.jar"/>
+	<classpathentry kind="lib" path="lib/ext/asm.jar"/>
+	<classpathentry kind="lib" path="lib/ext/cglib-2.1_3.jar"/>
+	<classpathentry kind="lib" path="lib/ext/commons-httpclient.jar"/>
+	<classpathentry kind="lib" path="lib/ext/commons-logging-1.0.4.jar"/>
+	<classpathentry kind="lib" path="lib/ext/hibernate3.jar"/>
+	<classpathentry kind="lib" path="lib/ext/javassist.jar"/>
+	<classpathentry kind="lib" path="lib/ext/jboss-aop-jdk50.jar"/>
+	<classpathentry kind="lib" path="lib/ext/jboss-messaging-client.jar"/>
+	<classpathentry kind="lib" path="lib/ext/jboss-remoting.jar"/>
+	<classpathentry kind="lib" path="lib/ext/jbossweb.jar"/>
+	<classpathentry kind="lib" path="lib/ext/stringtemplate-3.0.jar"/>
+	<classpathentry kind="lib" path="lib/ext/trove.jar"/>
+	<classpathentry kind="output" path="bin"/>
+</classpath>

Deleted: labs/jbossesb/trunk/IDE/JBossIDE/product/.project
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/IDE/JBossIDE/product/.project	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/IDE/JBossIDE/product/.project	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,17 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<projectDescription>
-	<name>JBossESB</name>
-	<comment></comment>
-	<projects>
-	</projects>
-	<buildSpec>
-		<buildCommand>
-			<name>org.eclipse.jdt.core.javabuilder</name>
-			<arguments>
-			</arguments>
-		</buildCommand>
-	</buildSpec>
-	<natures>
-		<nature>org.eclipse.jdt.core.javanature</nature>
-	</natures>
-</projectDescription>

Copied: labs/jbossesb/trunk/IDE/JBossIDE/product/.project (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/IDE/JBossIDE/product/.project)
===================================================================
--- labs/jbossesb/trunk/IDE/JBossIDE/product/.project	                        (rev 0)
+++ labs/jbossesb/trunk/IDE/JBossIDE/product/.project	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+	<name>JBossESB</name>
+	<comment></comment>
+	<projects>
+	</projects>
+	<buildSpec>
+		<buildCommand>
+			<name>org.eclipse.jdt.core.javabuilder</name>
+			<arguments>
+			</arguments>
+		</buildCommand>
+	</buildSpec>
+	<natures>
+		<nature>org.eclipse.jdt.core.javanature</nature>
+	</natures>
+</projectDescription>

Modified: labs/jbossesb/trunk/product/.classpath
===================================================================
--- labs/jbossesb/trunk/product/.classpath	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/.classpath	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,12 +1,8 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <classpath>
+	<classpathentry excluding="**/.svn/" kind="src" path="rosetta/src"/>
+	<classpathentry excluding="**/.svn/" kind="src" path="rosetta/tests/src"/>
 	<classpathentry kind="lib" path="etc/test/resources/log4j/dev"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/rosetta/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/rosetta/tests/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/listeners/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/listeners/tests/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/services/src"/>
-	<classpathentry excluding="**/.svn/" kind="src" path="core/services/tests/src"/>
 	<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
 	<classpathentry kind="lib" path="lib/ext/activation.jar"/>
 	<classpathentry kind="lib" path="lib/ext/antlr-2.7.6.jar"/>
@@ -58,8 +54,6 @@
 	<classpathentry kind="lib" path="lib/ext/jgroups-all.jar"/>
 	<classpathentry kind="lib" path="lib/ext/cache.jar"/>
 	<classpathentry kind="lib" path="lib/ext/standalone/c3p0-0.9.1-pre9.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jboss-jaxws.jar"/>
-	<classpathentry kind="lib" path="lib/ext/jbossws-spi.jar"/>
 	<classpathentry kind="lib" path="lib/ext/antlr-3.0b7.jar"/>
 	<classpathentry kind="lib" path="lib/ext/asm.jar"/>
 	<classpathentry kind="lib" path="lib/ext/cglib-2.1_3.jar"/>
@@ -73,6 +67,5 @@
 	<classpathentry kind="lib" path="lib/ext/jbossweb.jar"/>
 	<classpathentry kind="lib" path="lib/ext/stringtemplate-3.0.jar"/>
 	<classpathentry kind="lib" path="lib/ext/trove.jar"/>
-	<classpathentry kind="lib" path="lib/ext/wstx-lgpl-3.2.1.jar"/>
 	<classpathentry kind="output" path="bin"/>
 </classpath>

Modified: labs/jbossesb/trunk/product/Developer.txt
===================================================================
--- labs/jbossesb/trunk/product/Developer.txt	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/Developer.txt	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,11 +1,28 @@
 The structure of the distribution is as follows:
 
-lib:			contains the built jar
-lib/ext:		contains any jars needed to build/run the distribution
-core:			the core SOA infrastructure
-jbi:			the JBI implementation which layers on core
-javadocs:		created during the build
-build:			created during the build
+|-build						created during the build
+|---jbossesb/lib			contains the built jar
+|-docs						Project documentation, guide
+|-etc						Schemas 
+|-install					deployment and installation
+|-javadocs					JavaDocs
+|-lib						
+|---ext						contains any jars needed to build/run the distribution
+|-plugins
+|-rosetta					the core SOA infrastructure
+|-samples					Quickstarts and trailblazer
+|-services					services to the ESB, like Smooks, JBossRules etc.
+|---jbossesb
+|---jbpm					jBPM (Business Process Manager)
+|---jbrules					JBoss Rules (Content Based Routing)
+|---smooks					Smooks (tranformation)
+|---soap					SOAP
+|---soapui-client
+|---spring					Spring
+|-tools
+|---configeditor			
+|---console
 
+
 Any classes which occur within an 'internal' package are not meant for users. Changes to these
 classes can occur without notice and deprecation markers.

Modified: labs/jbossesb/trunk/product/build.xml
===================================================================
--- labs/jbossesb/trunk/product/build.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/build.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -72,7 +72,7 @@
 	</condition>
 	
 	<!-- Path names -->
-	<property name="org.jboss.esb.internal.core" value="esb"/>
+	<property name="org.jboss.esb.internal.rosetta" value="esb"/>
 	<property name="org.jboss.esb.internal.dest" location="build"/>
 	<property name="org.jboss.esb.internal.jar" location="lib"/>
 	<property name="org.jboss.esb.internal.javadocs.dest" location="javadocs"/>
@@ -97,8 +97,8 @@
 		</sequential>
 	</macrodef>
 
-	<target name="generate-config-model">
-		<ant dir="core/listeners" target="generate-config-model"/>
+	<target name="generate-config-model" description="generates the xmlbeans config model">
+		<ant dir="rosetta" target="generate-config-model"/>
 	</target>
 	
 	<!-- Initialisation -->
@@ -114,14 +114,14 @@
 	<!-- Compilation targets -->
 		
 	<target name="org.jboss.esb.compile"
-		depends="org.jboss.esb.internal.init, org.jboss.esb.core.compile"/>
+		depends="org.jboss.esb.internal.init, org.jboss.esb.rosetta.compile"/>
 	
-	<target name="org.jboss.esb.jar" depends="org.jboss.esb.internal.init, org.jboss.esb.core.jar,
+	<target name="org.jboss.esb.jar" depends="org.jboss.esb.internal.init, org.jboss.esb.rosetta.jar,
 		org.jboss.soa.esb.services.jar"/>	
 
-	<target name="org.jboss.esb.core.compile" depends="org.jboss.esb.internal.init">
+	<target name="org.jboss.esb.rosetta.compile" depends="org.jboss.esb.internal.init">
 		<echo message="Compiling modules"/>
-		<ant dir="core"/>
+		<ant dir="rosetta"/>
 	</target>
 
     <!-- Test targets -->
@@ -141,7 +141,7 @@
         <antcall target="assert-build-available" />
 
         <echo message="Testing of modules, using unit and functional tests"/>
-        <ant dir="core" target="org.jboss.esb.core.test"/>
+        <ant dir="rosetta" target="org.jboss.esb.rosetta.test"/>
     	<ant dir="services" target="test"/>
     </target>
 
@@ -157,15 +157,13 @@
     <!-- Integration test targets -->
     <target name="org.jboss.esb.integration.test" depends="org.jboss.esb.compile">
         <echo message="Testing of modules, using unit, functional and integration tests"/>
-        <ant dir="core" target="org.jboss.esb.core.integration.test"/>
+        <ant dir="rosetta" target="org.jboss.esb.core.integration.test"/>
     </target>
 
     <!-- javadocs paths -->
 	<path id="org.jboss.esb.javadocs.path">
 		<pathelement path="build/schema-model/src"/>
-		<pathelement path="core/rosetta/src"/>
-		<pathelement path="core/listeners/src"/>
-		<pathelement path="core/services/src/"/>
+		<pathelement path="rosetta/src"/>
 	</path>
 	
 
@@ -176,9 +174,9 @@
 	value="org.jboss.soa.esb.samples.*"/>
 
 	<!-- Jar targets -->
-	<target name="org.jboss.esb.core.jar">
+	<target name="org.jboss.esb.rosetta.jar">
 		<echo message="Building jar file"/>
-		<ant dir="core" target="jar"/>
+		<ant dir="rosetta" target="jar"/>
 	</target>
 	
 	<target name="org.jboss.soa.esb.services.jar">
@@ -382,8 +380,8 @@
 	<target name="org.jboss.esb.clean">
 		<echo message="Cleaning modules"/>
 		
-		<echo message="Cleaning core"/>
-		<ant dir="core" target="clean"/>
+		<echo message="Cleaning rosetta"/>
+		<ant dir="rosetta" target="clean"/>
 		<ant dir="${console.dir}" target="clean"/>
         <ant dir="services" target="clean"/>
 
@@ -449,13 +447,11 @@
          <ant antfile="build-distr.xml"/>
     </target>
 
-	<target name="deploy" depends="jar" description="deploys the ESB .sar to an application server">
-		<ant antfile="build-distr.xml" target="build.sar" />
-		<copy  todir="${org.jboss.esb.server.home}/server/${org.jboss.esb.server.config}/deploy">
-		    <fileset dir="build" includes="jbossesb.sar/**"/></copy>
+	<target name="deploy" depends="dist" description="deploys the ESB .sar to an application server">
+		<ant dir="install" target="deploy"/>
 	</target>
 
 	<target name="instr-report">
-		<ant dir="core" target="instr-report"/>
+		<ant dir="rosetta" target="instr-report"/>
 	</target>
 </project>

Copied: labs/jbossesb/trunk/product/rosetta (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta)


Property changes on: labs/jbossesb/trunk/product/rosetta
___________________________________________________________________
Name: svn:ignore
   + build
bin


Deleted: labs/jbossesb/trunk/product/rosetta/ant.bat
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/ant.bat	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/ant.bat	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,12 +0,0 @@
- at echo off
-set ANT_CMD_LINE_ARGS=%1
-if ""%1""=="""" goto doneStart
-shift
-:setupArgs
-if ""%1""=="""" goto doneStart
-set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
-shift
-goto setupArgs
-:doneStart
-%ANT_HOME%\bin\ant %ANT_CMD_LINE_ARGS%
-

Copied: labs/jbossesb/trunk/product/rosetta/ant.bat (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/ant.bat)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/ant.bat	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/ant.bat	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,12 @@
+ at echo off
+set ANT_CMD_LINE_ARGS=%1
+if ""%1""=="""" goto doneStart
+shift
+:setupArgs
+if ""%1""=="""" goto doneStart
+set ANT_CMD_LINE_ARGS=%ANT_CMD_LINE_ARGS% %1
+shift
+goto setupArgs
+:doneStart
+%ANT_HOME%\bin\ant %ANT_CMD_LINE_ARGS%
+

Deleted: labs/jbossesb/trunk/product/rosetta/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/build.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/build.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,121 +0,0 @@
-<?xml version="1.0"?>
-<project name="BuildJbossEsbRosetta" default="org.jboss.esb.rosetta.compile" basedir=".">
-
-	<property name="org.jboss.esb.rosetta.jar.name" value="jbossesb-rosetta"/>
-	<property name="org.jboss.esb.rosetta.distrib.dir" location="${org.jboss.esb.internal.dest}/jbossesb"/>
-	<property name="org.jboss.esb.rosetta.classes.dir" location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
-    <property name="org.jboss.esb.rosetta.src.dir" location="src"/>
-	<property name="org.jboss.esb.root.dir" location="../"/>
-	<property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
-    <property environment="env"/>
-
-
-	<property name="org.jboss.esb.ext.lib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
-	<condition property="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.jboss.home}/client">
-		<equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
-	</condition>
-	
-	<path id="org.jboss.esb.rosetta.base.classpath">
-        <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
-        <fileset dir="${org.jboss.esb.ext.lib.dir}/standalone" includes="*.jar"/>
-		<pathelement location="${gendir}/classes"/>
-	</path>
-
-	<path id="emma.libs">
-        <fileset dir="../lib/ext" includes="emma*.jar"/>
-    </path>
-    <taskdef resource="emma_ant.properties" classpathref="emma.libs" />
-
-
-    <target name="org.jboss.esb.rosetta.init">
-        <tstamp>
-            <format property="TODAY" pattern="dd-MM-yy"/>
-        </tstamp>
-    </target>
-
-    <target name="org.jboss.esb.rosetta.prepare" depends="org.jboss.esb.rosetta.init">
-        <mkdir dir="${org.jboss.esb.rosetta.classes.dir}"/>
-        <mkdir dir="${org.jboss.esb.rosetta.distrib.dir}"/>
-    	<mkdir dir="${org.jboss.esb.rosetta.distrib.dir}/lib"/>
-    </target>
-
-    <target name="clean" description="Remove classes directory">
-        <ant dir="tests" target="clean"/>
-    	<delete dir="${org.jboss.esb.rosetta.classes.dir}"/>
-    </target>
-
-    <target name="org.jboss.esb.rosetta.compile">
-		<!-- generate config model -->
-        <antcall target="generate-config-model"/>
-        <!-- Compile common -->
-        <antcall target="org.jboss.esb.rosetta.internal.compile"/>
-        <!-- Compile common tests -->
-        <ant inheritAll="true" dir="tests" target="org.jboss.esb.rosetta.tests.compile"/>
-    </target>
-
-    <target name="org.jboss.esb.rosetta.internal.compile" depends="org.jboss.esb.rosetta.prepare"
-        description="Compile all classes">
-
-        <javac
-            destdir="${org.jboss.esb.rosetta.classes.dir}"
-            classpathref="org.jboss.esb.rosetta.base.classpath"
-            debug="${org.jboss.esb.debug}"
-            optimize="${org.jboss.esb.optimize}"
-            >
-            <src path="${org.jboss.esb.rosetta.src.dir}"/>
-        </javac>
-
-    </target>
-
-	<target name="recompile" depends="clean,org.jboss.esb.rosetta.compile"
-        description="Clean and compile"/>
-
-    <target name="jar" depends="org.jboss.esb.rosetta.compile" description="Assemble jar files">
-    	<delete file="${org.jboss.esb.rosetta.distrib.dir}/lib/${org.jboss.esb.rosetta.jar.name}.jar" />
-        <jar    destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/${org.jboss.esb.rosetta.jar.name}.jar" 
-                basedir="${org.jboss.esb.rosetta.classes.dir}" 
-                includes="**/*.class"
-		excludes="test/**"
-                />
-    	<jar    destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/test-util.jar" 
-    	                basedir="${org.jboss.esb.internal.dest}/tests/" 
-    	                includes="org/jboss/soa/esb/testutils/**/*.class"/>
-    </target>
-
-    <target name="org.jboss.esb.rosetta.test" depends="org.jboss.esb.rosetta.compile" description="Run tests for this module">
-        <!-- Compile rosetta tests -->
-        <ant dir="tests" target="org.jboss.esb.rosetta.internal.test"/>
-    </target>
-	
-	<target name="org.jboss.esb.rosetta.integration.test" description="Run integration tests for this module">
-	        <!-- Compile rosetta integration tests -->
-	        <ant dir="tests" target="org.jboss.esb.rosetta.internal.integration.test"/>
-	    </target>
-
-    <target name="all" depends="recompile,jar" />
-
-	<target name="generate-config-model" depends="org.jboss.esb.rosetta.prepare">
-
-        <taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean" classpathref="xbeans-classpath" />
-        <delete dir="${gendir}" /><mkdir dir="${gendir}" />
-
-        <xmlbean
-            classgendir="${gendir}/classes"
-            javasource="1.5"
-            srcgendir="${gendir}/src"
-            destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.0.1.jar"
-            classpathref="xbeans-classpath">
-            <fileset dir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.0.1.xsd,jbossesb-1.0.1.xsdconfig"/>
-        </xmlbean>
-        <!-- now add the xsd to it -->
-        <jar destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.0.1.jar" update="true"
-            basedir="${org.jboss.esb.root.dir}/etc/schemas/xml/"
-            includes="jbossesb-1.0.1.xsd"/>
-    </target>
-
-    <path id="xbeans-classpath">
-        <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
-    </path>
-
-
-</project>

Copied: labs/jbossesb/trunk/product/rosetta/build.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/build.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/build.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/build.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,121 @@
+<?xml version="1.0"?>
+<project name="BuildJbossEsbRosetta" default="org.jboss.esb.rosetta.compile" basedir=".">
+
+	<property name="org.jboss.esb.rosetta.jar.name" value="jbossesb-rosetta"/>
+	<property name="org.jboss.esb.rosetta.distrib.dir" location="${org.jboss.esb.internal.dest}/jbossesb"/>
+	<property name="org.jboss.esb.rosetta.classes.dir" location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
+    <property name="org.jboss.esb.rosetta.src.dir" location="src"/>
+	<property name="org.jboss.esb.root.dir" location="../"/>
+	<property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
+    <property environment="env"/>
+
+
+	<property name="org.jboss.esb.ext.lib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
+	<condition property="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.jboss.home}/client">
+		<equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
+	</condition>
+	
+	<path id="org.jboss.esb.rosetta.base.classpath">
+        <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
+        <fileset dir="${org.jboss.esb.ext.lib.dir}/standalone" includes="*.jar"/>
+		<pathelement location="${gendir}/classes"/>
+	</path>
+
+	<path id="emma.libs">
+        <fileset dir="../lib/ext" includes="emma*.jar"/>
+    </path>
+    <taskdef resource="emma_ant.properties" classpathref="emma.libs" />
+
+
+    <target name="org.jboss.esb.rosetta.init">
+        <tstamp>
+            <format property="TODAY" pattern="dd-MM-yy"/>
+        </tstamp>
+    </target>
+
+    <target name="org.jboss.esb.rosetta.prepare" depends="org.jboss.esb.rosetta.init">
+        <mkdir dir="${org.jboss.esb.rosetta.classes.dir}"/>
+        <mkdir dir="${org.jboss.esb.rosetta.distrib.dir}"/>
+    	<mkdir dir="${org.jboss.esb.rosetta.distrib.dir}/lib"/>
+    </target>
+
+    <target name="clean" description="Remove classes directory">
+        <ant dir="tests" target="clean"/>
+    	<delete dir="${org.jboss.esb.rosetta.classes.dir}"/>
+    </target>
+
+    <target name="org.jboss.esb.rosetta.compile">
+		<!-- generate config model -->
+        <antcall target="generate-config-model"/>
+        <!-- Compile common -->
+        <antcall target="org.jboss.esb.rosetta.internal.compile"/>
+        <!-- Compile common tests -->
+        <ant inheritAll="true" dir="tests" target="org.jboss.esb.rosetta.tests.compile"/>
+    </target>
+
+    <target name="org.jboss.esb.rosetta.internal.compile" depends="org.jboss.esb.rosetta.prepare"
+        description="Compile all classes">
+
+        <javac
+            destdir="${org.jboss.esb.rosetta.classes.dir}"
+            classpathref="org.jboss.esb.rosetta.base.classpath"
+            debug="${org.jboss.esb.debug}"
+            optimize="${org.jboss.esb.optimize}"
+            >
+            <src path="${org.jboss.esb.rosetta.src.dir}"/>
+        </javac>
+
+    </target>
+
+	<target name="recompile" depends="clean,org.jboss.esb.rosetta.compile"
+        description="Clean and compile"/>
+
+    <target name="jar" depends="org.jboss.esb.rosetta.compile" description="Assemble jar files">
+    	<delete file="${org.jboss.esb.rosetta.distrib.dir}/lib/${org.jboss.esb.rosetta.jar.name}.jar" />
+        <jar    destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/${org.jboss.esb.rosetta.jar.name}.jar" 
+                basedir="${org.jboss.esb.rosetta.classes.dir}" 
+                includes="**/*.class"
+		excludes="test/**"
+                />
+    	<jar    destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/test-util.jar" 
+    	                basedir="${org.jboss.esb.internal.dest}/tests/" 
+    	                includes="org/jboss/soa/esb/testutils/**/*.class"/>
+    </target>
+
+    <target name="org.jboss.esb.rosetta.test" depends="org.jboss.esb.rosetta.compile" description="Run tests for this module">
+        <!-- Compile rosetta tests -->
+        <ant dir="tests" target="org.jboss.esb.rosetta.internal.test"/>
+    </target>
+	
+	<target name="org.jboss.esb.rosetta.integration.test" description="Run integration tests for this module">
+	        <!-- Compile rosetta integration tests -->
+	        <ant dir="tests" target="org.jboss.esb.rosetta.internal.integration.test"/>
+	    </target>
+
+    <target name="all" depends="recompile,jar" />
+
+	<target name="generate-config-model" depends="org.jboss.esb.rosetta.prepare">
+
+        <taskdef name="xmlbean" classname="org.apache.xmlbeans.impl.tool.XMLBean" classpathref="xbeans-classpath" />
+        <delete dir="${gendir}" /><mkdir dir="${gendir}" />
+
+        <xmlbean
+            classgendir="${gendir}/classes"
+            javasource="1.5"
+            srcgendir="${gendir}/src"
+            destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.0.1.jar"
+            classpathref="xbeans-classpath">
+            <fileset dir="${org.jboss.esb.root.dir}/etc/schemas/xml/" includes="jbossesb-1.0.1.xsd,jbossesb-1.0.1.xsdconfig"/>
+        </xmlbean>
+        <!-- now add the xsd to it -->
+        <jar destfile="${org.jboss.esb.rosetta.distrib.dir}/lib/jbossesb-config-model-1.0.1.jar" update="true"
+            basedir="${org.jboss.esb.root.dir}/etc/schemas/xml/"
+            includes="jbossesb-1.0.1.xsd"/>
+    </target>
+
+    <path id="xbeans-classpath">
+        <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
+    </path>
+
+
+</project>

Copied: labs/jbossesb/trunk/product/rosetta/src (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src)

Copied: labs/jbossesb/trunk/product/rosetta/src/org (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,211 +0,0 @@
-package org.jboss.internal.soa.esb.addressing.helpers;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.XMLUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public abstract class CallHelper
-{
-
-	public static Element toXML(Call call, Document doc, Element header)
-			throws MarshalException
-	{
-		AssertArgument.isNotNull(call, "call");
-		AssertArgument.isNotNull(doc, "doc");
-		AssertArgument.isNotNull(header, "header");
-
-		header.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
-				+ XMLUtil.WSA_PREFIX, XMLUtil.WSA_NAMESPACE_URI);
-		
-		if (call.getTo() != null)
-		{
-			final Element toElement = doc.createElementNS(
-					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.TO_TAG);
-			toElement.setPrefix(XMLUtil.WSA_PREFIX);
-			EPRHelper.toXML(call.getTo(), doc, header, toElement, true);
-			header.appendChild(toElement);
-		}
-
-		if (call.getFrom() != null)
-		{
-			final Element fromElement = doc.createElementNS(
-					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.FROM_TAG);
-			fromElement.setPrefix(XMLUtil.WSA_PREFIX);
-			EPRHelper.toXML(call.getFrom(), doc, header, fromElement, false);
-			header.appendChild(fromElement);
-		}
-
-		if (call.getReplyTo() != null)
-		{
-			final Element replyToElement = doc.createElementNS(
-					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.REPLY_TO_TAG);
-			replyToElement.setPrefix(XMLUtil.WSA_PREFIX);
-			EPRHelper.toXML(call.getReplyTo(), doc, header, replyToElement,
-					false);
-			header.appendChild(replyToElement);
-		}
-
-		if (call.getRelatesTo() != null)
-		{
-			final Element relatesToElement = doc.createElementNS(
-					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.RELATES_TO_TAG);
-			relatesToElement.setPrefix(XMLUtil.WSA_PREFIX);
-			relatesToElement.setTextContent(call.getRelatesTo().toString());
-			header.appendChild(relatesToElement);
-		}
-
-		if (call.getFaultTo() != null)
-		{
-			final Element faultToElement = doc.createElementNS(
-					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.FAULT_TO_TAG);
-			faultToElement.setPrefix(XMLUtil.WSA_PREFIX);
-			EPRHelper.toXML(call.getFaultTo(), doc, header, faultToElement,
-					false);
-			header.appendChild(faultToElement);
-		}
-
-		if (call.getAction() != null)
-		{
-			final Element actionElement = doc.createElementNS(
-					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.ACTION_TAG);
-			actionElement.setPrefix(XMLUtil.WSA_PREFIX);
-			actionElement.setTextContent(call.getAction().toString());
-			header.appendChild(actionElement);
-		}
-
-		if (call.getMessageID() != null)
-		{
-			final Element messageIDElement = doc.createElementNS(
-					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.MESSAGE_IDENTIFIER_TAG);
-			messageIDElement.setPrefix(XMLUtil.WSA_PREFIX);
-			messageIDElement.setTextContent(call.getMessageID().toString());
-			header.appendChild(messageIDElement);
-		}
-
-		return header;
-	}
-
-	public static Call fromXML(Element header) throws UnmarshalException
-	{
-		AssertArgument.isNotNull(header, "header");
-
-		Call call = new Call();
-		NodeList nl = header.getChildNodes();
-
-		for (int i = 0; i < nl.getLength(); i++)
-		{
-			Node n = nl.item(i);
-
-			if ((n.getPrefix() != null) && (n.getLocalName() != null))
-			{
-				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.TO_TAG)))
-				{
-					call.setTo(EPRHelper.fromXML((Element) header, true));
-				}
-				
-				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.FROM_TAG)))
-				{
-					call.setFrom(EPRHelper.fromXML((Element) n, false));
-				}
-	
-				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.REPLY_TO_TAG)))
-				{
-					call.setReplyTo(EPRHelper.fromXML((Element) n, false));
-				}
-	
-				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.RELATES_TO_TAG)))
-				{
-    					try
-    					{
-    						call.setRelatesTo(new URI(n.getTextContent()));
-    					}
-    					catch (URISyntaxException e)
-    					{
-    						throw new UnmarshalException("'" + XMLUtil.RELATES_TO_TAG
-    								+ "' must be a valid URI", e);
-    					}
-    					catch (Exception ex)
-    					{
-    						throw new UnmarshalException("'" + XMLUtil.RELATES_TO_TAG
-    						+ "' has invalid content", ex);
-    					}
-				}
-	
-				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.FAULT_TO_TAG)))
-				{
-					call.setFaultTo(EPRHelper.fromXML((Element) n, false));
-				}
-	
-				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.ACTION_TAG)))
-				{
-					try
-					{
-						call.setAction(new URI(n.getTextContent()));
-					}
-					catch (URISyntaxException e)
-					{
-						throw new UnmarshalException("'" + XMLUtil.ACTION_TAG
-								+ "' must be a valid URI", e);
-					}
-					catch (Exception ex)
-					{
-						throw new UnmarshalException("'" + XMLUtil.ACTION_TAG
-						+ "' has invalid content", ex);
-					}
-				}
-	
-				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.MESSAGE_IDENTIFIER_TAG)))
-				{
-					try
-					{
-						call.setMessageID(new URI(n.getTextContent()));
-					}
-					catch (URISyntaxException e)
-					{
-						throw new UnmarshalException("'"
-								+ XMLUtil.MESSAGE_IDENTIFIER_TAG
-								+ "' must be a valid URI", e);
-					}
-					catch (Exception ex)
-					{
-						throw new UnmarshalException("'" + XMLUtil.MESSAGE_IDENTIFIER_TAG
-						+ "' has invalid content", ex);
-					}
-				}
-			}
-		}
-
-		return call;
-	}
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/CallHelper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,211 @@
+package org.jboss.internal.soa.esb.addressing.helpers;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public abstract class CallHelper
+{
+
+	public static Element toXML(Call call, Document doc, Element header)
+			throws MarshalException
+	{
+		AssertArgument.isNotNull(call, "call");
+		AssertArgument.isNotNull(doc, "doc");
+		AssertArgument.isNotNull(header, "header");
+
+		header.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
+				+ XMLUtil.WSA_PREFIX, XMLUtil.WSA_NAMESPACE_URI);
+		
+		if (call.getTo() != null)
+		{
+			final Element toElement = doc.createElementNS(
+					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.TO_TAG);
+			toElement.setPrefix(XMLUtil.WSA_PREFIX);
+			EPRHelper.toXML(call.getTo(), doc, header, toElement, true);
+			header.appendChild(toElement);
+		}
+
+		if (call.getFrom() != null)
+		{
+			final Element fromElement = doc.createElementNS(
+					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.FROM_TAG);
+			fromElement.setPrefix(XMLUtil.WSA_PREFIX);
+			EPRHelper.toXML(call.getFrom(), doc, header, fromElement, false);
+			header.appendChild(fromElement);
+		}
+
+		if (call.getReplyTo() != null)
+		{
+			final Element replyToElement = doc.createElementNS(
+					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.REPLY_TO_TAG);
+			replyToElement.setPrefix(XMLUtil.WSA_PREFIX);
+			EPRHelper.toXML(call.getReplyTo(), doc, header, replyToElement,
+					false);
+			header.appendChild(replyToElement);
+		}
+
+		if (call.getRelatesTo() != null)
+		{
+			final Element relatesToElement = doc.createElementNS(
+					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.RELATES_TO_TAG);
+			relatesToElement.setPrefix(XMLUtil.WSA_PREFIX);
+			relatesToElement.setTextContent(call.getRelatesTo().toString());
+			header.appendChild(relatesToElement);
+		}
+
+		if (call.getFaultTo() != null)
+		{
+			final Element faultToElement = doc.createElementNS(
+					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.FAULT_TO_TAG);
+			faultToElement.setPrefix(XMLUtil.WSA_PREFIX);
+			EPRHelper.toXML(call.getFaultTo(), doc, header, faultToElement,
+					false);
+			header.appendChild(faultToElement);
+		}
+
+		if (call.getAction() != null)
+		{
+			final Element actionElement = doc.createElementNS(
+					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.ACTION_TAG);
+			actionElement.setPrefix(XMLUtil.WSA_PREFIX);
+			actionElement.setTextContent(call.getAction().toString());
+			header.appendChild(actionElement);
+		}
+
+		if (call.getMessageID() != null)
+		{
+			final Element messageIDElement = doc.createElementNS(
+					XMLUtil.WSA_NAMESPACE_URI, XMLUtil.MESSAGE_IDENTIFIER_TAG);
+			messageIDElement.setPrefix(XMLUtil.WSA_PREFIX);
+			messageIDElement.setTextContent(call.getMessageID().toString());
+			header.appendChild(messageIDElement);
+		}
+
+		return header;
+	}
+
+	public static Call fromXML(Element header) throws UnmarshalException
+	{
+		AssertArgument.isNotNull(header, "header");
+
+		Call call = new Call();
+		NodeList nl = header.getChildNodes();
+
+		for (int i = 0; i < nl.getLength(); i++)
+		{
+			Node n = nl.item(i);
+
+			if ((n.getPrefix() != null) && (n.getLocalName() != null))
+			{
+				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.TO_TAG)))
+				{
+					call.setTo(EPRHelper.fromXML((Element) header, true));
+				}
+				
+				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.FROM_TAG)))
+				{
+					call.setFrom(EPRHelper.fromXML((Element) n, false));
+				}
+	
+				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.REPLY_TO_TAG)))
+				{
+					call.setReplyTo(EPRHelper.fromXML((Element) n, false));
+				}
+	
+				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.RELATES_TO_TAG)))
+				{
+    					try
+    					{
+    						call.setRelatesTo(new URI(n.getTextContent()));
+    					}
+    					catch (URISyntaxException e)
+    					{
+    						throw new UnmarshalException("'" + XMLUtil.RELATES_TO_TAG
+    								+ "' must be a valid URI", e);
+    					}
+    					catch (Exception ex)
+    					{
+    						throw new UnmarshalException("'" + XMLUtil.RELATES_TO_TAG
+    						+ "' has invalid content", ex);
+    					}
+				}
+	
+				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.FAULT_TO_TAG)))
+				{
+					call.setFaultTo(EPRHelper.fromXML((Element) n, false));
+				}
+	
+				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.ACTION_TAG)))
+				{
+					try
+					{
+						call.setAction(new URI(n.getTextContent()));
+					}
+					catch (URISyntaxException e)
+					{
+						throw new UnmarshalException("'" + XMLUtil.ACTION_TAG
+								+ "' must be a valid URI", e);
+					}
+					catch (Exception ex)
+					{
+						throw new UnmarshalException("'" + XMLUtil.ACTION_TAG
+						+ "' has invalid content", ex);
+					}
+				}
+	
+				if (n.getPrefix().equals(XMLUtil.WSA_PREFIX) && (n.getLocalName().equals(XMLUtil.MESSAGE_IDENTIFIER_TAG)))
+				{
+					try
+					{
+						call.setMessageID(new URI(n.getTextContent()));
+					}
+					catch (URISyntaxException e)
+					{
+						throw new UnmarshalException("'"
+								+ XMLUtil.MESSAGE_IDENTIFIER_TAG
+								+ "' must be a valid URI", e);
+					}
+					catch (Exception ex)
+					{
+						throw new UnmarshalException("'" + XMLUtil.MESSAGE_IDENTIFIER_TAG
+						+ "' has invalid content", ex);
+					}
+				}
+			}
+		}
+
+		return call;
+	}
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,415 +0,0 @@
-package org.jboss.internal.soa.esb.addressing.helpers;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.StringWriter;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.XMLUtil;
-import org.jboss.soa.esb.addressing.eprs.EmailEpr;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
-import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
-public class EPRHelper
-{
-	public static final String EPR_TYPE = "type";
-
-	/**
-	 * Serialize the EPR to an XML representation.
-	 * 
-	 * @param epr
-	 * @param doc
-	 * @param header
-	 * @return
-	 */
-
-	public static final Element toXML(EPR epr, Document doc, Element header,
-			Element packElement) throws MarshalException
-	{
-		return toXML(epr, doc, header, packElement, false);
-	}
-
-	/**
-	 * Serialize the EPR to an XML representation. Specify whether this is a To
-	 * node in the Call.
-	 * 
-	 * @param epr
-	 * @param doc
-	 * @param header
-	 * @return
-	 */
-
-	public static final Element toXML(EPR epr, Document doc, Element header,
-			Element packElement, boolean to) throws MarshalException
-	{
-		AssertArgument.isNotNull(epr, "epr");
-
-		// TODO
-		// The EPR type really should be doing this itself.
-
-		setSpecificEPR(epr);
-		PortReferenceHelper.toXML(header, doc, packElement, epr.getAddr(), to);
-
-		return header;
-	}
-
-	/**
-	 * Deserialize the EPR from an XML representation.
-	 * 
-	 * @param header
-	 * @return
-	 */
-
-	public static final EPR fromXML(Element header) throws UnmarshalException
-	{
-		return fromXML(header, false);
-	}
-
-	/**
-	 * Deserialize the EPR from an XML representation. Specify whether this is a
-	 * To node in the Call.
-	 * 
-	 * @param header
-	 * @return
-	 */
-
-	public static final EPR fromXML(Element header, boolean to)
-			throws UnmarshalException
-	{
-		AssertArgument.isNotNull(header, "header");
-
-		if (to)
-		{
-			NodeList children = header.getChildNodes();
-
-			for (int i = 0; i < children.getLength(); i++)
-			{
-				Node n = children.item(i);
-
-				if (n instanceof Element)
-				{
-					Element el = (Element) n;
-					String prefix = el.getPrefix();
-					String tag = el.getLocalName();
-					
-					if ((prefix != null) && (prefix.equals(XMLUtil.WSA_PREFIX)))
-					{
-						if ((tag != null) && (tag.equals(XMLUtil.TO_TAG)))
-						{
-							return getSpecificEPR(new EPR(PortReferenceHelper
-									.fromXML(el, true)), header);
-						}
-					}
-				}
-			}
-		}
-
-		return getSpecificEPR(new EPR(PortReferenceHelper.fromXML(header, to)));
-	}
-
-	/**
-	 * Create a string version of the XML representation for this EPR. If the
-	 * EPR is a specific type (e.g., JMSEpr) then that type information will
-	 * also be encoded.
-	 * 
-	 * @param epr
-	 * @return
-	 * @throws MarshalException 
-	 */
-
-	public static final String toXMLString(EPR epr) throws MarshalException
-	{
-		return toXMLString(epr, false, XMLUtil.FROM_TAG);
-	}
-
-	/**
-	 * Create a string version of the XML representation for this EPR. If the
-	 * EPR is a specific type (e.g., JMSEpr) then that type information will
-	 * also be encoded. Specify whether this is a To node in the Call.
-	 * 
-	 * @param epr
-	 * @return
-	 * @throws MarshalException 
-	 */
-
-	public static final String toXMLString(EPR epr, boolean to, String tag) throws MarshalException
-	{
-		AssertArgument.isNotNull(epr, "epr");
-		AssertArgument.isNotNull(tag, "tag");
-
-		try
-		{
-			DocumentBuilderFactory factory = DocumentBuilderFactory
-					.newInstance();
-			
-			factory.setNamespaceAware(true);
-			
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			Document doc = builder.newDocument();
-			Element portReferenceElement = doc.createElementNS(
-					XMLUtil.WSA_NAMESPACE_URI, tag);
-			
-			setSpecificEPR(epr);
-
-			if (to)
-			{
-				Element header = doc.createElement("header");
-				doc.appendChild(header);
-				header.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
-						+ XMLUtil.WSA_PREFIX, XMLUtil.WSA_NAMESPACE_URI);
-				toXML(epr, doc, header, portReferenceElement, to);
-				header.appendChild(portReferenceElement);
-			}
-			else
-			{
-				portReferenceElement.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
-						+ XMLUtil.WSA_PREFIX, XMLUtil.WSA_NAMESPACE_URI);
-				
-				doc.appendChild(portReferenceElement);
-				toXML(epr, doc, portReferenceElement, portReferenceElement, to);
-			}
-
-			StringWriter sWriter = new StringWriter();
-			OutputFormat format = new OutputFormat();
-			format.setIndenting(true);
-
-			XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-
-			xmlS.asDOMSerializer();
-			xmlS.serialize(doc);
-
-			return sWriter.toString();
-		}
-		catch (ParserConfigurationException ex)
-		{
-			throw new MarshalException("Failed to construct DOM Document Builder.", ex);
-		}
-		catch (IOException ex)
-		{
-			throw new MarshalException("Error during DOM to String serialisation.", ex);
-		}
-	}
-
-	/**
-	 * Get the EPR from the string representation. If the EPR was a specific
-	 * type (e.g., JMSEpr) then it will be returned as an instance of the
-	 * appropriate class.
-	 * 
-	 * @param xml
-	 * @return
-	 * @throws UnmarshalException 
-	 */
-
-	public static final EPR fromXMLString(String xml) throws UnmarshalException
-	{
-		return fromXMLString(xml, false);
-	}
-
-	/**
-	 * Get the EPR from the string representation. If the EPR was a specific
-	 * type (e.g., JMSEpr) then it will be returned as an instance of the
-	 * appropriate class. Specify whether this is a To node in the Call.
-	 * 
-	 * @param xml
-	 * @return
-	 * @throws UnmarshalException 
-	 */
-
-	public static final EPR fromXMLString(String xml, boolean to) throws UnmarshalException
-	{
-		AssertArgument.isNotNull(xml, "xml");
-
-		try
-		{
-			DocumentBuilderFactory factory = DocumentBuilderFactory
-					.newInstance();
-			
-			factory.setNamespaceAware(true);
-			
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			Document doc = builder.parse(new ByteArrayInputStream(xml
-					.getBytes()));
-			Element rootElement = (Element) doc.getDocumentElement();
-
-			return fromXML(rootElement, to);
-		}
-		catch (SAXException ex)
-		{
-			throw new UnmarshalException("Unable to parse EPR XML.", ex);
-		}
-		catch (IOException ex)
-		{
-			throw new UnmarshalException("Unable to read EPR XML stream.", ex);
-		}
-		catch (ParserConfigurationException ex)
-		{
-			throw new UnmarshalException("Failed to construct DOM Document Builder.", ex);
-		}
-	}
-
-	private final static void setSpecificEPR(EPR epr)
-	{
-		String eprType = null;
-
-		/*
-		 * Do not re-order.
-		 */
-
-		if (epr instanceof EmailEpr)
-			eprType = EmailEpr.type().toString();
-		else if (epr instanceof SFTPEpr)
-			eprType = SFTPEpr.type().toString();
-		else if (epr instanceof HTTPEpr)
-			eprType = HTTPEpr.type().toString();
-		else if (epr instanceof JDBCEpr)
-			eprType = JDBCEpr.type().toString();
-		else if (epr instanceof HibernateEpr)
-			eprType = HibernateEpr.type().toString();
-		else if (epr instanceof JMSEpr)
-			eprType = JMSEpr.type().toString();
-		else if (epr instanceof FTPEpr)
-			eprType = FTPEpr.type().toString();
-		else if (epr instanceof FileEpr)
-			eprType = FileEpr.type().toString();
-
-		if (eprType != null)
-		{
-			if (epr.getAddr().getExtensionValue(EPR_TYPE) == null) {
-				epr.getAddr().addExtension(EPR_TYPE, eprType);
-			}
-		}
-	}
-
-	private final static EPR getSpecificEPR(EPR epr)
-	{
-		String eprType = epr.getAddr().getExtensionValue(EPR_TYPE);
-
-		if (eprType != null)
-		{
-			/*
-			 * Do not re-order.
-			 */
-
-			if (eprType.equals(EmailEpr.type().toString()))
-				return new EmailEpr(epr);
-			else if (eprType.equals(SFTPEpr.type().toString()))
-				return new SFTPEpr(epr);
-			else if (eprType.equals(HTTPEpr.type().toString()))
-				return new HTTPEpr(epr);
-			else if (eprType.equals(JDBCEpr.type().toString()))
-				return new JDBCEpr(epr);
-			else if (eprType.equals(HibernateEpr.type().toString()))
-				return new HibernateEpr(epr);
-			else if (eprType.equals(JMSEpr.type().toString()))
-				return new JMSEpr(epr);
-			else if (eprType.equals(FTPEpr.type().toString()))
-				return new FTPEpr(epr);
-			else if (eprType.equals(FileEpr.type().toString()))
-				return new FileEpr(epr);
-			else
-				return epr;
-		} else {
-			return epr;
-		}
-	}
-
-	/**
-	 * Because of WS-A rules, if this was a To node then all of the elements
-	 * within the EPR are now at top-level in the header and not easily
-	 * obtained. We need to ask each EPR type to reconstitute itself.
-	 * 
-	 * @param epr
-	 * @param header
-	 * @return
-	 */
-
-	private final static EPR getSpecificEPR(EPR epr, Element header)
-	{
-		NodeList children = header.getChildNodes();
-		String eprType = null;
-
-		for (int i = 0; i < children.getLength(); i++)
-		{
-			String prefix = children.item(i).getPrefix();
-			String tag = children.item(i).getLocalName();
-			
-			if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
-			{
-				if ((tag != null) && (tag.equals(EPR_TYPE)))
-				{
-					eprType = children.item(i).getTextContent();
-				}
-			}
-		}
-
-		if (eprType != null)
-		{
-			/*
-			 * Do not re-order.
-			 */
-
-			if (eprType.equals(EmailEpr.type().toString()))
-				return new EmailEpr(epr, header);
-			else if (eprType.equals(SFTPEpr.type().toString()))
-				return new SFTPEpr(epr, header);
-			else if (eprType.equals(HTTPEpr.type().toString()))
-				return new HTTPEpr(epr, header);
-			else if (eprType.equals(JDBCEpr.type().toString()))
-				return new JDBCEpr(epr, header);
-			else if (eprType.equals(HibernateEpr.type().toString()))
-				return new HibernateEpr(epr, header);
-			else if (eprType.equals(JMSEpr.type().toString()))
-				return new JMSEpr(epr, header);
-			else if (eprType.equals(FTPEpr.type().toString()))
-				return new FTPEpr(epr, header);
-			else if (eprType.equals(FileEpr.type().toString()))
-				return new FileEpr(epr, header);
-			else
-				return epr;
-		} else {
-			return epr;
-		}
-	}
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/EPRHelper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,415 @@
+package org.jboss.internal.soa.esb.addressing.helpers;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.jboss.soa.esb.addressing.eprs.EmailEpr;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+public class EPRHelper
+{
+	public static final String EPR_TYPE = "type";
+
+	/**
+	 * Serialize the EPR to an XML representation.
+	 * 
+	 * @param epr
+	 * @param doc
+	 * @param header
+	 * @return
+	 */
+
+	public static final Element toXML(EPR epr, Document doc, Element header,
+			Element packElement) throws MarshalException
+	{
+		return toXML(epr, doc, header, packElement, false);
+	}
+
+	/**
+	 * Serialize the EPR to an XML representation. Specify whether this is a To
+	 * node in the Call.
+	 * 
+	 * @param epr
+	 * @param doc
+	 * @param header
+	 * @return
+	 */
+
+	public static final Element toXML(EPR epr, Document doc, Element header,
+			Element packElement, boolean to) throws MarshalException
+	{
+		AssertArgument.isNotNull(epr, "epr");
+
+		// TODO
+		// The EPR type really should be doing this itself.
+
+		setSpecificEPR(epr);
+		PortReferenceHelper.toXML(header, doc, packElement, epr.getAddr(), to);
+
+		return header;
+	}
+
+	/**
+	 * Deserialize the EPR from an XML representation.
+	 * 
+	 * @param header
+	 * @return
+	 */
+
+	public static final EPR fromXML(Element header) throws UnmarshalException
+	{
+		return fromXML(header, false);
+	}
+
+	/**
+	 * Deserialize the EPR from an XML representation. Specify whether this is a
+	 * To node in the Call.
+	 * 
+	 * @param header
+	 * @return
+	 */
+
+	public static final EPR fromXML(Element header, boolean to)
+			throws UnmarshalException
+	{
+		AssertArgument.isNotNull(header, "header");
+
+		if (to)
+		{
+			NodeList children = header.getChildNodes();
+
+			for (int i = 0; i < children.getLength(); i++)
+			{
+				Node n = children.item(i);
+
+				if (n instanceof Element)
+				{
+					Element el = (Element) n;
+					String prefix = el.getPrefix();
+					String tag = el.getLocalName();
+					
+					if ((prefix != null) && (prefix.equals(XMLUtil.WSA_PREFIX)))
+					{
+						if ((tag != null) && (tag.equals(XMLUtil.TO_TAG)))
+						{
+							return getSpecificEPR(new EPR(PortReferenceHelper
+									.fromXML(el, true)), header);
+						}
+					}
+				}
+			}
+		}
+
+		return getSpecificEPR(new EPR(PortReferenceHelper.fromXML(header, to)));
+	}
+
+	/**
+	 * Create a string version of the XML representation for this EPR. If the
+	 * EPR is a specific type (e.g., JMSEpr) then that type information will
+	 * also be encoded.
+	 * 
+	 * @param epr
+	 * @return
+	 * @throws MarshalException 
+	 */
+
+	public static final String toXMLString(EPR epr) throws MarshalException
+	{
+		return toXMLString(epr, false, XMLUtil.FROM_TAG);
+	}
+
+	/**
+	 * Create a string version of the XML representation for this EPR. If the
+	 * EPR is a specific type (e.g., JMSEpr) then that type information will
+	 * also be encoded. Specify whether this is a To node in the Call.
+	 * 
+	 * @param epr
+	 * @return
+	 * @throws MarshalException 
+	 */
+
+	public static final String toXMLString(EPR epr, boolean to, String tag) throws MarshalException
+	{
+		AssertArgument.isNotNull(epr, "epr");
+		AssertArgument.isNotNull(tag, "tag");
+
+		try
+		{
+			DocumentBuilderFactory factory = DocumentBuilderFactory
+					.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			Document doc = builder.newDocument();
+			Element portReferenceElement = doc.createElementNS(
+					XMLUtil.WSA_NAMESPACE_URI, tag);
+			
+			setSpecificEPR(epr);
+
+			if (to)
+			{
+				Element header = doc.createElement("header");
+				doc.appendChild(header);
+				header.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
+						+ XMLUtil.WSA_PREFIX, XMLUtil.WSA_NAMESPACE_URI);
+				toXML(epr, doc, header, portReferenceElement, to);
+				header.appendChild(portReferenceElement);
+			}
+			else
+			{
+				portReferenceElement.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
+						+ XMLUtil.WSA_PREFIX, XMLUtil.WSA_NAMESPACE_URI);
+				
+				doc.appendChild(portReferenceElement);
+				toXML(epr, doc, portReferenceElement, portReferenceElement, to);
+			}
+
+			StringWriter sWriter = new StringWriter();
+			OutputFormat format = new OutputFormat();
+			format.setIndenting(true);
+
+			XMLSerializer xmlS = new XMLSerializer(sWriter, format);
+
+			xmlS.asDOMSerializer();
+			xmlS.serialize(doc);
+
+			return sWriter.toString();
+		}
+		catch (ParserConfigurationException ex)
+		{
+			throw new MarshalException("Failed to construct DOM Document Builder.", ex);
+		}
+		catch (IOException ex)
+		{
+			throw new MarshalException("Error during DOM to String serialisation.", ex);
+		}
+	}
+
+	/**
+	 * Get the EPR from the string representation. If the EPR was a specific
+	 * type (e.g., JMSEpr) then it will be returned as an instance of the
+	 * appropriate class.
+	 * 
+	 * @param xml
+	 * @return
+	 * @throws UnmarshalException 
+	 */
+
+	public static final EPR fromXMLString(String xml) throws UnmarshalException
+	{
+		return fromXMLString(xml, false);
+	}
+
+	/**
+	 * Get the EPR from the string representation. If the EPR was a specific
+	 * type (e.g., JMSEpr) then it will be returned as an instance of the
+	 * appropriate class. Specify whether this is a To node in the Call.
+	 * 
+	 * @param xml
+	 * @return
+	 * @throws UnmarshalException 
+	 */
+
+	public static final EPR fromXMLString(String xml, boolean to) throws UnmarshalException
+	{
+		AssertArgument.isNotNull(xml, "xml");
+
+		try
+		{
+			DocumentBuilderFactory factory = DocumentBuilderFactory
+					.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			Document doc = builder.parse(new ByteArrayInputStream(xml
+					.getBytes()));
+			Element rootElement = (Element) doc.getDocumentElement();
+
+			return fromXML(rootElement, to);
+		}
+		catch (SAXException ex)
+		{
+			throw new UnmarshalException("Unable to parse EPR XML.", ex);
+		}
+		catch (IOException ex)
+		{
+			throw new UnmarshalException("Unable to read EPR XML stream.", ex);
+		}
+		catch (ParserConfigurationException ex)
+		{
+			throw new UnmarshalException("Failed to construct DOM Document Builder.", ex);
+		}
+	}
+
+	private final static void setSpecificEPR(EPR epr)
+	{
+		String eprType = null;
+
+		/*
+		 * Do not re-order.
+		 */
+
+		if (epr instanceof EmailEpr)
+			eprType = EmailEpr.type().toString();
+		else if (epr instanceof SFTPEpr)
+			eprType = SFTPEpr.type().toString();
+		else if (epr instanceof HTTPEpr)
+			eprType = HTTPEpr.type().toString();
+		else if (epr instanceof JDBCEpr)
+			eprType = JDBCEpr.type().toString();
+		else if (epr instanceof HibernateEpr)
+			eprType = HibernateEpr.type().toString();
+		else if (epr instanceof JMSEpr)
+			eprType = JMSEpr.type().toString();
+		else if (epr instanceof FTPEpr)
+			eprType = FTPEpr.type().toString();
+		else if (epr instanceof FileEpr)
+			eprType = FileEpr.type().toString();
+
+		if (eprType != null)
+		{
+			if (epr.getAddr().getExtensionValue(EPR_TYPE) == null) {
+				epr.getAddr().addExtension(EPR_TYPE, eprType);
+			}
+		}
+	}
+
+	private final static EPR getSpecificEPR(EPR epr)
+	{
+		String eprType = epr.getAddr().getExtensionValue(EPR_TYPE);
+
+		if (eprType != null)
+		{
+			/*
+			 * Do not re-order.
+			 */
+
+			if (eprType.equals(EmailEpr.type().toString()))
+				return new EmailEpr(epr);
+			else if (eprType.equals(SFTPEpr.type().toString()))
+				return new SFTPEpr(epr);
+			else if (eprType.equals(HTTPEpr.type().toString()))
+				return new HTTPEpr(epr);
+			else if (eprType.equals(JDBCEpr.type().toString()))
+				return new JDBCEpr(epr);
+			else if (eprType.equals(HibernateEpr.type().toString()))
+				return new HibernateEpr(epr);
+			else if (eprType.equals(JMSEpr.type().toString()))
+				return new JMSEpr(epr);
+			else if (eprType.equals(FTPEpr.type().toString()))
+				return new FTPEpr(epr);
+			else if (eprType.equals(FileEpr.type().toString()))
+				return new FileEpr(epr);
+			else
+				return epr;
+		} else {
+			return epr;
+		}
+	}
+
+	/**
+	 * Because of WS-A rules, if this was a To node then all of the elements
+	 * within the EPR are now at top-level in the header and not easily
+	 * obtained. We need to ask each EPR type to reconstitute itself.
+	 * 
+	 * @param epr
+	 * @param header
+	 * @return
+	 */
+
+	private final static EPR getSpecificEPR(EPR epr, Element header)
+	{
+		NodeList children = header.getChildNodes();
+		String eprType = null;
+
+		for (int i = 0; i < children.getLength(); i++)
+		{
+			String prefix = children.item(i).getPrefix();
+			String tag = children.item(i).getLocalName();
+			
+			if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
+			{
+				if ((tag != null) && (tag.equals(EPR_TYPE)))
+				{
+					eprType = children.item(i).getTextContent();
+				}
+			}
+		}
+
+		if (eprType != null)
+		{
+			/*
+			 * Do not re-order.
+			 */
+
+			if (eprType.equals(EmailEpr.type().toString()))
+				return new EmailEpr(epr, header);
+			else if (eprType.equals(SFTPEpr.type().toString()))
+				return new SFTPEpr(epr, header);
+			else if (eprType.equals(HTTPEpr.type().toString()))
+				return new HTTPEpr(epr, header);
+			else if (eprType.equals(JDBCEpr.type().toString()))
+				return new JDBCEpr(epr, header);
+			else if (eprType.equals(HibernateEpr.type().toString()))
+				return new HibernateEpr(epr, header);
+			else if (eprType.equals(JMSEpr.type().toString()))
+				return new JMSEpr(epr, header);
+			else if (eprType.equals(FTPEpr.type().toString()))
+				return new FTPEpr(epr, header);
+			else if (eprType.equals(FileEpr.type().toString()))
+				return new FileEpr(epr, header);
+			else
+				return epr;
+		} else {
+			return epr;
+		}
+	}
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,433 +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 mark.little at jboss.com
- */
-
-/*
- * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
- *
- * PortReferenceHelper.java
- */
-
-package org.jboss.internal.soa.esb.addressing.helpers;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.Map;
-
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.addressing.PortReference;
-import org.jboss.soa.esb.addressing.XMLUtil;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/*
- * This should pack the PortReference into an ERP.
- * 
- * It would be better if PortReference had a packToXML and unpackFromXML.
- * 
- * This needs rewriting after the interoperability workshop!
- */
-
-public class PortReferenceHelper
-{
-	/**
-	 * WS-Addressing is broken in that the To field is a URI, even if the From
-	 * field was an EPR! You have to use the EPR bits separately. So, the
-	 * toField is used to indicate whether we are packing this address as a To
-	 * field (when we need to treat it differently) or as an EPR.
-	 */
-
-	/** ************************************************** */
-	public static void toXML(org.w3c.dom.Element header,
-			org.w3c.dom.Document document,
-			org.w3c.dom.Element portReferenceElement,
-			PortReference portReference, boolean toField)
-			throws MarshalException
-	{
-		try
-		{
-			if (!toField)
-			{
-				Element addressElement = document.createElementNS(
-						XMLUtil.WSA_NAMESPACE_URI, XMLUtil.ADDRESS_TAG);
-				addressElement.setPrefix(XMLUtil.WSA_PREFIX);
-				addressElement.appendChild(document
-						.createTextNode(portReference.getAddress()));
-				portReferenceElement.appendChild(addressElement);
-			}
-			else
-			{
-				portReferenceElement.appendChild(document
-						.createTextNode(portReference.getAddress()));
-			}
-
-			Iterator extensions = portReference.getExtensions();
-			Element referenceProperties = null;
-
-			while (extensions.hasNext())
-			{
-				PortReference.Extension extension = (PortReference.Extension) extensions
-						.next();
-
-				/*
-				 * WS-Addressing is broken in that the To field is a URI, even
-				 * if the From field was an EPR! You have to use the EPR bits
-				 * separately. Doh!
-				 */
-
-				if (!toField)
-				{
-					if (referenceProperties == null)
-					{
-						referenceProperties = document.createElementNS(
-								XMLUtil.WSA_NAMESPACE_URI,
-								XMLUtil.REFERENCE_PROPERTIES_TAG);
-						referenceProperties.setPrefix(XMLUtil.WSA_PREFIX);
-						portReferenceElement.appendChild(referenceProperties);
-					}
-				}
-				else
-					referenceProperties = header;
-
-				extensionToXML(referenceProperties, document, extension);
-			}
-		}
-		catch (Exception exception)
-		{
-			exception.printStackTrace();
-			throw new MarshalException("Marshal failure: " + exception);
-		}
-	}
-
-	/** **************************** */
-	public static PortReference fromXML(
-			org.w3c.dom.Element portReferenceElement, boolean toField)
-			throws UnmarshalException
-	{
-		PortReference portReference = new PortReference();
-
-		if (toField)
-		{
-			portReference.setAddress(portReferenceElement.getTextContent());
-		}
-		
-		org.w3c.dom.NodeList elements = portReferenceElement.getChildNodes();
-		
-		for (int i = 0; i < elements.getLength(); i++)
-		{
-			final Object extensionObject = elements.item(i);
-			
-			if (extensionObject instanceof Element)
-			{
-				int parentNodeType = PortReference.Extension.NEITHER;
-				Element extensionElement = (Element) extensionObject;
-				NodeList children = extensionElement.getChildNodes();
-				String parentName = extensionElement.getNodeName();
-				boolean haveChildren = false;
-
-				if (parentName.equals(XMLUtil.REFERENCE_PROPERTIES_TAG))
-					parentNodeType = PortReference.Extension.REFERENCE_PROPERTIES;
-				else
-				{
-					if (parentName.equals(XMLUtil.REFERENCE_PARAMETERS_TAG))
-						parentNodeType = PortReference.Extension.REFERENCE_PARAMETERS;
-					else
-					{
-						if (!toField
-								&& parentName.equals(XMLUtil.WSA_PREFIX + ":"
-										+ XMLUtil.ADDRESS_TAG))
-						{
-							portReference.setAddress(extensionElement
-									.getTextContent());
-						}
-					}
-				}
-
-				final int numChildren = children.getLength();
-				
-				for (int count = 0; count < numChildren; count++)
-				{
-					final Object childObject = children.item(count);
-
-					if (childObject instanceof Element)
-					{
-						Element childElement = (Element) childObject;
-
-						portReference
-								.addExtension(childrenFromXML(childElement));
-						haveChildren = true;
-					}
-				}
-
-				if (!haveChildren && !parentName.equals(XMLUtil.WSA_PREFIX + ":"+ XMLUtil.ADDRESS_TAG))
-				{
-					PortReference.Extension ext = new PortReference.Extension(
-							extensionElement.getNodeName(), null, null,
-							extensionElement.getNodeValue(), parentNodeType);
-
-					portReference.addExtension(ext);
-
-					final NamedNodeMap attrs = extensionElement.getAttributes();
-					final int numAttrs = attrs.getLength();
-					if (numAttrs > 0)
-					{
-						final HashMap<ArjunaName, String> p = new HashMap<ArjunaName, String>();
-						for (int count = 0; count < numAttrs; count++)
-						{
-							final Attr attr = (Attr) attrs.item(count);
-							if (!"http://www.w3.org/2000/xmlns/".equals(attr
-									.getNamespaceURI()))
-							{
-								final ArjunaName name = generateName(attr);
-								p.put(name, attr.getValue());
-							}
-						}
-
-						ext.addAttributes(p);
-					}
-				}
-			}
-		}
-
-		return portReference;
-	}
-
-	private final static PortReference.Extension childrenFromXML(
-			Element childRoot)
-	{
-		final NodeList children = childRoot.getChildNodes();
-		final int numChildNodes = children.getLength();
-
-		final PortReference.Extension extension;
-		if (numChildNodes > 0)
-		{
-			Object childObject = children.item(0);
-			if (childObject instanceof Element)
-			{
-				extension = new PortReference.Extension(
-						childRoot.getNodeName(), childRoot.getPrefix(),
-						childRoot.getNamespaceURI());
-				
-				for (int count = 1; count < numChildNodes; count++)
-				{
-					extension.addChild(childrenFromXML((Element) childObject));
-					childObject = children.item(count);
-				}
-			}
-			else
-			{
-				extension = new PortReference.Extension(
-						childRoot.getNodeName(), childRoot.getPrefix(),
-						childRoot.getNamespaceURI(), ((Node) childObject)
-								.getNodeValue());
-			}
-		}
-		else
-		{
-			extension = new PortReference.Extension(childRoot.getNodeName(),
-					childRoot.getPrefix(), childRoot.getNamespaceURI(),
-					childRoot.getNodeValue());
-		}
-
-		final NamedNodeMap attrs = childRoot.getAttributes();
-		final int numAttrs = attrs.getLength();
-		if (numAttrs > 0)
-		{
-			final HashMap<ArjunaName, String> p = new HashMap<ArjunaName, String>();
-			for (int count = 0; count < numAttrs; count++)
-			{
-				final Attr attr = (Attr) attrs.item(count);
-				if (!"http://www.w3.org/2000/xmlns/".equals(attr
-						.getNamespaceURI()))
-				{
-					final ArjunaName name = generateName(attr);
-					p.put(name, attr.getValue());
-				}
-			}
-
-			extension.addAttributes(p);
-		}
-		return extension;
-	}
-
-	private final static Element extensionToXML(Element packInto,
-			org.w3c.dom.Document document, PortReference.Extension toPack)
-			throws MarshalException
-	{
-		final String uri = toPack.getURI();
-		final Element element;
-		if (uri == null)
-		{
-			element = document.createElement(toPack.getTag());
-		}
-		else
-		{
-			final String prefix = toPack.getPrefix();
-			element = document.createElementNS(uri, toPack.getTag());
-			element.setPrefix(prefix);
-			element.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
-					+ toPack.getPrefix(), uri);
-		}
-		packInto.appendChild(element);
-
-		if (toPack.getValue() != null)
-		{
-			final Text text = document.createTextNode(toPack.getValue());
-			element.appendChild(text);
-		}
-
-		LinkedList extensions = toPack.getChildren();
-
-		if (extensions != null)
-		{
-			for (int i = 0; i < extensions.size(); i++)
-			{
-				PortReference.Extension ext = (PortReference.Extension) extensions
-						.get(i);
-
-				extensionToXML(element, document, ext);
-			}
-		}
-
-		HashMap attrs = toPack.getAttributes();
-
-		if (attrs != null)
-		{
-			Iterator names = attrs.entrySet().iterator();
-
-			while (names.hasNext())
-			{
-				Map.Entry entry = (Map.Entry) names.next();
-				ArjunaName name = (ArjunaName) entry.getKey();
-				final String value = (String) entry.getValue();
-				final String attrURI = name.getURI();
-				if (attrURI != null)
-				{
-					element.setAttributeNS(attrURI, name.getQualifiedName(),
-							value);
-				}
-				else
-				{
-					element.setAttribute(name.getQualifiedName(), value);
-				}
-			}
-		}
-
-		return element;
-	}
-
-	/**
-	 * Generate a name based on the attribute.
-	 * 
-	 * @param attr
-	 *            The current attribute.
-	 * @return The name
-	 */
-	private static ArjunaName generateName(final Attr attr)
-	{
-		final String localName = attr.getNodeName();
-		final String uri = attr.getNamespaceURI();
-		final String prefix = attr.getPrefix();
-
-		return new ArjunaName(uri, prefix, localName);
-	}
-
-	private static class ArjunaName
-	{
-		/**
-		 * The uri.
-		 */
-		private final String uri;
-
-		/**
-		 * The prefix.
-		 */
-		private final String prefix;
-
-		/**
-		 * The local name.
-		 */
-		private final String localName;
-
-		/**
-		 * Construct the name.
-		 * 
-		 * @param uri
-		 *            The uri.
-		 * @param prefix
-		 *            The prefix.
-		 * @param localName
-		 *            The local name.
-		 */
-		public ArjunaName(final String uri, final String prefix,
-				final String localName)
-		{
-			this.uri = uri;
-			this.prefix = prefix;
-			this.localName = localName;
-		}
-
-		/**
-		 * Get the uri.
-		 * 
-		 * @return the uri.
-		 */
-		public String getURI()
-		{
-			return uri;
-		}
-
-		/**
-		 * Get the prefix.
-		 * 
-		 * @return the prefix.
-		 */
-		public String getPrefix()
-		{
-			return prefix;
-		}
-
-		/**
-		 * Get the local name.
-		 * 
-		 * @return the local name.
-		 */
-		public String getLocalName()
-		{
-			return localName;
-		}
-
-		/**
-		 * Get the qualified name.
-		 * 
-		 * @return the qualified name.
-		 */
-		public String getQualifiedName()
-		{
-			return (prefix == null ? localName : prefix + ":" + localName);
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/addressing/helpers/PortReferenceHelper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,433 @@
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/*
+ * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
+ *
+ * PortReferenceHelper.java
+ */
+
+package org.jboss.internal.soa.esb.addressing.helpers;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.Map;
+
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+/*
+ * This should pack the PortReference into an ERP.
+ * 
+ * It would be better if PortReference had a packToXML and unpackFromXML.
+ * 
+ * This needs rewriting after the interoperability workshop!
+ */
+
+public class PortReferenceHelper
+{
+	/**
+	 * WS-Addressing is broken in that the To field is a URI, even if the From
+	 * field was an EPR! You have to use the EPR bits separately. So, the
+	 * toField is used to indicate whether we are packing this address as a To
+	 * field (when we need to treat it differently) or as an EPR.
+	 */
+
+	/** ************************************************** */
+	public static void toXML(org.w3c.dom.Element header,
+			org.w3c.dom.Document document,
+			org.w3c.dom.Element portReferenceElement,
+			PortReference portReference, boolean toField)
+			throws MarshalException
+	{
+		try
+		{
+			if (!toField)
+			{
+				Element addressElement = document.createElementNS(
+						XMLUtil.WSA_NAMESPACE_URI, XMLUtil.ADDRESS_TAG);
+				addressElement.setPrefix(XMLUtil.WSA_PREFIX);
+				addressElement.appendChild(document
+						.createTextNode(portReference.getAddress()));
+				portReferenceElement.appendChild(addressElement);
+			}
+			else
+			{
+				portReferenceElement.appendChild(document
+						.createTextNode(portReference.getAddress()));
+			}
+
+			Iterator extensions = portReference.getExtensions();
+			Element referenceProperties = null;
+
+			while (extensions.hasNext())
+			{
+				PortReference.Extension extension = (PortReference.Extension) extensions
+						.next();
+
+				/*
+				 * WS-Addressing is broken in that the To field is a URI, even
+				 * if the From field was an EPR! You have to use the EPR bits
+				 * separately. Doh!
+				 */
+
+				if (!toField)
+				{
+					if (referenceProperties == null)
+					{
+						referenceProperties = document.createElementNS(
+								XMLUtil.WSA_NAMESPACE_URI,
+								XMLUtil.REFERENCE_PROPERTIES_TAG);
+						referenceProperties.setPrefix(XMLUtil.WSA_PREFIX);
+						portReferenceElement.appendChild(referenceProperties);
+					}
+				}
+				else
+					referenceProperties = header;
+
+				extensionToXML(referenceProperties, document, extension);
+			}
+		}
+		catch (Exception exception)
+		{
+			exception.printStackTrace();
+			throw new MarshalException("Marshal failure: " + exception);
+		}
+	}
+
+	/** **************************** */
+	public static PortReference fromXML(
+			org.w3c.dom.Element portReferenceElement, boolean toField)
+			throws UnmarshalException
+	{
+		PortReference portReference = new PortReference();
+
+		if (toField)
+		{
+			portReference.setAddress(portReferenceElement.getTextContent());
+		}
+		
+		org.w3c.dom.NodeList elements = portReferenceElement.getChildNodes();
+		
+		for (int i = 0; i < elements.getLength(); i++)
+		{
+			final Object extensionObject = elements.item(i);
+			
+			if (extensionObject instanceof Element)
+			{
+				int parentNodeType = PortReference.Extension.NEITHER;
+				Element extensionElement = (Element) extensionObject;
+				NodeList children = extensionElement.getChildNodes();
+				String parentName = extensionElement.getNodeName();
+				boolean haveChildren = false;
+
+				if (parentName.equals(XMLUtil.REFERENCE_PROPERTIES_TAG))
+					parentNodeType = PortReference.Extension.REFERENCE_PROPERTIES;
+				else
+				{
+					if (parentName.equals(XMLUtil.REFERENCE_PARAMETERS_TAG))
+						parentNodeType = PortReference.Extension.REFERENCE_PARAMETERS;
+					else
+					{
+						if (!toField
+								&& parentName.equals(XMLUtil.WSA_PREFIX + ":"
+										+ XMLUtil.ADDRESS_TAG))
+						{
+							portReference.setAddress(extensionElement
+									.getTextContent());
+						}
+					}
+				}
+
+				final int numChildren = children.getLength();
+				
+				for (int count = 0; count < numChildren; count++)
+				{
+					final Object childObject = children.item(count);
+
+					if (childObject instanceof Element)
+					{
+						Element childElement = (Element) childObject;
+
+						portReference
+								.addExtension(childrenFromXML(childElement));
+						haveChildren = true;
+					}
+				}
+
+				if (!haveChildren && !parentName.equals(XMLUtil.WSA_PREFIX + ":"+ XMLUtil.ADDRESS_TAG))
+				{
+					PortReference.Extension ext = new PortReference.Extension(
+							extensionElement.getNodeName(), null, null,
+							extensionElement.getNodeValue(), parentNodeType);
+
+					portReference.addExtension(ext);
+
+					final NamedNodeMap attrs = extensionElement.getAttributes();
+					final int numAttrs = attrs.getLength();
+					if (numAttrs > 0)
+					{
+						final HashMap<ArjunaName, String> p = new HashMap<ArjunaName, String>();
+						for (int count = 0; count < numAttrs; count++)
+						{
+							final Attr attr = (Attr) attrs.item(count);
+							if (!"http://www.w3.org/2000/xmlns/".equals(attr
+									.getNamespaceURI()))
+							{
+								final ArjunaName name = generateName(attr);
+								p.put(name, attr.getValue());
+							}
+						}
+
+						ext.addAttributes(p);
+					}
+				}
+			}
+		}
+
+		return portReference;
+	}
+
+	private final static PortReference.Extension childrenFromXML(
+			Element childRoot)
+	{
+		final NodeList children = childRoot.getChildNodes();
+		final int numChildNodes = children.getLength();
+
+		final PortReference.Extension extension;
+		if (numChildNodes > 0)
+		{
+			Object childObject = children.item(0);
+			if (childObject instanceof Element)
+			{
+				extension = new PortReference.Extension(
+						childRoot.getNodeName(), childRoot.getPrefix(),
+						childRoot.getNamespaceURI());
+				
+				for (int count = 1; count < numChildNodes; count++)
+				{
+					extension.addChild(childrenFromXML((Element) childObject));
+					childObject = children.item(count);
+				}
+			}
+			else
+			{
+				extension = new PortReference.Extension(
+						childRoot.getNodeName(), childRoot.getPrefix(),
+						childRoot.getNamespaceURI(), ((Node) childObject)
+								.getNodeValue());
+			}
+		}
+		else
+		{
+			extension = new PortReference.Extension(childRoot.getNodeName(),
+					childRoot.getPrefix(), childRoot.getNamespaceURI(),
+					childRoot.getNodeValue());
+		}
+
+		final NamedNodeMap attrs = childRoot.getAttributes();
+		final int numAttrs = attrs.getLength();
+		if (numAttrs > 0)
+		{
+			final HashMap<ArjunaName, String> p = new HashMap<ArjunaName, String>();
+			for (int count = 0; count < numAttrs; count++)
+			{
+				final Attr attr = (Attr) attrs.item(count);
+				if (!"http://www.w3.org/2000/xmlns/".equals(attr
+						.getNamespaceURI()))
+				{
+					final ArjunaName name = generateName(attr);
+					p.put(name, attr.getValue());
+				}
+			}
+
+			extension.addAttributes(p);
+		}
+		return extension;
+	}
+
+	private final static Element extensionToXML(Element packInto,
+			org.w3c.dom.Document document, PortReference.Extension toPack)
+			throws MarshalException
+	{
+		final String uri = toPack.getURI();
+		final Element element;
+		if (uri == null)
+		{
+			element = document.createElement(toPack.getTag());
+		}
+		else
+		{
+			final String prefix = toPack.getPrefix();
+			element = document.createElementNS(uri, toPack.getTag());
+			element.setPrefix(prefix);
+			element.setAttributeNS(XMLUtil.XMLNS_URI, XMLUtil.XMLNS_PREFIX
+					+ toPack.getPrefix(), uri);
+		}
+		packInto.appendChild(element);
+
+		if (toPack.getValue() != null)
+		{
+			final Text text = document.createTextNode(toPack.getValue());
+			element.appendChild(text);
+		}
+
+		LinkedList extensions = toPack.getChildren();
+
+		if (extensions != null)
+		{
+			for (int i = 0; i < extensions.size(); i++)
+			{
+				PortReference.Extension ext = (PortReference.Extension) extensions
+						.get(i);
+
+				extensionToXML(element, document, ext);
+			}
+		}
+
+		HashMap attrs = toPack.getAttributes();
+
+		if (attrs != null)
+		{
+			Iterator names = attrs.entrySet().iterator();
+
+			while (names.hasNext())
+			{
+				Map.Entry entry = (Map.Entry) names.next();
+				ArjunaName name = (ArjunaName) entry.getKey();
+				final String value = (String) entry.getValue();
+				final String attrURI = name.getURI();
+				if (attrURI != null)
+				{
+					element.setAttributeNS(attrURI, name.getQualifiedName(),
+							value);
+				}
+				else
+				{
+					element.setAttribute(name.getQualifiedName(), value);
+				}
+			}
+		}
+
+		return element;
+	}
+
+	/**
+	 * Generate a name based on the attribute.
+	 * 
+	 * @param attr
+	 *            The current attribute.
+	 * @return The name
+	 */
+	private static ArjunaName generateName(final Attr attr)
+	{
+		final String localName = attr.getNodeName();
+		final String uri = attr.getNamespaceURI();
+		final String prefix = attr.getPrefix();
+
+		return new ArjunaName(uri, prefix, localName);
+	}
+
+	private static class ArjunaName
+	{
+		/**
+		 * The uri.
+		 */
+		private final String uri;
+
+		/**
+		 * The prefix.
+		 */
+		private final String prefix;
+
+		/**
+		 * The local name.
+		 */
+		private final String localName;
+
+		/**
+		 * Construct the name.
+		 * 
+		 * @param uri
+		 *            The uri.
+		 * @param prefix
+		 *            The prefix.
+		 * @param localName
+		 *            The local name.
+		 */
+		public ArjunaName(final String uri, final String prefix,
+				final String localName)
+		{
+			this.uri = uri;
+			this.prefix = prefix;
+			this.localName = localName;
+		}
+
+		/**
+		 * Get the uri.
+		 * 
+		 * @return the uri.
+		 */
+		public String getURI()
+		{
+			return uri;
+		}
+
+		/**
+		 * Get the prefix.
+		 * 
+		 * @return the prefix.
+		 */
+		public String getPrefix()
+		{
+			return prefix;
+		}
+
+		/**
+		 * Get the local name.
+		 * 
+		 * @return the local name.
+		 */
+		public String getLocalName()
+		{
+			return localName;
+		}
+
+		/**
+		 * Get the qualified name.
+		 * 
+		 * @return the qualified name.
+		 */
+		public String getQualifiedName()
+		{
+			return (prefix == null ? localName : prefix + ":" + localName);
+		}
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,70 +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
- */
-
-package org.jboss.internal.soa.esb.assertion;
-
-/**
- * Argument assertion utilities.
- * <p/>
- * <b>Copied from <a href="http://www.milyn.org">milyn.org</a></b>.
- *  
- * @author tfennelly
- */
-public abstract class AssertArgument {
-
-	/**
-	 * Assert that the argument is not null.
-	 * @param arg Argument.
-	 * @param argName Argument name.
-	 * @throws IllegalArgumentException Argument is null.
-	 */
-	public static void isNotNull(Object arg, String argName) throws IllegalArgumentException {
-		if (arg == null) {
-			throw new IllegalArgumentException("null '" + argName
-					+ "' arg in method call.");
-		}
-	}
-
-	/**
-	 * Assert that the argument is not empty.
-	 * @param arg Argument.
-	 * @param argName Argument name.
-	 * @throws IllegalArgumentException Argument is not null, but is empty.
-	 */
-	public static void isNotEmpty(String arg, String argName) throws IllegalArgumentException {
-		if (arg != null && arg.trim().equals("")) {
-			throw new IllegalArgumentException("Not null, but empty '"
-					+ argName + "' arg in method call.");
-		}
-	}
-
-	/**
-	 * Assert that the argument is neither null nor empty.
-	 * @param arg Argument.
-	 * @param argName Argument name.
-	 * @throws IllegalArgumentException Argument is null or empty.
-	 */
-	public static void isNotNullAndNotEmpty(String arg, String argName) throws IllegalArgumentException {
-		if (arg == null || arg.trim().equals("")) {
-			throw new IllegalArgumentException("null or empty '" + argName
-					+ "' arg in method call.");
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/assertion/AssertArgument.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,70 @@
+/*
+ * 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
+ */
+
+package org.jboss.internal.soa.esb.assertion;
+
+/**
+ * Argument assertion utilities.
+ * <p/>
+ * <b>Copied from <a href="http://www.milyn.org">milyn.org</a></b>.
+ *  
+ * @author tfennelly
+ */
+public abstract class AssertArgument {
+
+	/**
+	 * Assert that the argument is not null.
+	 * @param arg Argument.
+	 * @param argName Argument name.
+	 * @throws IllegalArgumentException Argument is null.
+	 */
+	public static void isNotNull(Object arg, String argName) throws IllegalArgumentException {
+		if (arg == null) {
+			throw new IllegalArgumentException("null '" + argName
+					+ "' arg in method call.");
+		}
+	}
+
+	/**
+	 * Assert that the argument is not empty.
+	 * @param arg Argument.
+	 * @param argName Argument name.
+	 * @throws IllegalArgumentException Argument is not null, but is empty.
+	 */
+	public static void isNotEmpty(String arg, String argName) throws IllegalArgumentException {
+		if (arg != null && arg.trim().equals("")) {
+			throw new IllegalArgumentException("Not null, but empty '"
+					+ argName + "' arg in method call.");
+		}
+	}
+
+	/**
+	 * Assert that the argument is neither null nor empty.
+	 * @param arg Argument.
+	 * @param argName Argument name.
+	 * @throws IllegalArgumentException Argument is null or empty.
+	 */
+	public static void isNotNullAndNotEmpty(String arg, String argName) throws IllegalArgumentException {
+		if (arg == null || arg.trim().equals("")) {
+			throw new IllegalArgumentException("null or empty '" + argName
+					+ "' arg in method call.");
+		}
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueue.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueue.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueue.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,34 +0,0 @@
-package org.jboss.internal.soa.esb.command;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-/**
- * Command queue abstraction.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public interface CommandQueue {
-
-	/**
-	 * Open the command queue.
-	 * @param config Command queue configuration.
-	 * @throws CommandQueueException Queue exception.  Check for probable chained cause exceptions.
-	 */
-	public void open(ConfigTree config) throws CommandQueueException;
-	
-	/**
-	 * Receive a message from the underlying queue implementation.
-	 * <p/>
-	 * Performs a blocking receive on the command queue, controled by the receive timeout.
-	 * @param timeout The receive block timeout.  Zero to block indefinitely.
-	 * @return The command message from the queue.
-	 * @throws CommandQueueException Queue exception.  Check for probable chained cause exceptions.
-	 */
-	public String receiveCommand(long timeout) throws CommandQueueException;
-	
-	/**
-	 * Close the command queue.
-	 * @throws CommandQueueException Queue exception.  Check for probable chained cause exceptions.
-	 */
-	public void close() throws CommandQueueException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueue.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueue.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueue.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueue.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,34 @@
+package org.jboss.internal.soa.esb.command;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+/**
+ * Command queue abstraction.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public interface CommandQueue {
+
+	/**
+	 * Open the command queue.
+	 * @param config Command queue configuration.
+	 * @throws CommandQueueException Queue exception.  Check for probable chained cause exceptions.
+	 */
+	public void open(ConfigTree config) throws CommandQueueException;
+	
+	/**
+	 * Receive a message from the underlying queue implementation.
+	 * <p/>
+	 * Performs a blocking receive on the command queue, controled by the receive timeout.
+	 * @param timeout The receive block timeout.  Zero to block indefinitely.
+	 * @return The command message from the queue.
+	 * @throws CommandQueueException Queue exception.  Check for probable chained cause exceptions.
+	 */
+	public String receiveCommand(long timeout) throws CommandQueueException;
+	
+	/**
+	 * Close the command queue.
+	 * @throws CommandQueueException Queue exception.  Check for probable chained cause exceptions.
+	 */
+	public void close() throws CommandQueueException;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueueException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueueException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueueException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,29 +0,0 @@
-package org.jboss.internal.soa.esb.command;
-
-import org.jboss.soa.esb.BaseException;
-
-/**
- * Command queue exception.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class CommandQueueException extends BaseException {
-
-	private static final long serialVersionUID = 1L;
-
-	public CommandQueueException() {
-		super();
-	}
-
-	public CommandQueueException(String message) {
-		super(message);
-	}
-
-	public CommandQueueException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-	public CommandQueueException(Throwable cause) {
-		super(cause);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueueException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueueException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueueException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/CommandQueueException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,29 @@
+package org.jboss.internal.soa.esb.command;
+
+import org.jboss.soa.esb.BaseException;
+
+/**
+ * Command queue exception.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class CommandQueueException extends BaseException {
+
+	private static final long serialVersionUID = 1L;
+
+	public CommandQueueException() {
+		super();
+	}
+
+	public CommandQueueException(String message) {
+		super(message);
+	}
+
+	public CommandQueueException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	public CommandQueueException(Throwable cause) {
+		super(cause);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/InMemoryCommandQueue.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/InMemoryCommandQueue.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/InMemoryCommandQueue.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,111 +0,0 @@
-package org.jboss.internal.soa.esb.command;
-
-import java.util.Hashtable;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-/**
- * In Memory Blocking Command Queue. <p/> Suitable for testing or any other
- * purpose. <p/> The command queue's configuration needs to specify the queue
- * name via a "command-queue-name" attribute supplied in the configuration to
- * the {@link #open(ConfigTree)} method. The queues are stored statically and
- * can be accessed via the {@link #getQueue(String)} method using the queue
- * name.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class InMemoryCommandQueue implements CommandQueue
-{
-
-	/**
-	 * Command queue name attribute name.
-	 */
-	public static final String COMMAND_QUEUE_NAME = "command-queue-name";
-
-	private static Hashtable<String, InMemoryCommandQueue> commandQueues = new Hashtable<String, InMemoryCommandQueue>();
-
-	private String name;
-
-	private BlockingQueue<String> queue = new LinkedBlockingQueue<String>();
-
-	public void open(ConfigTree config) throws CommandQueueException
-	{
-		if (config == null)
-		{
-			throw new IllegalArgumentException(
-					"null 'config' arg in method call.");
-		}
-
-		name = config.getAttribute(COMMAND_QUEUE_NAME);
-		if (name == null)
-		{
-			throw new CommandQueueException(
-					"Attribute 'command-queue-name' must be specified on the command queue configuration.");
-		}
-		commandQueues.put(name, this);
-	}
-
-	/**
-	 * Add a command to the in-memory command queue. <p/> Blocks until the
-	 * command has been consumed.
-	 * 
-	 * @param command
-	 *            The command string.
-	 */
-	public void addCommand(String command)
-	{
-		queue.add(command);
-		while (!queue.isEmpty())
-		{
-			try
-			{
-				Thread.sleep(100);
-			}
-			catch (InterruptedException e)
-			{
-				e.printStackTrace();
-			}
-		}
-	}
-
-	public String receiveCommand(long timeout) throws CommandQueueException
-	{
-		if (name == null || !commandQueues.containsKey(name))
-		{
-			throw new CommandQueueException(
-					"Sorry.  Invalid call to 'receiveCommand' method.  Queue is not open!");
-		}
-
-		try
-		{
-			return queue.take();
-		}
-		catch (InterruptedException e)
-		{
-			throw new CommandQueueException(
-					"Error taking command message from command queue.", e);
-		}
-	}
-
-	public void close() throws CommandQueueException
-	{
-		commandQueues.remove(name);
-	}
-
-	/**
-	 * Get the command queue based on the name supplied in the configuration
-	 * ("command-queue-name").
-	 * 
-	 * @param name
-	 *            The name of the queue ala the "command-queue-name" attribute
-	 *            on the queue configuration.
-	 * @return The MockCommandQueue instance, or null if no such queue exists.
-	 */
-	public static InMemoryCommandQueue getQueue(String name)
-	{
-		return commandQueues.get(name);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/InMemoryCommandQueue.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/InMemoryCommandQueue.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/InMemoryCommandQueue.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/InMemoryCommandQueue.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,111 @@
+package org.jboss.internal.soa.esb.command;
+
+import java.util.Hashtable;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+/**
+ * In Memory Blocking Command Queue. <p/> Suitable for testing or any other
+ * purpose. <p/> The command queue's configuration needs to specify the queue
+ * name via a "command-queue-name" attribute supplied in the configuration to
+ * the {@link #open(ConfigTree)} method. The queues are stored statically and
+ * can be accessed via the {@link #getQueue(String)} method using the queue
+ * name.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class InMemoryCommandQueue implements CommandQueue
+{
+
+	/**
+	 * Command queue name attribute name.
+	 */
+	public static final String COMMAND_QUEUE_NAME = "command-queue-name";
+
+	private static Hashtable<String, InMemoryCommandQueue> commandQueues = new Hashtable<String, InMemoryCommandQueue>();
+
+	private String name;
+
+	private BlockingQueue<String> queue = new LinkedBlockingQueue<String>();
+
+	public void open(ConfigTree config) throws CommandQueueException
+	{
+		if (config == null)
+		{
+			throw new IllegalArgumentException(
+					"null 'config' arg in method call.");
+		}
+
+		name = config.getAttribute(COMMAND_QUEUE_NAME);
+		if (name == null)
+		{
+			throw new CommandQueueException(
+					"Attribute 'command-queue-name' must be specified on the command queue configuration.");
+		}
+		commandQueues.put(name, this);
+	}
+
+	/**
+	 * Add a command to the in-memory command queue. <p/> Blocks until the
+	 * command has been consumed.
+	 * 
+	 * @param command
+	 *            The command string.
+	 */
+	public void addCommand(String command)
+	{
+		queue.add(command);
+		while (!queue.isEmpty())
+		{
+			try
+			{
+				Thread.sleep(100);
+			}
+			catch (InterruptedException e)
+			{
+				e.printStackTrace();
+			}
+		}
+	}
+
+	public String receiveCommand(long timeout) throws CommandQueueException
+	{
+		if (name == null || !commandQueues.containsKey(name))
+		{
+			throw new CommandQueueException(
+					"Sorry.  Invalid call to 'receiveCommand' method.  Queue is not open!");
+		}
+
+		try
+		{
+			return queue.take();
+		}
+		catch (InterruptedException e)
+		{
+			throw new CommandQueueException(
+					"Error taking command message from command queue.", e);
+		}
+	}
+
+	public void close() throws CommandQueueException
+	{
+		commandQueues.remove(name);
+	}
+
+	/**
+	 * Get the command queue based on the name supplied in the configuration
+	 * ("command-queue-name").
+	 * 
+	 * @param name
+	 *            The name of the queue ala the "command-queue-name" attribute
+	 *            on the queue configuration.
+	 * @return The MockCommandQueue instance, or null if no such queue exists.
+	 */
+	public static InMemoryCommandQueue getQueue(String name)
+	{
+		return commandQueues.get(name);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,241 +0,0 @@
-package org.jboss.internal.soa.esb.command;
-
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-
-import javax.jms.Connection;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TextMessage;
-import javax.jms.Topic;
-import javax.jms.TopicConnection;
-import javax.jms.TopicConnectionFactory;
-import javax.jms.TopicSession;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.NamingContext;
-import org.jboss.soa.esb.util.Util;
-
-/**
- * JMS based Command Queue implementation. <p/> This code was simply pulled from
- * the GpListener.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class JmsCommandQueue implements CommandQueue
-{
-
-	private static Logger logger = Logger.getLogger(JmsCommandQueue.class);
-
-	public static final String COMMAND_CONN_FACTORY = "commandConnFactoryClass";
-
-	public static final String COMMAND_JNDI_URL = "commandJndiURL";
-
-	public static final String COMMAND_JNDI_CONTEXT_FACTORY = "commandJndiContextFactory";
-
-	public static final String COMMAND_JNDI_PKG_PREFIX = "commandJndiUrlPkgPrefix";
-
-	public static final String COMMAND_IS_TOPIC = "commandIsTopic";
-
-	public static final String COMMAND_JNDI_NAME = "commandJndiName";
-
-	public static final String COMMAND_MSG_SELECTOR = "messageSelector";
-
-	private MessageConsumer m_oCmdSrc;
-
-	private Session m_oJmsSess;
-
-	private Connection m_oJmsConn;
-
-	public void open (ConfigTree config) throws CommandQueueException
-	{
-		try
-		{
-			initialiseJMS(config);
-		}
-		catch (Exception e)
-		{
-			throw new CommandQueueException(
-					"Failed to initialise JMS Command Queue.", e);
-		}
-	}
-
-	public void close () throws CommandQueueException
-	{
-		if (null != m_oJmsSess)
-		{
-			try
-			{
-				m_oJmsSess.close();
-			}
-			catch (JMSException eS)
-			{/* Tried my best - Just continue */
-			}
-		}
-		if (null != m_oJmsConn)
-		{
-			try
-			{
-				m_oJmsConn.close();
-			}
-			catch (JMSException eC)
-			{/* Tried my best - Just continue */
-			}
-		}
-	}
-
-	public String receiveCommand (long timeout) throws CommandQueueException
-	{
-		try
-		{
-			Message jmsMessage = m_oCmdSrc.receive(timeout);
-
-			if (null == jmsMessage) return null;
-			if (jmsMessage instanceof TextMessage)
-			{
-				return ((TextMessage) jmsMessage).getText();
-			}
-			else
-			{
-				logger
-						.warn("Message in command queue IGNORED - should be instanceof TextMessage");
-			}
-		}
-		catch (Exception e)
-		{
-			throw new CommandQueueException(
-					"Exception receiving message from JMS Command Queue.", e);
-		}
-
-		return null;
-	}
-
-	private void initialiseJMS (ConfigTree p_oP) throws ConfigurationException, JMSException, NamingException
-	{
-		// Only check for JMS attributes if a queue JNDI name was specified
-		String sJndiName = p_oP.getAttribute(COMMAND_JNDI_NAME);
-		
-		if (!Util.isNullString(sJndiName))
-		{
-            Properties environment = new Properties();
-			Map<String, Object> oNewAtts = new HashMap<String, Object>();
-
-			oNewAtts.put(COMMAND_JNDI_NAME, sJndiName);
-         
-			String sJndiURL = obtainAtt(p_oP, COMMAND_JNDI_URL,"");
-            environment.put(Context.PROVIDER_URL, sJndiURL);
-			oNewAtts.put(COMMAND_JNDI_URL, sJndiURL);
-			String sJndiContextFactory = obtainAtt(p_oP,
-					COMMAND_JNDI_CONTEXT_FACTORY,"");
-            environment.put(Context.OBJECT_FACTORIES, sJndiContextFactory);
-			oNewAtts.put(COMMAND_JNDI_CONTEXT_FACTORY, sJndiContextFactory);
-			String sJndiPkgPrefix = obtainAtt(p_oP, COMMAND_JNDI_PKG_PREFIX,"");
-            environment.put(Context.URL_PKG_PREFIXES, sJndiPkgPrefix);
-			oNewAtts.put(COMMAND_JNDI_PKG_PREFIX, sJndiPkgPrefix);
-			Context oJndiCtx = NamingContext.getServerContext(environment);
-
-			String sFactClass = obtainAtt(p_oP, COMMAND_CONN_FACTORY,
-					"ConnectionFactory");
-			oNewAtts.put(COMMAND_CONN_FACTORY, sFactClass);
-			if (Util.isNullString(sFactClass))
-				sFactClass = "ConnectionFactory";
-			Object oFactCls = null;
-			
-			try
-			{
-				oFactCls = oJndiCtx.lookup(sFactClass);
-			} catch (NamingException ne) {
-                oJndiCtx = NamingContext.getFreshServerContext(environment);
-                try {
-                    oFactCls = oJndiCtx.lookup(sFactClass);
-                } catch (NamingException ex) {
-                    throw new ConfigurationException(ex);
-                }
-			}
-
-			String sMsgSelector = p_oP.getAttribute(COMMAND_MSG_SELECTOR);
-			if (null != sMsgSelector)
-				oNewAtts.put(COMMAND_MSG_SELECTOR, sMsgSelector);
-
-			boolean bIsTopic = Boolean.parseBoolean(obtainAtt(p_oP,
-					COMMAND_IS_TOPIC, "false"));
-			if (bIsTopic)
-			{
-				TopicConnectionFactory tcf = (TopicConnectionFactory) oFactCls;
-				TopicConnection oTC = tcf.createTopicConnection();
-				TopicSession oSess = oTC.createTopicSession(false,
-						TopicSession.AUTO_ACKNOWLEDGE);
-				Topic oTopic = null;
-				try
-				{
-					oTopic = (Topic) oJndiCtx.lookup(sJndiName);
-				}
-				catch (NamingException ne)
-				{
-					oTopic = oSess.createTopic(sJndiName);
-				}
-				m_oJmsConn = oTC;
-				m_oJmsSess = oSess;
-				oTC.start();
-				m_oCmdSrc = oSess.createSubscriber(oTopic, sMsgSelector, true);
-			}
-			else
-			{
-				QueueConnectionFactory qcf = (QueueConnectionFactory) oFactCls;
-				QueueConnection oQC = qcf.createQueueConnection();
-				QueueSession oSess = oQC.createQueueSession(false,
-						TopicSession.AUTO_ACKNOWLEDGE);
-				javax.jms.Queue oQ = null;
-				try
-				{
-					oQ = (javax.jms.Queue) oJndiCtx.lookup(sJndiName);
-				}
-				catch (NamingException ne)
-				{
-					oQ = oSess.createQueue(sJndiName);
-				}
-				oQC.start();
-				m_oJmsConn = oQC;
-				m_oJmsSess = oSess;
-				m_oCmdSrc = oSess.createReceiver(oQ, sMsgSelector);
-			}
-            oJndiCtx.close();
-		}
-	}
-
-	/**
-	 * Find an attribute in the tree (arg 0) or assign default value (arg 2)
-	 * 
-	 * @param p_oP
-	 *            ConfigTree - look for attributes in this Element only
-	 * @param p_sAtt
-	 *            String - Name of attribute to find
-	 * @param p_sDefault
-	 *            String -default value if requested attribute is not there
-	 * @return String - value of attribute, or default value (if null)
-	 * @throws ConfigurationException -
-	 *             If requested attribute not found and no default value
-	 *             supplied by invoker
-	 */
-	private String obtainAtt (ConfigTree p_oP, String p_sAtt, String p_sDefault)
-			throws ConfigurationException
-	{
-		String sVal = p_oP.getAttribute(p_sAtt);
-		if ((null == sVal) && (null == p_sDefault))
-			throw new ConfigurationException(
-					"Missing or invalid <" + p_sAtt + "> attribute");
-
-		return (null != sVal) ? sVal : p_sDefault;
-	} // ________________________________
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/command/JmsCommandQueue.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,241 @@
+package org.jboss.internal.soa.esb.command;
+
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+
+import javax.jms.Connection;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.TextMessage;
+import javax.jms.Topic;
+import javax.jms.TopicConnection;
+import javax.jms.TopicConnectionFactory;
+import javax.jms.TopicSession;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.NamingContext;
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * JMS based Command Queue implementation. <p/> This code was simply pulled from
+ * the GpListener.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class JmsCommandQueue implements CommandQueue
+{
+
+	private static Logger logger = Logger.getLogger(JmsCommandQueue.class);
+
+	public static final String COMMAND_CONN_FACTORY = "commandConnFactoryClass";
+
+	public static final String COMMAND_JNDI_URL = "commandJndiURL";
+
+	public static final String COMMAND_JNDI_CONTEXT_FACTORY = "commandJndiContextFactory";
+
+	public static final String COMMAND_JNDI_PKG_PREFIX = "commandJndiUrlPkgPrefix";
+
+	public static final String COMMAND_IS_TOPIC = "commandIsTopic";
+
+	public static final String COMMAND_JNDI_NAME = "commandJndiName";
+
+	public static final String COMMAND_MSG_SELECTOR = "messageSelector";
+
+	private MessageConsumer m_oCmdSrc;
+
+	private Session m_oJmsSess;
+
+	private Connection m_oJmsConn;
+
+	public void open (ConfigTree config) throws CommandQueueException
+	{
+		try
+		{
+			initialiseJMS(config);
+		}
+		catch (Exception e)
+		{
+			throw new CommandQueueException(
+					"Failed to initialise JMS Command Queue.", e);
+		}
+	}
+
+	public void close () throws CommandQueueException
+	{
+		if (null != m_oJmsSess)
+		{
+			try
+			{
+				m_oJmsSess.close();
+			}
+			catch (JMSException eS)
+			{/* Tried my best - Just continue */
+			}
+		}
+		if (null != m_oJmsConn)
+		{
+			try
+			{
+				m_oJmsConn.close();
+			}
+			catch (JMSException eC)
+			{/* Tried my best - Just continue */
+			}
+		}
+	}
+
+	public String receiveCommand (long timeout) throws CommandQueueException
+	{
+		try
+		{
+			Message jmsMessage = m_oCmdSrc.receive(timeout);
+
+			if (null == jmsMessage) return null;
+			if (jmsMessage instanceof TextMessage)
+			{
+				return ((TextMessage) jmsMessage).getText();
+			}
+			else
+			{
+				logger
+						.warn("Message in command queue IGNORED - should be instanceof TextMessage");
+			}
+		}
+		catch (Exception e)
+		{
+			throw new CommandQueueException(
+					"Exception receiving message from JMS Command Queue.", e);
+		}
+
+		return null;
+	}
+
+	private void initialiseJMS (ConfigTree p_oP) throws ConfigurationException, JMSException, NamingException
+	{
+		// Only check for JMS attributes if a queue JNDI name was specified
+		String sJndiName = p_oP.getAttribute(COMMAND_JNDI_NAME);
+		
+		if (!Util.isNullString(sJndiName))
+		{
+            Properties environment = new Properties();
+			Map<String, Object> oNewAtts = new HashMap<String, Object>();
+
+			oNewAtts.put(COMMAND_JNDI_NAME, sJndiName);
+         
+			String sJndiURL = obtainAtt(p_oP, COMMAND_JNDI_URL,"");
+            environment.put(Context.PROVIDER_URL, sJndiURL);
+			oNewAtts.put(COMMAND_JNDI_URL, sJndiURL);
+			String sJndiContextFactory = obtainAtt(p_oP,
+					COMMAND_JNDI_CONTEXT_FACTORY,"");
+            environment.put(Context.OBJECT_FACTORIES, sJndiContextFactory);
+			oNewAtts.put(COMMAND_JNDI_CONTEXT_FACTORY, sJndiContextFactory);
+			String sJndiPkgPrefix = obtainAtt(p_oP, COMMAND_JNDI_PKG_PREFIX,"");
+            environment.put(Context.URL_PKG_PREFIXES, sJndiPkgPrefix);
+			oNewAtts.put(COMMAND_JNDI_PKG_PREFIX, sJndiPkgPrefix);
+			Context oJndiCtx = NamingContext.getServerContext(environment);
+
+			String sFactClass = obtainAtt(p_oP, COMMAND_CONN_FACTORY,
+					"ConnectionFactory");
+			oNewAtts.put(COMMAND_CONN_FACTORY, sFactClass);
+			if (Util.isNullString(sFactClass))
+				sFactClass = "ConnectionFactory";
+			Object oFactCls = null;
+			
+			try
+			{
+				oFactCls = oJndiCtx.lookup(sFactClass);
+			} catch (NamingException ne) {
+                oJndiCtx = NamingContext.getFreshServerContext(environment);
+                try {
+                    oFactCls = oJndiCtx.lookup(sFactClass);
+                } catch (NamingException ex) {
+                    throw new ConfigurationException(ex);
+                }
+			}
+
+			String sMsgSelector = p_oP.getAttribute(COMMAND_MSG_SELECTOR);
+			if (null != sMsgSelector)
+				oNewAtts.put(COMMAND_MSG_SELECTOR, sMsgSelector);
+
+			boolean bIsTopic = Boolean.parseBoolean(obtainAtt(p_oP,
+					COMMAND_IS_TOPIC, "false"));
+			if (bIsTopic)
+			{
+				TopicConnectionFactory tcf = (TopicConnectionFactory) oFactCls;
+				TopicConnection oTC = tcf.createTopicConnection();
+				TopicSession oSess = oTC.createTopicSession(false,
+						TopicSession.AUTO_ACKNOWLEDGE);
+				Topic oTopic = null;
+				try
+				{
+					oTopic = (Topic) oJndiCtx.lookup(sJndiName);
+				}
+				catch (NamingException ne)
+				{
+					oTopic = oSess.createTopic(sJndiName);
+				}
+				m_oJmsConn = oTC;
+				m_oJmsSess = oSess;
+				oTC.start();
+				m_oCmdSrc = oSess.createSubscriber(oTopic, sMsgSelector, true);
+			}
+			else
+			{
+				QueueConnectionFactory qcf = (QueueConnectionFactory) oFactCls;
+				QueueConnection oQC = qcf.createQueueConnection();
+				QueueSession oSess = oQC.createQueueSession(false,
+						TopicSession.AUTO_ACKNOWLEDGE);
+				javax.jms.Queue oQ = null;
+				try
+				{
+					oQ = (javax.jms.Queue) oJndiCtx.lookup(sJndiName);
+				}
+				catch (NamingException ne)
+				{
+					oQ = oSess.createQueue(sJndiName);
+				}
+				oQC.start();
+				m_oJmsConn = oQC;
+				m_oJmsSess = oSess;
+				m_oCmdSrc = oSess.createReceiver(oQ, sMsgSelector);
+			}
+            oJndiCtx.close();
+		}
+	}
+
+	/**
+	 * Find an attribute in the tree (arg 0) or assign default value (arg 2)
+	 * 
+	 * @param p_oP
+	 *            ConfigTree - look for attributes in this Element only
+	 * @param p_sAtt
+	 *            String - Name of attribute to find
+	 * @param p_sDefault
+	 *            String -default value if requested attribute is not there
+	 * @return String - value of attribute, or default value (if null)
+	 * @throws ConfigurationException -
+	 *             If requested attribute not found and no default value
+	 *             supplied by invoker
+	 */
+	private String obtainAtt (ConfigTree p_oP, String p_sAtt, String p_sDefault)
+			throws ConfigurationException
+	{
+		String sVal = p_oP.getAttribute(p_sAtt);
+		if ((null == sVal) && (null == p_sDefault))
+			throw new ConfigurationException(
+					"Missing or invalid <" + p_sAtt + "> attribute");
+
+		return (null != sVal) ? sVal : p_sDefault;
+	} // ________________________________
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/DeliverOnlyCourier.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/DeliverOnlyCourier.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/DeliverOnlyCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,33 +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.internal.soa.esb.couriers;
-
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.message.Message;
-
-public interface DeliverOnlyCourier
-{
-	public boolean	deliver(Message message) throws CourierException, MalformedEPRException;
-        public void cleanup() ;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/DeliverOnlyCourier.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/DeliverOnlyCourier.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/DeliverOnlyCourier.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/DeliverOnlyCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,33 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers;
+
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.message.Message;
+
+public interface DeliverOnlyCourier
+{
+	public boolean	deliver(Message message) throws CourierException, MalformedEPRException;
+        public void cleanup() ;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,513 +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.internal.soa.esb.couriers;
-
-import java.io.File;
-import java.io.IOException;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.UUID;
-
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.helpers.FileHandler;
-import org.jboss.internal.soa.esb.couriers.helpers.FileHandlerFactory;
-import org.jboss.internal.soa.esb.couriers.helpers.LocalFileHandler;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.FileUtil;
-import org.jboss.soa.esb.util.Util;
-
-/**
- * Internal implementation of a courier to handle Messages in a filesystem <p/>
- * Intended to cater for local file system, remote via ftp, ftps or sftp
- * 
- * @author <a
- *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- * 
- */
-public class FileCourier implements PickUpOnlyCourier, DeliverOnlyCourier
-{
-	/**
-	 * disable public default constructor
-	 */
-	protected FileCourier()
-	{
-	}
-
-	/**
-	 * package protected constructor - Objects of this class should only be
-	 * instantiated by internal implementations
-	 * 
-	 * @param epr
-	 */
-	FileCourier(FileEpr epr) throws CourierException, MalformedEPRException
-	{
-		this(epr, false);
-	}
-
-	/**
-	 * package protected constructor - Objects of this class should only be
-	 * instantiated by internal implementations
-	 * 
-	 * @param epr
-	 * @param receiverOnly
-	 */
-	FileCourier(FileEpr epr, boolean receiverOnly) throws CourierException, MalformedEPRException
-	{
-		_receiverOnly = receiverOnly;
-		_epr = epr;
-		
-		checkEprParms();
-	} // ________________________________
-
-	/**
-	 * See if we have everything we need in the EPR
-	 * 
-	 * @throws CourierException
-	 */
-	protected void checkEprParms() throws CourierException, MalformedEPRException
-	{
-		_outputSuffix = null;
-		
-		try
-		{
-			_outputSuffix = _epr.getPostSuffix();
-			_logger.debug("output suffix set to "+_outputSuffix);
-		}
-		catch (URISyntaxException e)
-		{
-			_logger.warn("Malformed EPR");
-		}
-
-		if (Util.isNullString(_outputSuffix))
-		{
-			_outputSuffix = ".esbMessage";
-			_logger
-					.debug("No suffix for delivered messages - using default of <"
-							+ _outputSuffix + ">");
-		}
-		
-		// Certain things can only be checked in local filesystem
-		try
-		{
-			_url = _epr.getURL();
-			FileHandler handler = FileHandlerFactory.getInstance()
-					.getFileHandler(_epr);
-			if (handler instanceof LocalFileHandler)
-			{
-				_localFhandler = (LocalFileHandler) handler;
-				File file = new File(_url.getFile());
-				if ((!_receiverOnly) && (!file.isDirectory()))
-					throw new CourierException(
-							"File for deliverAsync EPR must be a directory (file name will be MessageID)");
-
-				File directory = (file.isDirectory()) ? file : file
-						.getParentFile();
-				if (null==directory)
-					directory = new File("");
-				if (!directory.canRead())
-					throw new CourierException("Can't read directory "
-							+ directory.toString());
-				// need to write even if it's readOnly - file will be renamed
-				// during xfer
-				if (!directory.canWrite())
-					throw new CourierException("Can't write in directory "
-							+ directory.toString());
-
-				return;
-			}
-		}
-		catch (MalformedURLException e)
-		{
-			throw new MalformedEPRException(e);
-		}
-		catch (URISyntaxException e)
-		{
-			throw new MalformedEPRException(e);
-		}
-	} // ________________________________
-
-	/**
-	 * package the ESB message in a File
-	 * 
-	 * @param message
-	 *            Message - the message to deliverAsync
-	 * @return boolean - the result of the delivery
-	 * @throws CourierException -
-	 *             if problems were encountered
-	 */
-	public boolean deliver(Message message) throws CourierException, MalformedEPRException
-	{
-		if (_receiverOnly)
-			throw new CourierException("This is a pickUp-only Courier");
-
-		if (null == message)
-			return false;
-
-		// FileHandler is durable only for local filesystem (see
-		// checkEprParms())
-		FileHandler handler = (null != _localFhandler) ? _localFhandler
-				: FileHandlerFactory.getInstance().getFileHandler(_epr);
-		if (null == handler)
-			throw new CourierException(
-					"Can't find appropriate file handler for "
-							+ _url.toString());
-
-		Call call = message.getHeader().getCall();
-		if (null==call)
-			message.getHeader().setCall(call=new Call());
-		try
-		{
-			if (null==call.getMessageID())
-				call.setMessageID(new URI(UUID.randomUUID().toString()));
-		}
-		catch (URISyntaxException e)
-		{
-			throw new MalformedEPRException("Problems with message header ",e);
-		}
-		
-		File tmpFile = null;
-
-		if (handler instanceof LocalFileHandler)
-		{
-			try
-			{
-				File dir = new File(_url.getFile());
-				String name = message.getHeader().getCall().getMessageID()
-						.toString();
-				name += _outputSuffix;
-	
-				tmpFile = CourierUtil.messageToLocalFile(dir, message);
-
-				handler.renameFile(tmpFile, new File(dir, name));
-
-				return true;
-			}
-			catch (IOException e)
-			{
-				throw new CourierException(e);
-			}
-			catch (ParserConfigurationException e)
-			{
-				throw new CourierException(e);
-			}
-		}
-
-		try
-		{
-			Method upload = handler.getClass().getMethod("uploadFile",
-					new Class[]
-					{ File.class });
-
-			String sDir = ModulePropertyManager.getPropertyManager(
-					ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
-					Environment.FTP_LOCALDIR, DEFAULT_TMP);
-			File dir = new File(sDir);
-			String name = message.getHeader().getCall().getMessageID().toString();
-			
-			name += _outputSuffix;
-			
-			tmpFile = CourierUtil.messageToLocalFile(dir, message);
-
-			File messageFile = new File(dir, name);
-			FileUtil.renameTo(tmpFile, messageFile);
-			tmpFile = messageFile;
-
-			upload.invoke(handler, new Object[]
-			{ messageFile });
-			return true;
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-			
-			throw new CourierException(e);
-		}
-		finally
-		{
-			if (null != tmpFile)
-				tmpFile.delete();
-		}
-
-	} // ________________________________
-
-	public Message pickup(long millis) throws CourierException
-	{	
-		Message result = null;
-		long limit = System.currentTimeMillis()
-				+ ((millis < 100) ? 100 : millis);
-		
-		do
-		{
-			FileHandler handler = (null != _localFhandler) ? _localFhandler
-					: FileHandlerFactory.getInstance().getFileHandler(_epr);
-		
-			File[] files = handler.getFileList();
-
-			if (null != files && files.length > 0)
-			{
-				File input = files[0];
-				File work = workFile(input);
-				handler.renameFile(input, work);
-				try
-				{
-					result = readOneMessage(handler, work);
-				}
-				catch (Exception e)
-				{
-					if (null == errorFile(input))
-						handler.deleteFile(work);
-					else
-						handler.renameFile(work, errorFile(input));
-					continue;
-				}
-				File done = postFile(input);
-				if (null == done)
-					handler.deleteFile(work);
-				else
-					handler.renameFile(work, done);
-				
-				return result;
-			}
-			try
-			{
-				long lSleep = limit - System.currentTimeMillis();
-				if (_pollLatency < lSleep)
-					lSleep = _pollLatency;
-				if (lSleep > 0)
-					Thread.sleep(lSleep);
-			}
-			catch (InterruptedException e)
-			{
-				return null;
-			}
-		} while (System.currentTimeMillis() <= limit);
-		return null;
-	} // ________________________________
-
-	private Message readOneMessage(FileHandler handler, File work) throws CourierException
-	{
-		if (handler instanceof LocalFileHandler)
-		{
-			try
-			{
-				return CourierUtil.messageFromLocalFile(work);
-			}
-			catch (Exception ex)
-			{
-				throw new CourierException(ex);
-			}
-		}
-
-		File tmpFile = null;
-		try
-		{
-			Method download = handler.getClass().getMethod("downloadFile",
-					new Class[]
-					{ File.class });
-			tmpFile = (File) download.invoke(handler, new Object[]
-			{ work });
-			return CourierUtil.messageFromLocalFile(tmpFile);
-		}
-		catch (Exception e)
-		{
-			throw new CourierException(e);
-		}
-		finally
-		{
-			if (null != tmpFile)
-				tmpFile.delete();
-		}
-	} // ________________________________
-
-	protected File workFile(File input)
-	{
-		String sfx = null;
-		try
-		{
-			sfx = _epr.getWorkSuffix();
-		}
-		catch (URISyntaxException e)
-		{
-			_logger.warn("Malformed EPR", e);
-		}
-
-		if (Util.isNullString(sfx))
-		{
-			sfx = ".esbInProcess";
-			_logger
-					.debug("No valid work suffix found in EPR - using default of "
-							+ sfx);
-		}
-		
-		return new File(input.toString()+ sfx);
-	} // ________________________________
-
-	protected File errorFile(File input)
-	{
-		try
-		{
-			if (_epr.getErrorDelete())
-				return null;
-		}
-		catch (Exception e)
-		{
-			_logger.warn("Problems in FileEpr", e);
-		}
-
-		String sfx = null;
-		try
-		{
-			sfx = _epr.getErrorSuffix();
-		}
-		catch (URISyntaxException e)
-		{
-			_logger.warn("Malformed EPR", e);
-		}
-
-		if (Util.isNullString(sfx))
-		{
-			sfx = ".esbERROR";
-			_logger
-					.debug("No valid work suffix found in EPR - using default of "
-							+ sfx);
-		}
-		return new File(input.toString() + sfx);
-	} // ________________________________
-
-	protected File postFile(File input)
-	{
-		try
-		{
-//			if (_epr instanceof FTPEpr || _epr.getPostDelete())
-			if (_epr.getPostDelete())
-				return null;
-		}
-		catch (Exception e)
-		{
-			_logger.warn("Problems in FileEpr", e);
-		}
-
-		String inputDir = new File(input.getAbsolutePath()).getParent();		
-		if (inputDir == null)
-		{
-			_logger.debug("Could not get parent directory for "+input);
-			inputDir="";
-		}
-		
-		String dir = null;
-		try
-		{
-			dir = _epr.getPostDirectory();
-		}
-		catch (URISyntaxException e)
-		{
-			_logger.warn("Malformed EPR", e);
-		}
-		if (null==dir)
-		{
-			dir = inputDir;
-			_logger
-					.debug("No valid post process directory found in EPR - using same as input ("
-							+ dir + ")");
-		}
-
-		String sfx = null;
-		try
-		{
-			sfx = _epr.getPostSuffix();
-		}
-		catch (URISyntaxException e)
-		{
-			_logger.warn("Malformed EPR", e);
-		}
-		if (Util.isNullString(sfx))
-		{
-			if (dir == null)  // means inputDir is also null!
-			{
-				/*
-				 * Aarrghh! We should be able to return an exception, but
-				 * can't. Not changing the signature at this stage. Post
-				 * GA.
-				 * 
-				 * Plus we shouldn't be assuming getParent never returns null
-				 * in the first place.
-				 */
-				
-				_logger.error("No way to determine post process directory. Will use a default relative to cwd.");
-			}
-			
-			if (dir.equals(inputDir))
-			{
-				sfx = ".esbProcessed";
-				_logger
-						.debug("No valid post suffix found in EPR - using default of "
-								+ sfx);
-			}
-		}
-
-		return new File(dir, input.getName() + sfx);
-	} // ________________________________
-	
-	public void setPollLatency(Long millis)
-	{
-		if (millis <= 900)
-			_logger.warn("Poll latency must be >= 900 milliseconds - Keeping old value of "+_pollLatency);
-		else
-			_pollLatency = millis;
-	} // ________________________________
-	
-        public void cleanup()
-        {
-        }
-        
-	protected long _pollLatency = 900;
-
-	protected static final String DEFAULT_TMP = System
-			.getProperty("java.io.tmpdir");
-
-	protected String _outputSuffix;
-
-	protected URL _url;
-
-	protected boolean _receiverOnly;
-
-	protected FileEpr _epr;
-
-	protected LocalFileHandler _localFhandler;
-
-	protected static Logger _logger = Logger.getLogger(FileCourier.class);
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/FileCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,513 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers;
+
+import java.io.File;
+import java.io.IOException;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.UUID;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.helpers.FileHandler;
+import org.jboss.internal.soa.esb.couriers.helpers.FileHandlerFactory;
+import org.jboss.internal.soa.esb.couriers.helpers.LocalFileHandler;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.FileUtil;
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * Internal implementation of a courier to handle Messages in a filesystem <p/>
+ * Intended to cater for local file system, remote via ftp, ftps or sftp
+ * 
+ * @author <a
+ *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ * 
+ */
+public class FileCourier implements PickUpOnlyCourier, DeliverOnlyCourier
+{
+	/**
+	 * disable public default constructor
+	 */
+	protected FileCourier()
+	{
+	}
+
+	/**
+	 * package protected constructor - Objects of this class should only be
+	 * instantiated by internal implementations
+	 * 
+	 * @param epr
+	 */
+	FileCourier(FileEpr epr) throws CourierException, MalformedEPRException
+	{
+		this(epr, false);
+	}
+
+	/**
+	 * package protected constructor - Objects of this class should only be
+	 * instantiated by internal implementations
+	 * 
+	 * @param epr
+	 * @param receiverOnly
+	 */
+	FileCourier(FileEpr epr, boolean receiverOnly) throws CourierException, MalformedEPRException
+	{
+		_receiverOnly = receiverOnly;
+		_epr = epr;
+		
+		checkEprParms();
+	} // ________________________________
+
+	/**
+	 * See if we have everything we need in the EPR
+	 * 
+	 * @throws CourierException
+	 */
+	protected void checkEprParms() throws CourierException, MalformedEPRException
+	{
+		_outputSuffix = null;
+		
+		try
+		{
+			_outputSuffix = _epr.getPostSuffix();
+			_logger.debug("output suffix set to "+_outputSuffix);
+		}
+		catch (URISyntaxException e)
+		{
+			_logger.warn("Malformed EPR");
+		}
+
+		if (Util.isNullString(_outputSuffix))
+		{
+			_outputSuffix = ".esbMessage";
+			_logger
+					.debug("No suffix for delivered messages - using default of <"
+							+ _outputSuffix + ">");
+		}
+		
+		// Certain things can only be checked in local filesystem
+		try
+		{
+			_url = _epr.getURL();
+			FileHandler handler = FileHandlerFactory.getInstance()
+					.getFileHandler(_epr);
+			if (handler instanceof LocalFileHandler)
+			{
+				_localFhandler = (LocalFileHandler) handler;
+				File file = new File(_url.getFile());
+				if ((!_receiverOnly) && (!file.isDirectory()))
+					throw new CourierException(
+							"File for deliverAsync EPR must be a directory (file name will be MessageID)");
+
+				File directory = (file.isDirectory()) ? file : file
+						.getParentFile();
+				if (null==directory)
+					directory = new File("");
+				if (!directory.canRead())
+					throw new CourierException("Can't read directory "
+							+ directory.toString());
+				// need to write even if it's readOnly - file will be renamed
+				// during xfer
+				if (!directory.canWrite())
+					throw new CourierException("Can't write in directory "
+							+ directory.toString());
+
+				return;
+			}
+		}
+		catch (MalformedURLException e)
+		{
+			throw new MalformedEPRException(e);
+		}
+		catch (URISyntaxException e)
+		{
+			throw new MalformedEPRException(e);
+		}
+	} // ________________________________
+
+	/**
+	 * package the ESB message in a File
+	 * 
+	 * @param message
+	 *            Message - the message to deliverAsync
+	 * @return boolean - the result of the delivery
+	 * @throws CourierException -
+	 *             if problems were encountered
+	 */
+	public boolean deliver(Message message) throws CourierException, MalformedEPRException
+	{
+		if (_receiverOnly)
+			throw new CourierException("This is a pickUp-only Courier");
+
+		if (null == message)
+			return false;
+
+		// FileHandler is durable only for local filesystem (see
+		// checkEprParms())
+		FileHandler handler = (null != _localFhandler) ? _localFhandler
+				: FileHandlerFactory.getInstance().getFileHandler(_epr);
+		if (null == handler)
+			throw new CourierException(
+					"Can't find appropriate file handler for "
+							+ _url.toString());
+
+		Call call = message.getHeader().getCall();
+		if (null==call)
+			message.getHeader().setCall(call=new Call());
+		try
+		{
+			if (null==call.getMessageID())
+				call.setMessageID(new URI(UUID.randomUUID().toString()));
+		}
+		catch (URISyntaxException e)
+		{
+			throw new MalformedEPRException("Problems with message header ",e);
+		}
+		
+		File tmpFile = null;
+
+		if (handler instanceof LocalFileHandler)
+		{
+			try
+			{
+				File dir = new File(_url.getFile());
+				String name = message.getHeader().getCall().getMessageID()
+						.toString();
+				name += _outputSuffix;
+	
+				tmpFile = CourierUtil.messageToLocalFile(dir, message);
+
+				handler.renameFile(tmpFile, new File(dir, name));
+
+				return true;
+			}
+			catch (IOException e)
+			{
+				throw new CourierException(e);
+			}
+			catch (ParserConfigurationException e)
+			{
+				throw new CourierException(e);
+			}
+		}
+
+		try
+		{
+			Method upload = handler.getClass().getMethod("uploadFile",
+					new Class[]
+					{ File.class });
+
+			String sDir = ModulePropertyManager.getPropertyManager(
+					ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
+					Environment.FTP_LOCALDIR, DEFAULT_TMP);
+			File dir = new File(sDir);
+			String name = message.getHeader().getCall().getMessageID().toString();
+			
+			name += _outputSuffix;
+			
+			tmpFile = CourierUtil.messageToLocalFile(dir, message);
+
+			File messageFile = new File(dir, name);
+			FileUtil.renameTo(tmpFile, messageFile);
+			tmpFile = messageFile;
+
+			upload.invoke(handler, new Object[]
+			{ messageFile });
+			return true;
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+			
+			throw new CourierException(e);
+		}
+		finally
+		{
+			if (null != tmpFile)
+				tmpFile.delete();
+		}
+
+	} // ________________________________
+
+	public Message pickup(long millis) throws CourierException
+	{	
+		Message result = null;
+		long limit = System.currentTimeMillis()
+				+ ((millis < 100) ? 100 : millis);
+		
+		do
+		{
+			FileHandler handler = (null != _localFhandler) ? _localFhandler
+					: FileHandlerFactory.getInstance().getFileHandler(_epr);
+		
+			File[] files = handler.getFileList();
+
+			if (null != files && files.length > 0)
+			{
+				File input = files[0];
+				File work = workFile(input);
+				handler.renameFile(input, work);
+				try
+				{
+					result = readOneMessage(handler, work);
+				}
+				catch (Exception e)
+				{
+					if (null == errorFile(input))
+						handler.deleteFile(work);
+					else
+						handler.renameFile(work, errorFile(input));
+					continue;
+				}
+				File done = postFile(input);
+				if (null == done)
+					handler.deleteFile(work);
+				else
+					handler.renameFile(work, done);
+				
+				return result;
+			}
+			try
+			{
+				long lSleep = limit - System.currentTimeMillis();
+				if (_pollLatency < lSleep)
+					lSleep = _pollLatency;
+				if (lSleep > 0)
+					Thread.sleep(lSleep);
+			}
+			catch (InterruptedException e)
+			{
+				return null;
+			}
+		} while (System.currentTimeMillis() <= limit);
+		return null;
+	} // ________________________________
+
+	private Message readOneMessage(FileHandler handler, File work) throws CourierException
+	{
+		if (handler instanceof LocalFileHandler)
+		{
+			try
+			{
+				return CourierUtil.messageFromLocalFile(work);
+			}
+			catch (Exception ex)
+			{
+				throw new CourierException(ex);
+			}
+		}
+
+		File tmpFile = null;
+		try
+		{
+			Method download = handler.getClass().getMethod("downloadFile",
+					new Class[]
+					{ File.class });
+			tmpFile = (File) download.invoke(handler, new Object[]
+			{ work });
+			return CourierUtil.messageFromLocalFile(tmpFile);
+		}
+		catch (Exception e)
+		{
+			throw new CourierException(e);
+		}
+		finally
+		{
+			if (null != tmpFile)
+				tmpFile.delete();
+		}
+	} // ________________________________
+
+	protected File workFile(File input)
+	{
+		String sfx = null;
+		try
+		{
+			sfx = _epr.getWorkSuffix();
+		}
+		catch (URISyntaxException e)
+		{
+			_logger.warn("Malformed EPR", e);
+		}
+
+		if (Util.isNullString(sfx))
+		{
+			sfx = ".esbInProcess";
+			_logger
+					.debug("No valid work suffix found in EPR - using default of "
+							+ sfx);
+		}
+		
+		return new File(input.toString()+ sfx);
+	} // ________________________________
+
+	protected File errorFile(File input)
+	{
+		try
+		{
+			if (_epr.getErrorDelete())
+				return null;
+		}
+		catch (Exception e)
+		{
+			_logger.warn("Problems in FileEpr", e);
+		}
+
+		String sfx = null;
+		try
+		{
+			sfx = _epr.getErrorSuffix();
+		}
+		catch (URISyntaxException e)
+		{
+			_logger.warn("Malformed EPR", e);
+		}
+
+		if (Util.isNullString(sfx))
+		{
+			sfx = ".esbERROR";
+			_logger
+					.debug("No valid work suffix found in EPR - using default of "
+							+ sfx);
+		}
+		return new File(input.toString() + sfx);
+	} // ________________________________
+
+	protected File postFile(File input)
+	{
+		try
+		{
+//			if (_epr instanceof FTPEpr || _epr.getPostDelete())
+			if (_epr.getPostDelete())
+				return null;
+		}
+		catch (Exception e)
+		{
+			_logger.warn("Problems in FileEpr", e);
+		}
+
+		String inputDir = new File(input.getAbsolutePath()).getParent();		
+		if (inputDir == null)
+		{
+			_logger.debug("Could not get parent directory for "+input);
+			inputDir="";
+		}
+		
+		String dir = null;
+		try
+		{
+			dir = _epr.getPostDirectory();
+		}
+		catch (URISyntaxException e)
+		{
+			_logger.warn("Malformed EPR", e);
+		}
+		if (null==dir)
+		{
+			dir = inputDir;
+			_logger
+					.debug("No valid post process directory found in EPR - using same as input ("
+							+ dir + ")");
+		}
+
+		String sfx = null;
+		try
+		{
+			sfx = _epr.getPostSuffix();
+		}
+		catch (URISyntaxException e)
+		{
+			_logger.warn("Malformed EPR", e);
+		}
+		if (Util.isNullString(sfx))
+		{
+			if (dir == null)  // means inputDir is also null!
+			{
+				/*
+				 * Aarrghh! We should be able to return an exception, but
+				 * can't. Not changing the signature at this stage. Post
+				 * GA.
+				 * 
+				 * Plus we shouldn't be assuming getParent never returns null
+				 * in the first place.
+				 */
+				
+				_logger.error("No way to determine post process directory. Will use a default relative to cwd.");
+			}
+			
+			if (dir.equals(inputDir))
+			{
+				sfx = ".esbProcessed";
+				_logger
+						.debug("No valid post suffix found in EPR - using default of "
+								+ sfx);
+			}
+		}
+
+		return new File(dir, input.getName() + sfx);
+	} // ________________________________
+	
+	public void setPollLatency(Long millis)
+	{
+		if (millis <= 900)
+			_logger.warn("Poll latency must be >= 900 milliseconds - Keeping old value of "+_pollLatency);
+		else
+			_pollLatency = millis;
+	} // ________________________________
+	
+        public void cleanup()
+        {
+        }
+        
+	protected long _pollLatency = 900;
+
+	protected static final String DEFAULT_TMP = System
+			.getProperty("java.io.tmpdir");
+
+	protected String _outputSuffix;
+
+	protected URL _url;
+
+	protected boolean _receiverOnly;
+
+	protected FileEpr _epr;
+
+	protected LocalFileHandler _localFhandler;
+
+	protected static Logger _logger = Logger.getLogger(FileCourier.class);
+
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,126 +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.internal.soa.esb.couriers;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.hibernate.Query;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierTimeoutException;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Courier which delivers message.
- * 
- * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
- * @since Version 4.2
- * 
- */
-public class HibernateCourier implements PickUpOnlyCourier, DeliverOnlyCourier {
-
-	protected HibernateEpr m_epr = null;
-	protected static Logger m_Logger = Logger.getLogger(HibernateCourier.class);
-
-	protected Query m_prepDelete = null;
-	protected Query m_prepInsert = null;
-	protected Query m_prepUpdate = null;
-	protected Query m_prepSelUpd = null;
-	protected Query m_prepGetList = null;
-	
-	private boolean m_isReceiver = false;
-	protected long m_pollLatency = 200;
-
-	
-	private HibernateCourier() {
-	}
-	
-	/**
-	 * package protected constructor - Objects of Courier should only be
-	 * instantiated by the Factory
-	 * 
-	 * @param epr
-	 */
-	HibernateCourier(HibernateEpr epr) throws CourierException {
-		this(epr, false);
-	}
-	
-	public HibernateCourier(HibernateEpr epr, boolean pickUpOnly) {
-		m_isReceiver = pickUpOnly;
-		m_epr = epr;		
-	}
-
-	public void cleanup() {
-	}
-
-	/**
-	 * package the ESB message in a java.io.Serializable, and write it
-	 * 
-	 * @param message
-	 *            Message - the message to deliverAsync
-	 * @return boolean - the result of the delivery
-	 * @throws CourierException -
-	 *             if problems were encountered
-	 */
-	public boolean deliver(Message message) throws CourierException {
-		if (m_isReceiver)
-			throw new CourierException("This is a read-only Courier");
-
-		if (null == message)
-			return false;
-
-		Call call = message.getHeader().getCall();
-		if (null==call)
-			message.getHeader().setCall(call=new Call());
-		try {
-			if (null == call.getMessageID())
-				call.setMessageID(new URI(UUID.randomUUID().toString()));
-		} catch (URISyntaxException e) {
-			throw new CourierException("Problems with message header ",e);
-		}
-
-		return false;
-	}
-	
-	
-	/* (non-Javadoc)
-	 * @see org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier#pickup(long)
-	 */
-	
-	public Message pickup(long millis) throws CourierException,
-			CourierTimeoutException {
-		return null;
-	}
-	
-
-	
-	protected enum State {
-		Pending, WorkInProgress, Done, Error;
-		String getColumnValue() {
-			return toString().substring(0, 1);
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/HibernateCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,126 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.couriers;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.hibernate.Query;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierTimeoutException;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Courier which delivers message.
+ * 
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @since Version 4.2
+ * 
+ */
+public class HibernateCourier implements PickUpOnlyCourier, DeliverOnlyCourier {
+
+	protected HibernateEpr m_epr = null;
+	protected static Logger m_Logger = Logger.getLogger(HibernateCourier.class);
+
+	protected Query m_prepDelete = null;
+	protected Query m_prepInsert = null;
+	protected Query m_prepUpdate = null;
+	protected Query m_prepSelUpd = null;
+	protected Query m_prepGetList = null;
+	
+	private boolean m_isReceiver = false;
+	protected long m_pollLatency = 200;
+
+	
+	private HibernateCourier() {
+	}
+	
+	/**
+	 * package protected constructor - Objects of Courier should only be
+	 * instantiated by the Factory
+	 * 
+	 * @param epr
+	 */
+	HibernateCourier(HibernateEpr epr) throws CourierException {
+		this(epr, false);
+	}
+	
+	public HibernateCourier(HibernateEpr epr, boolean pickUpOnly) {
+		m_isReceiver = pickUpOnly;
+		m_epr = epr;		
+	}
+
+	public void cleanup() {
+	}
+
+	/**
+	 * package the ESB message in a java.io.Serializable, and write it
+	 * 
+	 * @param message
+	 *            Message - the message to deliverAsync
+	 * @return boolean - the result of the delivery
+	 * @throws CourierException -
+	 *             if problems were encountered
+	 */
+	public boolean deliver(Message message) throws CourierException {
+		if (m_isReceiver)
+			throw new CourierException("This is a read-only Courier");
+
+		if (null == message)
+			return false;
+
+		Call call = message.getHeader().getCall();
+		if (null==call)
+			message.getHeader().setCall(call=new Call());
+		try {
+			if (null == call.getMessageID())
+				call.setMessageID(new URI(UUID.randomUUID().toString()));
+		} catch (URISyntaxException e) {
+			throw new CourierException("Problems with message header ",e);
+		}
+
+		return false;
+	}
+	
+	
+	/* (non-Javadoc)
+	 * @see org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier#pickup(long)
+	 */
+	
+	public Message pickup(long millis) throws CourierException,
+			CourierTimeoutException {
+		return null;
+	}
+	
+
+	
+	protected enum State {
+		Pending, WorkInProgress, Done, Error;
+		String getColumnValue() {
+			return toString().substring(0, 1);
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,490 +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.internal.soa.esb.couriers;
-
-import java.io.IOException;
-import java.io.Serializable;
-import java.net.URISyntaxException;
-import java.util.List;
-import java.util.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-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.internal.soa.esb.rosetta.pooling.ConnectionException;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.helpers.NamingContext;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.Util;
-import org.xml.sax.SAXException;
-
-public class JmsCourier implements PickUpOnlyCourier, DeliverOnlyCourier
-{
-	/**
-	 * package protected constructor - Objects of Courier should only be
-	 * instantiated by the Factory
-	 * 
-	 * @param epr
-	 */
-	JmsCourier (JMSEpr epr) throws CourierException
-	{
-		this(epr, false);
-	}
-
-	/**
-	 * package protected constructor - Objects of Courier should only be
-	 * instantiated by the Factory
-	 * 
-	 * @param epr
-	 */
-	JmsCourier (JMSEpr epr, boolean isReceiver) throws CourierException
-	{
-		_isReceiver = isReceiver;
-		_epr = epr;
-		_sleepForRetries = 3000;
-
-		if (!_isReceiver)
-			try
-			{
-				_messageProperties = Util.propertiesFromSelector(_epr
-						.getMessageSelector());
-			}
-			catch (Exception e)
-			{
-				throw new CourierException(e);
-			}
-
-	} // ________________________________
-
-	public void cleanup ()
-	{
-		if (null != _messageProducer) try
-		{
-			_messageProducer.close();
-		}
-		catch (JMSException e)
-		{
-			_logger.debug(e.getMessage(), e);
-		}
-
-		if (null != _messageConsumer) try
-		{
-			_messageConsumer.close();
-		}
-		catch (JMSException e)
-		{
-			_logger.debug(e.getMessage(), e);
-		}
-
-		if (null != _jmsSession)
-		{
-			_pool.closeSession(_jmsSession);
-		}
-
-		_messageProducer = null;
-		_messageConsumer = null;
-		_jmsSession = null;
-	} // ________________________________
-
-	/**
-	 * package the ESB message in a javax.jms.ObjectMessage, and send it
-	 * 
-	 * @param message
-	 *            Message - the message to deliverAsync
-	 * @return boolean - the result of the delivery
-	 * @throws CourierException -
-	 *             if problems were encountered
-	 */
-	public boolean deliver (Message message) throws CourierException
-	{
-    		if (_isReceiver)
-    			throw new CourierException("This is a read-only Courier");
-    
-    		if (null == message) return false;
-    		if (null == _messageProducer) try
-    		{
-    			createMessageProducer();
-    		}
-    		catch (Exception e)
-    		{
-    			throw new CourierException(e);
-    		}
-    
-    		while (null != _messageProducer)
-    		{
-    			try
-    			{
-    				// obtain Serializable version of arg0 and package it in a jms
-    				// ObjectMessage
-    				ObjectMessage msg = _jmsSession.createObjectMessage(Util
-    						.serialize(message));
-    				for (KeyValuePair kvp : _messageProperties)
-    					msg.setStringProperty(kvp.getKey(), kvp.getValue());
-    				sendMessage(msg);
-    				return true;
-    			}
-    			catch (JMSException e)
-    			{
-    				jmsConnectRetry(e);
-    			}
-    			catch (Exception e)
-    			{
-    				throw new CourierException(e);
-    			}
-    		}
-    		return false;
-	} // ________________________________
-
-	/**
-	 * send/publish a javax.jms.ObjectMessage (that will contain the serialized
-	 * ESB Message)
-	 * 
-	 * @param jmsMessage
-	 */
-	private void sendMessage (javax.jms.Message jmsMessage) throws JMSException, URISyntaxException
-	{
-        String sType = _epr.getDestinationType();
-    	if (JMSEpr.TOPIC_TYPE.equals(sType)) {
-            ((TopicPublisher) _messageProducer).publish(jmsMessage);
-        } else {
-    		_messageProducer.send(jmsMessage);
-        }
-        
-	} // ________________________________
-
-	private void jmsConnectRetry (Exception exc)
-	{
-                _logger.debug("JMS error.  Attempting JMS reconnect.", exc);
-		_jmsSession = null;
-		_messageProducer = null;
-		_messageConsumer = null;
-
-                final int maxRetry = 5 ; // TODO Magic number here!!!
-		for (int i1 = 0; i1 < maxRetry; i1++)
-		{
-			// try to reconnect to the queue
-			try
-			{
-				if (_isReceiver) createMessageConsumer();
-				else
-					createMessageProducer();
-                                break ;
-			}
-			catch (Exception e)
-			{
-                                if (i1 < maxRetry-1)
-                                {
-                                    try
-                                    {
-                                            Thread.sleep(_sleepForRetries);
-                                    }
-                                    catch (InterruptedException e1)
-                                    { // Just return after logging
-                                        _logger.debug("Unexpected thread interupt exception.", e);
-                                        break;
-                                    }
-                                }
-                                else
-                                {
-                                    _logger.debug("Failed to reconnect to JMS", e);
-                                }
-			}
-		}
-	} // ________________________________
-
-	private void createMessageProducer () throws CourierException,
-			MalformedEPRException
-	{
-        Context oJndiCtx = null;
-		try
-		{
-			oJndiCtx = NamingContext.getServerContext(_epr.getJndiEnvironment());
-
-			String sFactoryClass = _epr.getConnectionFactory();
-			if (Util.isNullString(sFactoryClass))
-				sFactoryClass = "ConnectionFactory";
-
-			String sType = _epr.getDestinationType();
-             _pool = JmsConnectionPoolContainer.getPool(_epr.getJndiEnvironment(), sFactoryClass, sType);
-                
-			if (JMSEpr.QUEUE_TYPE.equals(sType)) {
-				QueueSession qSess = _pool.getQueueSession();
-                _jmsSession = qSess;
-				javax.jms.Queue queue = null;
-				try {
-					queue = (javax.jms.Queue) oJndiCtx.lookup(_epr
-							.getDestinationName());
-				} catch (NamingException ne) {
-                    try {
-                        oJndiCtx = NamingContext.getFreshServerContext(_epr.getJndiEnvironment());
-                        queue = (javax.jms.Queue) oJndiCtx.lookup(_epr
-                                .getDestinationName());
-                    } catch (NamingException nex) {
-                        //ActiveMQ
-                        queue = qSess.createQueue(_epr.getDestinationName());
-                    }
-				}
-				_messageProducer = qSess.createSender(queue);
-			} else if (JMSEpr.TOPIC_TYPE.equals(sType)) {
-				TopicSession tSess = _pool.getTopicSession();
-                _jmsSession = tSess;
-				Topic topic = null;
-				try
-				{
-					topic = (Topic) oJndiCtx.lookup(_epr
-							.getDestinationName());
-				}
-				catch (NamingException ne)
-				{
-					topic = tSess.createTopic(_epr.getDestinationName());
-				}
-				_messageProducer = tSess.createPublisher(topic);
-			} else {
-				throw new CourierException("Unknown destination type");
-            }
-		}
-        catch (ConnectionException vex)
-        {
-            throw new CourierException(vex);
-        }
-		catch (JMSException ex)
-		{
-			_logger.debug("Error from JMS system.", ex);
-			
-			throw new CourierException(ex);
-		}
-		catch (NamingException ex)
-		{
-			_logger.debug("JMX lookup error.", ex);
-			
-			throw new CourierException(ex);
-		}
-		catch (URISyntaxException ex)
-		{
-			throw new MalformedEPRException(ex);
-		}
-	} // ________________________________
-
-	public Message pickup (long millis) throws CourierException
-	{
-    		if (!_isReceiver)
-    			throw new CourierException("This is an outgoing-only Courier");
-    		if (millis < 1)
-    			throw new IllegalArgumentException("Timeout millis must be > 0");
-    		if (null == _messageConsumer) try
-    		{
-    			createMessageConsumer();
-    		}
-    		catch (Exception e)
-    		{
-    			try
-    			{
-    				Thread.sleep(1000); // TODO magic number
-    			}
-    			catch (InterruptedException eI)
-    			{/* OK do nothing */
-    			}
-    			throw new CourierException("Unable to create Message Consumer", e);
-    		}
-    
-    		javax.jms.Message jmsMessage = null;
-    		while (null != _messageConsumer)
-    		{
-    			try
-    			{
-    				jmsMessage = _messageConsumer.receive(millis);
-    				break;
-    			}
-    			catch (JMSException e)
-    			{
-    				jmsConnectRetry(e);
-    			}
-    			catch (Exception e)
-    			{
-    				throw new CourierException(e);
-    			}
-    		}
-    		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();
-    			
-    			Message msg = Util.deserialize(obj);
-    			
-    			return msg;
-    		}
-    		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;
-	} // ________________________________
-
-	private void createMessageConsumer () throws CourierException, ConfigurationException, MalformedEPRException
-	{
-        Context oJndiCtx = null;
-        boolean success = false ;
-		try
-		{
-            Properties environment = _epr.getJndiEnvironment();
-			oJndiCtx = NamingContext.getServerContext(environment);
-			if (null == oJndiCtx)
-				throw new ConfigurationException(
-						"Unable fo obtain jndi context");
-			
-			String sFactoryClass = _epr.getConnectionFactory();
-			if (Util.isNullString(sFactoryClass))
-				sFactoryClass = "ConnectionFactory";
-            
-            String sType = _epr.getDestinationType();
-            _pool = JmsConnectionPoolContainer.getPool(environment, sFactoryClass, sType);
-	
-			if (JMSEpr.QUEUE_TYPE.equals(sType)) {
-				QueueSession qSess = _pool.getQueueSession();
-                _jmsSession = qSess;
-				javax.jms.Queue queue = null;
-				try {
-					queue = (javax.jms.Queue) oJndiCtx.lookup(_epr
-							.getDestinationName());
-				} catch (NamingException ne) {
-                    try {
-                        oJndiCtx = NamingContext.getFreshServerContext(environment);
-                        queue = (javax.jms.Queue) oJndiCtx.lookup(_epr
-                                .getDestinationName());
-                    } catch (NamingException nex) {
-                        //ActiveMQ
-                        queue = qSess.createQueue(_epr.getDestinationName());
-                    }
-				}
-				_messageConsumer = qSess.createReceiver(queue, _epr.getMessageSelector());
-			} else if (JMSEpr.TOPIC_TYPE.equals(sType)) {
-					TopicSession tSess = _pool.getTopicSession();
-                    _jmsSession = tSess;
-					Topic topic = tSess.createTopic(_epr.getDestinationName());
-					_messageConsumer = tSess.createConsumer(topic, _epr
-							.getMessageSelector());
-			} else {
-				throw new CourierException("Unknown destination type");
-            }
-                        success = true ;
-		}
-        catch (ConnectionException cex)
-        {
-            throw new CourierException(cex);
-        }
-		catch (JMSException ex)
-		{
-			_logger.debug("Error from JMS system.", ex);
-			
-			throw new CourierException(ex);
-		}
-		catch (NamingException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-		catch (URISyntaxException ex)
-		{
-			throw new MalformedEPRException(ex);
-		}
-                finally
-                {
-                    if (!success)
-                    {
-                        if (_jmsSession != null)
-                        {
-                            _pool.closeSession(_jmsSession) ;
-                            _jmsSession = null ;
-                        }
-                        _pool = null ;
-                    }
-                }
-	} // ________________________________
-
-
-	long _sleepForRetries = 3000; // milliseconds
-
-	protected boolean _isReceiver;
-
-	protected JMSEpr _epr;
-
-	protected Logger _logger = Logger.getLogger(JmsCourier.class);
-
-	protected String _messageSelector;
-
-	protected Session _jmsSession;
-
-	protected MessageProducer _messageProducer;
-
-	protected MessageConsumer _messageConsumer;
-
-	protected List<KeyValuePair> _messageProperties;
-    
-    protected JmsConnectionPool _pool;
-        
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/JmsCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,490 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers;
+
+import java.io.IOException;
+import java.io.Serializable;
+import java.net.URISyntaxException;
+import java.util.List;
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.Topic;
+import javax.jms.TopicPublisher;
+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.internal.soa.esb.rosetta.pooling.ConnectionException;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.helpers.NamingContext;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.Util;
+import org.xml.sax.SAXException;
+
+public class JmsCourier implements PickUpOnlyCourier, DeliverOnlyCourier
+{
+	/**
+	 * package protected constructor - Objects of Courier should only be
+	 * instantiated by the Factory
+	 * 
+	 * @param epr
+	 */
+	JmsCourier (JMSEpr epr) throws CourierException
+	{
+		this(epr, false);
+	}
+
+	/**
+	 * package protected constructor - Objects of Courier should only be
+	 * instantiated by the Factory
+	 * 
+	 * @param epr
+	 */
+	JmsCourier (JMSEpr epr, boolean isReceiver) throws CourierException
+	{
+		_isReceiver = isReceiver;
+		_epr = epr;
+		_sleepForRetries = 3000;
+
+		if (!_isReceiver)
+			try
+			{
+				_messageProperties = Util.propertiesFromSelector(_epr
+						.getMessageSelector());
+			}
+			catch (Exception e)
+			{
+				throw new CourierException(e);
+			}
+
+	} // ________________________________
+
+	public void cleanup ()
+	{
+		if (null != _messageProducer) try
+		{
+			_messageProducer.close();
+		}
+		catch (JMSException e)
+		{
+			_logger.debug(e.getMessage(), e);
+		}
+
+		if (null != _messageConsumer) try
+		{
+			_messageConsumer.close();
+		}
+		catch (JMSException e)
+		{
+			_logger.debug(e.getMessage(), e);
+		}
+
+		if (null != _jmsSession)
+		{
+			_pool.closeSession(_jmsSession);
+		}
+
+		_messageProducer = null;
+		_messageConsumer = null;
+		_jmsSession = null;
+	} // ________________________________
+
+	/**
+	 * package the ESB message in a javax.jms.ObjectMessage, and send it
+	 * 
+	 * @param message
+	 *            Message - the message to deliverAsync
+	 * @return boolean - the result of the delivery
+	 * @throws CourierException -
+	 *             if problems were encountered
+	 */
+	public boolean deliver (Message message) throws CourierException
+	{
+    		if (_isReceiver)
+    			throw new CourierException("This is a read-only Courier");
+    
+    		if (null == message) return false;
+    		if (null == _messageProducer) try
+    		{
+    			createMessageProducer();
+    		}
+    		catch (Exception e)
+    		{
+    			throw new CourierException(e);
+    		}
+    
+    		while (null != _messageProducer)
+    		{
+    			try
+    			{
+    				// obtain Serializable version of arg0 and package it in a jms
+    				// ObjectMessage
+    				ObjectMessage msg = _jmsSession.createObjectMessage(Util
+    						.serialize(message));
+    				for (KeyValuePair kvp : _messageProperties)
+    					msg.setStringProperty(kvp.getKey(), kvp.getValue());
+    				sendMessage(msg);
+    				return true;
+    			}
+    			catch (JMSException e)
+    			{
+    				jmsConnectRetry(e);
+    			}
+    			catch (Exception e)
+    			{
+    				throw new CourierException(e);
+    			}
+    		}
+    		return false;
+	} // ________________________________
+
+	/**
+	 * send/publish a javax.jms.ObjectMessage (that will contain the serialized
+	 * ESB Message)
+	 * 
+	 * @param jmsMessage
+	 */
+	private void sendMessage (javax.jms.Message jmsMessage) throws JMSException, URISyntaxException
+	{
+        String sType = _epr.getDestinationType();
+    	if (JMSEpr.TOPIC_TYPE.equals(sType)) {
+            ((TopicPublisher) _messageProducer).publish(jmsMessage);
+        } else {
+    		_messageProducer.send(jmsMessage);
+        }
+        
+	} // ________________________________
+
+	private void jmsConnectRetry (Exception exc)
+	{
+                _logger.debug("JMS error.  Attempting JMS reconnect.", exc);
+		_jmsSession = null;
+		_messageProducer = null;
+		_messageConsumer = null;
+
+                final int maxRetry = 5 ; // TODO Magic number here!!!
+		for (int i1 = 0; i1 < maxRetry; i1++)
+		{
+			// try to reconnect to the queue
+			try
+			{
+				if (_isReceiver) createMessageConsumer();
+				else
+					createMessageProducer();
+                                break ;
+			}
+			catch (Exception e)
+			{
+                                if (i1 < maxRetry-1)
+                                {
+                                    try
+                                    {
+                                            Thread.sleep(_sleepForRetries);
+                                    }
+                                    catch (InterruptedException e1)
+                                    { // Just return after logging
+                                        _logger.debug("Unexpected thread interupt exception.", e);
+                                        break;
+                                    }
+                                }
+                                else
+                                {
+                                    _logger.debug("Failed to reconnect to JMS", e);
+                                }
+			}
+		}
+	} // ________________________________
+
+	private void createMessageProducer () throws CourierException,
+			MalformedEPRException
+	{
+        Context oJndiCtx = null;
+		try
+		{
+			oJndiCtx = NamingContext.getServerContext(_epr.getJndiEnvironment());
+
+			String sFactoryClass = _epr.getConnectionFactory();
+			if (Util.isNullString(sFactoryClass))
+				sFactoryClass = "ConnectionFactory";
+
+			String sType = _epr.getDestinationType();
+             _pool = JmsConnectionPoolContainer.getPool(_epr.getJndiEnvironment(), sFactoryClass, sType);
+                
+			if (JMSEpr.QUEUE_TYPE.equals(sType)) {
+				QueueSession qSess = _pool.getQueueSession();
+                _jmsSession = qSess;
+				javax.jms.Queue queue = null;
+				try {
+					queue = (javax.jms.Queue) oJndiCtx.lookup(_epr
+							.getDestinationName());
+				} catch (NamingException ne) {
+                    try {
+                        oJndiCtx = NamingContext.getFreshServerContext(_epr.getJndiEnvironment());
+                        queue = (javax.jms.Queue) oJndiCtx.lookup(_epr
+                                .getDestinationName());
+                    } catch (NamingException nex) {
+                        //ActiveMQ
+                        queue = qSess.createQueue(_epr.getDestinationName());
+                    }
+				}
+				_messageProducer = qSess.createSender(queue);
+			} else if (JMSEpr.TOPIC_TYPE.equals(sType)) {
+				TopicSession tSess = _pool.getTopicSession();
+                _jmsSession = tSess;
+				Topic topic = null;
+				try
+				{
+					topic = (Topic) oJndiCtx.lookup(_epr
+							.getDestinationName());
+				}
+				catch (NamingException ne)
+				{
+					topic = tSess.createTopic(_epr.getDestinationName());
+				}
+				_messageProducer = tSess.createPublisher(topic);
+			} else {
+				throw new CourierException("Unknown destination type");
+            }
+		}
+        catch (ConnectionException vex)
+        {
+            throw new CourierException(vex);
+        }
+		catch (JMSException ex)
+		{
+			_logger.debug("Error from JMS system.", ex);
+			
+			throw new CourierException(ex);
+		}
+		catch (NamingException ex)
+		{
+			_logger.debug("JMX lookup error.", ex);
+			
+			throw new CourierException(ex);
+		}
+		catch (URISyntaxException ex)
+		{
+			throw new MalformedEPRException(ex);
+		}
+	} // ________________________________
+
+	public Message pickup (long millis) throws CourierException
+	{
+    		if (!_isReceiver)
+    			throw new CourierException("This is an outgoing-only Courier");
+    		if (millis < 1)
+    			throw new IllegalArgumentException("Timeout millis must be > 0");
+    		if (null == _messageConsumer) try
+    		{
+    			createMessageConsumer();
+    		}
+    		catch (Exception e)
+    		{
+    			try
+    			{
+    				Thread.sleep(1000); // TODO magic number
+    			}
+    			catch (InterruptedException eI)
+    			{/* OK do nothing */
+    			}
+    			throw new CourierException("Unable to create Message Consumer", e);
+    		}
+    
+    		javax.jms.Message jmsMessage = null;
+    		while (null != _messageConsumer)
+    		{
+    			try
+    			{
+    				jmsMessage = _messageConsumer.receive(millis);
+    				break;
+    			}
+    			catch (JMSException e)
+    			{
+    				jmsConnectRetry(e);
+    			}
+    			catch (Exception e)
+    			{
+    				throw new CourierException(e);
+    			}
+    		}
+    		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();
+    			
+    			Message msg = Util.deserialize(obj);
+    			
+    			return msg;
+    		}
+    		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;
+	} // ________________________________
+
+	private void createMessageConsumer () throws CourierException, ConfigurationException, MalformedEPRException
+	{
+        Context oJndiCtx = null;
+        boolean success = false ;
+		try
+		{
+            Properties environment = _epr.getJndiEnvironment();
+			oJndiCtx = NamingContext.getServerContext(environment);
+			if (null == oJndiCtx)
+				throw new ConfigurationException(
+						"Unable fo obtain jndi context");
+			
+			String sFactoryClass = _epr.getConnectionFactory();
+			if (Util.isNullString(sFactoryClass))
+				sFactoryClass = "ConnectionFactory";
+            
+            String sType = _epr.getDestinationType();
+            _pool = JmsConnectionPoolContainer.getPool(environment, sFactoryClass, sType);
+	
+			if (JMSEpr.QUEUE_TYPE.equals(sType)) {
+				QueueSession qSess = _pool.getQueueSession();
+                _jmsSession = qSess;
+				javax.jms.Queue queue = null;
+				try {
+					queue = (javax.jms.Queue) oJndiCtx.lookup(_epr
+							.getDestinationName());
+				} catch (NamingException ne) {
+                    try {
+                        oJndiCtx = NamingContext.getFreshServerContext(environment);
+                        queue = (javax.jms.Queue) oJndiCtx.lookup(_epr
+                                .getDestinationName());
+                    } catch (NamingException nex) {
+                        //ActiveMQ
+                        queue = qSess.createQueue(_epr.getDestinationName());
+                    }
+				}
+				_messageConsumer = qSess.createReceiver(queue, _epr.getMessageSelector());
+			} else if (JMSEpr.TOPIC_TYPE.equals(sType)) {
+					TopicSession tSess = _pool.getTopicSession();
+                    _jmsSession = tSess;
+					Topic topic = tSess.createTopic(_epr.getDestinationName());
+					_messageConsumer = tSess.createConsumer(topic, _epr
+							.getMessageSelector());
+			} else {
+				throw new CourierException("Unknown destination type");
+            }
+                        success = true ;
+		}
+        catch (ConnectionException cex)
+        {
+            throw new CourierException(cex);
+        }
+		catch (JMSException ex)
+		{
+			_logger.debug("Error from JMS system.", ex);
+			
+			throw new CourierException(ex);
+		}
+		catch (NamingException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+		catch (URISyntaxException ex)
+		{
+			throw new MalformedEPRException(ex);
+		}
+                finally
+                {
+                    if (!success)
+                    {
+                        if (_jmsSession != null)
+                        {
+                            _pool.closeSession(_jmsSession) ;
+                            _jmsSession = null ;
+                        }
+                        _pool = null ;
+                    }
+                }
+	} // ________________________________
+
+
+	long _sleepForRetries = 3000; // milliseconds
+
+	protected boolean _isReceiver;
+
+	protected JMSEpr _epr;
+
+	protected Logger _logger = Logger.getLogger(JmsCourier.class);
+
+	protected String _messageSelector;
+
+	protected Session _jmsSession;
+
+	protected MessageProducer _messageProducer;
+
+	protected MessageConsumer _messageConsumer;
+
+	protected List<KeyValuePair> _messageProperties;
+    
+    protected JmsConnectionPool _pool;
+        
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/PickUpOnlyCourier.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/PickUpOnlyCourier.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/PickUpOnlyCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,37 +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.internal.soa.esb.couriers;
-
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierTimeoutException;
-import org.jboss.soa.esb.message.Message;
-/**
- * 
- * @author kstam
- *
- */
-public interface PickUpOnlyCourier 
-{
-	public Message	pickup(long millis) throws CourierException, CourierTimeoutException;
-        public void cleanup() ;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/PickUpOnlyCourier.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/PickUpOnlyCourier.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/PickUpOnlyCourier.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/PickUpOnlyCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,37 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers;
+
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierTimeoutException;
+import org.jboss.soa.esb.message.Message;
+/**
+ * 
+ * @author kstam
+ *
+ */
+public interface PickUpOnlyCourier 
+{
+	public Message	pickup(long millis) throws CourierException, CourierTimeoutException;
+        public void cleanup() ;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,574 +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.internal.soa.esb.couriers;
-
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
-import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.Util;
-import org.xml.sax.SAXParseException;
-
-public class SqlTableCourier implements PickUpOnlyCourier, DeliverOnlyCourier
-{
-	/**
-	 * disable default constructor
-	 */
-	private SqlTableCourier()
-	{
-	}
-
-	/**
-	 * package protected constructor - Objects of Courier should only be
-	 * instantiated by the Factory
-	 * 
-	 * @param epr
-	 */
-	SqlTableCourier(JDBCEpr epr) throws CourierException
-	{
-		this(epr, false);
-	}
-
-	/**
-	 * package protected constructor - Objects of Courier should only be
-	 * instantiated by the Factory
-	 * 
-	 * @param epr
-	 */
-	SqlTableCourier(JDBCEpr epr, boolean isReceiver) throws CourierException
-	{
-		_isReceiver = isReceiver;
-		_epr = epr;
-		_sleepForRetries = 3000;  // TODO magic number - configurable?
-		try
-		{
-			_postDelete = Boolean.TRUE.equals(Boolean.valueOf(epr
-					.getPostDelete()));
-			_errorDelete = Boolean.TRUE.equals(Boolean.valueOf(epr
-					.getErrorDelete()));
-		}
-		catch (URISyntaxException e)
-		{
-			throw new CourierException(e);
-		}
-
-	} // ________________________________
-
-	public void cleanup()
-	{
-		if (null != _conn)
-		{
-			try
-			{
-				_conn.release();
-			}
-			catch (Exception e)
-			{
-                                _logger.info("Unable to release connection");
-                                _logger.debug("Unable to release connection", e);
-			}
-		}
-
-	} // ________________________________
-
-	/**
-	 * package the ESB message in a java.io.Serializable, and write it
-	 * 
-	 * @param message
-	 *            Message - the message to deliverAsync
-	 * @return boolean - the result of the delivery
-	 * @throws CourierException -
-	 *             if problems were encountered
-	 */
-	public boolean deliver(Message message) throws CourierException
-	{
-		if (_isReceiver)
-			throw new CourierException("This is a read-only Courier");
-
-		if (null == message)
-			return false;
-
-		String msgId = null;
-		Call call = message.getHeader().getCall();
-		if (null==call)
-			message.getHeader().setCall(call=new Call());
-		try
-		{
-			if (null==call.getMessageID())
-				call.setMessageID(new URI(UUID.randomUUID().toString()));
-			msgId = call.getMessageID().toString();
-		}
-		catch (URISyntaxException e)
-		{
-			throw new CourierException("Problems with message header ",e);
-		}
-
-		if (null == _conn)
-		{
-			try
-			{
-				_conn = getConn();
-			}
-			catch (Exception e)
-			{
-				throw new CourierException(e);
-			}
-		}
-
-		while (_conn != null)
-		{
-			try
-			{
-				int iCol = 1;
-				PreparedStatement PS = insertStatement();
-				PS.setString(iCol++, msgId);
-				PS.setObject(iCol++, Util.serialize(message));
-				PS.setString(iCol++, State.Pending.getColumnValue());
-				PS.setLong(iCol++, System.currentTimeMillis());
-
-				_conn.execUpdWait(PS, 3);
-				_conn.commit();
-				return true;
-			}
-			catch (SQLException e)
-			{
-				if (null != _conn)
-				{
-					try
-					{
-						_conn.rollback();
-					}
-					catch (Exception roll)
-					{
-						_logger.debug(roll);
-					}
-				}
-				
-				_logger.debug("SQL exception during deliver", e);
-				throw new CourierException(e);
-			}
-			catch (Exception e)
-			{
-				jdbcConnectRetry(e);
-			}
-		}
-		return false;
-	} // ________________________________
-
-	public Message pickup(long millis) throws CourierException
-	{
-		Message result = null;
-		long limit = System.currentTimeMillis()
-				+ ((millis < 100) ? 100 : millis);
-		do
-		{
-                        try
-                        {
-                                ResultSet RS = getRowList();
-				while (null != RS && RS.next())
-				{
-					String messageId = RS.getString(1);
-					if (null == (result = tryToPickup(messageId)))
-						continue;
-					
-					return result;
-				}
-                        }
-			catch (SQLException e)
-			{
-				_logger.debug("SQL Exception during pickup", e);
-				return null;
-			}
-                        finally
-                        {
-                            // Added to make sure we release transactions from all paths
-                            if (_conn != null)
-                            {
-                                try
-                                {
-                                    _conn.rollback() ;
-                                }
-                                catch (final SQLException sqle) {} //ignore
-                            }
-                        }
-                        try
-                        {
-                                long lSleep = limit - System.currentTimeMillis();
-                                if (_pollLatency < lSleep)
-                                        lSleep = _pollLatency;
-                                if (lSleep > 0)
-                                        Thread.sleep(lSleep);
-                        }
-                        catch (InterruptedException e)
-                        {
-                                return null;
-                        }
-		} while (System.currentTimeMillis() <= limit);
-		return null;
-	} // ________________________________
-
-	private Message tryToPickup(String messageId) throws CourierException,
-			SQLException
-	{
-		int iParm = 1;
-
-		select4UpdateStatement().setString(iParm++, messageId);
-		select4UpdateStatement().setString(iParm++,
-				State.Pending.getColumnValue());
-
-		while (_conn != null)
-		{
-			try
-			{
-				ResultSet RS = _conn.execQueryWait(select4UpdateStatement(), 3);
-				while (RS.next())
-				{
-					Exception eBad = null;
-					try
-					{
-						Message result = Util.deserialize((Serializable) RS
-								.getObject(1));
-						if (_postDelete)
-							deleteMsg(messageId);
-						else
-							changeStatus(messageId, State.Done);
-						return result;
-					}
-					catch (ClassCastException e)
-					{
-						eBad = e;
-					}
-					catch (SAXParseException e)
-					{
-						eBad = e;
-					}
-					catch (Exception e)
-					{
-						throw new CourierException(e);
-					}
-					if (null != eBad)
-					{
-						if (_errorDelete)
-							deleteMsg(messageId);
-						else
-							changeStatus(messageId, State.Error);
-						continue;
-					}
-				}
-				return null;
-			}
-			catch (SQLException e)
-			{
-				throw new CourierException(e);
-			}
-			catch (Exception e)
-			{
-				jdbcConnectRetry(e);
-			}
-		}
-		return null;
-	} // ________________________________
-
-	private void deleteMsg(String messageId) throws SQLException
-	{
-		int iParm = 1;
-		deleteStatement().setString(iParm++, messageId);
-		_conn.execUpdWait(deleteStatement(), 3);
-		_conn.commit();
-
-	}
-
-	private void changeStatus(String messageId, State to) throws SQLException
-	{
-		int iParm = 1;
-		updateStatusStatement().setString(iParm++, to.getColumnValue());
-		updateStatusStatement().setString(iParm++, messageId);
-		_conn.execUpdWait(updateStatusStatement(), 3);
-		_conn.commit();
-
-	}
-
-	private ResultSet getRowList() throws CourierException
-	{
-		if (null == _conn)
-		{
-			try
-			{
-				_conn = getConn();
-			}
-			catch (Exception e)
-			{
-				throw new CourierException(e);
-			}
-		}
-		while (_conn != null)
-		{
-			try
-			{
-				return _conn.execQueryWait(listStatement(), 3);
-			}
-			catch (Exception e)
-			{
-				jdbcConnectRetry(e);
-			}
-		}
-		return null;
-
-	} // _______________________________
-
-	private void jdbcConnectRetry(Exception exc)
-	{
-		_logger.debug("DB problem, will try to reconnect", exc);
-		if (null != _conn)
-			_conn.release();
-		_conn = null;
-
-		_prepDelete = _prepGetList = _prepInsert = _prepSel4Upd = _prepUpdateStatus = null;
-		for (int i1 = 0; i1 < 3; i1++)
-		{
-			try
-			{
-				_conn = getConn();
-			}
-			catch (Exception e)
-			{
-				try
-				{
-					Thread.sleep(_sleepForRetries);
-				}
-				catch (InterruptedException eInt)
-				{
-					return;
-				}
-			}
-		}
-	} // ________________________________
-
-	private JdbcCleanConn getConn() throws SQLException, MalformedEPRException
-	{
-		if (null == _conn)
-		{
-			try
-			{
-				SimpleDataSource DS = new SimpleDataSource(_epr.getDriver(), _epr
-						.getURL(), _epr.getUserName(), _epr.getPassword());
-				_conn = new JdbcCleanConn(DS);
-			}
-			catch (URISyntaxException ex)
-			{
-				throw new MalformedEPRException(ex);
-			}
-		}
-		return _conn;
-	} // ________________________________
-
-	protected PreparedStatement listStatement()
-	{
-		if (null == _prepGetList)
-
-			try
-			{
-				String[] columns =
-				{ _epr.getMessageIdColumn(), _epr.getTimestampColumn() };
-
-				StringBuilder sb = new StringBuilder("select");
-				int i1 = 0;
-				for (String col : columns)
-					sb.append((i1++ < 1) ? " " : ",").append(col);
-				sb.append(" from ").append(_epr.getTableName());
-				sb.append(" where ").append(_epr.getStatusColumn())
-						.append("='").append(State.Pending.getColumnValue())
-						.append("'").append(" order by 2");
-				_prepGetList = getConn().prepareStatement(sb.toString());
-			}
-			catch (Exception e)
-			{
-				_logger.debug("Unable to prepare SQL statement", e);
-				return null;
-			}
-		return _prepGetList;
-	} // ________________________________
-
-	protected PreparedStatement select4UpdateStatement()
-	{
-		if (_prepSel4Upd == null)
-		{
-			try
-			{
-				/*
-				 * TODO make this dynamic using a factory pattern.
-				 */
-
-				StringBuilder sb = null;
-
-				if (!_epr.getURL().contains("hsqldb"))
-				{
-					sb = new StringBuilder("select ").append(
-							_epr.getDataColumn()).append(" from ").append(
-							_epr.getTableName()).append(" where ").append(
-							_epr.getMessageIdColumn()).append("=?").append(
-							" and ").append(_epr.getStatusColumn())
-							.append("=?").append(" for update");
-				}
-				else
-				{
-					/*
-					 * HSQL does not support FOR UPDATE! All tables appear to
-					 * be inherently updatable!
-					 */
-					
-					sb = new StringBuilder("select ").append(
-							_epr.getDataColumn()).append(" from ").append(
-							_epr.getTableName()).append(" where ").append(
-							_epr.getMessageIdColumn()).append("=?").append(
-							" and ").append(_epr.getStatusColumn())
-							.append("=?");
-				}
-
-				_prepSel4Upd = getConn().prepareStatement(sb.toString());
-			}
-			catch (Exception e)
-			{
-				_logger.debug(e);
-				return null;
-			}
-		}
-
-		return _prepSel4Upd;
-	} // ________________________________
-
-	protected PreparedStatement updateStatusStatement()
-	{
-		if (null == _prepUpdateStatus)
-			try
-			{
-				StringBuilder sb = new StringBuilder("update ").append(
-						_epr.getTableName()).append(" set ").append(
-						_epr.getStatusColumn()).append("= ?").append(" where ")
-						.append(_epr.getMessageIdColumn()).append("=?");
-				_prepUpdateStatus = getConn().prepareStatement(sb.toString());
-			}
-			catch (Exception e)
-			{
-				_logger.debug(e);
-				return null;
-			}
-		return _prepUpdateStatus;
-	} // ________________________________
-
-	protected PreparedStatement insertStatement()
-	{
-		if (null == _prepInsert)
-			try
-			{
-				String[] columns =
-				{ _epr.getMessageIdColumn(), _epr.getDataColumn(),
-						_epr.getStatusColumn(), _epr.getTimestampColumn() };
-
-				StringBuilder sb = new StringBuilder("insert into ").append(
-						_epr.getTableName()).append("(");
-				int i1 = 0;
-				for (String col : columns)
-					sb.append((i1++ < 1) ? " " : ",").append(col);
-				sb.append(") values (?,?,?,?)");
-				_prepInsert = getConn().prepareStatement(sb.toString());
-			}
-			catch (Exception e)
-			{
-				_logger.debug(e);
-				return null;
-			}
-		return _prepInsert;
-	} // ________________________________
-
-	protected PreparedStatement deleteStatement()
-	{
-		if (null == _prepDelete)
-			try
-			{
-				StringBuilder sb = new StringBuilder("delete from ").append(
-						_epr.getTableName()).append(" where ").append(
-						_epr.getMessageIdColumn()).append(" =?");
-				_prepDelete = getConn().prepareStatement(sb.toString());
-			}
-			catch (Exception e)
-			{
-				_logger.debug(e);
-				return null;
-			}
-		return _prepDelete;
-	} // ________________________________
-
-	protected enum State
-	{
-		Pending, WorkInProgress, Done, Error;
-		String getColumnValue()
-		{
-			return toString().substring(0, 1);
-		}
-	}
-
-	public void setPollLatency(Long millis)
-	{
-		if (millis <= 200)
-			_logger.warn("Poll latency must be >= 200 milliseconds - Keeping old value of "+_pollLatency);
-		else
-			_pollLatency = millis;
-	} // ________________________________
-	
-	protected long _pollLatency = 200;
-
-	protected long _sleepForRetries = 3000; // milliseconds
-
-	protected boolean _postDelete, _errorDelete;
-
-	protected boolean _isReceiver;
-
-	protected JDBCEpr _epr;
-
-	protected JdbcCleanConn _conn;
-
-	protected PreparedStatement _prepGetList;
-
-	protected PreparedStatement _prepSel4Upd;
-
-	protected PreparedStatement _prepUpdateStatus;
-
-	protected PreparedStatement _prepInsert;
-
-	protected PreparedStatement _prepDelete;
-
-	protected static Logger _logger = Logger.getLogger(SqlTableCourier.class);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/SqlTableCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,574 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers;
+
+import java.io.Serializable;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
+import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.Util;
+import org.xml.sax.SAXParseException;
+
+public class SqlTableCourier implements PickUpOnlyCourier, DeliverOnlyCourier
+{
+	/**
+	 * disable default constructor
+	 */
+	private SqlTableCourier()
+	{
+	}
+
+	/**
+	 * package protected constructor - Objects of Courier should only be
+	 * instantiated by the Factory
+	 * 
+	 * @param epr
+	 */
+	SqlTableCourier(JDBCEpr epr) throws CourierException
+	{
+		this(epr, false);
+	}
+
+	/**
+	 * package protected constructor - Objects of Courier should only be
+	 * instantiated by the Factory
+	 * 
+	 * @param epr
+	 */
+	SqlTableCourier(JDBCEpr epr, boolean isReceiver) throws CourierException
+	{
+		_isReceiver = isReceiver;
+		_epr = epr;
+		_sleepForRetries = 3000;  // TODO magic number - configurable?
+		try
+		{
+			_postDelete = Boolean.TRUE.equals(Boolean.valueOf(epr
+					.getPostDelete()));
+			_errorDelete = Boolean.TRUE.equals(Boolean.valueOf(epr
+					.getErrorDelete()));
+		}
+		catch (URISyntaxException e)
+		{
+			throw new CourierException(e);
+		}
+
+	} // ________________________________
+
+	public void cleanup()
+	{
+		if (null != _conn)
+		{
+			try
+			{
+				_conn.release();
+			}
+			catch (Exception e)
+			{
+                                _logger.info("Unable to release connection");
+                                _logger.debug("Unable to release connection", e);
+			}
+		}
+
+	} // ________________________________
+
+	/**
+	 * package the ESB message in a java.io.Serializable, and write it
+	 * 
+	 * @param message
+	 *            Message - the message to deliverAsync
+	 * @return boolean - the result of the delivery
+	 * @throws CourierException -
+	 *             if problems were encountered
+	 */
+	public boolean deliver(Message message) throws CourierException
+	{
+		if (_isReceiver)
+			throw new CourierException("This is a read-only Courier");
+
+		if (null == message)
+			return false;
+
+		String msgId = null;
+		Call call = message.getHeader().getCall();
+		if (null==call)
+			message.getHeader().setCall(call=new Call());
+		try
+		{
+			if (null==call.getMessageID())
+				call.setMessageID(new URI(UUID.randomUUID().toString()));
+			msgId = call.getMessageID().toString();
+		}
+		catch (URISyntaxException e)
+		{
+			throw new CourierException("Problems with message header ",e);
+		}
+
+		if (null == _conn)
+		{
+			try
+			{
+				_conn = getConn();
+			}
+			catch (Exception e)
+			{
+				throw new CourierException(e);
+			}
+		}
+
+		while (_conn != null)
+		{
+			try
+			{
+				int iCol = 1;
+				PreparedStatement PS = insertStatement();
+				PS.setString(iCol++, msgId);
+				PS.setObject(iCol++, Util.serialize(message));
+				PS.setString(iCol++, State.Pending.getColumnValue());
+				PS.setLong(iCol++, System.currentTimeMillis());
+
+				_conn.execUpdWait(PS, 3);
+				_conn.commit();
+				return true;
+			}
+			catch (SQLException e)
+			{
+				if (null != _conn)
+				{
+					try
+					{
+						_conn.rollback();
+					}
+					catch (Exception roll)
+					{
+						_logger.debug(roll);
+					}
+				}
+				
+				_logger.debug("SQL exception during deliver", e);
+				throw new CourierException(e);
+			}
+			catch (Exception e)
+			{
+				jdbcConnectRetry(e);
+			}
+		}
+		return false;
+	} // ________________________________
+
+	public Message pickup(long millis) throws CourierException
+	{
+		Message result = null;
+		long limit = System.currentTimeMillis()
+				+ ((millis < 100) ? 100 : millis);
+		do
+		{
+                        try
+                        {
+                                ResultSet RS = getRowList();
+				while (null != RS && RS.next())
+				{
+					String messageId = RS.getString(1);
+					if (null == (result = tryToPickup(messageId)))
+						continue;
+					
+					return result;
+				}
+                        }
+			catch (SQLException e)
+			{
+				_logger.debug("SQL Exception during pickup", e);
+				return null;
+			}
+                        finally
+                        {
+                            // Added to make sure we release transactions from all paths
+                            if (_conn != null)
+                            {
+                                try
+                                {
+                                    _conn.rollback() ;
+                                }
+                                catch (final SQLException sqle) {} //ignore
+                            }
+                        }
+                        try
+                        {
+                                long lSleep = limit - System.currentTimeMillis();
+                                if (_pollLatency < lSleep)
+                                        lSleep = _pollLatency;
+                                if (lSleep > 0)
+                                        Thread.sleep(lSleep);
+                        }
+                        catch (InterruptedException e)
+                        {
+                                return null;
+                        }
+		} while (System.currentTimeMillis() <= limit);
+		return null;
+	} // ________________________________
+
+	private Message tryToPickup(String messageId) throws CourierException,
+			SQLException
+	{
+		int iParm = 1;
+
+		select4UpdateStatement().setString(iParm++, messageId);
+		select4UpdateStatement().setString(iParm++,
+				State.Pending.getColumnValue());
+
+		while (_conn != null)
+		{
+			try
+			{
+				ResultSet RS = _conn.execQueryWait(select4UpdateStatement(), 3);
+				while (RS.next())
+				{
+					Exception eBad = null;
+					try
+					{
+						Message result = Util.deserialize((Serializable) RS
+								.getObject(1));
+						if (_postDelete)
+							deleteMsg(messageId);
+						else
+							changeStatus(messageId, State.Done);
+						return result;
+					}
+					catch (ClassCastException e)
+					{
+						eBad = e;
+					}
+					catch (SAXParseException e)
+					{
+						eBad = e;
+					}
+					catch (Exception e)
+					{
+						throw new CourierException(e);
+					}
+					if (null != eBad)
+					{
+						if (_errorDelete)
+							deleteMsg(messageId);
+						else
+							changeStatus(messageId, State.Error);
+						continue;
+					}
+				}
+				return null;
+			}
+			catch (SQLException e)
+			{
+				throw new CourierException(e);
+			}
+			catch (Exception e)
+			{
+				jdbcConnectRetry(e);
+			}
+		}
+		return null;
+	} // ________________________________
+
+	private void deleteMsg(String messageId) throws SQLException
+	{
+		int iParm = 1;
+		deleteStatement().setString(iParm++, messageId);
+		_conn.execUpdWait(deleteStatement(), 3);
+		_conn.commit();
+
+	}
+
+	private void changeStatus(String messageId, State to) throws SQLException
+	{
+		int iParm = 1;
+		updateStatusStatement().setString(iParm++, to.getColumnValue());
+		updateStatusStatement().setString(iParm++, messageId);
+		_conn.execUpdWait(updateStatusStatement(), 3);
+		_conn.commit();
+
+	}
+
+	private ResultSet getRowList() throws CourierException
+	{
+		if (null == _conn)
+		{
+			try
+			{
+				_conn = getConn();
+			}
+			catch (Exception e)
+			{
+				throw new CourierException(e);
+			}
+		}
+		while (_conn != null)
+		{
+			try
+			{
+				return _conn.execQueryWait(listStatement(), 3);
+			}
+			catch (Exception e)
+			{
+				jdbcConnectRetry(e);
+			}
+		}
+		return null;
+
+	} // _______________________________
+
+	private void jdbcConnectRetry(Exception exc)
+	{
+		_logger.debug("DB problem, will try to reconnect", exc);
+		if (null != _conn)
+			_conn.release();
+		_conn = null;
+
+		_prepDelete = _prepGetList = _prepInsert = _prepSel4Upd = _prepUpdateStatus = null;
+		for (int i1 = 0; i1 < 3; i1++)
+		{
+			try
+			{
+				_conn = getConn();
+			}
+			catch (Exception e)
+			{
+				try
+				{
+					Thread.sleep(_sleepForRetries);
+				}
+				catch (InterruptedException eInt)
+				{
+					return;
+				}
+			}
+		}
+	} // ________________________________
+
+	private JdbcCleanConn getConn() throws SQLException, MalformedEPRException
+	{
+		if (null == _conn)
+		{
+			try
+			{
+				SimpleDataSource DS = new SimpleDataSource(_epr.getDriver(), _epr
+						.getURL(), _epr.getUserName(), _epr.getPassword());
+				_conn = new JdbcCleanConn(DS);
+			}
+			catch (URISyntaxException ex)
+			{
+				throw new MalformedEPRException(ex);
+			}
+		}
+		return _conn;
+	} // ________________________________
+
+	protected PreparedStatement listStatement()
+	{
+		if (null == _prepGetList)
+
+			try
+			{
+				String[] columns =
+				{ _epr.getMessageIdColumn(), _epr.getTimestampColumn() };
+
+				StringBuilder sb = new StringBuilder("select");
+				int i1 = 0;
+				for (String col : columns)
+					sb.append((i1++ < 1) ? " " : ",").append(col);
+				sb.append(" from ").append(_epr.getTableName());
+				sb.append(" where ").append(_epr.getStatusColumn())
+						.append("='").append(State.Pending.getColumnValue())
+						.append("'").append(" order by 2");
+				_prepGetList = getConn().prepareStatement(sb.toString());
+			}
+			catch (Exception e)
+			{
+				_logger.debug("Unable to prepare SQL statement", e);
+				return null;
+			}
+		return _prepGetList;
+	} // ________________________________
+
+	protected PreparedStatement select4UpdateStatement()
+	{
+		if (_prepSel4Upd == null)
+		{
+			try
+			{
+				/*
+				 * TODO make this dynamic using a factory pattern.
+				 */
+
+				StringBuilder sb = null;
+
+				if (!_epr.getURL().contains("hsqldb"))
+				{
+					sb = new StringBuilder("select ").append(
+							_epr.getDataColumn()).append(" from ").append(
+							_epr.getTableName()).append(" where ").append(
+							_epr.getMessageIdColumn()).append("=?").append(
+							" and ").append(_epr.getStatusColumn())
+							.append("=?").append(" for update");
+				}
+				else
+				{
+					/*
+					 * HSQL does not support FOR UPDATE! All tables appear to
+					 * be inherently updatable!
+					 */
+					
+					sb = new StringBuilder("select ").append(
+							_epr.getDataColumn()).append(" from ").append(
+							_epr.getTableName()).append(" where ").append(
+							_epr.getMessageIdColumn()).append("=?").append(
+							" and ").append(_epr.getStatusColumn())
+							.append("=?");
+				}
+
+				_prepSel4Upd = getConn().prepareStatement(sb.toString());
+			}
+			catch (Exception e)
+			{
+				_logger.debug(e);
+				return null;
+			}
+		}
+
+		return _prepSel4Upd;
+	} // ________________________________
+
+	protected PreparedStatement updateStatusStatement()
+	{
+		if (null == _prepUpdateStatus)
+			try
+			{
+				StringBuilder sb = new StringBuilder("update ").append(
+						_epr.getTableName()).append(" set ").append(
+						_epr.getStatusColumn()).append("= ?").append(" where ")
+						.append(_epr.getMessageIdColumn()).append("=?");
+				_prepUpdateStatus = getConn().prepareStatement(sb.toString());
+			}
+			catch (Exception e)
+			{
+				_logger.debug(e);
+				return null;
+			}
+		return _prepUpdateStatus;
+	} // ________________________________
+
+	protected PreparedStatement insertStatement()
+	{
+		if (null == _prepInsert)
+			try
+			{
+				String[] columns =
+				{ _epr.getMessageIdColumn(), _epr.getDataColumn(),
+						_epr.getStatusColumn(), _epr.getTimestampColumn() };
+
+				StringBuilder sb = new StringBuilder("insert into ").append(
+						_epr.getTableName()).append("(");
+				int i1 = 0;
+				for (String col : columns)
+					sb.append((i1++ < 1) ? " " : ",").append(col);
+				sb.append(") values (?,?,?,?)");
+				_prepInsert = getConn().prepareStatement(sb.toString());
+			}
+			catch (Exception e)
+			{
+				_logger.debug(e);
+				return null;
+			}
+		return _prepInsert;
+	} // ________________________________
+
+	protected PreparedStatement deleteStatement()
+	{
+		if (null == _prepDelete)
+			try
+			{
+				StringBuilder sb = new StringBuilder("delete from ").append(
+						_epr.getTableName()).append(" where ").append(
+						_epr.getMessageIdColumn()).append(" =?");
+				_prepDelete = getConn().prepareStatement(sb.toString());
+			}
+			catch (Exception e)
+			{
+				_logger.debug(e);
+				return null;
+			}
+		return _prepDelete;
+	} // ________________________________
+
+	protected enum State
+	{
+		Pending, WorkInProgress, Done, Error;
+		String getColumnValue()
+		{
+			return toString().substring(0, 1);
+		}
+	}
+
+	public void setPollLatency(Long millis)
+	{
+		if (millis <= 200)
+			_logger.warn("Poll latency must be >= 200 milliseconds - Keeping old value of "+_pollLatency);
+		else
+			_pollLatency = millis;
+	} // ________________________________
+	
+	protected long _pollLatency = 200;
+
+	protected long _sleepForRetries = 3000; // milliseconds
+
+	protected boolean _postDelete, _errorDelete;
+
+	protected boolean _isReceiver;
+
+	protected JDBCEpr _epr;
+
+	protected JdbcCleanConn _conn;
+
+	protected PreparedStatement _prepGetList;
+
+	protected PreparedStatement _prepSel4Upd;
+
+	protected PreparedStatement _prepUpdateStatus;
+
+	protected PreparedStatement _prepInsert;
+
+	protected PreparedStatement _prepDelete;
+
+	protected static Logger _logger = Logger.getLogger(SqlTableCourier.class);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,236 +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.internal.soa.esb.couriers;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.UUID;
-
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierTimeoutException;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.couriers.TwoWayCourier;
-import org.jboss.soa.esb.couriers.filter.FilterManager;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * A two-way-courier can perform message deliveries and pickups.
- * 
- * @author esteban
- * @author kstam at redhat.com
- */
-public class TwoWayCourierImpl implements TwoWayCourier
-{
-	private DeliverOnlyCourier _deliverCourier;
-        
-        private EPR _toEPR ;
-
-	private PickUpOnlyCourier _pickupCourier;
-
-	/**
-	 * Constructor.
-	 * 
-	 * @param toEpr -
-	 *            to address
-	 * @param replyToEpr -
-	 *            reply to address
-	 * @throws CourierException
-	 */
-	public TwoWayCourierImpl(EPR toEpr, EPR replyToEpr)
-			throws CourierException, MalformedEPRException
-	{
-		setToEpr(toEpr);
-		setReplyToEpr(replyToEpr);
-	}
-
-	/**
-	 * @see org.jboss.soa.esb.couriers.TwoWayCourier#setToEpr(toEPR).
-	 */
-	public void setToEpr(EPR toEPR) throws CourierException,
-			MalformedEPRException
-	{
-		DeliverOnlyCourier old = _deliverCourier;
-                try
-                {
-                    _deliverCourier = getDeliverCourier(toEPR);
-                    _toEPR = toEPR ;
-                }
-                finally
-                {
-                    CourierUtil.cleanCourier(old) ;
-                }
-	}
-
-	/**
-	 * @see org.jboss.soa.esb.couriers.TwoWayCourier#setReplyEpr(toReplyEPR).
-	 */
-	public void setReplyToEpr(EPR replyToEPR) throws CourierException,
-			MalformedEPRException
-	{
-		PickUpOnlyCourier old = _pickupCourier;
-                try
-                {
-                    _pickupCourier = getPickupCourier(replyToEPR);
-                }
-                finally
-                {
-                    CourierUtil.cleanCourier(old) ;
-                }
-	}
-
-	private DeliverOnlyCourier getDeliverCourier(EPR toEPR)
-			throws CourierException, MalformedEPRException
-	{
-		return (null == toEPR) ? null : (DeliverOnlyCourier) courierFromEpr(
-				toEPR, false);
-	}
-
-	private PickUpOnlyCourier getPickupCourier(EPR replyToEPR)
-			throws CourierException, MalformedEPRException
-	{
-		return (null == replyToEPR) ? null
-				: (PickUpOnlyCourier) courierFromEpr(replyToEPR, true);
-	}
-
-	private Object courierFromEpr(EPR epr, boolean pickUpOnly)
-			throws CourierException, MalformedEPRException
-	{
-		if (null == epr)
-			return null;
-		if (epr instanceof JMSEpr)
-			return new JmsCourier((JMSEpr) epr, pickUpOnly);
-		if (epr instanceof FileEpr)
-			return new FileCourier((FileEpr) epr, pickUpOnly);
-		if (epr instanceof JDBCEpr)
-			return new SqlTableCourier((JDBCEpr) epr, pickUpOnly);
-
-		// TODO the following is necessary because EPR
-		// serialization/deserialization loses type
-
-		return courierFromGenericEPR(epr, pickUpOnly);
-	}
-
-	private Object courierFromGenericEPR(EPR epr, boolean pickUpOnly)
-			throws CourierException, MalformedEPRException
-	{
-		String addr = null;
-
-		addr = epr.getAddr().getAddress();
-		if (addr.startsWith(JMSEpr.JMS_PROTOCOL))
-			return new JmsCourier(new JMSEpr(epr), pickUpOnly);
-		if (addr.startsWith(JDBCEpr.JDBC_PROTOCOL))
-			return new SqlTableCourier(new JDBCEpr(epr), pickUpOnly);
-		// TODO magic strings
-		if (addr.startsWith("file://") || addr.startsWith("ftp://")
-				|| addr.startsWith("sftp://") || addr.startsWith("ftps://"))
-			return new FileCourier(new FileEpr(epr), pickUpOnly);
-
-		throw new CourierException("Courier for "
-				+ epr.getClass().getSimpleName() + " not supported yet");
-	}
-
-	/**
-	 * @see org.jboss.soa.esb.couriers.Courier#deliver(Message message).
-	 */
-	public boolean deliver(Message message) throws CourierException,
-			MalformedEPRException
-	{
-		if (null == _deliverCourier)
-			throw new CourierException("No deliverAsync courier");
-                final Call call = message.getHeader().getCall() ;
-                call.setTo(_toEPR) ;
-                
-                final boolean setMessageID = call.getMessageID() == null;
-                if (setMessageID)
-                {
-                    final String messageID = UUID.randomUUID().toString() ;
-                    try
-                    {
-                        call.setMessageID(new URI(messageID)) ;
-                    }
-                    catch (final URISyntaxException urise)
-                    {
-                        throw new MalformedEPRException("Failed to set message ID to " + messageID) ;
-                    }
-                }
-
-                try
-                {
-                    message = FilterManager.getInstance().doOutputWork(message);
-                    
-                    return _deliverCourier.deliver(message);
-                }
-                finally
-                {
-                    if (setMessageID)
-                    {
-                        call.setMessageID(null) ;
-                    }
-                }
-	}
-
-	/**
-	 * @see org.jboss.soa.esb.couriers.TwoWayCourier#pickup(long waitTime).
-	 */
-	public Message pickup(long waitTime) throws CourierException,
-			CourierTimeoutException
-	{
-		return pickup(waitTime, _pickupCourier);
-	}
-
-	/**
-	 * @see org.jboss.soa.esb.couriers.TwoWayCourier#pickup(long waitTime, EPR
-	 *      epr).
-	 */
-	public Message pickup(long waitTime, EPR epr) throws CourierException,
-			CourierTimeoutException, MalformedEPRException
-	{
-		return pickup(waitTime, getPickupCourier(epr));
-	}
-
-	private Message pickup(long waitTime, PickUpOnlyCourier courier)
-			throws CourierException, CourierTimeoutException
-	{
-		if (null == courier)
-			throw new CourierException("No courier defined for pick ups");
-		final Message result = courier.pickup(waitTime);
-                
-                return (result == null ? null : FilterManager.getInstance().doInputWork(result)) ;
-	}
-        
-        public void cleanup ()
-        {
-            CourierUtil.cleanCourier(_deliverCourier) ;
-            _deliverCourier = null ;
-            CourierUtil.cleanCourier(_pickupCourier) ;
-            _pickupCourier = null ;
-            CourierFactory.deregisterCourier(this) ;
-        }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/TwoWayCourierImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,236 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.UUID;
+
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierTimeoutException;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.couriers.TwoWayCourier;
+import org.jboss.soa.esb.couriers.filter.FilterManager;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * A two-way-courier can perform message deliveries and pickups.
+ * 
+ * @author esteban
+ * @author kstam at redhat.com
+ */
+public class TwoWayCourierImpl implements TwoWayCourier
+{
+	private DeliverOnlyCourier _deliverCourier;
+        
+        private EPR _toEPR ;
+
+	private PickUpOnlyCourier _pickupCourier;
+
+	/**
+	 * Constructor.
+	 * 
+	 * @param toEpr -
+	 *            to address
+	 * @param replyToEpr -
+	 *            reply to address
+	 * @throws CourierException
+	 */
+	public TwoWayCourierImpl(EPR toEpr, EPR replyToEpr)
+			throws CourierException, MalformedEPRException
+	{
+		setToEpr(toEpr);
+		setReplyToEpr(replyToEpr);
+	}
+
+	/**
+	 * @see org.jboss.soa.esb.couriers.TwoWayCourier#setToEpr(toEPR).
+	 */
+	public void setToEpr(EPR toEPR) throws CourierException,
+			MalformedEPRException
+	{
+		DeliverOnlyCourier old = _deliverCourier;
+                try
+                {
+                    _deliverCourier = getDeliverCourier(toEPR);
+                    _toEPR = toEPR ;
+                }
+                finally
+                {
+                    CourierUtil.cleanCourier(old) ;
+                }
+	}
+
+	/**
+	 * @see org.jboss.soa.esb.couriers.TwoWayCourier#setReplyEpr(toReplyEPR).
+	 */
+	public void setReplyToEpr(EPR replyToEPR) throws CourierException,
+			MalformedEPRException
+	{
+		PickUpOnlyCourier old = _pickupCourier;
+                try
+                {
+                    _pickupCourier = getPickupCourier(replyToEPR);
+                }
+                finally
+                {
+                    CourierUtil.cleanCourier(old) ;
+                }
+	}
+
+	private DeliverOnlyCourier getDeliverCourier(EPR toEPR)
+			throws CourierException, MalformedEPRException
+	{
+		return (null == toEPR) ? null : (DeliverOnlyCourier) courierFromEpr(
+				toEPR, false);
+	}
+
+	private PickUpOnlyCourier getPickupCourier(EPR replyToEPR)
+			throws CourierException, MalformedEPRException
+	{
+		return (null == replyToEPR) ? null
+				: (PickUpOnlyCourier) courierFromEpr(replyToEPR, true);
+	}
+
+	private Object courierFromEpr(EPR epr, boolean pickUpOnly)
+			throws CourierException, MalformedEPRException
+	{
+		if (null == epr)
+			return null;
+		if (epr instanceof JMSEpr)
+			return new JmsCourier((JMSEpr) epr, pickUpOnly);
+		if (epr instanceof FileEpr)
+			return new FileCourier((FileEpr) epr, pickUpOnly);
+		if (epr instanceof JDBCEpr)
+			return new SqlTableCourier((JDBCEpr) epr, pickUpOnly);
+
+		// TODO the following is necessary because EPR
+		// serialization/deserialization loses type
+
+		return courierFromGenericEPR(epr, pickUpOnly);
+	}
+
+	private Object courierFromGenericEPR(EPR epr, boolean pickUpOnly)
+			throws CourierException, MalformedEPRException
+	{
+		String addr = null;
+
+		addr = epr.getAddr().getAddress();
+		if (addr.startsWith(JMSEpr.JMS_PROTOCOL))
+			return new JmsCourier(new JMSEpr(epr), pickUpOnly);
+		if (addr.startsWith(JDBCEpr.JDBC_PROTOCOL))
+			return new SqlTableCourier(new JDBCEpr(epr), pickUpOnly);
+		// TODO magic strings
+		if (addr.startsWith("file://") || addr.startsWith("ftp://")
+				|| addr.startsWith("sftp://") || addr.startsWith("ftps://"))
+			return new FileCourier(new FileEpr(epr), pickUpOnly);
+
+		throw new CourierException("Courier for "
+				+ epr.getClass().getSimpleName() + " not supported yet");
+	}
+
+	/**
+	 * @see org.jboss.soa.esb.couriers.Courier#deliver(Message message).
+	 */
+	public boolean deliver(Message message) throws CourierException,
+			MalformedEPRException
+	{
+		if (null == _deliverCourier)
+			throw new CourierException("No deliverAsync courier");
+                final Call call = message.getHeader().getCall() ;
+                call.setTo(_toEPR) ;
+                
+                final boolean setMessageID = call.getMessageID() == null;
+                if (setMessageID)
+                {
+                    final String messageID = UUID.randomUUID().toString() ;
+                    try
+                    {
+                        call.setMessageID(new URI(messageID)) ;
+                    }
+                    catch (final URISyntaxException urise)
+                    {
+                        throw new MalformedEPRException("Failed to set message ID to " + messageID) ;
+                    }
+                }
+
+                try
+                {
+                    message = FilterManager.getInstance().doOutputWork(message);
+                    
+                    return _deliverCourier.deliver(message);
+                }
+                finally
+                {
+                    if (setMessageID)
+                    {
+                        call.setMessageID(null) ;
+                    }
+                }
+	}
+
+	/**
+	 * @see org.jboss.soa.esb.couriers.TwoWayCourier#pickup(long waitTime).
+	 */
+	public Message pickup(long waitTime) throws CourierException,
+			CourierTimeoutException
+	{
+		return pickup(waitTime, _pickupCourier);
+	}
+
+	/**
+	 * @see org.jboss.soa.esb.couriers.TwoWayCourier#pickup(long waitTime, EPR
+	 *      epr).
+	 */
+	public Message pickup(long waitTime, EPR epr) throws CourierException,
+			CourierTimeoutException, MalformedEPRException
+	{
+		return pickup(waitTime, getPickupCourier(epr));
+	}
+
+	private Message pickup(long waitTime, PickUpOnlyCourier courier)
+			throws CourierException, CourierTimeoutException
+	{
+		if (null == courier)
+			throw new CourierException("No courier defined for pick ups");
+		final Message result = courier.pickup(waitTime);
+                
+                return (result == null ? null : FilterManager.getInstance().doInputWork(result)) ;
+	}
+        
+        public void cleanup ()
+        {
+            CourierUtil.cleanCourier(_deliverCourier) ;
+            _deliverCourier = null ;
+            CourierUtil.cleanCourier(_pickupCourier) ;
+            _pickupCourier = null ;
+            CourierFactory.deregisterCourier(this) ;
+        }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandler.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandler.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandler.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.internal.soa.esb.couriers.helpers;
-
-import java.io.File;
-
-import org.jboss.soa.esb.couriers.CourierException;
-
-public interface FileHandler 
-{
-	abstract File[]  getFileList()					throws CourierException;
-	abstract byte[]	 getFileContents(File file)		throws CourierException;
-	abstract boolean renameFile(File from, File to) throws CourierException;
-	abstract boolean deleteFile(File file)			throws CourierException;    	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandler.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandler.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandler.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandler.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers.helpers;
+
+import java.io.File;
+
+import org.jboss.soa.esb.couriers.CourierException;
+
+public interface FileHandler 
+{
+	abstract File[]  getFileList()					throws CourierException;
+	abstract byte[]	 getFileContents(File file)		throws CourierException;
+	abstract boolean renameFile(File from, File to) throws CourierException;
+	abstract boolean deleteFile(File file)			throws CourierException;    	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandlerFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandlerFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandlerFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,47 +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.internal.soa.esb.couriers.helpers;
-
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.couriers.CourierException;
-
-public class FileHandlerFactory 
-{
-	private static final FileHandlerFactory _instance = new FileHandlerFactory();
-
-	public static FileHandlerFactory getInstance() { return _instance; }
-
-	public FileHandler getFileHandler(FileEpr epr) throws CourierException
-	{
-		if (epr instanceof FTPEpr) 	return new FtpFileHandler	((FTPEpr)epr);
-
-		//TODO  Maybe ftps and sftp ?  Wait for Bruno's input
-
-		//  if flow falls through, last option should be local file handler
-		if (epr instanceof FileEpr)	return new LocalFileHandler	((FileEpr)epr);
-
-		throw new CourierException("Unable to obtain a file handler for supplied EPR");
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandlerFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandlerFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandlerFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FileHandlerFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,47 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.internal.soa.esb.couriers.helpers;
+
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.couriers.CourierException;
+
+public class FileHandlerFactory 
+{
+	private static final FileHandlerFactory _instance = new FileHandlerFactory();
+
+	public static FileHandlerFactory getInstance() { return _instance; }
+
+	public FileHandler getFileHandler(FileEpr epr) throws CourierException
+	{
+		if (epr instanceof FTPEpr) 	return new FtpFileHandler	((FTPEpr)epr);
+
+		//TODO  Maybe ftps and sftp ?  Wait for Bruno's input
+
+		//  if flow falls through, last option should be local file handler
+		if (epr instanceof FileEpr)	return new LocalFileHandler	((FileEpr)epr);
+
+		throw new CourierException("Unable to obtain a file handler for supplied EPR");
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FtpFileHandler.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FtpFileHandler.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FtpFileHandler.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,274 +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.internal.soa.esb.couriers.helpers;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.util.RemoteFileSystem;
-import org.jboss.soa.esb.util.RemoteFileSystemException;
-import org.jboss.soa.esb.util.RemoteFileSystemFactory;
-
-public class FtpFileHandler implements FileHandler
-{
-	private FtpFileHandler()
-	{
-	}
-
-	FtpFileHandler(FTPEpr epr) throws CourierException
-	{
-		_epr = epr;
-
-		URL url = null;
-		try
-		{
-			url = _epr.getURL();
-		}
-		catch (MalformedURLException e)
-		{
-			throw new CourierException(e);
-		}
-		catch (URISyntaxException e)
-		{
-			throw new CourierException(e);
-		}
-
-		_server = url.getHost();
-
-		String[] sa = null;
-		
-		if (url.getUserInfo() != null)
-			sa = url.getUserInfo().split(":");
-		
-		if (sa == null)
-			sa = new String[]
-			{ "", "" };
-		_user = (sa.length < 1) ? "" : sa[0];
-		_passwd = (sa.length < 2) ? "" : sa[1];
-
-		_remoteDir = url.getFile();
-		
-		final String tmpdir = System.getProperty("java.io.tmpdir") ;
-		if ((_remoteDir == null) || (_remoteDir.equals("")))
-			_remoteDir = ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.FTP_REMOTEDIR, tmpdir);
-
-		_port = url.getPort();
-		if (_port < 0)
-			_port = url.getDefaultPort();
-
-		_localDir = ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.FTP_LOCALDIR, tmpdir);
-
-		_isAscii = false;
-		_isPassive = false;
-		
-		try
-		{
-			_isPassive = _epr.getPassive();
-		}
-		catch (URISyntaxException e)
-		{
-			_logger.warn(e);
-		}
-
-	}
-
-	public boolean deleteFile(File file) throws CourierException
-	{
-		// TODO would be better to return false if the file did not exist and leave exceptions
-		// for other error conditions (such as permission denied).
-		
-		try
-		{
-			getHandler().deleteRemoteFile(file.getName());
-			return true;
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-			
-			throw new CourierException(e);
-		}
-	}
-
-	public byte[] getFileContents(File file) throws CourierException
-	{
-		try
-		{
-			/*
-			 * For some reason the code only works on the file name at this
-			 * point, even if a dir is passed in. So, if it's a dir
-			 * we will ignore it and return null.
-			 */
-
-			String name = file.getName();
-			
-			if (file.toString().length() > name.length())
-			{
-				_logger.debug("FtpFileHandler.getFileContents on "+file+" will ignore because of directory.");
-			
-				return null;
-			}
-			
-			getHandler().downloadFile(name, name);
-			File local = new File(_localDir, name);
-			byte[] ba = CourierUtil.bytesFromLocalFile(local);
-			local.delete();
-			return ba;
-		}
-		catch (Exception e)
-		{
-			// TODO better error handling, e.g., what if someone
-			// tries to download a directory?
-			
-			throw new CourierException(e);
-		}
-	}
-
-	// FileCourier will try to invoke the uploadFile(File) method using
-	// reflection
-	public void uploadFile(File file) throws CourierException
-	{
-		try
-		{
-			String name = file.getName();
-			getHandler().uploadFile(file, name);
-			file.delete();
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-			
-			throw new CourierException(e);
-		}
-	}
-
-	// FileCourier will try to invoke the downloadFile(File) method using
-	// reflection
-	public File downloadFile(File file) throws CourierException
-	{
-		try
-		{
-			String name = file.getName();
-			getHandler().downloadFile(name, name);
-			return new File(_localDir,name);
-		}
-		catch (Exception e)
-		{
-			throw new CourierException(e);
-		}
-	}
-
-	public File[] getFileList() throws CourierException
-	{
-		String[] names = null;
-
-		try
-		{
-			names = getHandler()
-					.getFileListFromRemoteDir(_epr.getInputSuffix());
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-			
-			throw new CourierException(e);
-		}
-
-		if (null == names)
-			return null;
-		File[] files = new File[names.length];
-		int i = 0;
-		for (String file : names)
-			if (null != file)
-				files[i++] = new File(file);
-		return files;
-	}
-
-	public boolean renameFile(File from, File to) throws CourierException
-	{
-		try
-		{
-			getHandler().remoteRename(from, to);
-
-			return true;
-		}
-		catch (IOException ex)  // file not found
-		{
-			return false;
-		}
-		catch (Exception e)
-		{
-			throw new CourierException(e);
-		}
-	}
-
-	// Because ftp connections are volatile, we are always getting a fresh
-	// handle
-	// TODO there's room for optimization here - not for GA though
-	protected RemoteFileSystem getHandler() throws CourierException
-	{
-		try
-		{
-			RemoteFileSystem rfs = RemoteFileSystemFactory.getRemoteFileSystem(
-					_epr, true);
-			try
-			{
-				rfs.setRemoteDir(_remoteDir);
-			}
-			catch (Exception e)
-			{
-				throw new CourierException(e);
-			}
-
-			return rfs;
-		}
-		catch (RemoteFileSystemException e)
-		{
-			throw new CourierException(e);
-		}
-	}
-
-	private static final Logger _logger = Logger
-			.getLogger(FtpFileHandler.class);
-
-	protected FTPEpr _epr;
-	protected ConfigTree _tree;
-	protected String _server;
-	protected String _user;
-	protected String _passwd;
-	protected String _remoteDir;
-	protected String _localDir;
-	protected int _port;
-	protected boolean _isAscii, _isPassive;
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FtpFileHandler.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FtpFileHandler.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FtpFileHandler.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/FtpFileHandler.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,274 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.internal.soa.esb.couriers.helpers;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.util.RemoteFileSystem;
+import org.jboss.soa.esb.util.RemoteFileSystemException;
+import org.jboss.soa.esb.util.RemoteFileSystemFactory;
+
+public class FtpFileHandler implements FileHandler
+{
+	private FtpFileHandler()
+	{
+	}
+
+	FtpFileHandler(FTPEpr epr) throws CourierException
+	{
+		_epr = epr;
+
+		URL url = null;
+		try
+		{
+			url = _epr.getURL();
+		}
+		catch (MalformedURLException e)
+		{
+			throw new CourierException(e);
+		}
+		catch (URISyntaxException e)
+		{
+			throw new CourierException(e);
+		}
+
+		_server = url.getHost();
+
+		String[] sa = null;
+		
+		if (url.getUserInfo() != null)
+			sa = url.getUserInfo().split(":");
+		
+		if (sa == null)
+			sa = new String[]
+			{ "", "" };
+		_user = (sa.length < 1) ? "" : sa[0];
+		_passwd = (sa.length < 2) ? "" : sa[1];
+
+		_remoteDir = url.getFile();
+		
+		final String tmpdir = System.getProperty("java.io.tmpdir") ;
+		if ((_remoteDir == null) || (_remoteDir.equals("")))
+			_remoteDir = ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.FTP_REMOTEDIR, tmpdir);
+
+		_port = url.getPort();
+		if (_port < 0)
+			_port = url.getDefaultPort();
+
+		_localDir = ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.FTP_LOCALDIR, tmpdir);
+
+		_isAscii = false;
+		_isPassive = false;
+		
+		try
+		{
+			_isPassive = _epr.getPassive();
+		}
+		catch (URISyntaxException e)
+		{
+			_logger.warn(e);
+		}
+
+	}
+
+	public boolean deleteFile(File file) throws CourierException
+	{
+		// TODO would be better to return false if the file did not exist and leave exceptions
+		// for other error conditions (such as permission denied).
+		
+		try
+		{
+			getHandler().deleteRemoteFile(file.getName());
+			return true;
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+			
+			throw new CourierException(e);
+		}
+	}
+
+	public byte[] getFileContents(File file) throws CourierException
+	{
+		try
+		{
+			/*
+			 * For some reason the code only works on the file name at this
+			 * point, even if a dir is passed in. So, if it's a dir
+			 * we will ignore it and return null.
+			 */
+
+			String name = file.getName();
+			
+			if (file.toString().length() > name.length())
+			{
+				_logger.debug("FtpFileHandler.getFileContents on "+file+" will ignore because of directory.");
+			
+				return null;
+			}
+			
+			getHandler().downloadFile(name, name);
+			File local = new File(_localDir, name);
+			byte[] ba = CourierUtil.bytesFromLocalFile(local);
+			local.delete();
+			return ba;
+		}
+		catch (Exception e)
+		{
+			// TODO better error handling, e.g., what if someone
+			// tries to download a directory?
+			
+			throw new CourierException(e);
+		}
+	}
+
+	// FileCourier will try to invoke the uploadFile(File) method using
+	// reflection
+	public void uploadFile(File file) throws CourierException
+	{
+		try
+		{
+			String name = file.getName();
+			getHandler().uploadFile(file, name);
+			file.delete();
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+			
+			throw new CourierException(e);
+		}
+	}
+
+	// FileCourier will try to invoke the downloadFile(File) method using
+	// reflection
+	public File downloadFile(File file) throws CourierException
+	{
+		try
+		{
+			String name = file.getName();
+			getHandler().downloadFile(name, name);
+			return new File(_localDir,name);
+		}
+		catch (Exception e)
+		{
+			throw new CourierException(e);
+		}
+	}
+
+	public File[] getFileList() throws CourierException
+	{
+		String[] names = null;
+
+		try
+		{
+			names = getHandler()
+					.getFileListFromRemoteDir(_epr.getInputSuffix());
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+			
+			throw new CourierException(e);
+		}
+
+		if (null == names)
+			return null;
+		File[] files = new File[names.length];
+		int i = 0;
+		for (String file : names)
+			if (null != file)
+				files[i++] = new File(file);
+		return files;
+	}
+
+	public boolean renameFile(File from, File to) throws CourierException
+	{
+		try
+		{
+			getHandler().remoteRename(from, to);
+
+			return true;
+		}
+		catch (IOException ex)  // file not found
+		{
+			return false;
+		}
+		catch (Exception e)
+		{
+			throw new CourierException(e);
+		}
+	}
+
+	// Because ftp connections are volatile, we are always getting a fresh
+	// handle
+	// TODO there's room for optimization here - not for GA though
+	protected RemoteFileSystem getHandler() throws CourierException
+	{
+		try
+		{
+			RemoteFileSystem rfs = RemoteFileSystemFactory.getRemoteFileSystem(
+					_epr, true);
+			try
+			{
+				rfs.setRemoteDir(_remoteDir);
+			}
+			catch (Exception e)
+			{
+				throw new CourierException(e);
+			}
+
+			return rfs;
+		}
+		catch (RemoteFileSystemException e)
+		{
+			throw new CourierException(e);
+		}
+	}
+
+	private static final Logger _logger = Logger
+			.getLogger(FtpFileHandler.class);
+
+	protected FTPEpr _epr;
+	protected ConfigTree _tree;
+	protected String _server;
+	protected String _user;
+	protected String _passwd;
+	protected String _remoteDir;
+	protected String _localDir;
+	protected int _port;
+	protected boolean _isAscii, _isPassive;
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/LocalFileHandler.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/LocalFileHandler.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/LocalFileHandler.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,150 +0,0 @@
-package org.jboss.internal.soa.esb.couriers.helpers;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.util.FileUtil;
-import org.jboss.soa.esb.util.Util;
-
-public class LocalFileHandler implements FileHandler
-{
-	private LocalFileHandler()
-	{
-	}
-
-	LocalFileHandler(FileEpr epr)
-	{
-		_epr = epr;
-	}
-
-	public boolean deleteFile(File file) throws CourierException
-	{
-		return file.delete();
-	}
-
-	public byte[] getFileContents(File file) throws CourierException
-	{
-		ByteArrayOutputStream out = new ByteArrayOutputStream();
-		byte[] ba = new byte[1000];  // TODO MAGIC NUMBER
-		int iQread;
-
-		try
-		{
-			FileInputStream inp = new FileInputStream(file);
-			while (-1 != (iQread = inp.read(ba)))
-				if (iQread > 0)
-					out.write(ba, 0, iQread);
-			inp.close();
-			out.close();
-			return out.toByteArray();
-		}
-		catch (FileNotFoundException e)
-		{
-			throw new CourierException(e);
-		}
-		catch (IOException e)
-		{
-			throw new CourierException(e);
-		}
-		catch (Exception e)
-		{
-			throw new CourierException(e);
-		}
-	}
-
-	public File[] getFileList() throws CourierException
-	{
-		try
-		{
-			File dir = new File(_epr.getURL().getFile());
-			if (!dir.isDirectory())
-				throw new CourierException(
-						"Can't get file list if URL is not a directory");
-
-			FileFilter filter = new FileEndsWith(_epr.getInputSuffix());
-			return dir.listFiles(filter);
-		}
-		catch (URISyntaxException e)
-		{
-			throw new CourierException(e);
-		}
-		catch (MalformedURLException e)
-		{
-			throw new CourierException(e);
-		}
-		catch (Exception e)
-		{
-			throw new CourierException(e);
-		}
-	}
-
-	public boolean renameFile(File from, File to) throws CourierException
-	{
-		try
-		{
-			if (to.exists())
-				to.delete();
-			if (!FileUtil.renameTo(from, to))
-				throw new CourierException("Unable to rename from " + from
-						+ " to " + to);
-			
-			return true;
-		}
-		catch (Exception e)
-		{
-			throw new CourierException(e);
-		}
-	}
-
-	private class FileEndsWith implements FileFilter
-	{
-		String m_sSuffix;
-
-		FileEndsWith(String p_sEnd) throws CourierException
-		{
-			m_sSuffix = p_sEnd;
-			if (Util.isNullString(m_sSuffix))
-				throw new CourierException(
-						"A file suffix (or full Message id) must be specified for pickup");
-		} // ______________________________
-
-		public boolean accept(File p_f)
-		{
-			return (p_f.isFile()) ? p_f.toString().endsWith(m_sSuffix) : false;
-		} // ______________________________
-	} // ____________________________________________________
-
-	protected FileEpr _epr;
-
-	static Logger _logger = Logger.getLogger(LocalFileHandler.class);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/LocalFileHandler.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/LocalFileHandler.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/LocalFileHandler.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/couriers/helpers/LocalFileHandler.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,150 @@
+package org.jboss.internal.soa.esb.couriers.helpers;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.util.FileUtil;
+import org.jboss.soa.esb.util.Util;
+
+public class LocalFileHandler implements FileHandler
+{
+	private LocalFileHandler()
+	{
+	}
+
+	LocalFileHandler(FileEpr epr)
+	{
+		_epr = epr;
+	}
+
+	public boolean deleteFile(File file) throws CourierException
+	{
+		return file.delete();
+	}
+
+	public byte[] getFileContents(File file) throws CourierException
+	{
+		ByteArrayOutputStream out = new ByteArrayOutputStream();
+		byte[] ba = new byte[1000];  // TODO MAGIC NUMBER
+		int iQread;
+
+		try
+		{
+			FileInputStream inp = new FileInputStream(file);
+			while (-1 != (iQread = inp.read(ba)))
+				if (iQread > 0)
+					out.write(ba, 0, iQread);
+			inp.close();
+			out.close();
+			return out.toByteArray();
+		}
+		catch (FileNotFoundException e)
+		{
+			throw new CourierException(e);
+		}
+		catch (IOException e)
+		{
+			throw new CourierException(e);
+		}
+		catch (Exception e)
+		{
+			throw new CourierException(e);
+		}
+	}
+
+	public File[] getFileList() throws CourierException
+	{
+		try
+		{
+			File dir = new File(_epr.getURL().getFile());
+			if (!dir.isDirectory())
+				throw new CourierException(
+						"Can't get file list if URL is not a directory");
+
+			FileFilter filter = new FileEndsWith(_epr.getInputSuffix());
+			return dir.listFiles(filter);
+		}
+		catch (URISyntaxException e)
+		{
+			throw new CourierException(e);
+		}
+		catch (MalformedURLException e)
+		{
+			throw new CourierException(e);
+		}
+		catch (Exception e)
+		{
+			throw new CourierException(e);
+		}
+	}
+
+	public boolean renameFile(File from, File to) throws CourierException
+	{
+		try
+		{
+			if (to.exists())
+				to.delete();
+			if (!FileUtil.renameTo(from, to))
+				throw new CourierException("Unable to rename from " + from
+						+ " to " + to);
+			
+			return true;
+		}
+		catch (Exception e)
+		{
+			throw new CourierException(e);
+		}
+	}
+
+	private class FileEndsWith implements FileFilter
+	{
+		String m_sSuffix;
+
+		FileEndsWith(String p_sEnd) throws CourierException
+		{
+			m_sSuffix = p_sEnd;
+			if (Util.isNullString(m_sSuffix))
+				throw new CourierException(
+						"A file suffix (or full Message id) must be specified for pickup");
+		} // ______________________________
+
+		public boolean accept(File p_f)
+		{
+			return (p_f.isFile()) ? p_f.toString().endsWith(m_sSuffix) : false;
+		} // ______________________________
+	} // ____________________________________________________
+
+	protected FileEpr _epr;
+
+	static Logger _logger = Logger.getLogger(LocalFileHandler.class);
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.internal.soa.esb.dependencies;
-
-import java.net.URL;
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import javax.naming.InitialContext;
-import javax.sql.DataSource;
-
-import org.jboss.soa.esb.listeners.config.Configuration;
-import org.jboss.system.ServiceMBeanSupport;
-
-/**
- * Initialize a given datasource
- *
- * Takes a list resources that are .sql files and checks to see if they have alrady been executed
- * on a given datasource by executing a sql query.  If the sql query fails, then the .sql files are executed.
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class DatabaseInitializer extends ServiceMBeanSupport implements DatabaseInitializerMBean
-{
-   private String datasource;
-   private String sqlFiles;
-   private String existsSql;
-
-
-   public String getExistsSql()
-   {
-      return existsSql;
-   }
-
-   public void setExistsSql(String existsSql)
-   {
-      this.existsSql = existsSql;
-   }
-
-   public String getSqlFiles()
-   {
-      return sqlFiles;
-   }
-
-   public void setSqlFiles(String sqlFiles)
-   {
-      this.sqlFiles = sqlFiles;
-   }
-
-   public String getDatasource()
-   {
-      return datasource;
-   }
-
-   public void setDatasource(String datasource)
-   {
-      this.datasource = datasource;
-   }
-
-   protected void initDatabase() throws Exception
-   {
-      DataSource ds = (DataSource)new InitialContext().lookup(datasource);
-      Connection conn = ds.getConnection();
-      boolean load = false;
-
-      Statement st = conn.createStatement();
-      ResultSet rs = null;
-      try
-      {
-         rs = st.executeQuery(existsSql.trim());
-         rs.close();
-      }
-      catch (SQLException e)
-      {
-         load = true;
-      }
-      st.close();
-      if (!load)
-      {
-         log.info(datasource + " datasource is already initialized");
-         return;
-      }
-
-      log.info("Initializing " + datasource + " from listed sql files");
-
-      String[] list = sqlFiles.split(",");
-      for (String sql : list)
-      {
-         executeSql(sql.trim(), conn);
-      }
-   }
-
-   public void executeSql(String resource, Connection conn)
-           throws Exception
-   {
-      URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
-      String sql = Configuration.getStringFromStream(url.openStream());
-      String[] statements = sql.split(";");
-      for (String statement : statements)
-      {
-         Statement sqlStatement = conn.createStatement();
-         try
-         {
-            sqlStatement.executeUpdate(statement);
-         }
-         finally
-         {
-            sqlStatement.close();
-         }
-      }
-   }
-
-
-   @Override
-   protected void startService() throws Exception
-   {
-      initDatabase();
-      super.startService();
-   }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,142 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.dependencies;
+
+import java.net.URL;
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+
+import org.jboss.soa.esb.listeners.config.Configuration;
+import org.jboss.system.ServiceMBeanSupport;
+
+/**
+ * Initialize a given datasource
+ *
+ * Takes a list resources that are .sql files and checks to see if they have alrady been executed
+ * on a given datasource by executing a sql query.  If the sql query fails, then the .sql files are executed.
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class DatabaseInitializer extends ServiceMBeanSupport implements DatabaseInitializerMBean
+{
+   private String datasource;
+   private String sqlFiles;
+   private String existsSql;
+
+
+   public String getExistsSql()
+   {
+      return existsSql;
+   }
+
+   public void setExistsSql(String existsSql)
+   {
+      this.existsSql = existsSql;
+   }
+
+   public String getSqlFiles()
+   {
+      return sqlFiles;
+   }
+
+   public void setSqlFiles(String sqlFiles)
+   {
+      this.sqlFiles = sqlFiles;
+   }
+
+   public String getDatasource()
+   {
+      return datasource;
+   }
+
+   public void setDatasource(String datasource)
+   {
+      this.datasource = datasource;
+   }
+
+   protected void initDatabase() throws Exception
+   {
+      DataSource ds = (DataSource)new InitialContext().lookup(datasource);
+      Connection conn = ds.getConnection();
+      boolean load = false;
+
+      Statement st = conn.createStatement();
+      ResultSet rs = null;
+      try
+      {
+         rs = st.executeQuery(existsSql.trim());
+         rs.close();
+      }
+      catch (SQLException e)
+      {
+         load = true;
+      }
+      st.close();
+      if (!load)
+      {
+         log.info(datasource + " datasource is already initialized");
+         return;
+      }
+
+      log.info("Initializing " + datasource + " from listed sql files");
+
+      String[] list = sqlFiles.split(",");
+      for (String sql : list)
+      {
+         executeSql(sql.trim(), conn);
+      }
+   }
+
+   public void executeSql(String resource, Connection conn)
+           throws Exception
+   {
+      URL url = Thread.currentThread().getContextClassLoader().getResource(resource);
+      String sql = Configuration.getStringFromStream(url.openStream());
+      String[] statements = sql.split(";");
+      for (String statement : statements)
+      {
+         Statement sqlStatement = conn.createStatement();
+         try
+         {
+            sqlStatement.executeUpdate(statement);
+         }
+         finally
+         {
+            sqlStatement.close();
+         }
+      }
+   }
+
+
+   @Override
+   protected void startService() throws Exception
+   {
+      initDatabase();
+      super.startService();
+   }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,51 +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.internal.soa.esb.dependencies;
-
-import org.jboss.system.ServiceMBean;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public interface DatabaseInitializerMBean extends ServiceMBean
-{
-   String getExistsSql()
-           ;
-
-   void setExistsSql(String existsSql)
-           ;
-
-   String getSqlFiles()
-           ;
-
-   void setSqlFiles(String sqlFiles)
-           ;
-
-   String getDatasource()
-           ;
-
-   void setDatasource(String datasource)
-           ;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/DatabaseInitializerMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,51 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.dependencies;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface DatabaseInitializerMBean extends ServiceMBean
+{
+   String getExistsSql()
+           ;
+
+   void setExistsSql(String existsSql)
+           ;
+
+   String getSqlFiles()
+           ;
+
+   void setSqlFiles(String sqlFiles)
+           ;
+
+   String getDatasource()
+           ;
+
+   void setDatasource(String datasource)
+           ;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIService.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIService.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIService.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,96 +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.internal.soa.esb.dependencies;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.net.URI;
-import java.net.URL;
-import java.util.Properties;
-
-import javax.naming.InitialContext;
-
-import org.apache.juddi.registry.rmi.JNDIRegistration;
-import org.apache.log4j.Logger;
-import org.jboss.system.ServiceMBeanSupport;
-
-public class JuddiRMIService extends ServiceMBeanSupport implements JuddiRMIServiceMBean
-{
-   private Logger logger = Logger.getLogger(this.getClass());
-   public static final String PROPNAME_JAVA_NAMING_FACTORY_INITIAL = "java.naming.factory.initial";
-   public static final String PROPNAME_JAVA_NAMING_PROVIDER_URL = "java.naming.provider.url";
-   public static final String PROPNAME_JAVA_NAMING_FACTORY_URL_PKGS = "java.naming.factory.url.pkgs";
-
-   private String propertiesResourcePath = "esb.juddi.properties";
-
-   public String getPropertiesResourcePath()
-   {
-      return propertiesResourcePath;
-   }
-
-   public void setPropertiesResourcePath(String propertiesResourcePath)
-   {
-      this.propertiesResourcePath = propertiesResourcePath;
-   }
-
-   protected void startService() throws Exception
-	{
-		logger.info("starting juddi RMI service");
-        URL url = Thread.currentThread().getContextClassLoader().getResource(propertiesResourcePath);
-        URI uri = new URI(url.toString());
-        File confFile = new File(uri);
-		System.setProperty("juddi.propertiesFile", confFile.toString());
-        System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
-        
-        // Read properties from file and if they exist - pass them on to juddi as system properties
-        Properties properties = new Properties();
-        try {
-            properties.load(new FileInputStream(confFile));
-            String factoryInitial =  properties.getProperty(PROPNAME_JAVA_NAMING_FACTORY_INITIAL, null);
-            String providerURL = properties.getProperty(PROPNAME_JAVA_NAMING_PROVIDER_URL, null); 
-            String factoryURLPkgs = properties.getProperty(PROPNAME_JAVA_NAMING_FACTORY_URL_PKGS, null);
-            if (factoryInitial != null) {
-            	System.setProperty(PROPNAME_JAVA_NAMING_FACTORY_INITIAL, factoryInitial);
-	    }
-	    if (providerURL != null) {
-            	System.setProperty(PROPNAME_JAVA_NAMING_PROVIDER_URL, providerURL);
-	    }
-            if (factoryURLPkgs != null) {
-            	System.setProperty(PROPNAME_JAVA_NAMING_FACTORY_URL_PKGS, factoryURLPkgs);
-            }
-        } catch (IOException e) {
-        	logger.error(e);
-        }
-        JNDIRegistration.register();
-	}
-
-
-	protected void stopService() throws Exception
-	{
-		logger.info("Unbinding juddi services");
-		final InitialContext ic = new InitialContext() ;
-		ic.unbind(JNDIRegistration.INQUIRY_SERVICE) ;
-		ic.unbind(JNDIRegistration.PUBLISH_SERVICE) ;
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIService.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIService.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIService.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIService.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,96 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.internal.soa.esb.dependencies;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.net.URI;
+import java.net.URL;
+import java.util.Properties;
+
+import javax.naming.InitialContext;
+
+import org.apache.juddi.registry.rmi.JNDIRegistration;
+import org.apache.log4j.Logger;
+import org.jboss.system.ServiceMBeanSupport;
+
+public class JuddiRMIService extends ServiceMBeanSupport implements JuddiRMIServiceMBean
+{
+   private Logger logger = Logger.getLogger(this.getClass());
+   public static final String PROPNAME_JAVA_NAMING_FACTORY_INITIAL = "java.naming.factory.initial";
+   public static final String PROPNAME_JAVA_NAMING_PROVIDER_URL = "java.naming.provider.url";
+   public static final String PROPNAME_JAVA_NAMING_FACTORY_URL_PKGS = "java.naming.factory.url.pkgs";
+
+   private String propertiesResourcePath = "esb.juddi.properties";
+
+   public String getPropertiesResourcePath()
+   {
+      return propertiesResourcePath;
+   }
+
+   public void setPropertiesResourcePath(String propertiesResourcePath)
+   {
+      this.propertiesResourcePath = propertiesResourcePath;
+   }
+
+   protected void startService() throws Exception
+	{
+		logger.info("starting juddi RMI service");
+        URL url = Thread.currentThread().getContextClassLoader().getResource(propertiesResourcePath);
+        URI uri = new URI(url.toString());
+        File confFile = new File(uri);
+		System.setProperty("juddi.propertiesFile", confFile.toString());
+        System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
+        
+        // Read properties from file and if they exist - pass them on to juddi as system properties
+        Properties properties = new Properties();
+        try {
+            properties.load(new FileInputStream(confFile));
+            String factoryInitial =  properties.getProperty(PROPNAME_JAVA_NAMING_FACTORY_INITIAL, null);
+            String providerURL = properties.getProperty(PROPNAME_JAVA_NAMING_PROVIDER_URL, null); 
+            String factoryURLPkgs = properties.getProperty(PROPNAME_JAVA_NAMING_FACTORY_URL_PKGS, null);
+            if (factoryInitial != null) {
+            	System.setProperty(PROPNAME_JAVA_NAMING_FACTORY_INITIAL, factoryInitial);
+	    }
+	    if (providerURL != null) {
+            	System.setProperty(PROPNAME_JAVA_NAMING_PROVIDER_URL, providerURL);
+	    }
+            if (factoryURLPkgs != null) {
+            	System.setProperty(PROPNAME_JAVA_NAMING_FACTORY_URL_PKGS, factoryURLPkgs);
+            }
+        } catch (IOException e) {
+        	logger.error(e);
+        }
+        JNDIRegistration.register();
+	}
+
+
+	protected void stopService() throws Exception
+	{
+		logger.info("Unbinding juddi services");
+		final InitialContext ic = new InitialContext() ;
+		ic.unbind(JNDIRegistration.INQUIRY_SERVICE) ;
+		ic.unbind(JNDIRegistration.PUBLISH_SERVICE) ;
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIServiceMBean.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIServiceMBean.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIServiceMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.internal.soa.esb.dependencies;
-
-import org.jboss.system.ServiceMBean;
-
-public interface JuddiRMIServiceMBean extends ServiceMBean
-{
-
-   String getPropertiesResourcePath()
-           ;
-
-   void setPropertiesResourcePath(String propertiesResourcePath)
-           ;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIServiceMBean.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIServiceMBean.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIServiceMBean.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/dependencies/JuddiRMIServiceMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,35 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+
+package org.jboss.internal.soa.esb.dependencies;
+
+import org.jboss.system.ServiceMBean;
+
+public interface JuddiRMIServiceMBean extends ServiceMBean
+{
+
+   String getPropertiesResourcePath()
+           ;
+
+   void setPropertiesResourcePath(String propertiesResourcePath)
+           ;
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,137 +0,0 @@
-package org.jboss.internal.soa.esb.message.format;
-
-import java.net.URI;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Properties;
-
-import org.jboss.internal.soa.esb.message.format.serialized.SerializedMessagePlugin;
-import org.jboss.internal.soa.esb.message.format.xml.XMLMessagePlugin;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessagePlugin;
-import org.jboss.soa.esb.message.format.MessageType;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Messages may contain attachments that do not appear in the main payload body.
- * For example, binary document formats, zip files etc.
- * 
- * @author Mark Little
- */
-
-public class MessageFactoryImpl extends MessageFactory
-{
-
-	public MessageFactoryImpl ()
-	{
-		reset();
-	}
-
-	public void reset ()
-	{
-		messageFormats.clear();
-		
-		/*
-		 * Go through the properties loaded from the property file. Anything
-		 * starting with MessagePlugin.MESSAGE_PLUGIN is assumed to be a plugin
-		 * that we load and add to the list.
-		 */
-		
-		Properties properties = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperties();
-		
-		if (properties != null)
-		{
-			Enumeration names = properties.propertyNames();
-
-			while (names.hasMoreElements())
-			{
-				String attrName = (String) names.nextElement();
-				
-				if (attrName.startsWith(MessagePlugin.MESSAGE_PLUGIN))
-				{
-					try
-					{
-						String pluginName = properties.getProperty(attrName);
-						Class c = ClassUtil.forName(pluginName, getClass());
-						MessagePlugin thePlugin = (MessagePlugin) c.newInstance();
-
-						messageFormats.put(thePlugin.getType(), thePlugin);
-					}
-					catch (ClassNotFoundException ex)
-					{
-						ex.printStackTrace();
-					}
-					catch (IllegalAccessException ex)
-					{
-						ex.printStackTrace();
-					}
-					catch (InstantiationException ex)
-					{
-						ex.printStackTrace();
-					}
-				}
-			}
-		}
-	         
-		/*
-		 * Now add the default(s).
-		 */
-		
-		messageFormats.put(MessageType.JBOSS_XML, new XMLMessagePlugin());
-		messageFormats.put(MessageType.JAVA_SERIALIZED, new SerializedMessagePlugin());
-	}
-	
-	public Message getMessage() // returns some default implementation.
-	{
-		return ((MessagePlugin) messageFormats.get(MessageType.DEFAULT_TYPE)).getMessage();
-	}
-
-	public Message getMessage(URI type) // returns a message of a specific type.
-	{
-		if (type == null)
-			throw new IllegalArgumentException();
-
-		MessagePlugin plugin = messageFormats.get(type);
-
-		if (plugin != null)
-			return plugin.getMessage();
-		else
-			return null;
-	}
-
-	public Message getMessage(Message msg, URI type) // convert a message
-	// from one form to
-	// another.
-	{
-		if ((msg == null) || (type == null))
-			throw new IllegalArgumentException();
-
-		return null;
-	}
-
-	private final Hashtable<URI, MessagePlugin> messageFormats = new Hashtable<URI, MessagePlugin>();
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,137 @@
+package org.jboss.internal.soa.esb.message.format;
+
+import java.net.URI;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+
+import org.jboss.internal.soa.esb.message.format.serialized.SerializedMessagePlugin;
+import org.jboss.internal.soa.esb.message.format.xml.XMLMessagePlugin;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessagePlugin;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Messages may contain attachments that do not appear in the main payload body.
+ * For example, binary document formats, zip files etc.
+ * 
+ * @author Mark Little
+ */
+
+public class MessageFactoryImpl extends MessageFactory
+{
+
+	public MessageFactoryImpl ()
+	{
+		reset();
+	}
+
+	public void reset ()
+	{
+		messageFormats.clear();
+		
+		/*
+		 * Go through the properties loaded from the property file. Anything
+		 * starting with MessagePlugin.MESSAGE_PLUGIN is assumed to be a plugin
+		 * that we load and add to the list.
+		 */
+		
+		Properties properties = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperties();
+		
+		if (properties != null)
+		{
+			Enumeration names = properties.propertyNames();
+
+			while (names.hasMoreElements())
+			{
+				String attrName = (String) names.nextElement();
+				
+				if (attrName.startsWith(MessagePlugin.MESSAGE_PLUGIN))
+				{
+					try
+					{
+						String pluginName = properties.getProperty(attrName);
+						Class c = ClassUtil.forName(pluginName, getClass());
+						MessagePlugin thePlugin = (MessagePlugin) c.newInstance();
+
+						messageFormats.put(thePlugin.getType(), thePlugin);
+					}
+					catch (ClassNotFoundException ex)
+					{
+						ex.printStackTrace();
+					}
+					catch (IllegalAccessException ex)
+					{
+						ex.printStackTrace();
+					}
+					catch (InstantiationException ex)
+					{
+						ex.printStackTrace();
+					}
+				}
+			}
+		}
+	         
+		/*
+		 * Now add the default(s).
+		 */
+		
+		messageFormats.put(MessageType.JBOSS_XML, new XMLMessagePlugin());
+		messageFormats.put(MessageType.JAVA_SERIALIZED, new SerializedMessagePlugin());
+	}
+	
+	public Message getMessage() // returns some default implementation.
+	{
+		return ((MessagePlugin) messageFormats.get(MessageType.DEFAULT_TYPE)).getMessage();
+	}
+
+	public Message getMessage(URI type) // returns a message of a specific type.
+	{
+		if (type == null)
+			throw new IllegalArgumentException();
+
+		MessagePlugin plugin = messageFormats.get(type);
+
+		if (plugin != null)
+			return plugin.getMessage();
+		else
+			return null;
+	}
+
+	public Message getMessage(Message msg, URI type) // convert a message
+	// from one form to
+	// another.
+	{
+		if ((msg == null) || (type == null))
+			throw new IllegalArgumentException();
+
+		return null;
+	}
+
+	private final Hashtable<URI, MessagePlugin> messageFormats = new Hashtable<URI, MessagePlugin>();
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,155 +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 mark.little at jboss.com
- */
-
-package org.jboss.internal.soa.esb.message.format.serialized;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.jboss.soa.esb.message.Attachment;
-
-/**
- * Messages may contain attachments that do not appear in the main payload body.
- * For example, binary document formats, zip files etc.
- * 
- * @author Mark Little
- */
-
-public class AttachmentImpl implements Attachment, java.io.Serializable
-{
-	private static final long serialVersionUID = 0x0;
-
-	public Object get(String name)
-	{
-		return _table.get(name);
-	}
-
-	public Object put(String name, Object value) 
-	{
-		if (value instanceof Serializable)
-			return _table.put(name,(Serializable)value);
-		throw new IllegalArgumentException("value must be Serializable");
-	}
-
-	public Object remove(String name) 
-	{
-		return _table.remove(name);
-	}
-
-	public String[] getNames() 
-	{
-		return _table.keySet().toArray(new String[_table.size()]);
-	}
-
-	public Object itemAt(int index) throws IndexOutOfBoundsException 
-	{
-		return _list.get(index);
-	}
-
-	public Object removeItemAt(int index) throws IndexOutOfBoundsException 
-	{
-		return _list.remove(index);
-	}
-
-	public Object replaceItemAt(int index, Object value) throws IndexOutOfBoundsException 
-	{
-		if (value instanceof Serializable)
-			return _list.set(index,(Serializable)value);
-		throw new IllegalArgumentException("value must be Serializable");
-	}
-
-	public void addItem(Object value) 
-	{
-		if (value instanceof Serializable)
-			_list.add((Serializable)value);
-		else
-			throw new IllegalArgumentException("value must be Serializable");
-	}
-
-	public void addItemAt(int index, Object value) throws IndexOutOfBoundsException 
-	{
-		if (value instanceof Serializable)
-			_list.add(index,(Serializable)value);
-		else
-			throw new IllegalArgumentException("value must be Serializable");
-	}
-
-	public int getNamedCount() 
-	{
-		return _table.size();
-	}
-	
-	public int getUnnamedCount() 
-	{
-		return _list.size();
-	}
-	
-	public String toString() 
-	{ 
-		return new StringBuilder()
-		.append("attachments: [ Named:").append(_table.toString())
-		.append(", Unnamed:").append(_list.toString())
-		.toString()+" ]";
-	}
-	
-	@Override
-	public boolean equals(Object arg)
-	{
-		if (! (arg instanceof Attachment))
-			return false;
-		Attachment other = (Attachment)arg;
-
-		if (other.getNamedCount() != _table.size())
-			return false;
-		for(Map.Entry<String,Serializable>oCurr : _table.entrySet())
-		{	
-			Object val = other.get(oCurr.getKey());
-			if (null==oCurr.getValue())
-				if (null==val)
-					continue;
-				else
-					return false;
-			if (!oCurr.getValue().equals(val))
-				return false;
-		}
-
-		if (other.getUnnamedCount() != _list.size())
-			return false;
-		int index = 0;
-		for (Serializable oCurr : _list)
-		{
-			Object val = other.itemAt(index++);
-			if (null==oCurr)
-				if (null==val)
-					continue;
-				else
-					return false;
-			if (!oCurr.equals(val))
-				return false;
-		}
-		return true;		
-	}
-
-	ArrayList<Serializable> _list = new ArrayList<Serializable>();
-	Hashtable<String,Serializable> _table = new Hashtable<String,Serializable>();
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,155 @@
+/*
+ * 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 mark.little at jboss.com
+ */
+
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.jboss.soa.esb.message.Attachment;
+
+/**
+ * Messages may contain attachments that do not appear in the main payload body.
+ * For example, binary document formats, zip files etc.
+ * 
+ * @author Mark Little
+ */
+
+public class AttachmentImpl implements Attachment, java.io.Serializable
+{
+	private static final long serialVersionUID = 0x0;
+
+	public Object get(String name)
+	{
+		return _table.get(name);
+	}
+
+	public Object put(String name, Object value) 
+	{
+		if (value instanceof Serializable)
+			return _table.put(name,(Serializable)value);
+		throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public Object remove(String name) 
+	{
+		return _table.remove(name);
+	}
+
+	public String[] getNames() 
+	{
+		return _table.keySet().toArray(new String[_table.size()]);
+	}
+
+	public Object itemAt(int index) throws IndexOutOfBoundsException 
+	{
+		return _list.get(index);
+	}
+
+	public Object removeItemAt(int index) throws IndexOutOfBoundsException 
+	{
+		return _list.remove(index);
+	}
+
+	public Object replaceItemAt(int index, Object value) throws IndexOutOfBoundsException 
+	{
+		if (value instanceof Serializable)
+			return _list.set(index,(Serializable)value);
+		throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public void addItem(Object value) 
+	{
+		if (value instanceof Serializable)
+			_list.add((Serializable)value);
+		else
+			throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public void addItemAt(int index, Object value) throws IndexOutOfBoundsException 
+	{
+		if (value instanceof Serializable)
+			_list.add(index,(Serializable)value);
+		else
+			throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public int getNamedCount() 
+	{
+		return _table.size();
+	}
+	
+	public int getUnnamedCount() 
+	{
+		return _list.size();
+	}
+	
+	public String toString() 
+	{ 
+		return new StringBuilder()
+		.append("attachments: [ Named:").append(_table.toString())
+		.append(", Unnamed:").append(_list.toString())
+		.toString()+" ]";
+	}
+	
+	@Override
+	public boolean equals(Object arg)
+	{
+		if (! (arg instanceof Attachment))
+			return false;
+		Attachment other = (Attachment)arg;
+
+		if (other.getNamedCount() != _table.size())
+			return false;
+		for(Map.Entry<String,Serializable>oCurr : _table.entrySet())
+		{	
+			Object val = other.get(oCurr.getKey());
+			if (null==oCurr.getValue())
+				if (null==val)
+					continue;
+				else
+					return false;
+			if (!oCurr.getValue().equals(val))
+				return false;
+		}
+
+		if (other.getUnnamedCount() != _list.size())
+			return false;
+		int index = 0;
+		for (Serializable oCurr : _list)
+		{
+			Object val = other.itemAt(index++);
+			if (null==oCurr)
+				if (null==val)
+					continue;
+				else
+					return false;
+			if (!oCurr.equals(val))
+				return false;
+		}
+		return true;		
+	}
+
+	ArrayList<Serializable> _list = new ArrayList<Serializable>();
+	Hashtable<String,Serializable> _table = new Hashtable<String,Serializable>();
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,183 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.serialized;
-
-import java.io.Serializable;
-import java.util.Hashtable;
-import java.util.Set;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.util.Util;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/*
- * This implementation requires that all contents are serializable.
- */
-
-public class BodyImpl implements Body, java.io.Serializable
-{
-    private static final long serialVersionUID = 0x0;
-
-    public BodyImpl()
-    {
-	_content = null;
-	_objects = new Hashtable<String, Serializable>();
-    }
-
-    public void setByteArray (byte[] content)
-    {
-	_content = content;
-    }
-
-    public byte[] getByteArray ()
-    {
-	return _content;
-    }
-
-    public void setContents (byte[] content)
-    {
-	setByteArray(content);
-    }
-
-    public byte[] getContents ()
-    {
-	return getByteArray();
-    }
-
-    public void add (Object value)
-    {
-	add(Body.DEFAULT_LOCATION, value);
-    }
-
-    public void add (String name, Object value)
-    {
-	AssertArgument.isNotNull(value, "value");
-	AssertArgument.isNotNull(name, "name");
-
-	if (value instanceof Serializable)
-	{
-	    synchronized (_objects)
-	    {
-		_objects.put(name, (Serializable) value);
-	    }
-	}
-	else
-	    throw new IllegalArgumentException("Object must be Serializable.");
-    }
-
-    public Object get ()
-    {
-	return get(Body.DEFAULT_LOCATION);
-    }
-
-    public Object get (String name)
-    {
-	AssertArgument.isNotNull(name, "name");
-	
-	synchronized (_objects)
-	{
-	    return _objects.get(name);
-	}
-    }
-
-    public String[] getNames ()
-    {
-	Set<String> keys = _objects.keySet();
-
-	if (keys != null)
-	{
-	    String[] toReturn = new String[keys.size()];
-
-	    return keys.toArray(toReturn);
-	}
-	else
-	    return null;
-    }
-
-    public Object remove (String name)
-    {
-	synchronized (_objects)
-	{
-	    return _objects.remove(name);
-	}
-    }
-
-    public void replace (Body b)
-    {
-	if (b == null)
-	    throw new IllegalArgumentException();
-
-	setByteArray(b.getByteArray());
-
-	_objects = ((BodyImpl) b)._objects;
-    }
-
-    public void merge (Body b)
-    {
-	if (b == null)
-	    throw new IllegalArgumentException();
-
-	byte[] toAdd = b.getByteArray();
-
-	if ((toAdd != null) && (toAdd.length > 0))
-	{
-	    if ((_content == null) || (_content.length == 0))
-	    {
-		_content = toAdd;
-	    }
-	    else
-	    {
-		int newSize = _content.length + toAdd.length;
-		byte[] buffer = new byte[newSize];
-
-		System.arraycopy(_content, 0, buffer, 0, _content.length);
-		System.arraycopy(toAdd, 0, buffer, _content.length,
-			toAdd.length);
-
-		_content = buffer;
-	    }
-	}
-    }
-
-    public String toString ()
-    {
-	String toReturn = "body: [ ";
-
-	if (_content != null)
-	    toReturn += "byte[]: " + Util.format(new String(_content));
-
-	if (_objects != null)
-	{
-	    if (_content != null)
-		toReturn += ", ";
-
-	    toReturn += "objects: " + _objects.toString();
-	}
-
-	return toReturn + " ]";
-    }
-
-    private byte[] _content;
-
-    private Hashtable<String, Serializable> _objects;
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,183 @@
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import java.io.Serializable;
+import java.util.Hashtable;
+import java.util.Set;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.util.Util;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/*
+ * This implementation requires that all contents are serializable.
+ */
+
+public class BodyImpl implements Body, java.io.Serializable
+{
+    private static final long serialVersionUID = 0x0;
+
+    public BodyImpl()
+    {
+	_content = null;
+	_objects = new Hashtable<String, Serializable>();
+    }
+
+    public void setByteArray (byte[] content)
+    {
+	_content = content;
+    }
+
+    public byte[] getByteArray ()
+    {
+	return _content;
+    }
+
+    public void setContents (byte[] content)
+    {
+	setByteArray(content);
+    }
+
+    public byte[] getContents ()
+    {
+	return getByteArray();
+    }
+
+    public void add (Object value)
+    {
+	add(Body.DEFAULT_LOCATION, value);
+    }
+
+    public void add (String name, Object value)
+    {
+	AssertArgument.isNotNull(value, "value");
+	AssertArgument.isNotNull(name, "name");
+
+	if (value instanceof Serializable)
+	{
+	    synchronized (_objects)
+	    {
+		_objects.put(name, (Serializable) value);
+	    }
+	}
+	else
+	    throw new IllegalArgumentException("Object must be Serializable.");
+    }
+
+    public Object get ()
+    {
+	return get(Body.DEFAULT_LOCATION);
+    }
+
+    public Object get (String name)
+    {
+	AssertArgument.isNotNull(name, "name");
+	
+	synchronized (_objects)
+	{
+	    return _objects.get(name);
+	}
+    }
+
+    public String[] getNames ()
+    {
+	Set<String> keys = _objects.keySet();
+
+	if (keys != null)
+	{
+	    String[] toReturn = new String[keys.size()];
+
+	    return keys.toArray(toReturn);
+	}
+	else
+	    return null;
+    }
+
+    public Object remove (String name)
+    {
+	synchronized (_objects)
+	{
+	    return _objects.remove(name);
+	}
+    }
+
+    public void replace (Body b)
+    {
+	if (b == null)
+	    throw new IllegalArgumentException();
+
+	setByteArray(b.getByteArray());
+
+	_objects = ((BodyImpl) b)._objects;
+    }
+
+    public void merge (Body b)
+    {
+	if (b == null)
+	    throw new IllegalArgumentException();
+
+	byte[] toAdd = b.getByteArray();
+
+	if ((toAdd != null) && (toAdd.length > 0))
+	{
+	    if ((_content == null) || (_content.length == 0))
+	    {
+		_content = toAdd;
+	    }
+	    else
+	    {
+		int newSize = _content.length + toAdd.length;
+		byte[] buffer = new byte[newSize];
+
+		System.arraycopy(_content, 0, buffer, 0, _content.length);
+		System.arraycopy(toAdd, 0, buffer, _content.length,
+			toAdd.length);
+
+		_content = buffer;
+	    }
+	}
+    }
+
+    public String toString ()
+    {
+	String toReturn = "body: [ ";
+
+	if (_content != null)
+	    toReturn += "byte[]: " + Util.format(new String(_content));
+
+	if (_objects != null)
+	{
+	    if (_content != null)
+		toReturn += ", ";
+
+	    toReturn += "objects: " + _objects.toString();
+	}
+
+	return toReturn + " ]";
+    }
+
+    private byte[] _content;
+
+    private Hashtable<String, Serializable> _objects;
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,34 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.serialized;
-
-import org.jboss.soa.esb.message.Context;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-public class ContextImpl implements Context, java.io.Serializable
-{
-	private static final long serialVersionUID = 0x0;
-	
-	public String toString ()
-	{
-		return "context: [ null ]";
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,34 @@
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import org.jboss.soa.esb.message.Context;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+public class ContextImpl implements Context, java.io.Serializable
+{
+	private static final long serialVersionUID = 0x0;
+	
+	public String toString ()
+	{
+		return "context: [ null ]";
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,60 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.serialized;
-
-import java.net.URI;
-
-import org.jboss.soa.esb.message.Fault;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-public class FaultImpl implements Fault, java.io.Serializable
-{
-	private static final long serialVersionUID = 0x0;
-	
-	public URI getCode ()
-	{
-		return _code;
-	}
-	
-	public void setCode (URI code)
-	{
-		_code = code;
-	}
-	
-	public String getReason ()
-	{
-		return _reason;
-	}
-	
-	public void setReason (String reason)
-	{
-		_reason = reason;
-	}
-	
-	public String toString ()
-	{
-		return "fault: [ "+((_code != null) ? _code : "null")+", "+((_reason != null) ? _reason : "null")+" ]";
-	}
-	
-	private URI _code = null;
-	private String _reason = null;
-	
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,60 @@
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import java.net.URI;
+
+import org.jboss.soa.esb.message.Fault;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+public class FaultImpl implements Fault, java.io.Serializable
+{
+	private static final long serialVersionUID = 0x0;
+	
+	public URI getCode ()
+	{
+		return _code;
+	}
+	
+	public void setCode (URI code)
+	{
+		_code = code;
+	}
+	
+	public String getReason ()
+	{
+		return _reason;
+	}
+	
+	public void setReason (String reason)
+	{
+		_reason = reason;
+	}
+	
+	public String toString ()
+	{
+		return "fault: [ "+((_code != null) ? _code : "null")+", "+((_reason != null) ? _reason : "null")+" ]";
+	}
+	
+	private URI _code = null;
+	private String _reason = null;
+	
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,169 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.serialized;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.io.StringWriter;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.jboss.internal.soa.esb.addressing.helpers.CallHelper;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.message.Header;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
-/**
- * The message header. Contains such things as routing information.
- */
-
-public class HeaderImpl implements Header, Serializable
-{
-	private static final long serialVersionUID = 0x0;
-	
-	public static final String HEADER_TAG = "Header";
-	
-	public HeaderImpl ()
-	{
-		_call = new Call();
-	}
-	
-	// TODO add other setters/getters for artibitrary attributes
-	
-	public Call getCall ()
-	{
-		return _call;
-	}
-	
-	public void setCall (Call call)
-	{
-		if (call == null)
-			throw new IllegalArgumentException();
-		
-		_call = call;
-	}
-
-	public String toString ()
-	{
-		if (_call != null)
-			return "header: [ "+_call.toString()+" ]";
-		else
-			return "header: [ null ]";
-	}
-	
-	/*
-	 * Call and PortReference aren't Serializable so we have to do some
-	 * magic.
-	 */
-	
-	private void writeObject(java.io.ObjectOutputStream out) throws IOException
-	{
-		if (_call != null)
-		{
-			try
-			{
-				DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-				
-				factory.setNamespaceAware(true);
-
-				DocumentBuilder builder = factory.newDocumentBuilder();
-				Document doc = builder.newDocument();
-				Element header = doc.createElement(HEADER_TAG);	
-				
-				doc.appendChild(header);
-				
-				header = CallHelper.toXML(_call, doc, header);
-				
-				StringWriter sWriter = new StringWriter();
-				OutputFormat format = new OutputFormat();
-				format.setIndenting(true);
-				XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-				xmlS.asDOMSerializer();
-				xmlS.serialize(doc);
-
-				out.writeObject(sWriter.toString());
-			}
-			catch (MarshalException ex)
-			{
-				ex.printStackTrace();
-				
-				throw new IOException(ex.toString());
-			}
-			catch (ParserConfigurationException ex)
-			{
-				ex.printStackTrace();
-				
-				throw new IOException(ex.toString());
-			}
-		}	
-	}
-	
-	private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
-	{
-		try
-		{
-			String header = (String) in.readObject();
-			InputStream inStream = new ByteArrayInputStream(header.getBytes());
-			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			
-			factory.setNamespaceAware(true);
-
-			DocumentBuilder builder = factory.newDocumentBuilder();				
-			Document doc = builder.parse(inStream);
-	
-			Element headerElement = doc.getDocumentElement();
-			
-			_call = CallHelper.fromXML(headerElement);
-		}
-		catch (UnmarshalException ex)
-		{
-			ex.printStackTrace();
-			
-			throw new IOException(ex.toString());
-		}
-		catch (ParserConfigurationException ex)
-		{
-			ex.printStackTrace();
-			
-			throw new IOException(ex.toString());
-		}
-		catch (SAXException ex)
-		{
-			ex.printStackTrace();
-			
-			throw new IOException(ex.toString());
-		}
-	}
-	
-	private Call _call;
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,169 @@
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.jboss.internal.soa.esb.addressing.helpers.CallHelper;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.message.Header;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+/**
+ * The message header. Contains such things as routing information.
+ */
+
+public class HeaderImpl implements Header, Serializable
+{
+	private static final long serialVersionUID = 0x0;
+	
+	public static final String HEADER_TAG = "Header";
+	
+	public HeaderImpl ()
+	{
+		_call = new Call();
+	}
+	
+	// TODO add other setters/getters for artibitrary attributes
+	
+	public Call getCall ()
+	{
+		return _call;
+	}
+	
+	public void setCall (Call call)
+	{
+		if (call == null)
+			throw new IllegalArgumentException();
+		
+		_call = call;
+	}
+
+	public String toString ()
+	{
+		if (_call != null)
+			return "header: [ "+_call.toString()+" ]";
+		else
+			return "header: [ null ]";
+	}
+	
+	/*
+	 * Call and PortReference aren't Serializable so we have to do some
+	 * magic.
+	 */
+	
+	private void writeObject(java.io.ObjectOutputStream out) throws IOException
+	{
+		if (_call != null)
+		{
+			try
+			{
+				DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+				
+				factory.setNamespaceAware(true);
+
+				DocumentBuilder builder = factory.newDocumentBuilder();
+				Document doc = builder.newDocument();
+				Element header = doc.createElement(HEADER_TAG);	
+				
+				doc.appendChild(header);
+				
+				header = CallHelper.toXML(_call, doc, header);
+				
+				StringWriter sWriter = new StringWriter();
+				OutputFormat format = new OutputFormat();
+				format.setIndenting(true);
+				XMLSerializer xmlS = new XMLSerializer(sWriter, format);
+				xmlS.asDOMSerializer();
+				xmlS.serialize(doc);
+
+				out.writeObject(sWriter.toString());
+			}
+			catch (MarshalException ex)
+			{
+				ex.printStackTrace();
+				
+				throw new IOException(ex.toString());
+			}
+			catch (ParserConfigurationException ex)
+			{
+				ex.printStackTrace();
+				
+				throw new IOException(ex.toString());
+			}
+		}	
+	}
+	
+	private void readObject(java.io.ObjectInputStream in) throws IOException, ClassNotFoundException
+	{
+		try
+		{
+			String header = (String) in.readObject();
+			InputStream inStream = new ByteArrayInputStream(header.getBytes());
+			DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			
+			factory.setNamespaceAware(true);
+
+			DocumentBuilder builder = factory.newDocumentBuilder();				
+			Document doc = builder.parse(inStream);
+	
+			Element headerElement = doc.getDocumentElement();
+			
+			_call = CallHelper.fromXML(headerElement);
+		}
+		catch (UnmarshalException ex)
+		{
+			ex.printStackTrace();
+			
+			throw new IOException(ex.toString());
+		}
+		catch (ParserConfigurationException ex)
+		{
+			ex.printStackTrace();
+			
+			throw new IOException(ex.toString());
+		}
+		catch (SAXException ex)
+		{
+			ex.printStackTrace();
+			
+			throw new IOException(ex.toString());
+		}
+	}
+	
+	private Call _call;
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,135 +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 mark.little at jboss.com
- */
-package org.jboss.internal.soa.esb.message.format.serialized;
-
-import java.io.Serializable;
-import java.net.URI;
-
-import org.jboss.soa.esb.message.Attachment;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Context;
-import org.jboss.soa.esb.message.Fault;
-import org.jboss.soa.esb.message.Header;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.Properties;
-import org.jboss.soa.esb.message.format.MessageType;
-
-
-/**
- * This is the basic internal core message abstraction. A message consists of the following
- * components:
- * 
- * Header: the header information contains information such as the destination EPR, the
- * sender EPR, where the reply goes etc, i.e., general message-level functional information.
- * Context: additional information to contextualise the message; for example, transaction or
- * security data, the identity of the ultimate receiver, or HTTP-cookie like information.
- * Body: the actual payload of the message.
- * Fault: any fault information associated with the message.
- * Attachment: any attachments associated with the message.
- * 
- * Each message, once created, has a corresponding element for these 5 components. That element
- * may be empty (<b>NOT NULL</b>). The object representing the element can then be used to act
- * on the corresponding data item in the message.
- * 
- * @author Mark Little
- *
- */
-
-public class MessageImpl implements Message, Serializable
-{
-	private static final long serialVersionUID = 0x0;
-	
-	/**
-	 * @return get the header component of the message.
-	 */
-	
-	public Header getHeader ()
-	{
-		return _theHeader;
-	}
-	
-	/**
-	 * @return get the context component of the message.
-	 */
-	
-	public Context getContext ()
-	{
-		return _theContext;
-	}
-	
-	/**
-	 * @return get the body component of the message.
-	 */
-	
-	public Body getBody ()
-	{
-		return _theBody;
-	}
-	
-	/**
-	 * @return get any faults associated with the message. These should not
-	 * be application level faults, but comms level.
-	 */
-	
-	public Fault getFault ()
-	{
-		return _theFault;
-	}
-	
-	/**
-	 * @return get any message attachments.
-	 */
-	
-	public Attachment getAttachment ()
-	{
-		return _theAttachment;
-	}
-	
-	/**
-	 * @return the type of this message format.
-	 */
-	
-	public URI getType ()
-	{
-		return MessageType.JAVA_SERIALIZED;
-	}
-
-	/**
-	 * @return Map&lt;String,Object&gt; - any message properties.
-	 */
-	public Properties getProperties() 
-	{
-		return _theProperties;
-	}
-
-	public String toString ()
-	{
-		return "message: [ JAVA_SERIALIZED ]\n[ "+_theHeader.toString()+"\n"+_theContext.toString()+"\n"+_theBody.toString()
-		+"\n"+_theFault.toString()+"\n"+_theAttachment.toString()+"\n"+_theProperties.toString()+" ]";
-	}
-	
-	private HeaderImpl _theHeader = new HeaderImpl();
-	private ContextImpl _theContext = new ContextImpl();
-	private BodyImpl _theBody = new BodyImpl();
-	private FaultImpl _theFault = new FaultImpl();
-	private AttachmentImpl _theAttachment = new AttachmentImpl();
-	private Properties _theProperties = new PropertiesImpl();
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,135 @@
+/*
+ * 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 mark.little at jboss.com
+ */
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import java.io.Serializable;
+import java.net.URI;
+
+import org.jboss.soa.esb.message.Attachment;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Context;
+import org.jboss.soa.esb.message.Fault;
+import org.jboss.soa.esb.message.Header;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.Properties;
+import org.jboss.soa.esb.message.format.MessageType;
+
+
+/**
+ * This is the basic internal core message abstraction. A message consists of the following
+ * components:
+ * 
+ * Header: the header information contains information such as the destination EPR, the
+ * sender EPR, where the reply goes etc, i.e., general message-level functional information.
+ * Context: additional information to contextualise the message; for example, transaction or
+ * security data, the identity of the ultimate receiver, or HTTP-cookie like information.
+ * Body: the actual payload of the message.
+ * Fault: any fault information associated with the message.
+ * Attachment: any attachments associated with the message.
+ * 
+ * Each message, once created, has a corresponding element for these 5 components. That element
+ * may be empty (<b>NOT NULL</b>). The object representing the element can then be used to act
+ * on the corresponding data item in the message.
+ * 
+ * @author Mark Little
+ *
+ */
+
+public class MessageImpl implements Message, Serializable
+{
+	private static final long serialVersionUID = 0x0;
+	
+	/**
+	 * @return get the header component of the message.
+	 */
+	
+	public Header getHeader ()
+	{
+		return _theHeader;
+	}
+	
+	/**
+	 * @return get the context component of the message.
+	 */
+	
+	public Context getContext ()
+	{
+		return _theContext;
+	}
+	
+	/**
+	 * @return get the body component of the message.
+	 */
+	
+	public Body getBody ()
+	{
+		return _theBody;
+	}
+	
+	/**
+	 * @return get any faults associated with the message. These should not
+	 * be application level faults, but comms level.
+	 */
+	
+	public Fault getFault ()
+	{
+		return _theFault;
+	}
+	
+	/**
+	 * @return get any message attachments.
+	 */
+	
+	public Attachment getAttachment ()
+	{
+		return _theAttachment;
+	}
+	
+	/**
+	 * @return the type of this message format.
+	 */
+	
+	public URI getType ()
+	{
+		return MessageType.JAVA_SERIALIZED;
+	}
+
+	/**
+	 * @return Map&lt;String,Object&gt; - any message properties.
+	 */
+	public Properties getProperties() 
+	{
+		return _theProperties;
+	}
+
+	public String toString ()
+	{
+		return "message: [ JAVA_SERIALIZED ]\n[ "+_theHeader.toString()+"\n"+_theContext.toString()+"\n"+_theBody.toString()
+		+"\n"+_theFault.toString()+"\n"+_theAttachment.toString()+"\n"+_theProperties.toString()+" ]";
+	}
+	
+	private HeaderImpl _theHeader = new HeaderImpl();
+	private ContextImpl _theContext = new ContextImpl();
+	private BodyImpl _theBody = new BodyImpl();
+	private FaultImpl _theFault = new FaultImpl();
+	private AttachmentImpl _theAttachment = new AttachmentImpl();
+	private Properties _theProperties = new PropertiesImpl();
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,92 +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 schifest at heuristica.com.ar
- */
-package org.jboss.internal.soa.esb.message.format.serialized;
-
-import java.io.Serializable;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.jboss.soa.esb.message.Properties;
-
-public class PropertiesImpl implements Properties, Serializable
-{
-	private static final long serialVersionUID = 0x0;
-
-	public Object getProperty(String name)
-	{
-		return _table.get(name);
-	}
-
-	public Object getProperty(String name, Object defaultVal)
-	{
-		Object oRet = getProperty(name);
-		return (null == oRet) ? defaultVal : oRet;
-	}
-
-	public Object setProperty(String name, Object value)
-	{
-		if (value instanceof Serializable)
-			return _table.put(name, (Serializable) value);
-		else
-			throw new IllegalArgumentException("Value must be serializable");
-	}
-
-	public Object remove(String name)
-	{
-		return _table.remove(name);
-	}
-	
-	public int size() {return _table.size(); } 
-
-	public String[] getNames()
-	{
-		return _table.keySet().toArray(new String[_table.size()]);
-	}
-
-	public String toString()
-	{
-		return "properties: [ "+_table.toString()+" ]";
-	}
-
-	@Override
-	public boolean equals(Object arg)
-	{
-		if (! (arg instanceof Properties))
-			return false;
-		Properties other = (Properties)arg;
-		if (other.size() != _table.size())
-			return false;
-		for(Map.Entry<String,Serializable>oCurr : _table.entrySet())
-		{	
-			Object val = other.getProperty(oCurr.getKey());
-			if (null==oCurr.getValue())
-				if (null==val)
-					continue;
-				else
-					return false;
-			if (!oCurr.getValue().equals(val))
-				return false;
-		}
-		return true;
-	}
-
-	Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,92 @@
+/*
+ * 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 schifest at heuristica.com.ar
+ */
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import java.io.Serializable;
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.jboss.soa.esb.message.Properties;
+
+public class PropertiesImpl implements Properties, Serializable
+{
+	private static final long serialVersionUID = 0x0;
+
+	public Object getProperty(String name)
+	{
+		return _table.get(name);
+	}
+
+	public Object getProperty(String name, Object defaultVal)
+	{
+		Object oRet = getProperty(name);
+		return (null == oRet) ? defaultVal : oRet;
+	}
+
+	public Object setProperty(String name, Object value)
+	{
+		if (value instanceof Serializable)
+			return _table.put(name, (Serializable) value);
+		else
+			throw new IllegalArgumentException("Value must be serializable");
+	}
+
+	public Object remove(String name)
+	{
+		return _table.remove(name);
+	}
+	
+	public int size() {return _table.size(); } 
+
+	public String[] getNames()
+	{
+		return _table.keySet().toArray(new String[_table.size()]);
+	}
+
+	public String toString()
+	{
+		return "properties: [ "+_table.toString()+" ]";
+	}
+
+	@Override
+	public boolean equals(Object arg)
+	{
+		if (! (arg instanceof Properties))
+			return false;
+		Properties other = (Properties)arg;
+		if (other.size() != _table.size())
+			return false;
+		for(Map.Entry<String,Serializable>oCurr : _table.entrySet())
+		{	
+			Object val = other.getProperty(oCurr.getKey());
+			if (null==oCurr.getValue())
+				if (null==val)
+					continue;
+				else
+					return false;
+			if (!oCurr.getValue().equals(val))
+				return false;
+		}
+		return true;
+	}
+
+	Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,48 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.serialized;
-
-import java.net.URI;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessagePlugin;
-import org.jboss.soa.esb.message.format.MessageType;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Used to plug in new message formats dynamically.
- *  
- * @author Mark Little
- *
- */
-
-public class SerializedMessagePlugin implements MessagePlugin
-{
-	public Message getMessage ()
-	{
-		return new MessageImpl();
-	}
-	
-	public URI getType ()
-	{
-		return MessageType.JAVA_SERIALIZED;
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,48 @@
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import java.net.URI;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessagePlugin;
+import org.jboss.soa.esb.message.format.MessageType;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Used to plug in new message formats dynamically.
+ *  
+ * @author Mark Little
+ *
+ */
+
+public class SerializedMessagePlugin implements MessagePlugin
+{
+	public Message getMessage ()
+	{
+		return new MessageImpl();
+	}
+	
+	public URI getType ()
+	{
+		return MessageType.JAVA_SERIALIZED;
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,272 +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 mark.little at jboss.com
- */
-
-package org.jboss.internal.soa.esb.message.format.xml;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.jboss.internal.soa.esb.thirdparty.Base64;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.message.Attachment;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * Messages may contain attachments that do not appear in the main payload body.
- * For example, binary document formats, zip files etc.
- * 
- * @author Mark Little
- */
-
-public class AttachmentImpl implements Attachment, java.io.Serializable
-{
-	public static final String ATTACHMENT_TAG = "Attachment";
-	public static final String NAME_ATTR = "name";
-    public static final String NAMED_TAG = "Named";
-    public static final String UNNAMED_TAG = "UnNamed";
-
-	private static final long serialVersionUID = 0x0;
-
-	public Object get(String name)
-	{
-		return _table.get(name);
-	}
-
-	public Object put(String name, Object value)
-	{
-		if (value instanceof Serializable)
-			return _table.put(name, (Serializable) value);
-		throw new IllegalArgumentException("value must be Serializable");
-	}
-
-	public Object remove(String name)
-	{
-		return _table.remove(name);
-	}
-
-	public String[] getNames()
-	{
-		return _table.keySet().toArray(new String[_table.size()]);
-	}
-
-	public Object itemAt(int index) throws IndexOutOfBoundsException
-	{
-		return _list.get(index);
-	}
-
-	public Object removeItemAt(int index) throws IndexOutOfBoundsException
-	{
-		return _list.remove(index);
-	}
-
-	public Object replaceItemAt(int index, Object value)
-			throws IndexOutOfBoundsException
-	{
-		if (value instanceof Serializable)
-			return _list.set(index, (Serializable) value);
-		throw new IllegalArgumentException("value must be Serializable");
-	}
-
-	public void addItem(Object value)
-	{
-		if (value instanceof Serializable)
-			_list.add((Serializable) value);
-		else
-			throw new IllegalArgumentException("value must be Serializable");
-	}
-
-	public void addItemAt(int index, Object value)
-			throws IndexOutOfBoundsException
-	{
-		if (value instanceof Serializable)
-			_list.add(index, (Serializable) value);
-		else
-			throw new IllegalArgumentException("value must be Serializable");
-	}
-
-	public int getNamedCount()
-	{
-		return _table.size();
-	}
-
-	public int getUnnamedCount()
-	{
-		return _list.size();
-	}
-
-	public String toString()
-	{
-		return new StringBuilder().append("attachments: [ Named:").append(
-				_table.toString()).append(", Unnamed:").append(_list.toString())
-				.toString()+" ]";
-	}
-
-	/**
-	 * toXML(elem) - Will build a child element with appropriate values and
-	 * append it to arg0
-	 * 
-	 * @param elem
-	 *            Element - where to add 'this' as a child node
-	 * @return Element - 'this' as the added Element, or &lt;null&gt; if no
-	 *         properties in table and nothing was appended to arg0
-	 * @see XMLUtil.ATTACHMENT_TAG
-	 */
-	public Element toXML(Element elem) throws MarshalException
-	{
-		if (_table.size() < 1 && _list.size() < 1)
-			return null;
-
-		Document doc = elem.getOwnerDocument();
-		Element thisElement = doc.createElement(ATTACHMENT_TAG);
-
-		listToXml(doc, thisElement);
-		tableToXml(doc, thisElement);
-
-		elem.appendChild(thisElement);
-		return thisElement;
-	}
-
-	private void tableToXml(Document doc, Element elem)
-	{
-		for (Map.Entry<String, Serializable> oCurr : _table.entrySet())
-		{
-			Element named = doc.createElement(NAMED_TAG);
-			named.setAttribute(NAME_ATTR, oCurr.getKey());
-			named.appendChild(doc.createCDATASection(Base64.encodeObject(oCurr
-					.getValue())));
-			elem.appendChild(named);
-		}
-	}
-
-	private void listToXml(Document doc, Element elem)
-	{
-		for (Serializable oCurr : _list)
-		{
-			Element anonymous = doc.createElement(UNNAMED_TAG);
-			anonymous.appendChild(doc.createCDATASection(Base64
-					.encodeObject(oCurr)));
-			elem.appendChild(anonymous);
-		}
-	}
-
-	/**
-	 * fromXml(elem) - Populate properties found in appropriate child element
-	 * 
-	 * @see XMLUtil.ATTACHMENT_TAG
-	 * @param elem -
-	 *            Element where to look for child nodes
-	 */
-	public void fromXML(Element elem) throws UnmarshalException
-	{
-		_table.clear();
-		_list.clear();
-
-		NodeList NL = elem.getElementsByTagName(ATTACHMENT_TAG);
-		for (int i1 = 0; i1 < NL.getLength(); i1++)
-		{
-			Node oCurr = NL.item(i1);
-			if ((oCurr instanceof Element))
-			{
-				listFromXml((Element) oCurr);
-				tableFromXml((Element) oCurr);
-			}
-		}
-	}
-
-	private void listFromXml(Element elem)
-	{
-		NodeList anonymous = elem.getElementsByTagName(UNNAMED_TAG);
-		for (int i1 = 0; i1 < anonymous.getLength(); i1++)
-		{
-			Node oCurr = anonymous.item(i1);
-			if (oCurr instanceof Element)
-			{
-				CDATASection cdata = (CDATASection) oCurr.getFirstChild();
-				Object value = Base64.decodeToObject(cdata.getWholeText());
-				_list.add((Serializable) value);
-			}
-		}
-	}
-
-	private void tableFromXml(Element elem)
-	{
-		NodeList named = elem.getElementsByTagName(NAMED_TAG);
-		for (int i1 = 0; i1 < named.getLength(); i1++)
-		{
-			Node oCurr = named.item(i1);
-			if (oCurr instanceof Element)
-			{
-				CDATASection cdata = (CDATASection) oCurr.getFirstChild();
-				String name = ((Element) oCurr).getAttribute(NAME_ATTR);
-				Object value = Base64.decodeToObject(cdata.getWholeText());
-				_table.put(name, (Serializable) value);
-			}
-		}
-	}
-
-	@Override
-	public boolean equals(Object arg)
-	{
-		if (! (arg instanceof Attachment))
-			return false;
-		Attachment other = (Attachment)arg;
-
-		if (other.getNamedCount() != _table.size())
-			return false;
-		for(Map.Entry<String,Serializable>oCurr : _table.entrySet())
-		{	
-			Object val = other.get(oCurr.getKey());
-			if (null==oCurr.getValue())
-				if (null==val)
-					continue;
-				else
-					return false;
-			if (!oCurr.getValue().equals(val))
-				return false;
-		}
-
-		if (other.getUnnamedCount() != _list.size())
-			return false;
-		int index = 0;
-		for (Serializable oCurr : _list)
-		{
-			Object val = other.itemAt(index++);
-			if (null==oCurr)
-				if (null==val)
-					continue;
-				else
-					return false;
-			if (!oCurr.equals(val))
-				return false;
-		}
-		return true;		
-	}
-
-	ArrayList<Serializable> _list = new ArrayList<Serializable>();
-	Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,272 @@
+/*
+ * 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 mark.little at jboss.com
+ */
+
+package org.jboss.internal.soa.esb.message.format.xml;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.jboss.internal.soa.esb.thirdparty.Base64;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.message.Attachment;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * Messages may contain attachments that do not appear in the main payload body.
+ * For example, binary document formats, zip files etc.
+ * 
+ * @author Mark Little
+ */
+
+public class AttachmentImpl implements Attachment, java.io.Serializable
+{
+	public static final String ATTACHMENT_TAG = "Attachment";
+	public static final String NAME_ATTR = "name";
+    public static final String NAMED_TAG = "Named";
+    public static final String UNNAMED_TAG = "UnNamed";
+
+	private static final long serialVersionUID = 0x0;
+
+	public Object get(String name)
+	{
+		return _table.get(name);
+	}
+
+	public Object put(String name, Object value)
+	{
+		if (value instanceof Serializable)
+			return _table.put(name, (Serializable) value);
+		throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public Object remove(String name)
+	{
+		return _table.remove(name);
+	}
+
+	public String[] getNames()
+	{
+		return _table.keySet().toArray(new String[_table.size()]);
+	}
+
+	public Object itemAt(int index) throws IndexOutOfBoundsException
+	{
+		return _list.get(index);
+	}
+
+	public Object removeItemAt(int index) throws IndexOutOfBoundsException
+	{
+		return _list.remove(index);
+	}
+
+	public Object replaceItemAt(int index, Object value)
+			throws IndexOutOfBoundsException
+	{
+		if (value instanceof Serializable)
+			return _list.set(index, (Serializable) value);
+		throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public void addItem(Object value)
+	{
+		if (value instanceof Serializable)
+			_list.add((Serializable) value);
+		else
+			throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public void addItemAt(int index, Object value)
+			throws IndexOutOfBoundsException
+	{
+		if (value instanceof Serializable)
+			_list.add(index, (Serializable) value);
+		else
+			throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public int getNamedCount()
+	{
+		return _table.size();
+	}
+
+	public int getUnnamedCount()
+	{
+		return _list.size();
+	}
+
+	public String toString()
+	{
+		return new StringBuilder().append("attachments: [ Named:").append(
+				_table.toString()).append(", Unnamed:").append(_list.toString())
+				.toString()+" ]";
+	}
+
+	/**
+	 * toXML(elem) - Will build a child element with appropriate values and
+	 * append it to arg0
+	 * 
+	 * @param elem
+	 *            Element - where to add 'this' as a child node
+	 * @return Element - 'this' as the added Element, or &lt;null&gt; if no
+	 *         properties in table and nothing was appended to arg0
+	 * @see XMLUtil.ATTACHMENT_TAG
+	 */
+	public Element toXML(Element elem) throws MarshalException
+	{
+		if (_table.size() < 1 && _list.size() < 1)
+			return null;
+
+		Document doc = elem.getOwnerDocument();
+		Element thisElement = doc.createElement(ATTACHMENT_TAG);
+
+		listToXml(doc, thisElement);
+		tableToXml(doc, thisElement);
+
+		elem.appendChild(thisElement);
+		return thisElement;
+	}
+
+	private void tableToXml(Document doc, Element elem)
+	{
+		for (Map.Entry<String, Serializable> oCurr : _table.entrySet())
+		{
+			Element named = doc.createElement(NAMED_TAG);
+			named.setAttribute(NAME_ATTR, oCurr.getKey());
+			named.appendChild(doc.createCDATASection(Base64.encodeObject(oCurr
+					.getValue())));
+			elem.appendChild(named);
+		}
+	}
+
+	private void listToXml(Document doc, Element elem)
+	{
+		for (Serializable oCurr : _list)
+		{
+			Element anonymous = doc.createElement(UNNAMED_TAG);
+			anonymous.appendChild(doc.createCDATASection(Base64
+					.encodeObject(oCurr)));
+			elem.appendChild(anonymous);
+		}
+	}
+
+	/**
+	 * fromXml(elem) - Populate properties found in appropriate child element
+	 * 
+	 * @see XMLUtil.ATTACHMENT_TAG
+	 * @param elem -
+	 *            Element where to look for child nodes
+	 */
+	public void fromXML(Element elem) throws UnmarshalException
+	{
+		_table.clear();
+		_list.clear();
+
+		NodeList NL = elem.getElementsByTagName(ATTACHMENT_TAG);
+		for (int i1 = 0; i1 < NL.getLength(); i1++)
+		{
+			Node oCurr = NL.item(i1);
+			if ((oCurr instanceof Element))
+			{
+				listFromXml((Element) oCurr);
+				tableFromXml((Element) oCurr);
+			}
+		}
+	}
+
+	private void listFromXml(Element elem)
+	{
+		NodeList anonymous = elem.getElementsByTagName(UNNAMED_TAG);
+		for (int i1 = 0; i1 < anonymous.getLength(); i1++)
+		{
+			Node oCurr = anonymous.item(i1);
+			if (oCurr instanceof Element)
+			{
+				CDATASection cdata = (CDATASection) oCurr.getFirstChild();
+				Object value = Base64.decodeToObject(cdata.getWholeText());
+				_list.add((Serializable) value);
+			}
+		}
+	}
+
+	private void tableFromXml(Element elem)
+	{
+		NodeList named = elem.getElementsByTagName(NAMED_TAG);
+		for (int i1 = 0; i1 < named.getLength(); i1++)
+		{
+			Node oCurr = named.item(i1);
+			if (oCurr instanceof Element)
+			{
+				CDATASection cdata = (CDATASection) oCurr.getFirstChild();
+				String name = ((Element) oCurr).getAttribute(NAME_ATTR);
+				Object value = Base64.decodeToObject(cdata.getWholeText());
+				_table.put(name, (Serializable) value);
+			}
+		}
+	}
+
+	@Override
+	public boolean equals(Object arg)
+	{
+		if (! (arg instanceof Attachment))
+			return false;
+		Attachment other = (Attachment)arg;
+
+		if (other.getNamedCount() != _table.size())
+			return false;
+		for(Map.Entry<String,Serializable>oCurr : _table.entrySet())
+		{	
+			Object val = other.get(oCurr.getKey());
+			if (null==oCurr.getValue())
+				if (null==val)
+					continue;
+				else
+					return false;
+			if (!oCurr.getValue().equals(val))
+				return false;
+		}
+
+		if (other.getUnnamedCount() != _list.size())
+			return false;
+		int index = 0;
+		for (Serializable oCurr : _list)
+		{
+			Object val = other.itemAt(index++);
+			if (null==oCurr)
+				if (null==val)
+					continue;
+				else
+					return false;
+			if (!oCurr.equals(val))
+				return false;
+		}
+		return true;		
+	}
+
+	ArrayList<Serializable> _list = new ArrayList<Serializable>();
+	Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,327 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.xml;
-
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Set;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.internal.soa.esb.message.format.xml.marshal.MarshalUnmarshalManager;
-import org.jboss.internal.soa.esb.thirdparty.Base64;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.util.Util;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/*
- * A Body implementation that serializes to XML.
- */
-
-public class BodyImpl implements Body
-{
-    public static final String BODY_TAG = "Body";
-
-    public static final String BYTES_TAG = "Bytes";
-
-    public static final String CONTENT_TAG = "Content";
-
-    public static final String KEY_TAG = "Key";
-
-    public static final String VALUE_TAG = "Value";
-
-    public BodyImpl()
-    {
-	_content = null;
-	_objects = new Hashtable<String, Object>();
-    }
-
-    public void add (Object value)
-    {
-	add(Body.DEFAULT_LOCATION, value);
-    }
-
-    public void add (String name, Object value)
-    {
-	AssertArgument.isNotNull(value, "value");
-	AssertArgument.isNotNull(name, "name");
-
-	synchronized (_objects)
-	{
-	    _objects.put(name, value);
-	}
-    }
-
-    public Object get ()
-    {
-	return get(Body.DEFAULT_LOCATION);
-    }
-
-    public Object get (String name)
-    {
-	AssertArgument.isNotNull(name, "name");
-	
-	synchronized (_objects)
-	{
-	    return _objects.get(name);
-	}
-    }
-
-    public String[] getNames ()
-    {
-	Set<String> keys = _objects.keySet();
-
-	if (keys != null)
-	{
-	    String[] toReturn = new String[keys.size()];
-
-	    return keys.toArray(toReturn);
-	}
-	else
-	    return null;
-    }
-
-    public Object remove (String name)
-    {
-	synchronized (_objects)
-	{
-	    return _objects.remove(name);
-	}
-    }
-
-    public Element toXML (Element envelope) throws MarshalException
-    {
-	Document doc = envelope.getOwnerDocument();
-	Element bodyElement = doc.createElement(BODY_TAG);
-
-	envelope.appendChild(bodyElement);
-
-	if (_content != null)
-	{
-	    Element byteElement = doc.createElement(BYTES_TAG);
-
-	    byteElement.appendChild(doc.createCDATASection(Base64
-		    .encodeBytes(_content)));
-
-	    bodyElement.appendChild(byteElement);
-	}
-
-	/*
-         * This would normally be handled by an external adapter.
-         */
-
-	Enumeration<String> keys = _objects.keys();
-
-	while (keys.hasMoreElements())
-	{
-	    String key = keys.nextElement();
-	    Object value = _objects.get(key);
-
-	    Element objElement = doc.createElement(CONTENT_TAG);
-	    Element keyElement = doc.createElement(KEY_TAG);
-	    Element valueElement = doc.createElement(VALUE_TAG);
-
-	    keyElement.appendChild(doc.createCDATASection(Base64
-		    .encodeBytes(key.getBytes())));
-
-	    objElement.appendChild(keyElement);
-	    objElement.appendChild(valueElement);
-
-	    if (MarshalUnmarshalManager.getInstance().marshal(valueElement,
-		    value))
-	    {
-		bodyElement.appendChild(objElement);
-	    }
-	    else
-		throw new MarshalException("Cannot pack object " + key);
-	}
-
-	return bodyElement;
-    }
-
-    public void fromXML (Element envelope) throws UnmarshalException
-    {
-	NodeList nl = envelope.getChildNodes();
-
-	for (int i = 0; i < nl.getLength(); i++)
-	{
-	    /*
-                 * TODO
-                 * 
-                 * In the past, bugs in certain Dom implementations mean that
-                 * getElementsByName did not always work. Still the case? Plus
-                 * this way is quicker.
-                 */
-
-	    if (nl.item(i).getNodeName().equals(BODY_TAG))
-	    {
-		NodeList children = nl.item(i).getChildNodes();
-
-		for (int j = 0; j < children.getLength(); j++)
-		{
-		    Object xxx = children.item(j);
-
-		    if (!(xxx instanceof Element))
-			continue;
-
-		    Element node = (Element) xxx;
-
-		    if (node.getNodeName().equals(BYTES_TAG))
-		    {
-			CDATASection cdata = (CDATASection) node
-				.getFirstChild();
-
-			// support empty byte (null files etc.)
-
-			if (cdata != null)
-			    _content = Base64.decode(cdata.getWholeText());
-			else
-			    _content = new byte[0];
-		    }
-		    else
-		    {
-			if (node.getNodeName().equals(CONTENT_TAG))
-			{
-			    final NodeList childList = node.getChildNodes();
-
-			    String key = null;
-			    Object value = null;
-
-			    for (int k = 0; k < childList.getLength(); k++)
-			    {
-				if (childList.item(k).getNodeName().equals(
-					VALUE_TAG))
-				    value = MarshalUnmarshalManager
-					    .getInstance()
-					    .unmarshal(
-						    (Element) childList.item(k));
-
-				if (childList.item(k).getNodeName().equals(
-					KEY_TAG))
-				{
-				    CDATASection cdata = (CDATASection) childList
-					    .item(k).getFirstChild();
-
-				    key = new String(Base64.decode(cdata
-					    .getWholeText()));
-				}
-			    }
-
-			    if (value == null)
-				throw new UnmarshalException(
-					"Cannot unpack object "
-						+ node.getNodeName());
-			    else
-				_objects.put(key, value);
-			}
-		    }
-		}
-	    }
-	}
-    }
-
-    public void setByteArray (byte[] content)
-    {
-	_content = content;
-    }
-
-    public byte[] getByteArray ()
-    {
-	return _content;
-    }
-
-    public void setContents (byte[] content)
-    {
-	setByteArray(content);
-    }
-
-    public byte[] getContents ()
-    {
-	return getByteArray();
-    }
-
-    public void replace (Body b)
-    {
-	if (b == null)
-	    throw new IllegalArgumentException();
-
-	setByteArray(b.getByteArray());
-
-	_objects = ((BodyImpl) b)._objects;
-    }
-
-    public void merge (Body b)
-    {
-	if (b == null)
-	    throw new IllegalArgumentException();
-
-	byte[] toAdd = b.getByteArray();
-
-	if ((toAdd != null) && (toAdd.length > 0))
-	{
-	    if ((_content == null) || (_content.length == 0))
-	    {
-		_content = toAdd;
-	    }
-	    else
-	    {
-		int newSize = _content.length + toAdd.length;
-		byte[] buffer = new byte[newSize];
-
-		System.arraycopy(_content, 0, buffer, 0, _content.length);
-		System.arraycopy(toAdd, 0, buffer, _content.length,
-			toAdd.length);
-
-		_content = buffer;
-	    }
-	}
-
-	_objects.putAll(((BodyImpl) b)._objects);
-    }
-
-    public String toString ()
-    {
-	String toReturn = "body: [ ";
-
-	if (_content != null)
-	    toReturn += "byte[]: " + Util.format(new String(_content));
-
-	if (_objects != null)
-	{
-	    if (_content != null)
-		toReturn += ", ";
-
-	    toReturn += "objects: " + _objects.toString();
-	}
-
-	return toReturn + " ]";
-    }
-
-    private byte[] _content;
-
-    private Hashtable<String, Object> _objects;
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,327 @@
+package org.jboss.internal.soa.esb.message.format.xml;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Set;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.internal.soa.esb.message.format.xml.marshal.MarshalUnmarshalManager;
+import org.jboss.internal.soa.esb.thirdparty.Base64;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.util.Util;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/*
+ * A Body implementation that serializes to XML.
+ */
+
+public class BodyImpl implements Body
+{
+    public static final String BODY_TAG = "Body";
+
+    public static final String BYTES_TAG = "Bytes";
+
+    public static final String CONTENT_TAG = "Content";
+
+    public static final String KEY_TAG = "Key";
+
+    public static final String VALUE_TAG = "Value";
+
+    public BodyImpl()
+    {
+	_content = null;
+	_objects = new Hashtable<String, Object>();
+    }
+
+    public void add (Object value)
+    {
+	add(Body.DEFAULT_LOCATION, value);
+    }
+
+    public void add (String name, Object value)
+    {
+	AssertArgument.isNotNull(value, "value");
+	AssertArgument.isNotNull(name, "name");
+
+	synchronized (_objects)
+	{
+	    _objects.put(name, value);
+	}
+    }
+
+    public Object get ()
+    {
+	return get(Body.DEFAULT_LOCATION);
+    }
+
+    public Object get (String name)
+    {
+	AssertArgument.isNotNull(name, "name");
+	
+	synchronized (_objects)
+	{
+	    return _objects.get(name);
+	}
+    }
+
+    public String[] getNames ()
+    {
+	Set<String> keys = _objects.keySet();
+
+	if (keys != null)
+	{
+	    String[] toReturn = new String[keys.size()];
+
+	    return keys.toArray(toReturn);
+	}
+	else
+	    return null;
+    }
+
+    public Object remove (String name)
+    {
+	synchronized (_objects)
+	{
+	    return _objects.remove(name);
+	}
+    }
+
+    public Element toXML (Element envelope) throws MarshalException
+    {
+	Document doc = envelope.getOwnerDocument();
+	Element bodyElement = doc.createElement(BODY_TAG);
+
+	envelope.appendChild(bodyElement);
+
+	if (_content != null)
+	{
+	    Element byteElement = doc.createElement(BYTES_TAG);
+
+	    byteElement.appendChild(doc.createCDATASection(Base64
+		    .encodeBytes(_content)));
+
+	    bodyElement.appendChild(byteElement);
+	}
+
+	/*
+         * This would normally be handled by an external adapter.
+         */
+
+	Enumeration<String> keys = _objects.keys();
+
+	while (keys.hasMoreElements())
+	{
+	    String key = keys.nextElement();
+	    Object value = _objects.get(key);
+
+	    Element objElement = doc.createElement(CONTENT_TAG);
+	    Element keyElement = doc.createElement(KEY_TAG);
+	    Element valueElement = doc.createElement(VALUE_TAG);
+
+	    keyElement.appendChild(doc.createCDATASection(Base64
+		    .encodeBytes(key.getBytes())));
+
+	    objElement.appendChild(keyElement);
+	    objElement.appendChild(valueElement);
+
+	    if (MarshalUnmarshalManager.getInstance().marshal(valueElement,
+		    value))
+	    {
+		bodyElement.appendChild(objElement);
+	    }
+	    else
+		throw new MarshalException("Cannot pack object " + key);
+	}
+
+	return bodyElement;
+    }
+
+    public void fromXML (Element envelope) throws UnmarshalException
+    {
+	NodeList nl = envelope.getChildNodes();
+
+	for (int i = 0; i < nl.getLength(); i++)
+	{
+	    /*
+                 * TODO
+                 * 
+                 * In the past, bugs in certain Dom implementations mean that
+                 * getElementsByName did not always work. Still the case? Plus
+                 * this way is quicker.
+                 */
+
+	    if (nl.item(i).getNodeName().equals(BODY_TAG))
+	    {
+		NodeList children = nl.item(i).getChildNodes();
+
+		for (int j = 0; j < children.getLength(); j++)
+		{
+		    Object xxx = children.item(j);
+
+		    if (!(xxx instanceof Element))
+			continue;
+
+		    Element node = (Element) xxx;
+
+		    if (node.getNodeName().equals(BYTES_TAG))
+		    {
+			CDATASection cdata = (CDATASection) node
+				.getFirstChild();
+
+			// support empty byte (null files etc.)
+
+			if (cdata != null)
+			    _content = Base64.decode(cdata.getWholeText());
+			else
+			    _content = new byte[0];
+		    }
+		    else
+		    {
+			if (node.getNodeName().equals(CONTENT_TAG))
+			{
+			    final NodeList childList = node.getChildNodes();
+
+			    String key = null;
+			    Object value = null;
+
+			    for (int k = 0; k < childList.getLength(); k++)
+			    {
+				if (childList.item(k).getNodeName().equals(
+					VALUE_TAG))
+				    value = MarshalUnmarshalManager
+					    .getInstance()
+					    .unmarshal(
+						    (Element) childList.item(k));
+
+				if (childList.item(k).getNodeName().equals(
+					KEY_TAG))
+				{
+				    CDATASection cdata = (CDATASection) childList
+					    .item(k).getFirstChild();
+
+				    key = new String(Base64.decode(cdata
+					    .getWholeText()));
+				}
+			    }
+
+			    if (value == null)
+				throw new UnmarshalException(
+					"Cannot unpack object "
+						+ node.getNodeName());
+			    else
+				_objects.put(key, value);
+			}
+		    }
+		}
+	    }
+	}
+    }
+
+    public void setByteArray (byte[] content)
+    {
+	_content = content;
+    }
+
+    public byte[] getByteArray ()
+    {
+	return _content;
+    }
+
+    public void setContents (byte[] content)
+    {
+	setByteArray(content);
+    }
+
+    public byte[] getContents ()
+    {
+	return getByteArray();
+    }
+
+    public void replace (Body b)
+    {
+	if (b == null)
+	    throw new IllegalArgumentException();
+
+	setByteArray(b.getByteArray());
+
+	_objects = ((BodyImpl) b)._objects;
+    }
+
+    public void merge (Body b)
+    {
+	if (b == null)
+	    throw new IllegalArgumentException();
+
+	byte[] toAdd = b.getByteArray();
+
+	if ((toAdd != null) && (toAdd.length > 0))
+	{
+	    if ((_content == null) || (_content.length == 0))
+	    {
+		_content = toAdd;
+	    }
+	    else
+	    {
+		int newSize = _content.length + toAdd.length;
+		byte[] buffer = new byte[newSize];
+
+		System.arraycopy(_content, 0, buffer, 0, _content.length);
+		System.arraycopy(toAdd, 0, buffer, _content.length,
+			toAdd.length);
+
+		_content = buffer;
+	    }
+	}
+
+	_objects.putAll(((BodyImpl) b)._objects);
+    }
+
+    public String toString ()
+    {
+	String toReturn = "body: [ ";
+
+	if (_content != null)
+	    toReturn += "byte[]: " + Util.format(new String(_content));
+
+	if (_objects != null)
+	{
+	    if (_content != null)
+		toReturn += ", ";
+
+	    toReturn += "objects: " + _objects.toString();
+	}
+
+	return toReturn + " ]";
+    }
+
+    private byte[] _content;
+
+    private Hashtable<String, Object> _objects;
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,52 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.xml;
-
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.message.Context;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-public class ContextImpl implements Context
-{
-    public static final String CONTEXT_TAG = "Context";
-    
-	public String toString ()
-	{
-		return "context: [ null ]";
-	}
-	
-	public Element toXML (Element envelope) throws MarshalException
-	{
-		Document doc = envelope.getOwnerDocument();
-		Element contextElement = doc.createElement(CONTEXT_TAG);
-		
-		envelope.appendChild(contextElement);
-		
-		return contextElement;
-	}
-	
-	public void fromXML (Element envelope) throws UnmarshalException
-	{
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,52 @@
+package org.jboss.internal.soa.esb.message.format.xml;
+
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.message.Context;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+public class ContextImpl implements Context
+{
+    public static final String CONTEXT_TAG = "Context";
+    
+	public String toString ()
+	{
+		return "context: [ null ]";
+	}
+	
+	public Element toXML (Element envelope) throws MarshalException
+	{
+		Document doc = envelope.getOwnerDocument();
+		Element contextElement = doc.createElement(CONTEXT_TAG);
+		
+		envelope.appendChild(contextElement);
+		
+		return contextElement;
+	}
+	
+	public void fromXML (Element envelope) throws UnmarshalException
+	{
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,146 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.xml;
-
-import java.net.URI;
-
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.message.Fault;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.w3c.dom.Text;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-public class FaultImpl implements Fault
-{
-	public static final String FAULT_TAG = "Fault";
-
-	public static final String CODE_TAG = "Code";
-
-	public static final String REASON_TAG = "Reason";
-
-	public URI getCode()
-	{
-		return _code;
-	}
-
-	public void setCode(URI code)
-	{
-		_code = code;
-	}
-
-	public String getReason()
-	{
-		return _reason;
-	}
-
-	public void setReason(String reason)
-	{
-		_reason = reason;
-	}
-
-	public String toString ()
-	{
-		return "fault: [ "+((_code != null) ? _code : "null")+", "+((_reason != null) ? _reason : "null")+" ]";
-	}
-	
-	public Element toXML(Element envelope) throws MarshalException
-	{
-		Document doc = envelope.getOwnerDocument();
-		Element faultElement = doc.createElement(FAULT_TAG);
-
-		if (_code != null)
-		{
-			Element codeElement = doc.createElement(CODE_TAG);
-			Text content = doc.createTextNode(_code.toString());
-			
-			codeElement.appendChild(content);
-			
-			faultElement.appendChild(codeElement);
-		}
-
-		if (_reason != null)
-		{
-			Element reasonElement = doc.createElement(REASON_TAG);
-			Text content = doc.createTextNode(_reason);
-			
-			reasonElement.appendChild(content);
-
-			faultElement.appendChild(reasonElement);
-		}
-
-		if ((_code != null) || (_reason != null))
-		{
-			envelope.appendChild(faultElement);
-			
-			return faultElement;
-		}
-		else
-			return envelope;
-	}
-
-	public void fromXML (Element envelope) throws UnmarshalException
-	{
-		NodeList nl = envelope.getChildNodes();
-
-		_code = null;
-		_reason = null;
-		
-		for (int i = 0; i < nl.getLength(); i++)
-		{
-			if (nl.item(i).getNodeName().equals(FAULT_TAG))
-			{
-				NodeList children = nl.item(i).getChildNodes();
-
-				for (int j = 0; j < children.getLength(); j++)
-				{
-                                        final Node node = children.item(j) ;
-                                        if (node instanceof Element)
-                                        {
-        					Element child = (Element)node;
-        
-        					if (child.getNodeName().equals(CODE_TAG))
-        					{
-        						try
-        						{
-        							_code = new URI(child.getFirstChild().getNodeValue());
-        						}
-        						catch (Exception ex)
-        						{
-        							ex.printStackTrace();
-        						}
-        					}
-        
-        					if (child.getNodeName().equals(REASON_TAG))
-        						_reason = child.getFirstChild().getNodeValue();
-                                        }
-				}
-			}
-		}
-	}
-
-	private URI _code = null;
-	private String _reason = null;
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,146 @@
+package org.jboss.internal.soa.esb.message.format.xml;
+
+import java.net.URI;
+
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.message.Fault;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.w3c.dom.Text;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+public class FaultImpl implements Fault
+{
+	public static final String FAULT_TAG = "Fault";
+
+	public static final String CODE_TAG = "Code";
+
+	public static final String REASON_TAG = "Reason";
+
+	public URI getCode()
+	{
+		return _code;
+	}
+
+	public void setCode(URI code)
+	{
+		_code = code;
+	}
+
+	public String getReason()
+	{
+		return _reason;
+	}
+
+	public void setReason(String reason)
+	{
+		_reason = reason;
+	}
+
+	public String toString ()
+	{
+		return "fault: [ "+((_code != null) ? _code : "null")+", "+((_reason != null) ? _reason : "null")+" ]";
+	}
+	
+	public Element toXML(Element envelope) throws MarshalException
+	{
+		Document doc = envelope.getOwnerDocument();
+		Element faultElement = doc.createElement(FAULT_TAG);
+
+		if (_code != null)
+		{
+			Element codeElement = doc.createElement(CODE_TAG);
+			Text content = doc.createTextNode(_code.toString());
+			
+			codeElement.appendChild(content);
+			
+			faultElement.appendChild(codeElement);
+		}
+
+		if (_reason != null)
+		{
+			Element reasonElement = doc.createElement(REASON_TAG);
+			Text content = doc.createTextNode(_reason);
+			
+			reasonElement.appendChild(content);
+
+			faultElement.appendChild(reasonElement);
+		}
+
+		if ((_code != null) || (_reason != null))
+		{
+			envelope.appendChild(faultElement);
+			
+			return faultElement;
+		}
+		else
+			return envelope;
+	}
+
+	public void fromXML (Element envelope) throws UnmarshalException
+	{
+		NodeList nl = envelope.getChildNodes();
+
+		_code = null;
+		_reason = null;
+		
+		for (int i = 0; i < nl.getLength(); i++)
+		{
+			if (nl.item(i).getNodeName().equals(FAULT_TAG))
+			{
+				NodeList children = nl.item(i).getChildNodes();
+
+				for (int j = 0; j < children.getLength(); j++)
+				{
+                                        final Node node = children.item(j) ;
+                                        if (node instanceof Element)
+                                        {
+        					Element child = (Element)node;
+        
+        					if (child.getNodeName().equals(CODE_TAG))
+        					{
+        						try
+        						{
+        							_code = new URI(child.getFirstChild().getNodeValue());
+        						}
+        						catch (Exception ex)
+        						{
+        							ex.printStackTrace();
+        						}
+        					}
+        
+        					if (child.getNodeName().equals(REASON_TAG))
+        						_reason = child.getFirstChild().getNodeValue();
+                                        }
+				}
+			}
+		}
+	}
+
+	private URI _code = null;
+	private String _reason = null;
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,111 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.xml;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-import org.jboss.internal.soa.esb.addressing.helpers.CallHelper;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.message.Header;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/**
- * The message header. Contains such things as routing information.
- */
-
-public class HeaderImpl implements Header
-{
-    public static final String HEADER_TAG = "Header";
-    
-	public HeaderImpl ()
-	{
-		_call = new Call();
-	}
-	
-	// TODO add other setters/getters for artibitrary attributes
-	
-	public Call getCall ()
-	{
-		return _call;
-	}
-	
-	public void setCall (Call call)
-	{
-		if (call == null)
-			throw new IllegalArgumentException();
-		
-		_call = call;
-	}
-	
-	public String toString ()
-	{
-		if (_call != null)
-			return "header: [ "+_call.toString()+" ]";
-		else
-			return "header: [ null ]";
-	}
-	
-	public Element toXML (Element envelope) throws MarshalException
-	{
-		Document doc = envelope.getOwnerDocument();
-		
-		// TODO remove MAGIC strings!!
-		
-		Element headerElement = doc.createElement(HEADER_TAG);
-		
-		envelope.appendChild(headerElement);
-		
-		if (_call != null)
-			return CallHelper.toXML(_call, doc, headerElement);
-		else
-			return headerElement;
-	}
-	
-	public void fromXML (Element envelope) throws UnmarshalException
-	{
-		_call = new Call();
-		
-		NodeList nl = envelope.getChildNodes();
-		Element headerElement = null;
-		
-		for (int i = 0; i < nl.getLength(); i++)
-		{
-			Node n = nl.item(i);
-			
-			if (n.getNodeName().equals(HEADER_TAG))
-			{
-				headerElement = (Element) n;
-				break;
-			}
-		}
-		
-		// TODO error handling!!
-		
-		if (headerElement != null)
-			_call = CallHelper.fromXML(headerElement);
-	}
-	
-	private Call _call;
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,111 @@
+package org.jboss.internal.soa.esb.message.format.xml;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+import org.jboss.internal.soa.esb.addressing.helpers.CallHelper;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.message.Header;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/**
+ * The message header. Contains such things as routing information.
+ */
+
+public class HeaderImpl implements Header
+{
+    public static final String HEADER_TAG = "Header";
+    
+	public HeaderImpl ()
+	{
+		_call = new Call();
+	}
+	
+	// TODO add other setters/getters for artibitrary attributes
+	
+	public Call getCall ()
+	{
+		return _call;
+	}
+	
+	public void setCall (Call call)
+	{
+		if (call == null)
+			throw new IllegalArgumentException();
+		
+		_call = call;
+	}
+	
+	public String toString ()
+	{
+		if (_call != null)
+			return "header: [ "+_call.toString()+" ]";
+		else
+			return "header: [ null ]";
+	}
+	
+	public Element toXML (Element envelope) throws MarshalException
+	{
+		Document doc = envelope.getOwnerDocument();
+		
+		// TODO remove MAGIC strings!!
+		
+		Element headerElement = doc.createElement(HEADER_TAG);
+		
+		envelope.appendChild(headerElement);
+		
+		if (_call != null)
+			return CallHelper.toXML(_call, doc, headerElement);
+		else
+			return headerElement;
+	}
+	
+	public void fromXML (Element envelope) throws UnmarshalException
+	{
+		_call = new Call();
+		
+		NodeList nl = envelope.getChildNodes();
+		Element headerElement = null;
+		
+		for (int i = 0; i < nl.getLength(); i++)
+		{
+			Node n = nl.item(i);
+			
+			if (n.getNodeName().equals(HEADER_TAG))
+			{
+				headerElement = (Element) n;
+				break;
+			}
+		}
+		
+		// TODO error handling!!
+		
+		if (headerElement != null)
+			_call = CallHelper.fromXML(headerElement);
+	}
+	
+	private Call _call;
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,222 +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 mark.little at jboss.com
- */
-package org.jboss.internal.soa.esb.message.format.xml;
-
-import java.io.Serializable;
-import java.net.URI;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.message.Attachment;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Context;
-import org.jboss.soa.esb.message.Fault;
-import org.jboss.soa.esb.message.Header;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.Properties;
-import org.jboss.soa.esb.message.format.MessageType;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-
-/**
- * This is the basic internal core message abstraction. A message consists of the following
- * components:
- * 
- * Header: the header information contains information such as the destination EPR, the
- * sender EPR, where the reply goes etc, i.e., general message-level functional information.
- * Context: additional information to contextualise the message; for example, transaction or
- * security data, the identity of the ultimate receiver, or HTTP-cookie like information.
- * Body: the actual payload of the message.
- * Fault: any fault information associated with the message.
- * Attachment: any attachments associated with the message.
- * Properties: any properties associated with the message.
- * 
- * Each message, once created, has a corresponding element for these 5 components. That element
- * may be empty (<b>NOT NULL</b>). The object representing the element can then be used to act
- * on the corresponding data item in the message.
- * 
- * @author Mark Little
- *
- */
-
-public class MessageImpl implements Message, Serializable
-{
-    private static final long serialVersionUID = 0x0;
-    
-    public static final String ENVELOPE_TAG = "Envelope";
-    
-	/**
-	 * @return get the header component of the message.
-	 */
-	
-	public Header getHeader ()
-	{
-		return _theHeader;
-	}
-	
-	/**
-	 * @return get the context component of the message.
-	 */
-	
-	public Context getContext ()
-	{
-		return _theContext;
-	}
-	
-	/**
-	 * @return get the body component of the message.
-	 */
-	
-	public Body getBody ()
-	{
-		return _theBody;
-	}
-	
-	/**
-	 * @return get any faults associated with the message. These should not
-	 * be application level faults, but comms level.
-	 */
-	
-	public Fault getFault ()
-	{
-		return _theFault;
-	}
-	
-	/**
-	 * @return get any message attachments.
-	 */
-	
-	public Attachment getAttachment ()
-	{
-		return _theAttachment;
-	}
-	
-	/**
-	 * @return the type of this message format.
-	 */
-	
-	public URI getType ()
-	{
-		return MessageType.JBOSS_XML;
-	}
-	/**
-	 * getProperties()
-	 * @return org.jboss.soa.esb.message.Properties - any message properties.
-	 */
-	public Properties getProperties() 
-	{
-		return _theProperties;
-	}
-	
-	public String toString ()
-	{
-		return "message: [ JBOSS_XML ]\n[ "+_theHeader.toString()+"\n"+_theContext.toString()+"\n"+_theBody.toString()
-		+"\n"+_theFault.toString()+"\n"+_theAttachment.toString()+"\n"+_theProperties.toString()+" ]";
-	}
-	
-	// to/from XML here, rather than on individual elements
-	
-	public Document toXML (Document doc) throws MarshalException
-	{
-		try
-		{		
-			// TODO remove magic strings!
-			
-			Element envelope = doc.createElement(ENVELOPE_TAG);
-
-			doc.appendChild(envelope);
-			
-			_theHeader.toXML(envelope);
-			_theContext.toXML(envelope);
-			_theBody.toXML(envelope);
-			_theFault.toXML(envelope);
-			_theAttachment.toXML(envelope);
-			_theProperties.toXML(envelope);
-			
-			return doc;
-		}
-		catch (MarshalException ex)
-		{
-			throw ex;
-		}
-		catch (Exception ex)
-		{
-		    LOGGER.warn("MessageImpl.toXML caught unexpected exception:", ex);
-			
-			throw new MarshalException(ex);
-		}
-	}
-	
-	public void fromXML (Document doc) throws UnmarshalException
-	{
-		try
-		{
-			NodeList nl = doc.getChildNodes();
-			Element envelope = null;
-			
-			for (int i = 0; i < nl.getLength(); i++)
-			{
-				Node n = nl.item(i);
-				
-				if (n.getNodeName().equals(ENVELOPE_TAG))
-				{
-					envelope = (Element) n;
-					break;
-				}
-			}
-
-			_theHeader.fromXML(envelope);
-			_theContext.fromXML(envelope);
-			_theBody.fromXML(envelope);
-			_theFault.fromXML(envelope);
-			_theAttachment.fromXML(envelope);
-			_theProperties.fromXML(envelope);
-		}
-		catch (UnmarshalException ex)
-		{
-			throw ex;
-		}
-		catch (Exception ex)
-		{
-		    LOGGER.warn("MessageImpl.fromXML caught unexpected exception:", ex);
-			
-			throw new UnmarshalException(ex);
-		}
-	}
-	
-	// TODO add equality operator(s)
-	
-	private HeaderImpl _theHeader = new HeaderImpl();
-	private ContextImpl _theContext = new ContextImpl();
-	private BodyImpl _theBody = new BodyImpl();
-	private FaultImpl _theFault = new FaultImpl();
-	private AttachmentImpl _theAttachment = new AttachmentImpl();
-	private PropertiesImpl _theProperties = new PropertiesImpl();
-	
-	/**
-	 * The logger for this class.
-	 */
-	private static final Logger LOGGER = Logger.getLogger(MessageImpl.class);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,222 @@
+/*
+ * 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 mark.little at jboss.com
+ */
+package org.jboss.internal.soa.esb.message.format.xml;
+
+import java.io.Serializable;
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.message.Attachment;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Context;
+import org.jboss.soa.esb.message.Fault;
+import org.jboss.soa.esb.message.Header;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.Properties;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+
+/**
+ * This is the basic internal core message abstraction. A message consists of the following
+ * components:
+ * 
+ * Header: the header information contains information such as the destination EPR, the
+ * sender EPR, where the reply goes etc, i.e., general message-level functional information.
+ * Context: additional information to contextualise the message; for example, transaction or
+ * security data, the identity of the ultimate receiver, or HTTP-cookie like information.
+ * Body: the actual payload of the message.
+ * Fault: any fault information associated with the message.
+ * Attachment: any attachments associated with the message.
+ * Properties: any properties associated with the message.
+ * 
+ * Each message, once created, has a corresponding element for these 5 components. That element
+ * may be empty (<b>NOT NULL</b>). The object representing the element can then be used to act
+ * on the corresponding data item in the message.
+ * 
+ * @author Mark Little
+ *
+ */
+
+public class MessageImpl implements Message, Serializable
+{
+    private static final long serialVersionUID = 0x0;
+    
+    public static final String ENVELOPE_TAG = "Envelope";
+    
+	/**
+	 * @return get the header component of the message.
+	 */
+	
+	public Header getHeader ()
+	{
+		return _theHeader;
+	}
+	
+	/**
+	 * @return get the context component of the message.
+	 */
+	
+	public Context getContext ()
+	{
+		return _theContext;
+	}
+	
+	/**
+	 * @return get the body component of the message.
+	 */
+	
+	public Body getBody ()
+	{
+		return _theBody;
+	}
+	
+	/**
+	 * @return get any faults associated with the message. These should not
+	 * be application level faults, but comms level.
+	 */
+	
+	public Fault getFault ()
+	{
+		return _theFault;
+	}
+	
+	/**
+	 * @return get any message attachments.
+	 */
+	
+	public Attachment getAttachment ()
+	{
+		return _theAttachment;
+	}
+	
+	/**
+	 * @return the type of this message format.
+	 */
+	
+	public URI getType ()
+	{
+		return MessageType.JBOSS_XML;
+	}
+	/**
+	 * getProperties()
+	 * @return org.jboss.soa.esb.message.Properties - any message properties.
+	 */
+	public Properties getProperties() 
+	{
+		return _theProperties;
+	}
+	
+	public String toString ()
+	{
+		return "message: [ JBOSS_XML ]\n[ "+_theHeader.toString()+"\n"+_theContext.toString()+"\n"+_theBody.toString()
+		+"\n"+_theFault.toString()+"\n"+_theAttachment.toString()+"\n"+_theProperties.toString()+" ]";
+	}
+	
+	// to/from XML here, rather than on individual elements
+	
+	public Document toXML (Document doc) throws MarshalException
+	{
+		try
+		{		
+			// TODO remove magic strings!
+			
+			Element envelope = doc.createElement(ENVELOPE_TAG);
+
+			doc.appendChild(envelope);
+			
+			_theHeader.toXML(envelope);
+			_theContext.toXML(envelope);
+			_theBody.toXML(envelope);
+			_theFault.toXML(envelope);
+			_theAttachment.toXML(envelope);
+			_theProperties.toXML(envelope);
+			
+			return doc;
+		}
+		catch (MarshalException ex)
+		{
+			throw ex;
+		}
+		catch (Exception ex)
+		{
+		    LOGGER.warn("MessageImpl.toXML caught unexpected exception:", ex);
+			
+			throw new MarshalException(ex);
+		}
+	}
+	
+	public void fromXML (Document doc) throws UnmarshalException
+	{
+		try
+		{
+			NodeList nl = doc.getChildNodes();
+			Element envelope = null;
+			
+			for (int i = 0; i < nl.getLength(); i++)
+			{
+				Node n = nl.item(i);
+				
+				if (n.getNodeName().equals(ENVELOPE_TAG))
+				{
+					envelope = (Element) n;
+					break;
+				}
+			}
+
+			_theHeader.fromXML(envelope);
+			_theContext.fromXML(envelope);
+			_theBody.fromXML(envelope);
+			_theFault.fromXML(envelope);
+			_theAttachment.fromXML(envelope);
+			_theProperties.fromXML(envelope);
+		}
+		catch (UnmarshalException ex)
+		{
+			throw ex;
+		}
+		catch (Exception ex)
+		{
+		    LOGGER.warn("MessageImpl.fromXML caught unexpected exception:", ex);
+			
+			throw new UnmarshalException(ex);
+		}
+	}
+	
+	// TODO add equality operator(s)
+	
+	private HeaderImpl _theHeader = new HeaderImpl();
+	private ContextImpl _theContext = new ContextImpl();
+	private BodyImpl _theBody = new BodyImpl();
+	private FaultImpl _theFault = new FaultImpl();
+	private AttachmentImpl _theAttachment = new AttachmentImpl();
+	private PropertiesImpl _theProperties = new PropertiesImpl();
+	
+	/**
+	 * The logger for this class.
+	 */
+	private static final Logger LOGGER = Logger.getLogger(MessageImpl.class);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,223 +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 schifest at heuristica.com.ar
- */
-package org.jboss.internal.soa.esb.message.format.xml;
-
-import java.io.Serializable;
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.internal.soa.esb.thirdparty.Base64;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.message.Properties;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-public class PropertiesImpl implements Properties
-{
-	public static final String PROPERTIES_TAG = "Properties";
-
-	public static final String PROPERTY_TAG = "Property";
-
-	public static final String KEY_TAG = "Key";
-
-	public static final String VALUE_TAG = "Value";
-
-	public Object getProperty(String name)
-	{
-		return _table.get(name);
-	}
-
-	public Object getProperty(String name, Object defaultVal)
-	{
-		Object oRet = getProperty(name);
-		return (null == oRet) ? defaultVal : oRet;
-	}
-
-	public Object setProperty(String name, Object value)
-	{
-        AssertArgument.isNotNull(name, "name");
-        AssertArgument.isNotNull(value, "value");
-
-        if (!(value instanceof Serializable)) {
-			throw new IllegalArgumentException("Value of property '" + name + "' must implement " + Serializable.class.getName() + ".  Value is of type " + value.getClass().getName());
-        }
-
-        return _table.put(name, (Serializable) value);
-    }
-
-	public Object remove(String name)
-	{
-		return _table.remove(name);
-	}
-
-	public int size()
-	{
-		return _table.size();
-	}
-
-	public String[] getNames()
-	{
-		return _table.keySet().toArray(new String[_table.size()]);
-	}
-
-	/**
-	 * toXML(elem) - Will build a child element with appropriate values and
-	 * append it to arg0
-	 * 
-	 * @param elem
-	 *            Element - where to add 'this' as a child node
-	 * @return Element - 'this' as the added Element, or &lt;null&gt; if no
-	 *         properties in table and nothing was appended to arg0
-	 */
-	public Element toXML(Element elem) throws MarshalException
-	{
-		if (_table.size() < 1)
-			return null;
-
-		Document doc = elem.getOwnerDocument();
-		Element thisElement = doc.createElement(PROPERTIES_TAG);
-
-		boolean bAdd = false;
-		for (Map.Entry<String, Serializable> oCurr : _table.entrySet())
-		{
-			Element oProp = doc.createElement(PROPERTY_TAG);
-			Element keyElement = doc.createElement(KEY_TAG);
-			Element valueElement = doc.createElement(VALUE_TAG);
-			
-			keyElement.appendChild(doc.createCDATASection(Base64.encodeBytes(oCurr.getKey().getBytes())));
-			oProp.appendChild(keyElement);
-		
-			valueElement.appendChild(doc.createCDATASection(Base64.encodeObject(oCurr.getValue())));
-			oProp.appendChild(valueElement);
-			
-			thisElement.appendChild(oProp);
-			bAdd = true;
-		}
-		if (bAdd)
-		{
-			elem.appendChild(thisElement);
-			return thisElement;
-		}
-		else
-			return null;
-	}
-
-	/**
-	 * fromXml(elem) - Populate properties found in appropriate child element
-	 * 
-	 * @see XMLUtil.PROPERTIES_TAG
-	 * @param elem -
-	 *            Element where to look for child nodes
-	 */
-	public void fromXML(Element elem) throws UnmarshalException
-	{
-		_table.clear();
-		
-		/*
-		 * There should be only one!
-		 */
-		
-		NodeList NL = elem.getElementsByTagName(PROPERTIES_TAG);
-
-		if (NL.getLength() > 1)
-			throw new UnmarshalException("More "+PROPERTIES_TAG+" than we expected!");
-		
-		if (NL.getLength() == 1)
-			NL = NL.item(0).getChildNodes();
-		
-		for (int i1 = 0; i1 < NL.getLength(); i1++)
-		{
-			Node oCurr = NL.item(i1);
-			
-			if (!(oCurr instanceof Element))
-				continue;
-
-			if (oCurr.getNodeName().equals(PROPERTY_TAG))
-			{
-				NodeList props = oCurr.getChildNodes();
-				String key = null;
-				Object value = null;
-				
-				for (int i2 = 0; i2 < props.getLength(); i2++)
-				{
-					Node oProp = props.item(i2);
-
-					if (oProp instanceof Element)
-					{
-						if (oProp.getNodeName().equals(VALUE_TAG))
-						{
-							CDATASection cdata = (CDATASection) oProp.getFirstChild();
-							value = Base64.decodeToObject(cdata.getWholeText());
-						}
-						else
-						{
-							if (oProp.getNodeName().equals(KEY_TAG))
-							{
-								CDATASection cdata = (CDATASection) oProp.getFirstChild();
-								key = new String(Base64.decode(cdata.getWholeText()));
-							}
-						}
-					}
-				}
-				
-				if ((key != null) && (value != null))
-					_table.put(key, (Serializable) value);
-				else
-					throw new UnmarshalException("Could not get tuple for "+oCurr.getNodeName());
-			}
-		}
-	}
-
-	public String toString()
-	{
-		return "properties: [ "+_table.toString()+" ]";
-	}
-
-	@Override
-	public boolean equals(Object arg)
-	{
-		if (!(arg instanceof Properties))
-			return false;
-		Properties other = (Properties) arg;
-		if (other.size() != _table.size())
-			return false;
-		for (Map.Entry<String, Serializable> oCurr : _table.entrySet())
-		{
-			Object val = other.getProperty(oCurr.getKey());
-			if (null == oCurr.getValue())
-				if (null == val)
-					continue;
-				else
-					return false;
-			if (!oCurr.getValue().equals(val))
-				return false;
-		}
-		return true;
-	}
-
-	Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/PropertiesImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,223 @@
+/*
+ * 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 schifest at heuristica.com.ar
+ */
+package org.jboss.internal.soa.esb.message.format.xml;
+
+import java.io.Serializable;
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.internal.soa.esb.thirdparty.Base64;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.message.Properties;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+public class PropertiesImpl implements Properties
+{
+	public static final String PROPERTIES_TAG = "Properties";
+
+	public static final String PROPERTY_TAG = "Property";
+
+	public static final String KEY_TAG = "Key";
+
+	public static final String VALUE_TAG = "Value";
+
+	public Object getProperty(String name)
+	{
+		return _table.get(name);
+	}
+
+	public Object getProperty(String name, Object defaultVal)
+	{
+		Object oRet = getProperty(name);
+		return (null == oRet) ? defaultVal : oRet;
+	}
+
+	public Object setProperty(String name, Object value)
+	{
+        AssertArgument.isNotNull(name, "name");
+        AssertArgument.isNotNull(value, "value");
+
+        if (!(value instanceof Serializable)) {
+			throw new IllegalArgumentException("Value of property '" + name + "' must implement " + Serializable.class.getName() + ".  Value is of type " + value.getClass().getName());
+        }
+
+        return _table.put(name, (Serializable) value);
+    }
+
+	public Object remove(String name)
+	{
+		return _table.remove(name);
+	}
+
+	public int size()
+	{
+		return _table.size();
+	}
+
+	public String[] getNames()
+	{
+		return _table.keySet().toArray(new String[_table.size()]);
+	}
+
+	/**
+	 * toXML(elem) - Will build a child element with appropriate values and
+	 * append it to arg0
+	 * 
+	 * @param elem
+	 *            Element - where to add 'this' as a child node
+	 * @return Element - 'this' as the added Element, or &lt;null&gt; if no
+	 *         properties in table and nothing was appended to arg0
+	 */
+	public Element toXML(Element elem) throws MarshalException
+	{
+		if (_table.size() < 1)
+			return null;
+
+		Document doc = elem.getOwnerDocument();
+		Element thisElement = doc.createElement(PROPERTIES_TAG);
+
+		boolean bAdd = false;
+		for (Map.Entry<String, Serializable> oCurr : _table.entrySet())
+		{
+			Element oProp = doc.createElement(PROPERTY_TAG);
+			Element keyElement = doc.createElement(KEY_TAG);
+			Element valueElement = doc.createElement(VALUE_TAG);
+			
+			keyElement.appendChild(doc.createCDATASection(Base64.encodeBytes(oCurr.getKey().getBytes())));
+			oProp.appendChild(keyElement);
+		
+			valueElement.appendChild(doc.createCDATASection(Base64.encodeObject(oCurr.getValue())));
+			oProp.appendChild(valueElement);
+			
+			thisElement.appendChild(oProp);
+			bAdd = true;
+		}
+		if (bAdd)
+		{
+			elem.appendChild(thisElement);
+			return thisElement;
+		}
+		else
+			return null;
+	}
+
+	/**
+	 * fromXml(elem) - Populate properties found in appropriate child element
+	 * 
+	 * @see XMLUtil.PROPERTIES_TAG
+	 * @param elem -
+	 *            Element where to look for child nodes
+	 */
+	public void fromXML(Element elem) throws UnmarshalException
+	{
+		_table.clear();
+		
+		/*
+		 * There should be only one!
+		 */
+		
+		NodeList NL = elem.getElementsByTagName(PROPERTIES_TAG);
+
+		if (NL.getLength() > 1)
+			throw new UnmarshalException("More "+PROPERTIES_TAG+" than we expected!");
+		
+		if (NL.getLength() == 1)
+			NL = NL.item(0).getChildNodes();
+		
+		for (int i1 = 0; i1 < NL.getLength(); i1++)
+		{
+			Node oCurr = NL.item(i1);
+			
+			if (!(oCurr instanceof Element))
+				continue;
+
+			if (oCurr.getNodeName().equals(PROPERTY_TAG))
+			{
+				NodeList props = oCurr.getChildNodes();
+				String key = null;
+				Object value = null;
+				
+				for (int i2 = 0; i2 < props.getLength(); i2++)
+				{
+					Node oProp = props.item(i2);
+
+					if (oProp instanceof Element)
+					{
+						if (oProp.getNodeName().equals(VALUE_TAG))
+						{
+							CDATASection cdata = (CDATASection) oProp.getFirstChild();
+							value = Base64.decodeToObject(cdata.getWholeText());
+						}
+						else
+						{
+							if (oProp.getNodeName().equals(KEY_TAG))
+							{
+								CDATASection cdata = (CDATASection) oProp.getFirstChild();
+								key = new String(Base64.decode(cdata.getWholeText()));
+							}
+						}
+					}
+				}
+				
+				if ((key != null) && (value != null))
+					_table.put(key, (Serializable) value);
+				else
+					throw new UnmarshalException("Could not get tuple for "+oCurr.getNodeName());
+			}
+		}
+	}
+
+	public String toString()
+	{
+		return "properties: [ "+_table.toString()+" ]";
+	}
+
+	@Override
+	public boolean equals(Object arg)
+	{
+		if (!(arg instanceof Properties))
+			return false;
+		Properties other = (Properties) arg;
+		if (other.size() != _table.size())
+			return false;
+		for (Map.Entry<String, Serializable> oCurr : _table.entrySet())
+		{
+			Object val = other.getProperty(oCurr.getKey());
+			if (null == oCurr.getValue())
+				if (null == val)
+					continue;
+				else
+					return false;
+			if (!oCurr.getValue().equals(val))
+				return false;
+		}
+		return true;
+	}
+
+	Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,48 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.xml;
-
-import java.net.URI;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessagePlugin;
-import org.jboss.soa.esb.message.format.MessageType;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Used to plug in new message formats dynamically.
- *  
- * @author Mark Little
- *
- */
-
-public class XMLMessagePlugin implements MessagePlugin
-{
-	public Message getMessage ()
-	{
-		return new MessageImpl();
-	}
-	
-	public URI getType ()
-	{
-		return MessageType.JBOSS_XML;
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,48 @@
+package org.jboss.internal.soa.esb.message.format.xml;
+
+import java.net.URI;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessagePlugin;
+import org.jboss.soa.esb.message.format.MessageType;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Used to plug in new message formats dynamically.
+ *  
+ * @author Mark Little
+ *
+ */
+
+public class XMLMessagePlugin implements MessagePlugin
+{
+	public Message getMessage ()
+	{
+		return new MessageImpl();
+	}
+	
+	public URI getType ()
+	{
+		return MessageType.JBOSS_XML;
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,34 +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 mark.little at jboss.com
- */
-
-/*
- * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
- *
- * XMLUtil.java
- */
-
-package org.jboss.internal.soa.esb.message.format.xml;
-
-public class XMLUtil
-{
-    public static final String ESB_PREFIX = "jbesb";
-    public static final String ESB_NAMESPACE_URI = "http://www.jboss.org/ws/2006/09/esb";
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,34 @@
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/*
+ * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
+ *
+ * XMLUtil.java
+ */
+
+package org.jboss.internal.soa.esb.message.format.xml;
+
+public class XMLUtil
+{
+    public static final String ESB_PREFIX = "jbesb";
+    public static final String ESB_NAMESPACE_URI = "http://www.jboss.org/ws/2006/09/esb";
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,162 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.xml.marshal;
-
-import java.net.URI;
-import java.util.Enumeration;
-import java.util.Hashtable;
-import java.util.Properties;
-
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.w3c.dom.Element;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Used to plug in new Object marshal/unmarshal formats dynamically. When packing
- * objects in XML, the system runs through the list of registered plug-ins until it
- * finds one that can deal with the object type (or faults). When packing, the name (type)
- * of the plug-in that packed the object is also attached to facilitate unpacking.
- *  
- * @author Mark Little
- *
- */
-
-public class MarshalUnmarshalManager
-{
-	public static MarshalUnmarshalManager getInstance ()
-	{
-		return _instance;
-	}
-	
-	private MarshalUnmarshalManager ()
-	{
-		/*
-		 * Go through the properties loaded from the property file. Anything
-		 * starting with MessagePlugin.MESSAGE_PLUGIN is assumed to be a plugin
-		 * that we load and add to the list.
-		 */
-		
-		Properties properties = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperties();
-		
-		if (properties != null)
-		{
-			Enumeration names = properties.propertyNames();
-
-			while (names.hasMoreElements())
-			{
-				String attrName = (String) names.nextElement();
-				
-				if (attrName.startsWith(MarshalUnmarshalPlugin.MARSHAL_UNMARSHAL_PLUGIN))
-				{
-					try
-					{
-						String pluginName = properties.getProperty(attrName);
-						Class c = ClassUtil.forName(pluginName, getClass());
-						MarshalUnmarshalPlugin thePlugin = (MarshalUnmarshalPlugin) c.newInstance();
-
-						_plugins.put(thePlugin.type(), thePlugin);
-					}
-					catch (ClassNotFoundException ex)
-					{
-						ex.printStackTrace();
-					}
-					catch (IllegalAccessException ex)
-					{
-						ex.printStackTrace();
-					}
-					catch (InstantiationException ex)
-					{
-						ex.printStackTrace();
-					}
-				}
-			}
-			
-			/*
-			 * Add in the default plugin.
-			 */
-			
-			SerializedMarshalUnmarshalPlugin defaultPlugin = new SerializedMarshalUnmarshalPlugin();
-			
-			_plugins.put(defaultPlugin.type(), defaultPlugin);
-		}
-	}
-	
-	/**
-	 * Pack the provided object into the document.
-	 * 
-	 * @param doc the XML document.
-	 * @param param the object to pack.
-	 * 
-	 * @return <code>true</code> if the object was packed, <code>false</code> otherwise.
-	 * @throws MarshalException thrown if there is a problem packing.
-	 */
-	
-	public boolean marshal (Element doc, Object param) throws MarshalException
-	{
-		if ((doc == null) || (param == null))
-			throw new IllegalArgumentException();
-		
-		Enumeration<URI> keys = _plugins.keys();
-		
-		while (keys.hasMoreElements())
-		{
-			if (_plugins.get(keys.nextElement()).marshal(doc, param))
-				return true;
-		}
-		
-		return false;
-	}
-	
-	/**
-	 * Unpack the object from the document.
-	 * 
-	 * @param doc the document.
-	 * 
-	 * @return the object, or <code>null</code> if this implementation cannot deal with the
-	 * format.
-	 * @throws UnmarshalException thrown if there is a problem unpacking.
-	 */
-	
-	public Object unmarshal (Element doc) throws UnmarshalException
-	{
-		if (doc == null)
-			throw new IllegalArgumentException();
-		
-		Enumeration<URI> keys = _plugins.keys();
-		
-		while (keys.hasMoreElements())
-		{
-			Object result = _plugins.get(keys.nextElement()).unmarshal(doc);
-			
-			if (result != null)
-				return result;
-		}
-		
-		return null;
-	}
-	
-	private Hashtable<URI,MarshalUnmarshalPlugin> _plugins = new Hashtable<URI,MarshalUnmarshalPlugin>();
-
-	private static final MarshalUnmarshalManager _instance = new MarshalUnmarshalManager();
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,162 @@
+package org.jboss.internal.soa.esb.message.format.xml.marshal;
+
+import java.net.URI;
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Properties;
+
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.w3c.dom.Element;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Used to plug in new Object marshal/unmarshal formats dynamically. When packing
+ * objects in XML, the system runs through the list of registered plug-ins until it
+ * finds one that can deal with the object type (or faults). When packing, the name (type)
+ * of the plug-in that packed the object is also attached to facilitate unpacking.
+ *  
+ * @author Mark Little
+ *
+ */
+
+public class MarshalUnmarshalManager
+{
+	public static MarshalUnmarshalManager getInstance ()
+	{
+		return _instance;
+	}
+	
+	private MarshalUnmarshalManager ()
+	{
+		/*
+		 * Go through the properties loaded from the property file. Anything
+		 * starting with MessagePlugin.MESSAGE_PLUGIN is assumed to be a plugin
+		 * that we load and add to the list.
+		 */
+		
+		Properties properties = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperties();
+		
+		if (properties != null)
+		{
+			Enumeration names = properties.propertyNames();
+
+			while (names.hasMoreElements())
+			{
+				String attrName = (String) names.nextElement();
+				
+				if (attrName.startsWith(MarshalUnmarshalPlugin.MARSHAL_UNMARSHAL_PLUGIN))
+				{
+					try
+					{
+						String pluginName = properties.getProperty(attrName);
+						Class c = ClassUtil.forName(pluginName, getClass());
+						MarshalUnmarshalPlugin thePlugin = (MarshalUnmarshalPlugin) c.newInstance();
+
+						_plugins.put(thePlugin.type(), thePlugin);
+					}
+					catch (ClassNotFoundException ex)
+					{
+						ex.printStackTrace();
+					}
+					catch (IllegalAccessException ex)
+					{
+						ex.printStackTrace();
+					}
+					catch (InstantiationException ex)
+					{
+						ex.printStackTrace();
+					}
+				}
+			}
+			
+			/*
+			 * Add in the default plugin.
+			 */
+			
+			SerializedMarshalUnmarshalPlugin defaultPlugin = new SerializedMarshalUnmarshalPlugin();
+			
+			_plugins.put(defaultPlugin.type(), defaultPlugin);
+		}
+	}
+	
+	/**
+	 * Pack the provided object into the document.
+	 * 
+	 * @param doc the XML document.
+	 * @param param the object to pack.
+	 * 
+	 * @return <code>true</code> if the object was packed, <code>false</code> otherwise.
+	 * @throws MarshalException thrown if there is a problem packing.
+	 */
+	
+	public boolean marshal (Element doc, Object param) throws MarshalException
+	{
+		if ((doc == null) || (param == null))
+			throw new IllegalArgumentException();
+		
+		Enumeration<URI> keys = _plugins.keys();
+		
+		while (keys.hasMoreElements())
+		{
+			if (_plugins.get(keys.nextElement()).marshal(doc, param))
+				return true;
+		}
+		
+		return false;
+	}
+	
+	/**
+	 * Unpack the object from the document.
+	 * 
+	 * @param doc the document.
+	 * 
+	 * @return the object, or <code>null</code> if this implementation cannot deal with the
+	 * format.
+	 * @throws UnmarshalException thrown if there is a problem unpacking.
+	 */
+	
+	public Object unmarshal (Element doc) throws UnmarshalException
+	{
+		if (doc == null)
+			throw new IllegalArgumentException();
+		
+		Enumeration<URI> keys = _plugins.keys();
+		
+		while (keys.hasMoreElements())
+		{
+			Object result = _plugins.get(keys.nextElement()).unmarshal(doc);
+			
+			if (result != null)
+				return result;
+		}
+		
+		return null;
+	}
+	
+	private Hashtable<URI,MarshalUnmarshalPlugin> _plugins = new Hashtable<URI,MarshalUnmarshalPlugin>();
+
+	private static final MarshalUnmarshalManager _instance = new MarshalUnmarshalManager();
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,76 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.xml.marshal;
-
-import java.net.URI;
-
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.w3c.dom.Element;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Used to plug in new Object marshal/unmarshal formats dynamically. When packing
- * objects in XML, the system runs through the list of registered plug-ins until it
- * finds one that can deal with the object type (or faults). When packing, the name (type)
- * of the plug-in that packed the object is also attached to facilitate unpacking.
- *  
- * @author Mark Little
- *
- */
-
-public interface MarshalUnmarshalPlugin
-{
-	public static final String MARSHAL_UNMARSHAL_PLUGIN = "org.jboss.soa.esb.message.format.xml.plugin";
-	
-	public static final String tagName = "marshalunmarshal";
-	public static final String pluginType = "plugin-type";
-		
-	/**
-	 * Pack the provided object into the document.
-	 * 
-	 * @param doc the XML document.
-	 * @param param the object to pack.
-	 * 
-	 * @return <code>true</code> if the object was packed, <code>false</code> otherwise.
-	 * @throws MarshalException thrown if there is a problem packing.
-	 */
-	
-	public boolean marshal (Element doc, Object param) throws MarshalException;
-	
-	/**
-	 * Unpack the object from the document.
-	 * 
-	 * @param doc the document.
-	 * 
-	 * @return the object, or <code>null</code> if this implementation cannot deal with the
-	 * format.
-	 * @throws UnmarshalException thrown if there is a problem unpacking.
-	 */
-	
-	public Object unmarshal (Element doc) throws UnmarshalException;
-	
-	/**
-	 * @return the unique name for this plugin.
-	 */
-	
-	public URI type ();
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,76 @@
+package org.jboss.internal.soa.esb.message.format.xml.marshal;
+
+import java.net.URI;
+
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.w3c.dom.Element;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Used to plug in new Object marshal/unmarshal formats dynamically. When packing
+ * objects in XML, the system runs through the list of registered plug-ins until it
+ * finds one that can deal with the object type (or faults). When packing, the name (type)
+ * of the plug-in that packed the object is also attached to facilitate unpacking.
+ *  
+ * @author Mark Little
+ *
+ */
+
+public interface MarshalUnmarshalPlugin
+{
+	public static final String MARSHAL_UNMARSHAL_PLUGIN = "org.jboss.soa.esb.message.format.xml.plugin";
+	
+	public static final String tagName = "marshalunmarshal";
+	public static final String pluginType = "plugin-type";
+		
+	/**
+	 * Pack the provided object into the document.
+	 * 
+	 * @param doc the XML document.
+	 * @param param the object to pack.
+	 * 
+	 * @return <code>true</code> if the object was packed, <code>false</code> otherwise.
+	 * @throws MarshalException thrown if there is a problem packing.
+	 */
+	
+	public boolean marshal (Element doc, Object param) throws MarshalException;
+	
+	/**
+	 * Unpack the object from the document.
+	 * 
+	 * @param doc the document.
+	 * 
+	 * @return the object, or <code>null</code> if this implementation cannot deal with the
+	 * format.
+	 * @throws UnmarshalException thrown if there is a problem unpacking.
+	 */
+	
+	public Object unmarshal (Element doc) throws UnmarshalException;
+	
+	/**
+	 * @return the unique name for this plugin.
+	 */
+	
+	public URI type ();
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,175 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.xml.marshal;
-
-import java.io.Serializable;
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.jboss.internal.soa.esb.thirdparty.Base64;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.w3c.dom.CDATASection;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Used to plug in new Object marshal/unmarshal formats dynamically. When
- * packing objects in XML, the system runs through the list of registered
- * plug-ins until it finds one that can deal with the object type (or faults).
- * When packing, the name (type) of the plug-in that packed the object is also
- * attached to facilitate unpacking.
- * 
- * @author Mark Little
- * 
- */
-
-public class SerializedMarshalUnmarshalPlugin implements MarshalUnmarshalPlugin
-{
-
-	public SerializedMarshalUnmarshalPlugin()
-	{
-		try
-		{
-			_type = new URI("urn:xml/marshalunmarshal/plugin/serialization");
-		}
-		catch (URISyntaxException ex)
-		{
-			ex.printStackTrace();
-		}
-	}
-
-	/**
-	 * Pack the provided object into the document.
-	 * 
-	 * @param doc
-	 *            the XML document.
-	 * @param param
-	 *            the object to pack.
-	 * 
-	 * @return <code>true</code> if the object was packed, <code>false</code>
-	 *         otherwise.
-	 * @throws MarshalException
-	 *             thrown if there is a problem packing.
-	 */
-
-	public boolean marshal(Element doc, Object param) throws MarshalException
-	{
-		if (param instanceof Serializable)
-		{
-			// we can deal with this type!
-
-			try
-			{
-				Element nodeElement = doc.getOwnerDocument().createElement(
-						MarshalUnmarshalPlugin.tagName);
-
-				Element pluginType = doc.getOwnerDocument().createElement(
-						MarshalUnmarshalPlugin.pluginType);
-				pluginType.appendChild(doc.getOwnerDocument().createTextNode(
-						type().toString()));
-				nodeElement.appendChild(pluginType);
-
-				nodeElement.appendChild(doc.getOwnerDocument()
-						.createCDATASection(
-								Base64.encodeObject((Serializable) param)));
-
-				doc.appendChild(nodeElement);
-			}
-			catch (Exception ex)
-			{
-				ex.printStackTrace();
-
-				throw new MarshalException(ex);
-			}
-
-			return true;
-		}
-		else
-			return false;
-	}
-
-	/**
-	 * Unpack the object from the document.
-	 * 
-	 * @param doc
-	 *            the document.
-	 * 
-	 * @return the object, or <code>null</code> if this implementation cannot
-	 *         deal with the format.
-	 * @throws UnmarshalException
-	 *             thrown if there is a problem unpacking.
-	 */
-
-	public Object unmarshal(Element doc) throws UnmarshalException
-	{
-		try
-		{
-			NodeList nl = doc.getChildNodes();
-
-			for (int i = 0; i < nl.getLength(); i++)
-			{
-				if (nl.item(i).getNodeName().equals(MarshalUnmarshalPlugin.tagName))
-				{
-					NodeList childList = nl.item(i).getChildNodes();
-
-					for (int j = 0; j < childList.getLength(); j++)
-					{
-						Node el = childList.item(j);
-
-						if (el.getNodeName().equals(
-								MarshalUnmarshalPlugin.pluginType))
-						{
-							if (el.getTextContent().equals(type().toString()))
-							{
-								CDATASection cdata = (CDATASection) childList
-										.item(j + 1);
-
-								return Base64.decodeToObject(cdata
-										.getWholeText());
-							}
-						}
-					}
-				}
-			}
-
-			return null;
-		}
-		catch (Exception ex)
-		{
-			throw new UnmarshalException(ex);
-		}
-	}
-
-	/**
-	 * @return the unique name for this plugin.
-	 */
-
-	public URI type()
-	{
-		return _type;
-	}
-
-	private URI _type = null;
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,175 @@
+package org.jboss.internal.soa.esb.message.format.xml.marshal;
+
+import java.io.Serializable;
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.jboss.internal.soa.esb.thirdparty.Base64;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.w3c.dom.CDATASection;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Used to plug in new Object marshal/unmarshal formats dynamically. When
+ * packing objects in XML, the system runs through the list of registered
+ * plug-ins until it finds one that can deal with the object type (or faults).
+ * When packing, the name (type) of the plug-in that packed the object is also
+ * attached to facilitate unpacking.
+ * 
+ * @author Mark Little
+ * 
+ */
+
+public class SerializedMarshalUnmarshalPlugin implements MarshalUnmarshalPlugin
+{
+
+	public SerializedMarshalUnmarshalPlugin()
+	{
+		try
+		{
+			_type = new URI("urn:xml/marshalunmarshal/plugin/serialization");
+		}
+		catch (URISyntaxException ex)
+		{
+			ex.printStackTrace();
+		}
+	}
+
+	/**
+	 * Pack the provided object into the document.
+	 * 
+	 * @param doc
+	 *            the XML document.
+	 * @param param
+	 *            the object to pack.
+	 * 
+	 * @return <code>true</code> if the object was packed, <code>false</code>
+	 *         otherwise.
+	 * @throws MarshalException
+	 *             thrown if there is a problem packing.
+	 */
+
+	public boolean marshal(Element doc, Object param) throws MarshalException
+	{
+		if (param instanceof Serializable)
+		{
+			// we can deal with this type!
+
+			try
+			{
+				Element nodeElement = doc.getOwnerDocument().createElement(
+						MarshalUnmarshalPlugin.tagName);
+
+				Element pluginType = doc.getOwnerDocument().createElement(
+						MarshalUnmarshalPlugin.pluginType);
+				pluginType.appendChild(doc.getOwnerDocument().createTextNode(
+						type().toString()));
+				nodeElement.appendChild(pluginType);
+
+				nodeElement.appendChild(doc.getOwnerDocument()
+						.createCDATASection(
+								Base64.encodeObject((Serializable) param)));
+
+				doc.appendChild(nodeElement);
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+
+				throw new MarshalException(ex);
+			}
+
+			return true;
+		}
+		else
+			return false;
+	}
+
+	/**
+	 * Unpack the object from the document.
+	 * 
+	 * @param doc
+	 *            the document.
+	 * 
+	 * @return the object, or <code>null</code> if this implementation cannot
+	 *         deal with the format.
+	 * @throws UnmarshalException
+	 *             thrown if there is a problem unpacking.
+	 */
+
+	public Object unmarshal(Element doc) throws UnmarshalException
+	{
+		try
+		{
+			NodeList nl = doc.getChildNodes();
+
+			for (int i = 0; i < nl.getLength(); i++)
+			{
+				if (nl.item(i).getNodeName().equals(MarshalUnmarshalPlugin.tagName))
+				{
+					NodeList childList = nl.item(i).getChildNodes();
+
+					for (int j = 0; j < childList.getLength(); j++)
+					{
+						Node el = childList.item(j);
+
+						if (el.getNodeName().equals(
+								MarshalUnmarshalPlugin.pluginType))
+						{
+							if (el.getTextContent().equals(type().toString()))
+							{
+								CDATASection cdata = (CDATASection) childList
+										.item(j + 1);
+
+								return Base64.decodeToObject(cdata
+										.getWholeText());
+							}
+						}
+					}
+				}
+			}
+
+			return null;
+		}
+		catch (Exception ex)
+		{
+			throw new UnmarshalException(ex);
+		}
+	}
+
+	/**
+	 * @return the unique name for this plugin.
+	 */
+
+	public URI type()
+	{
+		return _type;
+	}
+
+	private URI _type = null;
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,153 +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.internal.soa.esb.message.metadata;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.util.Calendar;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.filter.InputOutputFilter;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.Properties;
-
-/**
- * An inputoutput filter is called when the message is being received/sent and after it
- * has been received from the transport/before it is passed to the transport.
- * Implementations may augment or modify the message en route. Implementations that
- * are pure output or pure input can just override the desired operation.
- * 
- * This one adds some metadata to the message as it flows through the ESB.
- * 
- * @author marklittle
- */
-
-public class MetaDataFilter extends InputOutputFilter
-{
-	public Message onOutput (Message msg) throws CourierException
-	{
-        final Environment.Transports type ;
-        final String name ;
-		EPR destination = msg.getHeader().getCall().getTo();
-        if (destination != null)
-        {
-        	if (destination instanceof FTPEpr)
-        	{
-        		try
-        		{
-        			type = Environment.Transports.FTP;
-        				
-        			String dir = ModulePropertyManager.getPropertyManager(
-        				ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
-        									Environment.FTP_LOCALDIR, System.getProperty("java.io.tmpdir"));
-        				
-        			name = dir + File.separator + msg.getHeader().getCall().getMessageID().toString() +
-        			((FTPEpr) destination).getPostDirectory();
-        		}
-        		catch (URISyntaxException ex)
-        		{
-        			throw new CourierException(ex);
-        		}
-        	}
-        	else if (destination instanceof FileEpr)
-        	{
-        		try
-        		{
-        			type = Environment.Transports.File;
-        				
-        			name = ((FileEpr) destination).getURL() + File.separator + 
-        				msg.getHeader().getCall().getMessageID().toString() + ((FileEpr) destination).getPostSuffix();
-        		}
-        		catch (MalformedURLException ex)
-        		{
-        			throw new CourierException(ex);
-        		}
-        		catch (URISyntaxException ex)
-        		{
-        			throw new CourierException(ex);
-        		}
-        	}		
-        	else if (destination instanceof JMSEpr)
-        	{
-        		type = Environment.Transports.JMS;
-        		
-        		name = destination.getAddr().toString();					
-        	}
-        	else if (destination instanceof JDBCEpr)
-        	{
-        		type = Environment.Transports.SQL;
-        			
-        		name = destination.getAddr().toString();
-        	} 
-        	else if (destination instanceof HibernateEpr)
-        	{
-        		type = Environment.Transports.Hibernate;
-        		name = destination.getAddr().toString();
-        	}
-            else
-            {
-            	type = null ;
-                name = null ;
-            }
-        }
-        else
-        {
-        	type = null ;
-            name = null ;
-        }
-    		
-        final Properties props = msg.getProperties() ;
-        setProperty(props, Environment.TRANSPORT_TYPE, type) ;
-        setProperty(props, Environment.MESSAGE_SOURCE, name);
-        props.setProperty(Environment.MESSAGE_ENTRY_TIME, Calendar.getInstance().getTime().toString());
-    	return msg;
-	}
-	
-	public Message onInput (Message msg) throws CourierException
-	{
-		msg.getProperties().setProperty(Environment.MESSAGE_EXIT_TIME, Calendar.getInstance().getTime().toString());
-		
-		return msg;
-	}
-        
-	private void setProperty(final Properties props, final String name, final Object value)
-	{
-		if (value == null)
-		{
-			props.remove(name) ;
-		}
-		else
-		{
-			props.setProperty(name, value) ;
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/metadata/MetaDataFilter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,153 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.message.metadata;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.util.Calendar;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.filter.InputOutputFilter;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.Properties;
+
+/**
+ * An inputoutput filter is called when the message is being received/sent and after it
+ * has been received from the transport/before it is passed to the transport.
+ * Implementations may augment or modify the message en route. Implementations that
+ * are pure output or pure input can just override the desired operation.
+ * 
+ * This one adds some metadata to the message as it flows through the ESB.
+ * 
+ * @author marklittle
+ */
+
+public class MetaDataFilter extends InputOutputFilter
+{
+	public Message onOutput (Message msg) throws CourierException
+	{
+        final Environment.Transports type ;
+        final String name ;
+		EPR destination = msg.getHeader().getCall().getTo();
+        if (destination != null)
+        {
+        	if (destination instanceof FTPEpr)
+        	{
+        		try
+        		{
+        			type = Environment.Transports.FTP;
+        				
+        			String dir = ModulePropertyManager.getPropertyManager(
+        				ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
+        									Environment.FTP_LOCALDIR, System.getProperty("java.io.tmpdir"));
+        				
+        			name = dir + File.separator + msg.getHeader().getCall().getMessageID().toString() +
+        			((FTPEpr) destination).getPostDirectory();
+        		}
+        		catch (URISyntaxException ex)
+        		{
+        			throw new CourierException(ex);
+        		}
+        	}
+        	else if (destination instanceof FileEpr)
+        	{
+        		try
+        		{
+        			type = Environment.Transports.File;
+        				
+        			name = ((FileEpr) destination).getURL() + File.separator + 
+        				msg.getHeader().getCall().getMessageID().toString() + ((FileEpr) destination).getPostSuffix();
+        		}
+        		catch (MalformedURLException ex)
+        		{
+        			throw new CourierException(ex);
+        		}
+        		catch (URISyntaxException ex)
+        		{
+        			throw new CourierException(ex);
+        		}
+        	}		
+        	else if (destination instanceof JMSEpr)
+        	{
+        		type = Environment.Transports.JMS;
+        		
+        		name = destination.getAddr().toString();					
+        	}
+        	else if (destination instanceof JDBCEpr)
+        	{
+        		type = Environment.Transports.SQL;
+        			
+        		name = destination.getAddr().toString();
+        	} 
+        	else if (destination instanceof HibernateEpr)
+        	{
+        		type = Environment.Transports.Hibernate;
+        		name = destination.getAddr().toString();
+        	}
+            else
+            {
+            	type = null ;
+                name = null ;
+            }
+        }
+        else
+        {
+        	type = null ;
+            name = null ;
+        }
+    		
+        final Properties props = msg.getProperties() ;
+        setProperty(props, Environment.TRANSPORT_TYPE, type) ;
+        setProperty(props, Environment.MESSAGE_SOURCE, name);
+        props.setProperty(Environment.MESSAGE_ENTRY_TIME, Calendar.getInstance().getTime().toString());
+    	return msg;
+	}
+	
+	public Message onInput (Message msg) throws CourierException
+	{
+		msg.getProperties().setProperty(Environment.MESSAGE_EXIT_TIME, Calendar.getInstance().getTime().toString());
+		
+		return msg;
+	}
+        
+	private void setProperty(final Properties props, final String name, final Object value)
+	{
+		if (value == null)
+		{
+			props.remove(name) ;
+		}
+		else
+		{
+			props.setProperty(name, value) ;
+		}
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/DefaultMessageURIGenerator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/DefaultMessageURIGenerator.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/DefaultMessageURIGenerator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,54 +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 derek.adams at sapience360.com
- */
-
-package org.jboss.internal.soa.esb.message.urigen;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.UUID;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.urigen.MessageURIGenerator;
-import org.jboss.soa.esb.message.urigen.URIGenerationException;
-
-/**
- * Default message URI generator. Generates a UUID independent of message
- * contents.
- * 
- * @author Derek Adams
- */
-public class DefaultMessageURIGenerator implements MessageURIGenerator {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.message.urigen.MessageURIGenerator#generateMessageURI(org.jboss.soa.esb.message.Message)
-	 */
-	public URI generateMessageURI(Message message)
-			throws URIGenerationException {
-		String uuid = UUID.randomUUID().toString();
-		try {
-			return new URI("urn:jboss/esb/message/UID#" + uuid);
-		} catch (URISyntaxException e) {
-			throw new URIGenerationException(e);
-		}
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/DefaultMessageURIGenerator.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/DefaultMessageURIGenerator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/DefaultMessageURIGenerator.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/DefaultMessageURIGenerator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,54 @@
+/*
+ * 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 derek.adams at sapience360.com
+ */
+
+package org.jboss.internal.soa.esb.message.urigen;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.UUID;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.urigen.MessageURIGenerator;
+import org.jboss.soa.esb.message.urigen.URIGenerationException;
+
+/**
+ * Default message URI generator. Generates a UUID independent of message
+ * contents.
+ * 
+ * @author Derek Adams
+ */
+public class DefaultMessageURIGenerator implements MessageURIGenerator {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.message.urigen.MessageURIGenerator#generateMessageURI(org.jboss.soa.esb.message.Message)
+	 */
+	public URI generateMessageURI(Message message)
+			throws URIGenerationException {
+		String uuid = UUID.randomUUID().toString();
+		try {
+			return new URI("urn:jboss/esb/message/UID#" + uuid);
+		} catch (URISyntaxException e) {
+			throw new URIGenerationException(e);
+		}
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/JcrMessageURIGenerator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/JcrMessageURIGenerator.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/JcrMessageURIGenerator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,53 +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 derek.adams at sapience360.com
- */
-
-package org.jboss.internal.soa.esb.message.urigen;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.UUID;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.urigen.MessageURIGenerator;
-import org.jboss.soa.esb.message.urigen.URIGenerationException;
-
-/**
- * Generates a message URI that can be used as a JCR node name.
- * 
- * @author Derek Adams
- */
-public class JcrMessageURIGenerator implements MessageURIGenerator {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.message.urigen.MessageURIGenerator#generateMessageURI(org.jboss.soa.esb.message.Message)
-	 */
-	public URI generateMessageURI(Message message)
-			throws URIGenerationException {
-		String uuid = UUID.randomUUID().toString();
-		try {
-			return new URI(uuid);
-		} catch (URISyntaxException e) {
-			throw new URIGenerationException(e);
-		}
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/JcrMessageURIGenerator.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/JcrMessageURIGenerator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/JcrMessageURIGenerator.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/message/urigen/JcrMessageURIGenerator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,53 @@
+/*
+ * 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 derek.adams at sapience360.com
+ */
+
+package org.jboss.internal.soa.esb.message.urigen;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.UUID;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.urigen.MessageURIGenerator;
+import org.jboss.soa.esb.message.urigen.URIGenerationException;
+
+/**
+ * Generates a message URI that can be used as a JCR node name.
+ * 
+ * @author Derek Adams
+ */
+public class JcrMessageURIGenerator implements MessageURIGenerator {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.message.urigen.MessageURIGenerator#generateMessageURI(org.jboss.soa.esb.message.Message)
+	 */
+	public URI generateMessageURI(Message message)
+			throws URIGenerationException {
+		String uuid = UUID.randomUUID().toString();
+		try {
+			return new URI(uuid);
+		} catch (URISyntaxException e) {
+			throw new URIGenerationException(e);
+		}
+	}
+}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification/MacroExpander.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification/MacroExpander.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification/MacroExpander.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,98 +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.internal.soa.esb.notification;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-
-
-/**
- * MacroExpander class.
- * <p/>
- * This class takes a DOM and iterates over it, replacing all "macro" tokens in 
- * any attribute values using the values from the supplied Map.
- * 
- * @author <a href="mailto:schifest at gmail.com">Esteban Shifman</a>
- */
-public class MacroExpander {
-	private static final String CTX_PREFIX = "@@ctx@@";
-
-	public static final String CTX_BATCH_UID = CTX_PREFIX + "batchUid";
-
-	public static final String CTX_BATCH_NUM = CTX_PREFIX + "batchNum";
-
-	public static final String CTX_INPUT_FILE = CTX_PREFIX + "inputFile";
-
-	public static final String CTX_POST_FILE = CTX_PREFIX + "postFile";
-
-	private static final String[] s_saMacros = { 
-		CTX_BATCH_UID, CTX_BATCH_NUM, CTX_INPUT_FILE, CTX_POST_FILE };
-
-	/**
-	 * Perform a macro replacement on the DOM tree attribute values
-	 * of the supplied ConfigTree using the supplied macro token
-	 * replacement map.
-	 * @param domTree The DOM Tree to be operated on.
-	 * @param replacementTokenMapMap The token replacement map.
-	 */
-	public static void replaceMacros(ConfigTree domTree, Map replacementTokenMap) {
-
-		List<KeyValuePair> changed = new ArrayList<KeyValuePair>();
-		for (String currAtt : domTree.getAttributeNames()) 
-		{
-			String sVal = domTree.getAttribute(currAtt);
-			boolean bSubst = false;
-			int iPos = 0;
-
-			while (0 <= (iPos = sVal.indexOf(CTX_PREFIX, 0))) {
-				String sRest = sVal.substring(iPos);
-				for (int ii = 0; ii < s_saMacros.length; ii++) {
-					String sMac = s_saMacros[ii];
-					if (!sRest.startsWith(sMac)) {
-						continue;
-					}
-					Object oRpl = (null != replacementTokenMap) ? replacementTokenMap.get(sMac) : null;
-					if (null == oRpl) {
-						continue;
-					}
-					bSubst = true;
-					sVal = sVal.substring(0, iPos) + oRpl.toString() + sVal.substring(iPos + sMac.length());
-					break;
-				}
-			}
-			if (bSubst)
-					changed.add(new KeyValuePair(currAtt,sVal));
-		}
-		for (KeyValuePair kvp : changed)
-			domTree.setAttribute(kvp.getKey(),kvp.getValue());
-		changed	= null;
-		
-		// Iterate over the child elements and recursively call this method...
-		for (ConfigTree child : domTree.getAllChildren())
-				replaceMacros(child, replacementTokenMap);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification/MacroExpander.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification/MacroExpander.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification/MacroExpander.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/notification/MacroExpander.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,98 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.notification;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+
+
+/**
+ * MacroExpander class.
+ * <p/>
+ * This class takes a DOM and iterates over it, replacing all "macro" tokens in 
+ * any attribute values using the values from the supplied Map.
+ * 
+ * @author <a href="mailto:schifest at gmail.com">Esteban Shifman</a>
+ */
+public class MacroExpander {
+	private static final String CTX_PREFIX = "@@ctx@@";
+
+	public static final String CTX_BATCH_UID = CTX_PREFIX + "batchUid";
+
+	public static final String CTX_BATCH_NUM = CTX_PREFIX + "batchNum";
+
+	public static final String CTX_INPUT_FILE = CTX_PREFIX + "inputFile";
+
+	public static final String CTX_POST_FILE = CTX_PREFIX + "postFile";
+
+	private static final String[] s_saMacros = { 
+		CTX_BATCH_UID, CTX_BATCH_NUM, CTX_INPUT_FILE, CTX_POST_FILE };
+
+	/**
+	 * Perform a macro replacement on the DOM tree attribute values
+	 * of the supplied ConfigTree using the supplied macro token
+	 * replacement map.
+	 * @param domTree The DOM Tree to be operated on.
+	 * @param replacementTokenMapMap The token replacement map.
+	 */
+	public static void replaceMacros(ConfigTree domTree, Map replacementTokenMap) {
+
+		List<KeyValuePair> changed = new ArrayList<KeyValuePair>();
+		for (String currAtt : domTree.getAttributeNames()) 
+		{
+			String sVal = domTree.getAttribute(currAtt);
+			boolean bSubst = false;
+			int iPos = 0;
+
+			while (0 <= (iPos = sVal.indexOf(CTX_PREFIX, 0))) {
+				String sRest = sVal.substring(iPos);
+				for (int ii = 0; ii < s_saMacros.length; ii++) {
+					String sMac = s_saMacros[ii];
+					if (!sRest.startsWith(sMac)) {
+						continue;
+					}
+					Object oRpl = (null != replacementTokenMap) ? replacementTokenMap.get(sMac) : null;
+					if (null == oRpl) {
+						continue;
+					}
+					bSubst = true;
+					sVal = sVal.substring(0, iPos) + oRpl.toString() + sVal.substring(iPos + sMac.length());
+					break;
+				}
+			}
+			if (bSubst)
+					changed.add(new KeyValuePair(currAtt,sVal));
+		}
+		for (KeyValuePair kvp : changed)
+			domTree.setAttribute(kvp.getKey(),kvp.getValue());
+		changed	= null;
+		
+		// Iterate over the child elements and recursively call this method...
+		for (ConfigTree child : domTree.getAllChildren())
+				replaceMacros(child, replacementTokenMap);
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,280 +0,0 @@
-package org.jboss.internal.soa.esb.parameters;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Properties;
-
-import javax.naming.CompoundName;
-import javax.naming.InvalidNameException;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.parameters.ParamRepository;
-import org.jboss.soa.esb.parameters.ParamRepositoryException;
-
-/**
- * This class provides basic file-based storage/retrieval of parameter trees for
- * the JBoss ESB. <p/> This class creates a hierarchical parameter file
- * structure on the file system. E.g. the value for a parameter named
- * "org/jboss/param1" is stored in a file called "param1" in the folder "<root>/org/jboss",
- * where "root" is either the working directory (default) or the directory
- * specified in the "org.jboss.soa.esb.paramsRepository.file.root" System
- * property.
- * 
- * @author Esteban
- * 
- */
-public class ParamFileRepository implements ParamRepository
-{
-
-	/**
-	 * System property defining the repository root directory.
-	 */
-	public static final String FILE_PARAMS_REPOS_ROOT = "org.jboss.soa.esb.paramsRepository.file.root";
-
-	/**
-	 * The repository root dir.
-	 */
-	private File root;
-
-	/**
-	 * Logger.
-	 */
-	private Logger logger = Logger.getLogger(ParamFileRepository.class);
-
-	/**
-	 * Public default constructor.
-	 */
-	public ParamFileRepository()
-	{
-		String rootDir = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE)
-				.getProperty(FILE_PARAMS_REPOS_ROOT);
-
-		// Set the repository root directory.
-		if (rootDir == null)
-		{
-			// set it to the working dir.
-			root = new File("./");
-		} else
-		{
-			root = new File(rootDir);
-			if (!root.exists())
-			{
-				throw new IllegalStateException(
-						"Nonexistant directory specified in the ["
-								+ FILE_PARAMS_REPOS_ROOT
-								+ "] System property: "
-								+ root.getAbsolutePath());
-			}
-		}
-
-		logger.info("Setting parameter repository root dir to ["
-				+ root.getAbsolutePath() + "].");
-	}
-
-	public void add(String name, String value) throws ParamRepositoryException
-	{
-		FileParamName nameParam = asserNameOK(name);
-		if (value == null)
-		{
-			throw new IllegalArgumentException(
-					"null 'value' arg in method call.");
-		}
-
-		synchronized (this)
-		{
-			File paramFile = toParamFile(nameParam);
-			File parentDir = paramFile.getParentFile();
-			if (null==parentDir)
-				parentDir=new File("");
-
-			parentDir.mkdirs();
-			FileOutputStream fileStream = null;
-			try
-			{
-				fileStream = new FileOutputStream(paramFile);
-				fileStream.write(value.getBytes("UTF-8"));
-			} catch (IOException e)
-			{
-				throw new ParamRepositoryException(
-						"IO Error while storing param [" + nameParam + "].", e);
-			} finally
-			{
-				try
-				{
-					if (fileStream != null)
-					{
-						fileStream.flush();
-						fileStream.close();
-					}
-				} catch (IOException e)
-				{
-					logger.warn("Unable to close param file: "
-							+ paramFile.getAbsolutePath(), e);
-				}
-			}
-		}
-	}
-
-	public String get(String name) throws ParamRepositoryException
-	{
-		FileParamName paramName = asserNameOK(name);
-
-		synchronized (this)
-		{
-			File paramFile = new File(name);
-
-			if (!paramFile.exists())
-			{
-				paramFile = toParamFile(paramName);
-				if (!paramFile.exists())
-				{
-					return null;
-				}
-			}
-
-			InputStream fileStream = null;
-			try
-			{
-				fileStream = new FileInputStream(paramFile);
-				byte[] value = StreamUtils.readStream(fileStream);
-				return new String(value, "UTF-8");
-			} catch (Exception e)
-			{
-				throw new ParamRepositoryException(
-						"Unable to load Param Value from file: "
-								+ paramFile.getAbsolutePath(), e);
-			} finally
-			{
-				try
-				{
-					if (fileStream != null)
-					{
-						fileStream.close();
-					}
-				} catch (IOException e)
-				{
-					logger.warn("Unable to close param file: "
-							+ paramFile.getAbsolutePath(), e);
-				}
-			}
-		}
-	}
-
-	public void remove(String name)
-	{
-		FileParamName paramName = asserNameOK(name);
-
-		synchronized (this)
-		{
-			File paramFile = toParamFile(paramName);
-			if (paramFile.exists())
-			{
-				paramFile.delete();
-			}
-		}
-	}
-
-	/**
-	 * Get the repository root directory.
-	 * 
-	 * @return The repository root directory.
-	 */
-	public File getRoot()
-	{
-		return root;
-	}
-
-	/**
-	 * Get the param file for the specified param name.
-	 * 
-	 * @param paramName
-	 *            The param name.
-	 * @return The param file.
-	 */
-	public File toParamFile(String name)
-	{
-		FileParamName paramName = asserNameOK(name);
-		return new File(root, paramName.toString());
-	}
-
-	/**
-	 * Get the param file for the specified param name.
-	 * 
-	 * @param paramName
-	 *            The param name.
-	 * @return The param file.
-	 */
-	private File toParamFile(FileParamName paramName)
-	{
-		return new File(root, paramName.toString());
-	}
-
-	private FileParamName asserNameOK(String name)
-	{
-		FileParamName paramName;
-
-		if (name == null)
-		{
-			throw new IllegalArgumentException(
-					"null 'name' arg in repository call.");
-		}
-		try
-		{
-			paramName = new FileParamName(name);
-		} catch (InvalidNameException e)
-		{
-			throw new IllegalArgumentException("Invalid 'name' arg: " + name, e);
-		}
-		if (paramName.size() == 0)
-		{
-			throw new IllegalArgumentException(
-					"Invalid 'name' arg.  0 tokens: " + name);
-		}
-
-		return paramName;
-	}
-
-	/**
-	 * Parameter Name. <p/> Represents a compound parameter name - from a
-	 * hierarchical namespace.
-	 * <h4 id="syntax">Parameter Name Format</h4>
-	 * The syntax of the parameter name is expected to be in "directory" format,
-	 * read from left to right, where the syntax seperator character is '/' e.g.
-	 * "com/acme/ParameterX".
-	 * 
-	 * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
-	 */
-	private static class FileParamName extends CompoundName
-	{
-
-		private static final long serialVersionUID = 1L;
-
-		private static final Properties nameSyntaxProperties = new Properties();
-		static
-		{
-			nameSyntaxProperties.setProperty("jndi.syntax.direction",
-					"left_to_right");
-			nameSyntaxProperties.setProperty("jndi.syntax.separator", "/");
-		};
-
-		/**
-		 * Public Constructor.
-		 * 
-		 * @param name
-		 *            The name of the parameter, specified according to the <a
-		 *            href="#syntax">defined syntax</a>.
-		 * @throws InvalidNameException
-		 *             The supplied name violates the <a href="#syntax">defined
-		 *             syntax</a>.
-		 */
-		public FileParamName(String name) throws InvalidNameException
-		{
-			super(name, nameSyntaxProperties);
-		}
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/parameters/ParamFileRepository.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,280 @@
+package org.jboss.internal.soa.esb.parameters;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Properties;
+
+import javax.naming.CompoundName;
+import javax.naming.InvalidNameException;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.parameters.ParamRepository;
+import org.jboss.soa.esb.parameters.ParamRepositoryException;
+
+/**
+ * This class provides basic file-based storage/retrieval of parameter trees for
+ * the JBoss ESB. <p/> This class creates a hierarchical parameter file
+ * structure on the file system. E.g. the value for a parameter named
+ * "org/jboss/param1" is stored in a file called "param1" in the folder "<root>/org/jboss",
+ * where "root" is either the working directory (default) or the directory
+ * specified in the "org.jboss.soa.esb.paramsRepository.file.root" System
+ * property.
+ * 
+ * @author Esteban
+ * 
+ */
+public class ParamFileRepository implements ParamRepository
+{
+
+	/**
+	 * System property defining the repository root directory.
+	 */
+	public static final String FILE_PARAMS_REPOS_ROOT = "org.jboss.soa.esb.paramsRepository.file.root";
+
+	/**
+	 * The repository root dir.
+	 */
+	private File root;
+
+	/**
+	 * Logger.
+	 */
+	private Logger logger = Logger.getLogger(ParamFileRepository.class);
+
+	/**
+	 * Public default constructor.
+	 */
+	public ParamFileRepository()
+	{
+		String rootDir = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE)
+				.getProperty(FILE_PARAMS_REPOS_ROOT);
+
+		// Set the repository root directory.
+		if (rootDir == null)
+		{
+			// set it to the working dir.
+			root = new File("./");
+		} else
+		{
+			root = new File(rootDir);
+			if (!root.exists())
+			{
+				throw new IllegalStateException(
+						"Nonexistant directory specified in the ["
+								+ FILE_PARAMS_REPOS_ROOT
+								+ "] System property: "
+								+ root.getAbsolutePath());
+			}
+		}
+
+		logger.info("Setting parameter repository root dir to ["
+				+ root.getAbsolutePath() + "].");
+	}
+
+	public void add(String name, String value) throws ParamRepositoryException
+	{
+		FileParamName nameParam = asserNameOK(name);
+		if (value == null)
+		{
+			throw new IllegalArgumentException(
+					"null 'value' arg in method call.");
+		}
+
+		synchronized (this)
+		{
+			File paramFile = toParamFile(nameParam);
+			File parentDir = paramFile.getParentFile();
+			if (null==parentDir)
+				parentDir=new File("");
+
+			parentDir.mkdirs();
+			FileOutputStream fileStream = null;
+			try
+			{
+				fileStream = new FileOutputStream(paramFile);
+				fileStream.write(value.getBytes("UTF-8"));
+			} catch (IOException e)
+			{
+				throw new ParamRepositoryException(
+						"IO Error while storing param [" + nameParam + "].", e);
+			} finally
+			{
+				try
+				{
+					if (fileStream != null)
+					{
+						fileStream.flush();
+						fileStream.close();
+					}
+				} catch (IOException e)
+				{
+					logger.warn("Unable to close param file: "
+							+ paramFile.getAbsolutePath(), e);
+				}
+			}
+		}
+	}
+
+	public String get(String name) throws ParamRepositoryException
+	{
+		FileParamName paramName = asserNameOK(name);
+
+		synchronized (this)
+		{
+			File paramFile = new File(name);
+
+			if (!paramFile.exists())
+			{
+				paramFile = toParamFile(paramName);
+				if (!paramFile.exists())
+				{
+					return null;
+				}
+			}
+
+			InputStream fileStream = null;
+			try
+			{
+				fileStream = new FileInputStream(paramFile);
+				byte[] value = StreamUtils.readStream(fileStream);
+				return new String(value, "UTF-8");
+			} catch (Exception e)
+			{
+				throw new ParamRepositoryException(
+						"Unable to load Param Value from file: "
+								+ paramFile.getAbsolutePath(), e);
+			} finally
+			{
+				try
+				{
+					if (fileStream != null)
+					{
+						fileStream.close();
+					}
+				} catch (IOException e)
+				{
+					logger.warn("Unable to close param file: "
+							+ paramFile.getAbsolutePath(), e);
+				}
+			}
+		}
+	}
+
+	public void remove(String name)
+	{
+		FileParamName paramName = asserNameOK(name);
+
+		synchronized (this)
+		{
+			File paramFile = toParamFile(paramName);
+			if (paramFile.exists())
+			{
+				paramFile.delete();
+			}
+		}
+	}
+
+	/**
+	 * Get the repository root directory.
+	 * 
+	 * @return The repository root directory.
+	 */
+	public File getRoot()
+	{
+		return root;
+	}
+
+	/**
+	 * Get the param file for the specified param name.
+	 * 
+	 * @param paramName
+	 *            The param name.
+	 * @return The param file.
+	 */
+	public File toParamFile(String name)
+	{
+		FileParamName paramName = asserNameOK(name);
+		return new File(root, paramName.toString());
+	}
+
+	/**
+	 * Get the param file for the specified param name.
+	 * 
+	 * @param paramName
+	 *            The param name.
+	 * @return The param file.
+	 */
+	private File toParamFile(FileParamName paramName)
+	{
+		return new File(root, paramName.toString());
+	}
+
+	private FileParamName asserNameOK(String name)
+	{
+		FileParamName paramName;
+
+		if (name == null)
+		{
+			throw new IllegalArgumentException(
+					"null 'name' arg in repository call.");
+		}
+		try
+		{
+			paramName = new FileParamName(name);
+		} catch (InvalidNameException e)
+		{
+			throw new IllegalArgumentException("Invalid 'name' arg: " + name, e);
+		}
+		if (paramName.size() == 0)
+		{
+			throw new IllegalArgumentException(
+					"Invalid 'name' arg.  0 tokens: " + name);
+		}
+
+		return paramName;
+	}
+
+	/**
+	 * Parameter Name. <p/> Represents a compound parameter name - from a
+	 * hierarchical namespace.
+	 * <h4 id="syntax">Parameter Name Format</h4>
+	 * The syntax of the parameter name is expected to be in "directory" format,
+	 * read from left to right, where the syntax seperator character is '/' e.g.
+	 * "com/acme/ParameterX".
+	 * 
+	 * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+	 */
+	private static class FileParamName extends CompoundName
+	{
+
+		private static final long serialVersionUID = 1L;
+
+		private static final Properties nameSyntaxProperties = new Properties();
+		static
+		{
+			nameSyntaxProperties.setProperty("jndi.syntax.direction",
+					"left_to_right");
+			nameSyntaxProperties.setProperty("jndi.syntax.separator", "/");
+		};
+
+		/**
+		 * Public Constructor.
+		 * 
+		 * @param name
+		 *            The name of the parameter, specified according to the <a
+		 *            href="#syntax">defined syntax</a>.
+		 * @throws InvalidNameException
+		 *             The supplied name violates the <a href="#syntax">defined
+		 *             syntax</a>.
+		 */
+		public FileParamName(String name) throws InvalidNameException
+		{
+			super(name, nameSyntaxProperties);
+		}
+	}
+}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager/ConnectionManager.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager/ConnectionManager.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager/ConnectionManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,22 +0,0 @@
-package org.jboss.internal.soa.esb.persistence.manager;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import org.jboss.soa.esb.ConfigurationException;
-
-public interface ConnectionManager {
-    /**
-     * 
-     * @return ConnectionManager
-     */
-    public ConnectionManager getInstance();
-	/**
-	 * Returns a connection from the pool.
-	 */
-	public Connection getConnection() throws SQLException;
-	/**
-     * Initializes the Connection Manager.
-	 */
-    public void init() throws  ConfigurationException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager/ConnectionManager.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager/ConnectionManager.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager/ConnectionManager.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/persistence/manager/ConnectionManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,22 @@
+package org.jboss.internal.soa.esb.persistence.manager;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import org.jboss.soa.esb.ConfigurationException;
+
+public interface ConnectionManager {
+    /**
+     * 
+     * @return ConnectionManager
+     */
+    public ConnectionManager getInstance();
+	/**
+	 * Returns a connection from the pool.
+	 */
+	public Connection getConnection() throws SQLException;
+	/**
+     * Initializes the Connection Manager.
+	 */
+    public void init() throws  ConfigurationException;
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ActionContractPublisher.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ActionContractPublisher.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ActionContractPublisher.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,20 +0,0 @@
-package org.jboss.internal.soa.esb.publish;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.listeners.config.ActionDocument.Action;
-
-/**
- * Action contract Publisher.
- *
- * @author
- */
-public interface ActionContractPublisher extends ContractPublisher {
-
-    /**
-     * Set the action configuration.
-     *
-     * @param actionConfig The action configuration instance.
-     * @throws org.jboss.soa.esb.ConfigurationException Configuration exception.
-     */
-    public void setActionConfig(Action actionConfig) throws ConfigurationException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ActionContractPublisher.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ActionContractPublisher.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ActionContractPublisher.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ActionContractPublisher.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,20 @@
+package org.jboss.internal.soa.esb.publish;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.listeners.config.ActionDocument.Action;
+
+/**
+ * Action contract Publisher.
+ *
+ * @author
+ */
+public interface ActionContractPublisher extends ContractPublisher {
+
+    /**
+     * Set the action configuration.
+     *
+     * @param actionConfig The action configuration instance.
+     * @throws org.jboss.soa.esb.ConfigurationException Configuration exception.
+     */
+    public void setActionConfig(Action actionConfig) throws ConfigurationException;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractInfo.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractInfo.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractInfo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,64 +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, JBoss Inc.
- */
-package org.jboss.internal.soa.esb.publish;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-
-/**
- * Endpoint contract publication information.
- * <p/>
- * The contract definition e.g. WSDL.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class ContractInfo {
-
-    private String mimeType;
-    private String data;
-
-    /**
-     * Public constructor.
-     * @param mimeType Contract data MIME type.
-     * @param data Contract data.
-     */
-    public ContractInfo(String mimeType, String data) {
-        AssertArgument.isNotNullAndNotEmpty(mimeType, "mimeType");
-        AssertArgument.isNotNullAndNotEmpty(data, "data");
-
-        this.mimeType = mimeType;
-        this.data = data;
-    }
-
-    /**
-     * Get the contract data MIME type.
-     * @return Contract data mime type.
-     */
-    public String getMimeType() {
-        return mimeType;
-    }
-
-    /**
-     * Get the contract data.
-     * @return Contract data.
-     */
-    public String getData() {
-        return data;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractInfo.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractInfo.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractInfo.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractInfo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,64 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.publish;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+
+/**
+ * Endpoint contract publication information.
+ * <p/>
+ * The contract definition e.g. WSDL.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ContractInfo {
+
+    private String mimeType;
+    private String data;
+
+    /**
+     * Public constructor.
+     * @param mimeType Contract data MIME type.
+     * @param data Contract data.
+     */
+    public ContractInfo(String mimeType, String data) {
+        AssertArgument.isNotNullAndNotEmpty(mimeType, "mimeType");
+        AssertArgument.isNotNullAndNotEmpty(data, "data");
+
+        this.mimeType = mimeType;
+        this.data = data;
+    }
+
+    /**
+     * Get the contract data MIME type.
+     * @return Contract data mime type.
+     */
+    public String getMimeType() {
+        return mimeType;
+    }
+
+    /**
+     * Get the contract data.
+     * @return Contract data.
+     */
+    public String getData() {
+        return data;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractPublisher.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractPublisher.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractPublisher.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,24 +0,0 @@
-package org.jboss.internal.soa.esb.publish;
-
-import org.jboss.soa.esb.addressing.EPR;
-
-/**
- * Contract Publisher.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract interface ContractPublisher extends Publisher {
-
-    /**
-     * Get the contract information.
-     * <p/>
-     * A Service may publish a number of addressable endpoints. The publisher
-     * will likely return different contract info depending on the endpoint EPR.
-     * <p/>
-     * This info can be stored and published from a global registry of some sort.
-     *
-     * @param epr Endpoint EPR.
-     * @return Contract information.
-     */
-    public ContractInfo getContractInfo(EPR epr);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractPublisher.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractPublisher.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractPublisher.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/ContractPublisher.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,24 @@
+package org.jboss.internal.soa.esb.publish;
+
+import org.jboss.soa.esb.addressing.EPR;
+
+/**
+ * Contract Publisher.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public abstract interface ContractPublisher extends Publisher {
+
+    /**
+     * Get the contract information.
+     * <p/>
+     * A Service may publish a number of addressable endpoints. The publisher
+     * will likely return different contract info depending on the endpoint EPR.
+     * <p/>
+     * This info can be stored and published from a global registry of some sort.
+     *
+     * @param epr Endpoint EPR.
+     * @return Contract information.
+     */
+    public ContractInfo getContractInfo(EPR epr);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publish.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publish.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publish.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,43 +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, JBoss Inc.
- */
-package org.jboss.internal.soa.esb.publish;
-
-import java.lang.annotation.Documented;
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-/**
- * Publish annotation.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
- at Documented
- at Target(ElementType.TYPE)
- at Retention(RetentionPolicy.RUNTIME)
-public @interface Publish {
-
-    /**
-     * The get the {@link org.jboss.internal.soa.esb.publish.Publisher} class runtime.
-     * @return The {@link org.jboss.internal.soa.esb.publish.Publisher} class runtime.
-     */
-    public Class value();
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publish.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publish.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publish.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publish.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,43 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.publish;
+
+import java.lang.annotation.Documented;
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Publish annotation.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+ at Documented
+ at Target(ElementType.TYPE)
+ at Retention(RetentionPolicy.RUNTIME)
+public @interface Publish {
+
+    /**
+     * The get the {@link org.jboss.internal.soa.esb.publish.Publisher} class runtime.
+     * @return The {@link org.jboss.internal.soa.esb.publish.Publisher} class runtime.
+     */
+    public Class value();
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publisher.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publisher.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publisher.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,7 +0,0 @@
-package org.jboss.internal.soa.esb.publish;
-
-/**
- * @author
- */
-public interface Publisher {
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publisher.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publisher.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publisher.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/publish/Publisher.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,7 @@
+package org.jboss.internal.soa.esb.publish;
+
+/**
+ * @author
+ */
+public interface Publisher {
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/ConnectionException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/ConnectionException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/ConnectionException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,50 +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.internal.soa.esb.rosetta.pooling;
-
-/**
- * This exception is thrown when Connection Pool fails to initialize
- * @author kstam
- * Date: March 10, 2007
- */
-public class ConnectionException extends Exception{
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-
-    public ConnectionException() {
-        super();
-    }
-
-    public ConnectionException(String message) {
-        super(message);
-    }
-
-    public ConnectionException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    public ConnectionException(Throwable cause) {
-        super(cause);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/ConnectionException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/ConnectionException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/ConnectionException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/ConnectionException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,50 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.rosetta.pooling;
+
+/**
+ * This exception is thrown when Connection Pool fails to initialize
+ * @author kstam
+ * Date: March 10, 2007
+ */
+public class ConnectionException extends Exception{
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    public ConnectionException() {
+        super();
+    }
+
+    public ConnectionException(String message) {
+        super(message);
+    }
+
+    public ConnectionException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    public ConnectionException(Throwable cause) {
+        super(cause);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,244 +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.internal.soa.esb.rosetta.pooling;
-
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Map;
-
-import javax.jms.Connection;
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.jms.TopicConnection;
-import javax.jms.TopicConnectionFactory;
-import javax.jms.TopicSession;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.helpers.NamingContext;
-
-/**
- * Interface that needs to be implemented to provide pool of connections.
- * @see DefaultConnectionPoolImpl
- * Default implementation of Connection Pool
- * @author kstam
- * Date: March 10, 2007
- */
-public class JmsConnectionPool
-{
-    /** Maximum number of Sessions that will be created in this pool */
-    private int MAX_SESSIONS=20;    //TODO Make this manageable
-    /** Number of free sessions in the pool that can be given out */
-    private ArrayList<Session> freeSessions = new ArrayList<Session>();
-    /** Number of session that are currently in use */
-    private ArrayList<Session> inUseSessions = new ArrayList<Session>();
-    /** Reference to a Queue or Topic Connection, we only need one per pool */
-    private Connection jmsConnection = null;
-    /** The Indentifier of the pool */
-    private Map<String, String> poolKey;
-    /** Logger */
-    private Logger logger = Logger.getLogger(this.getClass());
-    /** Context, which is cached until we encounter a naming exception, or the pool is rebuild */
-    private Context jndiContext;
-    /**
-     * Contructor of the pool.
-     * 
-     */
-    public JmsConnectionPool(Map<String, String> poolKey) 
-    {
-        this.poolKey = poolKey;
-    }
-   
-    /**
-     * This is where we create the sessions. 
-     * 
-     * @param poolKey
-     * @throws NamingException
-     * @throws JMSException
-     * @throws ConnectionException
-     */
-    private  synchronized void addAnotherSession(Map<String, String> poolKey)
-    throws NamingException, JMSException, ConnectionException
-    {
-        String destinationType = poolKey.get(JMSEpr.DESTINATION_TYPE_TAG);
-        
-        //Setup a connection if we don't have one
-        if (jmsConnection==null) {
-            JmsConnectionPoolContainer.addToPool(poolKey, this);
-            logger.debug("Creating a JMS Connection for ");
-            jndiContext = NamingContext.getServerContext(JmsConnectionPoolContainer.getJndiEnvironment(poolKey));
-            String connectionFactoryString = poolKey.get(JMSEpr.CONNECTION_FACTORY_TAG);
-            Object factoryConnection=null;
-            try {
-                factoryConnection = jndiContext.lookup(connectionFactoryString);
-            } catch (NamingException ne) {
-                logger.info("Received NamingException, refreshing context.");
-                jndiContext = NamingContext.getFreshServerContext(JmsConnectionPoolContainer.getJndiEnvironment(poolKey));
-                factoryConnection = jndiContext.lookup(connectionFactoryString);
-            }
-            if (JMSEpr.QUEUE_TYPE.equals(destinationType)) {
-                QueueConnectionFactory factory = (QueueConnectionFactory) factoryConnection;
-                jmsConnection = factory.createQueueConnection();
-            } else {
-                TopicConnectionFactory factory = (TopicConnectionFactory) factoryConnection;
-                jmsConnection = factory.createTopicConnection();
-            }
-            jmsConnection.setExceptionListener(new ExceptionListener() {
-                public void onException(JMSException arg0)
-                {
-                    removeSessionPool() ;
-                }
-            }) ;
-            jmsConnection.start();
-        }
-        //Create a new Session
-        if (JMSEpr.QUEUE_TYPE.equals(destinationType)) {
-            logger.debug("Creating a new Queue session.");
-            QueueSession session = ((QueueConnection)jmsConnection).createQueueSession(false,
-                    QueueSession.AUTO_ACKNOWLEDGE);
-            freeSessions.add(session);
-        } else if (JMSEpr.TOPIC_TYPE.equals(destinationType)) {
-            logger.debug("Creating a new Topic session.");
-            TopicSession session = ((TopicConnection) jmsConnection).createTopicSession(false,
-                        TopicSession.AUTO_ACKNOWLEDGE);
-            freeSessions.add(session);
-        } else {
-            throw new ConnectionException("Unknown destination type");
-        }
-        logger.debug("Number of Sessions in the pool now is " + getSessionsInPool());
-    }
-
-    /**
-     *  This method can be called whenever a connection is needed from the pool.
-     *  
-     * @return Connection to be used
-     * @throws ConnectionException
-     */
-    private synchronized Session getSession() throws NamingException, JMSException, ConnectionException
-    {
-        Session session = null;
-        int waitInSeconds = 0;
-        while (session == null) {
-            if (freeSessions.size() > 0)
-            {
-                if (logger.isDebugEnabled()) {
-                    logger.debug("Returning session, poolsize=" + getSessionsInPool() 
-                            + ", maxsize=" + MAX_SESSIONS 
-                            + ", number of pools=" + JmsConnectionPoolContainer.getNumberOfPools());
-                }
-                session = freeSessions.remove(freeSessions.size()-1);
-                inUseSessions.add(session);
-            } else {
-                if (waitInSeconds++ > 30) { 
-//                  We'll give up after not be able to get a session for 30 seconds.
-                    throw new ConnectionException("Could not obtain a JMS connection from the pool after 30s.");
-                }
-                //Add a connection if we can
-                if (inUseSessions.size()<MAX_SESSIONS) {
-                    addAnotherSession(poolKey);
-                } else {
-                    try {
-                        //wait one second and try again.
-                        logger.info("The connection pool was exhausted. Waiting 1 second before trying again..");
-                        wait(1000);
-                    } catch (Exception e) {
-                        e.printStackTrace();
-                    }
-                }
-            }
-        }
-        return session;
-    }
-    /**
-     *  This method can be called whenever a Queue Session is needed from the pool.
-     * @return
-     * @throws NamingException
-     * @throws JMSException
-     * @throws ConnectionException
-     */
-    public QueueSession getQueueSession() throws NamingException, JMSException, ConnectionException
-    {
-        return (QueueSession) getSession();
-    }
-    /**
-     * This method can be called whenever a Topic Session is needed from the pool.
-     * @return
-     * @throws NamingException
-     * @throws JMSException
-     * @throws ConnectionException
-     */
-    public TopicSession getTopicSession() throws NamingException, JMSException, ConnectionException
-    {
-        return (TopicSession) getSession();
-    }
-
-    /**
-     * This method closes an open connection and returns the connection to the pool.
-     * @param connectionToClose The connection to be returned to the pool.
-     * @throws SQLException
-     */
-    public  synchronized void closeSession(Session connectionToClose){
-        freeSessions.add(connectionToClose);
-        releaseSession(connectionToClose) ;
-    }
-    
-    /**
-     * This method closes an open session without returning it to the pool.
-     * @param sessionToClose The session to be returned to the pool.
-     * @throws SQLException
-     */
-    public synchronized void releaseSession(final Session sessionToClose) {
-        inUseSessions.remove(sessionToClose);
-        notifyAll() ;
-    }
-
-    /**
-     * This method is called when the pool needs to destroyed. It closes all open sessions
-     * and the connection and removes it from the container's poolMap.
-     */
-    public synchronized void removeSessionPool()
-    {
-        freeSessions.clear() ;
-        inUseSessions.clear() ;
-        logger.debug("Emptied the session pool now closing the connection to the factory.");
-        if (jmsConnection!=null) {
-            try {
-                jmsConnection.close();
-            } catch (final Exception ex) {} // ignore
-            jmsConnection=null;
-        }
-        JmsConnectionPoolContainer.removePool(poolKey);
-    }
-    /**
-     * Gets the total number of sessions in the pool.
-     * @return the session pool size
-     */
-    public int getSessionsInPool() {
-        return freeSessions.size() + inUseSessions.size();
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPool.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,244 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.rosetta.pooling;
+
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Map;
+
+import javax.jms.Connection;
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.jms.TopicConnection;
+import javax.jms.TopicConnectionFactory;
+import javax.jms.TopicSession;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.helpers.NamingContext;
+
+/**
+ * Interface that needs to be implemented to provide pool of connections.
+ * @see DefaultConnectionPoolImpl
+ * Default implementation of Connection Pool
+ * @author kstam
+ * Date: March 10, 2007
+ */
+public class JmsConnectionPool
+{
+    /** Maximum number of Sessions that will be created in this pool */
+    private int MAX_SESSIONS=20;    //TODO Make this manageable
+    /** Number of free sessions in the pool that can be given out */
+    private ArrayList<Session> freeSessions = new ArrayList<Session>();
+    /** Number of session that are currently in use */
+    private ArrayList<Session> inUseSessions = new ArrayList<Session>();
+    /** Reference to a Queue or Topic Connection, we only need one per pool */
+    private Connection jmsConnection = null;
+    /** The Indentifier of the pool */
+    private Map<String, String> poolKey;
+    /** Logger */
+    private Logger logger = Logger.getLogger(this.getClass());
+    /** Context, which is cached until we encounter a naming exception, or the pool is rebuild */
+    private Context jndiContext;
+    /**
+     * Contructor of the pool.
+     * 
+     */
+    public JmsConnectionPool(Map<String, String> poolKey) 
+    {
+        this.poolKey = poolKey;
+    }
+   
+    /**
+     * This is where we create the sessions. 
+     * 
+     * @param poolKey
+     * @throws NamingException
+     * @throws JMSException
+     * @throws ConnectionException
+     */
+    private  synchronized void addAnotherSession(Map<String, String> poolKey)
+    throws NamingException, JMSException, ConnectionException
+    {
+        String destinationType = poolKey.get(JMSEpr.DESTINATION_TYPE_TAG);
+        
+        //Setup a connection if we don't have one
+        if (jmsConnection==null) {
+            JmsConnectionPoolContainer.addToPool(poolKey, this);
+            logger.debug("Creating a JMS Connection for ");
+            jndiContext = NamingContext.getServerContext(JmsConnectionPoolContainer.getJndiEnvironment(poolKey));
+            String connectionFactoryString = poolKey.get(JMSEpr.CONNECTION_FACTORY_TAG);
+            Object factoryConnection=null;
+            try {
+                factoryConnection = jndiContext.lookup(connectionFactoryString);
+            } catch (NamingException ne) {
+                logger.info("Received NamingException, refreshing context.");
+                jndiContext = NamingContext.getFreshServerContext(JmsConnectionPoolContainer.getJndiEnvironment(poolKey));
+                factoryConnection = jndiContext.lookup(connectionFactoryString);
+            }
+            if (JMSEpr.QUEUE_TYPE.equals(destinationType)) {
+                QueueConnectionFactory factory = (QueueConnectionFactory) factoryConnection;
+                jmsConnection = factory.createQueueConnection();
+            } else {
+                TopicConnectionFactory factory = (TopicConnectionFactory) factoryConnection;
+                jmsConnection = factory.createTopicConnection();
+            }
+            jmsConnection.setExceptionListener(new ExceptionListener() {
+                public void onException(JMSException arg0)
+                {
+                    removeSessionPool() ;
+                }
+            }) ;
+            jmsConnection.start();
+        }
+        //Create a new Session
+        if (JMSEpr.QUEUE_TYPE.equals(destinationType)) {
+            logger.debug("Creating a new Queue session.");
+            QueueSession session = ((QueueConnection)jmsConnection).createQueueSession(false,
+                    QueueSession.AUTO_ACKNOWLEDGE);
+            freeSessions.add(session);
+        } else if (JMSEpr.TOPIC_TYPE.equals(destinationType)) {
+            logger.debug("Creating a new Topic session.");
+            TopicSession session = ((TopicConnection) jmsConnection).createTopicSession(false,
+                        TopicSession.AUTO_ACKNOWLEDGE);
+            freeSessions.add(session);
+        } else {
+            throw new ConnectionException("Unknown destination type");
+        }
+        logger.debug("Number of Sessions in the pool now is " + getSessionsInPool());
+    }
+
+    /**
+     *  This method can be called whenever a connection is needed from the pool.
+     *  
+     * @return Connection to be used
+     * @throws ConnectionException
+     */
+    private synchronized Session getSession() throws NamingException, JMSException, ConnectionException
+    {
+        Session session = null;
+        int waitInSeconds = 0;
+        while (session == null) {
+            if (freeSessions.size() > 0)
+            {
+                if (logger.isDebugEnabled()) {
+                    logger.debug("Returning session, poolsize=" + getSessionsInPool() 
+                            + ", maxsize=" + MAX_SESSIONS 
+                            + ", number of pools=" + JmsConnectionPoolContainer.getNumberOfPools());
+                }
+                session = freeSessions.remove(freeSessions.size()-1);
+                inUseSessions.add(session);
+            } else {
+                if (waitInSeconds++ > 30) { 
+//                  We'll give up after not be able to get a session for 30 seconds.
+                    throw new ConnectionException("Could not obtain a JMS connection from the pool after 30s.");
+                }
+                //Add a connection if we can
+                if (inUseSessions.size()<MAX_SESSIONS) {
+                    addAnotherSession(poolKey);
+                } else {
+                    try {
+                        //wait one second and try again.
+                        logger.info("The connection pool was exhausted. Waiting 1 second before trying again..");
+                        wait(1000);
+                    } catch (Exception e) {
+                        e.printStackTrace();
+                    }
+                }
+            }
+        }
+        return session;
+    }
+    /**
+     *  This method can be called whenever a Queue Session is needed from the pool.
+     * @return
+     * @throws NamingException
+     * @throws JMSException
+     * @throws ConnectionException
+     */
+    public QueueSession getQueueSession() throws NamingException, JMSException, ConnectionException
+    {
+        return (QueueSession) getSession();
+    }
+    /**
+     * This method can be called whenever a Topic Session is needed from the pool.
+     * @return
+     * @throws NamingException
+     * @throws JMSException
+     * @throws ConnectionException
+     */
+    public TopicSession getTopicSession() throws NamingException, JMSException, ConnectionException
+    {
+        return (TopicSession) getSession();
+    }
+
+    /**
+     * This method closes an open connection and returns the connection to the pool.
+     * @param connectionToClose The connection to be returned to the pool.
+     * @throws SQLException
+     */
+    public  synchronized void closeSession(Session connectionToClose){
+        freeSessions.add(connectionToClose);
+        releaseSession(connectionToClose) ;
+    }
+    
+    /**
+     * This method closes an open session without returning it to the pool.
+     * @param sessionToClose The session to be returned to the pool.
+     * @throws SQLException
+     */
+    public synchronized void releaseSession(final Session sessionToClose) {
+        inUseSessions.remove(sessionToClose);
+        notifyAll() ;
+    }
+
+    /**
+     * This method is called when the pool needs to destroyed. It closes all open sessions
+     * and the connection and removes it from the container's poolMap.
+     */
+    public synchronized void removeSessionPool()
+    {
+        freeSessions.clear() ;
+        inUseSessions.clear() ;
+        logger.debug("Emptied the session pool now closing the connection to the factory.");
+        if (jmsConnection!=null) {
+            try {
+                jmsConnection.close();
+            } catch (final Exception ex) {} // ignore
+            jmsConnection=null;
+        }
+        JmsConnectionPoolContainer.removePool(poolKey);
+    }
+    /**
+     * Gets the total number of sessions in the pool.
+     * @return the session pool size
+     */
+    public int getSessionsInPool() {
+        return freeSessions.size() + inUseSessions.size();
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.internal.soa.esb.rosetta.pooling;
-
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.Properties;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.jms.JMSException;
-
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-
-/**
- * This is a temporary pooling class until we start using JCA. It is designed to build
- * a JMS session pool for each ConnectionFactory.
- * 
- * @author kstam
- * Date: March 13, 2007
- */
-public class JmsConnectionPoolContainer{
-    /**
-     * Container of all the pools in the system.
-     */
-    private static ConcurrentHashMap<Map<String, String>, JmsConnectionPool> poolMap 
-        = new ConcurrentHashMap<Map<String, String>, JmsConnectionPool>();
-   
-    /**
-     * Returns the pool given a JMSEpr.
-     * 
-     * @param jmsEpr
-     * @return JmsSessionPool
-     * @throws ConnectionException
-     * @throws URISyntaxException
-     */
-    public static JmsConnectionPool getPool(JMSEpr jmsEpr) throws ConnectionException, URISyntaxException
-    {
-        return getPool(jmsEpr.getJndiEnvironment()
-                , jmsEpr.getConnectionFactory(), jmsEpr.getDestinationType());
-    }
-    /**
-     * Returns the pool given the identifiers for the JMS provider.
-     * 
-     * @param poolKey
-     * @return
-     * @throws ConnectionException
-     */
-    public static JmsConnectionPool getPool(Properties enviroment, String connectionFactory, String destinationType)
-    {
-        Map<String,String> poolKey = createPoolKey(enviroment, connectionFactory, destinationType);
-        if (poolMap.containsKey(poolKey)) {
-            return poolMap.get(poolKey);
-        } else {
-            JmsConnectionPool pool = new JmsConnectionPool(poolKey);
-            poolMap.put(poolKey, pool);
-            return pool;
-        }
-    }
-    /**
-     * Creates a poolKey using the identifying parameters
-     * 
-     * @param environment - the JNDI environment parameters
-     * @param connectionFactory
-     * @param destinationType
-     * @param destinationName
-     * @return
-     */
-    public static Map<String, String> createPoolKey(Properties  environment, String connectionFactory, String destinationType) 
-    {
-        Map<String,String> poolKey = new HashMap<String,String>();
-        if (environment!=null) {
-            for (Object key : environment.keySet()) {
-                poolKey.put(key.toString(), environment.getProperty(key.toString()));
-            }
-        }
-        if (connectionFactory!=null)  poolKey.put(JMSEpr.CONNECTION_FACTORY_TAG, connectionFactory);
-        if (destinationType!=null)    poolKey.put(JMSEpr.DESTINATION_TYPE_TAG, destinationType);
-        return poolKey;
-    }
-    /**
-     * Returns the JNDI environment in the key.
-     * @param poolKey
-     * @return
-     */
-    public static Properties getJndiEnvironment(Map<String,String> poolKey) {
-        Properties environment = new Properties();
-        for (String key: poolKey.keySet()) {
-            if (key.startsWith("java.naming.")) {
-                environment.setProperty(key, poolKey.get(key));
-            }
-        }
-        return environment;
-    }
-    /**
-     * Gets the number of pools in the constainer.
-     * 
-     */
-    public static int getNumberOfPools() {
-        return poolMap.size();
-    }
-    /**
-     * Removes the poolKey from the poolMap.
-     * 
-     * @param poolKey
-     */
-    protected static void removePool(Map<String, String> poolKey) {
-        if (poolMap.containsKey(poolKey)) {
-            poolMap.remove(poolKey);
-        }
-    }
-    /**
-     * Adds this poolKey and pool to the the poolMap.
-     * 
-     * @param poolKey
-     */
-    protected static void addToPool(Map<String, String> poolKey, JmsConnectionPool pool) {
-        if (!poolMap.containsKey(poolKey)) {
-            poolMap.put(poolKey, pool);
-        }
-    }
-    /**
-     * Removes all pools from the container.
-     * 
-     */
-    public static void removeAllPools() throws JMSException{
-        for (Map<String,String> poolKey : poolMap.keySet()) {
-            poolMap.get(poolKey).removeSessionPool();
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/rosetta/pooling/JmsConnectionPoolContainer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,150 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.rosetta.pooling;
+
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.Properties;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.jms.JMSException;
+
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+
+/**
+ * This is a temporary pooling class until we start using JCA. It is designed to build
+ * a JMS session pool for each ConnectionFactory.
+ * 
+ * @author kstam
+ * Date: March 13, 2007
+ */
+public class JmsConnectionPoolContainer{
+    /**
+     * Container of all the pools in the system.
+     */
+    private static ConcurrentHashMap<Map<String, String>, JmsConnectionPool> poolMap 
+        = new ConcurrentHashMap<Map<String, String>, JmsConnectionPool>();
+   
+    /**
+     * Returns the pool given a JMSEpr.
+     * 
+     * @param jmsEpr
+     * @return JmsSessionPool
+     * @throws ConnectionException
+     * @throws URISyntaxException
+     */
+    public static JmsConnectionPool getPool(JMSEpr jmsEpr) throws ConnectionException, URISyntaxException
+    {
+        return getPool(jmsEpr.getJndiEnvironment()
+                , jmsEpr.getConnectionFactory(), jmsEpr.getDestinationType());
+    }
+    /**
+     * Returns the pool given the identifiers for the JMS provider.
+     * 
+     * @param poolKey
+     * @return
+     * @throws ConnectionException
+     */
+    public static JmsConnectionPool getPool(Properties enviroment, String connectionFactory, String destinationType)
+    {
+        Map<String,String> poolKey = createPoolKey(enviroment, connectionFactory, destinationType);
+        if (poolMap.containsKey(poolKey)) {
+            return poolMap.get(poolKey);
+        } else {
+            JmsConnectionPool pool = new JmsConnectionPool(poolKey);
+            poolMap.put(poolKey, pool);
+            return pool;
+        }
+    }
+    /**
+     * Creates a poolKey using the identifying parameters
+     * 
+     * @param environment - the JNDI environment parameters
+     * @param connectionFactory
+     * @param destinationType
+     * @param destinationName
+     * @return
+     */
+    public static Map<String, String> createPoolKey(Properties  environment, String connectionFactory, String destinationType) 
+    {
+        Map<String,String> poolKey = new HashMap<String,String>();
+        if (environment!=null) {
+            for (Object key : environment.keySet()) {
+                poolKey.put(key.toString(), environment.getProperty(key.toString()));
+            }
+        }
+        if (connectionFactory!=null)  poolKey.put(JMSEpr.CONNECTION_FACTORY_TAG, connectionFactory);
+        if (destinationType!=null)    poolKey.put(JMSEpr.DESTINATION_TYPE_TAG, destinationType);
+        return poolKey;
+    }
+    /**
+     * Returns the JNDI environment in the key.
+     * @param poolKey
+     * @return
+     */
+    public static Properties getJndiEnvironment(Map<String,String> poolKey) {
+        Properties environment = new Properties();
+        for (String key: poolKey.keySet()) {
+            if (key.startsWith("java.naming.")) {
+                environment.setProperty(key, poolKey.get(key));
+            }
+        }
+        return environment;
+    }
+    /**
+     * Gets the number of pools in the constainer.
+     * 
+     */
+    public static int getNumberOfPools() {
+        return poolMap.size();
+    }
+    /**
+     * Removes the poolKey from the poolMap.
+     * 
+     * @param poolKey
+     */
+    protected static void removePool(Map<String, String> poolKey) {
+        if (poolMap.containsKey(poolKey)) {
+            poolMap.remove(poolKey);
+        }
+    }
+    /**
+     * Adds this poolKey and pool to the the poolMap.
+     * 
+     * @param poolKey
+     */
+    protected static void addToPool(Map<String, String> poolKey, JmsConnectionPool pool) {
+        if (!poolMap.containsKey(poolKey)) {
+            poolMap.put(poolKey, pool);
+        }
+    }
+    /**
+     * Removes all pools from the container.
+     * 
+     */
+    public static void removeAllPools() throws JMSException{
+        for (Map<String,String> poolKey : poolMap.keySet()) {
+            poolMap.get(poolKey).removeSessionPool();
+        }
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,711 +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.internal.soa.esb.services.registry;
-
-import java.net.PasswordAuthentication;
-import java.net.URLDecoder;
-import java.net.URLEncoder;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.xml.registry.BulkResponse;
-import javax.xml.registry.BusinessLifeCycleManager;
-import javax.xml.registry.BusinessQueryManager;
-import javax.xml.registry.Connection;
-import javax.xml.registry.ConnectionFactory;
-import javax.xml.registry.FindQualifier;
-import javax.xml.registry.JAXRException;
-import javax.xml.registry.JAXRResponse;
-import javax.xml.registry.RegistryService;
-import javax.xml.registry.infomodel.Classification;
-import javax.xml.registry.infomodel.ClassificationScheme;
-import javax.xml.registry.infomodel.EmailAddress;
-import javax.xml.registry.infomodel.Key;
-import javax.xml.registry.infomodel.Organization;
-import javax.xml.registry.infomodel.PersonName;
-import javax.xml.registry.infomodel.PostalAddress;
-import javax.xml.registry.infomodel.RegistryObject;
-import javax.xml.registry.infomodel.Service;
-import javax.xml.registry.infomodel.ServiceBinding;
-import javax.xml.registry.infomodel.TelephoneNumber;
-import javax.xml.registry.infomodel.User;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.common.Configuration;
-import org.jboss.soa.esb.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryException;
-/**
- * Utility class for the Registry.
- * If need be we can extract the interface from here, add a factory and have JAXR as a plugin, allowing
- * for other RegistryAPIs.
- *
- * @author Kurt Stam
- */
-public class JAXRRegistryImpl implements Registry
-{
-	private static Logger logger = Logger.getLogger(JAXRRegistryImpl.class);
-	public static Set<PasswordAuthentication> creds = new HashSet<PasswordAuthentication>();
-	private static Properties props = new Properties();
-	private static Organization jbossESBOrganization;
-	
-	private synchronized static void init() 
-	{
-	    props = new Properties();
-	    props.setProperty("javax.xml.registry.queryManagerURL", Configuration.getRegistryQueryManageURI());
-	    props.setProperty("javax.xml.registry.lifeCycleManagerURL", Configuration.getRegistryLifecycleManagerURI());
-	    props.setProperty("javax.xml.registry.factoryClass", Configuration.getRegistryFactoryClass());
-	    props.setProperty("scout.proxy.transportClass", Configuration.getRegistryScoutTransportClass());
-	    String user = Configuration.getRegistryUser();
-	    String password = Configuration.getRegistryPassword();
-	    PasswordAuthentication passwdAuth = new PasswordAuthentication(user, password.toCharArray());
-        creds.add(passwdAuth);
-	}
-
-	/** 
-	 * Creates a connecton to a JAXR capable registy.
-	 * 
-	 * @return Connection to a Registry using JAXR. 
-	 */
-	protected synchronized static Connection getConnection() 
-	{
-		Connection connection = null;
-		init();
-	    try
-	    {   // Create the connection, passing it the configuration properties
-	        ConnectionFactory factory = ConnectionFactory.newInstance();
-	        factory.setProperties(props);
-	        connection = factory.createConnection();
-	    } catch (JAXRException e) {
-            logger.log(Level.ERROR, "Could not set up a connection to the Registry. " + e.getMessage(), e);
-	    }
-	    return connection;
-	}
-	/**
-	 * Closes the connection to the Registry
-	 */
-	protected synchronized static void closeConnection(Connection connection)
-	{
-		try {
-			if (connection!=null && !connection.isClosed()) {
-				connection.close();
-			}
-		} catch (JAXRException je) {
-			logger.log(Level.ERROR, je.getMessage(), je);
-		}
-	}
-	/** 
-	 * Publish an EPR to the Registry
-	 */
-	protected Service registerService(String category, String serviceName, String serviceDescription) throws JAXRException 
-	{
-		Service service =null;
-		Organization organization = getJBossESBOrganization();
-		Connection connection = JAXRRegistryImpl.getConnection();
-		try {
-			connection.setCredentials(JAXRRegistryImpl.creds);
-			RegistryService rs = connection.getRegistryService();
-            BusinessQueryManager bqm = rs.getBusinessQueryManager();
-			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
-		    //Adding the category as prefix for the name
-			service = blm.createService(blm.createInternationalString(serviceName));
-			service.setDescription(blm.createInternationalString(serviceDescription));
-            Collection<String> findQualifiers = new ArrayList<String>();
-            findQualifiers.add(FindQualifier.AND_ALL_KEYS);
-            findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
-			ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
-            Classification classification = blm.createClassification(cScheme, "category", category);
-			service.addClassification(classification);
-			organization.addService(service);
-			saveRegistryObject(service);
-		} finally {
-			closeConnection(connection);
-		}
-		return service;
-	}
-	/** 
-	 * Remove an EPR from the Registry
-	 */
-	@SuppressWarnings("unchecked")
-    public void unRegisterService(String category, String serviceName) throws RegistryException{
-//    first find the ServiceBindings for this service
-        Connection connection = JAXRRegistryImpl.getConnection();
-        Service service = null;
-        try {
-            service = findService(category, serviceName);
-            if (service==null) {
-                throw new RegistryException("No such EPR found for service with name = " 
-                        + serviceName);
-            }
-            connection.setCredentials(JAXRRegistryImpl.creds);
-            RegistryService rs = connection.getRegistryService();
-            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
-            Collection<Key> serviceKeys = new ArrayList<Key>();
-            serviceKeys.add(service.getKey());
-            blm.deleteServices(serviceKeys);
-        } catch (Exception je) {
-            throw new RegistryException(je.getLocalizedMessage(), je);
-        } finally {
-            closeConnection(connection);
-        }
-	}
-	/** 
-	 * Publish an EPR to the Registry
-	 */
-	public void registerEPR(String category, String serviceName, String serviceDescription, EPR epr, String eprDescription) 
-		throws RegistryException
-	{
-		Connection connection = JAXRRegistryImpl.getConnection();
-		try {
-			//Find the service
-			Service service = findService(category,serviceName);
-			if (service==null) {
-				logger.log(Level.DEBUG, "Service " + serviceName + " does not yet exist, creating now..");
-				service = registerService(category, serviceName, serviceDescription);
-			}
-
-			connection.setCredentials(JAXRRegistryImpl.creds);
-			RegistryService rs = connection.getRegistryService();
-			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
-            BusinessQueryManager bqm = rs.getBusinessQueryManager();
-			ServiceBinding serviceBinding = blm.createServiceBinding();
-			serviceBinding.setDescription(blm.createInternationalString(eprDescription));
-			String xml = EPRHelper.toXMLString(epr);
-			serviceBinding.setAccessURI(URLEncoder.encode(xml,"UTF-8"));
-
-//			The following code would store the EPR xml as an ExtrinsicObject, but scout does not
-//          have an implementation for it.
-//			DataHandler repositoryItem = new DataHandler(xml,"text/xml");
-//			ExtrinsicObject eo = blm.createExtrinsicObject(repositoryItem);
-//			eo.setName(blm.createInternationalString("EPR"));
-//			eo.setMimeType("text/xml");
-//			String conceptId = "urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ExtrinsicObject:XML";
-//			Concept objectTypeConcept = (Concept) bqm.getRegistryObject(conceptId);
-//				((ExtrinsicObjectImpl)eo).setObjectType(objectTypeConcept); 
-			
-//			Concept specConcept = blm.createConcept(null, "HelloConcept", "");
-//			String schemeName = "uddi-org:types";
-//			ClassificationScheme uddiOrgTypes =
-//			     bqm.findClassificationSchemeByName(null, schemeName);
-//			Classification wsdlSpecClassification = 
-//			     blm.createClassification(uddiOrgTypes,
-//			       "eprSpec", xml);
-//			   specConcept.addClassification(wsdlSpecClassification);
-//			Collection<Concept> concepts = new ArrayList<Concept>();
-//			concepts.add(specConcept);
-//			BulkResponse br=blm.saveConcepts(concepts);
-//			Key conceptKey = null;
-//			if (br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
-//				Collection keys = br.getCollection();
-//				for (Iterator i=keys.iterator();i.hasNext();){
-//					conceptKey = (Key) i.next();
-//					break;
-//				}
-//			} else {
-//				throw new RegistryException("Could not save the EPR as Concept");
-//			}
-//			//now adding this concept to the binding
-//			Concept specificationConcept = (Concept) bqm.getRegistryObject(conceptKey.getId(), LifeCycleManager.CONCEPT);
-//			SpecificationLink specificationLink = blm.createSpecificationLink();
-//			specificationLink.setSpecificationObject(specificationConcept);
-//			serviceBinding.addSpecificationLink(specificationLink);
-		
-		    ArrayList<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
-		    serviceBindings.add(serviceBinding);
-		    service.addServiceBindings(serviceBindings);
-            Collection<String> findQualifiers = new ArrayList<String>();
-            findQualifiers.add(FindQualifier.AND_ALL_KEYS);
-            findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
-            ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
-            Classification classification = blm.createClassification(cScheme, "category", category);
-            service.addClassification(classification);
-           
-			saveRegistryObject(serviceBinding);
-		} catch (Exception je) {
-			throw new RegistryException(je.getLocalizedMessage(), je);
-		} finally {
-			closeConnection(connection);
-		}
-	}
-	/** 
-	 * Remove an EPR from the Registry
-	 */
-	public void unRegisterEPR(String category, String serviceName, EPR toBeDeletedEPR) throws RegistryException{
-		//first find the ServiceBindings for this service
-        Connection connection = JAXRRegistryImpl.getConnection();
-        Service service = null;
-		try {
-            service = findService(category, serviceName);
-            if (service==null) {
-                throw new RegistryException("No such Service found for service with category= "
-                        + category + " and name = " + serviceName);
-            }
-            connection.setCredentials(JAXRRegistryImpl.creds);
-			Collection serviceBindings = findServiceBindings(service);
-			service.addServiceBindings(serviceBindings);
-			for (Iterator i=serviceBindings.iterator();i.hasNext();){
-				ServiceBinding serviceBinding = (ServiceBinding) i.next();
-				String xml = URLDecoder.decode(serviceBinding.getAccessURI(), "UTF-8");
-				if (xml.equals(EPRHelper.toXMLString(toBeDeletedEPR))) {
-                    RegistryService rs = connection.getRegistryService();
-                    BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
-                    Collection<Key> serviceBindingKeys = new ArrayList<Key>();
-                    serviceBindingKeys.add(serviceBinding.getKey());
-                    blm.deleteServiceBindings(serviceBindingKeys);
-					return;
-				}
-			}
-            throw new RegistryException("No such EPR found for service with name = " 
-                    + serviceName + " and EPR=" + toBeDeletedEPR);
-		} catch (Exception je) {
-			throw new RegistryException(je.getLocalizedMessage(), je);
-		} finally {
-		    closeConnection(connection);
-        }
-	}
-	
-	/** 
-	 * {@inheritDoc}
-	 * @return collection services
-	 */
-	public Collection<String> findAllServices() throws RegistryException
-	{
-		Collection<String> serviceNames = new ArrayList<String>();
-		try {
-			Collection services = getJBossESBOrganization().getServices();
-			for (Iterator i=services.iterator();i.hasNext();) {
-				String serviceName = ((Service)i.next()).getName().getValue();
-				serviceNames.add(serviceName);
-			}
-		} catch (JAXRException je) {
-			throw new RegistryException(je.getLocalizedMessage(), je);
-		}
-		return serviceNames;
-	}
-	/**
-	 * Find Services based on a category ("transformation").
-	 * 
-	 * @param serviceType
-	 * @return collection services
-	 */
-	public Collection<String> findServices(String category) throws RegistryException
-	{
-		Collection<String>serviceNames = new ArrayList<String>();
-		try {
-			Collection<Service>services = findServicesForCategory(category);
-			for (Iterator<Service> i=services.iterator();i.hasNext();) {
-				String serviceName = i.next().getName().getValue();
-				serviceNames.add(serviceName);
-			}
-		} catch (JAXRException je) {
-			throw new RegistryException(je.getLocalizedMessage(), je);
-		}
-		return serviceNames;
-	}
-	/**
-	 * 
-	 * @param service
-	 * @return
-	 */
-	public Collection<EPR> findEPRs(String category, String serviceName) throws RegistryException
-	{
-		Collection<EPR> eprs = new ArrayList<EPR>();
-		Connection connection = JAXRRegistryImpl.getConnection();
-		try {
-			Service service = findService(category, serviceName);
-			if (service==null){
-				throw new RegistryException("Could not find service with category=" + category + " and serviceName=" + serviceName);
-			}
-			// Get registry service and business query manager
-			Collection<ServiceBinding> serviceBindings = findServiceBindings(service);
-			//Converting them to EPRs
-			for (Iterator i=serviceBindings.iterator();i.hasNext();) {
-				ServiceBinding serviceBinding = (ServiceBinding) i.next();
-				@SuppressWarnings("unused")
-				String eprXML = URLDecoder.decode(serviceBinding.getAccessURI(),"UTF-8");
-				EPR epr = EPRHelper.fromXMLString(eprXML);
-				eprs.add(epr);
-			}
-		} catch (Exception je) {
-			throw new RegistryException(je.getLocalizedMessage(), je);
-		} finally {
-			closeConnection(connection);
-		}
-		return eprs;
-	}
-	/**
-	 * 
-	 * @param service
-	 * @return
-	 */
-	public EPR findEPR(String category, String serviceName) throws RegistryException
-	{
-		EPR epr = null;
-		Connection connection = JAXRRegistryImpl.getConnection();
-		try {
-			Service service = findService(category, serviceName);
-			if (service==null){
-				throw new RegistryException("Could not find service with category=" + category + " and serviceName=" + serviceName);
-			}
-			// Get registry service and business query manager
-			Collection<ServiceBinding> serviceBindings = findServiceBindings(service);
-			if (serviceBindings.iterator().hasNext()) {
-				ServiceBinding serviceBinding = (ServiceBinding) serviceBindings.iterator().next();
-				String eprXML = URLDecoder.decode(serviceBinding.getAccessURI(),"UTF-8");
-				epr = EPRHelper.fromXMLString(eprXML);
-			}
-		} catch (Exception je) {
-			throw new RegistryException(je.getLocalizedMessage(), je);
-		} finally {
-			closeConnection(connection);
-		}
-		return epr;
-	}
-	/**
-	 * Find all Organizations with a name mathing the queryString parameter.
-	 * 
-	 * @param organizationName used to match with the name of the organization.
-	 * @return the Organization.
-	 */
-	protected synchronized static Organization findOrganization(String organizationName) throws JAXRException
-	{
-	    if (organizationName==null) {
-	    	organizationName="";
-	    }
-		Connection connection = JAXRRegistryImpl.getConnection();
-		try {
-			// Get registry service and business query manager
-			RegistryService rs = connection.getRegistryService();
-			BusinessQueryManager bqm = rs.getBusinessQueryManager();
-			// Define find qualifiers and name patterns
-			Collection<String> findQualifiers = new ArrayList<String>();
-			findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
-			Collection<String> namePatterns = new ArrayList<String>();
-			namePatterns.add("%" + organizationName + "%");
-	        //Find based upon qualifier type and values
-			logger.log(Level.DEBUG,"Going to query the registry for name pattern " + namePatterns);
-			BulkResponse response = bqm.findOrganizations(findQualifiers,
-					namePatterns, null, null, null, null);
-			if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
-				for (Iterator orgIter = response.getCollection().iterator(); orgIter.hasNext();) 
-				{
-					Organization org = (Organization) orgIter.next();
-					logger.log(Level.DEBUG, "Organization name: " + org.getName().getValue());
-					logger.log(Level.DEBUG, "Description: " + org.getDescription().getValue());
-					logger.log(Level.DEBUG, "Key id: " + org.getKey().getId());
-					User primaryContact = org.getPrimaryContact();
-					logger.log(Level.DEBUG, "Primary Contact: " + primaryContact.getPersonName().getFullName());
-					if (orgIter.hasNext()) {
-						logger.log(Level.ERROR, "Found " + response.getCollection().size() 
-								+ " Organization, while expecting only one of name " + organizationName);
-					}
-					return org;
-				}
-			}
-			return null;
-		} finally {
-			closeConnection(connection);
-		}
-	}
-	/**
-	 * 
-	 * @param category
-	 * @param serviceName
-	 * @return Service
-	 */
-	protected synchronized static Service findService(String category, String serviceName) throws JAXRException
-	{
-		if (category==null) {
-			category="";
-		}
-		if (serviceName==null) {
-			serviceName="";
-		}
-		Connection connection = JAXRRegistryImpl.getConnection();
-		try {
-			// Get registry service and business query manager
-			RegistryService rs = connection.getRegistryService();
-			BusinessQueryManager bqm = rs.getBusinessQueryManager();
-            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
-			// Define find qualifiers and name patterns
-            Collection<String> findQualifiers = new ArrayList<String>();
-            findQualifiers.add(FindQualifier.AND_ALL_KEYS);
-            findQualifiers.add(FindQualifier.EXACT_NAME_MATCH);
-            findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
-            ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
-            Collection<Classification> classifications = new ArrayList<Classification>();
-            Classification classification = 
-                blm.createClassification( 
-                  cScheme, 
-                  "category", category );
-            classifications.add(classification);
-			Collection<String> namePatterns = new ArrayList<String>();
-			namePatterns.add(serviceName);
-	        //Find based upon qualifier type and values
-			logger.log(Level.DEBUG, "Going to query the registry for name pattern " + namePatterns);
-			BulkResponse response = bqm.findServices(null, findQualifiers,
-					namePatterns, classifications, null);
-			if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
-				for (Iterator servIter = response.getCollection().iterator(); servIter.hasNext();) 
-				{
-					Service service = (Service) servIter.next();
-					logger.log(Level.DEBUG, "Service name: " + service.getName().getValue());
-					if (service.getDescription()!=null) {
-						logger.log(Level.DEBUG, "Description: " + service.getDescription().getValue());
-					}
-					logger.log(Level.DEBUG, "Key id: " + service.getKey().getId());
-					if (servIter.hasNext()) {
-						logger.log(Level.ERROR, "Found " + response.getCollection().size() 
-								+ " Services, while expecting only one by the name of " 
-								+ serviceName + " in category " + category);
-					}
-					return service;
-				}
-			}
-			return null;
-		} finally {
-			closeConnection(connection);
-		}
-	}
-	/**
-	 * Finds all services for a given category.
-	 * @param category
-	 * @param serviceName
-	 * @return Service
-	 */
-	@SuppressWarnings("unchecked")
-	protected synchronized static Collection<Service> findServicesForCategory(String category) throws JAXRException
-	{
-		Collection<Service> services = new ArrayList<Service>();
-		if (category==null) {
-			category="";
-		}
-		Connection connection = JAXRRegistryImpl.getConnection();
-		try {
-			// Get registry service and business query manager
-			RegistryService rs = connection.getRegistryService();
-			BusinessQueryManager bqm = rs.getBusinessQueryManager();
-            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
-            Collection<String> findQualifiers = new ArrayList<String>();
-            findQualifiers.add(FindQualifier.AND_ALL_KEYS);
-            findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
-            ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");  
-            //Create classification
-            Classification classification = 
-                blm.createClassification( 
-                  cScheme, 
-                  "category", category );
-            
-			// Define find qualifiers and name patterns
-			//Collection<String> findQualifiers = new ArrayList<String>();
-			//findQualifiers.add(FindQualifier.AND_ALL_KEYS);
-			findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
-			Collection<Classification> classifications = new ArrayList<Classification>();
-            classifications.add(classification);
-	        //Find based upon qualifier type and values
-			logger.log(Level.DEBUG, "Going to query the registry for classification " + classifications);
-			BulkResponse response = bqm.findServices(null, findQualifiers,
-					null, classifications, null);
-			if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
-				services = response.getCollection();
-			}
-			return services;
-		} finally {
-			closeConnection(connection);
-		}
-	}
-	/**
-	 * Create a jbossesb organization under which we will register all our services.
-	 * 
-	 * @param blm
-	 * @return
-	 * @throws JAXRException
-	 */
-	protected synchronized static Organization createJBossESBOrganization()
-			throws JAXRException 
-	{
-//		Getting the connection to the Registry (reading config)
-		Connection connection = JAXRRegistryImpl.getConnection();
-		try {
-			//Logging in
-			connection.setCredentials(JAXRRegistryImpl.creds);
-			RegistryService rs = connection.getRegistryService();
-			//Building organization
-			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
-			Organization organization = blm.createOrganization(blm.createInternationalString("Red Hat/JBossESB"));
-				organization.setDescription(blm.createInternationalString("Red Hat/JBoss Professional Open Source, Services for the JBossESB"));
-
-			User user = blm.createUser();
-			organization.setPrimaryContact(user);
-			PersonName personName = blm.createPersonName("JBossESB");
-			TelephoneNumber telephoneNumber = blm.createTelephoneNumber();
-			telephoneNumber.setNumber("404 467-8555");
-			telephoneNumber.setType(null);
-			PostalAddress address = blm.createPostalAddress("3340",
-					"Peachtree Road, NE, Suite 1200", "Atlanta", "GA", "USA",
-					"30326", "");
-			Collection<PostalAddress> postalAddresses = new ArrayList<PostalAddress>();
-			postalAddresses.add(address);
-			Collection<EmailAddress> emailAddresses = new ArrayList<EmailAddress>();
-			EmailAddress emailAddress = blm
-					.createEmailAddress("jbossesb at jboss.com");
-			emailAddresses.add(emailAddress);
-	
-			Collection<TelephoneNumber> numbers = new ArrayList<TelephoneNumber>();
-			numbers.add(telephoneNumber);
-			user.setPersonName(personName);
-			user.setPostalAddresses(postalAddresses);
-			user.setEmailAddresses(emailAddresses);
-			user.setTelephoneNumbers(numbers);
-	
-	//		Scout does not support this (yet), so leaving it out for now.
-	//		ClassificationScheme cScheme = getClassificationScheme(blm,
-	//				blm.createInternationalString("uddi-org:general_keywords"), blm.createInternationalString(""));
-	//		Classification classification = blm.createClassification(cScheme,
-	//				blm.createInternationalString("JBoss ESB"), blm.createInternationalString("JBESB"));
-	//		org.addClassification(classification);
-			
-			saveRegistryObject(organization);
-			return organization;
-		} finally {
-			closeConnection(connection);
-		}	
-	}
-	/**
-	 * Save Registry Object
-	 */
-	protected synchronized static void saveRegistryObject(RegistryObject registryObject) throws JAXRException
-	{
-//		Getting the connection to the Registry (reading config)
-		Connection connection = JAXRRegistryImpl.getConnection();
-		try {
-			Collection<RegistryObject> registryObjects = new ArrayList<RegistryObject>();
-			BulkResponse br = null;
-			//Logging in
-			connection.setCredentials(JAXRRegistryImpl.creds);
-			RegistryService rs = connection.getRegistryService();
-			//Building organization
-			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
-			registryObjects.add(registryObject);
-			Class[] interfaces = registryObject.getClass().getInterfaces();
-			String interfaceName ="";
-			for (int i=0; i<interfaces.length; i++) {
-				interfaceName = interfaces[i].getName();
-				if (interfaceName.equals("javax.xml.registry.infomodel.Organization")) {
-					br = blm.saveOrganizations(registryObjects);
-					break;
-				} else if (interfaceName.equals("javax.xml.registry.infomodel.Service")) {
-					br = blm.saveServices(registryObjects);
-					break;
-				} else if (interfaceName.equals("javax.xml.registry.infomodel.ServiceBinding")) {
-					br = blm.saveServiceBindings(registryObjects);
-					break;
-				} else {
-					logger.log(Level.ERROR, "Trying to save an unsupported RegistryObject");
-					throw new JAXRException("Trying to save an unsupported RegistryObject");
-				}
-			}
-            //Verify the return
-			if (br!=null && br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
-				logger.log(Level.DEBUG, interfaceName + " successfully saved");
-				Collection coll = br.getCollection();
-				Iterator iter = coll.iterator();
-				while (iter.hasNext()) {
-					Key key = (Key) iter.next();
-					registryObject.setKey(key);
-					logger.log(Level.DEBUG, "Saved Key=" + key.getId());
-				}
-			} else {
-				logger.log(Level.ERROR, "Errors occurred during save.");
-				if (br!=null) {
-					Collection exceptions = br.getExceptions();
-					Iterator iter = exceptions.iterator();
-					String errors = "";
-					JAXRException je = new JAXRException("JAXRExceptions occurred during save");
-					while (iter.hasNext()) {
-						Exception e = (Exception) iter.next();
-						errors += e.getLocalizedMessage() + "\n";
-						je.setStackTrace(e.getStackTrace());
-						logger.log(Level.ERROR, e.getLocalizedMessage(), e);
-						//if it's the last error, throw it now and set the current stacktrace
-						if (!iter.hasNext()) {
-							throw new JAXRException(errors, e);
-						}
-					}
-					throw new JAXRException("Errors occurred during save. Response status=" + br.getStatus());
-				}
-				throw new JAXRException("Errors occurred during save");
-			}
-		} finally {
-			JAXRRegistryImpl.closeConnection(connection);
-		}	
-	}
-	/**
-	 * finds the JBossESB Organizationa and creates one if it is not there.
-	 * @return JBossESB Organization
-	 * @throws JAXRException
-	 */
-	private Organization getJBossESBOrganization() throws JAXRException
-	{
-		jbossESBOrganization = findOrganization("Red Hat/JBossESB");
-		if (jbossESBOrganization==null) {
-			jbossESBOrganization = createJBossESBOrganization();
-		}
-		return jbossESBOrganization;
-	}
-	/**
-	 * Find the ServiceBindings for a given Service
-	 * @param service
-	 * @return
-	 * @throws RegistryException
-	 */
-	@SuppressWarnings("unchecked")
-	private Collection<ServiceBinding> findServiceBindings(Service service) throws RegistryException
-	{
-		Collection<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
-		Connection connection = JAXRRegistryImpl.getConnection();
-		try {
-			RegistryService rs = connection.getRegistryService();
-			BusinessQueryManager bqm = rs.getBusinessQueryManager();
-			Collection<String> findQualifiers = new ArrayList<String>();
-			findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
-			BulkResponse bulkResponse = bqm.findServiceBindings(service.getKey(),findQualifiers,null,null);
-			if (bulkResponse.getStatus()==JAXRResponse.STATUS_SUCCESS){
-				serviceBindings = bulkResponse.getCollection();
-			}
-			return serviceBindings;
-		} catch (Exception je) {
-			throw new RegistryException(je.getLocalizedMessage(), je);
-		} finally {
-			closeConnection(connection);
-		}
-	}
-	
-}
-
-	

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,711 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.services.registry;
+
+import java.net.PasswordAuthentication;
+import java.net.URLDecoder;
+import java.net.URLEncoder;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.xml.registry.BulkResponse;
+import javax.xml.registry.BusinessLifeCycleManager;
+import javax.xml.registry.BusinessQueryManager;
+import javax.xml.registry.Connection;
+import javax.xml.registry.ConnectionFactory;
+import javax.xml.registry.FindQualifier;
+import javax.xml.registry.JAXRException;
+import javax.xml.registry.JAXRResponse;
+import javax.xml.registry.RegistryService;
+import javax.xml.registry.infomodel.Classification;
+import javax.xml.registry.infomodel.ClassificationScheme;
+import javax.xml.registry.infomodel.EmailAddress;
+import javax.xml.registry.infomodel.Key;
+import javax.xml.registry.infomodel.Organization;
+import javax.xml.registry.infomodel.PersonName;
+import javax.xml.registry.infomodel.PostalAddress;
+import javax.xml.registry.infomodel.RegistryObject;
+import javax.xml.registry.infomodel.Service;
+import javax.xml.registry.infomodel.ServiceBinding;
+import javax.xml.registry.infomodel.TelephoneNumber;
+import javax.xml.registry.infomodel.User;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.services.registry.Registry;
+import org.jboss.soa.esb.services.registry.RegistryException;
+/**
+ * Utility class for the Registry.
+ * If need be we can extract the interface from here, add a factory and have JAXR as a plugin, allowing
+ * for other RegistryAPIs.
+ *
+ * @author Kurt Stam
+ */
+public class JAXRRegistryImpl implements Registry
+{
+	private static Logger logger = Logger.getLogger(JAXRRegistryImpl.class);
+	public static Set<PasswordAuthentication> creds = new HashSet<PasswordAuthentication>();
+	private static Properties props = new Properties();
+	private static Organization jbossESBOrganization;
+	
+	private synchronized static void init() 
+	{
+	    props = new Properties();
+	    props.setProperty("javax.xml.registry.queryManagerURL", Configuration.getRegistryQueryManageURI());
+	    props.setProperty("javax.xml.registry.lifeCycleManagerURL", Configuration.getRegistryLifecycleManagerURI());
+	    props.setProperty("javax.xml.registry.factoryClass", Configuration.getRegistryFactoryClass());
+	    props.setProperty("scout.proxy.transportClass", Configuration.getRegistryScoutTransportClass());
+	    String user = Configuration.getRegistryUser();
+	    String password = Configuration.getRegistryPassword();
+	    PasswordAuthentication passwdAuth = new PasswordAuthentication(user, password.toCharArray());
+        creds.add(passwdAuth);
+	}
+
+	/** 
+	 * Creates a connecton to a JAXR capable registy.
+	 * 
+	 * @return Connection to a Registry using JAXR. 
+	 */
+	protected synchronized static Connection getConnection() 
+	{
+		Connection connection = null;
+		init();
+	    try
+	    {   // Create the connection, passing it the configuration properties
+	        ConnectionFactory factory = ConnectionFactory.newInstance();
+	        factory.setProperties(props);
+	        connection = factory.createConnection();
+	    } catch (JAXRException e) {
+            logger.log(Level.ERROR, "Could not set up a connection to the Registry. " + e.getMessage(), e);
+	    }
+	    return connection;
+	}
+	/**
+	 * Closes the connection to the Registry
+	 */
+	protected synchronized static void closeConnection(Connection connection)
+	{
+		try {
+			if (connection!=null && !connection.isClosed()) {
+				connection.close();
+			}
+		} catch (JAXRException je) {
+			logger.log(Level.ERROR, je.getMessage(), je);
+		}
+	}
+	/** 
+	 * Publish an EPR to the Registry
+	 */
+	protected Service registerService(String category, String serviceName, String serviceDescription) throws JAXRException 
+	{
+		Service service =null;
+		Organization organization = getJBossESBOrganization();
+		Connection connection = JAXRRegistryImpl.getConnection();
+		try {
+			connection.setCredentials(JAXRRegistryImpl.creds);
+			RegistryService rs = connection.getRegistryService();
+            BusinessQueryManager bqm = rs.getBusinessQueryManager();
+			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+		    //Adding the category as prefix for the name
+			service = blm.createService(blm.createInternationalString(serviceName));
+			service.setDescription(blm.createInternationalString(serviceDescription));
+            Collection<String> findQualifiers = new ArrayList<String>();
+            findQualifiers.add(FindQualifier.AND_ALL_KEYS);
+            findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
+			ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
+            Classification classification = blm.createClassification(cScheme, "category", category);
+			service.addClassification(classification);
+			organization.addService(service);
+			saveRegistryObject(service);
+		} finally {
+			closeConnection(connection);
+		}
+		return service;
+	}
+	/** 
+	 * Remove an EPR from the Registry
+	 */
+	@SuppressWarnings("unchecked")
+    public void unRegisterService(String category, String serviceName) throws RegistryException{
+//    first find the ServiceBindings for this service
+        Connection connection = JAXRRegistryImpl.getConnection();
+        Service service = null;
+        try {
+            service = findService(category, serviceName);
+            if (service==null) {
+                throw new RegistryException("No such EPR found for service with name = " 
+                        + serviceName);
+            }
+            connection.setCredentials(JAXRRegistryImpl.creds);
+            RegistryService rs = connection.getRegistryService();
+            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+            Collection<Key> serviceKeys = new ArrayList<Key>();
+            serviceKeys.add(service.getKey());
+            blm.deleteServices(serviceKeys);
+        } catch (Exception je) {
+            throw new RegistryException(je.getLocalizedMessage(), je);
+        } finally {
+            closeConnection(connection);
+        }
+	}
+	/** 
+	 * Publish an EPR to the Registry
+	 */
+	public void registerEPR(String category, String serviceName, String serviceDescription, EPR epr, String eprDescription) 
+		throws RegistryException
+	{
+		Connection connection = JAXRRegistryImpl.getConnection();
+		try {
+			//Find the service
+			Service service = findService(category,serviceName);
+			if (service==null) {
+				logger.log(Level.DEBUG, "Service " + serviceName + " does not yet exist, creating now..");
+				service = registerService(category, serviceName, serviceDescription);
+			}
+
+			connection.setCredentials(JAXRRegistryImpl.creds);
+			RegistryService rs = connection.getRegistryService();
+			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+            BusinessQueryManager bqm = rs.getBusinessQueryManager();
+			ServiceBinding serviceBinding = blm.createServiceBinding();
+			serviceBinding.setDescription(blm.createInternationalString(eprDescription));
+			String xml = EPRHelper.toXMLString(epr);
+			serviceBinding.setAccessURI(URLEncoder.encode(xml,"UTF-8"));
+
+//			The following code would store the EPR xml as an ExtrinsicObject, but scout does not
+//          have an implementation for it.
+//			DataHandler repositoryItem = new DataHandler(xml,"text/xml");
+//			ExtrinsicObject eo = blm.createExtrinsicObject(repositoryItem);
+//			eo.setName(blm.createInternationalString("EPR"));
+//			eo.setMimeType("text/xml");
+//			String conceptId = "urn:oasis:names:tc:ebxml-regrep:ObjectType:RegistryObject:ExtrinsicObject:XML";
+//			Concept objectTypeConcept = (Concept) bqm.getRegistryObject(conceptId);
+//				((ExtrinsicObjectImpl)eo).setObjectType(objectTypeConcept); 
+			
+//			Concept specConcept = blm.createConcept(null, "HelloConcept", "");
+//			String schemeName = "uddi-org:types";
+//			ClassificationScheme uddiOrgTypes =
+//			     bqm.findClassificationSchemeByName(null, schemeName);
+//			Classification wsdlSpecClassification = 
+//			     blm.createClassification(uddiOrgTypes,
+//			       "eprSpec", xml);
+//			   specConcept.addClassification(wsdlSpecClassification);
+//			Collection<Concept> concepts = new ArrayList<Concept>();
+//			concepts.add(specConcept);
+//			BulkResponse br=blm.saveConcepts(concepts);
+//			Key conceptKey = null;
+//			if (br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
+//				Collection keys = br.getCollection();
+//				for (Iterator i=keys.iterator();i.hasNext();){
+//					conceptKey = (Key) i.next();
+//					break;
+//				}
+//			} else {
+//				throw new RegistryException("Could not save the EPR as Concept");
+//			}
+//			//now adding this concept to the binding
+//			Concept specificationConcept = (Concept) bqm.getRegistryObject(conceptKey.getId(), LifeCycleManager.CONCEPT);
+//			SpecificationLink specificationLink = blm.createSpecificationLink();
+//			specificationLink.setSpecificationObject(specificationConcept);
+//			serviceBinding.addSpecificationLink(specificationLink);
+		
+		    ArrayList<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
+		    serviceBindings.add(serviceBinding);
+		    service.addServiceBindings(serviceBindings);
+            Collection<String> findQualifiers = new ArrayList<String>();
+            findQualifiers.add(FindQualifier.AND_ALL_KEYS);
+            findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
+            ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
+            Classification classification = blm.createClassification(cScheme, "category", category);
+            service.addClassification(classification);
+           
+			saveRegistryObject(serviceBinding);
+		} catch (Exception je) {
+			throw new RegistryException(je.getLocalizedMessage(), je);
+		} finally {
+			closeConnection(connection);
+		}
+	}
+	/** 
+	 * Remove an EPR from the Registry
+	 */
+	public void unRegisterEPR(String category, String serviceName, EPR toBeDeletedEPR) throws RegistryException{
+		//first find the ServiceBindings for this service
+        Connection connection = JAXRRegistryImpl.getConnection();
+        Service service = null;
+		try {
+            service = findService(category, serviceName);
+            if (service==null) {
+                throw new RegistryException("No such Service found for service with category= "
+                        + category + " and name = " + serviceName);
+            }
+            connection.setCredentials(JAXRRegistryImpl.creds);
+			Collection serviceBindings = findServiceBindings(service);
+			service.addServiceBindings(serviceBindings);
+			for (Iterator i=serviceBindings.iterator();i.hasNext();){
+				ServiceBinding serviceBinding = (ServiceBinding) i.next();
+				String xml = URLDecoder.decode(serviceBinding.getAccessURI(), "UTF-8");
+				if (xml.equals(EPRHelper.toXMLString(toBeDeletedEPR))) {
+                    RegistryService rs = connection.getRegistryService();
+                    BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+                    Collection<Key> serviceBindingKeys = new ArrayList<Key>();
+                    serviceBindingKeys.add(serviceBinding.getKey());
+                    blm.deleteServiceBindings(serviceBindingKeys);
+					return;
+				}
+			}
+            throw new RegistryException("No such EPR found for service with name = " 
+                    + serviceName + " and EPR=" + toBeDeletedEPR);
+		} catch (Exception je) {
+			throw new RegistryException(je.getLocalizedMessage(), je);
+		} finally {
+		    closeConnection(connection);
+        }
+	}
+	
+	/** 
+	 * {@inheritDoc}
+	 * @return collection services
+	 */
+	public Collection<String> findAllServices() throws RegistryException
+	{
+		Collection<String> serviceNames = new ArrayList<String>();
+		try {
+			Collection services = getJBossESBOrganization().getServices();
+			for (Iterator i=services.iterator();i.hasNext();) {
+				String serviceName = ((Service)i.next()).getName().getValue();
+				serviceNames.add(serviceName);
+			}
+		} catch (JAXRException je) {
+			throw new RegistryException(je.getLocalizedMessage(), je);
+		}
+		return serviceNames;
+	}
+	/**
+	 * Find Services based on a category ("transformation").
+	 * 
+	 * @param serviceType
+	 * @return collection services
+	 */
+	public Collection<String> findServices(String category) throws RegistryException
+	{
+		Collection<String>serviceNames = new ArrayList<String>();
+		try {
+			Collection<Service>services = findServicesForCategory(category);
+			for (Iterator<Service> i=services.iterator();i.hasNext();) {
+				String serviceName = i.next().getName().getValue();
+				serviceNames.add(serviceName);
+			}
+		} catch (JAXRException je) {
+			throw new RegistryException(je.getLocalizedMessage(), je);
+		}
+		return serviceNames;
+	}
+	/**
+	 * 
+	 * @param service
+	 * @return
+	 */
+	public Collection<EPR> findEPRs(String category, String serviceName) throws RegistryException
+	{
+		Collection<EPR> eprs = new ArrayList<EPR>();
+		Connection connection = JAXRRegistryImpl.getConnection();
+		try {
+			Service service = findService(category, serviceName);
+			if (service==null){
+				throw new RegistryException("Could not find service with category=" + category + " and serviceName=" + serviceName);
+			}
+			// Get registry service and business query manager
+			Collection<ServiceBinding> serviceBindings = findServiceBindings(service);
+			//Converting them to EPRs
+			for (Iterator i=serviceBindings.iterator();i.hasNext();) {
+				ServiceBinding serviceBinding = (ServiceBinding) i.next();
+				@SuppressWarnings("unused")
+				String eprXML = URLDecoder.decode(serviceBinding.getAccessURI(),"UTF-8");
+				EPR epr = EPRHelper.fromXMLString(eprXML);
+				eprs.add(epr);
+			}
+		} catch (Exception je) {
+			throw new RegistryException(je.getLocalizedMessage(), je);
+		} finally {
+			closeConnection(connection);
+		}
+		return eprs;
+	}
+	/**
+	 * 
+	 * @param service
+	 * @return
+	 */
+	public EPR findEPR(String category, String serviceName) throws RegistryException
+	{
+		EPR epr = null;
+		Connection connection = JAXRRegistryImpl.getConnection();
+		try {
+			Service service = findService(category, serviceName);
+			if (service==null){
+				throw new RegistryException("Could not find service with category=" + category + " and serviceName=" + serviceName);
+			}
+			// Get registry service and business query manager
+			Collection<ServiceBinding> serviceBindings = findServiceBindings(service);
+			if (serviceBindings.iterator().hasNext()) {
+				ServiceBinding serviceBinding = (ServiceBinding) serviceBindings.iterator().next();
+				String eprXML = URLDecoder.decode(serviceBinding.getAccessURI(),"UTF-8");
+				epr = EPRHelper.fromXMLString(eprXML);
+			}
+		} catch (Exception je) {
+			throw new RegistryException(je.getLocalizedMessage(), je);
+		} finally {
+			closeConnection(connection);
+		}
+		return epr;
+	}
+	/**
+	 * Find all Organizations with a name mathing the queryString parameter.
+	 * 
+	 * @param organizationName used to match with the name of the organization.
+	 * @return the Organization.
+	 */
+	protected synchronized static Organization findOrganization(String organizationName) throws JAXRException
+	{
+	    if (organizationName==null) {
+	    	organizationName="";
+	    }
+		Connection connection = JAXRRegistryImpl.getConnection();
+		try {
+			// Get registry service and business query manager
+			RegistryService rs = connection.getRegistryService();
+			BusinessQueryManager bqm = rs.getBusinessQueryManager();
+			// Define find qualifiers and name patterns
+			Collection<String> findQualifiers = new ArrayList<String>();
+			findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
+			Collection<String> namePatterns = new ArrayList<String>();
+			namePatterns.add("%" + organizationName + "%");
+	        //Find based upon qualifier type and values
+			logger.log(Level.DEBUG,"Going to query the registry for name pattern " + namePatterns);
+			BulkResponse response = bqm.findOrganizations(findQualifiers,
+					namePatterns, null, null, null, null);
+			if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
+				for (Iterator orgIter = response.getCollection().iterator(); orgIter.hasNext();) 
+				{
+					Organization org = (Organization) orgIter.next();
+					logger.log(Level.DEBUG, "Organization name: " + org.getName().getValue());
+					logger.log(Level.DEBUG, "Description: " + org.getDescription().getValue());
+					logger.log(Level.DEBUG, "Key id: " + org.getKey().getId());
+					User primaryContact = org.getPrimaryContact();
+					logger.log(Level.DEBUG, "Primary Contact: " + primaryContact.getPersonName().getFullName());
+					if (orgIter.hasNext()) {
+						logger.log(Level.ERROR, "Found " + response.getCollection().size() 
+								+ " Organization, while expecting only one of name " + organizationName);
+					}
+					return org;
+				}
+			}
+			return null;
+		} finally {
+			closeConnection(connection);
+		}
+	}
+	/**
+	 * 
+	 * @param category
+	 * @param serviceName
+	 * @return Service
+	 */
+	protected synchronized static Service findService(String category, String serviceName) throws JAXRException
+	{
+		if (category==null) {
+			category="";
+		}
+		if (serviceName==null) {
+			serviceName="";
+		}
+		Connection connection = JAXRRegistryImpl.getConnection();
+		try {
+			// Get registry service and business query manager
+			RegistryService rs = connection.getRegistryService();
+			BusinessQueryManager bqm = rs.getBusinessQueryManager();
+            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+			// Define find qualifiers and name patterns
+            Collection<String> findQualifiers = new ArrayList<String>();
+            findQualifiers.add(FindQualifier.AND_ALL_KEYS);
+            findQualifiers.add(FindQualifier.EXACT_NAME_MATCH);
+            findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
+            ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");
+            Collection<Classification> classifications = new ArrayList<Classification>();
+            Classification classification = 
+                blm.createClassification( 
+                  cScheme, 
+                  "category", category );
+            classifications.add(classification);
+			Collection<String> namePatterns = new ArrayList<String>();
+			namePatterns.add(serviceName);
+	        //Find based upon qualifier type and values
+			logger.log(Level.DEBUG, "Going to query the registry for name pattern " + namePatterns);
+			BulkResponse response = bqm.findServices(null, findQualifiers,
+					namePatterns, classifications, null);
+			if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
+				for (Iterator servIter = response.getCollection().iterator(); servIter.hasNext();) 
+				{
+					Service service = (Service) servIter.next();
+					logger.log(Level.DEBUG, "Service name: " + service.getName().getValue());
+					if (service.getDescription()!=null) {
+						logger.log(Level.DEBUG, "Description: " + service.getDescription().getValue());
+					}
+					logger.log(Level.DEBUG, "Key id: " + service.getKey().getId());
+					if (servIter.hasNext()) {
+						logger.log(Level.ERROR, "Found " + response.getCollection().size() 
+								+ " Services, while expecting only one by the name of " 
+								+ serviceName + " in category " + category);
+					}
+					return service;
+				}
+			}
+			return null;
+		} finally {
+			closeConnection(connection);
+		}
+	}
+	/**
+	 * Finds all services for a given category.
+	 * @param category
+	 * @param serviceName
+	 * @return Service
+	 */
+	@SuppressWarnings("unchecked")
+	protected synchronized static Collection<Service> findServicesForCategory(String category) throws JAXRException
+	{
+		Collection<Service> services = new ArrayList<Service>();
+		if (category==null) {
+			category="";
+		}
+		Connection connection = JAXRRegistryImpl.getConnection();
+		try {
+			// Get registry service and business query manager
+			RegistryService rs = connection.getRegistryService();
+			BusinessQueryManager bqm = rs.getBusinessQueryManager();
+            BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+            Collection<String> findQualifiers = new ArrayList<String>();
+            findQualifiers.add(FindQualifier.AND_ALL_KEYS);
+            findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
+            ClassificationScheme cScheme = bqm.findClassificationSchemeByName(findQualifiers, "org.jboss.soa.esb.:category");  
+            //Create classification
+            Classification classification = 
+                blm.createClassification( 
+                  cScheme, 
+                  "category", category );
+            
+			// Define find qualifiers and name patterns
+			//Collection<String> findQualifiers = new ArrayList<String>();
+			//findQualifiers.add(FindQualifier.AND_ALL_KEYS);
+			findQualifiers.add(FindQualifier.SORT_BY_NAME_DESC);
+			Collection<Classification> classifications = new ArrayList<Classification>();
+            classifications.add(classification);
+	        //Find based upon qualifier type and values
+			logger.log(Level.DEBUG, "Going to query the registry for classification " + classifications);
+			BulkResponse response = bqm.findServices(null, findQualifiers,
+					null, classifications, null);
+			if (response.getStatus()==JAXRResponse.STATUS_SUCCESS) {
+				services = response.getCollection();
+			}
+			return services;
+		} finally {
+			closeConnection(connection);
+		}
+	}
+	/**
+	 * Create a jbossesb organization under which we will register all our services.
+	 * 
+	 * @param blm
+	 * @return
+	 * @throws JAXRException
+	 */
+	protected synchronized static Organization createJBossESBOrganization()
+			throws JAXRException 
+	{
+//		Getting the connection to the Registry (reading config)
+		Connection connection = JAXRRegistryImpl.getConnection();
+		try {
+			//Logging in
+			connection.setCredentials(JAXRRegistryImpl.creds);
+			RegistryService rs = connection.getRegistryService();
+			//Building organization
+			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+			Organization organization = blm.createOrganization(blm.createInternationalString("Red Hat/JBossESB"));
+				organization.setDescription(blm.createInternationalString("Red Hat/JBoss Professional Open Source, Services for the JBossESB"));
+
+			User user = blm.createUser();
+			organization.setPrimaryContact(user);
+			PersonName personName = blm.createPersonName("JBossESB");
+			TelephoneNumber telephoneNumber = blm.createTelephoneNumber();
+			telephoneNumber.setNumber("404 467-8555");
+			telephoneNumber.setType(null);
+			PostalAddress address = blm.createPostalAddress("3340",
+					"Peachtree Road, NE, Suite 1200", "Atlanta", "GA", "USA",
+					"30326", "");
+			Collection<PostalAddress> postalAddresses = new ArrayList<PostalAddress>();
+			postalAddresses.add(address);
+			Collection<EmailAddress> emailAddresses = new ArrayList<EmailAddress>();
+			EmailAddress emailAddress = blm
+					.createEmailAddress("jbossesb at jboss.com");
+			emailAddresses.add(emailAddress);
+	
+			Collection<TelephoneNumber> numbers = new ArrayList<TelephoneNumber>();
+			numbers.add(telephoneNumber);
+			user.setPersonName(personName);
+			user.setPostalAddresses(postalAddresses);
+			user.setEmailAddresses(emailAddresses);
+			user.setTelephoneNumbers(numbers);
+	
+	//		Scout does not support this (yet), so leaving it out for now.
+	//		ClassificationScheme cScheme = getClassificationScheme(blm,
+	//				blm.createInternationalString("uddi-org:general_keywords"), blm.createInternationalString(""));
+	//		Classification classification = blm.createClassification(cScheme,
+	//				blm.createInternationalString("JBoss ESB"), blm.createInternationalString("JBESB"));
+	//		org.addClassification(classification);
+			
+			saveRegistryObject(organization);
+			return organization;
+		} finally {
+			closeConnection(connection);
+		}	
+	}
+	/**
+	 * Save Registry Object
+	 */
+	protected synchronized static void saveRegistryObject(RegistryObject registryObject) throws JAXRException
+	{
+//		Getting the connection to the Registry (reading config)
+		Connection connection = JAXRRegistryImpl.getConnection();
+		try {
+			Collection<RegistryObject> registryObjects = new ArrayList<RegistryObject>();
+			BulkResponse br = null;
+			//Logging in
+			connection.setCredentials(JAXRRegistryImpl.creds);
+			RegistryService rs = connection.getRegistryService();
+			//Building organization
+			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+			registryObjects.add(registryObject);
+			Class[] interfaces = registryObject.getClass().getInterfaces();
+			String interfaceName ="";
+			for (int i=0; i<interfaces.length; i++) {
+				interfaceName = interfaces[i].getName();
+				if (interfaceName.equals("javax.xml.registry.infomodel.Organization")) {
+					br = blm.saveOrganizations(registryObjects);
+					break;
+				} else if (interfaceName.equals("javax.xml.registry.infomodel.Service")) {
+					br = blm.saveServices(registryObjects);
+					break;
+				} else if (interfaceName.equals("javax.xml.registry.infomodel.ServiceBinding")) {
+					br = blm.saveServiceBindings(registryObjects);
+					break;
+				} else {
+					logger.log(Level.ERROR, "Trying to save an unsupported RegistryObject");
+					throw new JAXRException("Trying to save an unsupported RegistryObject");
+				}
+			}
+            //Verify the return
+			if (br!=null && br.getStatus() == JAXRResponse.STATUS_SUCCESS) {
+				logger.log(Level.DEBUG, interfaceName + " successfully saved");
+				Collection coll = br.getCollection();
+				Iterator iter = coll.iterator();
+				while (iter.hasNext()) {
+					Key key = (Key) iter.next();
+					registryObject.setKey(key);
+					logger.log(Level.DEBUG, "Saved Key=" + key.getId());
+				}
+			} else {
+				logger.log(Level.ERROR, "Errors occurred during save.");
+				if (br!=null) {
+					Collection exceptions = br.getExceptions();
+					Iterator iter = exceptions.iterator();
+					String errors = "";
+					JAXRException je = new JAXRException("JAXRExceptions occurred during save");
+					while (iter.hasNext()) {
+						Exception e = (Exception) iter.next();
+						errors += e.getLocalizedMessage() + "\n";
+						je.setStackTrace(e.getStackTrace());
+						logger.log(Level.ERROR, e.getLocalizedMessage(), e);
+						//if it's the last error, throw it now and set the current stacktrace
+						if (!iter.hasNext()) {
+							throw new JAXRException(errors, e);
+						}
+					}
+					throw new JAXRException("Errors occurred during save. Response status=" + br.getStatus());
+				}
+				throw new JAXRException("Errors occurred during save");
+			}
+		} finally {
+			JAXRRegistryImpl.closeConnection(connection);
+		}	
+	}
+	/**
+	 * finds the JBossESB Organizationa and creates one if it is not there.
+	 * @return JBossESB Organization
+	 * @throws JAXRException
+	 */
+	private Organization getJBossESBOrganization() throws JAXRException
+	{
+		jbossESBOrganization = findOrganization("Red Hat/JBossESB");
+		if (jbossESBOrganization==null) {
+			jbossESBOrganization = createJBossESBOrganization();
+		}
+		return jbossESBOrganization;
+	}
+	/**
+	 * Find the ServiceBindings for a given Service
+	 * @param service
+	 * @return
+	 * @throws RegistryException
+	 */
+	@SuppressWarnings("unchecked")
+	private Collection<ServiceBinding> findServiceBindings(Service service) throws RegistryException
+	{
+		Collection<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
+		Connection connection = JAXRRegistryImpl.getConnection();
+		try {
+			RegistryService rs = connection.getRegistryService();
+			BusinessQueryManager bqm = rs.getBusinessQueryManager();
+			Collection<String> findQualifiers = new ArrayList<String>();
+			findQualifiers.add(FindQualifier.SORT_BY_NAME_ASC);
+			BulkResponse bulkResponse = bqm.findServiceBindings(service.getKey(),findQualifiers,null,null);
+			if (bulkResponse.getStatus()==JAXRResponse.STATUS_SUCCESS){
+				serviceBindings = bulkResponse.getCollection();
+			}
+			return serviceBindings;
+		} catch (Exception je) {
+			throw new RegistryException(je.getLocalizedMessage(), je);
+		} finally {
+			closeConnection(connection);
+		}
+	}
+	
+}
+
+	

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,71 +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.internal.soa.esb.services.registry;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-import org.jboss.soa.esb.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
-import org.jboss.system.ServiceMBeanSupport;
-
-/**
- * Service to isolate registry because of classloader dependency
- * This service can be removed if scout and jaxr dependencies are synchronzied with
- * application server.
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class JAXRRegistryService extends ServiceMBeanSupport implements JAXRRegistryServiceMBean
-{
-   @Override
-   protected void createService() throws Exception
-   {
-      final Registry registry = RegistryFactory.createRegistry();
-      Class[] intfs = {Registry.class};
-
-      // create a proxy around the Registry implementation that pushes/pops the
-      // scoped classloader
-
-      InvocationHandler handler = new InvocationHandler()
-      {
-         public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
-           {
-              ClassLoader old = Thread.currentThread().getContextClassLoader();
-              Thread.currentThread().setContextClassLoader(JAXRRegistryService.class.getClassLoader());
-              try
-              {
-                 return method.invoke(registry, args);
-              }
-              finally
-              {
-                 Thread.currentThread().setContextClassLoader(old);
-              }
-           }
-
-      };
-
-      RegistryFactory.setRegistry((Registry)Proxy.newProxyInstance(Registry.class.getClassLoader(), intfs, handler));
-   }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryService.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,71 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.services.registry;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import org.jboss.soa.esb.services.registry.Registry;
+import org.jboss.soa.esb.services.registry.RegistryFactory;
+import org.jboss.system.ServiceMBeanSupport;
+
+/**
+ * Service to isolate registry because of classloader dependency
+ * This service can be removed if scout and jaxr dependencies are synchronzied with
+ * application server.
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JAXRRegistryService extends ServiceMBeanSupport implements JAXRRegistryServiceMBean
+{
+   @Override
+   protected void createService() throws Exception
+   {
+      final Registry registry = RegistryFactory.createRegistry();
+      Class[] intfs = {Registry.class};
+
+      // create a proxy around the Registry implementation that pushes/pops the
+      // scoped classloader
+
+      InvocationHandler handler = new InvocationHandler()
+      {
+         public Object invoke(Object proxy, Method method, Object[] args) throws Throwable
+           {
+              ClassLoader old = Thread.currentThread().getContextClassLoader();
+              Thread.currentThread().setContextClassLoader(JAXRRegistryService.class.getClassLoader());
+              try
+              {
+                 return method.invoke(registry, args);
+              }
+              finally
+              {
+                 Thread.currentThread().setContextClassLoader(old);
+              }
+           }
+
+      };
+
+      RegistryFactory.setRegistry((Registry)Proxy.newProxyInstance(Registry.class.getClassLoader(), intfs, handler));
+   }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,34 +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.internal.soa.esb.services.registry;
-
-import org.jboss.system.ServiceMBean;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public interface JAXRRegistryServiceMBean extends ServiceMBean
-{
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryServiceMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,34 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.services.registry;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface JAXRRegistryServiceMBean extends ServiceMBean
+{
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/MockRegistryImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/MockRegistryImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/MockRegistryImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,258 +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.internal.soa.esb.services.registry;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryException;
-/**
- * Mock class for the Registry.
- * If need be we can extract the interface from here, add a factory and have JAXR as a plugin, allowing
- * for other RegistryAPIs.
- *
- * @author Kurt Stam
- */
-public class MockRegistryImpl implements Registry
-{
-    private static Map<String,Category> categories = new HashMap<String,Category>();
-    
-	/** 
-	 * Publish an EPR to the Registry
-	 */
-	protected Service registerService(String categoryName, String serviceName, String serviceDescription)
-	{
-        Category category = categories.get(categoryName);
-		if (category==null) {
-            category = new Category();
-		    categories.put(categoryName, category);
-        }
-        Service service = new Service();
-        service.setName(serviceName);
-        service.setDescription(serviceDescription);
-        category.getServices().add(service);
-		return service;
-	}
-	/** 
-	 * Remove an EPR from the Registry
-	 */
-	@SuppressWarnings("unchecked")
-    public void unRegisterService(String categoryName, String serviceName) throws RegistryException
-    {
-        Category category = categories.get(categoryName);
-        if (category==null) {
-            throw new RegistryException("Service not found");
-        } else {
-            List<Service> services = category.getServices();
-            for (Service service : services) {
-                if (serviceName.equals(service.getName())) {
-                    services.remove(service);
-                }
-            }
-        }
-	}
-	/** 
-	 * Publish an EPR to the Registry
-	 */
-	public void registerEPR(String categoryName, String serviceName, String serviceDescription, EPR epr, String eprDescription) 
-		throws RegistryException
-	{
-		Service service = registerService(categoryName, serviceName, serviceDescription);
-        ServiceBinding serviceBinding = new ServiceBinding();
-        serviceBinding.setDescription(eprDescription);
-        serviceBinding.setEpr(epr);
-        service.getServiceBindings().add(serviceBinding);
-    }
-	/** 
-	 * Remove an EPR from the Registry
-	 */
-	public void unRegisterEPR(String category, String serviceName, EPR toBeDeletedEPR) throws RegistryException{
-		//first find the ServiceBindings for this service
-        Service service = findService(category, serviceName);
-        List<ServiceBinding> serviceBindings = service.getServiceBindings();
-        for (ServiceBinding binding : serviceBindings) {
-            if (toBeDeletedEPR.equals(binding.getEpr())) {
-                serviceBindings.remove(binding);
-            }
-        }
-	}
-	
-	/** 
-	 * {@inheritDoc}
-	 * @return collection services
-	 */
-	public Collection<String> findAllServices() throws RegistryException
-	{
-        Collection<String> serviceNames = new ArrayList<String>();
-        for (Category category : categories.values()) {
-            for (Service service : category.getServices()) {
-                serviceNames.add(service.name);
-            }
-        }
-        return serviceNames;
-	}
-	/**
-	 * Find Services based on a category ("transformation").
-	 * 
-	 * @param serviceType
-	 * @return collection services
-	 */
-	public Collection<String> findServices(String categoryName) throws RegistryException
-	{
-        Collection<String> serviceNames = new ArrayList<String>();
-		Category category = categories.get(categoryName);
-        if (category==null) {
-            throw new RegistryException("No category called " + categoryName + " exist");
-        }
-        for (Service service : category.getServices()) {
-            serviceNames.add(service.name);
-        }
-        return serviceNames;
-	}
-	/**
-	 * 
-	 * @param service
-	 * @return
-	 */
-	public Collection<EPR> findEPRs(String categoryName, String serviceName) throws RegistryException
-	{
-		Collection<EPR> eprs = new ArrayList<EPR>();
-        Service service = findService(categoryName, serviceName);
-        for (ServiceBinding serviceBinding : service.serviceBindings) {
-            eprs.add(serviceBinding.getEpr());
-        }
-        return eprs;
-	}
-	/**
-	 * 
-	 * @param service
-	 * @return
-	 */
-	public EPR findEPR(String categoryName, String serviceName) throws RegistryException
-	{
-        Service service = findService(categoryName, serviceName);
-        for (ServiceBinding serviceBinding : service.serviceBindings) {
-            //return the first one in the list
-            return serviceBinding.getEpr();
-        }
-        return null;
-	}
-	/**
-	 * 
-	 * @param category
-	 * @param serviceName
-	 * @return Service
-	 */
-	protected synchronized static Service findService(String categoryName, String serviceName) throws RegistryException
-	{
-        Category category = categories.get(categoryName);
-        for (Service service : category.getServices()) {
-            if (serviceName.equals(service.getName())) {
-                return service;
-            }
-        }
-        throw new RegistryException("No service called " + serviceName + " exists in category " + categoryName);
-	}
-	/**
-	 * Finds all services for a given category.
-	 * @param category
-	 * @param serviceName
-	 * @return Service
-	 */
-	protected synchronized static Collection<Service> findServicesForCategory(String categoryName)
-	{
-        Category category = categories.get(categoryName);
-        return category.getServices();
-	}
-    
-    class Category
-    {
-        List<Service> services = new ArrayList<Service>();
-        
-        public List<Service> getServices() {
-            return services;
-        }
-        public void setServices(List<Service> services) {
-            this.services = services;
-        }
-    }
-    
-    class Service
-    {
-        String name;
-        String description;
-        List<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
-        
-        public String getDescription() {
-            return description;
-        }
-        public void setDescription(String description) {
-            this.description = description;
-        }
-        public String getName() {
-            return name;
-        }
-        public void setName(String name) {
-            this.name = name;
-        }
-        public List<ServiceBinding> getServiceBindings() {
-            return serviceBindings;
-        }
-        public void setServiceBindings(List<ServiceBinding> serviceBindings) {
-            this.serviceBindings = serviceBindings;
-        }
-    }
-    
-    class ServiceBinding
-    {
-        String name;
-        String description;
-        EPR epr;
-        
-        public String getDescription() {
-            return description;
-        }
-        public void setDescription(String description) {
-            this.description = description;
-        }
-        public EPR getEpr() {
-            return epr;
-        }
-        public void setEpr(EPR epr) {
-            this.epr = epr;
-        }
-        public String getName() {
-            return name;
-        }
-        public void setName(String name) {
-            this.name = name;
-        }
-    }
-	
-}
-
-	

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/MockRegistryImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/MockRegistryImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/MockRegistryImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/services/registry/MockRegistryImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,258 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.services.registry;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.services.registry.Registry;
+import org.jboss.soa.esb.services.registry.RegistryException;
+/**
+ * Mock class for the Registry.
+ * If need be we can extract the interface from here, add a factory and have JAXR as a plugin, allowing
+ * for other RegistryAPIs.
+ *
+ * @author Kurt Stam
+ */
+public class MockRegistryImpl implements Registry
+{
+    private static Map<String,Category> categories = new HashMap<String,Category>();
+    
+	/** 
+	 * Publish an EPR to the Registry
+	 */
+	protected Service registerService(String categoryName, String serviceName, String serviceDescription)
+	{
+        Category category = categories.get(categoryName);
+		if (category==null) {
+            category = new Category();
+		    categories.put(categoryName, category);
+        }
+        Service service = new Service();
+        service.setName(serviceName);
+        service.setDescription(serviceDescription);
+        category.getServices().add(service);
+		return service;
+	}
+	/** 
+	 * Remove an EPR from the Registry
+	 */
+	@SuppressWarnings("unchecked")
+    public void unRegisterService(String categoryName, String serviceName) throws RegistryException
+    {
+        Category category = categories.get(categoryName);
+        if (category==null) {
+            throw new RegistryException("Service not found");
+        } else {
+            List<Service> services = category.getServices();
+            for (Service service : services) {
+                if (serviceName.equals(service.getName())) {
+                    services.remove(service);
+                }
+            }
+        }
+	}
+	/** 
+	 * Publish an EPR to the Registry
+	 */
+	public void registerEPR(String categoryName, String serviceName, String serviceDescription, EPR epr, String eprDescription) 
+		throws RegistryException
+	{
+		Service service = registerService(categoryName, serviceName, serviceDescription);
+        ServiceBinding serviceBinding = new ServiceBinding();
+        serviceBinding.setDescription(eprDescription);
+        serviceBinding.setEpr(epr);
+        service.getServiceBindings().add(serviceBinding);
+    }
+	/** 
+	 * Remove an EPR from the Registry
+	 */
+	public void unRegisterEPR(String category, String serviceName, EPR toBeDeletedEPR) throws RegistryException{
+		//first find the ServiceBindings for this service
+        Service service = findService(category, serviceName);
+        List<ServiceBinding> serviceBindings = service.getServiceBindings();
+        for (ServiceBinding binding : serviceBindings) {
+            if (toBeDeletedEPR.equals(binding.getEpr())) {
+                serviceBindings.remove(binding);
+            }
+        }
+	}
+	
+	/** 
+	 * {@inheritDoc}
+	 * @return collection services
+	 */
+	public Collection<String> findAllServices() throws RegistryException
+	{
+        Collection<String> serviceNames = new ArrayList<String>();
+        for (Category category : categories.values()) {
+            for (Service service : category.getServices()) {
+                serviceNames.add(service.name);
+            }
+        }
+        return serviceNames;
+	}
+	/**
+	 * Find Services based on a category ("transformation").
+	 * 
+	 * @param serviceType
+	 * @return collection services
+	 */
+	public Collection<String> findServices(String categoryName) throws RegistryException
+	{
+        Collection<String> serviceNames = new ArrayList<String>();
+		Category category = categories.get(categoryName);
+        if (category==null) {
+            throw new RegistryException("No category called " + categoryName + " exist");
+        }
+        for (Service service : category.getServices()) {
+            serviceNames.add(service.name);
+        }
+        return serviceNames;
+	}
+	/**
+	 * 
+	 * @param service
+	 * @return
+	 */
+	public Collection<EPR> findEPRs(String categoryName, String serviceName) throws RegistryException
+	{
+		Collection<EPR> eprs = new ArrayList<EPR>();
+        Service service = findService(categoryName, serviceName);
+        for (ServiceBinding serviceBinding : service.serviceBindings) {
+            eprs.add(serviceBinding.getEpr());
+        }
+        return eprs;
+	}
+	/**
+	 * 
+	 * @param service
+	 * @return
+	 */
+	public EPR findEPR(String categoryName, String serviceName) throws RegistryException
+	{
+        Service service = findService(categoryName, serviceName);
+        for (ServiceBinding serviceBinding : service.serviceBindings) {
+            //return the first one in the list
+            return serviceBinding.getEpr();
+        }
+        return null;
+	}
+	/**
+	 * 
+	 * @param category
+	 * @param serviceName
+	 * @return Service
+	 */
+	protected synchronized static Service findService(String categoryName, String serviceName) throws RegistryException
+	{
+        Category category = categories.get(categoryName);
+        for (Service service : category.getServices()) {
+            if (serviceName.equals(service.getName())) {
+                return service;
+            }
+        }
+        throw new RegistryException("No service called " + serviceName + " exists in category " + categoryName);
+	}
+	/**
+	 * Finds all services for a given category.
+	 * @param category
+	 * @param serviceName
+	 * @return Service
+	 */
+	protected synchronized static Collection<Service> findServicesForCategory(String categoryName)
+	{
+        Category category = categories.get(categoryName);
+        return category.getServices();
+	}
+    
+    class Category
+    {
+        List<Service> services = new ArrayList<Service>();
+        
+        public List<Service> getServices() {
+            return services;
+        }
+        public void setServices(List<Service> services) {
+            this.services = services;
+        }
+    }
+    
+    class Service
+    {
+        String name;
+        String description;
+        List<ServiceBinding> serviceBindings = new ArrayList<ServiceBinding>();
+        
+        public String getDescription() {
+            return description;
+        }
+        public void setDescription(String description) {
+            this.description = description;
+        }
+        public String getName() {
+            return name;
+        }
+        public void setName(String name) {
+            this.name = name;
+        }
+        public List<ServiceBinding> getServiceBindings() {
+            return serviceBindings;
+        }
+        public void setServiceBindings(List<ServiceBinding> serviceBindings) {
+            this.serviceBindings = serviceBindings;
+        }
+    }
+    
+    class ServiceBinding
+    {
+        String name;
+        String description;
+        EPR epr;
+        
+        public String getDescription() {
+            return description;
+        }
+        public void setDescription(String description) {
+            this.description = description;
+        }
+        public EPR getEpr() {
+            return epr;
+        }
+        public void setEpr(EPR epr) {
+            this.epr = epr;
+        }
+        public String getName() {
+            return name;
+        }
+        public void setName(String name) {
+            this.name = name;
+        }
+    }
+	
+}
+
+	

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap/OGNLUtils.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap/OGNLUtils.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap/OGNLUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,122 +0,0 @@
-package org.jboss.internal.soa.esb.soap;
-
-import java.util.Map;
-
-import ognl.Ognl;
-import ognl.OgnlException;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.w3c.dom.Comment;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/**
- * OGNL Utilities for SOAP message processing.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class OGNLUtils {
-
-    private static Logger logger = Logger.getLogger(OGNLUtils.class);
-    public static final String JBOSSESB_SOAP_NS = "http://jbossesb.jboss.org/soap";
-    public static final String JBOSSESB_SOAP_NS_PREFIX = "jbossesb-soap:";
-    public static final String OGNL_ATTRIB = "ognl";
-    public static final String IS_COLLECTION_ATTRIB = "is-collection";
-
-    public static Object getParameter(String ognl, Map params) {
-        Object param;
-
-        // Try getting the parameter from the params Map using the
-        // raw OGNL expression as the key...
-        param = params.get(ognl);
-        if(param == null) {
-            // And if that didn't work, try using the OGNL expression to extract the param
-            // from an Object Graph using the OGNL toolkit...
-            try {
-                param = Ognl.getValue(ognl, params);
-            } catch (OgnlException ex) {
-                if(logger.isDebugEnabled()) {
-                    logger.debug("OGNL Error.", ex);
-                }
-            }
-        }
-
-        return (param != null?param:"");
-    }
-
-    public static String getOGNLExpression(Element element) {
-        StringBuffer ognlExpression = new StringBuffer();
-        Node parent = element.getParentNode();
-        boolean isInBody = false;
-
-        ognlExpression.append(getOGNLToken(element));
-
-        while (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
-            Element parentElement = (Element) parent;
-            String parentName = YADOMUtil.getName(parentElement);
-
-            if (parentName.equalsIgnoreCase("body") &&
-                    parent.getNamespaceURI().equalsIgnoreCase("http://schemas.xmlsoap.org/soap/envelope/")) {
-                isInBody = true;
-                break;
-            }
-
-            String preassignedOgnl = parentElement.getAttributeNS(JBOSSESB_SOAP_NS, OGNL_ATTRIB);
-            if(preassignedOgnl != null && !preassignedOgnl.equals("")) {
-                ognlExpression.insert(0, "." + preassignedOgnl);
-                isInBody = true;
-                break;
-            } else {
-                ognlExpression.insert(0, getOGNLToken(parentElement));
-            }
-            parent = parent.getParentNode();
-        }
-
-        if(!isInBody) {
-            return "";
-        }
-
-        // Remove the leading '.'
-        ognlExpression.deleteCharAt(0);
-
-        return ognlExpression.toString();
-    }
-
-    public static String getOGNLToken(Element element) {
-        String localName = element.getLocalName();
-        String ognlToken;
-
-        if (assertIsParentCollection(element)) {
-            int count = YADOMUtil.countElementsBefore(element, element.getTagName());
-            ognlToken = "[" + count + "]";
-        } else {
-            ognlToken = "." + localName;
-        }
-
-        return ognlToken;
-    }
-
-    private static boolean assertIsCollection(Element element) {
-        if(element.getAttributeNS(JBOSSESB_SOAP_NS, IS_COLLECTION_ATTRIB).equals("true")) {
-            // It's already been attributed... no need to check for the soapui comment...
-            return true;
-        }
-
-        Comment firstComment = (Comment) YADOMUtil.getFirstChildByType(element, Node.COMMENT_NODE);
-
-        // TODO: Get Ole (soapUI) to add an attribute to the collection element - better than looking for this comment.
-        if(firstComment != null && firstComment.getTextContent().indexOf("1 or more repetitions") != -1) {
-            return true;
-        }
-
-        return false;
-    }
-
-    private static boolean assertIsParentCollection(Element element) {
-        Node parent = element.getParentNode();
-        if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE && assertIsCollection((Element)parent)) {
-            return true;
-        }
-        return false;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap/OGNLUtils.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap/OGNLUtils.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap/OGNLUtils.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/soap/OGNLUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,122 @@
+package org.jboss.internal.soa.esb.soap;
+
+import java.util.Map;
+
+import ognl.Ognl;
+import ognl.OgnlException;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.w3c.dom.Comment;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/**
+ * OGNL Utilities for SOAP message processing.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public abstract class OGNLUtils {
+
+    private static Logger logger = Logger.getLogger(OGNLUtils.class);
+    public static final String JBOSSESB_SOAP_NS = "http://jbossesb.jboss.org/soap";
+    public static final String JBOSSESB_SOAP_NS_PREFIX = "jbossesb-soap:";
+    public static final String OGNL_ATTRIB = "ognl";
+    public static final String IS_COLLECTION_ATTRIB = "is-collection";
+
+    public static Object getParameter(String ognl, Map params) {
+        Object param;
+
+        // Try getting the parameter from the params Map using the
+        // raw OGNL expression as the key...
+        param = params.get(ognl);
+        if(param == null) {
+            // And if that didn't work, try using the OGNL expression to extract the param
+            // from an Object Graph using the OGNL toolkit...
+            try {
+                param = Ognl.getValue(ognl, params);
+            } catch (OgnlException ex) {
+                if(logger.isDebugEnabled()) {
+                    logger.debug("OGNL Error.", ex);
+                }
+            }
+        }
+
+        return (param != null?param:"");
+    }
+
+    public static String getOGNLExpression(Element element) {
+        StringBuffer ognlExpression = new StringBuffer();
+        Node parent = element.getParentNode();
+        boolean isInBody = false;
+
+        ognlExpression.append(getOGNLToken(element));
+
+        while (parent != null && parent.getNodeType() == Node.ELEMENT_NODE) {
+            Element parentElement = (Element) parent;
+            String parentName = YADOMUtil.getName(parentElement);
+
+            if (parentName.equalsIgnoreCase("body") &&
+                    parent.getNamespaceURI().equalsIgnoreCase("http://schemas.xmlsoap.org/soap/envelope/")) {
+                isInBody = true;
+                break;
+            }
+
+            String preassignedOgnl = parentElement.getAttributeNS(JBOSSESB_SOAP_NS, OGNL_ATTRIB);
+            if(preassignedOgnl != null && !preassignedOgnl.equals("")) {
+                ognlExpression.insert(0, "." + preassignedOgnl);
+                isInBody = true;
+                break;
+            } else {
+                ognlExpression.insert(0, getOGNLToken(parentElement));
+            }
+            parent = parent.getParentNode();
+        }
+
+        if(!isInBody) {
+            return "";
+        }
+
+        // Remove the leading '.'
+        ognlExpression.deleteCharAt(0);
+
+        return ognlExpression.toString();
+    }
+
+    public static String getOGNLToken(Element element) {
+        String localName = element.getLocalName();
+        String ognlToken;
+
+        if (assertIsParentCollection(element)) {
+            int count = YADOMUtil.countElementsBefore(element, element.getTagName());
+            ognlToken = "[" + count + "]";
+        } else {
+            ognlToken = "." + localName;
+        }
+
+        return ognlToken;
+    }
+
+    private static boolean assertIsCollection(Element element) {
+        if(element.getAttributeNS(JBOSSESB_SOAP_NS, IS_COLLECTION_ATTRIB).equals("true")) {
+            // It's already been attributed... no need to check for the soapui comment...
+            return true;
+        }
+
+        Comment firstComment = (Comment) YADOMUtil.getFirstChildByType(element, Node.COMMENT_NODE);
+
+        // TODO: Get Ole (soapUI) to add an attribute to the collection element - better than looking for this comment.
+        if(firstComment != null && firstComment.getTextContent().indexOf("1 or more repetitions") != -1) {
+            return true;
+        }
+
+        return false;
+    }
+
+    private static boolean assertIsParentCollection(Element element) {
+        Node parent = element.getParentNode();
+        if (parent != null && parent.getNodeType() == Node.ELEMENT_NODE && assertIsCollection((Element)parent)) {
+            return true;
+        }
+        return false;
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty/Base64.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty/Base64.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty/Base64.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,1451 +0,0 @@
-package org.jboss.internal.soa.esb.thirdparty;
-
-/**
- * Encodes and decodes to and from Base64 notation.
- *
- * <p>
- * Change Log:
- * </p>
- * <ul>
- *  <li>v2.1 - Cleaned up javadoc comments and unused variables and methods. Added
- *   some convenience methods for reading and writing to and from files.</li>
- *  <li>v2.0.2 - Now specifies UTF-8 encoding in places where the code fails on systems
- *   with other encodings (like EBCDIC).</li>
- *  <li>v2.0.1 - Fixed an error when decoding a single byte, that is, when the
- *   encoded data was a single byte.</li>
- *  <li>v2.0 - I got rid of methods that used booleans to set options. 
- *   Now everything is more consolidated and cleaner. The code now detects
- *   when data that's being decoded is gzip-compressed and will decompress it
- *   automatically. Generally things are cleaner. You'll probably have to
- *   change some method calls that you were making to support the new
- *   options format (<tt>int</tt>s that you "OR" together).</li>
- *  <li>v1.5.1 - Fixed bug when decompressing and decoding to a             
- *   byte[] using <tt>decode( String s, boolean gzipCompressed )</tt>.      
- *   Added the ability to "suspend" encoding in the Output Stream so        
- *   you can turn on and off the encoding if you need to embed base64       
- *   data in an otherwise "normal" stream (like an XML file).</li>  
- *  <li>v1.5 - Output stream pases on flush() command but doesn't do anything itself.
- *      This helps when using GZIP streams.
- *      Added the ability to GZip-compress objects before encoding them.</li>
- *  <li>v1.4 - Added helper methods to read/write files.</li>
- *  <li>v1.3.6 - Fixed OutputStream.flush() so that 'position' is reset.</li>
- *  <li>v1.3.5 - Added flag to turn on and off line breaks. Fixed bug in input stream
- *      where last buffer being read, if not completely full, was not returned.</li>
- *  <li>v1.3.4 - Fixed when "improperly padded stream" error was thrown at the wrong time.</li>
- *  <li>v1.3.3 - Fixed I/O streams which were totally messed up.</li>
- * </ul>
- *
- * <p>
- * I am placing this code in the Public Domain. Do with it as you will.
- * This software comes with no guarantees or warranties but with
- * plenty of well-wishing instead!
- * Please visit <a href="http://iharder.net/base64">http://iharder.net/base64</a>
- * periodically to check for updates or to contribute improvements.
- * </p>
- *
- * @author Robert Harder
- * @author rob at iharder.net
- * @version 2.1
- */
-public class Base64
-{
-    
-/* ********  P U B L I C   F I E L D S  ******** */   
-    
-    
-    /** No options specified. Value is zero. */
-    public final static int NO_OPTIONS = 0;
-    
-    /** Specify encoding. */
-    public final static int ENCODE = 1;
-    
-    
-    /** Specify decoding. */
-    public final static int DECODE = 0;
-    
-    
-    /** Specify that data should be gzip-compressed. */
-    public final static int GZIP = 2;
-    
-    
-    /** Don't break lines when encoding (violates strict Base64 specification) */
-    public final static int DONT_BREAK_LINES = 8;
-    
-    
-/* ********  P R I V A T E   F I E L D S  ******** */  
-    
-    
-    /** Maximum line length (76) of Base64 output. */
-    private final static int MAX_LINE_LENGTH = 76;
-    
-    
-    /** The equals sign (=) as a byte. */
-    private final static byte EQUALS_SIGN = (byte)'=';
-    
-    
-    /** The new line character (\n) as a byte. */
-    private final static byte NEW_LINE = (byte)'\n';
-    
-    
-    /** Preferred encoding. */
-    private final static String PREFERRED_ENCODING = "UTF-8";
-    
-    
-    /** The 64 valid Base64 values. */
-    private final static byte[] ALPHABET;
-    private final static byte[] _NATIVE_ALPHABET = /* May be something funny like EBCDIC */
-    {
-        (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G',
-        (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L', (byte)'M', (byte)'N',
-        (byte)'O', (byte)'P', (byte)'Q', (byte)'R', (byte)'S', (byte)'T', (byte)'U', 
-        (byte)'V', (byte)'W', (byte)'X', (byte)'Y', (byte)'Z',
-        (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f', (byte)'g',
-        (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l', (byte)'m', (byte)'n',
-        (byte)'o', (byte)'p', (byte)'q', (byte)'r', (byte)'s', (byte)'t', (byte)'u', 
-        (byte)'v', (byte)'w', (byte)'x', (byte)'y', (byte)'z',
-        (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', 
-        (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'+', (byte)'/'
-    };
-    
-    /** Determine which ALPHABET to use. */
-    static
-    {
-        byte[] __bytes;
-        try
-        {
-            __bytes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes( PREFERRED_ENCODING );
-        }   // end try
-        catch (java.io.UnsupportedEncodingException use)
-        {
-            __bytes = _NATIVE_ALPHABET; // Fall back to native encoding
-        }   // end catch
-        ALPHABET = __bytes;
-    }   // end static
-    
-    
-    /** 
-     * Translates a Base64 value to either its 6-bit reconstruction value
-     * or a negative number indicating some other meaning.
-     **/
-    private final static byte[] DECODABET =
-    {   
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,                 // Decimal  0 -  8
-        -5,-5,                                      // Whitespace: Tab and Linefeed
-        -9,-9,                                      // Decimal 11 - 12
-        -5,                                         // Whitespace: Carriage Return
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 14 - 26
-        -9,-9,-9,-9,-9,                             // Decimal 27 - 31
-        -5,                                         // Whitespace: Space
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,              // Decimal 33 - 42
-        62,                                         // Plus sign at decimal 43
-        -9,-9,-9,                                   // Decimal 44 - 46
-        63,                                         // Slash at decimal 47
-        52,53,54,55,56,57,58,59,60,61,              // Numbers zero through nine
-        -9,-9,-9,                                   // Decimal 58 - 60
-        -1,                                         // Equals sign at decimal 61
-        -9,-9,-9,                                      // Decimal 62 - 64
-        0,1,2,3,4,5,6,7,8,9,10,11,12,13,            // Letters 'A' through 'N'
-        14,15,16,17,18,19,20,21,22,23,24,25,        // Letters 'O' through 'Z'
-        -9,-9,-9,-9,-9,-9,                          // Decimal 91 - 96
-        26,27,28,29,30,31,32,33,34,35,36,37,38,     // Letters 'a' through 'm'
-        39,40,41,42,43,44,45,46,47,48,49,50,51,     // Letters 'n' through 'z'
-        -9,-9,-9,-9                                 // Decimal 123 - 126
-        /*,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 127 - 139
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 140 - 152
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 153 - 165
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 166 - 178
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 179 - 191
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 192 - 204
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 205 - 217
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 218 - 230
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 231 - 243
-        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9         // Decimal 244 - 255 */
-    };
-    
-    // I think I end up not using the BAD_ENCODING indicator.
-    //private final static byte BAD_ENCODING    = -9; // Indicates error in encoding
-    private final static byte WHITE_SPACE_ENC = -5; // Indicates white space in encoding
-    private final static byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
-
-    
-    /** Defeats instantiation. */
-    private Base64(){}
-    
-    
-    
-/* ********  E N C O D I N G   M E T H O D S  ******** */    
-    
-    
-    /**
-     * Encodes up to the first three bytes of array <var>threeBytes</var>
-     * and returns a four-byte array in Base64 notation.
-     * The actual number of significant bytes in your array is
-     * given by <var>numSigBytes</var>.
-     * The array <var>threeBytes</var> needs only be as big as
-     * <var>numSigBytes</var>.
-     * Code can reuse a byte array by passing a four-byte array as <var>b4</var>.
-     *
-     * @param b4 A reusable byte array to reduce array instantiation
-     * @param threeBytes the array to convert
-     * @param numSigBytes the number of significant bytes in your array
-     * @return four byte array in Base64 notation.
-     * @since 1.5.1
-     */
-    private static byte[] encode3to4( byte[] b4, byte[] threeBytes, int numSigBytes )
-    {
-        encode3to4( threeBytes, 0, numSigBytes, b4, 0 );
-        return b4;
-    }   // end encode3to4
-
-    
-    /**
-     * Encodes up to three bytes of the array <var>source</var>
-     * and writes the resulting four Base64 bytes to <var>destination</var>.
-     * The source and destination arrays can be manipulated
-     * anywhere along their length by specifying 
-     * <var>srcOffset</var> and <var>destOffset</var>.
-     * This method does not check to make sure your arrays
-     * are large enough to accomodate <var>srcOffset</var> + 3 for
-     * the <var>source</var> array or <var>destOffset</var> + 4 for
-     * the <var>destination</var> array.
-     * The actual number of significant bytes in your array is
-     * given by <var>numSigBytes</var>.
-     *
-     * @param source the array to convert
-     * @param srcOffset the index where conversion begins
-     * @param numSigBytes the number of significant bytes in your array
-     * @param destination the array to hold the conversion
-     * @param destOffset the index where output will be put
-     * @return the <var>destination</var> array
-     * @since 1.3
-     */
-    private static byte[] encode3to4( 
-     byte[] source, int srcOffset, int numSigBytes,
-     byte[] destination, int destOffset )
-    {
-        //           1         2         3  
-        // 01234567890123456789012345678901 Bit position
-        // --------000000001111111122222222 Array position from threeBytes
-        // --------|    ||    ||    ||    | Six bit groups to index ALPHABET
-        //          >>18  >>12  >> 6  >> 0  Right shift necessary
-        //                0x3f  0x3f  0x3f  Additional AND
-        
-        // Create buffer with zero-padding if there are only one or two
-        // significant bytes passed in the array.
-        // We have to shift left 24 in order to flush out the 1's that appear
-        // when Java treats a value as negative that is cast from a byte to an int.
-        int inBuff =   ( numSigBytes > 0 ? ((source[ srcOffset     ] << 24) >>>  8) : 0 )
-                     | ( numSigBytes > 1 ? ((source[ srcOffset + 1 ] << 24) >>> 16) : 0 )
-                     | ( numSigBytes > 2 ? ((source[ srcOffset + 2 ] << 24) >>> 24) : 0 );
-
-        switch( numSigBytes )
-        {
-            case 3:
-                destination[ destOffset     ] = ALPHABET[ (inBuff >>> 18)        ];
-                destination[ destOffset + 1 ] = ALPHABET[ (inBuff >>> 12) & 0x3f ];
-                destination[ destOffset + 2 ] = ALPHABET[ (inBuff >>>  6) & 0x3f ];
-                destination[ destOffset + 3 ] = ALPHABET[ (inBuff       ) & 0x3f ];
-                return destination;
-                
-            case 2:
-                destination[ destOffset     ] = ALPHABET[ (inBuff >>> 18)        ];
-                destination[ destOffset + 1 ] = ALPHABET[ (inBuff >>> 12) & 0x3f ];
-                destination[ destOffset + 2 ] = ALPHABET[ (inBuff >>>  6) & 0x3f ];
-                destination[ destOffset + 3 ] = EQUALS_SIGN;
-                return destination;
-                
-            case 1:
-                destination[ destOffset     ] = ALPHABET[ (inBuff >>> 18)        ];
-                destination[ destOffset + 1 ] = ALPHABET[ (inBuff >>> 12) & 0x3f ];
-                destination[ destOffset + 2 ] = EQUALS_SIGN;
-                destination[ destOffset + 3 ] = EQUALS_SIGN;
-                return destination;
-                
-            default:
-                return destination;
-        }   // end switch
-    }   // end encode3to4
-    
-    
-    
-    /**
-     * Serializes an object and returns the Base64-encoded
-     * version of that serialized object. If the object
-     * cannot be serialized or there is another error,
-     * the method will return <tt>null</tt>.
-     * The object is not GZip-compressed before being encoded.
-     *
-     * @param serializableObject The object to encode
-     * @return The Base64-encoded object
-     * @since 1.4
-     */
-    public static String encodeObject( java.io.Serializable serializableObject )
-    {
-        return encodeObject( serializableObject, NO_OPTIONS );
-    }   // end encodeObject
-    
-
-
-    /**
-     * Serializes an object and returns the Base64-encoded
-     * version of that serialized object. If the object
-     * cannot be serialized or there is another error,
-     * the method will return <tt>null</tt>.
-     * <p>
-     * Valid options:<pre>
-     *   GZIP: gzip-compresses object before encoding it.
-     *   DONT_BREAK_LINES: don't break lines at 76 characters
-     *     <i>Note: Technically, this makes your encoding non-compliant.</i>
-     * </pre>
-     * <p>
-     * Example: <code>encodeObject( myObj, Base64.GZIP )</code> or
-     * <p>
-     * Example: <code>encodeObject( myObj, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
-     *
-     * @param serializableObject The object to encode
-     * @param options Specified options
-     * @return The Base64-encoded object
-     * @see Base64#GZIP
-     * @see Base64#DONT_BREAK_LINES
-     * @since 2.0
-     */
-    public static String encodeObject( java.io.Serializable serializableObject, int options )
-    {
-        // Streams
-        java.io.ByteArrayOutputStream  baos  = null; 
-        java.io.OutputStream           b64os = null; 
-        java.io.ObjectOutputStream     oos   = null; 
-        java.util.zip.GZIPOutputStream gzos  = null;
-        
-        // Isolate options
-        int gzip           = (options & GZIP);
-        int dontBreakLines = (options & DONT_BREAK_LINES);
-        
-        try
-        {
-            // ObjectOutputStream -> (GZIP) -> Base64 -> ByteArrayOutputStream
-            baos  = new java.io.ByteArrayOutputStream();
-            b64os = new Base64.OutputStream( baos, ENCODE | dontBreakLines );
-    
-            // GZip?
-            if( gzip == GZIP )
-            {
-                gzos = new java.util.zip.GZIPOutputStream( b64os );
-                oos  = new java.io.ObjectOutputStream( gzos );
-            }   // end if: gzip
-            else
-                oos   = new java.io.ObjectOutputStream( b64os );
-            
-            oos.writeObject( serializableObject );
-        }   // end try
-        catch( java.io.IOException e )
-        {
-            e.printStackTrace();
-            return null;
-        }   // end catch
-        finally
-        {
-            try{ oos.close();   } catch( Exception e ){}
-            try{ gzos.close();  } catch( Exception e ){}
-            try{ b64os.close(); } catch( Exception e ){}
-            try{ baos.close();  } catch( Exception e ){}
-        }   // end finally
-        
-        // Return value according to relevant encoding.
-        try 
-        {
-            return new String( baos.toByteArray(), PREFERRED_ENCODING );
-        }   // end try
-        catch (java.io.UnsupportedEncodingException uue)
-        {
-            return new String( baos.toByteArray() );
-        }   // end catch
-        
-    }   // end encode
-    
-    
-
-    /**
-     * Encodes a byte array into Base64 notation.
-     * Does not GZip-compress data.
-     *
-     * @param source The data to convert
-     * @since 1.4
-     */
-    public static String encodeBytes( byte[] source )
-    {
-        return encodeBytes( source, 0, source.length, NO_OPTIONS );
-    }   // end encodeBytes
-    
-
-
-    /**
-     * Encodes a byte array into Base64 notation.
-     * <p>
-     * Valid options:<pre>
-     *   GZIP: gzip-compresses object before encoding it.
-     *   DONT_BREAK_LINES: don't break lines at 76 characters
-     *     <i>Note: Technically, this makes your encoding non-compliant.</i>
-     * </pre>
-     * <p>
-     * Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
-     * <p>
-     * Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
-     *
-     *
-     * @param source The data to convert
-     * @param options Specified options
-     * @see Base64#GZIP
-     * @see Base64#DONT_BREAK_LINES
-     * @since 2.0
-     */
-    public static String encodeBytes( byte[] source, int options )
-    {   
-        return encodeBytes( source, 0, source.length, options );
-    }   // end encodeBytes
-    
-    
-    /**
-     * Encodes a byte array into Base64 notation.
-     * Does not GZip-compress data.
-     *
-     * @param source The data to convert
-     * @param off Offset in array where conversion should begin
-     * @param len Length of data to convert
-     * @since 1.4
-     */
-    public static String encodeBytes( byte[] source, int off, int len )
-    {
-        return encodeBytes( source, off, len, NO_OPTIONS );
-    }   // end encodeBytes
-    
-    
-
-    /**
-     * Encodes a byte array into Base64 notation.
-     * <p>
-     * Valid options:<pre>
-     *   GZIP: gzip-compresses object before encoding it.
-     *   DONT_BREAK_LINES: don't break lines at 76 characters
-     *     <i>Note: Technically, this makes your encoding non-compliant.</i>
-     * </pre>
-     * <p>
-     * Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
-     * <p>
-     * Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
-     *
-     *
-     * @param source The data to convert
-     * @param off Offset in array where conversion should begin
-     * @param len Length of data to convert
-     * @param options Specified options
-     * @see Base64#GZIP
-     * @see Base64#DONT_BREAK_LINES
-     * @since 2.0
-     */
-    public static String encodeBytes( byte[] source, int off, int len, int options )
-    {
-        // Isolate options
-        int dontBreakLines = ( options & DONT_BREAK_LINES );
-        int gzip           = ( options & GZIP   );
-        
-        // Compress?
-        if( gzip == GZIP )
-        {
-            java.io.ByteArrayOutputStream  baos  = null;
-            java.util.zip.GZIPOutputStream gzos  = null;
-            Base64.OutputStream            b64os = null;
-            
-    
-            try
-            {
-                // GZip -> Base64 -> ByteArray
-                baos = new java.io.ByteArrayOutputStream();
-                b64os = new Base64.OutputStream( baos, ENCODE | dontBreakLines );
-                gzos  = new java.util.zip.GZIPOutputStream( b64os ); 
-            
-                gzos.write( source, off, len );
-                gzos.close();
-            }   // end try
-            catch( java.io.IOException e )
-            {
-                e.printStackTrace();
-                return null;
-            }   // end catch
-            finally
-            {
-                try{ gzos.close();  } catch( Exception e ){}
-                try{ b64os.close(); } catch( Exception e ){}
-                try{ baos.close();  } catch( Exception e ){}
-            }   // end finally
-
-            // Return value according to relevant encoding.
-            try
-            {
-                return new String( baos.toByteArray(), PREFERRED_ENCODING );
-            }   // end try
-            catch (java.io.UnsupportedEncodingException uue)
-            {
-                return new String( baos.toByteArray() );
-            }   // end catch
-        }   // end if: compress
-        
-        // Else, don't compress. Better not to use streams at all then.
-        else
-        {
-            // Convert option to boolean in way that code likes it.
-            boolean breakLines = dontBreakLines == 0;
-            
-            int    len43   = len * 4 / 3;
-            byte[] outBuff = new byte[   ( len43 )                      // Main 4:3
-                                       + ( (len % 3) > 0 ? 4 : 0 )      // Account for padding
-                                       + (breakLines ? ( len43 / MAX_LINE_LENGTH ) : 0) ]; // New lines      
-            int d = 0;
-            int e = 0;
-            int len2 = len - 2;
-            int lineLength = 0;
-            for( ; d < len2; d+=3, e+=4 )
-            {
-                encode3to4( source, d+off, 3, outBuff, e );
-
-                lineLength += 4;
-                if( breakLines && lineLength == MAX_LINE_LENGTH )
-                {   
-                    outBuff[e+4] = NEW_LINE;
-                    e++;
-                    lineLength = 0;
-                }   // end if: end of line
-            }   // en dfor: each piece of array
-
-            if( d < len )
-            {
-                encode3to4( source, d+off, len - d, outBuff, e );
-                e += 4;
-            }   // end if: some padding needed
-
-            
-            // Return value according to relevant encoding.
-            try
-            {
-                return new String( outBuff, 0, e, PREFERRED_ENCODING );
-            }   // end try
-            catch (java.io.UnsupportedEncodingException uue)
-            {
-                return new String( outBuff, 0, e );
-            }   // end catch
-            
-        }   // end else: don't compress
-        
-    }   // end encodeBytes
-    
-
-    
-    
-    
-/* ********  D E C O D I N G   M E T H O D S  ******** */
-    
-    
-    /**
-     * Decodes four bytes from array <var>source</var>
-     * and writes the resulting bytes (up to three of them)
-     * to <var>destination</var>.
-     * The source and destination arrays can be manipulated
-     * anywhere along their length by specifying 
-     * <var>srcOffset</var> and <var>destOffset</var>.
-     * This method does not check to make sure your arrays
-     * are large enough to accomodate <var>srcOffset</var> + 4 for
-     * the <var>source</var> array or <var>destOffset</var> + 3 for
-     * the <var>destination</var> array.
-     * This method returns the actual number of bytes that 
-     * were converted from the Base64 encoding.
-     * 
-     *
-     * @param source the array to convert
-     * @param srcOffset the index where conversion begins
-     * @param destination the array to hold the conversion
-     * @param destOffset the index where output will be put
-     * @return the number of decoded bytes converted
-     * @since 1.3
-     */
-    private static int decode4to3( byte[] source, int srcOffset, byte[] destination, int destOffset )
-    {
-        // Example: Dk==
-        if( source[ srcOffset + 2] == EQUALS_SIGN )
-        {
-            // Two ways to do the same thing. Don't know which way I like best.
-            //int outBuff =   ( ( DECODABET[ source[ srcOffset    ] ] << 24 ) >>>  6 )
-            //              | ( ( DECODABET[ source[ srcOffset + 1] ] << 24 ) >>> 12 );
-            int outBuff =   ( ( DECODABET[ source[ srcOffset    ] ] & 0xFF ) << 18 )
-                          | ( ( DECODABET[ source[ srcOffset + 1] ] & 0xFF ) << 12 );
-            
-            destination[ destOffset ] = (byte)( outBuff >>> 16 );
-            return 1;
-        }
-        
-        // Example: DkL=
-        else if( source[ srcOffset + 3 ] == EQUALS_SIGN )
-        {
-            // Two ways to do the same thing. Don't know which way I like best.
-            //int outBuff =   ( ( DECODABET[ source[ srcOffset     ] ] << 24 ) >>>  6 )
-            //              | ( ( DECODABET[ source[ srcOffset + 1 ] ] << 24 ) >>> 12 )
-            //              | ( ( DECODABET[ source[ srcOffset + 2 ] ] << 24 ) >>> 18 );
-            int outBuff =   ( ( DECODABET[ source[ srcOffset     ] ] & 0xFF ) << 18 )
-                          | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 )
-                          | ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) <<  6 );
-            
-            destination[ destOffset     ] = (byte)( outBuff >>> 16 );
-            destination[ destOffset + 1 ] = (byte)( outBuff >>>  8 );
-            return 2;
-        }
-        
-        // Example: DkLE
-        else
-        {
-            try{
-            // Two ways to do the same thing. Don't know which way I like best.
-            //int outBuff =   ( ( DECODABET[ source[ srcOffset     ] ] << 24 ) >>>  6 )
-            //              | ( ( DECODABET[ source[ srcOffset + 1 ] ] << 24 ) >>> 12 )
-            //              | ( ( DECODABET[ source[ srcOffset + 2 ] ] << 24 ) >>> 18 )
-            //              | ( ( DECODABET[ source[ srcOffset + 3 ] ] << 24 ) >>> 24 );
-            int outBuff =   ( ( DECODABET[ source[ srcOffset     ] ] & 0xFF ) << 18 )
-                          | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 )
-                          | ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) <<  6)
-                          | ( ( DECODABET[ source[ srcOffset + 3 ] ] & 0xFF )      );
-
-            
-            destination[ destOffset     ] = (byte)( outBuff >> 16 );
-            destination[ destOffset + 1 ] = (byte)( outBuff >>  8 );
-            destination[ destOffset + 2 ] = (byte)( outBuff       );
-
-            return 3;
-            }catch( Exception e){
-                System.out.println(""+source[srcOffset]+ ": " + ( DECODABET[ source[ srcOffset     ] ]  ) );
-                System.out.println(""+source[srcOffset+1]+  ": " + ( DECODABET[ source[ srcOffset + 1 ] ]  ) );
-                System.out.println(""+source[srcOffset+2]+  ": " + ( DECODABET[ source[ srcOffset + 2 ] ]  ) );
-                System.out.println(""+source[srcOffset+3]+  ": " + ( DECODABET[ source[ srcOffset + 3 ] ]  ) );
-                return -1;
-            }   //e nd catch
-        }
-    }   // end decodeToBytes
-    
-    
-    
-    
-    /**
-     * Very low-level access to decoding ASCII characters in
-     * the form of a byte array. Does not support automatically
-     * gunzipping or any other "fancy" features.
-     *
-     * @param source The Base64 encoded data
-     * @param off    The offset of where to begin decoding
-     * @param len    The length of characters to decode
-     * @return decoded data
-     * @since 1.3
-     */
-    public static byte[] decode( byte[] source, int off, int len )
-    {
-        int    len34   = len * 3 / 4;
-        byte[] outBuff = new byte[ len34 ]; // Upper limit on size of output
-        int    outBuffPosn = 0;
-        
-        byte[] b4        = new byte[4];
-        int    b4Posn    = 0;
-        int    i         = 0;
-        byte   sbiCrop   = 0;
-        byte   sbiDecode = 0;
-        for( i = off; i < off+len; i++ )
-        {
-            sbiCrop = (byte)(source[i] & 0x7f); // Only the low seven bits
-            sbiDecode = DECODABET[ sbiCrop ];
-            
-            if( sbiDecode >= WHITE_SPACE_ENC ) // White space, Equals sign or better
-            {
-                if( sbiDecode >= EQUALS_SIGN_ENC )
-                {
-                    b4[ b4Posn++ ] = sbiCrop;
-                    if( b4Posn > 3 )
-                    {
-                        outBuffPosn += decode4to3( b4, 0, outBuff, outBuffPosn );
-                        b4Posn = 0;
-                        
-                        // If that was the equals sign, break out of 'for' loop
-                        if( sbiCrop == EQUALS_SIGN )
-                            break;
-                    }   // end if: quartet built
-                    
-                }   // end if: equals sign or better
-                
-            }   // end if: white space, equals sign or better
-            else
-            {
-                System.err.println( "Bad Base64 input character at " + i + ": " + source[i] + "(decimal)" );
-                return null;
-            }   // end else: 
-        }   // each input character
-                                   
-        byte[] out = new byte[ outBuffPosn ];
-        System.arraycopy( outBuff, 0, out, 0, outBuffPosn ); 
-        return out;
-    }   // end decode
-    
-    
-    
-    
-    /**
-     * Decodes data from Base64 notation, automatically
-     * detecting gzip-compressed data and decompressing it.
-     *
-     * @param s the string to decode
-     * @return the decoded data
-     * @since 1.4
-     */
-    public static byte[] decode( String s )
-    {   
-        byte[] bytes;
-        try
-        {
-            bytes = s.getBytes( PREFERRED_ENCODING );
-        }   // end try
-        catch( java.io.UnsupportedEncodingException uee )
-        {
-            bytes = s.getBytes();
-        }   // end catch
-		//</change>
-        
-        // Decode
-        bytes = decode( bytes, 0, bytes.length );
-        
-        
-        // Check to see if it's gzip-compressed
-        // GZIP Magic Two-Byte Number: 0x8b1f (35615)
-        if( bytes != null && bytes.length >= 4 )
-        {
-            
-            int head = ((int)bytes[0] & 0xff) | ((bytes[1] << 8) & 0xff00);       
-            if( java.util.zip.GZIPInputStream.GZIP_MAGIC == head ) 
-            {
-                java.io.ByteArrayInputStream  bais = null;
-                java.util.zip.GZIPInputStream gzis = null;
-                java.io.ByteArrayOutputStream baos = null;
-                byte[] buffer = new byte[2048];
-                int    length = 0;
-
-                try
-                {
-                    baos = new java.io.ByteArrayOutputStream();
-                    bais = new java.io.ByteArrayInputStream( bytes );
-                    gzis = new java.util.zip.GZIPInputStream( bais );
-
-                    while( ( length = gzis.read( buffer ) ) >= 0 )
-                    {
-                        baos.write(buffer,0,length);
-                    }   // end while: reading input
-
-                    // No error? Get new bytes.
-                    bytes = baos.toByteArray();
-
-                }   // end try
-                catch( java.io.IOException e )
-                {
-                    // Just return originally-decoded bytes
-                }   // end catch
-                finally
-                {
-                    try{ baos.close(); } catch( Exception e ){}
-                    try{ gzis.close(); } catch( Exception e ){}
-                    try{ bais.close(); } catch( Exception e ){}
-                }   // end finally
-
-            }   // end if: gzipped
-        }   // end if: bytes.length >= 2
-        
-        return bytes;
-    }   // end decode
-
-
-    
-
-    /**
-     * Attempts to decode Base64 data and deserialize a Java
-     * Object within. Returns <tt>null</tt> if there was an error.
-     *
-     * @param encodedObject The Base64 data to decode
-     * @return The decoded and deserialized object
-     * @since 1.5
-     */
-    public static Object decodeToObject( String encodedObject )
-    {
-        // Decode and gunzip if necessary
-        byte[] objBytes = decode( encodedObject );
-        
-        java.io.ByteArrayInputStream  bais = null;
-        java.io.ObjectInputStream     ois  = null;
-        Object obj = null;
-        
-        try
-        {
-            bais = new java.io.ByteArrayInputStream( objBytes );
-            ois  = new java.io.ObjectInputStream( bais );
-        
-            obj = ois.readObject();
-        }   // end try
-        catch( java.io.IOException e )
-        {
-            e.printStackTrace();
-            obj = null;
-        }   // end catch
-        catch( java.lang.ClassNotFoundException e )
-        {
-            e.printStackTrace();
-            obj = null;
-        }   // end catch
-        finally
-        {
-            try{ bais.close(); } catch( Exception e ){}
-            try{ ois.close();  } catch( Exception e ){}
-        }   // end finally
-        
-        return obj;
-    }   // end decodeObject
-    
-    
-    
-    /**
-     * Convenience method for encoding data to a file.
-     *
-     * @param dataToEncode byte array of data to encode in base64 form
-     * @param filename Filename for saving encoded data
-     * @return <tt>true</tt> if successful, <tt>false</tt> otherwise
-     *
-     * @since 2.1
-     */
-    public static boolean encodeToFile( byte[] dataToEncode, String filename )
-    {
-        boolean success = false;
-        Base64.OutputStream bos = null;
-        try
-        {
-            bos = new Base64.OutputStream( 
-                      new java.io.FileOutputStream( filename ), Base64.ENCODE );
-            bos.write( dataToEncode );
-            success = true;
-        }   // end try
-        catch( java.io.IOException e )
-        {
-            
-            success = false;
-        }   // end catch: IOException
-        finally
-        {
-            try{ bos.close(); } catch( Exception e ){}
-        }   // end finally
-        
-        return success;
-    }   // end encodeToFile
-    
-    
-    /**
-     * Convenience method for decoding data to a file.
-     *
-     * @param dataToDecode Base64-encoded data as a string
-     * @param filename Filename for saving decoded data
-     * @return <tt>true</tt> if successful, <tt>false</tt> otherwise
-     *
-     * @since 2.1
-     */
-    public static boolean decodeToFile( String dataToDecode, String filename )
-    {
-        boolean success = false;
-        Base64.OutputStream bos = null;
-        try
-        {
-                bos = new Base64.OutputStream( 
-                          new java.io.FileOutputStream( filename ), Base64.DECODE );
-                bos.write( dataToDecode.getBytes( PREFERRED_ENCODING ) );
-                success = true;
-        }   // end try
-        catch( java.io.IOException e )
-        {
-            success = false;
-        }   // end catch: IOException
-        finally
-        {
-                try{ bos.close(); } catch( Exception e ){}
-        }   // end finally
-        
-        return success;
-    }   // end decodeToFile
-    
-    
-    
-    
-    /**
-     * Convenience method for reading a base64-encoded
-     * file and decoding it.
-     *
-     * @param filename Filename for reading encoded data
-     * @return decoded byte array or null if unsuccessful
-     *
-     * @since 2.1
-     */
-    public static byte[] decodeFromFile( String filename )
-    {
-        byte[] decodedData = null;
-        Base64.InputStream bis = null;
-        try
-        {
-            // Set up some useful variables
-            java.io.File file = new java.io.File( filename );
-            byte[] buffer = null;
-            int length   = 0;
-            int numBytes = 0;
-            
-            // Check for size of file
-            if( file.length() > Integer.MAX_VALUE )
-            {
-                System.err.println( "File is too big for this convenience method (" + file.length() + " bytes)." );
-                return null;
-            }   // end if: file too big for int index
-            buffer = new byte[ (int)file.length() ];
-            
-            // Open a stream
-            bis = new Base64.InputStream( 
-                      new java.io.BufferedInputStream( 
-                      new java.io.FileInputStream( file ) ), Base64.DECODE );
-            
-            // Read until done
-            while( ( numBytes = bis.read( buffer, length, 4096 ) ) >= 0 )
-                length += numBytes;
-            
-            // Save in a variable to return
-            decodedData = new byte[ length ];
-            System.arraycopy( buffer, 0, decodedData, 0, length );
-            
-        }   // end try
-        catch( java.io.IOException e )
-        {
-            System.err.println( "Error decoding from file " + filename );
-        }   // end catch: IOException
-        finally
-        {
-            try{ bis.close(); } catch( Exception e) {}
-        }   // end finally
-        
-        return decodedData;
-    }   // end decodeFromFile
-    
-    
-    
-    /**
-     * Convenience method for reading a binary file
-     * and base64-encoding it.
-     *
-     * @param filename Filename for reading binary data
-     * @return base64-encoded string or null if unsuccessful
-     *
-     * @since 2.1
-     */
-    public static String encodeFromFile( String filename )
-    {
-        String encodedData = null;
-        Base64.InputStream bis = null;
-        try
-        {
-            // Set up some useful variables
-            java.io.File file = new java.io.File( filename );
-            byte[] buffer = new byte[ (int)(file.length() * 1.4) ];
-            int length   = 0;
-            int numBytes = 0;
-            
-            // Open a stream
-            bis = new Base64.InputStream( 
-                      new java.io.BufferedInputStream( 
-                      new java.io.FileInputStream( file ) ), Base64.ENCODE );
-            
-            // Read until done
-            while( ( numBytes = bis.read( buffer, length, 4096 ) ) >= 0 )
-                length += numBytes;
-            
-            // Save in a variable to return
-            encodedData = new String( buffer, 0, length, Base64.PREFERRED_ENCODING );
-                
-        }   // end try
-        catch( java.io.IOException e )
-        {
-            System.err.println( "Error encoding from file " + filename );
-        }   // end catch: IOException
-        finally
-        {
-            try{ bis.close(); } catch( Exception e) {}
-        }   // end finally
-        
-        return encodedData;
-        }   // end encodeFromFile
-    
-    
-    
-    
-    /* ********  I N N E R   C L A S S   I N P U T S T R E A M  ******** */
-    
-    
-    
-    /**
-     * A {@link Base64.InputStream} will read data from another
-     * <tt>java.io.InputStream</tt>, given in the constructor,
-     * and encode/decode to/from Base64 notation on the fly.
-     *
-     * @see Base64
-     * @since 1.3
-     */
-    public static class InputStream extends java.io.FilterInputStream
-    {
-        private boolean encode;         // Encoding or decoding
-        private int     position;       // Current position in the buffer
-        private byte[]  buffer;         // Small buffer holding converted data
-        private int     bufferLength;   // Length of buffer (3 or 4)
-        private int     numSigBytes;    // Number of meaningful bytes in the buffer
-        private int     lineLength;
-        private boolean breakLines;     // Break lines at less than 80 characters
-        
-        
-        /**
-         * Constructs a {@link Base64.InputStream} in DECODE mode.
-         *
-         * @param in the <tt>java.io.InputStream</tt> from which to read data.
-         * @since 1.3
-         */
-        public InputStream( java.io.InputStream in )
-        {   
-            this( in, DECODE );
-        }   // end constructor
-        
-        
-        /**
-         * Constructs a {@link Base64.InputStream} in
-         * either ENCODE or DECODE mode.
-         * <p>
-         * Valid options:<pre>
-         *   ENCODE or DECODE: Encode or Decode as data is read.
-         *   DONT_BREAK_LINES: don't break lines at 76 characters
-         *     (only meaningful when encoding)
-         *     <i>Note: Technically, this makes your encoding non-compliant.</i>
-         * </pre>
-         * <p>
-         * Example: <code>new Base64.InputStream( in, Base64.DECODE )</code>
-         *
-         *
-         * @param in the <tt>java.io.InputStream</tt> from which to read data.
-         * @param options Specified options
-         * @see Base64#ENCODE
-         * @see Base64#DECODE
-         * @see Base64#DONT_BREAK_LINES
-         * @since 2.0
-         */
-        public InputStream( java.io.InputStream in, int options )
-        {   
-            super( in );
-            this.breakLines   = (options & DONT_BREAK_LINES) != DONT_BREAK_LINES;
-            this.encode       = (options & ENCODE) == ENCODE;
-            this.bufferLength = encode ? 4 : 3;
-            this.buffer   = new byte[ bufferLength ];
-            this.position = -1;
-            this.lineLength = 0;
-        }   // end constructor
-        
-        /**
-         * Reads enough of the input stream to convert
-         * to/from Base64 and returns the next byte.
-         *
-         * @return next byte
-         * @since 1.3
-         */
-        public int read() throws java.io.IOException 
-        { 
-            // Do we need to get data?
-            if( position < 0 )
-            {
-                if( encode )
-                {
-                    byte[] b3 = new byte[3];
-                    int numBinaryBytes = 0;
-                    for( int i = 0; i < 3; i++ )
-                    {
-                        try
-                        { 
-                            int b = in.read();
-                            
-                            // If end of stream, b is -1.
-                            if( b >= 0 )
-                            {
-                                b3[i] = (byte)b;
-                                numBinaryBytes++;
-                            }   // end if: not end of stream
-                            
-                        }   // end try: read
-                        catch( java.io.IOException e )
-                        {   
-                            // Only a problem if we got no data at all.
-                            if( i == 0 )
-                                throw e;
-                            
-                        }   // end catch
-                    }   // end for: each needed input byte
-                    
-                    if( numBinaryBytes > 0 )
-                    {
-                        encode3to4( b3, 0, numBinaryBytes, buffer, 0 );
-                        position = 0;
-                        numSigBytes = 4;
-                    }   // end if: got data
-                    else
-                    {
-                        return -1;
-                    }   // end else
-                }   // end if: encoding
-                
-                // Else decoding
-                else
-                {
-                    byte[] b4 = new byte[4];
-                    int i = 0;
-                    for( i = 0; i < 4; i++ )
-                    {
-                        // Read four "meaningful" bytes:
-                        int b = 0;
-                        do{ b = in.read(); }
-                        while( b >= 0 && DECODABET[ b & 0x7f ] <= WHITE_SPACE_ENC );
-                        
-                        if( b < 0 )
-                            break; // Reads a -1 if end of stream
-                        
-                        b4[i] = (byte)b;
-                    }   // end for: each needed input byte
-                    
-                    if( i == 4 )
-                    {
-                        numSigBytes = decode4to3( b4, 0, buffer, 0 );
-                        position = 0;
-                    }   // end if: got four characters
-                    else if( i == 0 ){
-                        return -1;
-                    }   // end else if: also padded correctly
-                    else
-                    {
-                        // Must have broken out from above.
-                        throw new java.io.IOException( "Improperly padded Base64 input." );
-                    }   // end 
-                    
-                }   // end else: decode
-            }   // end else: get data
-            
-            // Got data?
-            if( position >= 0 )
-            {
-                // End of relevant data?
-                if( /*!encode &&*/ position >= numSigBytes )
-                    return -1;
-                
-                if( encode && breakLines && lineLength >= MAX_LINE_LENGTH )
-                {
-                    lineLength = 0;
-                    return '\n';
-                }   // end if
-                else
-                {
-                    lineLength++;   // This isn't important when decoding
-                                    // but throwing an extra "if" seems
-                                    // just as wasteful.
-                    
-                    int b = buffer[ position++ ];
-
-                    if( position >= bufferLength )
-                        position = -1;
-
-                    return b & 0xFF; // This is how you "cast" a byte that's
-                                     // intended to be unsigned.
-                }   // end else
-            }   // end if: position >= 0
-            
-            // Else error
-            else
-            {   
-                // When JDK1.4 is more accepted, use an assertion here.
-                throw new java.io.IOException( "Error in Base64 code reading stream." );
-            }   // end else
-        }   // end read
-        
-        
-        /**
-         * Calls {@link #read()} repeatedly until the end of stream
-         * is reached or <var>len</var> bytes are read.
-         * Returns number of bytes read into array or -1 if
-         * end of stream is encountered.
-         *
-         * @param dest array to hold values
-         * @param off offset for array
-         * @param len max number of bytes to read into array
-         * @return bytes read into array or -1 if end of stream is encountered.
-         * @since 1.3
-         */
-        public int read( byte[] dest, int off, int len ) throws java.io.IOException
-        {
-            int i;
-            int b;
-            for( i = 0; i < len; i++ )
-            {
-                b = read();
-                
-                //if( b < 0 && i == 0 )
-                //    return -1;
-                
-                if( b >= 0 )
-                    dest[off + i] = (byte)b;
-                else if( i == 0 )
-                    return -1;
-                else
-                    break; // Out of 'for' loop
-            }   // end for: each byte read
-            return i;
-        }   // end read
-        
-    }   // end inner class InputStream
-    
-    
-    
-    
-    
-    
-    /* ********  I N N E R   C L A S S   O U T P U T S T R E A M  ******** */
-    
-    
-    
-    /**
-     * A {@link Base64.OutputStream} will write data to another
-     * <tt>java.io.OutputStream</tt>, given in the constructor,
-     * and encode/decode to/from Base64 notation on the fly.
-     *
-     * @see Base64
-     * @since 1.3
-     */
-    public static class OutputStream extends java.io.FilterOutputStream
-    {
-        private boolean encode;
-        private int     position;
-        private byte[]  buffer;
-        private int     bufferLength;
-        private int     lineLength;
-        private boolean breakLines;
-        private byte[]  b4; // Scratch used in a few places
-        private boolean suspendEncoding;
-        
-        /**
-         * Constructs a {@link Base64.OutputStream} in ENCODE mode.
-         *
-         * @param out the <tt>java.io.OutputStream</tt> to which data will be written.
-         * @since 1.3
-         */
-        public OutputStream( java.io.OutputStream out )
-        {   
-            this( out, ENCODE );
-        }   // end constructor
-        
-        
-        /**
-         * Constructs a {@link Base64.OutputStream} in
-         * either ENCODE or DECODE mode.
-         * <p>
-         * Valid options:<pre>
-         *   ENCODE or DECODE: Encode or Decode as data is read.
-         *   DONT_BREAK_LINES: don't break lines at 76 characters
-         *     (only meaningful when encoding)
-         *     <i>Note: Technically, this makes your encoding non-compliant.</i>
-         * </pre>
-         * <p>
-         * Example: <code>new Base64.OutputStream( out, Base64.ENCODE )</code>
-         *
-         * @param out the <tt>java.io.OutputStream</tt> to which data will be written.
-         * @param options Specified options.
-         * @see Base64#ENCODE
-         * @see Base64#DECODE
-         * @see Base64#DONT_BREAK_LINES
-         * @since 1.3
-         */
-        public OutputStream( java.io.OutputStream out, int options )
-        {   
-            super( out );
-            this.breakLines   = (options & DONT_BREAK_LINES) != DONT_BREAK_LINES;
-            this.encode       = (options & ENCODE) == ENCODE;
-            this.bufferLength = encode ? 3 : 4;
-            this.buffer       = new byte[ bufferLength ];
-            this.position     = 0;
-            this.lineLength   = 0;
-            this.suspendEncoding = false;
-            this.b4           = new byte[4];
-        }   // end constructor
-        
-        
-        /**
-         * Writes the byte to the output stream after
-         * converting to/from Base64 notation.
-         * When encoding, bytes are buffered three
-         * at a time before the output stream actually
-         * gets a write() call.
-         * When decoding, bytes are buffered four
-         * at a time.
-         *
-         * @param theByte the byte to write
-         * @since 1.3
-         */
-        public void write(int theByte) throws java.io.IOException
-        {
-            // Encoding suspended?
-            if( suspendEncoding )
-            {
-                super.out.write( theByte );
-                return;
-            }   // end if: supsended
-            
-            // Encode?
-            if( encode )
-            {
-                buffer[ position++ ] = (byte)theByte;
-                if( position >= bufferLength )  // Enough to encode.
-                {
-                    out.write( encode3to4( b4, buffer, bufferLength ) );
-
-                    lineLength += 4;
-                    if( breakLines && lineLength >= MAX_LINE_LENGTH )
-                    {
-                        out.write( NEW_LINE );
-                        lineLength = 0;
-                    }   // end if: end of line
-
-                    position = 0;
-                }   // end if: enough to output
-            }   // end if: encoding
-
-            // Else, Decoding
-            else
-            {
-                // Meaningful Base64 character?
-                if( DECODABET[ theByte & 0x7f ] > WHITE_SPACE_ENC )
-                {
-                    buffer[ position++ ] = (byte)theByte;
-                    if( position >= bufferLength )  // Enough to output.
-                    {
-                        int len = Base64.decode4to3( buffer, 0, b4, 0 );
-                        out.write( b4, 0, len );
-                        //out.write( Base64.decode4to3( buffer ) );
-                        position = 0;
-                    }   // end if: enough to output
-                }   // end if: meaningful base64 character
-                else if( DECODABET[ theByte & 0x7f ] != WHITE_SPACE_ENC )
-                {
-                    throw new java.io.IOException( "Invalid character in Base64 data." );
-                }   // end else: not white space either
-            }   // end else: decoding
-        }   // end write
-        
-        
-        
-        /**
-         * Calls {@link #write(int)} repeatedly until <var>len</var> 
-         * bytes are written.
-         *
-         * @param theBytes array from which to read bytes
-         * @param off offset for array
-         * @param len max number of bytes to read into array
-         * @since 1.3
-         */
-        public void write( byte[] theBytes, int off, int len ) throws java.io.IOException
-        {
-            // Encoding suspended?
-            if( suspendEncoding )
-            {
-                super.out.write( theBytes, off, len );
-                return;
-            }   // end if: supsended
-            
-            for( int i = 0; i < len; i++ )
-            {
-                write( theBytes[ off + i ] );
-            }   // end for: each byte written
-            
-        }   // end write
-        
-        
-        
-        /**
-         * Method added by PHIL. [Thanks, PHIL. -Rob]
-         * This pads the buffer without closing the stream.
-         */
-        public void flushBase64() throws java.io.IOException 
-        {
-            if( position > 0 )
-            {
-                if( encode )
-                {
-                    out.write( encode3to4( b4, buffer, position ) );
-                    position = 0;
-                }   // end if: encoding
-                else
-                {
-                    throw new java.io.IOException( "Base64 input not properly padded." );
-                }   // end else: decoding
-            }   // end if: buffer partially full
-
-        }   // end flush
-
-        
-        /** 
-         * Flushes and closes (I think, in the superclass) the stream. 
-         *
-         * @since 1.3
-         */
-        public void close() throws java.io.IOException
-        {
-            // 1. Ensure that pending characters are written
-            flushBase64();
-
-            // 2. Actually close the stream
-            // Base class both flushes and closes.
-            super.close();
-            
-            buffer = null;
-            out    = null;
-        }   // end close
-        
-        
-        
-        /**
-         * Suspends encoding of the stream.
-         * May be helpful if you need to embed a piece of
-         * base640-encoded data in a stream.
-         *
-         * @since 1.5.1
-         */
-        public void suspendEncoding() throws java.io.IOException 
-        {
-            flushBase64();
-            this.suspendEncoding = true;
-        }   // end suspendEncoding
-        
-        
-        /**
-         * Resumes encoding of the stream.
-         * May be helpful if you need to embed a piece of
-         * base640-encoded data in a stream.
-         *
-         * @since 1.5.1
-         */
-        public void resumeEncoding()
-        {
-            this.suspendEncoding = false;
-        }   // end resumeEncoding
-        
-        
-        
-    }   // end inner class OutputStream
-    
-    
-}   // end class Base64

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty/Base64.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty/Base64.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty/Base64.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/thirdparty/Base64.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,1451 @@
+package org.jboss.internal.soa.esb.thirdparty;
+
+/**
+ * Encodes and decodes to and from Base64 notation.
+ *
+ * <p>
+ * Change Log:
+ * </p>
+ * <ul>
+ *  <li>v2.1 - Cleaned up javadoc comments and unused variables and methods. Added
+ *   some convenience methods for reading and writing to and from files.</li>
+ *  <li>v2.0.2 - Now specifies UTF-8 encoding in places where the code fails on systems
+ *   with other encodings (like EBCDIC).</li>
+ *  <li>v2.0.1 - Fixed an error when decoding a single byte, that is, when the
+ *   encoded data was a single byte.</li>
+ *  <li>v2.0 - I got rid of methods that used booleans to set options. 
+ *   Now everything is more consolidated and cleaner. The code now detects
+ *   when data that's being decoded is gzip-compressed and will decompress it
+ *   automatically. Generally things are cleaner. You'll probably have to
+ *   change some method calls that you were making to support the new
+ *   options format (<tt>int</tt>s that you "OR" together).</li>
+ *  <li>v1.5.1 - Fixed bug when decompressing and decoding to a             
+ *   byte[] using <tt>decode( String s, boolean gzipCompressed )</tt>.      
+ *   Added the ability to "suspend" encoding in the Output Stream so        
+ *   you can turn on and off the encoding if you need to embed base64       
+ *   data in an otherwise "normal" stream (like an XML file).</li>  
+ *  <li>v1.5 - Output stream pases on flush() command but doesn't do anything itself.
+ *      This helps when using GZIP streams.
+ *      Added the ability to GZip-compress objects before encoding them.</li>
+ *  <li>v1.4 - Added helper methods to read/write files.</li>
+ *  <li>v1.3.6 - Fixed OutputStream.flush() so that 'position' is reset.</li>
+ *  <li>v1.3.5 - Added flag to turn on and off line breaks. Fixed bug in input stream
+ *      where last buffer being read, if not completely full, was not returned.</li>
+ *  <li>v1.3.4 - Fixed when "improperly padded stream" error was thrown at the wrong time.</li>
+ *  <li>v1.3.3 - Fixed I/O streams which were totally messed up.</li>
+ * </ul>
+ *
+ * <p>
+ * I am placing this code in the Public Domain. Do with it as you will.
+ * This software comes with no guarantees or warranties but with
+ * plenty of well-wishing instead!
+ * Please visit <a href="http://iharder.net/base64">http://iharder.net/base64</a>
+ * periodically to check for updates or to contribute improvements.
+ * </p>
+ *
+ * @author Robert Harder
+ * @author rob at iharder.net
+ * @version 2.1
+ */
+public class Base64
+{
+    
+/* ********  P U B L I C   F I E L D S  ******** */   
+    
+    
+    /** No options specified. Value is zero. */
+    public final static int NO_OPTIONS = 0;
+    
+    /** Specify encoding. */
+    public final static int ENCODE = 1;
+    
+    
+    /** Specify decoding. */
+    public final static int DECODE = 0;
+    
+    
+    /** Specify that data should be gzip-compressed. */
+    public final static int GZIP = 2;
+    
+    
+    /** Don't break lines when encoding (violates strict Base64 specification) */
+    public final static int DONT_BREAK_LINES = 8;
+    
+    
+/* ********  P R I V A T E   F I E L D S  ******** */  
+    
+    
+    /** Maximum line length (76) of Base64 output. */
+    private final static int MAX_LINE_LENGTH = 76;
+    
+    
+    /** The equals sign (=) as a byte. */
+    private final static byte EQUALS_SIGN = (byte)'=';
+    
+    
+    /** The new line character (\n) as a byte. */
+    private final static byte NEW_LINE = (byte)'\n';
+    
+    
+    /** Preferred encoding. */
+    private final static String PREFERRED_ENCODING = "UTF-8";
+    
+    
+    /** The 64 valid Base64 values. */
+    private final static byte[] ALPHABET;
+    private final static byte[] _NATIVE_ALPHABET = /* May be something funny like EBCDIC */
+    {
+        (byte)'A', (byte)'B', (byte)'C', (byte)'D', (byte)'E', (byte)'F', (byte)'G',
+        (byte)'H', (byte)'I', (byte)'J', (byte)'K', (byte)'L', (byte)'M', (byte)'N',
+        (byte)'O', (byte)'P', (byte)'Q', (byte)'R', (byte)'S', (byte)'T', (byte)'U', 
+        (byte)'V', (byte)'W', (byte)'X', (byte)'Y', (byte)'Z',
+        (byte)'a', (byte)'b', (byte)'c', (byte)'d', (byte)'e', (byte)'f', (byte)'g',
+        (byte)'h', (byte)'i', (byte)'j', (byte)'k', (byte)'l', (byte)'m', (byte)'n',
+        (byte)'o', (byte)'p', (byte)'q', (byte)'r', (byte)'s', (byte)'t', (byte)'u', 
+        (byte)'v', (byte)'w', (byte)'x', (byte)'y', (byte)'z',
+        (byte)'0', (byte)'1', (byte)'2', (byte)'3', (byte)'4', (byte)'5', 
+        (byte)'6', (byte)'7', (byte)'8', (byte)'9', (byte)'+', (byte)'/'
+    };
+    
+    /** Determine which ALPHABET to use. */
+    static
+    {
+        byte[] __bytes;
+        try
+        {
+            __bytes = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".getBytes( PREFERRED_ENCODING );
+        }   // end try
+        catch (java.io.UnsupportedEncodingException use)
+        {
+            __bytes = _NATIVE_ALPHABET; // Fall back to native encoding
+        }   // end catch
+        ALPHABET = __bytes;
+    }   // end static
+    
+    
+    /** 
+     * Translates a Base64 value to either its 6-bit reconstruction value
+     * or a negative number indicating some other meaning.
+     **/
+    private final static byte[] DECODABET =
+    {   
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,                 // Decimal  0 -  8
+        -5,-5,                                      // Whitespace: Tab and Linefeed
+        -9,-9,                                      // Decimal 11 - 12
+        -5,                                         // Whitespace: Carriage Return
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 14 - 26
+        -9,-9,-9,-9,-9,                             // Decimal 27 - 31
+        -5,                                         // Whitespace: Space
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,              // Decimal 33 - 42
+        62,                                         // Plus sign at decimal 43
+        -9,-9,-9,                                   // Decimal 44 - 46
+        63,                                         // Slash at decimal 47
+        52,53,54,55,56,57,58,59,60,61,              // Numbers zero through nine
+        -9,-9,-9,                                   // Decimal 58 - 60
+        -1,                                         // Equals sign at decimal 61
+        -9,-9,-9,                                      // Decimal 62 - 64
+        0,1,2,3,4,5,6,7,8,9,10,11,12,13,            // Letters 'A' through 'N'
+        14,15,16,17,18,19,20,21,22,23,24,25,        // Letters 'O' through 'Z'
+        -9,-9,-9,-9,-9,-9,                          // Decimal 91 - 96
+        26,27,28,29,30,31,32,33,34,35,36,37,38,     // Letters 'a' through 'm'
+        39,40,41,42,43,44,45,46,47,48,49,50,51,     // Letters 'n' through 'z'
+        -9,-9,-9,-9                                 // Decimal 123 - 126
+        /*,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 127 - 139
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 140 - 152
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 153 - 165
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 166 - 178
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 179 - 191
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 192 - 204
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 205 - 217
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 218 - 230
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,     // Decimal 231 - 243
+        -9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9,-9         // Decimal 244 - 255 */
+    };
+    
+    // I think I end up not using the BAD_ENCODING indicator.
+    //private final static byte BAD_ENCODING    = -9; // Indicates error in encoding
+    private final static byte WHITE_SPACE_ENC = -5; // Indicates white space in encoding
+    private final static byte EQUALS_SIGN_ENC = -1; // Indicates equals sign in encoding
+
+    
+    /** Defeats instantiation. */
+    private Base64(){}
+    
+    
+    
+/* ********  E N C O D I N G   M E T H O D S  ******** */    
+    
+    
+    /**
+     * Encodes up to the first three bytes of array <var>threeBytes</var>
+     * and returns a four-byte array in Base64 notation.
+     * The actual number of significant bytes in your array is
+     * given by <var>numSigBytes</var>.
+     * The array <var>threeBytes</var> needs only be as big as
+     * <var>numSigBytes</var>.
+     * Code can reuse a byte array by passing a four-byte array as <var>b4</var>.
+     *
+     * @param b4 A reusable byte array to reduce array instantiation
+     * @param threeBytes the array to convert
+     * @param numSigBytes the number of significant bytes in your array
+     * @return four byte array in Base64 notation.
+     * @since 1.5.1
+     */
+    private static byte[] encode3to4( byte[] b4, byte[] threeBytes, int numSigBytes )
+    {
+        encode3to4( threeBytes, 0, numSigBytes, b4, 0 );
+        return b4;
+    }   // end encode3to4
+
+    
+    /**
+     * Encodes up to three bytes of the array <var>source</var>
+     * and writes the resulting four Base64 bytes to <var>destination</var>.
+     * The source and destination arrays can be manipulated
+     * anywhere along their length by specifying 
+     * <var>srcOffset</var> and <var>destOffset</var>.
+     * This method does not check to make sure your arrays
+     * are large enough to accomodate <var>srcOffset</var> + 3 for
+     * the <var>source</var> array or <var>destOffset</var> + 4 for
+     * the <var>destination</var> array.
+     * The actual number of significant bytes in your array is
+     * given by <var>numSigBytes</var>.
+     *
+     * @param source the array to convert
+     * @param srcOffset the index where conversion begins
+     * @param numSigBytes the number of significant bytes in your array
+     * @param destination the array to hold the conversion
+     * @param destOffset the index where output will be put
+     * @return the <var>destination</var> array
+     * @since 1.3
+     */
+    private static byte[] encode3to4( 
+     byte[] source, int srcOffset, int numSigBytes,
+     byte[] destination, int destOffset )
+    {
+        //           1         2         3  
+        // 01234567890123456789012345678901 Bit position
+        // --------000000001111111122222222 Array position from threeBytes
+        // --------|    ||    ||    ||    | Six bit groups to index ALPHABET
+        //          >>18  >>12  >> 6  >> 0  Right shift necessary
+        //                0x3f  0x3f  0x3f  Additional AND
+        
+        // Create buffer with zero-padding if there are only one or two
+        // significant bytes passed in the array.
+        // We have to shift left 24 in order to flush out the 1's that appear
+        // when Java treats a value as negative that is cast from a byte to an int.
+        int inBuff =   ( numSigBytes > 0 ? ((source[ srcOffset     ] << 24) >>>  8) : 0 )
+                     | ( numSigBytes > 1 ? ((source[ srcOffset + 1 ] << 24) >>> 16) : 0 )
+                     | ( numSigBytes > 2 ? ((source[ srcOffset + 2 ] << 24) >>> 24) : 0 );
+
+        switch( numSigBytes )
+        {
+            case 3:
+                destination[ destOffset     ] = ALPHABET[ (inBuff >>> 18)        ];
+                destination[ destOffset + 1 ] = ALPHABET[ (inBuff >>> 12) & 0x3f ];
+                destination[ destOffset + 2 ] = ALPHABET[ (inBuff >>>  6) & 0x3f ];
+                destination[ destOffset + 3 ] = ALPHABET[ (inBuff       ) & 0x3f ];
+                return destination;
+                
+            case 2:
+                destination[ destOffset     ] = ALPHABET[ (inBuff >>> 18)        ];
+                destination[ destOffset + 1 ] = ALPHABET[ (inBuff >>> 12) & 0x3f ];
+                destination[ destOffset + 2 ] = ALPHABET[ (inBuff >>>  6) & 0x3f ];
+                destination[ destOffset + 3 ] = EQUALS_SIGN;
+                return destination;
+                
+            case 1:
+                destination[ destOffset     ] = ALPHABET[ (inBuff >>> 18)        ];
+                destination[ destOffset + 1 ] = ALPHABET[ (inBuff >>> 12) & 0x3f ];
+                destination[ destOffset + 2 ] = EQUALS_SIGN;
+                destination[ destOffset + 3 ] = EQUALS_SIGN;
+                return destination;
+                
+            default:
+                return destination;
+        }   // end switch
+    }   // end encode3to4
+    
+    
+    
+    /**
+     * Serializes an object and returns the Base64-encoded
+     * version of that serialized object. If the object
+     * cannot be serialized or there is another error,
+     * the method will return <tt>null</tt>.
+     * The object is not GZip-compressed before being encoded.
+     *
+     * @param serializableObject The object to encode
+     * @return The Base64-encoded object
+     * @since 1.4
+     */
+    public static String encodeObject( java.io.Serializable serializableObject )
+    {
+        return encodeObject( serializableObject, NO_OPTIONS );
+    }   // end encodeObject
+    
+
+
+    /**
+     * Serializes an object and returns the Base64-encoded
+     * version of that serialized object. If the object
+     * cannot be serialized or there is another error,
+     * the method will return <tt>null</tt>.
+     * <p>
+     * Valid options:<pre>
+     *   GZIP: gzip-compresses object before encoding it.
+     *   DONT_BREAK_LINES: don't break lines at 76 characters
+     *     <i>Note: Technically, this makes your encoding non-compliant.</i>
+     * </pre>
+     * <p>
+     * Example: <code>encodeObject( myObj, Base64.GZIP )</code> or
+     * <p>
+     * Example: <code>encodeObject( myObj, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
+     *
+     * @param serializableObject The object to encode
+     * @param options Specified options
+     * @return The Base64-encoded object
+     * @see Base64#GZIP
+     * @see Base64#DONT_BREAK_LINES
+     * @since 2.0
+     */
+    public static String encodeObject( java.io.Serializable serializableObject, int options )
+    {
+        // Streams
+        java.io.ByteArrayOutputStream  baos  = null; 
+        java.io.OutputStream           b64os = null; 
+        java.io.ObjectOutputStream     oos   = null; 
+        java.util.zip.GZIPOutputStream gzos  = null;
+        
+        // Isolate options
+        int gzip           = (options & GZIP);
+        int dontBreakLines = (options & DONT_BREAK_LINES);
+        
+        try
+        {
+            // ObjectOutputStream -> (GZIP) -> Base64 -> ByteArrayOutputStream
+            baos  = new java.io.ByteArrayOutputStream();
+            b64os = new Base64.OutputStream( baos, ENCODE | dontBreakLines );
+    
+            // GZip?
+            if( gzip == GZIP )
+            {
+                gzos = new java.util.zip.GZIPOutputStream( b64os );
+                oos  = new java.io.ObjectOutputStream( gzos );
+            }   // end if: gzip
+            else
+                oos   = new java.io.ObjectOutputStream( b64os );
+            
+            oos.writeObject( serializableObject );
+        }   // end try
+        catch( java.io.IOException e )
+        {
+            e.printStackTrace();
+            return null;
+        }   // end catch
+        finally
+        {
+            try{ oos.close();   } catch( Exception e ){}
+            try{ gzos.close();  } catch( Exception e ){}
+            try{ b64os.close(); } catch( Exception e ){}
+            try{ baos.close();  } catch( Exception e ){}
+        }   // end finally
+        
+        // Return value according to relevant encoding.
+        try 
+        {
+            return new String( baos.toByteArray(), PREFERRED_ENCODING );
+        }   // end try
+        catch (java.io.UnsupportedEncodingException uue)
+        {
+            return new String( baos.toByteArray() );
+        }   // end catch
+        
+    }   // end encode
+    
+    
+
+    /**
+     * Encodes a byte array into Base64 notation.
+     * Does not GZip-compress data.
+     *
+     * @param source The data to convert
+     * @since 1.4
+     */
+    public static String encodeBytes( byte[] source )
+    {
+        return encodeBytes( source, 0, source.length, NO_OPTIONS );
+    }   // end encodeBytes
+    
+
+
+    /**
+     * Encodes a byte array into Base64 notation.
+     * <p>
+     * Valid options:<pre>
+     *   GZIP: gzip-compresses object before encoding it.
+     *   DONT_BREAK_LINES: don't break lines at 76 characters
+     *     <i>Note: Technically, this makes your encoding non-compliant.</i>
+     * </pre>
+     * <p>
+     * Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
+     * <p>
+     * Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
+     *
+     *
+     * @param source The data to convert
+     * @param options Specified options
+     * @see Base64#GZIP
+     * @see Base64#DONT_BREAK_LINES
+     * @since 2.0
+     */
+    public static String encodeBytes( byte[] source, int options )
+    {   
+        return encodeBytes( source, 0, source.length, options );
+    }   // end encodeBytes
+    
+    
+    /**
+     * Encodes a byte array into Base64 notation.
+     * Does not GZip-compress data.
+     *
+     * @param source The data to convert
+     * @param off Offset in array where conversion should begin
+     * @param len Length of data to convert
+     * @since 1.4
+     */
+    public static String encodeBytes( byte[] source, int off, int len )
+    {
+        return encodeBytes( source, off, len, NO_OPTIONS );
+    }   // end encodeBytes
+    
+    
+
+    /**
+     * Encodes a byte array into Base64 notation.
+     * <p>
+     * Valid options:<pre>
+     *   GZIP: gzip-compresses object before encoding it.
+     *   DONT_BREAK_LINES: don't break lines at 76 characters
+     *     <i>Note: Technically, this makes your encoding non-compliant.</i>
+     * </pre>
+     * <p>
+     * Example: <code>encodeBytes( myData, Base64.GZIP )</code> or
+     * <p>
+     * Example: <code>encodeBytes( myData, Base64.GZIP | Base64.DONT_BREAK_LINES )</code>
+     *
+     *
+     * @param source The data to convert
+     * @param off Offset in array where conversion should begin
+     * @param len Length of data to convert
+     * @param options Specified options
+     * @see Base64#GZIP
+     * @see Base64#DONT_BREAK_LINES
+     * @since 2.0
+     */
+    public static String encodeBytes( byte[] source, int off, int len, int options )
+    {
+        // Isolate options
+        int dontBreakLines = ( options & DONT_BREAK_LINES );
+        int gzip           = ( options & GZIP   );
+        
+        // Compress?
+        if( gzip == GZIP )
+        {
+            java.io.ByteArrayOutputStream  baos  = null;
+            java.util.zip.GZIPOutputStream gzos  = null;
+            Base64.OutputStream            b64os = null;
+            
+    
+            try
+            {
+                // GZip -> Base64 -> ByteArray
+                baos = new java.io.ByteArrayOutputStream();
+                b64os = new Base64.OutputStream( baos, ENCODE | dontBreakLines );
+                gzos  = new java.util.zip.GZIPOutputStream( b64os ); 
+            
+                gzos.write( source, off, len );
+                gzos.close();
+            }   // end try
+            catch( java.io.IOException e )
+            {
+                e.printStackTrace();
+                return null;
+            }   // end catch
+            finally
+            {
+                try{ gzos.close();  } catch( Exception e ){}
+                try{ b64os.close(); } catch( Exception e ){}
+                try{ baos.close();  } catch( Exception e ){}
+            }   // end finally
+
+            // Return value according to relevant encoding.
+            try
+            {
+                return new String( baos.toByteArray(), PREFERRED_ENCODING );
+            }   // end try
+            catch (java.io.UnsupportedEncodingException uue)
+            {
+                return new String( baos.toByteArray() );
+            }   // end catch
+        }   // end if: compress
+        
+        // Else, don't compress. Better not to use streams at all then.
+        else
+        {
+            // Convert option to boolean in way that code likes it.
+            boolean breakLines = dontBreakLines == 0;
+            
+            int    len43   = len * 4 / 3;
+            byte[] outBuff = new byte[   ( len43 )                      // Main 4:3
+                                       + ( (len % 3) > 0 ? 4 : 0 )      // Account for padding
+                                       + (breakLines ? ( len43 / MAX_LINE_LENGTH ) : 0) ]; // New lines      
+            int d = 0;
+            int e = 0;
+            int len2 = len - 2;
+            int lineLength = 0;
+            for( ; d < len2; d+=3, e+=4 )
+            {
+                encode3to4( source, d+off, 3, outBuff, e );
+
+                lineLength += 4;
+                if( breakLines && lineLength == MAX_LINE_LENGTH )
+                {   
+                    outBuff[e+4] = NEW_LINE;
+                    e++;
+                    lineLength = 0;
+                }   // end if: end of line
+            }   // en dfor: each piece of array
+
+            if( d < len )
+            {
+                encode3to4( source, d+off, len - d, outBuff, e );
+                e += 4;
+            }   // end if: some padding needed
+
+            
+            // Return value according to relevant encoding.
+            try
+            {
+                return new String( outBuff, 0, e, PREFERRED_ENCODING );
+            }   // end try
+            catch (java.io.UnsupportedEncodingException uue)
+            {
+                return new String( outBuff, 0, e );
+            }   // end catch
+            
+        }   // end else: don't compress
+        
+    }   // end encodeBytes
+    
+
+    
+    
+    
+/* ********  D E C O D I N G   M E T H O D S  ******** */
+    
+    
+    /**
+     * Decodes four bytes from array <var>source</var>
+     * and writes the resulting bytes (up to three of them)
+     * to <var>destination</var>.
+     * The source and destination arrays can be manipulated
+     * anywhere along their length by specifying 
+     * <var>srcOffset</var> and <var>destOffset</var>.
+     * This method does not check to make sure your arrays
+     * are large enough to accomodate <var>srcOffset</var> + 4 for
+     * the <var>source</var> array or <var>destOffset</var> + 3 for
+     * the <var>destination</var> array.
+     * This method returns the actual number of bytes that 
+     * were converted from the Base64 encoding.
+     * 
+     *
+     * @param source the array to convert
+     * @param srcOffset the index where conversion begins
+     * @param destination the array to hold the conversion
+     * @param destOffset the index where output will be put
+     * @return the number of decoded bytes converted
+     * @since 1.3
+     */
+    private static int decode4to3( byte[] source, int srcOffset, byte[] destination, int destOffset )
+    {
+        // Example: Dk==
+        if( source[ srcOffset + 2] == EQUALS_SIGN )
+        {
+            // Two ways to do the same thing. Don't know which way I like best.
+            //int outBuff =   ( ( DECODABET[ source[ srcOffset    ] ] << 24 ) >>>  6 )
+            //              | ( ( DECODABET[ source[ srcOffset + 1] ] << 24 ) >>> 12 );
+            int outBuff =   ( ( DECODABET[ source[ srcOffset    ] ] & 0xFF ) << 18 )
+                          | ( ( DECODABET[ source[ srcOffset + 1] ] & 0xFF ) << 12 );
+            
+            destination[ destOffset ] = (byte)( outBuff >>> 16 );
+            return 1;
+        }
+        
+        // Example: DkL=
+        else if( source[ srcOffset + 3 ] == EQUALS_SIGN )
+        {
+            // Two ways to do the same thing. Don't know which way I like best.
+            //int outBuff =   ( ( DECODABET[ source[ srcOffset     ] ] << 24 ) >>>  6 )
+            //              | ( ( DECODABET[ source[ srcOffset + 1 ] ] << 24 ) >>> 12 )
+            //              | ( ( DECODABET[ source[ srcOffset + 2 ] ] << 24 ) >>> 18 );
+            int outBuff =   ( ( DECODABET[ source[ srcOffset     ] ] & 0xFF ) << 18 )
+                          | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 )
+                          | ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) <<  6 );
+            
+            destination[ destOffset     ] = (byte)( outBuff >>> 16 );
+            destination[ destOffset + 1 ] = (byte)( outBuff >>>  8 );
+            return 2;
+        }
+        
+        // Example: DkLE
+        else
+        {
+            try{
+            // Two ways to do the same thing. Don't know which way I like best.
+            //int outBuff =   ( ( DECODABET[ source[ srcOffset     ] ] << 24 ) >>>  6 )
+            //              | ( ( DECODABET[ source[ srcOffset + 1 ] ] << 24 ) >>> 12 )
+            //              | ( ( DECODABET[ source[ srcOffset + 2 ] ] << 24 ) >>> 18 )
+            //              | ( ( DECODABET[ source[ srcOffset + 3 ] ] << 24 ) >>> 24 );
+            int outBuff =   ( ( DECODABET[ source[ srcOffset     ] ] & 0xFF ) << 18 )
+                          | ( ( DECODABET[ source[ srcOffset + 1 ] ] & 0xFF ) << 12 )
+                          | ( ( DECODABET[ source[ srcOffset + 2 ] ] & 0xFF ) <<  6)
+                          | ( ( DECODABET[ source[ srcOffset + 3 ] ] & 0xFF )      );
+
+            
+            destination[ destOffset     ] = (byte)( outBuff >> 16 );
+            destination[ destOffset + 1 ] = (byte)( outBuff >>  8 );
+            destination[ destOffset + 2 ] = (byte)( outBuff       );
+
+            return 3;
+            }catch( Exception e){
+                System.out.println(""+source[srcOffset]+ ": " + ( DECODABET[ source[ srcOffset     ] ]  ) );
+                System.out.println(""+source[srcOffset+1]+  ": " + ( DECODABET[ source[ srcOffset + 1 ] ]  ) );
+                System.out.println(""+source[srcOffset+2]+  ": " + ( DECODABET[ source[ srcOffset + 2 ] ]  ) );
+                System.out.println(""+source[srcOffset+3]+  ": " + ( DECODABET[ source[ srcOffset + 3 ] ]  ) );
+                return -1;
+            }   //e nd catch
+        }
+    }   // end decodeToBytes
+    
+    
+    
+    
+    /**
+     * Very low-level access to decoding ASCII characters in
+     * the form of a byte array. Does not support automatically
+     * gunzipping or any other "fancy" features.
+     *
+     * @param source The Base64 encoded data
+     * @param off    The offset of where to begin decoding
+     * @param len    The length of characters to decode
+     * @return decoded data
+     * @since 1.3
+     */
+    public static byte[] decode( byte[] source, int off, int len )
+    {
+        int    len34   = len * 3 / 4;
+        byte[] outBuff = new byte[ len34 ]; // Upper limit on size of output
+        int    outBuffPosn = 0;
+        
+        byte[] b4        = new byte[4];
+        int    b4Posn    = 0;
+        int    i         = 0;
+        byte   sbiCrop   = 0;
+        byte   sbiDecode = 0;
+        for( i = off; i < off+len; i++ )
+        {
+            sbiCrop = (byte)(source[i] & 0x7f); // Only the low seven bits
+            sbiDecode = DECODABET[ sbiCrop ];
+            
+            if( sbiDecode >= WHITE_SPACE_ENC ) // White space, Equals sign or better
+            {
+                if( sbiDecode >= EQUALS_SIGN_ENC )
+                {
+                    b4[ b4Posn++ ] = sbiCrop;
+                    if( b4Posn > 3 )
+                    {
+                        outBuffPosn += decode4to3( b4, 0, outBuff, outBuffPosn );
+                        b4Posn = 0;
+                        
+                        // If that was the equals sign, break out of 'for' loop
+                        if( sbiCrop == EQUALS_SIGN )
+                            break;
+                    }   // end if: quartet built
+                    
+                }   // end if: equals sign or better
+                
+            }   // end if: white space, equals sign or better
+            else
+            {
+                System.err.println( "Bad Base64 input character at " + i + ": " + source[i] + "(decimal)" );
+                return null;
+            }   // end else: 
+        }   // each input character
+                                   
+        byte[] out = new byte[ outBuffPosn ];
+        System.arraycopy( outBuff, 0, out, 0, outBuffPosn ); 
+        return out;
+    }   // end decode
+    
+    
+    
+    
+    /**
+     * Decodes data from Base64 notation, automatically
+     * detecting gzip-compressed data and decompressing it.
+     *
+     * @param s the string to decode
+     * @return the decoded data
+     * @since 1.4
+     */
+    public static byte[] decode( String s )
+    {   
+        byte[] bytes;
+        try
+        {
+            bytes = s.getBytes( PREFERRED_ENCODING );
+        }   // end try
+        catch( java.io.UnsupportedEncodingException uee )
+        {
+            bytes = s.getBytes();
+        }   // end catch
+		//</change>
+        
+        // Decode
+        bytes = decode( bytes, 0, bytes.length );
+        
+        
+        // Check to see if it's gzip-compressed
+        // GZIP Magic Two-Byte Number: 0x8b1f (35615)
+        if( bytes != null && bytes.length >= 4 )
+        {
+            
+            int head = ((int)bytes[0] & 0xff) | ((bytes[1] << 8) & 0xff00);       
+            if( java.util.zip.GZIPInputStream.GZIP_MAGIC == head ) 
+            {
+                java.io.ByteArrayInputStream  bais = null;
+                java.util.zip.GZIPInputStream gzis = null;
+                java.io.ByteArrayOutputStream baos = null;
+                byte[] buffer = new byte[2048];
+                int    length = 0;
+
+                try
+                {
+                    baos = new java.io.ByteArrayOutputStream();
+                    bais = new java.io.ByteArrayInputStream( bytes );
+                    gzis = new java.util.zip.GZIPInputStream( bais );
+
+                    while( ( length = gzis.read( buffer ) ) >= 0 )
+                    {
+                        baos.write(buffer,0,length);
+                    }   // end while: reading input
+
+                    // No error? Get new bytes.
+                    bytes = baos.toByteArray();
+
+                }   // end try
+                catch( java.io.IOException e )
+                {
+                    // Just return originally-decoded bytes
+                }   // end catch
+                finally
+                {
+                    try{ baos.close(); } catch( Exception e ){}
+                    try{ gzis.close(); } catch( Exception e ){}
+                    try{ bais.close(); } catch( Exception e ){}
+                }   // end finally
+
+            }   // end if: gzipped
+        }   // end if: bytes.length >= 2
+        
+        return bytes;
+    }   // end decode
+
+
+    
+
+    /**
+     * Attempts to decode Base64 data and deserialize a Java
+     * Object within. Returns <tt>null</tt> if there was an error.
+     *
+     * @param encodedObject The Base64 data to decode
+     * @return The decoded and deserialized object
+     * @since 1.5
+     */
+    public static Object decodeToObject( String encodedObject )
+    {
+        // Decode and gunzip if necessary
+        byte[] objBytes = decode( encodedObject );
+        
+        java.io.ByteArrayInputStream  bais = null;
+        java.io.ObjectInputStream     ois  = null;
+        Object obj = null;
+        
+        try
+        {
+            bais = new java.io.ByteArrayInputStream( objBytes );
+            ois  = new java.io.ObjectInputStream( bais );
+        
+            obj = ois.readObject();
+        }   // end try
+        catch( java.io.IOException e )
+        {
+            e.printStackTrace();
+            obj = null;
+        }   // end catch
+        catch( java.lang.ClassNotFoundException e )
+        {
+            e.printStackTrace();
+            obj = null;
+        }   // end catch
+        finally
+        {
+            try{ bais.close(); } catch( Exception e ){}
+            try{ ois.close();  } catch( Exception e ){}
+        }   // end finally
+        
+        return obj;
+    }   // end decodeObject
+    
+    
+    
+    /**
+     * Convenience method for encoding data to a file.
+     *
+     * @param dataToEncode byte array of data to encode in base64 form
+     * @param filename Filename for saving encoded data
+     * @return <tt>true</tt> if successful, <tt>false</tt> otherwise
+     *
+     * @since 2.1
+     */
+    public static boolean encodeToFile( byte[] dataToEncode, String filename )
+    {
+        boolean success = false;
+        Base64.OutputStream bos = null;
+        try
+        {
+            bos = new Base64.OutputStream( 
+                      new java.io.FileOutputStream( filename ), Base64.ENCODE );
+            bos.write( dataToEncode );
+            success = true;
+        }   // end try
+        catch( java.io.IOException e )
+        {
+            
+            success = false;
+        }   // end catch: IOException
+        finally
+        {
+            try{ bos.close(); } catch( Exception e ){}
+        }   // end finally
+        
+        return success;
+    }   // end encodeToFile
+    
+    
+    /**
+     * Convenience method for decoding data to a file.
+     *
+     * @param dataToDecode Base64-encoded data as a string
+     * @param filename Filename for saving decoded data
+     * @return <tt>true</tt> if successful, <tt>false</tt> otherwise
+     *
+     * @since 2.1
+     */
+    public static boolean decodeToFile( String dataToDecode, String filename )
+    {
+        boolean success = false;
+        Base64.OutputStream bos = null;
+        try
+        {
+                bos = new Base64.OutputStream( 
+                          new java.io.FileOutputStream( filename ), Base64.DECODE );
+                bos.write( dataToDecode.getBytes( PREFERRED_ENCODING ) );
+                success = true;
+        }   // end try
+        catch( java.io.IOException e )
+        {
+            success = false;
+        }   // end catch: IOException
+        finally
+        {
+                try{ bos.close(); } catch( Exception e ){}
+        }   // end finally
+        
+        return success;
+    }   // end decodeToFile
+    
+    
+    
+    
+    /**
+     * Convenience method for reading a base64-encoded
+     * file and decoding it.
+     *
+     * @param filename Filename for reading encoded data
+     * @return decoded byte array or null if unsuccessful
+     *
+     * @since 2.1
+     */
+    public static byte[] decodeFromFile( String filename )
+    {
+        byte[] decodedData = null;
+        Base64.InputStream bis = null;
+        try
+        {
+            // Set up some useful variables
+            java.io.File file = new java.io.File( filename );
+            byte[] buffer = null;
+            int length   = 0;
+            int numBytes = 0;
+            
+            // Check for size of file
+            if( file.length() > Integer.MAX_VALUE )
+            {
+                System.err.println( "File is too big for this convenience method (" + file.length() + " bytes)." );
+                return null;
+            }   // end if: file too big for int index
+            buffer = new byte[ (int)file.length() ];
+            
+            // Open a stream
+            bis = new Base64.InputStream( 
+                      new java.io.BufferedInputStream( 
+                      new java.io.FileInputStream( file ) ), Base64.DECODE );
+            
+            // Read until done
+            while( ( numBytes = bis.read( buffer, length, 4096 ) ) >= 0 )
+                length += numBytes;
+            
+            // Save in a variable to return
+            decodedData = new byte[ length ];
+            System.arraycopy( buffer, 0, decodedData, 0, length );
+            
+        }   // end try
+        catch( java.io.IOException e )
+        {
+            System.err.println( "Error decoding from file " + filename );
+        }   // end catch: IOException
+        finally
+        {
+            try{ bis.close(); } catch( Exception e) {}
+        }   // end finally
+        
+        return decodedData;
+    }   // end decodeFromFile
+    
+    
+    
+    /**
+     * Convenience method for reading a binary file
+     * and base64-encoding it.
+     *
+     * @param filename Filename for reading binary data
+     * @return base64-encoded string or null if unsuccessful
+     *
+     * @since 2.1
+     */
+    public static String encodeFromFile( String filename )
+    {
+        String encodedData = null;
+        Base64.InputStream bis = null;
+        try
+        {
+            // Set up some useful variables
+            java.io.File file = new java.io.File( filename );
+            byte[] buffer = new byte[ (int)(file.length() * 1.4) ];
+            int length   = 0;
+            int numBytes = 0;
+            
+            // Open a stream
+            bis = new Base64.InputStream( 
+                      new java.io.BufferedInputStream( 
+                      new java.io.FileInputStream( file ) ), Base64.ENCODE );
+            
+            // Read until done
+            while( ( numBytes = bis.read( buffer, length, 4096 ) ) >= 0 )
+                length += numBytes;
+            
+            // Save in a variable to return
+            encodedData = new String( buffer, 0, length, Base64.PREFERRED_ENCODING );
+                
+        }   // end try
+        catch( java.io.IOException e )
+        {
+            System.err.println( "Error encoding from file " + filename );
+        }   // end catch: IOException
+        finally
+        {
+            try{ bis.close(); } catch( Exception e) {}
+        }   // end finally
+        
+        return encodedData;
+        }   // end encodeFromFile
+    
+    
+    
+    
+    /* ********  I N N E R   C L A S S   I N P U T S T R E A M  ******** */
+    
+    
+    
+    /**
+     * A {@link Base64.InputStream} will read data from another
+     * <tt>java.io.InputStream</tt>, given in the constructor,
+     * and encode/decode to/from Base64 notation on the fly.
+     *
+     * @see Base64
+     * @since 1.3
+     */
+    public static class InputStream extends java.io.FilterInputStream
+    {
+        private boolean encode;         // Encoding or decoding
+        private int     position;       // Current position in the buffer
+        private byte[]  buffer;         // Small buffer holding converted data
+        private int     bufferLength;   // Length of buffer (3 or 4)
+        private int     numSigBytes;    // Number of meaningful bytes in the buffer
+        private int     lineLength;
+        private boolean breakLines;     // Break lines at less than 80 characters
+        
+        
+        /**
+         * Constructs a {@link Base64.InputStream} in DECODE mode.
+         *
+         * @param in the <tt>java.io.InputStream</tt> from which to read data.
+         * @since 1.3
+         */
+        public InputStream( java.io.InputStream in )
+        {   
+            this( in, DECODE );
+        }   // end constructor
+        
+        
+        /**
+         * Constructs a {@link Base64.InputStream} in
+         * either ENCODE or DECODE mode.
+         * <p>
+         * Valid options:<pre>
+         *   ENCODE or DECODE: Encode or Decode as data is read.
+         *   DONT_BREAK_LINES: don't break lines at 76 characters
+         *     (only meaningful when encoding)
+         *     <i>Note: Technically, this makes your encoding non-compliant.</i>
+         * </pre>
+         * <p>
+         * Example: <code>new Base64.InputStream( in, Base64.DECODE )</code>
+         *
+         *
+         * @param in the <tt>java.io.InputStream</tt> from which to read data.
+         * @param options Specified options
+         * @see Base64#ENCODE
+         * @see Base64#DECODE
+         * @see Base64#DONT_BREAK_LINES
+         * @since 2.0
+         */
+        public InputStream( java.io.InputStream in, int options )
+        {   
+            super( in );
+            this.breakLines   = (options & DONT_BREAK_LINES) != DONT_BREAK_LINES;
+            this.encode       = (options & ENCODE) == ENCODE;
+            this.bufferLength = encode ? 4 : 3;
+            this.buffer   = new byte[ bufferLength ];
+            this.position = -1;
+            this.lineLength = 0;
+        }   // end constructor
+        
+        /**
+         * Reads enough of the input stream to convert
+         * to/from Base64 and returns the next byte.
+         *
+         * @return next byte
+         * @since 1.3
+         */
+        public int read() throws java.io.IOException 
+        { 
+            // Do we need to get data?
+            if( position < 0 )
+            {
+                if( encode )
+                {
+                    byte[] b3 = new byte[3];
+                    int numBinaryBytes = 0;
+                    for( int i = 0; i < 3; i++ )
+                    {
+                        try
+                        { 
+                            int b = in.read();
+                            
+                            // If end of stream, b is -1.
+                            if( b >= 0 )
+                            {
+                                b3[i] = (byte)b;
+                                numBinaryBytes++;
+                            }   // end if: not end of stream
+                            
+                        }   // end try: read
+                        catch( java.io.IOException e )
+                        {   
+                            // Only a problem if we got no data at all.
+                            if( i == 0 )
+                                throw e;
+                            
+                        }   // end catch
+                    }   // end for: each needed input byte
+                    
+                    if( numBinaryBytes > 0 )
+                    {
+                        encode3to4( b3, 0, numBinaryBytes, buffer, 0 );
+                        position = 0;
+                        numSigBytes = 4;
+                    }   // end if: got data
+                    else
+                    {
+                        return -1;
+                    }   // end else
+                }   // end if: encoding
+                
+                // Else decoding
+                else
+                {
+                    byte[] b4 = new byte[4];
+                    int i = 0;
+                    for( i = 0; i < 4; i++ )
+                    {
+                        // Read four "meaningful" bytes:
+                        int b = 0;
+                        do{ b = in.read(); }
+                        while( b >= 0 && DECODABET[ b & 0x7f ] <= WHITE_SPACE_ENC );
+                        
+                        if( b < 0 )
+                            break; // Reads a -1 if end of stream
+                        
+                        b4[i] = (byte)b;
+                    }   // end for: each needed input byte
+                    
+                    if( i == 4 )
+                    {
+                        numSigBytes = decode4to3( b4, 0, buffer, 0 );
+                        position = 0;
+                    }   // end if: got four characters
+                    else if( i == 0 ){
+                        return -1;
+                    }   // end else if: also padded correctly
+                    else
+                    {
+                        // Must have broken out from above.
+                        throw new java.io.IOException( "Improperly padded Base64 input." );
+                    }   // end 
+                    
+                }   // end else: decode
+            }   // end else: get data
+            
+            // Got data?
+            if( position >= 0 )
+            {
+                // End of relevant data?
+                if( /*!encode &&*/ position >= numSigBytes )
+                    return -1;
+                
+                if( encode && breakLines && lineLength >= MAX_LINE_LENGTH )
+                {
+                    lineLength = 0;
+                    return '\n';
+                }   // end if
+                else
+                {
+                    lineLength++;   // This isn't important when decoding
+                                    // but throwing an extra "if" seems
+                                    // just as wasteful.
+                    
+                    int b = buffer[ position++ ];
+
+                    if( position >= bufferLength )
+                        position = -1;
+
+                    return b & 0xFF; // This is how you "cast" a byte that's
+                                     // intended to be unsigned.
+                }   // end else
+            }   // end if: position >= 0
+            
+            // Else error
+            else
+            {   
+                // When JDK1.4 is more accepted, use an assertion here.
+                throw new java.io.IOException( "Error in Base64 code reading stream." );
+            }   // end else
+        }   // end read
+        
+        
+        /**
+         * Calls {@link #read()} repeatedly until the end of stream
+         * is reached or <var>len</var> bytes are read.
+         * Returns number of bytes read into array or -1 if
+         * end of stream is encountered.
+         *
+         * @param dest array to hold values
+         * @param off offset for array
+         * @param len max number of bytes to read into array
+         * @return bytes read into array or -1 if end of stream is encountered.
+         * @since 1.3
+         */
+        public int read( byte[] dest, int off, int len ) throws java.io.IOException
+        {
+            int i;
+            int b;
+            for( i = 0; i < len; i++ )
+            {
+                b = read();
+                
+                //if( b < 0 && i == 0 )
+                //    return -1;
+                
+                if( b >= 0 )
+                    dest[off + i] = (byte)b;
+                else if( i == 0 )
+                    return -1;
+                else
+                    break; // Out of 'for' loop
+            }   // end for: each byte read
+            return i;
+        }   // end read
+        
+    }   // end inner class InputStream
+    
+    
+    
+    
+    
+    
+    /* ********  I N N E R   C L A S S   O U T P U T S T R E A M  ******** */
+    
+    
+    
+    /**
+     * A {@link Base64.OutputStream} will write data to another
+     * <tt>java.io.OutputStream</tt>, given in the constructor,
+     * and encode/decode to/from Base64 notation on the fly.
+     *
+     * @see Base64
+     * @since 1.3
+     */
+    public static class OutputStream extends java.io.FilterOutputStream
+    {
+        private boolean encode;
+        private int     position;
+        private byte[]  buffer;
+        private int     bufferLength;
+        private int     lineLength;
+        private boolean breakLines;
+        private byte[]  b4; // Scratch used in a few places
+        private boolean suspendEncoding;
+        
+        /**
+         * Constructs a {@link Base64.OutputStream} in ENCODE mode.
+         *
+         * @param out the <tt>java.io.OutputStream</tt> to which data will be written.
+         * @since 1.3
+         */
+        public OutputStream( java.io.OutputStream out )
+        {   
+            this( out, ENCODE );
+        }   // end constructor
+        
+        
+        /**
+         * Constructs a {@link Base64.OutputStream} in
+         * either ENCODE or DECODE mode.
+         * <p>
+         * Valid options:<pre>
+         *   ENCODE or DECODE: Encode or Decode as data is read.
+         *   DONT_BREAK_LINES: don't break lines at 76 characters
+         *     (only meaningful when encoding)
+         *     <i>Note: Technically, this makes your encoding non-compliant.</i>
+         * </pre>
+         * <p>
+         * Example: <code>new Base64.OutputStream( out, Base64.ENCODE )</code>
+         *
+         * @param out the <tt>java.io.OutputStream</tt> to which data will be written.
+         * @param options Specified options.
+         * @see Base64#ENCODE
+         * @see Base64#DECODE
+         * @see Base64#DONT_BREAK_LINES
+         * @since 1.3
+         */
+        public OutputStream( java.io.OutputStream out, int options )
+        {   
+            super( out );
+            this.breakLines   = (options & DONT_BREAK_LINES) != DONT_BREAK_LINES;
+            this.encode       = (options & ENCODE) == ENCODE;
+            this.bufferLength = encode ? 3 : 4;
+            this.buffer       = new byte[ bufferLength ];
+            this.position     = 0;
+            this.lineLength   = 0;
+            this.suspendEncoding = false;
+            this.b4           = new byte[4];
+        }   // end constructor
+        
+        
+        /**
+         * Writes the byte to the output stream after
+         * converting to/from Base64 notation.
+         * When encoding, bytes are buffered three
+         * at a time before the output stream actually
+         * gets a write() call.
+         * When decoding, bytes are buffered four
+         * at a time.
+         *
+         * @param theByte the byte to write
+         * @since 1.3
+         */
+        public void write(int theByte) throws java.io.IOException
+        {
+            // Encoding suspended?
+            if( suspendEncoding )
+            {
+                super.out.write( theByte );
+                return;
+            }   // end if: supsended
+            
+            // Encode?
+            if( encode )
+            {
+                buffer[ position++ ] = (byte)theByte;
+                if( position >= bufferLength )  // Enough to encode.
+                {
+                    out.write( encode3to4( b4, buffer, bufferLength ) );
+
+                    lineLength += 4;
+                    if( breakLines && lineLength >= MAX_LINE_LENGTH )
+                    {
+                        out.write( NEW_LINE );
+                        lineLength = 0;
+                    }   // end if: end of line
+
+                    position = 0;
+                }   // end if: enough to output
+            }   // end if: encoding
+
+            // Else, Decoding
+            else
+            {
+                // Meaningful Base64 character?
+                if( DECODABET[ theByte & 0x7f ] > WHITE_SPACE_ENC )
+                {
+                    buffer[ position++ ] = (byte)theByte;
+                    if( position >= bufferLength )  // Enough to output.
+                    {
+                        int len = Base64.decode4to3( buffer, 0, b4, 0 );
+                        out.write( b4, 0, len );
+                        //out.write( Base64.decode4to3( buffer ) );
+                        position = 0;
+                    }   // end if: enough to output
+                }   // end if: meaningful base64 character
+                else if( DECODABET[ theByte & 0x7f ] != WHITE_SPACE_ENC )
+                {
+                    throw new java.io.IOException( "Invalid character in Base64 data." );
+                }   // end else: not white space either
+            }   // end else: decoding
+        }   // end write
+        
+        
+        
+        /**
+         * Calls {@link #write(int)} repeatedly until <var>len</var> 
+         * bytes are written.
+         *
+         * @param theBytes array from which to read bytes
+         * @param off offset for array
+         * @param len max number of bytes to read into array
+         * @since 1.3
+         */
+        public void write( byte[] theBytes, int off, int len ) throws java.io.IOException
+        {
+            // Encoding suspended?
+            if( suspendEncoding )
+            {
+                super.out.write( theBytes, off, len );
+                return;
+            }   // end if: supsended
+            
+            for( int i = 0; i < len; i++ )
+            {
+                write( theBytes[ off + i ] );
+            }   // end for: each byte written
+            
+        }   // end write
+        
+        
+        
+        /**
+         * Method added by PHIL. [Thanks, PHIL. -Rob]
+         * This pads the buffer without closing the stream.
+         */
+        public void flushBase64() throws java.io.IOException 
+        {
+            if( position > 0 )
+            {
+                if( encode )
+                {
+                    out.write( encode3to4( b4, buffer, position ) );
+                    position = 0;
+                }   // end if: encoding
+                else
+                {
+                    throw new java.io.IOException( "Base64 input not properly padded." );
+                }   // end else: decoding
+            }   // end if: buffer partially full
+
+        }   // end flush
+
+        
+        /** 
+         * Flushes and closes (I think, in the superclass) the stream. 
+         *
+         * @since 1.3
+         */
+        public void close() throws java.io.IOException
+        {
+            // 1. Ensure that pending characters are written
+            flushBase64();
+
+            // 2. Actually close the stream
+            // Base class both flushes and closes.
+            super.close();
+            
+            buffer = null;
+            out    = null;
+        }   // end close
+        
+        
+        
+        /**
+         * Suspends encoding of the stream.
+         * May be helpful if you need to embed a piece of
+         * base640-encoded data in a stream.
+         *
+         * @since 1.5.1
+         */
+        public void suspendEncoding() throws java.io.IOException 
+        {
+            flushBase64();
+            this.suspendEncoding = true;
+        }   // end suspendEncoding
+        
+        
+        /**
+         * Resumes encoding of the stream.
+         * May be helpful if you need to embed a piece of
+         * base640-encoded data in a stream.
+         *
+         * @since 1.5.1
+         */
+        public void resumeEncoding()
+        {
+            this.suspendEncoding = false;
+        }   // end resumeEncoding
+        
+        
+        
+    }   // end inner class OutputStream
+    
+    
+}   // end class Base64

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,596 +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.internal.soa.esb.util;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.UnknownHostException;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-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.helpers.KeyValuePair;
-import org.jboss.soa.esb.util.FileUtil;
-import org.jboss.soa.esb.util.FtpClientUtil;
-import org.jboss.soa.esb.util.RemoteFileSystem;
-import org.jboss.soa.esb.util.RemoteFileSystemException;
-
-import com.enterprisedt.net.ftp.FTPClient;
-import com.enterprisedt.net.ftp.FTPConnectMode;
-import com.enterprisedt.net.ftp.FTPException;
-import com.enterprisedt.net.ftp.FTPTransferType;
-
-/**
- * Simplified FTP transfers
- * <p>
- * Description: Implements a simple set of FTP functionality Parameters to
- * establish the FTP connection are provided at construction time and cannot
- * change during the lifetime of the object <br/>Hides low level details.
- * Current implementation is based on the "Entreprise Distributed Technology
- * edtFTPj" library but this can be changed with no impact to existing code,
- * just by changing this class without modifying the signature of it's public
- * methods
- * </p>
- */
-
-public class EdtFtpImpl implements RemoteFileSystem
-{
-
-	private static final Logger _logger = Logger.getLogger(EdtFtpImpl.class);
-
-	private static final String TMP_SUFFIX = ".rosettaPart";
-
-	private boolean m_bPassive;
-
-	private int m_iPort;
-
-	private FTPClient m_oConn = new FTPClient();
-
-	private FTPEpr m_oEpr;
-
-	private ConfigTree m_oParms;
-
-	private FTPTransferType m_oXferType;
-
-	private String m_sFtpServer, m_sUser, m_sPasswd;
-
-	private String m_sRemoteDir, m_sLocalDir;
-
-	/**
-	 * Checks validity and completeness of parameters, and keeps the info
-	 * internally for subsequent FTP requests
-	 * 
-	 * @param p_oP
-	 *            ConfigTree
-	 * @throws ConfigurationException :
-	 *             if parameters are invalid or incomplete
-	 *             <li>Parameters: (XML attributes at the root level) </li>
-	 *             <li> ftpServer = name or IP of FTP server </li>
-	 *             <li> ftpUser = login ID for server </li>
-	 *             <li> ftpPassword </li>
-	 *             <li> localDirURI = absolute path in the local filesystem
-	 *             </li>
-	 *             <li> remoteDirURI = remote path is relative to ftp user home
-	 *             in remote computer </li>
-	 */
-
-	public EdtFtpImpl (ConfigTree p_oP, boolean p_bConnect)
-			throws ConfigurationException, RemoteFileSystemException
-	{
-		m_oParms = p_oP;
-		initialize(p_bConnect);
-	}
-
-	public EdtFtpImpl (FTPEpr p_oP, boolean p_bConnect)
-			throws ConfigurationException, RemoteFileSystemException
-	{
-		m_oEpr = p_oP;
-
-		URL url = null;
-		try
-		{
-			url = m_oEpr.getURL();
-		}
-		catch (MalformedURLException e)
-		{
-			throw new ConfigurationException(e);
-		}
-		catch (URISyntaxException e)
-		{
-			throw new ConfigurationException(e);
-		}
-
-		m_sFtpServer = url.getHost();
-
-		String[] sa = null;
-
-		if (url.getUserInfo() != null) sa = url.getUserInfo().split(":");
-
-		if (sa == null) sa = new String[] { "", "" };
-
-		m_sUser = (sa.length < 1) ? "" : sa[0];
-		m_sPasswd = (sa.length < 2) ? "" : sa[1];
-
-		m_sRemoteDir = url.getFile();
-
-		final String tmpdir = System.getProperty("java.io.tmpdir");
-		if ((m_sRemoteDir == null) || (m_sRemoteDir.equals("")))
-			m_sRemoteDir = ModulePropertyManager.getPropertyManager(
-					ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
-					Environment.FTP_REMOTEDIR, tmpdir);
-
-		m_iPort = url.getPort();
-		if (m_iPort < 0) m_iPort = url.getDefaultPort();
-
-		m_sLocalDir = ModulePropertyManager.getPropertyManager(
-				ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
-				Environment.FTP_LOCALDIR, tmpdir);
-
-		m_bPassive = false;
-
-		try
-		{
-			m_bPassive = m_oEpr.getPassive();
-		}
-		catch (URISyntaxException e)
-		{
-			_logger.warn(e);
-		}
-
-		// TODO there is still a bit of space for improvements here.
-		configTreeFromEpr();
-
-		initialize(p_bConnect);
-	}
-
-	public EdtFtpImpl (List<KeyValuePair> p_oAttribs, boolean p_bConnect)
-			throws ConfigurationException, RemoteFileSystemException
-	{
-		m_oParms = new ConfigTree("fromProps");
-		for (KeyValuePair oCurr : p_oAttribs)
-			m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
-		initialize(p_bConnect);
-	}
-
-	private void checkParms () throws ConfigurationException
-	{
-		String att = m_oParms.getAttribute(FileEpr.URL_TAG);
-		URL url = null;
-		
-		try
-		{
-			if (att != null)
-				url = new URL(att);
-		}
-		catch (MalformedURLException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-		
-		m_sFtpServer = (null != url) ? url.getHost() : m_oParms
-				.getAttribute(PARMS_FTP_SERVER);
-		if (null == m_sFtpServer)
-			throw new ConfigurationException("No FTP server specified");
-
-		String[] sa = (null == url) ? null : url.getUserInfo().split(":");
-		m_sUser = (null != sa) ? sa[0] : m_oParms.getAttribute(PARMS_USER);
-		if (null == m_sUser)
-			throw new ConfigurationException("No username specified for FTP");
-
-		m_sPasswd = (null != sa) ? sa[1] : m_oParms.getAttribute(PARMS_PASSWD);
-		if (null == m_sPasswd)
-			throw new ConfigurationException("No password specified for FTP");
-
-		m_sRemoteDir = (null != url) ? url.getFile() : m_oParms
-				.getAttribute(PARMS_REMOTE_DIR);
-		if (null == m_sRemoteDir) m_sRemoteDir = "";
-
-		m_sLocalDir = m_oParms.getAttribute(PARMS_LOCAL_DIR);
-		if (null == m_sLocalDir) m_sLocalDir = ".";
-
-		String sAux = m_oParms.getAttribute(PARMS_PORT);
-		m_iPort = (null != url) ? url.getPort() : (null == sAux) ? 21 : Integer
-				.parseInt(sAux);
-		
-		try
-		{
-			if (m_iPort < 0)
-				m_iPort = new URL("ftp://").getDefaultPort();
-		}
-		catch (MalformedURLException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-
-		// Dec-2006 (b_georges): it has been decided to set the Type to binary.
-		m_oXferType = FTPTransferType.BINARY;
-
-		m_bPassive = false;
-		sAux = m_oParms.getAttribute(PARMS_PASSIVE);
-		m_bPassive = (null != sAux) && Boolean.parseBoolean(sAux);
-
-		return;
-	}
-
-	private void configTreeFromEpr () throws RemoteFileSystemException
-	{
-		m_oParms = new ConfigTree("fromEpr");
-		try
-		{
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_FTP_SERVER,
-					m_sFtpServer);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_USER, m_sUser);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSWD, m_sPasswd);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_REMOTE_DIR,
-					m_sRemoteDir);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_PORT, Integer
-					.toString(m_iPort));
-			m_oParms
-					.setAttribute(RemoteFileSystem.PARMS_LOCAL_DIR, m_sLocalDir);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_ASCII, Boolean
-					.toString(false));
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSIVE, Boolean
-					.toString(m_bPassive));
-		}
-		catch (Exception e)
-		{
-			throw new RemoteFileSystemException(e);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#deleteRemoteFile(java.lang.String)
-	 */
-	public void deleteRemoteFile (String p_sFile) throws RemoteFileSystemException
-	{
-		try
-		{
-			m_oConn.delete(getRemoteDir() + "/" + new File(p_sFile).getName());
-		}
-		catch (Exception ex)
-		{
-			/*
-			 * It seems as though we have a race condition whereby one thread
-			 * tries to remove a file when another renames it!
-			 */
-			
-			throw new RemoteFileSystemException(ex);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#downloadFile(java.lang.String,
-	 *      java.lang.String)
-	 */
-	public void downloadFile (String p_sFile, String p_sFinalName)
-			throws IOException, RemoteFileSystemException
-	{
-		File oLocalDir = new File(m_sLocalDir);
-		File oLclFile = File.createTempFile("Rosetta_", TMP_SUFFIX, oLocalDir);
-
-		try
-		{
-			oLclFile.delete();
-		}
-		catch (Exception e)
-		{
-		}
-
-		try
-		{
-			m_oConn.get(FtpUtils.fileToFtpString(oLclFile), p_sFile);
-		}
-		catch (FTPException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-
-                final File to = new File(p_sFinalName) ;
-		final File oNew = (to.isAbsolute() ? to : new File(oLocalDir, p_sFinalName)) ;
-		
-		if (oNew.exists()) 
-			oNew.delete();
-		
-		FileUtil.renameTo(oLclFile, oNew);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getFileListFromRemoteDir(java.lang.String)
-	 */
-	public String[] getFileListFromRemoteDir (String p_sSuffix)
-			throws RemoteFileSystemException, IOException
-	{
-		String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
-
-		try
-		{
-			return m_oConn.dir(sSuffix);
-		}
-		catch (FTPException ex)
-		{
-			String msg = ex.getMessage();
-			int rc = ex.getReplyCode();
-			if (rc == 550) // means File Not Found - see JBESB-303
-			{
-				_logger
-						.debug("No matching file or directory. Server returns: [" + rc + "] " + msg);
-				return null;
-			}
-			else
-			{
-				// TODO Test with different FTP Servers
-				String sMess = this.getClass().getSimpleName() + " can't list " + sSuffix + " due to: [" + rc + "] " + msg;
-				throw new RemoteFileSystemException(sMess);
-			}
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getRemoteDir()
-	 */
-	public String getRemoteDir ()
-	{
-		return m_sRemoteDir;
-	}
-
-	private void initialize (boolean bConnect) throws ConfigurationException,
-			RemoteFileSystemException
-	{
-		checkParms();
-		if (bConnect)
-		{
-			try
-			{
-				m_oConn.setRemoteHost(m_sFtpServer);
-			}
-			catch (UnknownHostException ex)
-			{
-				_logger.error("Unknown host for FTP.", ex);
-
-				throw new ConfigurationException(ex);
-			}
-			catch (IOException ex)
-			{
-				_logger.error("Caught IOException", ex);
-				
-				throw new RemoteFileSystemException(ex);
-			}
-			catch (FTPException ex)
-			{
-				_logger.error("Caught FTPException.", ex);
-
-				throw new RemoteFileSystemException(ex);
-			}
-
-			try
-			{
-				m_oConn.setRemotePort(m_iPort);
-
-				m_oConn.connect();
-				for (int i1 = 0; i1 < 10 && !m_oConn.connected(); i1++)
-				{
-					try
-					{
-						Thread.sleep(200); // TODO arbitrary MAGIC number!
-					}
-					catch (InterruptedException ex)
-					{
-					}
-				}
-
-				// Configurable?
-				if (!m_oConn.connected())
-					throw new RemoteFileSystemException(
-							"Can't connect to FTP server");
-				m_oConn.user(m_sUser);
-				m_oConn.password(m_sPasswd);
-				m_oConn
-						.setConnectMode((m_bPassive) ? FTPConnectMode.PASV : FTPConnectMode.ACTIVE);
-				m_oConn.setType(m_oXferType);
-			}
-			catch (IOException ex)
-			{
-				throw new RemoteFileSystemException(ex);
-			}
-			catch (FTPException ex)
-			{
-				_logger.error("Caught FTPException.", ex);
-
-				throw new RemoteFileSystemException(ex);
-			}
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#quit()
-	 */
-	public void quit ()
-	{
-		if (null != m_oConn)
-		{
-			try
-			{
-				m_oConn.quit();
-			}
-			catch (Exception e)
-			{
-			}
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteDelete(java.io.File)
-	 */
-	public void remoteDelete (File p_oFile) throws RemoteFileSystemException
-	{
-		try
-		{
-			m_oConn.delete(getRemoteDir() + "/" + p_oFile.getName());
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-		catch (FTPException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteRename(java.io.File,
-	 *      java.io.File)
-	 */
-	public void remoteRename (File p_oFrom, File p_oTo) throws RemoteFileSystemException
-	{
-		try
-		{
-			m_oConn.rename(FtpClientUtil.fileToFtpString(p_oFrom), FtpUtils
-					.fileToFtpString(p_oTo));
-		}
-		catch (FTPException ex)
-		{
-			if (ex.getReplyCode() == 550) // EdtFtp error code meaning File
-			// Not Found
-			{
-				_logger
-						.debug("EdtFtpImpl tried to rename file that had moved.");
-
-				throw new RemoteFileSystemException("File not found.");
-			}
-			else
-			{
-				_logger.error("Caught FTPException.", ex);
-
-				throw new RemoteFileSystemException(ex);
-			}
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-
-			String sMess = this.getClass().getSimpleName() + " can't rename in remote directory <" + e
-					.getMessage() + ">";
-			throw new RemoteFileSystemException(sMess);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#renameInRemoteDir(java.lang.String,
-	 *      java.lang.String)
-	 */
-	public void renameInRemoteDir (String p_sFrom, String p_sTo)
-			throws RemoteFileSystemException
-	{
-		String sRmtFrom = new File(p_sFrom).getName();
-		String sRmtTo = new File(p_sTo).getName();
-
-		try
-		{
-			m_oConn.rename(getRemoteDir() + "/" + sRmtFrom,
-					getRemoteDir() + "/" + sRmtTo);
-		}
-		catch (Exception e)
-		{
-			String sMess = this.getClass().getSimpleName() + " can't rename in remote directory <" + e
-					.getMessage() + ">";
-			throw new RemoteFileSystemException(sMess);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#setRemoteDir(java.lang.String)
-	 */
-	public void setRemoteDir (String p_sDir) throws RemoteFileSystemException
-	{
-		if (p_sDir == null)
-			throw new IllegalArgumentException();
-		
-		try
-		{
-			m_oConn.chdir(p_sDir);
-			m_sRemoteDir = p_sDir;
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-		catch (FTPException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#uploadFile(java.io.File,
-	 *      java.lang.String)
-	 */
-	public void uploadFile (File p_oFile, String p_sRemoteName)
-			throws RemoteFileSystemException
-	{
-		String sRemoteOK = getRemoteDir() + "/" + p_sRemoteName;
-		String sRemoteTmp = sRemoteOK + TMP_SUFFIX;
-
-		try
-		{
-			m_oConn.put(FtpUtils.fileToFtpString(p_oFile), sRemoteTmp);
-			m_oConn.rename(sRemoteTmp, sRemoteOK);
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-		catch (FTPException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/EdtFtpImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,596 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.UnknownHostException;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+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.helpers.KeyValuePair;
+import org.jboss.soa.esb.util.FileUtil;
+import org.jboss.soa.esb.util.FtpClientUtil;
+import org.jboss.soa.esb.util.RemoteFileSystem;
+import org.jboss.soa.esb.util.RemoteFileSystemException;
+
+import com.enterprisedt.net.ftp.FTPClient;
+import com.enterprisedt.net.ftp.FTPConnectMode;
+import com.enterprisedt.net.ftp.FTPException;
+import com.enterprisedt.net.ftp.FTPTransferType;
+
+/**
+ * Simplified FTP transfers
+ * <p>
+ * Description: Implements a simple set of FTP functionality Parameters to
+ * establish the FTP connection are provided at construction time and cannot
+ * change during the lifetime of the object <br/>Hides low level details.
+ * Current implementation is based on the "Entreprise Distributed Technology
+ * edtFTPj" library but this can be changed with no impact to existing code,
+ * just by changing this class without modifying the signature of it's public
+ * methods
+ * </p>
+ */
+
+public class EdtFtpImpl implements RemoteFileSystem
+{
+
+	private static final Logger _logger = Logger.getLogger(EdtFtpImpl.class);
+
+	private static final String TMP_SUFFIX = ".rosettaPart";
+
+	private boolean m_bPassive;
+
+	private int m_iPort;
+
+	private FTPClient m_oConn = new FTPClient();
+
+	private FTPEpr m_oEpr;
+
+	private ConfigTree m_oParms;
+
+	private FTPTransferType m_oXferType;
+
+	private String m_sFtpServer, m_sUser, m_sPasswd;
+
+	private String m_sRemoteDir, m_sLocalDir;
+
+	/**
+	 * Checks validity and completeness of parameters, and keeps the info
+	 * internally for subsequent FTP requests
+	 * 
+	 * @param p_oP
+	 *            ConfigTree
+	 * @throws ConfigurationException :
+	 *             if parameters are invalid or incomplete
+	 *             <li>Parameters: (XML attributes at the root level) </li>
+	 *             <li> ftpServer = name or IP of FTP server </li>
+	 *             <li> ftpUser = login ID for server </li>
+	 *             <li> ftpPassword </li>
+	 *             <li> localDirURI = absolute path in the local filesystem
+	 *             </li>
+	 *             <li> remoteDirURI = remote path is relative to ftp user home
+	 *             in remote computer </li>
+	 */
+
+	public EdtFtpImpl (ConfigTree p_oP, boolean p_bConnect)
+			throws ConfigurationException, RemoteFileSystemException
+	{
+		m_oParms = p_oP;
+		initialize(p_bConnect);
+	}
+
+	public EdtFtpImpl (FTPEpr p_oP, boolean p_bConnect)
+			throws ConfigurationException, RemoteFileSystemException
+	{
+		m_oEpr = p_oP;
+
+		URL url = null;
+		try
+		{
+			url = m_oEpr.getURL();
+		}
+		catch (MalformedURLException e)
+		{
+			throw new ConfigurationException(e);
+		}
+		catch (URISyntaxException e)
+		{
+			throw new ConfigurationException(e);
+		}
+
+		m_sFtpServer = url.getHost();
+
+		String[] sa = null;
+
+		if (url.getUserInfo() != null) sa = url.getUserInfo().split(":");
+
+		if (sa == null) sa = new String[] { "", "" };
+
+		m_sUser = (sa.length < 1) ? "" : sa[0];
+		m_sPasswd = (sa.length < 2) ? "" : sa[1];
+
+		m_sRemoteDir = url.getFile();
+
+		final String tmpdir = System.getProperty("java.io.tmpdir");
+		if ((m_sRemoteDir == null) || (m_sRemoteDir.equals("")))
+			m_sRemoteDir = ModulePropertyManager.getPropertyManager(
+					ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
+					Environment.FTP_REMOTEDIR, tmpdir);
+
+		m_iPort = url.getPort();
+		if (m_iPort < 0) m_iPort = url.getDefaultPort();
+
+		m_sLocalDir = ModulePropertyManager.getPropertyManager(
+				ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
+				Environment.FTP_LOCALDIR, tmpdir);
+
+		m_bPassive = false;
+
+		try
+		{
+			m_bPassive = m_oEpr.getPassive();
+		}
+		catch (URISyntaxException e)
+		{
+			_logger.warn(e);
+		}
+
+		// TODO there is still a bit of space for improvements here.
+		configTreeFromEpr();
+
+		initialize(p_bConnect);
+	}
+
+	public EdtFtpImpl (List<KeyValuePair> p_oAttribs, boolean p_bConnect)
+			throws ConfigurationException, RemoteFileSystemException
+	{
+		m_oParms = new ConfigTree("fromProps");
+		for (KeyValuePair oCurr : p_oAttribs)
+			m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
+		initialize(p_bConnect);
+	}
+
+	private void checkParms () throws ConfigurationException
+	{
+		String att = m_oParms.getAttribute(FileEpr.URL_TAG);
+		URL url = null;
+		
+		try
+		{
+			if (att != null)
+				url = new URL(att);
+		}
+		catch (MalformedURLException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+		
+		m_sFtpServer = (null != url) ? url.getHost() : m_oParms
+				.getAttribute(PARMS_FTP_SERVER);
+		if (null == m_sFtpServer)
+			throw new ConfigurationException("No FTP server specified");
+
+		String[] sa = (null == url) ? null : url.getUserInfo().split(":");
+		m_sUser = (null != sa) ? sa[0] : m_oParms.getAttribute(PARMS_USER);
+		if (null == m_sUser)
+			throw new ConfigurationException("No username specified for FTP");
+
+		m_sPasswd = (null != sa) ? sa[1] : m_oParms.getAttribute(PARMS_PASSWD);
+		if (null == m_sPasswd)
+			throw new ConfigurationException("No password specified for FTP");
+
+		m_sRemoteDir = (null != url) ? url.getFile() : m_oParms
+				.getAttribute(PARMS_REMOTE_DIR);
+		if (null == m_sRemoteDir) m_sRemoteDir = "";
+
+		m_sLocalDir = m_oParms.getAttribute(PARMS_LOCAL_DIR);
+		if (null == m_sLocalDir) m_sLocalDir = ".";
+
+		String sAux = m_oParms.getAttribute(PARMS_PORT);
+		m_iPort = (null != url) ? url.getPort() : (null == sAux) ? 21 : Integer
+				.parseInt(sAux);
+		
+		try
+		{
+			if (m_iPort < 0)
+				m_iPort = new URL("ftp://").getDefaultPort();
+		}
+		catch (MalformedURLException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+
+		// Dec-2006 (b_georges): it has been decided to set the Type to binary.
+		m_oXferType = FTPTransferType.BINARY;
+
+		m_bPassive = false;
+		sAux = m_oParms.getAttribute(PARMS_PASSIVE);
+		m_bPassive = (null != sAux) && Boolean.parseBoolean(sAux);
+
+		return;
+	}
+
+	private void configTreeFromEpr () throws RemoteFileSystemException
+	{
+		m_oParms = new ConfigTree("fromEpr");
+		try
+		{
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_FTP_SERVER,
+					m_sFtpServer);
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_USER, m_sUser);
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSWD, m_sPasswd);
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_REMOTE_DIR,
+					m_sRemoteDir);
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_PORT, Integer
+					.toString(m_iPort));
+			m_oParms
+					.setAttribute(RemoteFileSystem.PARMS_LOCAL_DIR, m_sLocalDir);
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_ASCII, Boolean
+					.toString(false));
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSIVE, Boolean
+					.toString(m_bPassive));
+		}
+		catch (Exception e)
+		{
+			throw new RemoteFileSystemException(e);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#deleteRemoteFile(java.lang.String)
+	 */
+	public void deleteRemoteFile (String p_sFile) throws RemoteFileSystemException
+	{
+		try
+		{
+			m_oConn.delete(getRemoteDir() + "/" + new File(p_sFile).getName());
+		}
+		catch (Exception ex)
+		{
+			/*
+			 * It seems as though we have a race condition whereby one thread
+			 * tries to remove a file when another renames it!
+			 */
+			
+			throw new RemoteFileSystemException(ex);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#downloadFile(java.lang.String,
+	 *      java.lang.String)
+	 */
+	public void downloadFile (String p_sFile, String p_sFinalName)
+			throws IOException, RemoteFileSystemException
+	{
+		File oLocalDir = new File(m_sLocalDir);
+		File oLclFile = File.createTempFile("Rosetta_", TMP_SUFFIX, oLocalDir);
+
+		try
+		{
+			oLclFile.delete();
+		}
+		catch (Exception e)
+		{
+		}
+
+		try
+		{
+			m_oConn.get(FtpUtils.fileToFtpString(oLclFile), p_sFile);
+		}
+		catch (FTPException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+
+                final File to = new File(p_sFinalName) ;
+		final File oNew = (to.isAbsolute() ? to : new File(oLocalDir, p_sFinalName)) ;
+		
+		if (oNew.exists()) 
+			oNew.delete();
+		
+		FileUtil.renameTo(oLclFile, oNew);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getFileListFromRemoteDir(java.lang.String)
+	 */
+	public String[] getFileListFromRemoteDir (String p_sSuffix)
+			throws RemoteFileSystemException, IOException
+	{
+		String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
+
+		try
+		{
+			return m_oConn.dir(sSuffix);
+		}
+		catch (FTPException ex)
+		{
+			String msg = ex.getMessage();
+			int rc = ex.getReplyCode();
+			if (rc == 550) // means File Not Found - see JBESB-303
+			{
+				_logger
+						.debug("No matching file or directory. Server returns: [" + rc + "] " + msg);
+				return null;
+			}
+			else
+			{
+				// TODO Test with different FTP Servers
+				String sMess = this.getClass().getSimpleName() + " can't list " + sSuffix + " due to: [" + rc + "] " + msg;
+				throw new RemoteFileSystemException(sMess);
+			}
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getRemoteDir()
+	 */
+	public String getRemoteDir ()
+	{
+		return m_sRemoteDir;
+	}
+
+	private void initialize (boolean bConnect) throws ConfigurationException,
+			RemoteFileSystemException
+	{
+		checkParms();
+		if (bConnect)
+		{
+			try
+			{
+				m_oConn.setRemoteHost(m_sFtpServer);
+			}
+			catch (UnknownHostException ex)
+			{
+				_logger.error("Unknown host for FTP.", ex);
+
+				throw new ConfigurationException(ex);
+			}
+			catch (IOException ex)
+			{
+				_logger.error("Caught IOException", ex);
+				
+				throw new RemoteFileSystemException(ex);
+			}
+			catch (FTPException ex)
+			{
+				_logger.error("Caught FTPException.", ex);
+
+				throw new RemoteFileSystemException(ex);
+			}
+
+			try
+			{
+				m_oConn.setRemotePort(m_iPort);
+
+				m_oConn.connect();
+				for (int i1 = 0; i1 < 10 && !m_oConn.connected(); i1++)
+				{
+					try
+					{
+						Thread.sleep(200); // TODO arbitrary MAGIC number!
+					}
+					catch (InterruptedException ex)
+					{
+					}
+				}
+
+				// Configurable?
+				if (!m_oConn.connected())
+					throw new RemoteFileSystemException(
+							"Can't connect to FTP server");
+				m_oConn.user(m_sUser);
+				m_oConn.password(m_sPasswd);
+				m_oConn
+						.setConnectMode((m_bPassive) ? FTPConnectMode.PASV : FTPConnectMode.ACTIVE);
+				m_oConn.setType(m_oXferType);
+			}
+			catch (IOException ex)
+			{
+				throw new RemoteFileSystemException(ex);
+			}
+			catch (FTPException ex)
+			{
+				_logger.error("Caught FTPException.", ex);
+
+				throw new RemoteFileSystemException(ex);
+			}
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#quit()
+	 */
+	public void quit ()
+	{
+		if (null != m_oConn)
+		{
+			try
+			{
+				m_oConn.quit();
+			}
+			catch (Exception e)
+			{
+			}
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteDelete(java.io.File)
+	 */
+	public void remoteDelete (File p_oFile) throws RemoteFileSystemException
+	{
+		try
+		{
+			m_oConn.delete(getRemoteDir() + "/" + p_oFile.getName());
+		}
+		catch (IOException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+		catch (FTPException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteRename(java.io.File,
+	 *      java.io.File)
+	 */
+	public void remoteRename (File p_oFrom, File p_oTo) throws RemoteFileSystemException
+	{
+		try
+		{
+			m_oConn.rename(FtpClientUtil.fileToFtpString(p_oFrom), FtpUtils
+					.fileToFtpString(p_oTo));
+		}
+		catch (FTPException ex)
+		{
+			if (ex.getReplyCode() == 550) // EdtFtp error code meaning File
+			// Not Found
+			{
+				_logger
+						.debug("EdtFtpImpl tried to rename file that had moved.");
+
+				throw new RemoteFileSystemException("File not found.");
+			}
+			else
+			{
+				_logger.error("Caught FTPException.", ex);
+
+				throw new RemoteFileSystemException(ex);
+			}
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+
+			String sMess = this.getClass().getSimpleName() + " can't rename in remote directory <" + e
+					.getMessage() + ">";
+			throw new RemoteFileSystemException(sMess);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#renameInRemoteDir(java.lang.String,
+	 *      java.lang.String)
+	 */
+	public void renameInRemoteDir (String p_sFrom, String p_sTo)
+			throws RemoteFileSystemException
+	{
+		String sRmtFrom = new File(p_sFrom).getName();
+		String sRmtTo = new File(p_sTo).getName();
+
+		try
+		{
+			m_oConn.rename(getRemoteDir() + "/" + sRmtFrom,
+					getRemoteDir() + "/" + sRmtTo);
+		}
+		catch (Exception e)
+		{
+			String sMess = this.getClass().getSimpleName() + " can't rename in remote directory <" + e
+					.getMessage() + ">";
+			throw new RemoteFileSystemException(sMess);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#setRemoteDir(java.lang.String)
+	 */
+	public void setRemoteDir (String p_sDir) throws RemoteFileSystemException
+	{
+		if (p_sDir == null)
+			throw new IllegalArgumentException();
+		
+		try
+		{
+			m_oConn.chdir(p_sDir);
+			m_sRemoteDir = p_sDir;
+		}
+		catch (IOException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+		catch (FTPException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#uploadFile(java.io.File,
+	 *      java.lang.String)
+	 */
+	public void uploadFile (File p_oFile, String p_sRemoteName)
+			throws RemoteFileSystemException
+	{
+		String sRemoteOK = getRemoteDir() + "/" + p_sRemoteName;
+		String sRemoteTmp = sRemoteOK + TMP_SUFFIX;
+
+		try
+		{
+			m_oConn.put(FtpUtils.fileToFtpString(p_oFile), sRemoteTmp);
+			m_oConn.rename(sRemoteTmp, sRemoteOK);
+		}
+		catch (IOException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+		catch (FTPException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpUtils.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpUtils.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,42 +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.internal.soa.esb.util;
-
-import java.io.File;
-
-/**
- * Ftp handling utilities.
- * @author b_georges
- */
-public class FtpUtils {
-
-	/**
-	 * Transforms File path to FTP path
-	 * @param p_oF The file to transform
-	 * @return The modified path
-	 */
-	public static String fileToFtpString(File p_oF)
-	{
-		return (null == p_oF) ? null : p_oF.toString().replace("\\", "/");
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpUtils.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpUtils.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpUtils.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/FtpUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,42 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.util;
+
+import java.io.File;
+
+/**
+ * Ftp handling utilities.
+ * @author b_georges
+ */
+public class FtpUtils {
+
+	/**
+	 * Transforms File path to FTP path
+	 * @param p_oF The file to transform
+	 * @return The modified path
+	 */
+	public static String fileToFtpString(File p_oF)
+	{
+		return (null == p_oF) ? null : p_oF.toString().replace("\\", "/");
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,587 +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.internal.soa.esb.util;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Vector;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
-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.helpers.KeyValuePair;
-import org.jboss.soa.esb.util.FileUtil;
-import org.jboss.soa.esb.util.RemoteFileSystem;
-import org.jboss.soa.esb.util.RemoteFileSystemException;
-
-import com.jcraft.jsch.Channel;
-import com.jcraft.jsch.ChannelSftp;
-import com.jcraft.jsch.JSch;
-import com.jcraft.jsch.JSchException;
-import com.jcraft.jsch.Session;
-import com.jcraft.jsch.SftpATTRS;
-import com.jcraft.jsch.SftpException;
-import com.jcraft.jsch.UserInfo;
-import com.jcraft.jsch.ChannelSftp.LsEntry;
-
-/**
- * 
- * Implementation of sftp (Secure FTP over SSH) Based on JSch from JCraft
- * http://www.jcraft.com/
- * 
- * @author b_georges
- * 
- */
-
-public class SecureFtpImpl implements RemoteFileSystem 
-{
-
-	private static final Logger _logger = Logger.getLogger(SecureFtpImpl.class);
-
-	private static final String TMP_SUFFIX = ".rosettaPart";
-
-	private static final String SECURE_CHANNEL = "sftp";
-
-	// The objects implementing secure FTP over ssh
-	private JSch m_oJSch = new JSch();
-
-	private Session session = null;
-
-	private Channel m_oChannel = null;
-
-	private ChannelSftp m_oSftpChannel = null;
-
-	// TODO Add support for certificate. Not for GA though.
-	private URL m_oCertificate = null;
-
-	@SuppressWarnings("unused")
-	private boolean m_bConnected, m_bPassive;
-
-	private int m_iPort;
-
-	private SFTPEpr m_oEpr;
-
-	private ConfigTree m_oParms;
-
-	private String m_sFtpServer, m_sUser, m_sPasswd;
-
-	private String m_sRemoteDir, m_sLocalDir;
-
-	/*
-	 * Constructor
-	 * 
-	 * @param p_oP Is a config treeThe used to initialize the object
-	 * 
-	 * @param connect If true create a new sftp session
-	 * 
-	 */
-	public SecureFtpImpl(ConfigTree p_oP, boolean p_bConnect) throws ConfigurationException, RemoteFileSystemException
-	{
-		m_oParms = p_oP;
-		initialize(p_bConnect);
-	}
-
-	/*
-	 * Constructor
-	 * 
-	 * @param p_oP Is an EPR used to initialize the object
-	 * 
-	 * @param connect If true create a new sftp session
-	 * 
-	 */
-	public SecureFtpImpl(SFTPEpr p_oP, boolean p_bConnect) throws ConfigurationException, RemoteFileSystemException 
-	{
-
-		m_oEpr = p_oP;
-
-		URL url = null;
-		try {
-			url = m_oEpr.getURL();
-		} catch (MalformedURLException e) {
-			throw new RemoteFileSystemException(e);
-		} catch (URISyntaxException e) {
-			throw new RemoteFileSystemException(e);
-		}
-
-		m_sFtpServer = url.getHost();
-
-		String[] sa = null;
-
-		if (url.getUserInfo() != null)
-			sa = url.getUserInfo().split(":");
-
-		if (sa == null)
-			sa = new String[] { "", "" };
-
-		m_sUser = (sa.length < 1) ? "" : sa[0];
-		m_sPasswd = (sa.length < 2) ? "" : sa[1];
-
-		m_sRemoteDir = url.getFile();
-
-		final String tmpdir = System.getProperty("java.io.tmpdir");
-		if ((m_sRemoteDir == null) || (m_sRemoteDir.equals("")))
-			m_sRemoteDir = ModulePropertyManager.getPropertyManager(
-					ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
-							Environment.FTP_REMOTEDIR, tmpdir);
-
-		m_iPort = url.getPort();
-		if (m_iPort < 0)
-			m_iPort = url.getDefaultPort();
-
-		m_sLocalDir = ModulePropertyManager.getPropertyManager(
-				ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
-						Environment.FTP_LOCALDIR, tmpdir);
-
-		m_bPassive = false;
-
-		try
-		{
-			m_bPassive = m_oEpr.getPassive();
-		} catch (URISyntaxException e) 
-		{
-			_logger.warn(e);
-		}
-
-		try
-		{
-			m_oCertificate = m_oEpr.getCertificateURL();
-		} 
-		catch (MalformedURLException ex)
-		{
-			_logger.error(ex);
-			
-			throw new ConfigurationException(ex);
-		}
-		catch (URISyntaxException e) 
-		{
-			_logger.warn(e);
-			
-			throw new ConfigurationException(e);
-		}
-
-		// TODO there is still a bit of space for improvements here.
-		configTreeFromEpr();
-
-		initialize(p_bConnect);
-	}
-
-	/*
-	 * Constructor
-	 * 
-	 * @param attribs The key/value pairs used to initialize the object
-	 * 
-	 * @param connect If true create a new sftp session using attribs
-	 * 
-	 */
-	public SecureFtpImpl(List<KeyValuePair> attribs, boolean connect)
-	throws ConfigurationException, RemoteFileSystemException 
-	{
-		m_oParms = new ConfigTree("fromProps");
-		for (KeyValuePair oCurr : attribs)
-			m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
-		initialize(connect);
-	}
-
-	private void initialize(boolean bConnect) throws ConfigurationException, RemoteFileSystemException
-	{
-		checkParms();
-		
-		if (bConnect) 
-		{
-			try
-			{
-				session = m_oJSch.getSession(m_sUser, m_sFtpServer, m_iPort);
-	
-				UserInfo ui = new SecureFtpUserInfo(m_sPasswd);
-				session.setUserInfo(ui);
-	
-				session.connect();
-	
-				m_oChannel = session.openChannel(SECURE_CHANNEL);
-	
-				m_oChannel.connect();
-	
-				m_oSftpChannel = (ChannelSftp) m_oChannel;
-	
-				for (int i1 = 0; i1 < 10 && !session.isConnected(); i1++)
-				{
-					try
-					{
-						Thread.sleep(200);  // TODO magic number
-					}
-					catch (InterruptedException ex)
-					{
-						// try again?
-					}
-				}
-				
-				if (!session.isConnected())
-					throw new RemoteFileSystemException("Can't connect to FTP server");
-	
-				m_bConnected = this.session.isConnected();
-			}
-			catch (JSchException ex)
-			{
-				_logger.error("Caught Secure FTP Exception.", ex);
-				
-				throw new RemoteFileSystemException(ex);
-			}
-		}
-		// TODO set connection Mode [PASSIVE|ACTIVE]using m_bPassive ?
-
-	}
-
-	private void checkParms() throws ConfigurationException 
-	{
-		m_sFtpServer = m_oParms.getAttribute(PARMS_FTP_SERVER);
-		if (null == m_sFtpServer)
-			throw new ConfigurationException("No SFTP server specified");
-
-		m_sUser = m_oParms.getAttribute(PARMS_USER);
-		if (null == m_sUser)
-			throw new ConfigurationException("No username specified for SFTP");
-
-		m_sPasswd = m_oParms.getAttribute(PARMS_PASSWD);
-		if (null == m_sPasswd)
-			throw new ConfigurationException("No password specified for SFTP");
-
-		m_sRemoteDir = m_oParms.getAttribute(PARMS_REMOTE_DIR);
-		if (null == m_sRemoteDir)
-			m_sRemoteDir = "";
-
-		m_sLocalDir = m_oParms.getAttribute(PARMS_LOCAL_DIR);
-		if (null == m_sLocalDir)
-			m_sLocalDir = ".";
-
-		String sAux = m_oParms.getAttribute(PARMS_PORT);
-		
-		try
-		{
-			m_iPort = (null == sAux) ? 22 : Integer.parseInt(sAux);
-		}
-		catch (Exception ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-
-		m_bPassive = false;
-		sAux = m_oParms.getAttribute(PARMS_PASSIVE);
-		m_bPassive = (null != sAux) && Boolean.parseBoolean(sAux);
-
-		final String certificate = m_oParms.getAttribute(PARMS_CERTIFICATE) ;
-		
-		if (certificate != null)
-		{
-			try
-			{
-				m_oCertificate = new URL(certificate);
-			}
-			catch (MalformedURLException ex)
-			{
-				throw new ConfigurationException(ex);
-			}
-		}
-	}
-
-	/*
-	 * Deletes a file on the SFTP-Server
-	 * 
-	 * @param fileName The file's Name to be removed from the SFTP-Server
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#deleteRemoteFile(java.lang.String)
-	 */
-	public void deleteRemoteFile(String p_sFile) throws RemoteFileSystemException 
-	{
-		try
-		{
-			m_oSftpChannel.rm(getRemoteDir() + "/" + new File(p_sFile).getName());
-		}
-		catch (SftpException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	}
-
-	/*
-	 * Deletes a file on the SFTP-Server
-	 * 
-	 * @param fileName The file to be removed from the SFTP-Server
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteDelete(java.io.File)
-	 */
-	public void remoteDelete(File p_oFile) throws RemoteFileSystemException 
-	{
-		try
-		{
-			m_oSftpChannel.rm(FtpUtils.fileToFtpString(p_oFile));
-		}
-		catch (SftpException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	}
-
-	/*
-	 * Returns a list of Filenames for the directory specified in p_Suffix
-	 * 
-	 * @param p_sSuffix The remote directory path from the SFTP-Server
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getFileListFromRemoteDir(java.lang.String)
-	 */
-	public String[] getFileListFromRemoteDir(String p_sSuffix) throws RemoteFileSystemException 
-	{
-		try
-		{
-			String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
-			List<String> lFileList = new ArrayList<String>();
-			Vector vFileList = m_oSftpChannel.ls(sSuffix);
-			
-			if (vFileList != null) 
-			{
-				for (int i = 0; i < vFileList.size(); i++) 
-				{
-					Object obj = vFileList.elementAt(i);
-					
-					if (obj instanceof LsEntry) 
-					{
-						SftpATTRS oSftAttr = ((LsEntry) obj).getAttrs();
-						if (!oSftAttr.isDir()) 
-						{
-							lFileList.add(((LsEntry) obj).getFilename());
-						}
-					}
-				}
-			}
-			
-			return (String[]) lFileList.toArray(new String[lFileList.size()]);
-		}
-		catch (SftpException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	}
-
-	/*
-	 * Set the new directory to p_SDir
-	 * 
-	 * @param p_sDir The remote directory path name we want to "cd" to.
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#setRemoteDir(java.lang.String)
-	 */
-	public void setRemoteDir(String p_sDir) throws RemoteFileSystemException 
-	{
-		try
-		{
-			m_oSftpChannel.cd(p_sDir);
-		}
-		catch (SftpException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	}
-
-	/*
-	 * Rename the Remote Directory name p_sFrom with p_sTo
-	 * 
-	 * @param p_sFrom The remote directory name we want to rename
-	 * 
-	 * @param p_sTo The new remote directory name
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#renameInRemoteDir(java.lang.String,
-	 *      java.lang.String)
-	 */
-	public void renameInRemoteDir(String p_sFrom, String p_sTo)
-	throws RemoteFileSystemException 
-	{
-
-		String sRmtFrom = new File(p_sFrom).getName();
-		String sRmtTo = new File(p_sTo).getName();
-
-		try 
-		{
-			m_oSftpChannel.rename(getRemoteDir() + "/" + sRmtFrom,
-					getRemoteDir() + "/" + sRmtTo);
-		} 
-		catch (Exception e) 
-		{
-			String sMess = this.getClass().getSimpleName()
-			+ " can't rename in remote directory <" + e.getMessage()
-			+ ">";
-			throw new RemoteFileSystemException(sMess);
-		}
-	}
-
-	/*
-	 * Rename the Remote File name p_sFrom with p_sTo
-	 * 
-	 * @param p_oFrom The remote file name we want to rename
-	 * 
-	 * @param p_oTo The new remote file name
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteRename(java.io.File,
-	 *      java.io.File)
-	 */
-	public void remoteRename(File p_oFrom, File p_oTo) throws RemoteFileSystemException 
-	{
-		try 
-		{
-			m_oSftpChannel.rename(FtpUtils.fileToFtpString(p_oFrom), FtpUtils
-					.fileToFtpString(p_oTo));
-		} 
-		catch (Exception e) 
-		{
-			String sMess = this.getClass().getSimpleName()
-			+ " can't rename in remote directory <" + e.getMessage()
-			+ ">";
-			throw new RemoteFileSystemException(sMess);
-		}
-	}
-
-	/*
-	 * Upload the local File p_ofile to p_sRemoteName
-	 * 
-	 * @param p_oFile The local file name we want to upload
-	 * 
-	 * @param p_sRemoteName The remote file name [can be the same as p_oFile of
-	 * course]
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#uploadFile(java.io.File,
-	 *      java.lang.String)
-	 */
-	public void uploadFile(File p_oFile, String p_sRemoteName) throws RemoteFileSystemException 
-	{
-		try
-		{
-			String sRemoteOK = getRemoteDir() + "/" + p_sRemoteName;
-			String sRemoteTmp = sRemoteOK + TMP_SUFFIX;
-			m_oSftpChannel.put(FtpUtils.fileToFtpString(p_oFile), sRemoteTmp);
-			m_oSftpChannel.rename(sRemoteTmp, sRemoteOK);
-		}
-		catch (SftpException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	}
-
-	/*
-	 * Download the remote File p_sFile to p_sFile.
-	 * 
-	 * @param p_sFile The remote file name we want to download
-	 * 
-	 * @param p_sFinalName The local file name
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#downloadFile(java.lang.String,
-	 *      java.lang.String)
-	 */
-	public void downloadFile(String p_sFile, String p_sFinalName) throws IOException, RemoteFileSystemException 
-	{
-		File oLocalDir = new File(m_sLocalDir);
-		File oLclFile = File.createTempFile("Rosetta_", TMP_SUFFIX, oLocalDir);
-
-		try 
-		{
-			oLclFile.delete();
-		} 
-		catch (Exception e) 
-		{
-			_logger.warn("Could not delete file: "+oLclFile, e);
-		}
-		// TODO check if we have to set the Transfer Type with JSch impl =>
-		// m_oXferType
-		
-		try
-		{
-			m_oSftpChannel.get(p_sFile, FtpUtils.fileToFtpString(oLclFile));
-	
-			File oNew = new File(oLocalDir, p_sFinalName);
-			if (oNew.exists())
-				oNew.delete();
-			FileUtil.renameTo(oLclFile, oNew);
-		}
-		catch (Exception ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	}
-
-	/*
-	 * Returns the current remote directory
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getRemoteDir()
-	 */
-	public String getRemoteDir() 
-	{
-		return m_sRemoteDir;
-	}
-
-	/*
-	 * Terminates the sftp session.
-	 * 
-	 * @see org.jboss.soa.esb.util.RemoteFileSystem#quit()
-	 */
-	public void quit() 
-	{
-		m_oSftpChannel.quit();
-	}
-
-	private void configTreeFromEpr() throws ConfigurationException 
-	{
-		m_oParms = new ConfigTree("fromEpr");
-		try 
-		{
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_FTP_SERVER,
-					m_sFtpServer);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_USER, m_sUser);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSWD, m_sPasswd);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_REMOTE_DIR,
-					m_sRemoteDir);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_PORT, Integer
-					.toString(m_iPort));
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_LOCAL_DIR, m_sLocalDir);
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_ASCII, Boolean
-					.toString(false));
-			m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSIVE, Boolean
-					.toString(m_bPassive));
-			if (m_oCertificate != null)
-			{
-				m_oParms.setAttribute(RemoteFileSystem.PARMS_CERTIFICATE, m_oCertificate.toString());
-			}
-		} 
-		catch (Exception e) 
-		{
-			throw new ConfigurationException(e);
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,587 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+/**
+ * 
+ */
+package org.jboss.internal.soa.esb.util;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Vector;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
+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.helpers.KeyValuePair;
+import org.jboss.soa.esb.util.FileUtil;
+import org.jboss.soa.esb.util.RemoteFileSystem;
+import org.jboss.soa.esb.util.RemoteFileSystemException;
+
+import com.jcraft.jsch.Channel;
+import com.jcraft.jsch.ChannelSftp;
+import com.jcraft.jsch.JSch;
+import com.jcraft.jsch.JSchException;
+import com.jcraft.jsch.Session;
+import com.jcraft.jsch.SftpATTRS;
+import com.jcraft.jsch.SftpException;
+import com.jcraft.jsch.UserInfo;
+import com.jcraft.jsch.ChannelSftp.LsEntry;
+
+/**
+ * 
+ * Implementation of sftp (Secure FTP over SSH) Based on JSch from JCraft
+ * http://www.jcraft.com/
+ * 
+ * @author b_georges
+ * 
+ */
+
+public class SecureFtpImpl implements RemoteFileSystem 
+{
+
+	private static final Logger _logger = Logger.getLogger(SecureFtpImpl.class);
+
+	private static final String TMP_SUFFIX = ".rosettaPart";
+
+	private static final String SECURE_CHANNEL = "sftp";
+
+	// The objects implementing secure FTP over ssh
+	private JSch m_oJSch = new JSch();
+
+	private Session session = null;
+
+	private Channel m_oChannel = null;
+
+	private ChannelSftp m_oSftpChannel = null;
+
+	// TODO Add support for certificate. Not for GA though.
+	private URL m_oCertificate = null;
+
+	@SuppressWarnings("unused")
+	private boolean m_bConnected, m_bPassive;
+
+	private int m_iPort;
+
+	private SFTPEpr m_oEpr;
+
+	private ConfigTree m_oParms;
+
+	private String m_sFtpServer, m_sUser, m_sPasswd;
+
+	private String m_sRemoteDir, m_sLocalDir;
+
+	/*
+	 * Constructor
+	 * 
+	 * @param p_oP Is a config treeThe used to initialize the object
+	 * 
+	 * @param connect If true create a new sftp session
+	 * 
+	 */
+	public SecureFtpImpl(ConfigTree p_oP, boolean p_bConnect) throws ConfigurationException, RemoteFileSystemException
+	{
+		m_oParms = p_oP;
+		initialize(p_bConnect);
+	}
+
+	/*
+	 * Constructor
+	 * 
+	 * @param p_oP Is an EPR used to initialize the object
+	 * 
+	 * @param connect If true create a new sftp session
+	 * 
+	 */
+	public SecureFtpImpl(SFTPEpr p_oP, boolean p_bConnect) throws ConfigurationException, RemoteFileSystemException 
+	{
+
+		m_oEpr = p_oP;
+
+		URL url = null;
+		try {
+			url = m_oEpr.getURL();
+		} catch (MalformedURLException e) {
+			throw new RemoteFileSystemException(e);
+		} catch (URISyntaxException e) {
+			throw new RemoteFileSystemException(e);
+		}
+
+		m_sFtpServer = url.getHost();
+
+		String[] sa = null;
+
+		if (url.getUserInfo() != null)
+			sa = url.getUserInfo().split(":");
+
+		if (sa == null)
+			sa = new String[] { "", "" };
+
+		m_sUser = (sa.length < 1) ? "" : sa[0];
+		m_sPasswd = (sa.length < 2) ? "" : sa[1];
+
+		m_sRemoteDir = url.getFile();
+
+		final String tmpdir = System.getProperty("java.io.tmpdir");
+		if ((m_sRemoteDir == null) || (m_sRemoteDir.equals("")))
+			m_sRemoteDir = ModulePropertyManager.getPropertyManager(
+					ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
+							Environment.FTP_REMOTEDIR, tmpdir);
+
+		m_iPort = url.getPort();
+		if (m_iPort < 0)
+			m_iPort = url.getDefaultPort();
+
+		m_sLocalDir = ModulePropertyManager.getPropertyManager(
+				ModulePropertyManager.TRANSPORTS_MODULE).getProperty(
+						Environment.FTP_LOCALDIR, tmpdir);
+
+		m_bPassive = false;
+
+		try
+		{
+			m_bPassive = m_oEpr.getPassive();
+		} catch (URISyntaxException e) 
+		{
+			_logger.warn(e);
+		}
+
+		try
+		{
+			m_oCertificate = m_oEpr.getCertificateURL();
+		} 
+		catch (MalformedURLException ex)
+		{
+			_logger.error(ex);
+			
+			throw new ConfigurationException(ex);
+		}
+		catch (URISyntaxException e) 
+		{
+			_logger.warn(e);
+			
+			throw new ConfigurationException(e);
+		}
+
+		// TODO there is still a bit of space for improvements here.
+		configTreeFromEpr();
+
+		initialize(p_bConnect);
+	}
+
+	/*
+	 * Constructor
+	 * 
+	 * @param attribs The key/value pairs used to initialize the object
+	 * 
+	 * @param connect If true create a new sftp session using attribs
+	 * 
+	 */
+	public SecureFtpImpl(List<KeyValuePair> attribs, boolean connect)
+	throws ConfigurationException, RemoteFileSystemException 
+	{
+		m_oParms = new ConfigTree("fromProps");
+		for (KeyValuePair oCurr : attribs)
+			m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
+		initialize(connect);
+	}
+
+	private void initialize(boolean bConnect) throws ConfigurationException, RemoteFileSystemException
+	{
+		checkParms();
+		
+		if (bConnect) 
+		{
+			try
+			{
+				session = m_oJSch.getSession(m_sUser, m_sFtpServer, m_iPort);
+	
+				UserInfo ui = new SecureFtpUserInfo(m_sPasswd);
+				session.setUserInfo(ui);
+	
+				session.connect();
+	
+				m_oChannel = session.openChannel(SECURE_CHANNEL);
+	
+				m_oChannel.connect();
+	
+				m_oSftpChannel = (ChannelSftp) m_oChannel;
+	
+				for (int i1 = 0; i1 < 10 && !session.isConnected(); i1++)
+				{
+					try
+					{
+						Thread.sleep(200);  // TODO magic number
+					}
+					catch (InterruptedException ex)
+					{
+						// try again?
+					}
+				}
+				
+				if (!session.isConnected())
+					throw new RemoteFileSystemException("Can't connect to FTP server");
+	
+				m_bConnected = this.session.isConnected();
+			}
+			catch (JSchException ex)
+			{
+				_logger.error("Caught Secure FTP Exception.", ex);
+				
+				throw new RemoteFileSystemException(ex);
+			}
+		}
+		// TODO set connection Mode [PASSIVE|ACTIVE]using m_bPassive ?
+
+	}
+
+	private void checkParms() throws ConfigurationException 
+	{
+		m_sFtpServer = m_oParms.getAttribute(PARMS_FTP_SERVER);
+		if (null == m_sFtpServer)
+			throw new ConfigurationException("No SFTP server specified");
+
+		m_sUser = m_oParms.getAttribute(PARMS_USER);
+		if (null == m_sUser)
+			throw new ConfigurationException("No username specified for SFTP");
+
+		m_sPasswd = m_oParms.getAttribute(PARMS_PASSWD);
+		if (null == m_sPasswd)
+			throw new ConfigurationException("No password specified for SFTP");
+
+		m_sRemoteDir = m_oParms.getAttribute(PARMS_REMOTE_DIR);
+		if (null == m_sRemoteDir)
+			m_sRemoteDir = "";
+
+		m_sLocalDir = m_oParms.getAttribute(PARMS_LOCAL_DIR);
+		if (null == m_sLocalDir)
+			m_sLocalDir = ".";
+
+		String sAux = m_oParms.getAttribute(PARMS_PORT);
+		
+		try
+		{
+			m_iPort = (null == sAux) ? 22 : Integer.parseInt(sAux);
+		}
+		catch (Exception ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+
+		m_bPassive = false;
+		sAux = m_oParms.getAttribute(PARMS_PASSIVE);
+		m_bPassive = (null != sAux) && Boolean.parseBoolean(sAux);
+
+		final String certificate = m_oParms.getAttribute(PARMS_CERTIFICATE) ;
+		
+		if (certificate != null)
+		{
+			try
+			{
+				m_oCertificate = new URL(certificate);
+			}
+			catch (MalformedURLException ex)
+			{
+				throw new ConfigurationException(ex);
+			}
+		}
+	}
+
+	/*
+	 * Deletes a file on the SFTP-Server
+	 * 
+	 * @param fileName The file's Name to be removed from the SFTP-Server
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#deleteRemoteFile(java.lang.String)
+	 */
+	public void deleteRemoteFile(String p_sFile) throws RemoteFileSystemException 
+	{
+		try
+		{
+			m_oSftpChannel.rm(getRemoteDir() + "/" + new File(p_sFile).getName());
+		}
+		catch (SftpException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	}
+
+	/*
+	 * Deletes a file on the SFTP-Server
+	 * 
+	 * @param fileName The file to be removed from the SFTP-Server
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteDelete(java.io.File)
+	 */
+	public void remoteDelete(File p_oFile) throws RemoteFileSystemException 
+	{
+		try
+		{
+			m_oSftpChannel.rm(FtpUtils.fileToFtpString(p_oFile));
+		}
+		catch (SftpException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	}
+
+	/*
+	 * Returns a list of Filenames for the directory specified in p_Suffix
+	 * 
+	 * @param p_sSuffix The remote directory path from the SFTP-Server
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getFileListFromRemoteDir(java.lang.String)
+	 */
+	public String[] getFileListFromRemoteDir(String p_sSuffix) throws RemoteFileSystemException 
+	{
+		try
+		{
+			String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
+			List<String> lFileList = new ArrayList<String>();
+			Vector vFileList = m_oSftpChannel.ls(sSuffix);
+			
+			if (vFileList != null) 
+			{
+				for (int i = 0; i < vFileList.size(); i++) 
+				{
+					Object obj = vFileList.elementAt(i);
+					
+					if (obj instanceof LsEntry) 
+					{
+						SftpATTRS oSftAttr = ((LsEntry) obj).getAttrs();
+						if (!oSftAttr.isDir()) 
+						{
+							lFileList.add(((LsEntry) obj).getFilename());
+						}
+					}
+				}
+			}
+			
+			return (String[]) lFileList.toArray(new String[lFileList.size()]);
+		}
+		catch (SftpException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	}
+
+	/*
+	 * Set the new directory to p_SDir
+	 * 
+	 * @param p_sDir The remote directory path name we want to "cd" to.
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#setRemoteDir(java.lang.String)
+	 */
+	public void setRemoteDir(String p_sDir) throws RemoteFileSystemException 
+	{
+		try
+		{
+			m_oSftpChannel.cd(p_sDir);
+		}
+		catch (SftpException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	}
+
+	/*
+	 * Rename the Remote Directory name p_sFrom with p_sTo
+	 * 
+	 * @param p_sFrom The remote directory name we want to rename
+	 * 
+	 * @param p_sTo The new remote directory name
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#renameInRemoteDir(java.lang.String,
+	 *      java.lang.String)
+	 */
+	public void renameInRemoteDir(String p_sFrom, String p_sTo)
+	throws RemoteFileSystemException 
+	{
+
+		String sRmtFrom = new File(p_sFrom).getName();
+		String sRmtTo = new File(p_sTo).getName();
+
+		try 
+		{
+			m_oSftpChannel.rename(getRemoteDir() + "/" + sRmtFrom,
+					getRemoteDir() + "/" + sRmtTo);
+		} 
+		catch (Exception e) 
+		{
+			String sMess = this.getClass().getSimpleName()
+			+ " can't rename in remote directory <" + e.getMessage()
+			+ ">";
+			throw new RemoteFileSystemException(sMess);
+		}
+	}
+
+	/*
+	 * Rename the Remote File name p_sFrom with p_sTo
+	 * 
+	 * @param p_oFrom The remote file name we want to rename
+	 * 
+	 * @param p_oTo The new remote file name
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#remoteRename(java.io.File,
+	 *      java.io.File)
+	 */
+	public void remoteRename(File p_oFrom, File p_oTo) throws RemoteFileSystemException 
+	{
+		try 
+		{
+			m_oSftpChannel.rename(FtpUtils.fileToFtpString(p_oFrom), FtpUtils
+					.fileToFtpString(p_oTo));
+		} 
+		catch (Exception e) 
+		{
+			String sMess = this.getClass().getSimpleName()
+			+ " can't rename in remote directory <" + e.getMessage()
+			+ ">";
+			throw new RemoteFileSystemException(sMess);
+		}
+	}
+
+	/*
+	 * Upload the local File p_ofile to p_sRemoteName
+	 * 
+	 * @param p_oFile The local file name we want to upload
+	 * 
+	 * @param p_sRemoteName The remote file name [can be the same as p_oFile of
+	 * course]
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#uploadFile(java.io.File,
+	 *      java.lang.String)
+	 */
+	public void uploadFile(File p_oFile, String p_sRemoteName) throws RemoteFileSystemException 
+	{
+		try
+		{
+			String sRemoteOK = getRemoteDir() + "/" + p_sRemoteName;
+			String sRemoteTmp = sRemoteOK + TMP_SUFFIX;
+			m_oSftpChannel.put(FtpUtils.fileToFtpString(p_oFile), sRemoteTmp);
+			m_oSftpChannel.rename(sRemoteTmp, sRemoteOK);
+		}
+		catch (SftpException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	}
+
+	/*
+	 * Download the remote File p_sFile to p_sFile.
+	 * 
+	 * @param p_sFile The remote file name we want to download
+	 * 
+	 * @param p_sFinalName The local file name
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#downloadFile(java.lang.String,
+	 *      java.lang.String)
+	 */
+	public void downloadFile(String p_sFile, String p_sFinalName) throws IOException, RemoteFileSystemException 
+	{
+		File oLocalDir = new File(m_sLocalDir);
+		File oLclFile = File.createTempFile("Rosetta_", TMP_SUFFIX, oLocalDir);
+
+		try 
+		{
+			oLclFile.delete();
+		} 
+		catch (Exception e) 
+		{
+			_logger.warn("Could not delete file: "+oLclFile, e);
+		}
+		// TODO check if we have to set the Transfer Type with JSch impl =>
+		// m_oXferType
+		
+		try
+		{
+			m_oSftpChannel.get(p_sFile, FtpUtils.fileToFtpString(oLclFile));
+	
+			File oNew = new File(oLocalDir, p_sFinalName);
+			if (oNew.exists())
+				oNew.delete();
+			FileUtil.renameTo(oLclFile, oNew);
+		}
+		catch (Exception ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	}
+
+	/*
+	 * Returns the current remote directory
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#getRemoteDir()
+	 */
+	public String getRemoteDir() 
+	{
+		return m_sRemoteDir;
+	}
+
+	/*
+	 * Terminates the sftp session.
+	 * 
+	 * @see org.jboss.soa.esb.util.RemoteFileSystem#quit()
+	 */
+	public void quit() 
+	{
+		m_oSftpChannel.quit();
+	}
+
+	private void configTreeFromEpr() throws ConfigurationException 
+	{
+		m_oParms = new ConfigTree("fromEpr");
+		try 
+		{
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_FTP_SERVER,
+					m_sFtpServer);
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_USER, m_sUser);
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSWD, m_sPasswd);
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_REMOTE_DIR,
+					m_sRemoteDir);
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_PORT, Integer
+					.toString(m_iPort));
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_LOCAL_DIR, m_sLocalDir);
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_ASCII, Boolean
+					.toString(false));
+			m_oParms.setAttribute(RemoteFileSystem.PARMS_PASSIVE, Boolean
+					.toString(m_bPassive));
+			if (m_oCertificate != null)
+			{
+				m_oParms.setAttribute(RemoteFileSystem.PARMS_CERTIFICATE, m_oCertificate.toString());
+			}
+		} 
+		catch (Exception e) 
+		{
+			throw new ConfigurationException(e);
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,103 +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.internal.soa.esb.util;
-
-import com.jcraft.jsch.UserInfo;
-
-/**
- * @author geo
- * 
- */
-public class SecureFtpUserInfo implements UserInfo {
-
-	/** The user-password */
-	String password = null;
-
-	/**
-	 * Constructor
-	 * 
-	 * @param password
-	 *            The users password.
-	 */
-	public SecureFtpUserInfo(String password) {
-		this.password = password;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.jcraft.jsch.UserInfo#getPassphrase()
-	 */
-	public String getPassphrase() {
-		return null;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.jcraft.jsch.UserInfo#getPassword()
-	 */
-	public String getPassword() {
-		return password;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.jcraft.jsch.UserInfo#promptPassphrase(java.lang.String)
-	 */
-	public boolean promptPassphrase(String arg0) {
-		return false;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.jcraft.jsch.UserInfo#promptPassword(java.lang.String)
-	 */
-	public boolean promptPassword(String arg0) {
-		return true;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.jcraft.jsch.UserInfo#promptYesNo(java.lang.String)
-	 */
-	public boolean promptYesNo(String arg0) {
-		return true;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see com.jcraft.jsch.UserInfo#showMessage(java.lang.String)
-	 */
-	public void showMessage(String arg0) {
-		
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/SecureFtpUserInfo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,103 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+/**
+ * 
+ */
+package org.jboss.internal.soa.esb.util;
+
+import com.jcraft.jsch.UserInfo;
+
+/**
+ * @author geo
+ * 
+ */
+public class SecureFtpUserInfo implements UserInfo {
+
+	/** The user-password */
+	String password = null;
+
+	/**
+	 * Constructor
+	 * 
+	 * @param password
+	 *            The users password.
+	 */
+	public SecureFtpUserInfo(String password) {
+		this.password = password;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see com.jcraft.jsch.UserInfo#getPassphrase()
+	 */
+	public String getPassphrase() {
+		return null;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see com.jcraft.jsch.UserInfo#getPassword()
+	 */
+	public String getPassword() {
+		return password;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see com.jcraft.jsch.UserInfo#promptPassphrase(java.lang.String)
+	 */
+	public boolean promptPassphrase(String arg0) {
+		return false;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see com.jcraft.jsch.UserInfo#promptPassword(java.lang.String)
+	 */
+	public boolean promptPassword(String arg0) {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see com.jcraft.jsch.UserInfo#promptYesNo(java.lang.String)
+	 */
+	public boolean promptYesNo(String arg0) {
+		return true;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see com.jcraft.jsch.UserInfo#showMessage(java.lang.String)
+	 */
+	public void showMessage(String arg0) {
+		
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/StreamUtils.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/StreamUtils.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/StreamUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,58 +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.internal.soa.esb.util;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-/**
- * Stream handling utilities.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class StreamUtils {
-
-	/**
-	 * Read the supplied InputStream and return as an array of bytes.
-	 * @param stream The stream to read.
-	 * @return The stream contents in an array of bytes.
-	 */
-	public static byte[] readStream(InputStream stream) {
-		if(stream == null) {
-			throw new IllegalArgumentException("null 'stream' arg passed in method call.");
-		}
-		
-		ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
-		byte[] buffer = new byte[256];
-		int readCount = 0;
-		
-		try {
-			while((readCount = stream.read(buffer)) != -1) {
-				outBuffer.write(buffer, 0, readCount);
-			}
-		} catch (IOException e) {
-			throw new IllegalStateException("Error reading stream.", e);
-		}		
-		
-		return outBuffer.toByteArray();
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/StreamUtils.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/StreamUtils.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/StreamUtils.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/internal/soa/esb/util/StreamUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.util;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * Stream handling utilities.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class StreamUtils {
+
+	/**
+	 * Read the supplied InputStream and return as an array of bytes.
+	 * @param stream The stream to read.
+	 * @return The stream contents in an array of bytes.
+	 */
+	public static byte[] readStream(InputStream stream) {
+		if(stream == null) {
+			throw new IllegalArgumentException("null 'stream' arg passed in method call.");
+		}
+		
+		ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
+		byte[] buffer = new byte[256];
+		int readCount = 0;
+		
+		try {
+			while((readCount = stream.read(buffer)) != -1) {
+				outBuffer.write(buffer, 0, readCount);
+			}
+		} catch (IOException e) {
+			throw new IllegalStateException("Error reading stream.", e);
+		}		
+		
+		return outBuffer.toByteArray();
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/BaseException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/BaseException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/BaseException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,42 +0,0 @@
-package org.jboss.soa.esb;
-
-/**
- * Base ESB Exception.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class BaseException extends Exception {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Public Default Constructor.
-	 */
-	public BaseException() {
-		super();
-	}
-
-	/**
-	 * Public Constructor.
-	 * @param message Exception message.
-	 */
-	public BaseException(String message) {
-		super(message);
-	}
-
-	/**
-	 * Public Constructor.
-	 * @param message Exception message.
-	 * @param cause Exception cause.
-	 */
-	public BaseException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-	/**
-	 * Public Constructor.
-	 * @param cause Exception cause.
-	 */
-	public BaseException(Throwable cause) {
-		super(cause);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/BaseException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/BaseException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/BaseException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/BaseException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,42 @@
+package org.jboss.soa.esb;
+
+/**
+ * Base ESB Exception.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class BaseException extends Exception {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Public Default Constructor.
+	 */
+	public BaseException() {
+		super();
+	}
+
+	/**
+	 * Public Constructor.
+	 * @param message Exception message.
+	 */
+	public BaseException(String message) {
+		super(message);
+	}
+
+	/**
+	 * Public Constructor.
+	 * @param message Exception message.
+	 * @param cause Exception cause.
+	 */
+	public BaseException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	/**
+	 * Public Constructor.
+	 * @param cause Exception cause.
+	 */
+	public BaseException(Throwable cause) {
+		super(cause);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ConfigurationException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/ConfigurationException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ConfigurationException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,58 +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;
-
-/**
- * Configuration Exception.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ConfigurationException extends BaseException {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-     * Construct an exception instance. 
-     * @param message Exception message.
-     */
-    public ConfigurationException(String message) {
-        super(message);
-    }
-
-    /**
-     * Construct an exception instance. 
-     * @param message Exception message.
-     * @param cause Exception cause.
-     */
-    public ConfigurationException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Construct an exception instance. 
-     * @param cause Exception cause.
-     */
-    public ConfigurationException(Throwable cause) {
-        super(cause);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ConfigurationException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/ConfigurationException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ConfigurationException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ConfigurationException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb;
+
+/**
+ * Configuration Exception.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class ConfigurationException extends BaseException {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     */
+    public ConfigurationException(String message) {
+        super(message);
+    }
+
+    /**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     * @param cause Exception cause.
+     */
+    public ConfigurationException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Construct an exception instance. 
+     * @param cause Exception cause.
+     */
+    public ConfigurationException(Throwable cause) {
+        super(cause);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/FatalError.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/FatalError.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/FatalError.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,73 +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;
-
-/**
- * Thrown if the ESB enters a state from which it would be unsafe
- * to continue to execute. If caught, the handler must be sure it
- * can deal with any underlying cause if the ESB is not to terminate.
- * 
- * @author Mark Little
- * @since Version 4.0.1
- */
-
-public class FatalError extends Error
-{
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param message
-	 *            Exception message.
-	 */
-	public FatalError (String message)
-	{
-		super(message);
-	}
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param message
-	 *            Exception message.
-	 * @param cause
-	 *            Exception cause.
-	 */
-	public FatalError(String message, Throwable cause)
-	{
-		super(message, cause);
-	}
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param cause
-	 *            Exception cause.
-	 */
-	public FatalError(Throwable cause)
-	{
-		super(cause);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/FatalError.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/FatalError.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/FatalError.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/FatalError.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,73 @@
+/*
+ * 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;
+
+/**
+ * Thrown if the ESB enters a state from which it would be unsafe
+ * to continue to execute. If caught, the handler must be sure it
+ * can deal with any underlying cause if the ESB is not to terminate.
+ * 
+ * @author Mark Little
+ * @since Version 4.0.1
+ */
+
+public class FatalError extends Error
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 */
+	public FatalError (String message)
+	{
+		super(message);
+	}
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 * @param cause
+	 *            Exception cause.
+	 */
+	public FatalError(String message, Throwable cause)
+	{
+		super(message, cause);
+	}
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param cause
+	 *            Exception cause.
+	 */
+	public FatalError(Throwable cause)
+	{
+		super(cause);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/MarshalException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/MarshalException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/MarshalException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,53 +0,0 @@
-package org.jboss.soa.esb;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Thrown if marshalling a message fails. This could be because
- * conversion to XML encounters problems.
- */
-
-public class MarshalException extends Exception
-{
-	private static final long serialVersionUID = 0xE;
-	
-	public MarshalException()
-	{
-		super();
-	}
-
-	public MarshalException(String s)
-	{
-		super(s);
-	}
-
-	public MarshalException (Exception ex)
-	{
-		super(ex);
-	}
-
-	public MarshalException (String message, Exception ex)
-	{
-		super(message, ex);
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/MarshalException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/MarshalException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/MarshalException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/MarshalException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,53 @@
+package org.jboss.soa.esb;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Thrown if marshalling a message fails. This could be because
+ * conversion to XML encounters problems.
+ */
+
+public class MarshalException extends Exception
+{
+	private static final long serialVersionUID = 0xE;
+	
+	public MarshalException()
+	{
+		super();
+	}
+
+	public MarshalException(String s)
+	{
+		super(s);
+	}
+
+	public MarshalException (Exception ex)
+	{
+		super(ex);
+	}
+
+	public MarshalException (String message, Exception ex)
+	{
+		super(message, ex);
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ProtocolNotSupportedException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/ProtocolNotSupportedException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ProtocolNotSupportedException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,39 +0,0 @@
-package org.jboss.soa.esb;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-
-public class ProtocolNotSupportedException extends Exception
-{
-	public static final long serialVersionUID = 0xE;
-	
-	public ProtocolNotSupportedException()
-	{
-		super();
-	}
-
-	public ProtocolNotSupportedException(String s)
-	{
-		super(s);
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ProtocolNotSupportedException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/ProtocolNotSupportedException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ProtocolNotSupportedException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/ProtocolNotSupportedException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,39 @@
+package org.jboss.soa.esb;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+
+public class ProtocolNotSupportedException extends Exception
+{
+	public static final long serialVersionUID = 0xE;
+	
+	public ProtocolNotSupportedException()
+	{
+		super();
+	}
+
+	public ProtocolNotSupportedException(String s)
+	{
+		super(s);
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/SendFailedException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/SendFailedException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/SendFailedException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,43 +0,0 @@
-package org.jboss.soa.esb;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-
-public class SendFailedException extends Exception
-{
-	public static final long serialVersionUID = 0xE;
-	
-	public SendFailedException()
-	{
-		super();
-	}
-
-	public SendFailedException(String s)
-	{
-		super(s);
-	}
-
-	public SendFailedException(Throwable ex)
-	{
-		super(ex);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/SendFailedException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/SendFailedException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/SendFailedException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/SendFailedException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,43 @@
+package org.jboss.soa.esb;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+
+public class SendFailedException extends Exception
+{
+	public static final long serialVersionUID = 0xE;
+	
+	public SendFailedException()
+	{
+		super();
+	}
+
+	public SendFailedException(String s)
+	{
+		super(s);
+	}
+
+	public SendFailedException(Throwable ex)
+	{
+		super(ex);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/UnmarshalException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/UnmarshalException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/UnmarshalException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,52 +0,0 @@
-package org.jboss.soa.esb;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Thrown if unmarshalling fails. This could be because
- * conversion from XML encounters problems.
- */
-
-public class UnmarshalException extends Exception
-{
-	private static final long serialVersionUID = 0xE;
-	
-	public UnmarshalException()
-	{
-		super();
-	}
-
-	public UnmarshalException(String s)
-	{
-		super(s);
-	}
-
-	public UnmarshalException (Exception ex)
-	{
-		super(ex);
-	}
-
-	public UnmarshalException (String message, Exception ex)
-	{
-		super(ex);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/UnmarshalException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/UnmarshalException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/UnmarshalException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/UnmarshalException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,52 @@
+package org.jboss.soa.esb;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Thrown if unmarshalling fails. This could be because
+ * conversion from XML encounters problems.
+ */
+
+public class UnmarshalException extends Exception
+{
+	private static final long serialVersionUID = 0xE;
+	
+	public UnmarshalException()
+	{
+		super();
+	}
+
+	public UnmarshalException(String s)
+	{
+		super(s);
+	}
+
+	public UnmarshalException (Exception ex)
+	{
+		super(ex);
+	}
+
+	public UnmarshalException (String message, Exception ex)
+	{
+		super(ex);
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionLifecycle.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionLifecycle.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionLifecycle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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;
-
-/**
- * Abstract class for lifecycle methods
- *  
- * @author kevin
- */
-public abstract class AbstractActionLifecycle implements ActionLifecycle
-{
-    /**
-     * Initialise the action instance.
-     * <p/>
-     * This method is called after the action instance has been instantiated so that
-     * configuration options can be validated.
-     * 
-     * @throws ActionLifecycleException for errors during initialisation.
-     */
-    public void initialise()
-        throws ActionLifecycleException
-    {
-    }
-
-    /**
-     * Destroy the action instance.
-     * <p/>
-     * This method is called prior to the release of the action instance.  All
-     * resources associated with this action instance should be released as the
-     * instance will no longer be used.
-     */
-    public void destroy()
-        throws ActionLifecycleException
-    {
-    }
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionLifecycle.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionLifecycle.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionLifecycle.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionLifecycle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.actions;
+
+/**
+ * Abstract class for lifecycle methods
+ *  
+ * @author kevin
+ */
+public abstract class AbstractActionLifecycle implements ActionLifecycle
+{
+    /**
+     * Initialise the action instance.
+     * <p/>
+     * This method is called after the action instance has been instantiated so that
+     * configuration options can be validated.
+     * 
+     * @throws ActionLifecycleException for errors during initialisation.
+     */
+    public void initialise()
+        throws ActionLifecycleException
+    {
+    }
+
+    /**
+     * Destroy the action instance.
+     * <p/>
+     * This method is called prior to the release of the action instance.  All
+     * resources associated with this action instance should be released as the
+     * instance will no longer be used.
+     */
+    public void destroy()
+        throws ActionLifecycleException
+    {
+    }
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionPipelineProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionPipelineProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionPipelineProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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 org.jboss.soa.esb.message.Message;
-
-/**
- * Abstract class for processor actions used in a pipeline.
- * 
- * @author kevin
- */
-public abstract class AbstractActionPipelineProcessor extends AbstractActionLifecycle implements ActionPipelineProcessor
-{
-    /**
-     * Process an exception generated by the pipeline processing.
-     * Invoked when the processing of a subsequent stage of the
-     * pipeline generates an exception.
-     * 
-     * @param message The original message.
-     * @param th The throwable raised by the pipeline processing
-     */
-    public void processException(final Message message, final Throwable th)
-    {
-    }
-    
-    /**
-     * Process a successful pipeline process. 
-     * Invoked when the pipeline processing completes successfully.
-     * 
-     * @param message The original message.
-     */
-    public void processSuccess(final Message message)
-    {
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionPipelineProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionPipelineProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionPipelineProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/AbstractActionPipelineProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.actions;
+
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Abstract class for processor actions used in a pipeline.
+ * 
+ * @author kevin
+ */
+public abstract class AbstractActionPipelineProcessor extends AbstractActionLifecycle implements ActionPipelineProcessor
+{
+    /**
+     * Process an exception generated by the pipeline processing.
+     * Invoked when the processing of a subsequent stage of the
+     * pipeline generates an exception.
+     * 
+     * @param message The original message.
+     * @param th The throwable raised by the pipeline processing
+     */
+    public void processException(final Message message, final Throwable th)
+    {
+    }
+    
+    /**
+     * Process a successful pipeline process. 
+     * Invoked when the pipeline processing completes successfully.
+     * 
+     * @param message The original message.
+     */
+    public void processSuccess(final Message message)
+    {
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycle.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycle.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,56 +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;
-
-/**
- * Interface representing lifecycle methods of an action. 
- * <p/>
- * Actions implementing this interface will participate in the application
- * lifecycle and should not contain any state specific to a particular message
- * instance.  Each {@link org.jboss.soa.esb.listeners.message.ActionProcessingPipeline} will instantiate a single
- * instance of the action to process all messages passing through the pipeline.  
- *  
- * @author kevin
- */
-public interface ActionLifecycle
-{
-    /**
-     * Initialise the action instance.
-     * <p/>
-     * This method is called after the action instance has been instantiated so that
-     * configuration options can be validated.
-     * 
-     * @throws ActionLifecycleException for errors during initialisation.
-     */
-    public void initialise()
-        throws ActionLifecycleException ;
-
-    /**
-     * Destroy the action instance.
-     * <p/>
-     * This method is called prior to the release of the action instance.  All
-     * resources associated with this action instance should be released as the
-     * instance will no longer be used.
-     */
-    public void destroy()
-        throws ActionLifecycleException ;
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycle.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycle.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycle.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,56 @@
+/*
+ * 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;
+
+/**
+ * Interface representing lifecycle methods of an action. 
+ * <p/>
+ * Actions implementing this interface will participate in the application
+ * lifecycle and should not contain any state specific to a particular message
+ * instance.  Each {@link org.jboss.soa.esb.listeners.message.ActionProcessingPipeline} will instantiate a single
+ * instance of the action to process all messages passing through the pipeline.  
+ *  
+ * @author kevin
+ */
+public interface ActionLifecycle
+{
+    /**
+     * Initialise the action instance.
+     * <p/>
+     * This method is called after the action instance has been instantiated so that
+     * configuration options can be validated.
+     * 
+     * @throws ActionLifecycleException for errors during initialisation.
+     */
+    public void initialise()
+        throws ActionLifecycleException ;
+
+    /**
+     * Destroy the action instance.
+     * <p/>
+     * This method is called prior to the release of the action instance.  All
+     * resources associated with this action instance should be released as the
+     * instance will no longer be used.
+     */
+    public void destroy()
+        throws ActionLifecycleException ;
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycleException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycleException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycleException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,69 +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;
-
-/**
- * Exception representing errors in an action lifecycle.
- * @author kevin
- */
-public class ActionLifecycleException extends Exception
-{
-    /**
-     * serial version UID of this exception.
-     */
-    private static final long serialVersionUID = 3275504884247607474L;
-
-    /**
-     * Construct a default action lifecycle exception.
-     */
-    public ActionLifecycleException()
-    {
-    }
-
-    /**
-     * Construct an action lifecycle exception with the specified message.
-     * @param message The exception message.
-     */
-    public ActionLifecycleException(final String message) 
-    {
-	super(message);
-    }
-
-    /**
-     * Construct an action lifecycle exception with the associated cause.
-     * @param cause The associated cause.
-     */
-    public ActionLifecycleException(final Throwable cause)
-    {
-	super(cause);
-    }
-
-    /**
-     * Construct an action lifecycle exception with the specified message and associated cause.
-     * @param message The exception message.
-     * @param cause The associated cause.
-     */
-    public ActionLifecycleException(String message, Throwable cause)
-    {
-	super(message, cause);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycleException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycleException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycleException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionLifecycleException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,69 @@
+/*
+ * 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;
+
+/**
+ * Exception representing errors in an action lifecycle.
+ * @author kevin
+ */
+public class ActionLifecycleException extends Exception
+{
+    /**
+     * serial version UID of this exception.
+     */
+    private static final long serialVersionUID = 3275504884247607474L;
+
+    /**
+     * Construct a default action lifecycle exception.
+     */
+    public ActionLifecycleException()
+    {
+    }
+
+    /**
+     * Construct an action lifecycle exception with the specified message.
+     * @param message The exception message.
+     */
+    public ActionLifecycleException(final String message) 
+    {
+	super(message);
+    }
+
+    /**
+     * Construct an action lifecycle exception with the associated cause.
+     * @param cause The associated cause.
+     */
+    public ActionLifecycleException(final Throwable cause)
+    {
+	super(cause);
+    }
+
+    /**
+     * Construct an action lifecycle exception with the specified message and associated cause.
+     * @param message The exception message.
+     * @param cause The associated cause.
+     */
+    public ActionLifecycleException(String message, Throwable cause)
+    {
+	super(message, cause);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionPipelineProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionPipelineProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionPipelineProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,78 +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;
-
-/**
- * Interface representing processor actions used in a pipeline.
- * <p/>
- * A pipeline will instantiate a single instance of the implementing class
- * for processing every message passing through the pipeline.
- * 
- * @author kevin
- */
-public interface ActionPipelineProcessor extends ActionLifecycle
-{
-    /**
-     * The name of the process method.
-     */
-    public String PROCESS_METHOD = "process" ;
-    /**
-     * The name of the processException method.
-     */
-    public String PROCESS_EXCEPTION_METHOD = "processException" ;
-    /**
-     * The name of the processSuccess method.
-     */
-    public String PROCESS_SUCCESS_METHOD = "processSuccess" ;
-    
-    /**
-     * Perform the action processing on the specified message.
-     * This method is invoked for each message passing throught the pipeline.
-     * 
-     * @param message The current message being processed.
-     * @return The message to be passed to the next stage of the pipeline.
-     * @throws ActionProcessingException for errors during processing.
-     */
-    public Message process(final Message message)
-        throws ActionProcessingException ;
-    
-    /**
-     * Process an exception generated by the pipeline processing.
-     * Invoked when the processing of a subsequent stage of the
-     * pipeline generates an exception.
-     * 
-     * @param message The original message.
-     * @param th The throwable raised by the pipeline processing
-     */
-    public void processException(final Message message, final Throwable th) ;
-    
-    /**
-     * Process a successful pipeline process. 
-     * Invoked when the pipeline processing completes successfully.
-     * 
-     * @param message The original message.
-     */
-    public void processSuccess(final Message message) ;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionPipelineProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionPipelineProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionPipelineProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionPipelineProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,78 @@
+/*
+ * 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;
+
+/**
+ * Interface representing processor actions used in a pipeline.
+ * <p/>
+ * A pipeline will instantiate a single instance of the implementing class
+ * for processing every message passing through the pipeline.
+ * 
+ * @author kevin
+ */
+public interface ActionPipelineProcessor extends ActionLifecycle
+{
+    /**
+     * The name of the process method.
+     */
+    public String PROCESS_METHOD = "process" ;
+    /**
+     * The name of the processException method.
+     */
+    public String PROCESS_EXCEPTION_METHOD = "processException" ;
+    /**
+     * The name of the processSuccess method.
+     */
+    public String PROCESS_SUCCESS_METHOD = "processSuccess" ;
+    
+    /**
+     * Perform the action processing on the specified message.
+     * This method is invoked for each message passing throught the pipeline.
+     * 
+     * @param message The current message being processed.
+     * @return The message to be passed to the next stage of the pipeline.
+     * @throws ActionProcessingException for errors during processing.
+     */
+    public Message process(final Message message)
+        throws ActionProcessingException ;
+    
+    /**
+     * Process an exception generated by the pipeline processing.
+     * Invoked when the processing of a subsequent stage of the
+     * pipeline generates an exception.
+     * 
+     * @param message The original message.
+     * @param th The throwable raised by the pipeline processing
+     */
+    public void processException(final Message message, final Throwable th) ;
+    
+    /**
+     * Process a successful pipeline process. 
+     * Invoked when the pipeline processing completes successfully.
+     * 
+     * @param message The original message.
+     */
+    public void processSuccess(final Message message) ;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,61 +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.BaseException;
-
-/**
- * Exception while processing message payload processing action.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ActionProcessingException extends BaseException {
-
-    private static final long serialVersionUID = 1L;
-
-    /**
-     * Public constructor.
-     * @param message Exception message.
-     */
-    public ActionProcessingException(String message) {
-        super(message);
-    }
-
-    /**
-     * Public constructor.
-     * @param message Exception message.
-     * @param cause Exception cause.
-     */
-    public ActionProcessingException(String message, Throwable cause) {
-        super(message, cause);
-    }
-
-    /**
-     * Public constructor.
-     * @param cause Exception cause.
-     */
-    public ActionProcessingException(Throwable cause) {
-        super(cause);
-    }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,61 @@
+/*
+ * 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.BaseException;
+
+/**
+ * Exception while processing message payload processing action.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class ActionProcessingException extends BaseException {
+
+    private static final long serialVersionUID = 1L;
+
+    /**
+     * Public constructor.
+     * @param message Exception message.
+     */
+    public ActionProcessingException(String message) {
+        super(message);
+    }
+
+    /**
+     * Public constructor.
+     * @param message Exception message.
+     * @param cause Exception cause.
+     */
+    public ActionProcessingException(String message, Throwable cause) {
+        super(message, cause);
+    }
+
+    /**
+     * Public constructor.
+     * @param cause Exception cause.
+     */
+    public ActionProcessingException(Throwable cause) {
+        super(cause);
+    }
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingFaultException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingFaultException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingFaultException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,88 +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;
-
-/**
- * Exception while processing message payload processing action. Can be
- * used to return an application specific fault message and break out
- * of action chaining loop.
- * 
- * @author marklittle
- * @since Version 4.2MR2
- */
-public class ActionProcessingFaultException extends ActionProcessingException
-{
-
-	private static final long serialVersionUID = 1L;
-
-	public ActionProcessingFaultException (Message faultMessage, String cause)
-	{
-		this(cause);
-		
-		_message = faultMessage;
-	}
-	
-	/**
-	 * Public constructor.
-	 * 
-	 * @param message
-	 *            Exception message.
-	 */
-	public ActionProcessingFaultException(String message)
-	{
-		super(message);
-	}
-
-	/**
-	 * Public constructor.
-	 * 
-	 * @param message
-	 *            Exception message.
-	 * @param cause
-	 *            Exception cause.
-	 */
-	public ActionProcessingFaultException(String message, Throwable cause)
-	{
-		super(message, cause);
-	}
-
-	/**
-	 * Public constructor.
-	 * 
-	 * @param cause
-	 *            Exception cause.
-	 */
-	public ActionProcessingFaultException(Throwable cause)
-	{
-		super(cause);
-	}
-
-	public final Message getFaultMessage ()
-	{
-		return _message;
-	}
-	
-	private Message _message;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingFaultException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingFaultException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingFaultException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessingFaultException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,88 @@
+/*
+ * 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;
+
+/**
+ * Exception while processing message payload processing action. Can be
+ * used to return an application specific fault message and break out
+ * of action chaining loop.
+ * 
+ * @author marklittle
+ * @since Version 4.2MR2
+ */
+public class ActionProcessingFaultException extends ActionProcessingException
+{
+
+	private static final long serialVersionUID = 1L;
+
+	public ActionProcessingFaultException (Message faultMessage, String cause)
+	{
+		this(cause);
+		
+		_message = faultMessage;
+	}
+	
+	/**
+	 * Public constructor.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 */
+	public ActionProcessingFaultException(String message)
+	{
+		super(message);
+	}
+
+	/**
+	 * Public constructor.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 * @param cause
+	 *            Exception cause.
+	 */
+	public ActionProcessingFaultException(String message, Throwable cause)
+	{
+		super(message, cause);
+	}
+
+	/**
+	 * Public constructor.
+	 * 
+	 * @param cause
+	 *            Exception cause.
+	 */
+	public ActionProcessingFaultException(Throwable cause)
+	{
+		super(cause);
+	}
+
+	public final Message getFaultMessage ()
+	{
+		return _message;
+	}
+	
+	private Message _message;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,69 +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.Serializable;
-
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Action Processor Interface Definition.
- * <p/>
- * An "Action Processor" performs a processing action on a message payload and returns the processing
- * result.
- * <p/>
- * Implementations are constructed based on the following public constructor order precedence:
- * <ol>
- *  <li><b>(String actionName, List&lt;{@link org.jboss.soa.esb.helpers.KeyValuePair}&gt; properties)</b></li>
- *  <li><b>default constructor</b>.</li>
- * </ol>
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- * 
- * @deprecated This interface has been replaced by {@link ActionPipelineProcessor}
- */
-public interface ActionProcessor {
-    
-	
-    /**
-     * Perform the processing action on the message
-     * @param message The message to be processed.
-     * @return Message - result of process
-     * @throws ActionProcessingException Exception during payload processing.
-     */
-    public Message process(Message message) throws ActionProcessingException;
-
-    /**
-     * Get the "OK" notification message for this processor.
-     * @param message The message Object.
-     * @return The OK message.
-     */
-    public abstract Serializable getOkNotification(Message message);
-
-    /**
-     * Get the "Error" notification message for this processor.
-     * @param message The message Object.
-     * @return The Error message.
-     */
-    public abstract Serializable getErrorNotification(Message message);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,69 @@
+/*
+ * 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.Serializable;
+
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Action Processor Interface Definition.
+ * <p/>
+ * An "Action Processor" performs a processing action on a message payload and returns the processing
+ * result.
+ * <p/>
+ * Implementations are constructed based on the following public constructor order precedence:
+ * <ol>
+ *  <li><b>(String actionName, List&lt;{@link org.jboss.soa.esb.helpers.KeyValuePair}&gt; properties)</b></li>
+ *  <li><b>default constructor</b>.</li>
+ * </ol>
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ * 
+ * @deprecated This interface has been replaced by {@link ActionPipelineProcessor}
+ */
+public interface ActionProcessor {
+    
+	
+    /**
+     * Perform the processing action on the message
+     * @param message The message to be processed.
+     * @return Message - result of process
+     * @throws ActionProcessingException Exception during payload processing.
+     */
+    public Message process(Message message) throws ActionProcessingException;
+
+    /**
+     * Get the "OK" notification message for this processor.
+     * @param message The message Object.
+     * @return The OK message.
+     */
+    public abstract Serializable getOkNotification(Message message);
+
+    /**
+     * Get the "Error" notification message for this processor.
+     * @param message The message Object.
+     * @return The Error message.
+     */
+    public abstract Serializable getErrorNotification(Message message);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionUtils.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionUtils.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,113 +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.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.notification.NotificationList;
-
-/**
- * Contains utility methods for actions 
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- */
-public class ActionUtils 
-{
-	public  static final String BEFORE_ACTION="org.jboss.soa.esb.actions.current.before";
-	private static final String CURRENT_OBJECT="org.jboss.soa.esb.actions.current.after";
-
-    /**
-     * Obtain the current object from standard spot within message 
-     * @param message - from where to obtain the 'current object'
-     * @return Object stored in Body with key ActionProcessor.CURRENT_OBJECT
-     */
-    public static Object getTaskObject(Message message)
-    {
-    	Object payload = null ;
-        if (message != null) {
-            payload = message.getBody().get(CURRENT_OBJECT);
-            
-            if(payload == null) {
-    		payload = message.getBody().getByteArray();
-            }
-    	}
-    	
-    	return payload;
-    }
-    /**
-     * Obtain previous 'current object' from standard spot within message 
-     * @param message - from where to obtain the value
-     * @return Object stored in Body with key ActionProcessor.BEFORE_ACTION
-     */
-    public static Object getTaskBeforeObject(Message message)
-    {
-    	return (null==message)? null : message.getBody().get(BEFORE_ACTION);
-    }
-    /**
-     * Copy 'current object' to a temporary holder within message 
-     * @param message 
-     */
-    public static void copyCurrentToPrevious(Message message)
-    {
-    	Body body = message.getBody();
-    	body.remove(BEFORE_ACTION);
-    	Object obj = body.get(CURRENT_OBJECT);
-    	if (null != obj)
-    		body.add(BEFORE_ACTION,obj);
-    }
-    /**
-     * Put current object in standard spot within message
-     * <br/>NULL values are not stored 
-     * @param message - to operate on
-     * @param obj - Object to store - Won't be stored if &lt;null&gt;
-     * @return Object previous 'current object'
-     */
-    public static Object setTaskObject(Message message, Object obj)
-    {
-        Object oRet = message.getBody().remove(CURRENT_OBJECT);
-    	
-    	if (null!=obj) {
-    		message.getBody().add(CURRENT_OBJECT,obj);
-    	}
-    	if(obj instanceof byte[]) {
-    		message.getBody().setByteArray((byte[])obj);
-    	}
-    	
-    	return oRet;
-    }	
-
-    public static NotificationList getNotifyList(ConfigTree tree, String type)
-    {
-    	ConfigTree[] array = tree.getChildren("NotificationList");
-    	for (ConfigTree curr : array)
-    	{
-    		String sType = curr.getAttribute(NotificationList.TYPE);
-    		if (null==sType)
-    			continue;
-    		if (type.toLowerCase().startsWith(sType.toLowerCase()))
-    			return new NotificationList(curr);
-    	}
-    	return null;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionUtils.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionUtils.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionUtils.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ActionUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,113 @@
+/*
+ * 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.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.notification.NotificationList;
+
+/**
+ * Contains utility methods for actions 
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ */
+public class ActionUtils 
+{
+	public  static final String BEFORE_ACTION="org.jboss.soa.esb.actions.current.before";
+	private static final String CURRENT_OBJECT="org.jboss.soa.esb.actions.current.after";
+
+    /**
+     * Obtain the current object from standard spot within message 
+     * @param message - from where to obtain the 'current object'
+     * @return Object stored in Body with key ActionProcessor.CURRENT_OBJECT
+     */
+    public static Object getTaskObject(Message message)
+    {
+    	Object payload = null ;
+        if (message != null) {
+            payload = message.getBody().get(CURRENT_OBJECT);
+            
+            if(payload == null) {
+    		payload = message.getBody().getByteArray();
+            }
+    	}
+    	
+    	return payload;
+    }
+    /**
+     * Obtain previous 'current object' from standard spot within message 
+     * @param message - from where to obtain the value
+     * @return Object stored in Body with key ActionProcessor.BEFORE_ACTION
+     */
+    public static Object getTaskBeforeObject(Message message)
+    {
+    	return (null==message)? null : message.getBody().get(BEFORE_ACTION);
+    }
+    /**
+     * Copy 'current object' to a temporary holder within message 
+     * @param message 
+     */
+    public static void copyCurrentToPrevious(Message message)
+    {
+    	Body body = message.getBody();
+    	body.remove(BEFORE_ACTION);
+    	Object obj = body.get(CURRENT_OBJECT);
+    	if (null != obj)
+    		body.add(BEFORE_ACTION,obj);
+    }
+    /**
+     * Put current object in standard spot within message
+     * <br/>NULL values are not stored 
+     * @param message - to operate on
+     * @param obj - Object to store - Won't be stored if &lt;null&gt;
+     * @return Object previous 'current object'
+     */
+    public static Object setTaskObject(Message message, Object obj)
+    {
+        Object oRet = message.getBody().remove(CURRENT_OBJECT);
+    	
+    	if (null!=obj) {
+    		message.getBody().add(CURRENT_OBJECT,obj);
+    	}
+    	if(obj instanceof byte[]) {
+    		message.getBody().setByteArray((byte[])obj);
+    	}
+    	
+    	return oRet;
+    }	
+
+    public static NotificationList getNotifyList(ConfigTree tree, String type)
+    {
+    	ConfigTree[] array = tree.getChildren("NotificationList");
+    	for (ConfigTree curr : array)
+    	{
+    		String sType = curr.getAttribute(NotificationList.TYPE);
+    		if (null==sType)
+    			continue;
+    		if (type.toLowerCase().startsWith(sType.toLowerCase()))
+    			return new NotificationList(curr);
+    	}
+    	return null;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,343 +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.
- */
-
-/**
- * Routes the Message argument to a fixed list of services ([category,name]) 
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- */
-package org.jboss.soa.esb.actions;
-
-import java.text.DateFormat;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-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.services.routing.MessageRouter;
-
-/**
- * Simple Aggregator. The aggregator relies on 'aggregatorTags'. To puzzle the individual
- * back together. The aggregatorTag is set in the MessageRouter.deliverAsync() method. The aggregator
- * adds a collected message in the series as attachements to a new message. When all
- * messages are received or if we are timeout an aggregated message is returned. 
- * In all other cases null is returned.
- * 
- * Future enhancement should be 
- *  - all sort of waitfor/timout algorithms.
- *  - persisting the map so no messages get lost.
- *  - make the map managable.
- * 
- * @author kurt.stam at redhat.com
- *
- */
-public class Aggregator extends AbstractActionPipelineProcessor
-{
-    public final static String SPLITTER_TIME_STAMP = "splitterTimeStamp";
-    private ConcurrentHashMap<String,ConcurrentHashMap< String, Message > > _aggregatedMessageMap
-        = new ConcurrentHashMap< String, ConcurrentHashMap< String, Message > >();
-    private TimeoutChecker _timeoutChecker=null;
-    private ArrayList<String> _notified = new ArrayList<String>();
-    
-    protected ConfigTree config;
-    private Logger logger = Logger.getLogger(Aggregator.class);
-    private Long timeoutInMillies=null;
-    private String serviceName;
-    private String serviceCategoryName;
-    private Registry registry;
-    
-	private Aggregator(){}
-
-	public Aggregator(ConfigTree config) throws ConfigurationException, RegistryException
-	{
-        
-        this.config = config;
-		checkMyParms();
-        registry = RegistryFactory.getRegistry();
-    }
-        
-    /**
-     * Initialise the action instance.
-     * <p/>
-     * This method is called after the action instance has been instantiated so that
-     * configuration options can be validated.
-     * 
-     * @throws ActionLifecycleException for errors during initialisation.
-     */
-    public void initialise()
-        throws ActionLifecycleException
-    {
-        _timeoutChecker = new TimeoutChecker();
-        _timeoutChecker.start();
-    }
-
-            /**
-             * Destroy the action instance.
-             * <p/>
-             * This method is called prior to the release of the action instance.  All
-             * resources associated with this action instance should be released as the
-             * instance will no longer be used.
-             */
-    public void destroy()
-        throws ActionLifecycleException
-    {
-        _timeoutChecker.terminate() ;
-        _timeoutChecker = null ;
-    }
-    
-    /**
-     * Processes an incoming message, aggregates messages in a set and returns a aggregated message
-     * when isComplete() is satisfied. The aggregated messages are set as attachments to this message.
-     * Next the message can be send to a transformer to do the second part of the aggregation which is 
-     * to convert the attachement messages into to one message.
-     * 
-     * @param message
-     * @return a aggregated message, or null if the aggregation has not been completed.
-     * @throws ActionProcessingException
-     */
-	@SuppressWarnings("unchecked")
-    public Message process(Message message) throws ActionProcessingException
-	{
-        ArrayList<String> aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(MessageRouter.AGGEGRATOR_TAG);
-		
-        if (aggregatorTags!=null && aggregatorTags.size()>0) {
-            String aggregatorTag = (String) aggregatorTags.get(aggregatorTags.size()-1);
-            //Removing the last tags and setting them as "the one in current use"
-            if (aggregatorTags.size()>1) {
-                aggregatorTags.remove(aggregatorTags.size()-1);
-                message.getProperties().setProperty(MessageRouter.AGGEGRATOR_TAG, aggregatorTags);
-            } else {
-                message.getProperties().remove(MessageRouter.AGGEGRATOR_TAG);
-            }
-            String[] tag = aggregatorTag.split(":");
-            String uuId = tag[0];
-            String messageNumber = tag[1];
-            int totalNumberOfMessages = Integer.valueOf(tag[2]).intValue();
-            Long splitterTimeStamp = Long.valueOf(tag[3]);
-            message.getProperties().setProperty(SPLITTER_TIME_STAMP, splitterTimeStamp);
-
-            if (isTimedOut(message)) {
-                if (_aggregatedMessageMap.containsKey(uuId)) {
-                    ConcurrentHashMap<String, Message> messageMap = _aggregatedMessageMap.get(uuId);
-                    //add the message in if we don't already have it
-                    if (!messageMap.containsKey(uuId)) {
-                         messageMap.put(messageNumber, message);
-                    }
-                    //Just going to send out what we have this far, which will remove this key
-                    //so subsequent messages with this uuId will be ignored
-                    message = createAggregateMessage(uuId, _aggregatedMessageMap.get(uuId));
-                } else {
-                    logger.debug("Ignoring this message since we are already timedout on this message.");
-                    //ignoring this message
-                    message = null;
-                }
-            } else {
-                ConcurrentHashMap<String, Message> messageMap=null;
-                //Get the messageMap with this uuId, or create it if not found
-                if (_aggregatedMessageMap.containsKey(uuId)) {
-                    messageMap = _aggregatedMessageMap.get(uuId);
-                } else {
-                    messageMap = new ConcurrentHashMap<String, Message>();
-                }
-                if (messageMap.containsKey(messageNumber)) {
-                    logger.warn("Received duplicate message, ignoring it but this should not happen.");
-                } else {
-                    messageMap.put(messageNumber, message);
-                    _aggregatedMessageMap.put(uuId, messageMap);
-                } 
-                if (messageMap.size()==totalNumberOfMessages) {
-                    message = createAggregateMessage(uuId, messageMap);
-                } else {
-                    message = null;
-                }
-            }
-        } else {
-            throw new ActionProcessingException("Could not find an aggregator tag, so this message can not be aggregated.");
-        }
-		return message;
-	}
-	/**
-     * Obtains the timeoutInMillies to a number
-     * 
-     * @throws ConfigurationException
-	 */
-	private void checkMyParms() throws ConfigurationException 
-    {
-        timeoutInMillies     = Long.valueOf(config.getAttribute("timeoutInMillies"));
-        logger.debug("Aggregator config:  timeoutInMillies=" + timeoutInMillies);
-        serviceName          = config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
-        serviceCategoryName  = config.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
-    }
-    /**
-     * Aggregates the messages into 1 new message with an attachment for each message.
-     * 
-     * @param uuId
-     * @param messageMap
-     * @return the aggregated message
-     */
-    private Message createAggregateMessage(String uuId, ConcurrentHashMap<String, Message> messageMap) 
-    {
-        //Create an aggregated message
-        Message aggregatedMessage = MessageFactory.getInstance().getMessage();
-        boolean isFirstTime=true;
-        for (Message message : messageMap.values()) {
-            //Push additional AggregatorTags onto the new message, so we can aggregate in case of nested splits.
-            //Only need to get it from the first message, should be the same for the others.
-            if (isFirstTime) {
-                ArrayList aggregatorTags = (ArrayList) message.getProperties().getProperty(MessageRouter.AGGEGRATOR_TAG);
-                if (aggregatorTags!=null && aggregatorTags.size()>0) {
-                    aggregatedMessage.getProperties().setProperty(MessageRouter.AGGEGRATOR_TAG, aggregatorTags);
-                }
-                isFirstTime=false;
-            }
-            //Add the individual messages as attachments
-            aggregatedMessage.getAttachment().addItem(message);
-        }
-        _aggregatedMessageMap.remove(uuId);
-        //TODO remove messageMap from permanent storage, or do that per message in the loop above using value of the aggregatorTag
-        //remove from the notificationMap if it is in there.
-        _notified.remove(uuId);
-        
-        return aggregatedMessage;
-    }
-    /**
-     * If the aggregation process is complete then return true. This depends on the configuration. 
-     * 
-     * @param totalNumberOfMessages
-     * @param splitterTimeStamp
-     * @param messageMap
-     * @return
-     */
-    private boolean isTimedOut(Message message) 
-    {
-        long splitterTimeStamp = (Long) message.getProperties().getProperty(SPLITTER_TIME_STAMP);
-        if (timeoutInMillies!=null) {
-            long now = new Date().getTime();
-            long expiration = splitterTimeStamp + Long.valueOf(timeoutInMillies);
-            if (logger.isDebugEnabled()) {
-                DateFormat dateFormat = DateFormat.getTimeInstance();
-                logger.debug("Current time=" + dateFormat.format(new Date(now)) 
-                    + " message expiration=" + dateFormat.format(new Date(expiration)));
-            }
-            if ( now > expiration) {
-                logger.debug("message expired.");
-                return true;
-            } else {
-                logger.debug("message is alive.");
-            }
-        }
-        return false;
-    }
-    /**
-     * Checks for message that are timed out. If we find that one we notify ourselves about it by resending the message.
-     * 
-     * @author kstam
-     *
-     */
-    class TimeoutChecker extends Thread {
-        private final Lock terminateLock = new ReentrantLock() ;
-        private final Condition terminateCondition = terminateLock.newCondition() ;
-        private boolean terminated ; 
-        
-        public void run() {
-            boolean running = true ;
-            while(running) {
-                //no need to check if no timeout is set
-                if (timeoutInMillies!=null) {
-                    for (ConcurrentHashMap< String, Message > messageMap : _aggregatedMessageMap.values()) {
-                        //Check the first message, they all have the same time stamp
-                        Message message = messageMap.values().iterator().next();
-                        if (isTimedOut(message)) {
-                            //We found a timed-out message. Let's go notify ourselves about by resending a message,
-                            //it if we haven't done so already
-                            String aggregatorTag = (String) message.getProperties().getProperty(MessageRouter.AGGEGRATOR_TAG);
-                            String[] tag = aggregatorTag.split(":");
-                            String uuId = tag[0];
-                            if (!_notified.contains(uuId)) {
-                                _notified.add(uuId);
-                                logger.debug("Found timeout message.");
-                                try {
-                                    EPR epr = registry.findEPR(serviceCategoryName, serviceName);
-                                    Courier courier = CourierFactory.getCourier(epr);
-                                    try
-                                    {
-                                        courier.deliver(message);
-                                    }
-                                    finally
-                                    {
-                                        CourierUtil.cleanCourier(courier) ;
-                                    }
-                                } catch (Exception e) {
-                                    logger.error(e.getMessage(), e);
-                                    //If we can't notify then drop this data
-                                    logger.debug("Deleting data for message series with uuId=" + uuId);
-                                    _notified.remove(uuId);
-                                    _aggregatedMessageMap.remove(uuId);
-                                }
-                            }
-                        }
-                    }
-                }
-                terminateLock.lock() ;
-                try {
-                    if (!terminated) {
-                        terminateCondition.await(500, TimeUnit.MILLISECONDS) ;
-                    }
-                    running = !terminated ;
-                } catch (InterruptedException ie){}
-                finally {
-                    terminateLock.unlock() ;
-                }
-            }
-        }
-            
-        public void terminate() {
-            terminateLock.lock() ;
-            try
-            {
-                terminated = true ;
-                terminateCondition.signalAll() ;
-            }
-            finally
-            {
-                terminateLock.unlock() ;
-            }
-        }
-    }
- 
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Aggregator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,343 @@
+/*
+ * 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.
+ */
+
+/**
+ * Routes the Message argument to a fixed list of services ([category,name]) 
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ */
+package org.jboss.soa.esb.actions;
+
+import java.text.DateFormat;
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+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.services.routing.MessageRouter;
+
+/**
+ * Simple Aggregator. The aggregator relies on 'aggregatorTags'. To puzzle the individual
+ * back together. The aggregatorTag is set in the MessageRouter.deliverAsync() method. The aggregator
+ * adds a collected message in the series as attachements to a new message. When all
+ * messages are received or if we are timeout an aggregated message is returned. 
+ * In all other cases null is returned.
+ * 
+ * Future enhancement should be 
+ *  - all sort of waitfor/timout algorithms.
+ *  - persisting the map so no messages get lost.
+ *  - make the map managable.
+ * 
+ * @author kurt.stam at redhat.com
+ *
+ */
+public class Aggregator extends AbstractActionPipelineProcessor
+{
+    public final static String SPLITTER_TIME_STAMP = "splitterTimeStamp";
+    private ConcurrentHashMap<String,ConcurrentHashMap< String, Message > > _aggregatedMessageMap
+        = new ConcurrentHashMap< String, ConcurrentHashMap< String, Message > >();
+    private TimeoutChecker _timeoutChecker=null;
+    private ArrayList<String> _notified = new ArrayList<String>();
+    
+    protected ConfigTree config;
+    private Logger logger = Logger.getLogger(Aggregator.class);
+    private Long timeoutInMillies=null;
+    private String serviceName;
+    private String serviceCategoryName;
+    private Registry registry;
+    
+	private Aggregator(){}
+
+	public Aggregator(ConfigTree config) throws ConfigurationException, RegistryException
+	{
+        
+        this.config = config;
+		checkMyParms();
+        registry = RegistryFactory.getRegistry();
+    }
+        
+    /**
+     * Initialise the action instance.
+     * <p/>
+     * This method is called after the action instance has been instantiated so that
+     * configuration options can be validated.
+     * 
+     * @throws ActionLifecycleException for errors during initialisation.
+     */
+    public void initialise()
+        throws ActionLifecycleException
+    {
+        _timeoutChecker = new TimeoutChecker();
+        _timeoutChecker.start();
+    }
+
+            /**
+             * Destroy the action instance.
+             * <p/>
+             * This method is called prior to the release of the action instance.  All
+             * resources associated with this action instance should be released as the
+             * instance will no longer be used.
+             */
+    public void destroy()
+        throws ActionLifecycleException
+    {
+        _timeoutChecker.terminate() ;
+        _timeoutChecker = null ;
+    }
+    
+    /**
+     * Processes an incoming message, aggregates messages in a set and returns a aggregated message
+     * when isComplete() is satisfied. The aggregated messages are set as attachments to this message.
+     * Next the message can be send to a transformer to do the second part of the aggregation which is 
+     * to convert the attachement messages into to one message.
+     * 
+     * @param message
+     * @return a aggregated message, or null if the aggregation has not been completed.
+     * @throws ActionProcessingException
+     */
+	@SuppressWarnings("unchecked")
+    public Message process(Message message) throws ActionProcessingException
+	{
+        ArrayList<String> aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(MessageRouter.AGGEGRATOR_TAG);
+		
+        if (aggregatorTags!=null && aggregatorTags.size()>0) {
+            String aggregatorTag = (String) aggregatorTags.get(aggregatorTags.size()-1);
+            //Removing the last tags and setting them as "the one in current use"
+            if (aggregatorTags.size()>1) {
+                aggregatorTags.remove(aggregatorTags.size()-1);
+                message.getProperties().setProperty(MessageRouter.AGGEGRATOR_TAG, aggregatorTags);
+            } else {
+                message.getProperties().remove(MessageRouter.AGGEGRATOR_TAG);
+            }
+            String[] tag = aggregatorTag.split(":");
+            String uuId = tag[0];
+            String messageNumber = tag[1];
+            int totalNumberOfMessages = Integer.valueOf(tag[2]).intValue();
+            Long splitterTimeStamp = Long.valueOf(tag[3]);
+            message.getProperties().setProperty(SPLITTER_TIME_STAMP, splitterTimeStamp);
+
+            if (isTimedOut(message)) {
+                if (_aggregatedMessageMap.containsKey(uuId)) {
+                    ConcurrentHashMap<String, Message> messageMap = _aggregatedMessageMap.get(uuId);
+                    //add the message in if we don't already have it
+                    if (!messageMap.containsKey(uuId)) {
+                         messageMap.put(messageNumber, message);
+                    }
+                    //Just going to send out what we have this far, which will remove this key
+                    //so subsequent messages with this uuId will be ignored
+                    message = createAggregateMessage(uuId, _aggregatedMessageMap.get(uuId));
+                } else {
+                    logger.debug("Ignoring this message since we are already timedout on this message.");
+                    //ignoring this message
+                    message = null;
+                }
+            } else {
+                ConcurrentHashMap<String, Message> messageMap=null;
+                //Get the messageMap with this uuId, or create it if not found
+                if (_aggregatedMessageMap.containsKey(uuId)) {
+                    messageMap = _aggregatedMessageMap.get(uuId);
+                } else {
+                    messageMap = new ConcurrentHashMap<String, Message>();
+                }
+                if (messageMap.containsKey(messageNumber)) {
+                    logger.warn("Received duplicate message, ignoring it but this should not happen.");
+                } else {
+                    messageMap.put(messageNumber, message);
+                    _aggregatedMessageMap.put(uuId, messageMap);
+                } 
+                if (messageMap.size()==totalNumberOfMessages) {
+                    message = createAggregateMessage(uuId, messageMap);
+                } else {
+                    message = null;
+                }
+            }
+        } else {
+            throw new ActionProcessingException("Could not find an aggregator tag, so this message can not be aggregated.");
+        }
+		return message;
+	}
+	/**
+     * Obtains the timeoutInMillies to a number
+     * 
+     * @throws ConfigurationException
+	 */
+	private void checkMyParms() throws ConfigurationException 
+    {
+        timeoutInMillies     = Long.valueOf(config.getAttribute("timeoutInMillies"));
+        logger.debug("Aggregator config:  timeoutInMillies=" + timeoutInMillies);
+        serviceName          = config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
+        serviceCategoryName  = config.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
+    }
+    /**
+     * Aggregates the messages into 1 new message with an attachment for each message.
+     * 
+     * @param uuId
+     * @param messageMap
+     * @return the aggregated message
+     */
+    private Message createAggregateMessage(String uuId, ConcurrentHashMap<String, Message> messageMap) 
+    {
+        //Create an aggregated message
+        Message aggregatedMessage = MessageFactory.getInstance().getMessage();
+        boolean isFirstTime=true;
+        for (Message message : messageMap.values()) {
+            //Push additional AggregatorTags onto the new message, so we can aggregate in case of nested splits.
+            //Only need to get it from the first message, should be the same for the others.
+            if (isFirstTime) {
+                ArrayList aggregatorTags = (ArrayList) message.getProperties().getProperty(MessageRouter.AGGEGRATOR_TAG);
+                if (aggregatorTags!=null && aggregatorTags.size()>0) {
+                    aggregatedMessage.getProperties().setProperty(MessageRouter.AGGEGRATOR_TAG, aggregatorTags);
+                }
+                isFirstTime=false;
+            }
+            //Add the individual messages as attachments
+            aggregatedMessage.getAttachment().addItem(message);
+        }
+        _aggregatedMessageMap.remove(uuId);
+        //TODO remove messageMap from permanent storage, or do that per message in the loop above using value of the aggregatorTag
+        //remove from the notificationMap if it is in there.
+        _notified.remove(uuId);
+        
+        return aggregatedMessage;
+    }
+    /**
+     * If the aggregation process is complete then return true. This depends on the configuration. 
+     * 
+     * @param totalNumberOfMessages
+     * @param splitterTimeStamp
+     * @param messageMap
+     * @return
+     */
+    private boolean isTimedOut(Message message) 
+    {
+        long splitterTimeStamp = (Long) message.getProperties().getProperty(SPLITTER_TIME_STAMP);
+        if (timeoutInMillies!=null) {
+            long now = new Date().getTime();
+            long expiration = splitterTimeStamp + Long.valueOf(timeoutInMillies);
+            if (logger.isDebugEnabled()) {
+                DateFormat dateFormat = DateFormat.getTimeInstance();
+                logger.debug("Current time=" + dateFormat.format(new Date(now)) 
+                    + " message expiration=" + dateFormat.format(new Date(expiration)));
+            }
+            if ( now > expiration) {
+                logger.debug("message expired.");
+                return true;
+            } else {
+                logger.debug("message is alive.");
+            }
+        }
+        return false;
+    }
+    /**
+     * Checks for message that are timed out. If we find that one we notify ourselves about it by resending the message.
+     * 
+     * @author kstam
+     *
+     */
+    class TimeoutChecker extends Thread {
+        private final Lock terminateLock = new ReentrantLock() ;
+        private final Condition terminateCondition = terminateLock.newCondition() ;
+        private boolean terminated ; 
+        
+        public void run() {
+            boolean running = true ;
+            while(running) {
+                //no need to check if no timeout is set
+                if (timeoutInMillies!=null) {
+                    for (ConcurrentHashMap< String, Message > messageMap : _aggregatedMessageMap.values()) {
+                        //Check the first message, they all have the same time stamp
+                        Message message = messageMap.values().iterator().next();
+                        if (isTimedOut(message)) {
+                            //We found a timed-out message. Let's go notify ourselves about by resending a message,
+                            //it if we haven't done so already
+                            String aggregatorTag = (String) message.getProperties().getProperty(MessageRouter.AGGEGRATOR_TAG);
+                            String[] tag = aggregatorTag.split(":");
+                            String uuId = tag[0];
+                            if (!_notified.contains(uuId)) {
+                                _notified.add(uuId);
+                                logger.debug("Found timeout message.");
+                                try {
+                                    EPR epr = registry.findEPR(serviceCategoryName, serviceName);
+                                    Courier courier = CourierFactory.getCourier(epr);
+                                    try
+                                    {
+                                        courier.deliver(message);
+                                    }
+                                    finally
+                                    {
+                                        CourierUtil.cleanCourier(courier) ;
+                                    }
+                                } catch (Exception e) {
+                                    logger.error(e.getMessage(), e);
+                                    //If we can't notify then drop this data
+                                    logger.debug("Deleting data for message series with uuId=" + uuId);
+                                    _notified.remove(uuId);
+                                    _aggregatedMessageMap.remove(uuId);
+                                }
+                            }
+                        }
+                    }
+                }
+                terminateLock.lock() ;
+                try {
+                    if (!terminated) {
+                        terminateCondition.await(500, TimeUnit.MILLISECONDS) ;
+                    }
+                    running = !terminated ;
+                } catch (InterruptedException ie){}
+                finally {
+                    terminateLock.unlock() ;
+                }
+            }
+        }
+            
+        public void terminate() {
+            terminateLock.lock() ;
+            try
+            {
+                terminated = true ;
+                terminateCondition.signalAll() ;
+            }
+            finally
+            {
+                terminateLock.unlock() ;
+            }
+        }
+    }
+ 
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BeanConfiguredAction.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BeanConfiguredAction.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BeanConfiguredAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,31 +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;
-
-/**
- * Marker interface for actions configured automatically by invoking setters
- * based on ConfigTree attributes.
- * 
- * @author Derek Adams
- */
-public interface BeanConfiguredAction {
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BeanConfiguredAction.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BeanConfiguredAction.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BeanConfiguredAction.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BeanConfiguredAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,31 @@
+/*
+ * 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;
+
+/**
+ * Marker interface for actions configured automatically by invoking setters
+ * based on ConfigTree attributes.
+ * 
+ * @author Derek Adams
+ */
+public interface BeanConfiguredAction {
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BusinessRulesProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BusinessRulesProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BusinessRulesProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,65 +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.
- */
-
-/**
- * Routes the Message argument to a fixed list of services ([category,name]) 
- * @author kstam at jboss.com
- * @since Version 4.2
- */
-package org.jboss.soa.esb.actions;
-
-import java.util.List;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.routing.MessageRouterException;
-
-public class BusinessRulesProcessor extends ContentBasedRouter
-{
-	public BusinessRulesProcessor(ConfigTree config) throws ConfigurationException, RegistryException, MessageRouterException
-	{
-        super(config);
-	}
-	/** 
-     * Inspect the content of the message using a rule set 
-     * Router the message to one or more destinations, using the ContentBasedRouter to figure out
-     * to which destinations it is going to be routed too. 
-     *  
-     * @param message
-     * @return Message
-     * @throws ActionProcessingException
-	 */
-	public Message process(Message message) throws ActionProcessingException
-	{
-        try {
-            List<Object> objectList = _mapper.createObjectList(message, _messagePathList);
-            _cbr.route(_ruleSet, _ruleLanguage, _ruleReload, message, objectList);
-        } catch (MessageRouterException mre) {
-            throw new ActionProcessingException(mre.getMessage(), mre);
-        }
-		return message;
-	}
-    
-    
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BusinessRulesProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BusinessRulesProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BusinessRulesProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/BusinessRulesProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,65 @@
+/*
+ * 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.
+ */
+
+/**
+ * Routes the Message argument to a fixed list of services ([category,name]) 
+ * @author kstam at jboss.com
+ * @since Version 4.2
+ */
+package org.jboss.soa.esb.actions;
+
+import java.util.List;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.routing.MessageRouterException;
+
+public class BusinessRulesProcessor extends ContentBasedRouter
+{
+	public BusinessRulesProcessor(ConfigTree config) throws ConfigurationException, RegistryException, MessageRouterException
+	{
+        super(config);
+	}
+	/** 
+     * Inspect the content of the message using a rule set 
+     * Router the message to one or more destinations, using the ContentBasedRouter to figure out
+     * to which destinations it is going to be routed too. 
+     *  
+     * @param message
+     * @return Message
+     * @throws ActionProcessingException
+	 */
+	public Message process(Message message) throws ActionProcessingException
+	{
+        try {
+            List<Object> objectList = _mapper.createObjectList(message, _messagePathList);
+            _cbr.route(_ruleSet, _ruleLanguage, _ruleReload, message, objectList);
+        } catch (MessageRouterException mre) {
+            throw new ActionProcessingException(mre.getMessage(), mre);
+        }
+		return message;
+	}
+    
+    
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedRouter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedRouter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,65 +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.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.routing.MessageRouterException;
-/**
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @author kstam at jboss.com
- *
- */
-public class ContentBasedRouter extends ContentBasedWiretap
-{
-    public ContentBasedRouter(ConfigTree config) throws ConfigurationException, RegistryException, MessageRouterException
-    {
-        super(config) ;
-    }
-    /** Router the message to one or more destinations, using the ContentBasedRouter to figure out
-     *  to which destinations it is going to be routed too.
-     *  
-     * @param message
-     * @return Message
-     * @throws ActionProcessingException
-     */
-    public Message process(Message message) throws ActionProcessingException
-    {
-        super.process(message) ;
-        return null ;
-    }
-
-    /** 
-     * @deprecated no longer needed, leaving this in here for backwards compatibility,
-     * use the default "process".
-     * */
-    public Message split(Message message) throws ActionProcessingException
-    {
-        _logger.warn("Depricated, please use the default 'process' method in your configuration");
-        return process(message);
-    }
-
-    protected static Logger _logger = Logger.getLogger(ContentBasedRouter.class);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedRouter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedRouter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedRouter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,65 @@
+/*
+ * 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.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.routing.MessageRouterException;
+/**
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @author kstam at jboss.com
+ *
+ */
+public class ContentBasedRouter extends ContentBasedWiretap
+{
+    public ContentBasedRouter(ConfigTree config) throws ConfigurationException, RegistryException, MessageRouterException
+    {
+        super(config) ;
+    }
+    /** Router the message to one or more destinations, using the ContentBasedRouter to figure out
+     *  to which destinations it is going to be routed too.
+     *  
+     * @param message
+     * @return Message
+     * @throws ActionProcessingException
+     */
+    public Message process(Message message) throws ActionProcessingException
+    {
+        super.process(message) ;
+        return null ;
+    }
+
+    /** 
+     * @deprecated no longer needed, leaving this in here for backwards compatibility,
+     * use the default "process".
+     * */
+    public Message split(Message message) throws ActionProcessingException
+    {
+        _logger.warn("Depricated, please use the default 'process' method in your configuration");
+        return process(message);
+    }
+
+    protected static Logger _logger = Logger.getLogger(ContentBasedRouter.class);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedWiretap.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedWiretap.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedWiretap.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,224 +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.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.mapping.ObjectMapper;
-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.services.routing.MessageRouter;
-import org.jboss.soa.esb.services.routing.MessageRouterException;
-import org.jboss.soa.esb.services.routing.cbr.ContentBasedRouterFactory;
-
-/**
- * @author <a
- *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @author kstam at jboss.com
- * @author kevin.conner at jboss.com
- * 
- */
-public class ContentBasedWiretap extends AbstractActionPipelineProcessor
-{
-    public static final String ROUTE_TO_TAG = "route-to";
-
-    public static final String OBJECT_PATH_TAG = "object-path";
-
-    public static final String OBJECT_PATH = "path";
-
-    public static final String DEFAULT_CBR_CLASS = "org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter";
-
-    public ContentBasedWiretap(ConfigTree config)
-        throws ConfigurationException, RegistryException,
-            MessageRouterException
-    {
-        _config = config;
-        checkMyParms();
-        _registry = RegistryFactory.getRegistry();
-        _cbr = ContentBasedRouterFactory.getRouter(_cbrClass);
-        _mapper = new ObjectMapper();
-    }
-
-    public void initialise()
-    {
-        if (_destinations.size() < 1)
-        {
-            _logger.warn("Missing or empty destination list - This action class won't have any effect");
-        }
-    }
-
-    /**
-     * Router the message to one or more destinations, using the
-     * ContentBasedRouter to figure out to which destinations it is going to be
-     * routed too.
-     * 
-     * @param message
-     * @return Message
-     * @throws ActionProcessingException
-     */
-    public Message process(Message message) throws ActionProcessingException
-    {
-        try
-        {
-            List<Object> objectList = _mapper.createObjectList(message, _messagePathList);
-            List<String> destinations = _cbr.route(_ruleSet, _ruleLanguage,
-                _ruleReload, message, objectList);
-            Collection<String[]> outgoingDestinations = new ArrayList<String[]>();
-            for (String destination : destinations)
-            {
-                if (_destinations.containsKey(destination))
-                {
-                    outgoingDestinations.add(_destinations.get(destination));
-                }
-            }
-            if (outgoingDestinations.size() > 0)
-            {
-                MessageRouter.deliverMessages(outgoingDestinations, message);
-            }
-            else if (destinations.size() > 0)
-            {
-                _logger.error("The rule destination(s) " + destinations
-                    + " are  not in found in the destination names in the configuration "
-                    + _destinations.keySet() + ". Please fix your configuration.");
-
-                MessageRouter.deliverMessage(MessageRouter.INTERNAL_SERVICE_CATEGORY,
-                    MessageRouter.DEAD_LETTER_SERVICE_NAME, message);
-            }
-            return message;
-        }
-        catch (MessageRouterException mre)
-        {
-            throw new ActionProcessingException(mre.getMessage(), mre);
-        }
-    }
-
-    /**
-     * Reading the piece of configTree specific to the CBR, and setting the
-     * configuration.
-     * 
-     * @throws ConfigurationException
-     */
-    protected void checkMyParms() throws ConfigurationException
-    {
-        if (_config.getAttribute(ListenerTagNames.RULE_SET_TAG) == null)
-        {
-            _logger.error("Required attribute " + ListenerTagNames.RULE_SET_TAG
-                + " not found in " + _config.getName() + ".");
-            throw new ConfigurationException("Required attribute"
-                + ListenerTagNames.RULE_SET_TAG + " not found.");
-        }
-        else
-        {
-            _ruleSet = _config.getAttribute(ListenerTagNames.RULE_SET_TAG);
-            if (_ruleSet == null)
-            {
-                throw new ConfigurationException("Required attribute "
-                    + ListenerTagNames.RULE_SET_TAG + " not found.");
-            }
-            _ruleLanguage = _config.getAttribute(ListenerTagNames.RULE_LANGUAGE_TAG);
-            String ruleReload = _config.getAttribute(ListenerTagNames.RULE_RELOAD_TAG);
-            if (ruleReload != null && "true".equals(ruleReload))
-            {
-                _ruleReload = true;
-            }
-        }
-        if (_config.getAttribute(ListenerTagNames.CBR_CLASS) != null)
-        {
-            _cbrClass = _config.getAttribute(ListenerTagNames.CBR_CLASS);
-        }
-        else
-        {
-            _cbrClass = DEFAULT_CBR_CLASS;
-        }
-
-        _destinations = new HashMap<String, String[]>();
-        ConfigTree[] destList = _config.getChildren(ROUTE_TO_TAG);
-        if (destList != null)
-        {
-            for (ConfigTree curr : destList)
-            {
-                try
-                {
-                    String key = curr.getRequiredAttribute(ListenerTagNames.DESTINATION_NAME_TAG);
-                    String category = curr.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, "");
-                    String name = curr.getRequiredAttribute(ListenerTagNames.SERVICE_NAME_TAG);
-                    _destinations.put(key, new String[] { category, name });
-                }
-                catch (Exception e)
-                {
-                    throw new ConfigurationException("Problems with destination list", e);
-                }
-            }
-        }
-        _messagePathList = new ArrayList<String>();
-        ConfigTree[] objectList = _config.getChildren(OBJECT_PATH_TAG);
-        if (objectList != null)
-        {
-            for (ConfigTree curr : objectList)
-            {
-                try
-                {
-                    String objectPath = curr.getRequiredAttribute(OBJECT_PATH);
-                    _messagePathList.add(objectPath);
-                }
-                catch (Exception e)
-                {
-                    throw new ConfigurationException("Problems with object path list", e);
-                }
-            }
-        }
-
-    }
-
-    protected ConfigTree _config;
-
-    protected Map<String, String[]> _destinations;
-
-    protected String _cbrClass;
-
-    protected String _ruleSet;
-
-    protected String _ruleLanguage;
-
-    protected boolean _ruleReload;
-
-    protected List<String> _messagePathList;
-
-    protected ObjectMapper _mapper;
-
-    protected Registry _registry;
-
-    protected org.jboss.soa.esb.services.routing.cbr.ContentBasedRouter _cbr;
-
-    protected static Logger _logger = Logger.getLogger(ContentBasedWiretap.class);
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedWiretap.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedWiretap.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedWiretap.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/ContentBasedWiretap.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,224 @@
+/*
+ * 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.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.mapping.ObjectMapper;
+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.services.routing.MessageRouter;
+import org.jboss.soa.esb.services.routing.MessageRouterException;
+import org.jboss.soa.esb.services.routing.cbr.ContentBasedRouterFactory;
+
+/**
+ * @author <a
+ *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @author kstam at jboss.com
+ * @author kevin.conner at jboss.com
+ * 
+ */
+public class ContentBasedWiretap extends AbstractActionPipelineProcessor
+{
+    public static final String ROUTE_TO_TAG = "route-to";
+
+    public static final String OBJECT_PATH_TAG = "object-path";
+
+    public static final String OBJECT_PATH = "path";
+
+    public static final String DEFAULT_CBR_CLASS = "org.jboss.internal.soa.esb.services.routing.cbr.JBossRulesRouter";
+
+    public ContentBasedWiretap(ConfigTree config)
+        throws ConfigurationException, RegistryException,
+            MessageRouterException
+    {
+        _config = config;
+        checkMyParms();
+        _registry = RegistryFactory.getRegistry();
+        _cbr = ContentBasedRouterFactory.getRouter(_cbrClass);
+        _mapper = new ObjectMapper();
+    }
+
+    public void initialise()
+    {
+        if (_destinations.size() < 1)
+        {
+            _logger.warn("Missing or empty destination list - This action class won't have any effect");
+        }
+    }
+
+    /**
+     * Router the message to one or more destinations, using the
+     * ContentBasedRouter to figure out to which destinations it is going to be
+     * routed too.
+     * 
+     * @param message
+     * @return Message
+     * @throws ActionProcessingException
+     */
+    public Message process(Message message) throws ActionProcessingException
+    {
+        try
+        {
+            List<Object> objectList = _mapper.createObjectList(message, _messagePathList);
+            List<String> destinations = _cbr.route(_ruleSet, _ruleLanguage,
+                _ruleReload, message, objectList);
+            Collection<String[]> outgoingDestinations = new ArrayList<String[]>();
+            for (String destination : destinations)
+            {
+                if (_destinations.containsKey(destination))
+                {
+                    outgoingDestinations.add(_destinations.get(destination));
+                }
+            }
+            if (outgoingDestinations.size() > 0)
+            {
+                MessageRouter.deliverMessages(outgoingDestinations, message);
+            }
+            else if (destinations.size() > 0)
+            {
+                _logger.error("The rule destination(s) " + destinations
+                    + " are  not in found in the destination names in the configuration "
+                    + _destinations.keySet() + ". Please fix your configuration.");
+
+                MessageRouter.deliverMessage(MessageRouter.INTERNAL_SERVICE_CATEGORY,
+                    MessageRouter.DEAD_LETTER_SERVICE_NAME, message);
+            }
+            return message;
+        }
+        catch (MessageRouterException mre)
+        {
+            throw new ActionProcessingException(mre.getMessage(), mre);
+        }
+    }
+
+    /**
+     * Reading the piece of configTree specific to the CBR, and setting the
+     * configuration.
+     * 
+     * @throws ConfigurationException
+     */
+    protected void checkMyParms() throws ConfigurationException
+    {
+        if (_config.getAttribute(ListenerTagNames.RULE_SET_TAG) == null)
+        {
+            _logger.error("Required attribute " + ListenerTagNames.RULE_SET_TAG
+                + " not found in " + _config.getName() + ".");
+            throw new ConfigurationException("Required attribute"
+                + ListenerTagNames.RULE_SET_TAG + " not found.");
+        }
+        else
+        {
+            _ruleSet = _config.getAttribute(ListenerTagNames.RULE_SET_TAG);
+            if (_ruleSet == null)
+            {
+                throw new ConfigurationException("Required attribute "
+                    + ListenerTagNames.RULE_SET_TAG + " not found.");
+            }
+            _ruleLanguage = _config.getAttribute(ListenerTagNames.RULE_LANGUAGE_TAG);
+            String ruleReload = _config.getAttribute(ListenerTagNames.RULE_RELOAD_TAG);
+            if (ruleReload != null && "true".equals(ruleReload))
+            {
+                _ruleReload = true;
+            }
+        }
+        if (_config.getAttribute(ListenerTagNames.CBR_CLASS) != null)
+        {
+            _cbrClass = _config.getAttribute(ListenerTagNames.CBR_CLASS);
+        }
+        else
+        {
+            _cbrClass = DEFAULT_CBR_CLASS;
+        }
+
+        _destinations = new HashMap<String, String[]>();
+        ConfigTree[] destList = _config.getChildren(ROUTE_TO_TAG);
+        if (destList != null)
+        {
+            for (ConfigTree curr : destList)
+            {
+                try
+                {
+                    String key = curr.getRequiredAttribute(ListenerTagNames.DESTINATION_NAME_TAG);
+                    String category = curr.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, "");
+                    String name = curr.getRequiredAttribute(ListenerTagNames.SERVICE_NAME_TAG);
+                    _destinations.put(key, new String[] { category, name });
+                }
+                catch (Exception e)
+                {
+                    throw new ConfigurationException("Problems with destination list", e);
+                }
+            }
+        }
+        _messagePathList = new ArrayList<String>();
+        ConfigTree[] objectList = _config.getChildren(OBJECT_PATH_TAG);
+        if (objectList != null)
+        {
+            for (ConfigTree curr : objectList)
+            {
+                try
+                {
+                    String objectPath = curr.getRequiredAttribute(OBJECT_PATH);
+                    _messagePathList.add(objectPath);
+                }
+                catch (Exception e)
+                {
+                    throw new ConfigurationException("Problems with object path list", e);
+                }
+            }
+        }
+
+    }
+
+    protected ConfigTree _config;
+
+    protected Map<String, String[]> _destinations;
+
+    protected String _cbrClass;
+
+    protected String _ruleSet;
+
+    protected String _ruleLanguage;
+
+    protected boolean _ruleReload;
+
+    protected List<String> _messagePathList;
+
+    protected ObjectMapper _mapper;
+
+    protected Registry _registry;
+
+    protected org.jboss.soa.esb.services.routing.cbr.ContentBasedRouter _cbr;
+
+    protected static Logger _logger = Logger.getLogger(ContentBasedWiretap.class);
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/MessageFilter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/MessageFilter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/MessageFilter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,83 +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.
- */
-
-/**
- * Routes the Message argument to a fixed list of services ([category,name]) 
- * @author kstam at redhat.com
- * @since Version 4.2
- */
-package org.jboss.soa.esb.actions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-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.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.routing.MessageRouter;
-import org.jboss.soa.esb.services.routing.MessageRouterException;
-
-public class MessageFilter extends ContentBasedRouter
-{
-	public static final String ROUTE_TO_TAG = "route-to";
-	private Logger log = Logger.getLogger(this.getClass());
-
-	public MessageFilter(ConfigTree config) throws ConfigurationException, RegistryException, MessageRouterException
-	{
-        super(config);
-	}
-	/** 
-     * Inspect the content of the message using a rule set 
-     * Router the message to one or more destinations, using the ContentBasedRouter to figure out
-     * to which destinations it is going to be routed too. 
-     *  
-     * @param message
-     * @return Message
-     * @throws ActionProcessingException
-	 */
-	public Message process(Message message) throws ActionProcessingException
-	{
-        try {
-            List<Object> objectList = _mapper.createObjectList(message, _messagePathList);
-            List<String> destinations = _cbr.route(_ruleSet, _ruleLanguage, _ruleReload, message, objectList);
-            Collection<String[]> outgoingDestinations = new ArrayList<String[]>();
-    		for (String destination : destinations) {
-                if (_destinations.containsKey(destination)) {
-                    outgoingDestinations.add(_destinations.get(destination));
-                }
-    		}
-            if (outgoingDestinations.size()>0) {
-                MessageRouter.deliverMessages(outgoingDestinations, message); 
-            } else {
-                log.debug("No destinations where found, the Message is filtered"); 
-            }
-        } catch (MessageRouterException mre) {
-            throw new ActionProcessingException(mre.getMessage(), mre);
-        }
-		return null;
-	}
-    
-    
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/MessageFilter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/MessageFilter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/MessageFilter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/MessageFilter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,83 @@
+/*
+ * 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.
+ */
+
+/**
+ * Routes the Message argument to a fixed list of services ([category,name]) 
+ * @author kstam at redhat.com
+ * @since Version 4.2
+ */
+package org.jboss.soa.esb.actions;
+
+import java.util.ArrayList;
+import java.util.Collection;
+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.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.routing.MessageRouter;
+import org.jboss.soa.esb.services.routing.MessageRouterException;
+
+public class MessageFilter extends ContentBasedRouter
+{
+	public static final String ROUTE_TO_TAG = "route-to";
+	private Logger log = Logger.getLogger(this.getClass());
+
+	public MessageFilter(ConfigTree config) throws ConfigurationException, RegistryException, MessageRouterException
+	{
+        super(config);
+	}
+	/** 
+     * Inspect the content of the message using a rule set 
+     * Router the message to one or more destinations, using the ContentBasedRouter to figure out
+     * to which destinations it is going to be routed too. 
+     *  
+     * @param message
+     * @return Message
+     * @throws ActionProcessingException
+	 */
+	public Message process(Message message) throws ActionProcessingException
+	{
+        try {
+            List<Object> objectList = _mapper.createObjectList(message, _messagePathList);
+            List<String> destinations = _cbr.route(_ruleSet, _ruleLanguage, _ruleReload, message, objectList);
+            Collection<String[]> outgoingDestinations = new ArrayList<String[]>();
+    		for (String destination : destinations) {
+                if (_destinations.containsKey(destination)) {
+                    outgoingDestinations.add(_destinations.get(destination));
+                }
+    		}
+            if (outgoingDestinations.size()>0) {
+                MessageRouter.deliverMessages(outgoingDestinations, message); 
+            } else {
+                log.debug("No destinations where found, the Message is filtered"); 
+            }
+        } catch (MessageRouterException mre) {
+            throw new ActionProcessingException(mre.getMessage(), mre);
+        }
+		return null;
+	}
+    
+    
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,128 +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.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.notification.NotificationList;
-
-/**
- * Stand alone action class that replaces the NotificationHandler EJB (beta 1) 
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- */
-public class Notifier implements ActionLifecycle
-{
-	public Notifier(ConfigTree config)
-	{
-		_config = config;
-	} //________________________________
-	
-        /**
-         * Initialise the action instance.
-         * <p/>
-         * This method is called after the action instance has been instantiated so that
-         * configuration options can be validated.
-         * 
-         * @throws ActionLifecycleException for errors during initialisation.
-         */
-        public void initialise()
-            throws ActionLifecycleException
-        {
-            if (null==_config)
-            {
-                _notifyOK = _notifyError = new ConfigTree[]{};
-            }
-            else
-            {
-                _notifyOK       = getNotificationList("ok");
-                _notifyError= getNotificationList("err");
-            }
-        }
-
-        /**
-         * Destroy the action instance.
-         * <p/>
-         * This method is called prior to the release of the action instance.  All
-         * resources associated with this action instance should be released as the
-         * instance will no longer be used.
-         */
-        public void destroy()
-            throws ActionLifecycleException
-        {
-        }
-        
-	/**
-	 * This is equivalent to a No Operation
-	 * @param message
-	 * @return - this method will always return arg0 unchanged
-	 */
-	public Message process 	(Message message) 
-	{
-		return message;
-	} //________________________________
-	
-	public void notifyOK 	(Message message) 
-	{
-		NotificationList.notifyAll(_notifyOK, message); 
-	} //________________________________
-	public void notifyError (Message message, final Throwable th) 
-	{ 
-		NotificationList.notifyAll(_notifyError, message); 
-	} //________________________________
-	
-	public String messageAsString (Message message) 
-	{ 
-		byte[] ba = null;
-		return (null==message) ? "<null message>"
-			:(null==(ba=message.getBody().getByteArray())) ? "<null body content>"
-			: new String(ba); 
-	} //________________________________
-	
-	private ConfigTree[] getNotificationList(String type)
-	{
-		List<ConfigTree> list = new ArrayList<ConfigTree>();
-		if (null!=type)
-			type = type.toLowerCase();
-		
-		for (ConfigTree tree : _config.getChildren(NotificationList.ELEMENT))
-		{
-			String sType = tree.getAttribute(NotificationList.TYPE);
-			if (null==sType)
-				continue;
-			if (null==type || sType.toLowerCase().equals(type))
-				list.add(tree);
-		}
-		
-		ConfigTree[] array = new ConfigTree[list.size()];
-		return list.toArray(array);
-	} //________________________________
-	
-	protected ConfigTree 	_config;
-	protected ConfigTree[]	_notifyOK	,_notifyError;
-	protected static Logger	_logger = Logger.getLogger(Notifier.class);
-} //____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/Notifier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,128 @@
+/*
+ * 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.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.notification.NotificationList;
+
+/**
+ * Stand alone action class that replaces the NotificationHandler EJB (beta 1) 
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ */
+public class Notifier implements ActionLifecycle
+{
+	public Notifier(ConfigTree config)
+	{
+		_config = config;
+	} //________________________________
+	
+        /**
+         * Initialise the action instance.
+         * <p/>
+         * This method is called after the action instance has been instantiated so that
+         * configuration options can be validated.
+         * 
+         * @throws ActionLifecycleException for errors during initialisation.
+         */
+        public void initialise()
+            throws ActionLifecycleException
+        {
+            if (null==_config)
+            {
+                _notifyOK = _notifyError = new ConfigTree[]{};
+            }
+            else
+            {
+                _notifyOK       = getNotificationList("ok");
+                _notifyError= getNotificationList("err");
+            }
+        }
+
+        /**
+         * Destroy the action instance.
+         * <p/>
+         * This method is called prior to the release of the action instance.  All
+         * resources associated with this action instance should be released as the
+         * instance will no longer be used.
+         */
+        public void destroy()
+            throws ActionLifecycleException
+        {
+        }
+        
+	/**
+	 * This is equivalent to a No Operation
+	 * @param message
+	 * @return - this method will always return arg0 unchanged
+	 */
+	public Message process 	(Message message) 
+	{
+		return message;
+	} //________________________________
+	
+	public void notifyOK 	(Message message) 
+	{
+		NotificationList.notifyAll(_notifyOK, message); 
+	} //________________________________
+	public void notifyError (Message message, final Throwable th) 
+	{ 
+		NotificationList.notifyAll(_notifyError, message); 
+	} //________________________________
+	
+	public String messageAsString (Message message) 
+	{ 
+		byte[] ba = null;
+		return (null==message) ? "<null message>"
+			:(null==(ba=message.getBody().getByteArray())) ? "<null body content>"
+			: new String(ba); 
+	} //________________________________
+	
+	private ConfigTree[] getNotificationList(String type)
+	{
+		List<ConfigTree> list = new ArrayList<ConfigTree>();
+		if (null!=type)
+			type = type.toLowerCase();
+		
+		for (ConfigTree tree : _config.getChildren(NotificationList.ELEMENT))
+		{
+			String sType = tree.getAttribute(NotificationList.TYPE);
+			if (null==sType)
+				continue;
+			if (null==type || sType.toLowerCase().equals(type))
+				list.add(tree);
+		}
+		
+		ConfigTree[] array = new ConfigTree[list.size()];
+		return list.toArray(array);
+	} //________________________________
+	
+	protected ConfigTree 	_config;
+	protected ConfigTree[]	_notifyOK	,_notifyError;
+	protected static Logger	_logger = Logger.getLogger(Notifier.class);
+} //____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,63 +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.
- */
-
-/**
- * Routes the Message argument to a fixed list of services ([category,name]) 
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- */
-package org.jboss.soa.esb.actions;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-
-public class StaticRouter extends StaticWiretap
-{
-    public StaticRouter(ConfigTree config) throws ConfigurationException, RegistryException
-    {
-            super(config) ;
-    }
-    
-    /**
-     * Routes the message to one or more destonations.
-     */
-    public Message process(Message message) throws ActionProcessingException
-    {
-        super.process(message) ;
-        return null ;
-    }
-    
-    /** 
-     * @deprecated no longer needed, leaving this in here for backwards compatibility,
-     * use the default "process".
-     * */
-    public Message split(Message message) throws ActionProcessingException 
-    {
-        _logger.warn("Depricated, please use the default 'process' method in your configuration");
-        return process(message);
-    }
-    
-    protected static Logger _logger = Logger.getLogger(StaticRouter.class);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,63 @@
+/*
+ * 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.
+ */
+
+/**
+ * Routes the Message argument to a fixed list of services ([category,name]) 
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ */
+package org.jboss.soa.esb.actions;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+
+public class StaticRouter extends StaticWiretap
+{
+    public StaticRouter(ConfigTree config) throws ConfigurationException, RegistryException
+    {
+            super(config) ;
+    }
+    
+    /**
+     * Routes the message to one or more destonations.
+     */
+    public Message process(Message message) throws ActionProcessingException
+    {
+        super.process(message) ;
+        return null ;
+    }
+    
+    /** 
+     * @deprecated no longer needed, leaving this in here for backwards compatibility,
+     * use the default "process".
+     * */
+    public Message split(Message message) throws ActionProcessingException 
+    {
+        _logger.warn("Depricated, please use the default 'process' method in your configuration");
+        return process(message);
+    }
+    
+    protected static Logger _logger = Logger.getLogger(StaticRouter.class);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,101 +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.
- */
-
-/**
- * Routes the Message argument to a fixed list of services ([category,name]) 
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @author Kevin.Conner at jboss.com
- * @since Version 4.0
- */
-package org.jboss.soa.esb.actions;
-
-import java.util.ArrayList;
-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.listeners.ListenerTagNames;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.routing.MessageRouter;
-import org.jboss.soa.esb.services.routing.MessageRouterException;
-
-public class StaticWiretap extends AbstractActionPipelineProcessor
-{
-    public static final String ROUTE_TO_TAG = "route-to";
-
-    public StaticWiretap(ConfigTree config) throws ConfigurationException,
-        RegistryException
-    {
-        _config = config;
-    }
-
-    /**
-     * Routes the message to one or more destinations, returning original message.
-     */
-    public Message process(Message message) throws ActionProcessingException
-    {
-        try
-        {
-            MessageRouter.deliverMessages(_destinations, message);
-            return message;
-        }
-        catch (MessageRouterException ex)
-        {
-            throw new ActionProcessingException(ex);
-        }
-    }
-
-    /**
-     * Initialization by reading the configuration.
-     */
-    public void initialise() throws ActionLifecycleException
-    {
-        _destinations = new ArrayList<String[]>();
-        ConfigTree[] destList = _config.getChildren(ROUTE_TO_TAG);
-        if (null == destList || destList.length < 1)
-        {
-            _logger.warn("Missing or empty destination list - This action class won't have any effect");
-            return;
-        }
-        for (ConfigTree curr : destList)
-        {
-            try
-            {
-                String category = curr.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, "");
-                String name = curr.getRequiredAttribute(ListenerTagNames.SERVICE_NAME_TAG);
-                _destinations.add(new String[] { category, name });
-            }
-            catch (Exception e)
-            {
-                throw new ActionLifecycleException("Problems with destination list", e);
-            }
-        }
-    }
-
-    protected ConfigTree _config;
-
-    protected List<String[]> _destinations;
-
-    protected static Logger _logger = Logger.getLogger(StaticRouter.class);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/StaticWiretap.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,101 @@
+/*
+ * 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.
+ */
+
+/**
+ * Routes the Message argument to a fixed list of services ([category,name]) 
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @author Kevin.Conner at jboss.com
+ * @since Version 4.0
+ */
+package org.jboss.soa.esb.actions;
+
+import java.util.ArrayList;
+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.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.routing.MessageRouter;
+import org.jboss.soa.esb.services.routing.MessageRouterException;
+
+public class StaticWiretap extends AbstractActionPipelineProcessor
+{
+    public static final String ROUTE_TO_TAG = "route-to";
+
+    public StaticWiretap(ConfigTree config) throws ConfigurationException,
+        RegistryException
+    {
+        _config = config;
+    }
+
+    /**
+     * Routes the message to one or more destinations, returning original message.
+     */
+    public Message process(Message message) throws ActionProcessingException
+    {
+        try
+        {
+            MessageRouter.deliverMessages(_destinations, message);
+            return message;
+        }
+        catch (MessageRouterException ex)
+        {
+            throw new ActionProcessingException(ex);
+        }
+    }
+
+    /**
+     * Initialization by reading the configuration.
+     */
+    public void initialise() throws ActionLifecycleException
+    {
+        _destinations = new ArrayList<String[]>();
+        ConfigTree[] destList = _config.getChildren(ROUTE_TO_TAG);
+        if (null == destList || destList.length < 1)
+        {
+            _logger.warn("Missing or empty destination list - This action class won't have any effect");
+            return;
+        }
+        for (ConfigTree curr : destList)
+        {
+            try
+            {
+                String category = curr.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, "");
+                String name = curr.getRequiredAttribute(ListenerTagNames.SERVICE_NAME_TAG);
+                _destinations.add(new String[] { category, name });
+            }
+            catch (Exception e)
+            {
+                throw new ActionLifecycleException("Problems with destination list", e);
+            }
+        }
+    }
+
+    protected ConfigTree _config;
+
+    protected List<String[]> _destinations;
+
+    protected static Logger _logger = Logger.getLogger(StaticRouter.class);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/SystemPrintln.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/SystemPrintln.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/SystemPrintln.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,101 +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
- */
-package org.jboss.soa.esb.actions;
-
-import java.io.PrintStream;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.Util;
-
-/**
- * Simple action that prints out the message contents using System.println.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class SystemPrintln extends AbstractActionPipelineProcessor
-{
-	public static final String PRE_MESSAGE = "message";
-	public static final String FULL_MESSAGE = "printfull";
-	public static final String PRINT_STREAM = "outputstream";
-	
-	/**
-	 * Public constructor.
-	 * 
-	 * @param config
-	 *            Configuration.
-	 */
-	public SystemPrintln(ConfigTree config)
-	{
-		printlnMessage = config.getAttribute(PRE_MESSAGE,
-				"** 'message' attribute not set **");
-		
-		printFullMessage = (config.getAttribute(FULL_MESSAGE, "false").equalsIgnoreCase("true") ? true : false);
-		useOutputStream = (config.getAttribute(PRINT_STREAM, "true").equals("true") ? true : false);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.ActionProcessor#process(org.jboss.soa.esb.message.Message)
-	 */
-	public Message process(Message message) throws ActionProcessingException
-	{
-		Object messageObject = ActionUtils.getTaskObject(message);
-		PrintStream stream = (useOutputStream ? System.out : System.err);
-		
-		System.out.println(printlnMessage + ": ");
-		
-		if (printFullMessage && (message != null))
-		{
-			// the message should be responsible for converting itself to a string.
-			
-			stream.println("[ "+message.toString()+" ]");
-		}
-		else
-		{
-			if (messageObject instanceof byte[])
-			{
-				stream.println("[" + Util.format(new String((byte[]) messageObject))
-						+ "].");
-			}
-			else
-			{
-				if (messageObject != null)
-					stream.println("[" + Util.format(messageObject.toString())
-							+ "].");
-				for (int i = 0; i < message.getAttachment().getUnnamedCount(); i++)
-				{
-					Message attachedMessage = (Message) message.getAttachment()
-							.itemAt(i);
-					stream.println("attachment " + i + ": ["
-							+ new String(attachedMessage.getBody().getByteArray())
-							+ "].");
-				}
-			}
-		}
-
-		return message;
-	}
-
-	private String printlnMessage;
-	private boolean printFullMessage;
-	private boolean useOutputStream;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/SystemPrintln.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/SystemPrintln.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/SystemPrintln.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/SystemPrintln.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,101 @@
+/*
+ * 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
+ */
+package org.jboss.soa.esb.actions;
+
+import java.io.PrintStream;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * Simple action that prints out the message contents using System.println.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class SystemPrintln extends AbstractActionPipelineProcessor
+{
+	public static final String PRE_MESSAGE = "message";
+	public static final String FULL_MESSAGE = "printfull";
+	public static final String PRINT_STREAM = "outputstream";
+	
+	/**
+	 * Public constructor.
+	 * 
+	 * @param config
+	 *            Configuration.
+	 */
+	public SystemPrintln(ConfigTree config)
+	{
+		printlnMessage = config.getAttribute(PRE_MESSAGE,
+				"** 'message' attribute not set **");
+		
+		printFullMessage = (config.getAttribute(FULL_MESSAGE, "false").equalsIgnoreCase("true") ? true : false);
+		useOutputStream = (config.getAttribute(PRINT_STREAM, "true").equals("true") ? true : false);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.ActionProcessor#process(org.jboss.soa.esb.message.Message)
+	 */
+	public Message process(Message message) throws ActionProcessingException
+	{
+		Object messageObject = ActionUtils.getTaskObject(message);
+		PrintStream stream = (useOutputStream ? System.out : System.err);
+		
+		System.out.println(printlnMessage + ": ");
+		
+		if (printFullMessage && (message != null))
+		{
+			// the message should be responsible for converting itself to a string.
+			
+			stream.println("[ "+message.toString()+" ]");
+		}
+		else
+		{
+			if (messageObject instanceof byte[])
+			{
+				stream.println("[" + Util.format(new String((byte[]) messageObject))
+						+ "].");
+			}
+			else
+			{
+				if (messageObject != null)
+					stream.println("[" + Util.format(messageObject.toString())
+							+ "].");
+				for (int i = 0; i < message.getAttachment().getUnnamedCount(); i++)
+				{
+					Message attachedMessage = (Message) message.getAttachment()
+							.itemAt(i);
+					stream.println("attachment " + i + ": ["
+							+ new String(attachedMessage.getBody().getByteArray())
+							+ "].");
+				}
+			}
+		}
+
+		return message;
+	}
+
+	private String printlnMessage;
+	private boolean printFullMessage;
+	private boolean useOutputStream;
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/AbstractObjectXStream.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/AbstractObjectXStream.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/AbstractObjectXStream.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,83 +0,0 @@
-package org.jboss.soa.esb.actions.converters;
-
-import java.util.List;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-
-/**
- * Abstract object and xstream action processor for common functionality. 
- * 
- * 
- * @author danielmarchant
- *
- */
-public abstract class AbstractObjectXStream extends AbstractActionPipelineProcessor {
-	
-	
-	protected String classAlias;
-	protected String rootNodeName;
-	protected boolean excludePackage = true;
-	protected String classMethod;
-    protected Class processorClass;
-	protected String classProcessor;
-	private String name;
-		 
-	    
-    /**
-     * Public constructor.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public AbstractObjectXStream(ConfigTree properties) {
-    	this( properties.getName(), properties.attributesAsList());
-    }
-	    
-    /**
-     * Public constructor.
-     * @param actionName Action name.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public AbstractObjectXStream(String actionName, List<KeyValuePair> properties) {
-    	name = actionName;
-    	classAlias = KeyValuePair.getValue("class-alias", properties, null);
-        excludePackage = KeyValuePair.getBooleanValue("exclude-package", properties, true);
-        rootNodeName = KeyValuePair.getValue("root-node", properties, null );
-    }
-	
-	
-	public String getName() {
-		return name;
-	}
-
-	public void setName(String name) {
-		this.name = name;
-	}
-	
-
-	/**
-	 * Gets the alias to use with classes.
-	 * 
-	 * @param obj
-	 * @return String
-	 */
-	protected String getAlias(Object obj) {
-		if(classAlias == null) {
-            if(excludePackage) {
-                return (obj instanceof Class) ? ((Class)obj).getSimpleName() : obj.getClass().getSimpleName();
-            } else {
-               return (obj instanceof Class) ? ((Class)obj).getName() : obj.getClass().getName();
-            }
-        } 
-		return classAlias;
-	}
-
-	public String getRootNodeName()
-	{
-		return rootNodeName;
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/AbstractObjectXStream.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/AbstractObjectXStream.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/AbstractObjectXStream.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/AbstractObjectXStream.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,83 @@
+package org.jboss.soa.esb.actions.converters;
+
+import java.util.List;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+
+/**
+ * Abstract object and xstream action processor for common functionality. 
+ * 
+ * 
+ * @author danielmarchant
+ *
+ */
+public abstract class AbstractObjectXStream extends AbstractActionPipelineProcessor {
+	
+	
+	protected String classAlias;
+	protected String rootNodeName;
+	protected boolean excludePackage = true;
+	protected String classMethod;
+    protected Class processorClass;
+	protected String classProcessor;
+	private String name;
+		 
+	    
+    /**
+     * Public constructor.
+     * @param properties Action Properties.
+     * @throws ConfigurationException Action not properly configured.
+     */
+    public AbstractObjectXStream(ConfigTree properties) {
+    	this( properties.getName(), properties.attributesAsList());
+    }
+	    
+    /**
+     * Public constructor.
+     * @param actionName Action name.
+     * @param properties Action Properties.
+     * @throws ConfigurationException Action not properly configured.
+     */
+    public AbstractObjectXStream(String actionName, List<KeyValuePair> properties) {
+    	name = actionName;
+    	classAlias = KeyValuePair.getValue("class-alias", properties, null);
+        excludePackage = KeyValuePair.getBooleanValue("exclude-package", properties, true);
+        rootNodeName = KeyValuePair.getValue("root-node", properties, null );
+    }
+	
+	
+	public String getName() {
+		return name;
+	}
+
+	public void setName(String name) {
+		this.name = name;
+	}
+	
+
+	/**
+	 * Gets the alias to use with classes.
+	 * 
+	 * @param obj
+	 * @return String
+	 */
+	protected String getAlias(Object obj) {
+		if(classAlias == null) {
+            if(excludePackage) {
+                return (obj instanceof Class) ? ((Class)obj).getSimpleName() : obj.getClass().getSimpleName();
+            } else {
+               return (obj instanceof Class) ? ((Class)obj).getName() : obj.getClass().getName();
+            }
+        } 
+		return classAlias;
+	}
+
+	public String getRootNodeName()
+	{
+		return rootNodeName;
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ByteArrayToString.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ByteArrayToString.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ByteArrayToString.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,87 +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.UnsupportedEncodingException;
-import java.util.List;
-
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Byte Array to String processor.
- * <p/>
- * Sample Action Configuration:
- * <pre>
- * &lt;Action name="Bytes-To-UTF-8-String" processor="ByteArrayToString"&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 ByteArrayToString extends AbstractActionPipelineProcessor {
-    
-    private String encoding;
-    
-    /**
-     * Public constructor.
-     * @param properties Action properties.
-     */
-    public ByteArrayToString(ConfigTree properties) {
-    	this("ByteArrayToString", properties.attributesAsList());
-    }
-    
-    /**
-     * Public constructor.
-     * @param actionName Processing action name.
-     * @param properties Action properties.
-     */
-    public ByteArrayToString(String actionName, List<KeyValuePair> properties) {
-        encoding = KeyValuePair.getValue("encoding", properties, "UTF-8");
-    }
-    
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
-     */
-    public Message process(Message message) throws ActionProcessingException {
-        byte[] bytes;
-        
-        try {
-            bytes = (byte[])ActionUtils.getTaskObject(message);
-        } catch(ClassCastException e) {
-            throw new ActionProcessingException("Message must be an array of bytes. Is " + message.getClass().getName());
-        }
-        
-        try {
-        	ActionUtils.setTaskObject(message,new String(bytes, encoding));
-        	return message;
-        } catch (UnsupportedEncodingException e) {
-            throw new ActionProcessingException("Unable to decode byte[] to String. Unsupported character encoding configuration: " + encoding, e);
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ByteArrayToString.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ByteArrayToString.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ByteArrayToString.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ByteArrayToString.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,87 @@
+/*
+ * 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.UnsupportedEncodingException;
+import java.util.List;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Byte Array to String processor.
+ * <p/>
+ * Sample Action Configuration:
+ * <pre>
+ * &lt;Action name="Bytes-To-UTF-8-String" processor="ByteArrayToString"&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 ByteArrayToString extends AbstractActionPipelineProcessor {
+    
+    private String encoding;
+    
+    /**
+     * Public constructor.
+     * @param properties Action properties.
+     */
+    public ByteArrayToString(ConfigTree properties) {
+    	this("ByteArrayToString", properties.attributesAsList());
+    }
+    
+    /**
+     * Public constructor.
+     * @param actionName Processing action name.
+     * @param properties Action properties.
+     */
+    public ByteArrayToString(String actionName, List<KeyValuePair> properties) {
+        encoding = KeyValuePair.getValue("encoding", properties, "UTF-8");
+    }
+    
+    /* (non-Javadoc)
+     * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
+     */
+    public Message process(Message message) throws ActionProcessingException {
+        byte[] bytes;
+        
+        try {
+            bytes = (byte[])ActionUtils.getTaskObject(message);
+        } catch(ClassCastException e) {
+            throw new ActionProcessingException("Message must be an array of bytes. Is " + message.getClass().getName());
+        }
+        
+        try {
+        	ActionUtils.setTaskObject(message,new String(bytes, encoding));
+        	return message;
+        } catch (UnsupportedEncodingException e) {
+            throw new ActionProcessingException("Unable to decode byte[] to String. Unsupported character encoding configuration: " + encoding, e);
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectInvoke.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectInvoke.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectInvoke.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,198 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.ClassUtil;
-
-
-/**
- * Object to processor.
- * <p/>
- * Uses the <a href="http://xstream.codehaus.org/">XStream</a> processor to generate an XML message String from the supplied object.
- * <p/>
- * Sample Action Configuration:
- * <pre>
- * &lt;Action name="doCustomer" processor="ObjectInvoke"&gt;
- *     &lt;property name="class-processor" value="CustomerProcessor" /&gt; &lt;!-- Required. Class processor used to process the message . --&gt;
- *     &lt;property name="class-method" value="fooMethodName" /&gt; &lt;!-- Optional. Default to name of action. --&gt;
- * 
- * &lt;/Action&gt;
- * </pre>
- * <p/>
- * 
- * This can be used with ObjectToXStream and XStreamToObject
- * 
- * @author danielmarchant
- * @since Version 4.0
- */
-public class ObjectInvoke extends AbstractActionPipelineProcessor {
-
-	private static Logger logger = Logger.getLogger(ObjectInvoke.class);
-	
-	private String classProcessor;
-    
-    // class related variables
-    private Class processorClass;
-    private Method method;
-    private String classMethod;
-    
-    // action related variables
-    private String name;
-    
-    /**
-     * Public constructor.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public ObjectInvoke(ConfigTree properties) {
-    	this(properties.getName(), properties.attributesAsList());
-    	
-    }
-    
-    
-    
-    
-    /**
-     * Public constructor.
-     * @param actionName Action name.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public ObjectInvoke(String actionName, List<KeyValuePair> properties) {
-    	
-    	name = actionName;
-        classProcessor = KeyValuePair.getValue("class-processor", properties);
-        classMethod = KeyValuePair.getValue("class-method", properties);
-        if((classMethod == null) || (classMethod.length() == 0) ) {
-        	classMethod = actionName;
-        }
-        
-        if(classProcessor == null) {
-        	return;
-        }
-        
-        try {
-			processorClass = ClassUtil.forName(classProcessor, getClass());
-			
-			this.setUpMethod(processorClass);
-			
-		} catch (ClassNotFoundException e) {
-			logger.error("Not able to find class: " + classProcessor, e);
-		}
-    }
-	
-	
-	/**
-	 * Processes the message by using the giving class-processor.
-	 *  
-	 */
-	public Message process(Message message) throws ActionProcessingException {
-		Object object = ActionUtils.getTaskObject(message);
-
-		Object processor = getObjectToInvoke();
-		Method m = this.setUpMethod(processor);
-		
-		Object result;
-		try {
-			result = m.invoke(processor, new Object[] { object });
-		} catch (IllegalArgumentException e) {
-			throw new ActionProcessingException("Invalid arguments for class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
-			
-		} catch (IllegalAccessException e) {
-			throw new ActionProcessingException("No access for class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
-			
-		} catch (InvocationTargetException e) {
-			throw new ActionProcessingException("Invocation problem with class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
-			
-		}
-		
-		ActionUtils.setTaskObject(message,result);
-		return message;
-	}
-
-	
-	/**
-	 * Gets the object that will process the message.
-	 * Classes can extend this to provide the object in the way they want.
-	 * 
-	 * 
-	 * @return Object
-	 * @throws ActionProcessingException
-	 */
-	protected Object getObjectToInvoke()  throws ActionProcessingException {
-		Object processor = null;
-		try {
-			processor = processorClass.newInstance();
-		} catch (InstantiationException e) {
-			throw new ActionProcessingException("Could not invoke class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
-		} catch (IllegalAccessException e) {
-			throw new ActionProcessingException("Could not access class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
-		}
-		return processor;
-	}
-	
-	
-	/**
-	 * Gets the method to invoke on object.
-	 * 
-	 * @param obj
-	 * @return Method
-	 */
-	protected Method setUpMethod(Object obj) {
-		if(method != null) 
-		{
-			return method;
-		}
-		
-		if(obj instanceof Class) {
-			processorClass = (Class)obj;
-		} else {
-			processorClass = obj.getClass();
-		}
-
-		Method[] methods = processorClass.getMethods();
-		for(int i=0; i<methods.length; i++) {
-			Method m = methods[i];
-			if(m.getName().equals(classMethod)) {
-				this.method = m;
-				break;
-			}
-		}
-		
-		return method;
-	}
-
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectInvoke.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectInvoke.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectInvoke.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectInvoke.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,198 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.ClassUtil;
+
+
+/**
+ * Object to processor.
+ * <p/>
+ * Uses the <a href="http://xstream.codehaus.org/">XStream</a> processor to generate an XML message String from the supplied object.
+ * <p/>
+ * Sample Action Configuration:
+ * <pre>
+ * &lt;Action name="doCustomer" processor="ObjectInvoke"&gt;
+ *     &lt;property name="class-processor" value="CustomerProcessor" /&gt; &lt;!-- Required. Class processor used to process the message . --&gt;
+ *     &lt;property name="class-method" value="fooMethodName" /&gt; &lt;!-- Optional. Default to name of action. --&gt;
+ * 
+ * &lt;/Action&gt;
+ * </pre>
+ * <p/>
+ * 
+ * This can be used with ObjectToXStream and XStreamToObject
+ * 
+ * @author danielmarchant
+ * @since Version 4.0
+ */
+public class ObjectInvoke extends AbstractActionPipelineProcessor {
+
+	private static Logger logger = Logger.getLogger(ObjectInvoke.class);
+	
+	private String classProcessor;
+    
+    // class related variables
+    private Class processorClass;
+    private Method method;
+    private String classMethod;
+    
+    // action related variables
+    private String name;
+    
+    /**
+     * Public constructor.
+     * @param properties Action Properties.
+     * @throws ConfigurationException Action not properly configured.
+     */
+    public ObjectInvoke(ConfigTree properties) {
+    	this(properties.getName(), properties.attributesAsList());
+    	
+    }
+    
+    
+    
+    
+    /**
+     * Public constructor.
+     * @param actionName Action name.
+     * @param properties Action Properties.
+     * @throws ConfigurationException Action not properly configured.
+     */
+    public ObjectInvoke(String actionName, List<KeyValuePair> properties) {
+    	
+    	name = actionName;
+        classProcessor = KeyValuePair.getValue("class-processor", properties);
+        classMethod = KeyValuePair.getValue("class-method", properties);
+        if((classMethod == null) || (classMethod.length() == 0) ) {
+        	classMethod = actionName;
+        }
+        
+        if(classProcessor == null) {
+        	return;
+        }
+        
+        try {
+			processorClass = ClassUtil.forName(classProcessor, getClass());
+			
+			this.setUpMethod(processorClass);
+			
+		} catch (ClassNotFoundException e) {
+			logger.error("Not able to find class: " + classProcessor, e);
+		}
+    }
+	
+	
+	/**
+	 * Processes the message by using the giving class-processor.
+	 *  
+	 */
+	public Message process(Message message) throws ActionProcessingException {
+		Object object = ActionUtils.getTaskObject(message);
+
+		Object processor = getObjectToInvoke();
+		Method m = this.setUpMethod(processor);
+		
+		Object result;
+		try {
+			result = m.invoke(processor, new Object[] { object });
+		} catch (IllegalArgumentException e) {
+			throw new ActionProcessingException("Invalid arguments for class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
+			
+		} catch (IllegalAccessException e) {
+			throw new ActionProcessingException("No access for class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
+			
+		} catch (InvocationTargetException e) {
+			throw new ActionProcessingException("Invocation problem with class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
+			
+		}
+		
+		ActionUtils.setTaskObject(message,result);
+		return message;
+	}
+
+	
+	/**
+	 * Gets the object that will process the message.
+	 * Classes can extend this to provide the object in the way they want.
+	 * 
+	 * 
+	 * @return Object
+	 * @throws ActionProcessingException
+	 */
+	protected Object getObjectToInvoke()  throws ActionProcessingException {
+		Object processor = null;
+		try {
+			processor = processorClass.newInstance();
+		} catch (InstantiationException e) {
+			throw new ActionProcessingException("Could not invoke class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
+		} catch (IllegalAccessException e) {
+			throw new ActionProcessingException("Could not access class-processor [ " + this.classProcessor + "] for Action Processor: " + name, e );
+		}
+		return processor;
+	}
+	
+	
+	/**
+	 * Gets the method to invoke on object.
+	 * 
+	 * @param obj
+	 * @return Method
+	 */
+	protected Method setUpMethod(Object obj) {
+		if(method != null) 
+		{
+			return method;
+		}
+		
+		if(obj instanceof Class) {
+			processorClass = (Class)obj;
+		} else {
+			processorClass = obj.getClass();
+		}
+
+		Method[] methods = processorClass.getMethods();
+		for(int i=0; i<methods.length; i++) {
+			Method m = methods[i];
+			if(m.getName().equals(classMethod)) {
+				this.method = m;
+				break;
+			}
+		}
+		
+		return method;
+	}
+
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToCSVString.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToCSVString.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToCSVString.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,153 +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.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Object to CSV String processor.
- * <p/>
- * Returns a CSV string based on the supplied message object and a comma-separated "bean-properties"
- * action property that specifies a list of bean property names.
- * <p/>
- * Sample Action Configuration:
- * <pre>
- * &lt;Action name="Customer-To-CSV" processor="ObjectToCSVString"&gt;
- *     &lt;property name="bean-properties" value="name,address1,address2,phone" /&gt;
- *     &lt;property name="fail-on-missing-property" value="true" /&gt; &lt;!-- (Optional) Default of false. --&gt;
- * &lt;/Action&gt;
- * </pre>
- * <p/>
- * TODO: Add support for arrays ala producing the contents of a CSV file.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ObjectToCSVString extends AbstractActionPipelineProcessor {
-
-	public static final String BEAN_PROPERTIES_PROP = "bean-properties";
-	public static final String FAIL_ON_MISSING_PROPERTY = "fail-on-missing-property";
-    private static Logger logger = Logger.getLogger(ObjectToCSVString.class);
-    private List<String> propertyMethodNames = new ArrayList<String>();
-	private boolean failOnMissingProperty;
-    
-    /**
-     * Public constructor.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public ObjectToCSVString(ConfigTree properties) throws ConfigurationException {
-    	this("ObjectToCSVString", properties.attributesAsList());
-    }
-    
-    /**
-     * Public constructor.
-     * @param actionName Action name.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public ObjectToCSVString(String actionName, List<KeyValuePair> properties) throws ConfigurationException {
-        String objectProps = KeyValuePair.getValue(BEAN_PROPERTIES_PROP, properties);
-        
-        if(objectProps == null || objectProps.trim().equals("")) {
-            throw new ConfigurationException("Action [" + actionName + "] must specify a comma seperated object bean property list via a '" + BEAN_PROPERTIES_PROP + "' property setting.");
-        }
-        
-        // Construct a bean method name list from the configured property name list...
-        String[] propertyNames = objectProps.split(",");
-        StringBuffer methodNameConstructionBuffer = new StringBuffer();
-        for(String propertyName : propertyNames) {
-            propertyName = propertyName.trim();
-            
-            if(propertyName.equals("")) {
-                continue;
-            }
-            
-            methodNameConstructionBuffer.setLength(0);
-            methodNameConstructionBuffer.append("get");
-            methodNameConstructionBuffer.append(propertyName);
-            
-            // Capitalise the 4th char to make it a proper bean method....
-            methodNameConstructionBuffer.setCharAt(3, Character.toUpperCase(methodNameConstructionBuffer.charAt(3)));
-
-            // Add to the set...
-            propertyMethodNames.add(methodNameConstructionBuffer.toString());
-        }
-        
-        failOnMissingProperty = KeyValuePair.getBooleanValue(FAIL_ON_MISSING_PROPERTY, properties, false);
-    }
-    
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
-     */
-    public Message process(Message message) throws ActionProcessingException {
-    	
-    	Object oCurr = ActionUtils.getTaskObject(message);
-    	Class oCurrClass = (null==oCurr) ? null : oCurr.getClass(); 
-        StringBuffer csv = new StringBuffer();
-        boolean hasAppendStarted = false; // Have we appended a value yet?
-        
-        for(String methodName : propertyMethodNames) {
-            Method method;
-
-            if(hasAppendStarted) {
-                csv.append(",");
-            }
-            hasAppendStarted = true;
-
-            // Get the bean method....
-            try {
-                method = oCurrClass.getMethod(methodName, new Class[] {});
-            } catch (Exception e) {
-            	String exceptionMessage = "Bean method: " + methodName + " not found/accessible on message object " + oCurr.getClass().getName();
-                logger.error(exceptionMessage, e);
-                if(failOnMissingProperty) {
-                	throw new ActionProcessingException(exceptionMessage, e);
-                }
-                csv.append("<no-such-property>");
-                continue;
-            }
-
-            // Call the bean method and add the toString of the return to the CSV string....
-            try {
-                Object value = method.invoke(oCurr, new Object[] {});
-                // TODO: Some sort of encoding is required here to make a proper CSV string...
-                csv.append(value != null?value.toString():"");
-            } catch (Exception e) {
-                logger.error("Exception calling bean method: " + methodName, e);
-            }
-        }
-        ActionUtils.setTaskObject(message,csv.toString());
-        return message;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToCSVString.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToCSVString.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToCSVString.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToCSVString.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,153 @@
+/*
+ * 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.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Object to CSV String processor.
+ * <p/>
+ * Returns a CSV string based on the supplied message object and a comma-separated "bean-properties"
+ * action property that specifies a list of bean property names.
+ * <p/>
+ * Sample Action Configuration:
+ * <pre>
+ * &lt;Action name="Customer-To-CSV" processor="ObjectToCSVString"&gt;
+ *     &lt;property name="bean-properties" value="name,address1,address2,phone" /&gt;
+ *     &lt;property name="fail-on-missing-property" value="true" /&gt; &lt;!-- (Optional) Default of false. --&gt;
+ * &lt;/Action&gt;
+ * </pre>
+ * <p/>
+ * TODO: Add support for arrays ala producing the contents of a CSV file.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class ObjectToCSVString extends AbstractActionPipelineProcessor {
+
+	public static final String BEAN_PROPERTIES_PROP = "bean-properties";
+	public static final String FAIL_ON_MISSING_PROPERTY = "fail-on-missing-property";
+    private static Logger logger = Logger.getLogger(ObjectToCSVString.class);
+    private List<String> propertyMethodNames = new ArrayList<String>();
+	private boolean failOnMissingProperty;
+    
+    /**
+     * Public constructor.
+     * @param properties Action Properties.
+     * @throws ConfigurationException Action not properly configured.
+     */
+    public ObjectToCSVString(ConfigTree properties) throws ConfigurationException {
+    	this("ObjectToCSVString", properties.attributesAsList());
+    }
+    
+    /**
+     * Public constructor.
+     * @param actionName Action name.
+     * @param properties Action Properties.
+     * @throws ConfigurationException Action not properly configured.
+     */
+    public ObjectToCSVString(String actionName, List<KeyValuePair> properties) throws ConfigurationException {
+        String objectProps = KeyValuePair.getValue(BEAN_PROPERTIES_PROP, properties);
+        
+        if(objectProps == null || objectProps.trim().equals("")) {
+            throw new ConfigurationException("Action [" + actionName + "] must specify a comma seperated object bean property list via a '" + BEAN_PROPERTIES_PROP + "' property setting.");
+        }
+        
+        // Construct a bean method name list from the configured property name list...
+        String[] propertyNames = objectProps.split(",");
+        StringBuffer methodNameConstructionBuffer = new StringBuffer();
+        for(String propertyName : propertyNames) {
+            propertyName = propertyName.trim();
+            
+            if(propertyName.equals("")) {
+                continue;
+            }
+            
+            methodNameConstructionBuffer.setLength(0);
+            methodNameConstructionBuffer.append("get");
+            methodNameConstructionBuffer.append(propertyName);
+            
+            // Capitalise the 4th char to make it a proper bean method....
+            methodNameConstructionBuffer.setCharAt(3, Character.toUpperCase(methodNameConstructionBuffer.charAt(3)));
+
+            // Add to the set...
+            propertyMethodNames.add(methodNameConstructionBuffer.toString());
+        }
+        
+        failOnMissingProperty = KeyValuePair.getBooleanValue(FAIL_ON_MISSING_PROPERTY, properties, false);
+    }
+    
+    /* (non-Javadoc)
+     * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
+     */
+    public Message process(Message message) throws ActionProcessingException {
+    	
+    	Object oCurr = ActionUtils.getTaskObject(message);
+    	Class oCurrClass = (null==oCurr) ? null : oCurr.getClass(); 
+        StringBuffer csv = new StringBuffer();
+        boolean hasAppendStarted = false; // Have we appended a value yet?
+        
+        for(String methodName : propertyMethodNames) {
+            Method method;
+
+            if(hasAppendStarted) {
+                csv.append(",");
+            }
+            hasAppendStarted = true;
+
+            // Get the bean method....
+            try {
+                method = oCurrClass.getMethod(methodName, new Class[] {});
+            } catch (Exception e) {
+            	String exceptionMessage = "Bean method: " + methodName + " not found/accessible on message object " + oCurr.getClass().getName();
+                logger.error(exceptionMessage, e);
+                if(failOnMissingProperty) {
+                	throw new ActionProcessingException(exceptionMessage, e);
+                }
+                csv.append("<no-such-property>");
+                continue;
+            }
+
+            // Call the bean method and add the toString of the return to the CSV string....
+            try {
+                Object value = method.invoke(oCurr, new Object[] {});
+                // TODO: Some sort of encoding is required here to make a proper CSV string...
+                csv.append(value != null?value.toString():"");
+            } catch (Exception e) {
+                logger.error("Exception calling bean method: " + methodName, e);
+            }
+        }
+        ActionUtils.setTaskObject(message,csv.toString());
+        return message;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToXStream.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToXStream.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToXStream.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,102 +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.util.List;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-
-import com.thoughtworks.xstream.XStream;
-
-/**
- * Object to XML processor.
- * <p/>
- * Uses the <a href="http://xstream.codehaus.org/">XStream</a> processor to generate an XML message String from the supplied object.
- * <p/>
- * Sample Action Configuration:
- * <pre>
- * &lt;Action name="Customer-To-XML" processor="ObjectToXStream"&gt;
- *     &lt;property name="class-alias" value="Customer" /&gt; &lt;!-- Class alias used in call to <a href="http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/XStream.html">XStream.alias(String, Class)</a> prior to serialisation. --&gt;
- *     &lt;property name="exclude-package" value="false" /&gt; &lt;!-- Default "true".  Not applicable if a "class-alias" is specified. --&gt;
- * &lt;/Action&gt;
- * </pre>
- * <p/>
- * The XML root element is either set from the "class-alias" property or the classes full name.  In the later case, the class package is
- * excluded unless "exclude-package" is set to "false"/"no". 
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ObjectToXStream extends AbstractActionPipelineProcessor {
-    
-    private String classAlias;
-    private boolean excludePackage;
-    
-    /**
-     * Public constructor.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public ObjectToXStream(ConfigTree properties) {
-    	this("ObjectToXStream", properties.attributesAsList());
-    }
-    
-    /**
-     * Public constructor.
-     * @param actionName Action name.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public ObjectToXStream(String actionName, List<KeyValuePair> properties) {
-        classAlias = KeyValuePair.getValue("class-alias", properties);
-        excludePackage = KeyValuePair.getBooleanValue("exclude-package", properties, true);
-    }
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
-     */
-    public Message process(Message message) throws ActionProcessingException {
-    	
-    	Object object = ActionUtils.getTaskObject(message);
-        XStream xstream = new XStream();
-        
-        if(classAlias == null) {
-            if(excludePackage) {
-                xstream.alias(object.getClass().getSimpleName(), object.getClass());
-            } else {
-                xstream.alias(object.getClass().getName(), object.getClass());
-            }
-        } else {
-            xstream.alias(classAlias, object.getClass());
-        }
-        
-        ActionUtils.setTaskObject(message,xstream.toXML(object));
-        return message;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToXStream.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToXStream.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToXStream.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/ObjectToXStream.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,102 @@
+/*
+ * 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.util.List;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.message.Message;
+
+import com.thoughtworks.xstream.XStream;
+
+/**
+ * Object to XML processor.
+ * <p/>
+ * Uses the <a href="http://xstream.codehaus.org/">XStream</a> processor to generate an XML message String from the supplied object.
+ * <p/>
+ * Sample Action Configuration:
+ * <pre>
+ * &lt;Action name="Customer-To-XML" processor="ObjectToXStream"&gt;
+ *     &lt;property name="class-alias" value="Customer" /&gt; &lt;!-- Class alias used in call to <a href="http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/XStream.html">XStream.alias(String, Class)</a> prior to serialisation. --&gt;
+ *     &lt;property name="exclude-package" value="false" /&gt; &lt;!-- Default "true".  Not applicable if a "class-alias" is specified. --&gt;
+ * &lt;/Action&gt;
+ * </pre>
+ * <p/>
+ * The XML root element is either set from the "class-alias" property or the classes full name.  In the later case, the class package is
+ * excluded unless "exclude-package" is set to "false"/"no". 
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class ObjectToXStream extends AbstractActionPipelineProcessor {
+    
+    private String classAlias;
+    private boolean excludePackage;
+    
+    /**
+     * Public constructor.
+     * @param properties Action Properties.
+     * @throws ConfigurationException Action not properly configured.
+     */
+    public ObjectToXStream(ConfigTree properties) {
+    	this("ObjectToXStream", properties.attributesAsList());
+    }
+    
+    /**
+     * Public constructor.
+     * @param actionName Action name.
+     * @param properties Action Properties.
+     * @throws ConfigurationException Action not properly configured.
+     */
+    public ObjectToXStream(String actionName, List<KeyValuePair> properties) {
+        classAlias = KeyValuePair.getValue("class-alias", properties);
+        excludePackage = KeyValuePair.getBooleanValue("exclude-package", properties, true);
+    }
+
+    /* (non-Javadoc)
+     * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
+     */
+    public Message process(Message message) throws ActionProcessingException {
+    	
+    	Object object = ActionUtils.getTaskObject(message);
+        XStream xstream = new XStream();
+        
+        if(classAlias == null) {
+            if(excludePackage) {
+                xstream.alias(object.getClass().getSimpleName(), object.getClass());
+            } else {
+                xstream.alias(object.getClass().getName(), object.getClass());
+            }
+        } else {
+            xstream.alias(classAlias, object.getClass());
+        }
+        
+        ActionUtils.setTaskObject(message,xstream.toXML(object));
+        return message;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/XStreamToObject.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/XStreamToObject.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/XStreamToObject.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,230 +0,0 @@
-package org.jboss.soa.esb.actions.converters;
-
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPathExpressionException;
-
-import org.apache.log4j.Logger;
-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.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.jboss.soa.esb.util.XPathUtil;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-import com.thoughtworks.xstream.XStream;
-import com.thoughtworks.xstream.io.HierarchicalStreamReader;
-import com.thoughtworks.xstream.io.xml.DomDriver;
-import com.thoughtworks.xstream.io.xml.DomReader;
-
-
-/**
- * Object to processor.
- * <p/>
- * Uses the <a href="http://xstream.codehaus.org/">XStream</a> processor to generate an XML message String from the supplied object.
- * <p/>
- * Sample Action Configuration:
- * <pre>
- * &lt;Action name="doCustomer" processor="XStreamObject"&gt;
- *     &lt;property name="class-alias" value="Customer" /&gt; &lt;!-- Optional. Class alias used in call to <a href="http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/XStream.html">XStream.alias(String, Class)</a> prior to deserialisation. --&gt;
- *     &lt;property name="incoming-type" value="CustomerProcessor" /&gt; &lt;!-- Required. Class for incoming type used to process the message after  deserialisation. --&gt;
- *     &lt;property name="exclude-package" value="false" /&gt; &lt;!-- Optional. Default "true".  Not applicable if a "class-alias" is specified. --&gt;
- *     &lt;property name="root-node" value="/root/Customer" /&gt; 
- *     &lt;!-- Optional. Specify an XPath expression be used to determine the root node used with XStream. 
- *     Useful when the object to convert is not the root node of the document --&gt;
- *     &lt;property name="aliases"&gt; &lt;!-- Optional list of extra aliases to add to XStream  --&gt;
- * 		&lt;alias name="aliasName" class="className" /&gt; 
- * 		&lt;alias name="aliasName" class="className" /&gt; 
- * 		...
- *     &lt;/property&gt;
- * &lt;/Action&gt;
- * </pre>
- * <p/>
- * The XML root element is either set from the "class-alias" property or the classes full name.  In the later case, the class package is
- * excluded unless "exclude-package" is set to "false"/"no". 
- * 
- * This can be used with ObjectToXStream
- * 
- * @author danielmarchant
- * @author Daniel Bevenius
- * @since Version 4.0
- */
-public class XStreamToObject  extends AbstractObjectXStream {
-
-	private static Logger logger = Logger.getLogger(XStreamToObject.class);
-	
-    // class related variables
-    private Class incomingType;
-    
-    // action related variables
-	private Map<String,String> aliases;
-   
-    /**
-     * Public constructor.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public XStreamToObject(ConfigTree properties) {
-    	this(properties.getName(), properties.attributesAsList());
-    	aliases = getAliases( properties );
-    }
-    
-    /**
-     * Public constructor.
-     * @param actionName Action name.
-     * @param properties Action Properties.
-     * @throws ConfigurationException Action not properly configured.
-     */
-    public XStreamToObject(String actionName, List<KeyValuePair> properties) {
-    	super(actionName,properties);
-    	String incomingTypeStr = KeyValuePair.getValue("incoming-type", properties);
-    	try {
-			incomingType = ClassUtil.forName(incomingTypeStr, getClass());
-		} catch (ClassNotFoundException e) {
-			logger.error("Could not find : " + incomingTypeStr,e);
-		}
-    }
-	
-	/**
-	 * Processes the message by using the giving class-processor.
-	 *  
-	 */
-	public Message process(Message message) throws ActionProcessingException {
-		Object object = ActionUtils.getTaskObject(message);
-		
-		try {
-			Object toObject = incomingType.newInstance();
-			fromXmlToObject( object.toString(), toObject );
-   		 	ActionUtils.setTaskObject(message,toObject);
-		} catch (InstantiationException e) {
-			logger.error( e );
-			throw new ActionProcessingException("Could not invoke for Arg: " + getName(),e );
-		} catch (IllegalAccessException e) {
-			logger.error( e );
-			throw new ActionProcessingException("Could not access for Arg: " + getName(),e );
-		} 
-		
-		return message;
-	}
-	
-	/**
-	 * Will extract the alias elements from the passed-in conifgTree 
-	 * 
-	 * @param configTree			the configuration for this class
-	 * 
-	 * @return Map<String,String> 	either an empty map or a map containing the alias name
-	 * 								as its key and the corresponding value is the class to map
-	 * 								it to.	
-	 */
-	protected Map<String,String> getAliases( ConfigTree configTree )
-	{
-		Map<String,String> aliases = new HashMap<String,String>();
-		
-		ConfigTree[] children = configTree.getChildren( "alias" );
-		
-		if ( children != null ) {
-			for ( ConfigTree alias : children )
-				aliases.put( alias.getAttribute( "name" ), alias.getAttribute( "class" ) );
-		}
-		return aliases;
-	}
-
-	/**
-	 * Added the aliases contained in the passed-in map to the
-	 * passed-in XStream object
-	 * 
-	 * @param aliases	 Map of aliases.
-	 * @throws ActionProcessingException 
-	 */
-	protected void addAliases( Map<String, String> aliases, XStream xstream) throws ActionProcessingException
-	{
-		if ( aliases == null )
-			return;
-		
-		Set<Map.Entry<String,String>> set = aliases.entrySet();
-		for (Map.Entry me : set ) {
-			String className = (String) me.getValue();
-			try {
-				Class clazz = ClassUtil.forName( className, getClass() );
-		        xstream.alias((String)me.getKey(), clazz );
-			} catch (ClassNotFoundException e) {
-				logger.error(e);
-				throw new ActionProcessingException("Could not add alias : " + (String)me.getKey() + ", class : " + className ,e );
-			}
-		}
-	}
-	
-	/**
-	 * 
-	 * @param xml		the xml String
-	 * @param root		an instance of the type of the root element
-	 * @throws ActionProcessingException
-	 * @throws ParserConfigurationException 
-	 * @throws IOException 
-	 * @throws SAXException 
-	 */
-	protected void fromXmlToObject(String xml, Object root ) throws ActionProcessingException
-	{
-		HierarchicalStreamReader reader = null;
-		try
-		{
-			XStream xstream = new XStream( new DomDriver() );
-			
-			reader = new DomReader( getRootElement( xml, rootNodeName ) );
-				
-	        xstream.alias(getAlias(incomingType), incomingType);
-	        addAliases( aliases, xstream );
-		        
-			xstream.unmarshal( reader, root );
-			
-		}
-		finally 
-		{
-			if ( reader != null)  reader.close();
-		}
-	}
-
-	/*
-	 * Simply delegates to XPathUtil and catches exceptions specific
-	 * to that class and rethrows an ActionProcessingException
-	 */
-	private Element getRootElement( String xml, String xPathExpression ) throws ActionProcessingException
-	{
-		logger.debug( "rootNodeName : " + xPathExpression );
-		
-		try
-		{
-			return XPathUtil.getNodeFromXPathExpression( xml, xPathExpression );
-		} 
-		catch (ParserConfigurationException e)
-		{
-			logger.error( e );
-			throw new ActionProcessingException( e );
-		} 
-		catch (SAXException e)
-		{
-			logger.error( e );
-			throw new ActionProcessingException( e );
-		} 
-		catch (IOException e)
-		{
-			logger.error( e );
-			throw new ActionProcessingException( e );
-		}
-		catch (XPathExpressionException e)
-		{
-			logger.error( e );
-			throw new ActionProcessingException( e );
-		}
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/XStreamToObject.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/XStreamToObject.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/XStreamToObject.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/converters/XStreamToObject.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,230 @@
+package org.jboss.soa.esb.actions.converters;
+
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPathExpressionException;
+
+import org.apache.log4j.Logger;
+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.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.jboss.soa.esb.util.XPathUtil;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.HierarchicalStreamReader;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+import com.thoughtworks.xstream.io.xml.DomReader;
+
+
+/**
+ * Object to processor.
+ * <p/>
+ * Uses the <a href="http://xstream.codehaus.org/">XStream</a> processor to generate an XML message String from the supplied object.
+ * <p/>
+ * Sample Action Configuration:
+ * <pre>
+ * &lt;Action name="doCustomer" processor="XStreamObject"&gt;
+ *     &lt;property name="class-alias" value="Customer" /&gt; &lt;!-- Optional. Class alias used in call to <a href="http://xstream.codehaus.org/javadoc/com/thoughtworks/xstream/XStream.html">XStream.alias(String, Class)</a> prior to deserialisation. --&gt;
+ *     &lt;property name="incoming-type" value="CustomerProcessor" /&gt; &lt;!-- Required. Class for incoming type used to process the message after  deserialisation. --&gt;
+ *     &lt;property name="exclude-package" value="false" /&gt; &lt;!-- Optional. Default "true".  Not applicable if a "class-alias" is specified. --&gt;
+ *     &lt;property name="root-node" value="/root/Customer" /&gt; 
+ *     &lt;!-- Optional. Specify an XPath expression be used to determine the root node used with XStream. 
+ *     Useful when the object to convert is not the root node of the document --&gt;
+ *     &lt;property name="aliases"&gt; &lt;!-- Optional list of extra aliases to add to XStream  --&gt;
+ * 		&lt;alias name="aliasName" class="className" /&gt; 
+ * 		&lt;alias name="aliasName" class="className" /&gt; 
+ * 		...
+ *     &lt;/property&gt;
+ * &lt;/Action&gt;
+ * </pre>
+ * <p/>
+ * The XML root element is either set from the "class-alias" property or the classes full name.  In the later case, the class package is
+ * excluded unless "exclude-package" is set to "false"/"no". 
+ * 
+ * This can be used with ObjectToXStream
+ * 
+ * @author danielmarchant
+ * @author Daniel Bevenius
+ * @since Version 4.0
+ */
+public class XStreamToObject  extends AbstractObjectXStream {
+
+	private static Logger logger = Logger.getLogger(XStreamToObject.class);
+	
+    // class related variables
+    private Class incomingType;
+    
+    // action related variables
+	private Map<String,String> aliases;
+   
+    /**
+     * Public constructor.
+     * @param properties Action Properties.
+     * @throws ConfigurationException Action not properly configured.
+     */
+    public XStreamToObject(ConfigTree properties) {
+    	this(properties.getName(), properties.attributesAsList());
+    	aliases = getAliases( properties );
+    }
+    
+    /**
+     * Public constructor.
+     * @param actionName Action name.
+     * @param properties Action Properties.
+     * @throws ConfigurationException Action not properly configured.
+     */
+    public XStreamToObject(String actionName, List<KeyValuePair> properties) {
+    	super(actionName,properties);
+    	String incomingTypeStr = KeyValuePair.getValue("incoming-type", properties);
+    	try {
+			incomingType = ClassUtil.forName(incomingTypeStr, getClass());
+		} catch (ClassNotFoundException e) {
+			logger.error("Could not find : " + incomingTypeStr,e);
+		}
+    }
+	
+	/**
+	 * Processes the message by using the giving class-processor.
+	 *  
+	 */
+	public Message process(Message message) throws ActionProcessingException {
+		Object object = ActionUtils.getTaskObject(message);
+		
+		try {
+			Object toObject = incomingType.newInstance();
+			fromXmlToObject( object.toString(), toObject );
+   		 	ActionUtils.setTaskObject(message,toObject);
+		} catch (InstantiationException e) {
+			logger.error( e );
+			throw new ActionProcessingException("Could not invoke for Arg: " + getName(),e );
+		} catch (IllegalAccessException e) {
+			logger.error( e );
+			throw new ActionProcessingException("Could not access for Arg: " + getName(),e );
+		} 
+		
+		return message;
+	}
+	
+	/**
+	 * Will extract the alias elements from the passed-in conifgTree 
+	 * 
+	 * @param configTree			the configuration for this class
+	 * 
+	 * @return Map<String,String> 	either an empty map or a map containing the alias name
+	 * 								as its key and the corresponding value is the class to map
+	 * 								it to.	
+	 */
+	protected Map<String,String> getAliases( ConfigTree configTree )
+	{
+		Map<String,String> aliases = new HashMap<String,String>();
+		
+		ConfigTree[] children = configTree.getChildren( "alias" );
+		
+		if ( children != null ) {
+			for ( ConfigTree alias : children )
+				aliases.put( alias.getAttribute( "name" ), alias.getAttribute( "class" ) );
+		}
+		return aliases;
+	}
+
+	/**
+	 * Added the aliases contained in the passed-in map to the
+	 * passed-in XStream object
+	 * 
+	 * @param aliases	 Map of aliases.
+	 * @throws ActionProcessingException 
+	 */
+	protected void addAliases( Map<String, String> aliases, XStream xstream) throws ActionProcessingException
+	{
+		if ( aliases == null )
+			return;
+		
+		Set<Map.Entry<String,String>> set = aliases.entrySet();
+		for (Map.Entry me : set ) {
+			String className = (String) me.getValue();
+			try {
+				Class clazz = ClassUtil.forName( className, getClass() );
+		        xstream.alias((String)me.getKey(), clazz );
+			} catch (ClassNotFoundException e) {
+				logger.error(e);
+				throw new ActionProcessingException("Could not add alias : " + (String)me.getKey() + ", class : " + className ,e );
+			}
+		}
+	}
+	
+	/**
+	 * 
+	 * @param xml		the xml String
+	 * @param root		an instance of the type of the root element
+	 * @throws ActionProcessingException
+	 * @throws ParserConfigurationException 
+	 * @throws IOException 
+	 * @throws SAXException 
+	 */
+	protected void fromXmlToObject(String xml, Object root ) throws ActionProcessingException
+	{
+		HierarchicalStreamReader reader = null;
+		try
+		{
+			XStream xstream = new XStream( new DomDriver() );
+			
+			reader = new DomReader( getRootElement( xml, rootNodeName ) );
+				
+	        xstream.alias(getAlias(incomingType), incomingType);
+	        addAliases( aliases, xstream );
+		        
+			xstream.unmarshal( reader, root );
+			
+		}
+		finally 
+		{
+			if ( reader != null)  reader.close();
+		}
+	}
+
+	/*
+	 * Simply delegates to XPathUtil and catches exceptions specific
+	 * to that class and rethrows an ActionProcessingException
+	 */
+	private Element getRootElement( String xml, String xPathExpression ) throws ActionProcessingException
+	{
+		logger.debug( "rootNodeName : " + xPathExpression );
+		
+		try
+		{
+			return XPathUtil.getNodeFromXPathExpression( xml, xPathExpression );
+		} 
+		catch (ParserConfigurationException e)
+		{
+			logger.error( e );
+			throw new ActionProcessingException( e );
+		} 
+		catch (SAXException e)
+		{
+			logger.error( e );
+			throw new ActionProcessingException( e );
+		} 
+		catch (IOException e)
+		{
+			logger.error( e );
+			throw new ActionProcessingException( e );
+		}
+		catch (XPathExpressionException e)
+		{
+			logger.error( e );
+			throw new ActionProcessingException( e );
+		}
+	}
+	
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/FileNameGeneratorAction.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/FileNameGeneratorAction.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/FileNameGeneratorAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,191 +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.naming;
-
-import java.io.IOException;
-import java.io.StringReader;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.xerces.parsers.DOMParser;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.BeanConfiguredAction;
-import org.jboss.soa.esb.actions.naming.strategy.FileNamingStrategy;
-import org.jboss.soa.esb.listeners.gateway.AbstractFileGateway;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.w3c.dom.DOMException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-
-/**
- * Action that generates a filename based on a naming strategy.
- * 
- * @author Derek Adams
- */
-public class FileNameGeneratorAction extends AbstractActionPipelineProcessor implements
-		BeanConfiguredAction {
-
-	/** Property name for incoming file name */
-	private String fileNameProperty = AbstractFileGateway.ORIGINAL_FILE_NAME_MSG_PROP;
-
-	/** Property name for filename after processing */
-	private String resultProperty = DEFAULT_RESULT_PROPERTY;
-
-	/** String containing XML for configured strategies */
-	private String strategies;
-
-	/** List of strategy instances created from XML */
-	protected List<FileNamingStrategy> strategyImpls;
-
-	/** Default name for processing result */
-	public static final String DEFAULT_RESULT_PROPERTY = "org.jboss.soa.esb.naming.result";
-
-	/** Tag for strategy element */
-	public static final String ELEMENT_STRATEGY = "strategy";
-	
-	/** Class attribute */
-	public static final String ATTR_CLASS = "class";
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.ActionPipelineProcessor#process(org.jboss.soa.esb.message.Message)
-	 */
-	public Message process(Message message) throws ActionProcessingException {
-		String currentFilename = (String) message.getProperties().getProperty(getFileNameProperty());
-		for (FileNamingStrategy strategy : strategyImpls) {
-			currentFilename = strategy.process(currentFilename, message);
-		}
-		message.getProperties().setProperty(getResultProperty(), currentFilename);
-		return message;
-	}
-
-	/**
-	 * Create a List of strategy implentations from the XML.
-	 */
-	protected void createStrategies() {
-		strategyImpls = new ArrayList<FileNamingStrategy>();
-		try {
-			DOMParser parser = new DOMParser();
-			InputSource source = new InputSource(new StringReader(getStrategies()));
-			parser.parse(source);
-			Document doc = parser.getDocument();
-			NodeList strategyNodes = doc.getElementsByTagName(ELEMENT_STRATEGY);
-			for (int i = 0; i < strategyNodes.getLength(); i++) {
-				FileNamingStrategy strategy = createStrategy(strategyNodes.item(i));
-				strategyImpls.add(strategy);
-			}
-		} catch (SAXException e) {
-			throw new RuntimeException(e);
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
-	}
-
-	/**
-	 * Create a strategy instance given a DOM node.
-	 * 
-	 * @param strategyNode
-	 * @return FileNamingStrategy
-	 */
-	protected FileNamingStrategy createStrategy(Node strategyNode) {
-		Node classNode = strategyNode.getAttributes().getNamedItem(ATTR_CLASS);
-		if (classNode == null) {
-			throw new RuntimeException("Strategy does not have 'class' attribute.");
-		}
-		try {
-			Class strategyClass = ClassUtil.forName(classNode.getNodeValue(), this.getClass());
-			FileNamingStrategy strategy = (FileNamingStrategy) strategyClass.newInstance();
-			strategy.configure(strategyNode);
-			return strategy;
-		} catch (DOMException e) {
-			throw new RuntimeException(e);
-		} catch (ClassNotFoundException e) {
-			throw new RuntimeException(e);
-		} catch (InstantiationException e) {
-			throw new RuntimeException(e);
-		} catch (IllegalAccessException e) {
-			throw new RuntimeException(e);
-		}
-	}
-
-	/**
-	 * Set the property that holds the initial file name.
-	 * 
-	 * @param fileNameProperty
-	 */
-	public void setFileNameProperty(String fileNameProperty) {
-		this.fileNameProperty = fileNameProperty;
-	}
-
-	/**
-	 * Get the property that holds the initial file name.
-	 * 
-	 * @return String
-	 */
-	public String getFileNameProperty() {
-		return fileNameProperty;
-	}
-
-	/**
-	 * Set the property that holds the processed file name.
-	 * 
-	 * @param resultProperty
-	 */
-	public void setResultProperty(String resultProperty) {
-		this.resultProperty = resultProperty;
-	}
-
-	/**
-	 * Get the property that holds the processed file name.
-	 * 
-	 * @return String
-	 */
-	public String getResultProperty() {
-		return resultProperty;
-	}
-
-	/**
-	 * Set the string containing XML for strategies.
-	 * 
-	 * @param strategies
-	 */
-	public void setStrategies(String strategies) {
-		this.strategies = strategies;
-		this.createStrategies();
-	}
-
-	/**
-	 * Set the string containing XML for strategies.
-	 * 
-	 * @return String
-	 */
-	public String getStrategies() {
-		return strategies;
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/FileNameGeneratorAction.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/FileNameGeneratorAction.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/FileNameGeneratorAction.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/FileNameGeneratorAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,191 @@
+/*
+ * 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.naming;
+
+import java.io.IOException;
+import java.io.StringReader;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.xerces.parsers.DOMParser;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.BeanConfiguredAction;
+import org.jboss.soa.esb.actions.naming.strategy.FileNamingStrategy;
+import org.jboss.soa.esb.listeners.gateway.AbstractFileGateway;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.w3c.dom.DOMException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+
+/**
+ * Action that generates a filename based on a naming strategy.
+ * 
+ * @author Derek Adams
+ */
+public class FileNameGeneratorAction extends AbstractActionPipelineProcessor implements
+		BeanConfiguredAction {
+
+	/** Property name for incoming file name */
+	private String fileNameProperty = AbstractFileGateway.ORIGINAL_FILE_NAME_MSG_PROP;
+
+	/** Property name for filename after processing */
+	private String resultProperty = DEFAULT_RESULT_PROPERTY;
+
+	/** String containing XML for configured strategies */
+	private String strategies;
+
+	/** List of strategy instances created from XML */
+	protected List<FileNamingStrategy> strategyImpls;
+
+	/** Default name for processing result */
+	public static final String DEFAULT_RESULT_PROPERTY = "org.jboss.soa.esb.naming.result";
+
+	/** Tag for strategy element */
+	public static final String ELEMENT_STRATEGY = "strategy";
+	
+	/** Class attribute */
+	public static final String ATTR_CLASS = "class";
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.ActionPipelineProcessor#process(org.jboss.soa.esb.message.Message)
+	 */
+	public Message process(Message message) throws ActionProcessingException {
+		String currentFilename = (String) message.getProperties().getProperty(getFileNameProperty());
+		for (FileNamingStrategy strategy : strategyImpls) {
+			currentFilename = strategy.process(currentFilename, message);
+		}
+		message.getProperties().setProperty(getResultProperty(), currentFilename);
+		return message;
+	}
+
+	/**
+	 * Create a List of strategy implentations from the XML.
+	 */
+	protected void createStrategies() {
+		strategyImpls = new ArrayList<FileNamingStrategy>();
+		try {
+			DOMParser parser = new DOMParser();
+			InputSource source = new InputSource(new StringReader(getStrategies()));
+			parser.parse(source);
+			Document doc = parser.getDocument();
+			NodeList strategyNodes = doc.getElementsByTagName(ELEMENT_STRATEGY);
+			for (int i = 0; i < strategyNodes.getLength(); i++) {
+				FileNamingStrategy strategy = createStrategy(strategyNodes.item(i));
+				strategyImpls.add(strategy);
+			}
+		} catch (SAXException e) {
+			throw new RuntimeException(e);
+		} catch (IOException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/**
+	 * Create a strategy instance given a DOM node.
+	 * 
+	 * @param strategyNode
+	 * @return FileNamingStrategy
+	 */
+	protected FileNamingStrategy createStrategy(Node strategyNode) {
+		Node classNode = strategyNode.getAttributes().getNamedItem(ATTR_CLASS);
+		if (classNode == null) {
+			throw new RuntimeException("Strategy does not have 'class' attribute.");
+		}
+		try {
+			Class strategyClass = ClassUtil.forName(classNode.getNodeValue(), this.getClass());
+			FileNamingStrategy strategy = (FileNamingStrategy) strategyClass.newInstance();
+			strategy.configure(strategyNode);
+			return strategy;
+		} catch (DOMException e) {
+			throw new RuntimeException(e);
+		} catch (ClassNotFoundException e) {
+			throw new RuntimeException(e);
+		} catch (InstantiationException e) {
+			throw new RuntimeException(e);
+		} catch (IllegalAccessException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/**
+	 * Set the property that holds the initial file name.
+	 * 
+	 * @param fileNameProperty
+	 */
+	public void setFileNameProperty(String fileNameProperty) {
+		this.fileNameProperty = fileNameProperty;
+	}
+
+	/**
+	 * Get the property that holds the initial file name.
+	 * 
+	 * @return String
+	 */
+	public String getFileNameProperty() {
+		return fileNameProperty;
+	}
+
+	/**
+	 * Set the property that holds the processed file name.
+	 * 
+	 * @param resultProperty
+	 */
+	public void setResultProperty(String resultProperty) {
+		this.resultProperty = resultProperty;
+	}
+
+	/**
+	 * Get the property that holds the processed file name.
+	 * 
+	 * @return String
+	 */
+	public String getResultProperty() {
+		return resultProperty;
+	}
+
+	/**
+	 * Set the string containing XML for strategies.
+	 * 
+	 * @param strategies
+	 */
+	public void setStrategies(String strategies) {
+		this.strategies = strategies;
+		this.createStrategies();
+	}
+
+	/**
+	 * Set the string containing XML for strategies.
+	 * 
+	 * @return String
+	 */
+	public String getStrategies() {
+		return strategies;
+	}
+}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AbstractFileNamingStrategy.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AbstractFileNamingStrategy.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AbstractFileNamingStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,71 +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.naming.strategy;
-
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Abstract base class that handles common concerns for file naming.
- * 
- * @author Derek Adams
- */
-public abstract class AbstractFileNamingStrategy implements FileNamingStrategy {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.naming.strategy.FileNamingStrategy#process(java.lang.String,
-	 *      org.jboss.soa.esb.message.Message)
-	 */
-	public abstract String process(String filename, Message message);
-
-	/**
-	 * Gets the filename without the suffix.
-	 * 
-	 * @param filename
-	 * @return String
-	 */
-	public String getFilenameWithoutSuffix(String filename) {
-		int lastDot = filename.lastIndexOf('.');
-		if (lastDot < 1) {
-			return filename;
-		} else {
-			return filename.substring(0, lastDot);
-		}
-	}
-
-	/**
-	 * Gets the filename without the suffix.
-	 * 
-	 * @param filename
-	 * @return String
-	 */
-	public String getSuffix(String filename) {
-		int lastDot = filename.lastIndexOf('.');
-		if (lastDot == -1) {
-			return filename;
-		} else {
-			return filename.substring(lastDot + 1);
-		}
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AbstractFileNamingStrategy.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AbstractFileNamingStrategy.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AbstractFileNamingStrategy.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AbstractFileNamingStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,71 @@
+/*
+ * 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.naming.strategy;
+
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Abstract base class that handles common concerns for file naming.
+ * 
+ * @author Derek Adams
+ */
+public abstract class AbstractFileNamingStrategy implements FileNamingStrategy {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.naming.strategy.FileNamingStrategy#process(java.lang.String,
+	 *      org.jboss.soa.esb.message.Message)
+	 */
+	public abstract String process(String filename, Message message);
+
+	/**
+	 * Gets the filename without the suffix.
+	 * 
+	 * @param filename
+	 * @return String
+	 */
+	public String getFilenameWithoutSuffix(String filename) {
+		int lastDot = filename.lastIndexOf('.');
+		if (lastDot < 1) {
+			return filename;
+		} else {
+			return filename.substring(0, lastDot);
+		}
+	}
+
+	/**
+	 * Gets the filename without the suffix.
+	 * 
+	 * @param filename
+	 * @return String
+	 */
+	public String getSuffix(String filename) {
+		int lastDot = filename.lastIndexOf('.');
+		if (lastDot == -1) {
+			return filename;
+		} else {
+			return filename.substring(lastDot + 1);
+		}
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AddTimestampNamingStrategy.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AddTimestampNamingStrategy.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AddTimestampNamingStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,54 +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.naming.strategy;
-
-import org.jboss.soa.esb.message.Message;
-import org.w3c.dom.Node;
-
-/**
- * Naming strategy that appends a timestamp to the filename.
- * 
- * @author Derek Adams
- * 
- */
-public class AddTimestampNamingStrategy extends AbstractFileNamingStrategy {
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.naming.strategy.FileNamingStrategy#configure(org.w3c.dom.Node)
-	 */
-	public void configure(Node xml) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.naming.strategy.AbstractFileNamingStrategy#process(java.lang.String,
-	 *      org.jboss.soa.esb.message.Message)
-	 */
-	public String process(String filename, Message message) {
-		return getFilenameWithoutSuffix(filename) + "-" + System.currentTimeMillis() + "."
-				+ getSuffix(filename);
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AddTimestampNamingStrategy.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AddTimestampNamingStrategy.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AddTimestampNamingStrategy.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/AddTimestampNamingStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,54 @@
+/*
+ * 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.naming.strategy;
+
+import org.jboss.soa.esb.message.Message;
+import org.w3c.dom.Node;
+
+/**
+ * Naming strategy that appends a timestamp to the filename.
+ * 
+ * @author Derek Adams
+ * 
+ */
+public class AddTimestampNamingStrategy extends AbstractFileNamingStrategy {
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.naming.strategy.FileNamingStrategy#configure(org.w3c.dom.Node)
+	 */
+	public void configure(Node xml) {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.naming.strategy.AbstractFileNamingStrategy#process(java.lang.String,
+	 *      org.jboss.soa.esb.message.Message)
+	 */
+	public String process(String filename, Message message) {
+		return getFilenameWithoutSuffix(filename) + "-" + System.currentTimeMillis() + "."
+				+ getSuffix(filename);
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/ChangeSuffixNamingStrategy.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/ChangeSuffixNamingStrategy.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/ChangeSuffixNamingStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,83 +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.naming.strategy;
-
-import org.jboss.soa.esb.message.Message;
-import org.w3c.dom.Node;
-
-/**
- * Naming strategy that changes the suffix of a file to a configured value.
- * 
- * @author Derek Adams
- */
-public class ChangeSuffixNamingStrategy extends AbstractFileNamingStrategy {
-
-	/** New suffix to use */
-	private String newSuffix = DEFAULT_NEW_SUFFIX;
-
-	/** Default suffix if none is configured */
-	public static final String DEFAULT_NEW_SUFFIX = "esbout";
-
-	/** XML attribute that holds the new suffix */
-	public static final String ATTR_NEW_SUFFIX = "newSuffix";
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.naming.strategy.FileNamingStrategy#configure(org.w3c.dom.Node)
-	 */
-	public void configure(Node xml) {
-		Node newSuffixNode = xml.getAttributes().getNamedItem(ATTR_NEW_SUFFIX);
-		if (newSuffixNode != null) {
-			setNewSuffix(newSuffixNode.getNodeValue());
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.naming.strategy.AbstractFileNamingStrategy#process(java.lang.String,
-	 *      org.jboss.soa.esb.message.Message)
-	 */
-	public String process(String filename, Message message) {
-		return getFilenameWithoutSuffix(filename) + '.' + getNewSuffix();
-	}
-
-	/**
-	 * Set the new suffix to use.
-	 * 
-	 * @param newSuffix
-	 */
-	public void setNewSuffix(String newSuffix) {
-		this.newSuffix = newSuffix;
-	}
-
-	/**
-	 * Get the new suffix to use.
-	 * 
-	 * @return String
-	 */
-	public String getNewSuffix() {
-		return newSuffix;
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/ChangeSuffixNamingStrategy.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/ChangeSuffixNamingStrategy.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/ChangeSuffixNamingStrategy.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/ChangeSuffixNamingStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,83 @@
+/*
+ * 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.naming.strategy;
+
+import org.jboss.soa.esb.message.Message;
+import org.w3c.dom.Node;
+
+/**
+ * Naming strategy that changes the suffix of a file to a configured value.
+ * 
+ * @author Derek Adams
+ */
+public class ChangeSuffixNamingStrategy extends AbstractFileNamingStrategy {
+
+	/** New suffix to use */
+	private String newSuffix = DEFAULT_NEW_SUFFIX;
+
+	/** Default suffix if none is configured */
+	public static final String DEFAULT_NEW_SUFFIX = "esbout";
+
+	/** XML attribute that holds the new suffix */
+	public static final String ATTR_NEW_SUFFIX = "newSuffix";
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.naming.strategy.FileNamingStrategy#configure(org.w3c.dom.Node)
+	 */
+	public void configure(Node xml) {
+		Node newSuffixNode = xml.getAttributes().getNamedItem(ATTR_NEW_SUFFIX);
+		if (newSuffixNode != null) {
+			setNewSuffix(newSuffixNode.getNodeValue());
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.naming.strategy.AbstractFileNamingStrategy#process(java.lang.String,
+	 *      org.jboss.soa.esb.message.Message)
+	 */
+	public String process(String filename, Message message) {
+		return getFilenameWithoutSuffix(filename) + '.' + getNewSuffix();
+	}
+
+	/**
+	 * Set the new suffix to use.
+	 * 
+	 * @param newSuffix
+	 */
+	public void setNewSuffix(String newSuffix) {
+		this.newSuffix = newSuffix;
+	}
+
+	/**
+	 * Get the new suffix to use.
+	 * 
+	 * @return String
+	 */
+	public String getNewSuffix() {
+		return newSuffix;
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/FileNamingStrategy.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/FileNamingStrategy.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/FileNamingStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,50 +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.naming.strategy;
-
-import org.jboss.soa.esb.message.Message;
-import org.w3c.dom.Node;
-
-/**
- * Strategy that performs a conversion on a filename.
- * 
- * @author Derek Adams
- */
-public interface FileNamingStrategy {
-
-	/**
-	 * Configure the strategy from its XML node.
-	 * 
-	 * @param xml
-	 */
-	public void configure(Node xml);
-
-	/**
-	 * Process the incoming filename and generate an outgoing filename.
-	 * 
-	 * @param filename
-	 * @param message
-	 * @return String
-	 */
-	public String process(String filename, Message message);
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/FileNamingStrategy.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/FileNamingStrategy.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/FileNamingStrategy.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/FileNamingStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,50 @@
+/*
+ * 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.naming.strategy;
+
+import org.jboss.soa.esb.message.Message;
+import org.w3c.dom.Node;
+
+/**
+ * Strategy that performs a conversion on a filename.
+ * 
+ * @author Derek Adams
+ */
+public interface FileNamingStrategy {
+
+	/**
+	 * Configure the strategy from its XML node.
+	 * 
+	 * @param xml
+	 */
+	public void configure(Node xml);
+
+	/**
+	 * Process the incoming filename and generate an outgoing filename.
+	 * 
+	 * @param filename
+	 * @param message
+	 * @return String
+	 */
+	public String process(String filename, Message message);
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/GroovyNamingStrategy.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/GroovyNamingStrategy.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/GroovyNamingStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,110 +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.naming.strategy;
-
-import groovy.lang.Binding;
-import groovy.lang.GroovyShell;
-
-import java.io.IOException;
-
-import org.jboss.soa.esb.actions.scripting.GroovyActionProcessor;
-import org.jboss.soa.esb.message.Message;
-import org.w3c.dom.Node;
-
-/**
- * Naming strategy that executes a Groovy script to manipulate a filename.
- * 
- * @author Derek Adams
- */
-public class GroovyNamingStrategy extends AbstractFileNamingStrategy {
-
-	/** Path to the groovy script that will be executed */
-	private String scriptPath = DEFAULT_SCRIPT_PATH;
-
-	/** Default path for the groovy script */
-	public static final String DEFAULT_SCRIPT_PATH = "naming.groovy";
-
-	/** XML attribute that holds the script pathx */
-	public static final String ATTR_SCRIPT_PATH = "scriptPath";
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.naming.strategy.FileNamingStrategy#configure(org.w3c.dom.Node)
-	 */
-	public void configure(Node xml) {
-		Node scriptPathNode = xml.getAttributes().getNamedItem(ATTR_SCRIPT_PATH);
-		if (scriptPathNode != null) {
-			setScriptPath(scriptPathNode.getNodeValue());
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.naming.strategy.AbstractFileNamingStrategy#process(java.lang.String,
-	 *      org.jboss.soa.esb.message.Message)
-	 */
-	@Override
-	public String process(String filename, Message message) {
-		try {
-			// Read the script into a string.
-			String script = GroovyActionProcessor.getScriptFromClasspath(getScriptPath());
-
-			// Bind objects into the Groovy context.
-			Binding binding = new Binding();
-			binding.setVariable("filename", filename);
-			binding.setVariable("message", message);
-
-			// Create a shell and evaluate
-			GroovyShell shell = new GroovyShell(Thread.currentThread().getContextClassLoader(),
-					binding);
-			Object result = shell.evaluate(script);
-			if (!(result instanceof String)) {
-				throw new RuntimeException(
-						"Groovy script should return a String indicating processed filename");
-			}
-			return (String) result;
-		} catch (IOException e) {
-			throw new RuntimeException(e);
-		}
-	}
-
-	/**
-	 * Set the path to the script.
-	 * 
-	 * @param scriptPath
-	 */
-	public void setScriptPath(String scriptPath) {
-		this.scriptPath = scriptPath;
-	}
-
-	/**
-	 * Get the path to the script.
-	 * 
-	 * @return String
-	 */
-	public String getScriptPath() {
-		return scriptPath;
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/GroovyNamingStrategy.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/GroovyNamingStrategy.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/GroovyNamingStrategy.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/naming/strategy/GroovyNamingStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,110 @@
+/*
+ * 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.naming.strategy;
+
+import groovy.lang.Binding;
+import groovy.lang.GroovyShell;
+
+import java.io.IOException;
+
+import org.jboss.soa.esb.actions.scripting.GroovyActionProcessor;
+import org.jboss.soa.esb.message.Message;
+import org.w3c.dom.Node;
+
+/**
+ * Naming strategy that executes a Groovy script to manipulate a filename.
+ * 
+ * @author Derek Adams
+ */
+public class GroovyNamingStrategy extends AbstractFileNamingStrategy {
+
+	/** Path to the groovy script that will be executed */
+	private String scriptPath = DEFAULT_SCRIPT_PATH;
+
+	/** Default path for the groovy script */
+	public static final String DEFAULT_SCRIPT_PATH = "naming.groovy";
+
+	/** XML attribute that holds the script pathx */
+	public static final String ATTR_SCRIPT_PATH = "scriptPath";
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.naming.strategy.FileNamingStrategy#configure(org.w3c.dom.Node)
+	 */
+	public void configure(Node xml) {
+		Node scriptPathNode = xml.getAttributes().getNamedItem(ATTR_SCRIPT_PATH);
+		if (scriptPathNode != null) {
+			setScriptPath(scriptPathNode.getNodeValue());
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.naming.strategy.AbstractFileNamingStrategy#process(java.lang.String,
+	 *      org.jboss.soa.esb.message.Message)
+	 */
+	@Override
+	public String process(String filename, Message message) {
+		try {
+			// Read the script into a string.
+			String script = GroovyActionProcessor.getScriptFromClasspath(getScriptPath());
+
+			// Bind objects into the Groovy context.
+			Binding binding = new Binding();
+			binding.setVariable("filename", filename);
+			binding.setVariable("message", message);
+
+			// Create a shell and evaluate
+			GroovyShell shell = new GroovyShell(Thread.currentThread().getContextClassLoader(),
+					binding);
+			Object result = shell.evaluate(script);
+			if (!(result instanceof String)) {
+				throw new RuntimeException(
+						"Groovy script should return a String indicating processed filename");
+			}
+			return (String) result;
+		} catch (IOException e) {
+			throw new RuntimeException(e);
+		}
+	}
+
+	/**
+	 * Set the path to the script.
+	 * 
+	 * @param scriptPath
+	 */
+	public void setScriptPath(String scriptPath) {
+		this.scriptPath = scriptPath;
+	}
+
+	/**
+	 * Get the path to the script.
+	 * 
+	 * @return String
+	 */
+	public String getScriptPath() {
+		return scriptPath;
+	}
+}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,84 +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.actions.routing;
-
-import java.util.List;
-
-import javax.jms.JMSException;
-import javax.naming.NamingException;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-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.message.Message;
-
-/**
- * Abstract router.
- * <p/>
- * Handles unwrapping of the message payload (if required) before routing.  To turn on
- * unwrapping, supply an "unwrap" property with a value of "true" (default "false").
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class AbstractRouter extends AbstractActionPipelineProcessor {
-
-	/**
-	 * Unwrap the message payload before routing. 
-	 */
-	public boolean unwrap = false;
-	
-    /**
-     * Public constructor.
-     * @param actionName Action name.
-     * @param properties Action properties.
-     * @throws ConfigurationException Queue name not configured.
-     * @throws JMSException Unable to configure JMS destination.
-     * @throws NamingException Unable to configure JMS destination.
-     */
-    public AbstractRouter(String actionName, List<KeyValuePair> properties) throws ConfigurationException {
-    	unwrap = KeyValuePair.getBooleanValue("unwrap", properties, false); 
-    }
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
-     */
-    public final Message process(Message message) throws ActionProcessingException {
-    	if(unwrap) {
-    		route(ActionUtils.getTaskObject(message));
-    	} else {
-    		route(message);
-    	}
-    	
-    	return null;
-    }
-    
-    /**
-     * Route the message or message payload.
-     * <p/>
-     * If the message is to be unwrapped, it will have been unwrapped at this stage.
-     * @param object The object to route.
-     * @throws ActionProcessingException Exception during routing operation.
-     */
-    public abstract void route(Object object) throws ActionProcessingException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/AbstractRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,84 @@
+/*
+ * 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.actions.routing;
+
+import java.util.List;
+
+import javax.jms.JMSException;
+import javax.naming.NamingException;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+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.message.Message;
+
+/**
+ * Abstract router.
+ * <p/>
+ * Handles unwrapping of the message payload (if required) before routing.  To turn on
+ * unwrapping, supply an "unwrap" property with a value of "true" (default "false").
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public abstract class AbstractRouter extends AbstractActionPipelineProcessor {
+
+	/**
+	 * Unwrap the message payload before routing. 
+	 */
+	public boolean unwrap = false;
+	
+    /**
+     * Public constructor.
+     * @param actionName Action name.
+     * @param properties Action properties.
+     * @throws ConfigurationException Queue name not configured.
+     * @throws JMSException Unable to configure JMS destination.
+     * @throws NamingException Unable to configure JMS destination.
+     */
+    public AbstractRouter(String actionName, List<KeyValuePair> properties) throws ConfigurationException {
+    	unwrap = KeyValuePair.getBooleanValue("unwrap", properties, false); 
+    }
+
+    /* (non-Javadoc)
+     * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
+     */
+    public final Message process(Message message) throws ActionProcessingException {
+    	if(unwrap) {
+    		route(ActionUtils.getTaskObject(message));
+    	} else {
+    		route(message);
+    	}
+    	
+    	return null;
+    }
+    
+    /**
+     * Route the message or message payload.
+     * <p/>
+     * If the message is to be unwrapped, it will have been unwrapped at this stage.
+     * @param object The object to route.
+     * @throws ActionProcessingException Exception during routing operation.
+     */
+    public abstract void route(Object object) throws ActionProcessingException;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/EchoRouter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/EchoRouter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/EchoRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.routing;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-/**
- * Echo Action Processor. 
- * 
- * <p/> Sample Action Configuration:
- * 
- * <pre>
- *   &lt;Action class=&quot;org.jboss.soa.esb.actions.routing.EchoRouter&quot;&gt;&lt;/Action&gt;
- * </pre>
- * 
- * @author <a href="mailto:johan.kumps at telenet.be">Johan Kumps</a>
- */
-public class EchoRouter extends AbstractActionPipelineProcessor {
-
-	/* The logger for this class */
-	private static Logger logger = Logger.getLogger(EchoRouter.class);
-	
-	public EchoRouter (ConfigTree configTree){		
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
-	 */
-	public org.jboss.soa.esb.message.Message process(
-			org.jboss.soa.esb.message.Message message)
-			throws ActionProcessingException {
-
-		if (logger.isInfoEnabled()) {
-			logger.info("EchoRouter currently routing message " + message + " with payload <<" + ActionUtils.getTaskObject(message) + ">>");
-		}
-
-		return message;
-
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/EchoRouter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/EchoRouter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/EchoRouter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/EchoRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,66 @@
+/*
+ * 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 org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+/**
+ * Echo Action Processor. 
+ * 
+ * <p/> Sample Action Configuration:
+ * 
+ * <pre>
+ *   &lt;Action class=&quot;org.jboss.soa.esb.actions.routing.EchoRouter&quot;&gt;&lt;/Action&gt;
+ * </pre>
+ * 
+ * @author <a href="mailto:johan.kumps at telenet.be">Johan Kumps</a>
+ */
+public class EchoRouter extends AbstractActionPipelineProcessor {
+
+	/* The logger for this class */
+	private static Logger logger = Logger.getLogger(EchoRouter.class);
+	
+	public EchoRouter (ConfigTree configTree){		
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
+	 */
+	public org.jboss.soa.esb.message.Message process(
+			org.jboss.soa.esb.message.Message message)
+			throws ActionProcessingException {
+
+		if (logger.isInfoEnabled()) {
+			logger.info("EchoRouter currently routing message " + message + " with payload <<" + ActionUtils.getTaskObject(message) + ">>");
+		}
+
+		return message;
+
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,130 +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 org.apache.log4j.Logger;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-
-/**
- * HttpRouter Action Processor. This ActionProcessor will forward the message to an url for further processing.
- * If the routeUrl property is not set a default url will be used.
- * 
- * <p/> Sample Action Configuration:
- * 
- * <pre>
- *    &lt;Action class=&quot;org.jboss.soa.esb.actions.routing.HttpRouter&quot;&gt;
- *    	&lt;property name=&quot;routeUrl&quot; value=&quot;http://localhost:8888&quot;&lt;/property&gt;
- *    &lt;/Action&gt;
- * </pre>
- *
- * @author <a href="mailto:johan.kumps at telenet.be">Johan Kumps</a>
- */
-public class HttpRouter extends AbstractActionPipelineProcessor {
-
-	/* The logger for this class */
-	private static Logger logger = Logger.getLogger(HttpRouter.class);
-
-	/* The url to route the message to */
-	private String urlToRouteTo = null;
-
-	/*
-	 * The url to route the message to if the url was not set in the
-	 * configuration
-	 */
-	private static final String DEFAULT_URL_TO_ROUTE_TO = "http://localhost:5400";
-
-	/**
-	 * Constructing a HttpRouter instance
-	 * 
-	 * @param configTree
-	 *            the configuration to use in this HttpRouter instance
-	 */
-	public HttpRouter(ConfigTree configTree) {
-                urlToRouteTo = obtainAttribute(configTree,
-                    ListenerTagNames.HTTP_ROUTER_ROUTE_URL,
-                    DEFAULT_URL_TO_ROUTE_TO);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
-	 */
-	public org.jboss.soa.esb.message.Message process(
-			org.jboss.soa.esb.message.Message message)
-			throws ActionProcessingException {
-
-		Object oCurr = ActionUtils.getTaskObject(message);
-
-		if (logger.isInfoEnabled()) {
-			logger
-					.info("HttpRouter currently routing message " + message
-							+ " with payload <<" + oCurr + ">> to "
-							+ this.urlToRouteTo);
-		}
-
-		try {
-			InvokerLocator locator = new InvokerLocator(this.urlToRouteTo);
-
-			Client remotingClient = new Client(locator);
-                        remotingClient.connect();
-                        try
-                        {
-                            remotingClient.invoke(oCurr, null);
-                            return null;
-                        }
-                        finally
-                        {
-                            remotingClient.disconnect() ;
-                        }
-		} catch (Throwable e) {
-			String errorMessage = "Exception while sending message [" + oCurr
-					+ "] to destination [" + this.urlToRouteTo + "].";
-			logger.error(errorMessage, e);
-			throw new ActionProcessingException(errorMessage, e);
-		}
-	}
-
-	/**
-	 * Method obtaining an attribute from the configuration tree
-	 * 
-	 * @param tree
-	 *            the configuration to use
-	 * @param p_sAtt
-	 *            the name of the attribute to get
-	 * @param p_sDefault
-	 *            the default value for the attribute if not set
-	 * @return the value of the attribute or the default one is not set in
-	 *         configuration tree
-	 */
-	private String obtainAttribute(final ConfigTree configTree, String p_sAtt, String p_sDefault) {
-		String sVal = configTree.getAttribute(p_sAtt);
-		return (null != sVal) ? sVal : p_sDefault;
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/HttpRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,130 @@
+/*
+ * 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 org.apache.log4j.Logger;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+
+/**
+ * HttpRouter Action Processor. This ActionProcessor will forward the message to an url for further processing.
+ * If the routeUrl property is not set a default url will be used.
+ * 
+ * <p/> Sample Action Configuration:
+ * 
+ * <pre>
+ *    &lt;Action class=&quot;org.jboss.soa.esb.actions.routing.HttpRouter&quot;&gt;
+ *    	&lt;property name=&quot;routeUrl&quot; value=&quot;http://localhost:8888&quot;&lt;/property&gt;
+ *    &lt;/Action&gt;
+ * </pre>
+ *
+ * @author <a href="mailto:johan.kumps at telenet.be">Johan Kumps</a>
+ */
+public class HttpRouter extends AbstractActionPipelineProcessor {
+
+	/* The logger for this class */
+	private static Logger logger = Logger.getLogger(HttpRouter.class);
+
+	/* The url to route the message to */
+	private String urlToRouteTo = null;
+
+	/*
+	 * The url to route the message to if the url was not set in the
+	 * configuration
+	 */
+	private static final String DEFAULT_URL_TO_ROUTE_TO = "http://localhost:5400";
+
+	/**
+	 * Constructing a HttpRouter instance
+	 * 
+	 * @param configTree
+	 *            the configuration to use in this HttpRouter instance
+	 */
+	public HttpRouter(ConfigTree configTree) {
+                urlToRouteTo = obtainAttribute(configTree,
+                    ListenerTagNames.HTTP_ROUTER_ROUTE_URL,
+                    DEFAULT_URL_TO_ROUTE_TO);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.ActionProcessor#process(java.lang.Object)
+	 */
+	public org.jboss.soa.esb.message.Message process(
+			org.jboss.soa.esb.message.Message message)
+			throws ActionProcessingException {
+
+		Object oCurr = ActionUtils.getTaskObject(message);
+
+		if (logger.isInfoEnabled()) {
+			logger
+					.info("HttpRouter currently routing message " + message
+							+ " with payload <<" + oCurr + ">> to "
+							+ this.urlToRouteTo);
+		}
+
+		try {
+			InvokerLocator locator = new InvokerLocator(this.urlToRouteTo);
+
+			Client remotingClient = new Client(locator);
+                        remotingClient.connect();
+                        try
+                        {
+                            remotingClient.invoke(oCurr, null);
+                            return null;
+                        }
+                        finally
+                        {
+                            remotingClient.disconnect() ;
+                        }
+		} catch (Throwable e) {
+			String errorMessage = "Exception while sending message [" + oCurr
+					+ "] to destination [" + this.urlToRouteTo + "].";
+			logger.error(errorMessage, e);
+			throw new ActionProcessingException(errorMessage, e);
+		}
+	}
+
+	/**
+	 * Method obtaining an attribute from the configuration tree
+	 * 
+	 * @param tree
+	 *            the configuration to use
+	 * @param p_sAtt
+	 *            the name of the attribute to get
+	 * @param p_sDefault
+	 *            the default value for the attribute if not set
+	 * @return the value of the attribute or the default one is not set in
+	 *         configuration tree
+	 */
+	private String obtainAttribute(final ConfigTree configTree, String p_sAtt, String p_sDefault) {
+		String sVal = configTree.getAttribute(p_sAtt);
+		return (null != sVal) ? sVal : p_sDefault;
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,256 +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.Serializable;
-import java.util.List;
-import java.util.Properties;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.ObjectMessage;
-import javax.jms.Queue;
-import javax.jms.QueueSession;
-import javax.jms.TextMessage;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.common.Configuration;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.helpers.NamingContext;
-import org.jboss.soa.esb.util.Util;
-
-/**
- * JSM Routing Action Processor.
- * <p/>
- * Sample Action Configuration:
- * <pre>
- * &lt;action class="org.jboss.soa.esb.actions.routing.JMSRouter"&gt;
- *     jndiName="queue/A"
- *     message-prop-<i>&gt;prop-name&lt;</i>="<i>&gt;prop-value&lt;</i>" &gt;!-- (Optional)--&lt; 
- *     unwrap="true/false" &gt;!-- (Optional - default false)--&lt;
- * /&gt;
- * </pre>
- * Note how properties to be set on the message are prefixed with "message-prop-".
- * <p/>
- * To unwrap the message payload from the message before routing, set the "unwrap" property to "true".
- * TODO: Add support for JMS Topic destinations.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class JMSRouter extends AbstractRouter {
-    /**
-     * Logger.
-     */
-    private static Logger logger = Logger.getLogger(JMSRouter.class);
-    /**
-     * Routing properties.
-     */
-    private List<KeyValuePair> properties;
-    /**
-     * JMS Queue setup.
-     */
-    private JMSSendQueueSetup queueSetup;
-    
-    /**
-     * Public constructor.
-     * @param propertiesTree Action properties.
-     * @throws ConfigurationException Queue name not configured.
-     * @throws JMSException Unable to configure JMS destination.
-     * @throws NamingException Unable to configure JMS destination.
-     */
-    public JMSRouter(ConfigTree propertiesTree) throws ConfigurationException, NamingException, JMSException {
-    	this("JMSRouter", propertiesTree.attributesAsList());
-    }
-
-    /**
-     * Public constructor.
-     * @param actionName Action name.
-     * @param properties Action properties.
-     * @throws ConfigurationException Queue name not configured.
-     * @throws JMSException Unable to configure JMS destination.
-     * @throws NamingException Unable to configure JMS destination.
-     */
-    public JMSRouter(String actionName, List<KeyValuePair> properties) throws ConfigurationException {
-    	super(actionName, properties);
-    	
-        this.properties = properties;
-        
-        String queueName = KeyValuePair.getValue("jndiName", properties);
-        if(queueName == null) {
-            throw new ConfigurationException("JMSRouter must specify a 'jndiName' property.");
-        }
-        try {
-			queueSetup = new JMSSendQueueSetup(queueName);
-		} catch (Throwable t) {
-			new ConfigurationException("Failed to configure JMS Queue for routing.", t);
-		}
-        this.properties = properties;
-    }
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.routing.AbstractRouter#route(java.lang.Object)
-     */
-    public void route(Object message) throws ActionProcessingException {
-    	
-        if(!(message instanceof Serializable) && !(message instanceof org.jboss.soa.esb.message.Message)) {
-            throw new ActionProcessingException("Cannot send Object [" + message.getClass().getName() + "] to destination [" + queueSetup.queueName + "]. Object must be serializable.");
-        }
-        
-        try {
-        	Message jmsMessage = null;
-        	
-            // Send the message to the queue...
-            if (message instanceof org.jboss.soa.esb.message.Message) {
-            	message = Util.serialize((org.jboss.soa.esb.message.Message)message);
-            	jmsMessage = createObjectMessage(message);
-            } else if(message instanceof String) {
-            	jmsMessage = queueSetup.jmsSession.createTextMessage();
-    
-                if(logger.isDebugEnabled()) {
-                    logger.debug("Sending Text message: [" + message + "] to destination [" + queueSetup.queueName + "].");
-                }
-                ((TextMessage)jmsMessage).setText((String)message);
-            } else if(message instanceof byte[]) {
-            	jmsMessage = queueSetup.jmsSession.createBytesMessage();
-                
-                if(logger.isDebugEnabled()) {
-                    logger.debug("Sending byte[] message: [" + message + "] to destination [" + queueSetup.queueName + "].");
-                }
-                ((BytesMessage)jmsMessage).writeBytes((byte[])message);
-            } else {
-            	jmsMessage = createObjectMessage(message);
-            }
-            setStringProperties(jmsMessage);
-            queueSetup.jmsProducer.send(jmsMessage);
-        } catch(Exception e) {
-            String errorMessage = "Exception while sending message [" + message + "] to destination [";
-            
-            if (queueSetup != null)
-            	errorMessage += queueSetup.queueName + "].";
-            else
-            	errorMessage += "null ].";
-            
-            logger.error(errorMessage, e);
-            throw new ActionProcessingException(errorMessage, e);
-        }
-    }
-
-	private Message createObjectMessage(Object message) throws JMSException {
-		Message jmsMessage;
-		jmsMessage = queueSetup.jmsSession.createObjectMessage();
-		
-		if(logger.isDebugEnabled()) {
-		    logger.debug("Sending Object message: [" + message + "] to destination [" + queueSetup.queueName + "].");
-		}
-		((ObjectMessage)jmsMessage).setObject((Serializable) message);
-		return jmsMessage;
-	}
-
-    private void setStringProperties(Message msg) throws JMSException {
-        String messagePropPrefix = "message-prop-";
-
-        for(KeyValuePair property : properties) {
-            String key = property.getKey();
-            
-            if(key.startsWith(messagePropPrefix) && key.length() > messagePropPrefix.length()) {
-                msg.setStringProperty(key.substring(messagePropPrefix.length()), property.getValue());
-            }
-        }
-    }
-    
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#getOkNotification(java.lang.Object)
-     */
-    public Serializable getOkNotification(org.jboss.soa.esb.message.Message message) {
-        return null;
-    }
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#getErrorNotification(java.lang.Object)
-     */
-    public Serializable getErrorNotification(org.jboss.soa.esb.message.Message message) {
-        return null;
-    }
-
-    @Override
-    protected void finalize() throws Throwable {
-        queueSetup.close();
-        super.finalize();
-    }
-    
-    private static class JMSSendQueueSetup {
-        QueueSession jmsSession;
-        Queue jmsQueue;
-        MessageProducer jmsProducer;
-        String queueName;
-        JmsConnectionPool pool;
-        
-        // TODO: Modify to support topic destinations too
-
-        private JMSSendQueueSetup(String queueName) throws NamingException, JMSException, ConnectionException  {
-            Properties environment = new Properties();
-            environment.setProperty(Context.PROVIDER_URL, Configuration.getJndiServerURL());
-            environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, Configuration.getJndiServerContextFactory());
-            environment.setProperty(Context.URL_PKG_PREFIXES, Configuration.getJndiServerPkgPrefix());
-            Context oCtx = NamingContext.getServerContext(environment);
-            pool = JmsConnectionPoolContainer.getPool(environment, "ConnectionFactory", JMSEpr.QUEUE_TYPE);
-            
-            this.queueName = queueName;
-            
-            try {
-                jmsSession = pool.getQueueSession();
-            	jmsQueue = (Queue) oCtx.lookup(queueName);
-            } catch (NamingException ne) {
-                try {
-                    oCtx = NamingContext.getFreshServerContext(environment);
-                    jmsQueue = (Queue) oCtx.lookup(queueName);
-                } catch (NamingException nex) {
-                    //ActiveMQ
-                    jmsQueue = jmsSession.createQueue(queueName);
-                }
-            }
-            jmsProducer = jmsSession.createSender(jmsQueue);            
-        }
-        
-        private void close() {
-            try {
-                if (jmsProducer!=null) jmsProducer.close();
-                pool.closeSession(jmsSession);
-            } catch (Exception e) {
-                logger.error("Unable to close JMS Queue Setup.", e);
-            }
-        }
-    }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/routing/JMSRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,256 @@
+/*
+ * 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.Serializable;
+import java.util.List;
+import java.util.Properties;
+
+import javax.jms.BytesMessage;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+import javax.jms.ObjectMessage;
+import javax.jms.Queue;
+import javax.jms.QueueSession;
+import javax.jms.TextMessage;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.helpers.NamingContext;
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * JSM Routing Action Processor.
+ * <p/>
+ * Sample Action Configuration:
+ * <pre>
+ * &lt;action class="org.jboss.soa.esb.actions.routing.JMSRouter"&gt;
+ *     jndiName="queue/A"
+ *     message-prop-<i>&gt;prop-name&lt;</i>="<i>&gt;prop-value&lt;</i>" &gt;!-- (Optional)--&lt; 
+ *     unwrap="true/false" &gt;!-- (Optional - default false)--&lt;
+ * /&gt;
+ * </pre>
+ * Note how properties to be set on the message are prefixed with "message-prop-".
+ * <p/>
+ * To unwrap the message payload from the message before routing, set the "unwrap" property to "true".
+ * TODO: Add support for JMS Topic destinations.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class JMSRouter extends AbstractRouter {
+    /**
+     * Logger.
+     */
+    private static Logger logger = Logger.getLogger(JMSRouter.class);
+    /**
+     * Routing properties.
+     */
+    private List<KeyValuePair> properties;
+    /**
+     * JMS Queue setup.
+     */
+    private JMSSendQueueSetup queueSetup;
+    
+    /**
+     * Public constructor.
+     * @param propertiesTree Action properties.
+     * @throws ConfigurationException Queue name not configured.
+     * @throws JMSException Unable to configure JMS destination.
+     * @throws NamingException Unable to configure JMS destination.
+     */
+    public JMSRouter(ConfigTree propertiesTree) throws ConfigurationException, NamingException, JMSException {
+    	this("JMSRouter", propertiesTree.attributesAsList());
+    }
+
+    /**
+     * Public constructor.
+     * @param actionName Action name.
+     * @param properties Action properties.
+     * @throws ConfigurationException Queue name not configured.
+     * @throws JMSException Unable to configure JMS destination.
+     * @throws NamingException Unable to configure JMS destination.
+     */
+    public JMSRouter(String actionName, List<KeyValuePair> properties) throws ConfigurationException {
+    	super(actionName, properties);
+    	
+        this.properties = properties;
+        
+        String queueName = KeyValuePair.getValue("jndiName", properties);
+        if(queueName == null) {
+            throw new ConfigurationException("JMSRouter must specify a 'jndiName' property.");
+        }
+        try {
+			queueSetup = new JMSSendQueueSetup(queueName);
+		} catch (Throwable t) {
+			new ConfigurationException("Failed to configure JMS Queue for routing.", t);
+		}
+        this.properties = properties;
+    }
+
+    /* (non-Javadoc)
+     * @see org.jboss.soa.esb.actions.routing.AbstractRouter#route(java.lang.Object)
+     */
+    public void route(Object message) throws ActionProcessingException {
+    	
+        if(!(message instanceof Serializable) && !(message instanceof org.jboss.soa.esb.message.Message)) {
+            throw new ActionProcessingException("Cannot send Object [" + message.getClass().getName() + "] to destination [" + queueSetup.queueName + "]. Object must be serializable.");
+        }
+        
+        try {
+        	Message jmsMessage = null;
+        	
+            // Send the message to the queue...
+            if (message instanceof org.jboss.soa.esb.message.Message) {
+            	message = Util.serialize((org.jboss.soa.esb.message.Message)message);
+            	jmsMessage = createObjectMessage(message);
+            } else if(message instanceof String) {
+            	jmsMessage = queueSetup.jmsSession.createTextMessage();
+    
+                if(logger.isDebugEnabled()) {
+                    logger.debug("Sending Text message: [" + message + "] to destination [" + queueSetup.queueName + "].");
+                }
+                ((TextMessage)jmsMessage).setText((String)message);
+            } else if(message instanceof byte[]) {
+            	jmsMessage = queueSetup.jmsSession.createBytesMessage();
+                
+                if(logger.isDebugEnabled()) {
+                    logger.debug("Sending byte[] message: [" + message + "] to destination [" + queueSetup.queueName + "].");
+                }
+                ((BytesMessage)jmsMessage).writeBytes((byte[])message);
+            } else {
+            	jmsMessage = createObjectMessage(message);
+            }
+            setStringProperties(jmsMessage);
+            queueSetup.jmsProducer.send(jmsMessage);
+        } catch(Exception e) {
+            String errorMessage = "Exception while sending message [" + message + "] to destination [";
+            
+            if (queueSetup != null)
+            	errorMessage += queueSetup.queueName + "].";
+            else
+            	errorMessage += "null ].";
+            
+            logger.error(errorMessage, e);
+            throw new ActionProcessingException(errorMessage, e);
+        }
+    }
+
+	private Message createObjectMessage(Object message) throws JMSException {
+		Message jmsMessage;
+		jmsMessage = queueSetup.jmsSession.createObjectMessage();
+		
+		if(logger.isDebugEnabled()) {
+		    logger.debug("Sending Object message: [" + message + "] to destination [" + queueSetup.queueName + "].");
+		}
+		((ObjectMessage)jmsMessage).setObject((Serializable) message);
+		return jmsMessage;
+	}
+
+    private void setStringProperties(Message msg) throws JMSException {
+        String messagePropPrefix = "message-prop-";
+
+        for(KeyValuePair property : properties) {
+            String key = property.getKey();
+            
+            if(key.startsWith(messagePropPrefix) && key.length() > messagePropPrefix.length()) {
+                msg.setStringProperty(key.substring(messagePropPrefix.length()), property.getValue());
+            }
+        }
+    }
+    
+    /* (non-Javadoc)
+     * @see org.jboss.soa.esb.actions.ActionProcessor#getOkNotification(java.lang.Object)
+     */
+    public Serializable getOkNotification(org.jboss.soa.esb.message.Message message) {
+        return null;
+    }
+
+    /* (non-Javadoc)
+     * @see org.jboss.soa.esb.actions.ActionProcessor#getErrorNotification(java.lang.Object)
+     */
+    public Serializable getErrorNotification(org.jboss.soa.esb.message.Message message) {
+        return null;
+    }
+
+    @Override
+    protected void finalize() throws Throwable {
+        queueSetup.close();
+        super.finalize();
+    }
+    
+    private static class JMSSendQueueSetup {
+        QueueSession jmsSession;
+        Queue jmsQueue;
+        MessageProducer jmsProducer;
+        String queueName;
+        JmsConnectionPool pool;
+        
+        // TODO: Modify to support topic destinations too
+
+        private JMSSendQueueSetup(String queueName) throws NamingException, JMSException, ConnectionException  {
+            Properties environment = new Properties();
+            environment.setProperty(Context.PROVIDER_URL, Configuration.getJndiServerURL());
+            environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, Configuration.getJndiServerContextFactory());
+            environment.setProperty(Context.URL_PKG_PREFIXES, Configuration.getJndiServerPkgPrefix());
+            Context oCtx = NamingContext.getServerContext(environment);
+            pool = JmsConnectionPoolContainer.getPool(environment, "ConnectionFactory", JMSEpr.QUEUE_TYPE);
+            
+            this.queueName = queueName;
+            
+            try {
+                jmsSession = pool.getQueueSession();
+            	jmsQueue = (Queue) oCtx.lookup(queueName);
+            } catch (NamingException ne) {
+                try {
+                    oCtx = NamingContext.getFreshServerContext(environment);
+                    jmsQueue = (Queue) oCtx.lookup(queueName);
+                } catch (NamingException nex) {
+                    //ActiveMQ
+                    jmsQueue = jmsSession.createQueue(queueName);
+                }
+            }
+            jmsProducer = jmsSession.createSender(jmsQueue);            
+        }
+        
+        private void close() {
+            try {
+                if (jmsProducer!=null) jmsProducer.close();
+                pool.closeSession(jmsSession);
+            } catch (Exception e) {
+                logger.error("Unable to close JMS Queue Setup.", e);
+            }
+        }
+    }
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,168 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.actions.scripting;
-
-import groovy.lang.Binding;
-import groovy.lang.GroovyShell;
-import groovy.util.GroovyScriptEngine;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * <a href="http://groovy.codehaus.org">Groovy</a> Scripting action processor.
- * <p/>
- * <pre>
- * &lt;action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor"&gt;
- *     &lt;property name="script" value="/scripts/helloWorld.groovy" /&gt;
- * &lt;/action&gt;
- * </pre>
- * <p/>
- * The {@link Message message} is bound on the script under the name "message" and the
- * {@link ConfigTree configuration} is bound under the name "config".
- * <p/>
- * The script can also be supplied to this action as the message payload, allowing you to
- * dynamically supply the action with script.
- *
- * @author Gregory Pierce.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class GroovyActionProcessor implements ActionPipelineProcessor {
-
-    private static Logger logger = Logger.getLogger(GroovyActionProcessor.class);
-    protected ConfigTree configTree;
-    protected GroovyScriptEngine scriptEngine;
-    private String script;
-
-    public GroovyActionProcessor(ConfigTree config) throws ConfigurationException {
-        this.configTree = config;
-    }
-
-    public void initialise() throws ActionLifecycleException {
-        String scriptPath = configTree.getAttribute("script");
-
-        if(scriptPath == null) {
-            logger.info("No Groovy script specified on action config " + configTree.getAttribute("name")
-                    + ". Expecting Groovy script to be in message.");
-        } else {
-            try {
-                script = GroovyActionProcessor.getScriptFromClasspath(scriptPath);
-            } catch (IOException e) {
-                throw new ActionLifecycleException("Error reading script '" + scriptPath + "' stream.");
-            }
-        }
-    }
-
-    /**
-     * Get the input stream for the Groovy script (from the classpath).
-     * @param scriptPath The script classpath.
-     * @return An input
-     */
-    public static String getScriptFromClasspath(String scriptPath) throws IOException {
-        InputStream scriptStream;
-
-        scriptStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptPath);
-        if(scriptStream == null) {
-            scriptStream = ClassUtil.getResourceAsStream(scriptPath, GroovyActionProcessor.class);
-            if(scriptStream == null) {
-                throw new IOException("Script '" + scriptPath + "' not found on classpath.");
-            }
-        }
-
-        try {
-            return new String(StreamUtils.readStream(scriptStream));
-        } finally {
-            try {
-                if(scriptStream != null) {
-                    scriptStream.close();
-                }
-            } catch (IOException e) {
-                throw new IOException("Failed to close script '" + scriptPath + "' stream.");
-            }
-        }
-    }
-
-    public void destroy() throws ActionLifecycleException {
-    }
-    
-    /**
-     * Processes an ESB message. Configuration is via two properties of this ESB element
-     * scriptPath - The path to the script that will be run
-     * script - the name of the script that will be run (include .groovy exception)
-     */
-    public Message process(Message message) throws ActionProcessingException {
-        try {
-            // create a Java/Groovy binding for the message object
-            //
-            Binding binding = new Binding();
-
-            // binds the message object to the script with a variable name of 'message'
-            //
-            binding.setVariable("message", message);
-            binding.setVariable("config", configTree);
-
-            GroovyShell shell = new GroovyShell(Thread.currentThread().getContextClassLoader(), binding);
-            Object returnVal = shell.evaluate(getScript(message));
-
-            if(returnVal instanceof Message) {
-                return (Message) returnVal;
-            } else {
-                return message;
-            }
-        }
-        catch (Exception e) {
-            logger.error("Error executing Groovy script.", e);
-            return message;
-		}
-	}
-
-    private String getScript(Message message) throws ActionProcessingException {
-        if(script != null) {
-            return script;
-        } else {
-            // So, the script is being passed in in the message...            
-            Object messageScript = ActionUtils.getTaskObject(message);
-            if(messageScript instanceof String) {
-                return (String)messageScript;
-            } else if(messageScript instanceof byte[]) {
-                return new String((byte[])messageScript);
-            } else {
-                throw new ActionProcessingException("Groovy script not specified in message.");
-            }
-        }
-    }
-
-    public void processException(final Message message, final Throwable th) {
-    }
-
-    public void processSuccess(final Message message) {
-    }
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,168 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions.scripting;
+
+import groovy.lang.Binding;
+import groovy.lang.GroovyShell;
+import groovy.util.GroovyScriptEngine;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * <a href="http://groovy.codehaus.org">Groovy</a> Scripting action processor.
+ * <p/>
+ * <pre>
+ * &lt;action name="groovy" class="org.jboss.soa.esb.actions.scripting.GroovyActionProcessor"&gt;
+ *     &lt;property name="script" value="/scripts/helloWorld.groovy" /&gt;
+ * &lt;/action&gt;
+ * </pre>
+ * <p/>
+ * The {@link Message message} is bound on the script under the name "message" and the
+ * {@link ConfigTree configuration} is bound under the name "config".
+ * <p/>
+ * The script can also be supplied to this action as the message payload, allowing you to
+ * dynamically supply the action with script.
+ *
+ * @author Gregory Pierce.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class GroovyActionProcessor implements ActionPipelineProcessor {
+
+    private static Logger logger = Logger.getLogger(GroovyActionProcessor.class);
+    protected ConfigTree configTree;
+    protected GroovyScriptEngine scriptEngine;
+    private String script;
+
+    public GroovyActionProcessor(ConfigTree config) throws ConfigurationException {
+        this.configTree = config;
+    }
+
+    public void initialise() throws ActionLifecycleException {
+        String scriptPath = configTree.getAttribute("script");
+
+        if(scriptPath == null) {
+            logger.info("No Groovy script specified on action config " + configTree.getAttribute("name")
+                    + ". Expecting Groovy script to be in message.");
+        } else {
+            try {
+                script = GroovyActionProcessor.getScriptFromClasspath(scriptPath);
+            } catch (IOException e) {
+                throw new ActionLifecycleException("Error reading script '" + scriptPath + "' stream.");
+            }
+        }
+    }
+
+    /**
+     * Get the input stream for the Groovy script (from the classpath).
+     * @param scriptPath The script classpath.
+     * @return An input
+     */
+    public static String getScriptFromClasspath(String scriptPath) throws IOException {
+        InputStream scriptStream;
+
+        scriptStream = Thread.currentThread().getContextClassLoader().getResourceAsStream(scriptPath);
+        if(scriptStream == null) {
+            scriptStream = ClassUtil.getResourceAsStream(scriptPath, GroovyActionProcessor.class);
+            if(scriptStream == null) {
+                throw new IOException("Script '" + scriptPath + "' not found on classpath.");
+            }
+        }
+
+        try {
+            return new String(StreamUtils.readStream(scriptStream));
+        } finally {
+            try {
+                if(scriptStream != null) {
+                    scriptStream.close();
+                }
+            } catch (IOException e) {
+                throw new IOException("Failed to close script '" + scriptPath + "' stream.");
+            }
+        }
+    }
+
+    public void destroy() throws ActionLifecycleException {
+    }
+    
+    /**
+     * Processes an ESB message. Configuration is via two properties of this ESB element
+     * scriptPath - The path to the script that will be run
+     * script - the name of the script that will be run (include .groovy exception)
+     */
+    public Message process(Message message) throws ActionProcessingException {
+        try {
+            // create a Java/Groovy binding for the message object
+            //
+            Binding binding = new Binding();
+
+            // binds the message object to the script with a variable name of 'message'
+            //
+            binding.setVariable("message", message);
+            binding.setVariable("config", configTree);
+
+            GroovyShell shell = new GroovyShell(Thread.currentThread().getContextClassLoader(), binding);
+            Object returnVal = shell.evaluate(getScript(message));
+
+            if(returnVal instanceof Message) {
+                return (Message) returnVal;
+            } else {
+                return message;
+            }
+        }
+        catch (Exception e) {
+            logger.error("Error executing Groovy script.", e);
+            return message;
+		}
+	}
+
+    private String getScript(Message message) throws ActionProcessingException {
+        if(script != null) {
+            return script;
+        } else {
+            // So, the script is being passed in in the message...            
+            Object messageScript = ActionUtils.getTaskObject(message);
+            if(messageScript instanceof String) {
+                return (String)messageScript;
+            } else if(messageScript instanceof byte[]) {
+                return new String((byte[])messageScript);
+            } else {
+                throw new ActionProcessingException("Groovy script not specified in message.");
+            }
+        }
+    }
+
+    public void processException(final Message message, final Throwable th) {
+    }
+
+    public void processSuccess(final Message message) {
+    }
+}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockAction.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockAction.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,67 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.actions.templates;
-
-import java.text.SimpleDateFormat;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.Util;
-
-
-/**
- * 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 MockAction 
-{
-    /**
-     * Class Logger.
-     */
-    private static Logger logger = Logger.getLogger(MockAction.class);
-
-    public Message process(Message message) 
-    {
-    	Object oCurr = null;
-    	if (null==message)
-    		oCurr = "null";
-    	else
-	    	try { oCurr = Util.serialize(message); }
-	    	catch (Exception e) 
-	    		{ oCurr = message.toString();}
-        logger.info(getStamp() + " process was called with <<" + oCurr.toString() + ">>");
-        return message;
-    } // ________________________________
-
-    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()));
-    }
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockAction.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockAction.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockAction.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,67 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.actions.templates;
+
+import java.text.SimpleDateFormat;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.Util;
+
+
+/**
+ * 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 MockAction 
+{
+    /**
+     * Class Logger.
+     */
+    private static Logger logger = Logger.getLogger(MockAction.class);
+
+    public Message process(Message message) 
+    {
+    	Object oCurr = null;
+    	if (null==message)
+    		oCurr = "null";
+    	else
+	    	try { oCurr = Util.serialize(message); }
+	    	catch (Exception e) 
+	    		{ oCurr = message.toString();}
+        logger.info(getStamp() + " process was called with <<" + oCurr.toString() + ">>");
+        return message;
+    } // ________________________________
+
+    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()));
+    }
+
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockComposer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockComposer.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockComposer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,62 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.actions.templates;
-
-import java.text.SimpleDateFormat;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
-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 
- * 
- * @author Esteban
- * 
- */
-public class MockComposer
-{
-    private static Logger _logger = Logger.getLogger(MockComposer.class);
-
-    public Message composeEmptyMessage(Object obj) 
-    {
-        _logger.info(getLogMessage("process was called with <<" + obj.toString() + ">>"));
-        MessageImpl message = new MessageImpl();
-        return message;
-    } // ________________________________
-
-    private SimpleDateFormat s_oTS = new SimpleDateFormat(
-            "yyyy/MM/dd hh:mm:ss.SSS");
-
-    private String getLogMessage(String text)
-    {
-    	return new StringBuilder()
-    	.append(s_oTS.format(new java.util.Date(System.currentTimeMillis())))
-    	.append(" ").append(text)
-    	.toString()
-    	;
-    }
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockComposer.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockComposer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockComposer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templates/MockComposer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,62 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.actions.templates;
+
+import java.text.SimpleDateFormat;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
+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 
+ * 
+ * @author Esteban
+ * 
+ */
+public class MockComposer
+{
+    private static Logger _logger = Logger.getLogger(MockComposer.class);
+
+    public Message composeEmptyMessage(Object obj) 
+    {
+        _logger.info(getLogMessage("process was called with <<" + obj.toString() + ">>"));
+        MessageImpl message = new MessageImpl();
+        return message;
+    } // ________________________________
+
+    private SimpleDateFormat s_oTS = new SimpleDateFormat(
+            "yyyy/MM/dd hh:mm:ss.SSS");
+
+    private String getLogMessage(String text)
+    {
+    	return new StringBuilder()
+    	.append(s_oTS.format(new java.util.Date(System.currentTimeMillis())))
+    	.append(" ").append(text)
+    	.toString()
+    	;
+    }
+
+} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,50 +0,0 @@
-package org.jboss.soa.esb.actions.templating;
-
-import java.util.Map;
-
-import org.antlr.stringtemplate.StringTemplate;
-import org.antlr.stringtemplate.StringTemplateGroup;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * <a href="http://www.stringtemplate.org">StringTemplate</a> Processor.
- * <p/>
- * Code supplied by the <a href="http://milyn.codehaus.org/Smooks">Milyn Smooks</a> project.
- *
- * @author John Doe
- */
-public class StringTemplateProcessor extends AbstractActionPipelineProcessor {
-
-    private StringTemplate template;
-
-    public StringTemplateProcessor(ConfigTree config) {
-        String path = config.getAttribute("template");
-        String encoding = config.getAttribute("encoding", "UTF-8");
-
-        if(path.charAt(0) == '/') {
-            path = path.substring(1);
-        }
-        if(path.endsWith(".st")) {
-            path = path.substring(0, path.length() - 3);
-        }
-
-        StringTemplateGroup templateGroup = new StringTemplateGroup(path);
-        templateGroup.setFileCharEncoding(encoding);
-        template = templateGroup.getInstanceOf(path);
-    }
-
-    public Message process(final Message message) throws ActionProcessingException {
-        // First thing we do is clone the template for this message...
-        StringTemplate thisTransTemplate = template.getInstanceOf();
-        Map beans = (Map) message.getBody().get();
-
-        // Set the document data beans on the template and apply it...
-        thisTransTemplate.setAttributes(beans);
-        message.getBody().add(thisTransTemplate.toString());
-
-        return message;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/actions/templating/StringTemplateProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,50 @@
+package org.jboss.soa.esb.actions.templating;
+
+import java.util.Map;
+
+import org.antlr.stringtemplate.StringTemplate;
+import org.antlr.stringtemplate.StringTemplateGroup;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * <a href="http://www.stringtemplate.org">StringTemplate</a> Processor.
+ * <p/>
+ * Code supplied by the <a href="http://milyn.codehaus.org/Smooks">Milyn Smooks</a> project.
+ *
+ * @author John Doe
+ */
+public class StringTemplateProcessor extends AbstractActionPipelineProcessor {
+
+    private StringTemplate template;
+
+    public StringTemplateProcessor(ConfigTree config) {
+        String path = config.getAttribute("template");
+        String encoding = config.getAttribute("encoding", "UTF-8");
+
+        if(path.charAt(0) == '/') {
+            path = path.substring(1);
+        }
+        if(path.endsWith(".st")) {
+            path = path.substring(0, path.length() - 3);
+        }
+
+        StringTemplateGroup templateGroup = new StringTemplateGroup(path);
+        templateGroup.setFileCharEncoding(encoding);
+        template = templateGroup.getInstanceOf(path);
+    }
+
+    public Message process(final Message message) throws ActionProcessingException {
+        // First thing we do is clone the template for this message...
+        StringTemplate thisTransTemplate = template.getInstanceOf();
+        Map beans = (Map) message.getBody().get();
+
+        // Set the document data beans on the template and apply it...
+        thisTransTemplate.setAttributes(beans);
+        message.getBody().add(thisTransTemplate.toString());
+
+        return message;
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,276 +0,0 @@
-package org.jboss.soa.esb.addressing;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-/**
- * Represents an interaction pattern for a specific message exchange. When sending a message
- * the sender application can specify where errors are to be returned, where responses are
- * to go, along with other interaction information.
- * 
- * A call represents an exchange pattern for this message. It is built up as the message
- * flows through the ESB and identifies where the message should go, along with any
- * routing information for faults, replies etc.
- *
- * 
- * To: the destination. MANDATORY.
- * From: the sender. OPTIONAL. If not defined, then the sender MAY be inferred from the transport.
- * ReplyTo: the destination for any response. OPTIONAL.
- * FaultTo: the destination for any error message. OPTIONAL.
- * RelatesTo: used to indicate that this message is related to another. OPTIONAL.
- * Action: used by the sender to indicate the semantics of the message. Must be unique. MANDATORY.
- * MessageID: used to uniquely identify this message. OPTIONAL.
- * 
- * @author marklittle
- *
- */
-
-// TODO maybe this should simply go into the Header interface?
-
-public class Call
-{
-	/**
-	 * Create a new (empty) call.
-	 */
-	
-	public Call ()
-	{
-	}
-	
-	/**
-	 * Create a new call, whose To field is set to the supplied EPR.
-	 * 
-	 * @param epr the To field.
-	 */
-	
-	public Call (EPR epr)
-	{
-		_to = epr;
-	}
-	
-	/**
-	 * Set the To field. Must not be null.
-	 * 
-	 * @param epr the To field value.
-	 */
-	
-	public void setTo (EPR epr)
-	{
-		if (epr == null)
-			throw new IllegalArgumentException();
-		
-		_to = epr;
-	}
-	
-	/**
-	 * @return the To field.
-	 */
-	
-	public EPR getTo ()
-	{
-		return _to;
-	}
-	
-	/**
-	 * Set the From field. May be null.
-	 * 
-	 * @param from the value of the field.
-	 */
-	
-	public void setFrom (EPR from)
-	{
-		_from = from;
-	}
-	
-	/**
-	 * @return the From field.
-	 * @throws URISyntaxException thrown if the address is invalid.
-	 */
-	
-	public EPR getFrom ()
-	{
-		return _from;
-	}
-	
-	/**
-	 * Set the ReplyTo field. May be null.
-	 * 
-	 * @param replyTo the value of the field.
-	 */
-	
-	public void setReplyTo (EPR replyTo)
-	{
-		_replyTo = replyTo;
-	}
-	
-	/**
-	 * @return the ReplyTo field.
-	 * @throws URISyntaxException thrown if the address is invalid.
-	 */
-	
-	public EPR getReplyTo ()
-	{
-		return _replyTo;
-	}
-	
-	/**
-	 * Set the FaultTo field. May be null.
-	 * 
-	 * @param uri the value of the field.
-	 */
-	
-	public void setFaultTo (EPR uri)
-	{
-		_faultTo = uri;
-	}
-	
-	/**
-	 * @return the FaultTo field.
-	 */
-	
-	public EPR getFaultTo ()
-	{
-		return _faultTo;
-	}
-	
-	/**
-	 * Set the RelatesTo field.
-	 * 
-	 * @param uri the value to set.
-	 */
-	
-	public void setRelatesTo (URI uri)
-	{
-		_relatesTo = uri;
-	}
-	
-	/**
-	 * @return the RelatesTo field.
-	 */
-	
-	public URI getRelatesTo ()
-	{
-		return _relatesTo;
-	}
-	
-	/**
-	 * Set the Action field.
-	 * @param uri the value to set.
-	 */
-	
-	public void setAction (URI uri)
-	{
-		_action = uri;
-	}
-
-	/**
-	 * @return the Action field.
-	 */
-	public URI getAction ()
-	{
-		return _action;
-	}
-	
-	/**
-	 * Set the MessageId for this instance.
-	 * 
-	 * @param uri the value to use.
-	 */
-	
-	public void setMessageID (URI uri)
-	{
-		_messageID = uri;
-	}
-	
-	/**
-	 * @return the MessageID field.
-	 */
-	
-	public URI getMessageID ()
-	{
-		return _messageID;
-	}
-	
-	public final boolean empty ()
-	{
-		if ((_to == null) && (_from == null) && (_replyTo == null))
-		{
-			if ((_relatesTo == null) && (_faultTo == null) && (_action == null) && (_messageID == null))
-				return true;
-		}
-		
-		return false;
-	}
-	
-	/**
-	 * Copy the instance specified.
-	 * 
-	 * @param from the instance to copy.
-	 */
-	
-	public void copy (Call from)
-	{
-		Call fromImpl = (Call) from;
-		
-		_to = fromImpl._to;
-		_from = fromImpl._from;
-		_replyTo = fromImpl._replyTo;
-		_relatesTo = fromImpl._relatesTo;
-		_faultTo = fromImpl._faultTo;
-		_action = fromImpl._action;
-		_messageID = fromImpl._messageID;
-	}
-	
-//	public void setMetaData (MetaData md);
-//	public MetaData getMetaData ();
-//	public void addReferenceParameter (...);
-	
-	public String toString ()
-	{
-		return "To: "+_to+", From: "+_from+", ReplyTo: "+_replyTo+", FaultTo: "+_faultTo+", Action: "+_action+", MessageID: "+_messageID+", RelatesTo: "+_relatesTo;
-	}
-	
-	/**
-	 * This instance is valid if all mandatory elements are set.
-	 * 
-	 * @return <code>true</code> if all mandatory elements are set, <code>false</code> otherwise.
-	 */
-	
-	public boolean valid ()
-	{
-		if ((_to != null) && (_action != null))
-			return true;
-		else
-			return false;
-	}
-	
-	private EPR _to = null;
-	private EPR _from = null;
-	private EPR _faultTo = null;
-	private EPR _replyTo = null;
-	private URI _relatesTo = null;
-	private URI _action = null;
-	private URI _messageID = null;
-	
-} 

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/Call.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,276 @@
+package org.jboss.soa.esb.addressing;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+/**
+ * Represents an interaction pattern for a specific message exchange. When sending a message
+ * the sender application can specify where errors are to be returned, where responses are
+ * to go, along with other interaction information.
+ * 
+ * A call represents an exchange pattern for this message. It is built up as the message
+ * flows through the ESB and identifies where the message should go, along with any
+ * routing information for faults, replies etc.
+ *
+ * 
+ * To: the destination. MANDATORY.
+ * From: the sender. OPTIONAL. If not defined, then the sender MAY be inferred from the transport.
+ * ReplyTo: the destination for any response. OPTIONAL.
+ * FaultTo: the destination for any error message. OPTIONAL.
+ * RelatesTo: used to indicate that this message is related to another. OPTIONAL.
+ * Action: used by the sender to indicate the semantics of the message. Must be unique. MANDATORY.
+ * MessageID: used to uniquely identify this message. OPTIONAL.
+ * 
+ * @author marklittle
+ *
+ */
+
+// TODO maybe this should simply go into the Header interface?
+
+public class Call
+{
+	/**
+	 * Create a new (empty) call.
+	 */
+	
+	public Call ()
+	{
+	}
+	
+	/**
+	 * Create a new call, whose To field is set to the supplied EPR.
+	 * 
+	 * @param epr the To field.
+	 */
+	
+	public Call (EPR epr)
+	{
+		_to = epr;
+	}
+	
+	/**
+	 * Set the To field. Must not be null.
+	 * 
+	 * @param epr the To field value.
+	 */
+	
+	public void setTo (EPR epr)
+	{
+		if (epr == null)
+			throw new IllegalArgumentException();
+		
+		_to = epr;
+	}
+	
+	/**
+	 * @return the To field.
+	 */
+	
+	public EPR getTo ()
+	{
+		return _to;
+	}
+	
+	/**
+	 * Set the From field. May be null.
+	 * 
+	 * @param from the value of the field.
+	 */
+	
+	public void setFrom (EPR from)
+	{
+		_from = from;
+	}
+	
+	/**
+	 * @return the From field.
+	 * @throws URISyntaxException thrown if the address is invalid.
+	 */
+	
+	public EPR getFrom ()
+	{
+		return _from;
+	}
+	
+	/**
+	 * Set the ReplyTo field. May be null.
+	 * 
+	 * @param replyTo the value of the field.
+	 */
+	
+	public void setReplyTo (EPR replyTo)
+	{
+		_replyTo = replyTo;
+	}
+	
+	/**
+	 * @return the ReplyTo field.
+	 * @throws URISyntaxException thrown if the address is invalid.
+	 */
+	
+	public EPR getReplyTo ()
+	{
+		return _replyTo;
+	}
+	
+	/**
+	 * Set the FaultTo field. May be null.
+	 * 
+	 * @param uri the value of the field.
+	 */
+	
+	public void setFaultTo (EPR uri)
+	{
+		_faultTo = uri;
+	}
+	
+	/**
+	 * @return the FaultTo field.
+	 */
+	
+	public EPR getFaultTo ()
+	{
+		return _faultTo;
+	}
+	
+	/**
+	 * Set the RelatesTo field.
+	 * 
+	 * @param uri the value to set.
+	 */
+	
+	public void setRelatesTo (URI uri)
+	{
+		_relatesTo = uri;
+	}
+	
+	/**
+	 * @return the RelatesTo field.
+	 */
+	
+	public URI getRelatesTo ()
+	{
+		return _relatesTo;
+	}
+	
+	/**
+	 * Set the Action field.
+	 * @param uri the value to set.
+	 */
+	
+	public void setAction (URI uri)
+	{
+		_action = uri;
+	}
+
+	/**
+	 * @return the Action field.
+	 */
+	public URI getAction ()
+	{
+		return _action;
+	}
+	
+	/**
+	 * Set the MessageId for this instance.
+	 * 
+	 * @param uri the value to use.
+	 */
+	
+	public void setMessageID (URI uri)
+	{
+		_messageID = uri;
+	}
+	
+	/**
+	 * @return the MessageID field.
+	 */
+	
+	public URI getMessageID ()
+	{
+		return _messageID;
+	}
+	
+	public final boolean empty ()
+	{
+		if ((_to == null) && (_from == null) && (_replyTo == null))
+		{
+			if ((_relatesTo == null) && (_faultTo == null) && (_action == null) && (_messageID == null))
+				return true;
+		}
+		
+		return false;
+	}
+	
+	/**
+	 * Copy the instance specified.
+	 * 
+	 * @param from the instance to copy.
+	 */
+	
+	public void copy (Call from)
+	{
+		Call fromImpl = (Call) from;
+		
+		_to = fromImpl._to;
+		_from = fromImpl._from;
+		_replyTo = fromImpl._replyTo;
+		_relatesTo = fromImpl._relatesTo;
+		_faultTo = fromImpl._faultTo;
+		_action = fromImpl._action;
+		_messageID = fromImpl._messageID;
+	}
+	
+//	public void setMetaData (MetaData md);
+//	public MetaData getMetaData ();
+//	public void addReferenceParameter (...);
+	
+	public String toString ()
+	{
+		return "To: "+_to+", From: "+_from+", ReplyTo: "+_replyTo+", FaultTo: "+_faultTo+", Action: "+_action+", MessageID: "+_messageID+", RelatesTo: "+_relatesTo;
+	}
+	
+	/**
+	 * This instance is valid if all mandatory elements are set.
+	 * 
+	 * @return <code>true</code> if all mandatory elements are set, <code>false</code> otherwise.
+	 */
+	
+	public boolean valid ()
+	{
+		if ((_to != null) && (_action != null))
+			return true;
+		else
+			return false;
+	}
+	
+	private EPR _to = null;
+	private EPR _from = null;
+	private EPR _faultTo = null;
+	private EPR _replyTo = null;
+	private URI _relatesTo = null;
+	private URI _action = null;
+	private URI _messageID = null;
+	
+} 

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,133 +0,0 @@
-package org.jboss.soa.esb.addressing;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-
-/**
- * This class represents the endpoint reference for services.
- */
-
-import java.net.URI;
-
-/**
- * The Endpoint Reference class. All services (and clients) can be represented by
- * an EPR, which is effectively an address. If using SOA principles then the ultimate
- * recipient of the message should be addressed in a loosely-coupled manner: the service
- * should multiplex/demultiplex work across "objects" based on the message content and
- * the EPR should not address a specific "object".
- * 
- * @author marklittle
- *
- */
-public class EPR
-{
-	/**
-	 * Create a new Endpoint Reference with a null address.
-	 */
-	
-	public EPR ()
-	{
-		_addr = new PortReference();
-	}
-	
-	/**
-	 * Create a new Endpoint Reference with the specified address.
-	 * 
-	 * @param addr the specified address.
-	 */
-	
-	public EPR (PortReference addr)
-	{
-		_addr = addr;
-	}
-
-	/**
-	 * Create a new Endpoint Reference with the specified address.
-	 * 
-	 * @param uri the specified address.
-	 */
-	
-	public EPR (URI uri)
-	{
-		_addr = new PortReference(uri.toString());
-	}
-	
-	/**
-	 * Override the address of this EPR.
-	 * 
-	 * @param uri the new address.
-	 */
-	
-	public void setAddr (PortReference uri)
-	{
-		_addr = uri;
-	}
-	
-	/**
-	 * Get the EPR address.
-	 * 
-	 * @return the address.
-	 */
-	
-	public PortReference getAddr ()
-	{
-		return _addr;
-	}
-
-	/**
-	 * Copy the contents of the specified EPR into this instance.
-	 * 
-	 * @param from the instance to copy.
-	 */
-	
-	public void copy (EPR from)
-	{
-		EPR fromImpl = (EPR) from;
-		
-		_addr = fromImpl._addr;
-	}
-	
-//	public void setMetaData (MetaData md);
-//	public MetaData getMetaData ();
-//	public void addReferenceParameter (...);
-	
-	public String toString ()
-	{
-		return "EPR: "+_addr.extendedToString();
-	}
-
-	public boolean equals (Object obj)
-	{
-		if (obj == this)
-			return true;
-		else
-		{
-			if (obj instanceof EPR)
-				return ((EPR) obj)._addr.equals(_addr);
-		}
-		
-		return false;
-	}
-	
-	private PortReference _addr;
-
-} 
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/EPR.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,133 @@
+package org.jboss.soa.esb.addressing;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+
+/**
+ * This class represents the endpoint reference for services.
+ */
+
+import java.net.URI;
+
+/**
+ * The Endpoint Reference class. All services (and clients) can be represented by
+ * an EPR, which is effectively an address. If using SOA principles then the ultimate
+ * recipient of the message should be addressed in a loosely-coupled manner: the service
+ * should multiplex/demultiplex work across "objects" based on the message content and
+ * the EPR should not address a specific "object".
+ * 
+ * @author marklittle
+ *
+ */
+public class EPR
+{
+	/**
+	 * Create a new Endpoint Reference with a null address.
+	 */
+	
+	public EPR ()
+	{
+		_addr = new PortReference();
+	}
+	
+	/**
+	 * Create a new Endpoint Reference with the specified address.
+	 * 
+	 * @param addr the specified address.
+	 */
+	
+	public EPR (PortReference addr)
+	{
+		_addr = addr;
+	}
+
+	/**
+	 * Create a new Endpoint Reference with the specified address.
+	 * 
+	 * @param uri the specified address.
+	 */
+	
+	public EPR (URI uri)
+	{
+		_addr = new PortReference(uri.toString());
+	}
+	
+	/**
+	 * Override the address of this EPR.
+	 * 
+	 * @param uri the new address.
+	 */
+	
+	public void setAddr (PortReference uri)
+	{
+		_addr = uri;
+	}
+	
+	/**
+	 * Get the EPR address.
+	 * 
+	 * @return the address.
+	 */
+	
+	public PortReference getAddr ()
+	{
+		return _addr;
+	}
+
+	/**
+	 * Copy the contents of the specified EPR into this instance.
+	 * 
+	 * @param from the instance to copy.
+	 */
+	
+	public void copy (EPR from)
+	{
+		EPR fromImpl = (EPR) from;
+		
+		_addr = fromImpl._addr;
+	}
+	
+//	public void setMetaData (MetaData md);
+//	public MetaData getMetaData ();
+//	public void addReferenceParameter (...);
+	
+	public String toString ()
+	{
+		return "EPR: "+_addr.extendedToString();
+	}
+
+	public boolean equals (Object obj)
+	{
+		if (obj == this)
+			return true;
+		else
+		{
+			if (obj instanceof EPR)
+				return ((EPR) obj)._addr.equals(_addr);
+		}
+		
+		return false;
+	}
+	
+	private PortReference _addr;
+
+} 
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/MalformedEPRException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/MalformedEPRException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/MalformedEPRException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,51 +0,0 @@
-package org.jboss.soa.esb.addressing;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Thrown if the EPR is not well formed, e.g., contains incorrect information.
- */
-
-public class MalformedEPRException extends Exception
-{
-	public static final long serialVersionUID = 0xE;
-	
-	public MalformedEPRException()
-	{
-		super();
-	}
-
-	public MalformedEPRException(String s)
-	{
-		super(s);
-	}
-	
-	public MalformedEPRException(String s, Throwable ex)
-	{
-		super(s, ex);
-	}
-
-	public MalformedEPRException(Throwable ex)
-	{
-		super(ex);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/MalformedEPRException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/MalformedEPRException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/MalformedEPRException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/MalformedEPRException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,51 @@
+package org.jboss.soa.esb.addressing;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Thrown if the EPR is not well formed, e.g., contains incorrect information.
+ */
+
+public class MalformedEPRException extends Exception
+{
+	public static final long serialVersionUID = 0xE;
+	
+	public MalformedEPRException()
+	{
+		super();
+	}
+
+	public MalformedEPRException(String s)
+	{
+		super(s);
+	}
+	
+	public MalformedEPRException(String s, Throwable ex)
+	{
+		super(s, ex);
+	}
+
+	public MalformedEPRException(Throwable ex)
+	{
+		super(ex);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,396 +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 mark.little at jboss.com
- */
-
-/*
- * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
- *
- * PortReference.java
- */
-
-package org.jboss.soa.esb.addressing;
-
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * An implementation of a WS-Addressing EPR. It needs completely rewriting after
- * the interoperability workshop as it is not extensible. It's morphed with the changing WS-C/WS-T and
- * WS-Addr specifications and their quirks; now that WS-Addr is finalized the
- * old quirks no longer need to be supported so it's best to rewrite this from
- * scratch.
- * 
- * An instance of a PortReference represents a single element in WS-A.
- */
-
-public class PortReference
-{
-	public PortReference()
-	{
-	}
-
-	public PortReference(String address)
-	{
-		setAddress(address);
-	}
-
-	public void setAddress(String address)
-	{
-		_address = address;
-	}
-
-	public String getAddress()
-	{
-		return _address;
-	}
-
-	public void addExtension(PortReference.Extension extension)
-	{
-		_extensions.add(extension);
-	}
-
-	// all extensions are added as the Arjuna namespace.
-
-	public void addExtension(String value)
-	{
-		addExtension(XMLUtil.INSTANCE_IDENTIFIER_TAG, XMLUtil.JBOSSESB_PREFIX,
-				XMLUtil.JBOSSESB_NAMESPACE_URI, value,
-				Extension.REFERENCE_PROPERTIES);
-	}
-
-	public void addExtension(String tag, String value)
-	{
-		addExtension(tag, XMLUtil.JBOSSESB_PREFIX,
-				XMLUtil.JBOSSESB_NAMESPACE_URI, value,
-				Extension.REFERENCE_PROPERTIES);
-	}
-
-	/**
-	 * Define the tag, prefix and namespace URI for the extension value. The
-	 * parent is a refProperty.
-	 */
-
-	public void addExtension(String tag, String prefix, String uri, String value)
-	{
-		_extensions.add(new Extension(tag, prefix, uri, value,
-				Extension.REFERENCE_PROPERTIES));
-	}
-
-	/**
-	 * Define the tag, prefix and namespace URI for the extension value. The
-	 * parent field defines whether the attribute has a refParam, refProp or
-	 * neither as its parent.
-	 */
-
-	public void addExtension(String tag, String prefix, String uri,
-			String value, int parent)
-	{
-		_extensions.add(new Extension(tag, prefix, uri, value, parent));
-	}
-
-	// placeholders only
-
-	public void addPortType(String qName)
-	{
-	}
-
-	public void addServiceName(String portName, String qName)
-	{
-	}
-
-	public void addPolicy()
-	{
-	}
-
-	public String getExtensionValue(String tag)
-	{
-		String extensionValue = null;
-		Iterator iterator = _extensions.iterator();
-
-		while (iterator.hasNext() && (extensionValue == null))
-		{
-			Extension extension = (Extension) iterator.next();
-
-			if (tag.equals(extension.getTag()))
-				extensionValue = extension.getValue();
-		}
-
-		return extensionValue;
-	}
-
-	public Iterator<Extension> getExtensions()
-	{
-		return _extensions.iterator();
-	}
-
-	public void clearExtensions()
-	{
-		_extensions.clear();
-	}
-
-	public String toString()
-	{
-		return "PortReference < " + _address + " >";
-	}
-
-	public String extendedToString()
-	{
-		String addr = "<" + XMLUtil.WSA_PREFIX + ":Address " + _address + "/>";
-
-		Iterator extensions = getExtensions();
-
-		while (extensions.hasNext())
-		{
-			Extension ext = (Extension) extensions.next();
-
-			addr += ", <" + XMLUtil.WSA_PREFIX + ":"
-					+ XMLUtil.REFERENCE_PROPERTIES_TAG + " " + ext.getPrefix()
-					+ ":" + ext.getTag() + " : " + ext.getValue() + "/>";
-		}
-
-		return "PortReference < " + addr + " >";
-	}
-
-	/**
-	 * Is this object equal to the specified parameter?
-	 * 
-	 * @param rhs
-	 *            The rhs object.
-	 * @return true if the specified object is equal, false otherwise.
-	 */
-	public boolean equals(final Object rhs)
-	{
-		if ((rhs != null) && (rhs.getClass() == getClass()))
-		{
-			// This should really only include reference property extensions
-			final PortReference rhsPortReference = (PortReference) rhs;
-			return (equalsObject(_address, rhsPortReference._address)
-					&& equalsObject(_extensions, rhsPortReference._extensions)
-					&& equalsObject(_portType, rhsPortReference._portType)
-					&& equalsObject(_serviceName, rhsPortReference._serviceName) && equalsObject(
-					_policies, rhsPortReference._policies));
-		}
-		return false;
-	}
-
-	/**
-	 * Return the hash code for this object.
-	 * 
-	 * @return the hash code value.
-	 */
-	public int hashCode()
-	{
-		// Not checked for spread.
-		return (objectHashCode(_address, 0x1)
-				^ objectHashCode(_extensions, 0x2)
-				^ objectHashCode(_portType, 0x4)
-				^ objectHashCode(_serviceName, 0x8) ^ objectHashCode(_policies,
-				0x10));
-	}
-
-	public static class Extension
-	{
-		public static final int REFERENCE_PROPERTIES = 0;
-		public static final int REFERENCE_PARAMETERS = 1;
-		public static final int NEITHER = 2;
-
-		public Extension(String tag, String prefix, String uri)
-		{
-			this(tag, prefix, uri, null, REFERENCE_PROPERTIES);
-		}
-
-		public Extension(String tag, String prefix, String uri, String value)
-		{
-			this(tag, prefix, uri, value, REFERENCE_PROPERTIES);
-		}
-
-		public Extension(String tag, String prefix, String uri, String value,
-				int parent)
-		{
-			_tag = tag;
-			_prefix = prefix;
-			_uri = uri;
-			_value = value;
-			_parent = parent;
-			
-			/*
-			 * If XML was loaded via DOM1 then prefix and namespace won't work!
-			 */
-			
-			if (_uri == null)
-				_uri = XMLUtil.JBOSSESB_NAMESPACE_URI;
-			
-			if (_prefix == null)
-				_prefix = XMLUtil.JBOSSESB_PREFIX;
-			
-			if (_tag.contains(":"))
-			{
-				int colon = _tag.indexOf(':');
-				
-				_tag = _tag.substring(colon+1);
-			}
-		}
-
-		public int getParent()
-		{
-			return _parent;
-		}
-
-		public String getTag()
-		{
-			return _tag;
-		}
-
-		public String getPrefix()
-		{
-			return _prefix;
-		}
-
-		public String getURI()
-		{
-			return _uri;
-		}
-
-		public String getValue()
-		{
-			return _value;
-		}
-
-		public LinkedList getChildren()
-		{
-			return _extensions;
-		}
-
-		public HashMap getAttributes()
-		{
-			return _attributes;
-		}
-
-		public void addAttributes(HashMap props)
-		{
-			_attributes = props;
-		}
-
-		public void addChild(Extension child)
-		{
-			if (_extensions == null)
-				_extensions = new LinkedList<Extension>();
-
-			_extensions.add(child);
-		}
-
-		public String toString()
-		{
-			return new String("< " + _tag + ", " + _prefix + ", " + _uri + ", "
-					+ _value + " >");
-		}
-
-		/**
-		 * Is this object equal to the specified parameter (ignoring prefix)?
-		 * 
-		 * @param rhs
-		 *            The rhs object.
-		 * @return true if the specified object is equal, false otherwise.
-		 */
-		public boolean equals(final Object rhs)
-		{
-			if ((rhs != null) && (rhs.getClass() == getClass()))
-			{
-				final Extension rhsExtension = (Extension) rhs;
-				return (equalsObject(_tag, rhsExtension._tag)
-						&& equalsObject(_uri, rhsExtension._uri)
-						&& equalsObject(_value, rhsExtension._value)
-						&& equalsObject(_extensions, rhsExtension._extensions) && (_parent == rhsExtension._parent));
-			}
-			return false;
-		}
-
-		/**
-		 * Return the hash code for this object.
-		 * 
-		 * @return the hash code value.
-		 */
-		public int hashCode()
-		{
-			// Not checked for spread.
-			return (_parent ^ objectHashCode(_tag, 0x4)
-					^ objectHashCode(_uri, 0x8) ^ objectHashCode(_value, 0x10) ^ objectHashCode(
-					_extensions, 0x20));
-		}
-
-		private String _tag = null;
-
-		private String _prefix = null;
-
-		private String _uri = null;
-
-		private String _value = null;
-
-		private int _parent = NEITHER;
-
-		private LinkedList<Extension> _extensions = null;
-
-		private HashMap _attributes = null;
-
-	}
-
-	/**
-	 * Get the hash code from the object or use the default if null.
-	 * 
-	 * @param obj
-	 *            The object.
-	 * @param defaultHashCode
-	 *            The default hash code.
-	 * @return The hash code.
-	 */
-	static int objectHashCode(final Object obj, final int defaultHashCode)
-	{
-		return (obj == null ? defaultHashCode : obj.hashCode());
-	}
-
-	/**
-	 * Are the two objects equal?
-	 * 
-	 * @param lhs
-	 *            The lhs object.
-	 * @param rhs
-	 *            The rhs object.
-	 * @return true if equal or both null, false otherwise.
-	 */
-	static boolean equalsObject(final Object lhs, final Object rhs)
-	{
-		if (lhs == null)
-		{
-			return (rhs == null);
-		} else
-		{
-			return lhs.equals(rhs);
-		}
-	}
-
-	private String _address = null;
-	private LinkedList<Extension> _extensions = new LinkedList<Extension>();
-	private Extension _portType = null;
-	private Extension _serviceName = null;
-	private List _policies = null;
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/PortReference.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,396 @@
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/*
+ * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
+ *
+ * PortReference.java
+ */
+
+package org.jboss.soa.esb.addressing;
+
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.LinkedList;
+import java.util.List;
+
+/**
+ * An implementation of a WS-Addressing EPR. It needs completely rewriting after
+ * the interoperability workshop as it is not extensible. It's morphed with the changing WS-C/WS-T and
+ * WS-Addr specifications and their quirks; now that WS-Addr is finalized the
+ * old quirks no longer need to be supported so it's best to rewrite this from
+ * scratch.
+ * 
+ * An instance of a PortReference represents a single element in WS-A.
+ */
+
+public class PortReference
+{
+	public PortReference()
+	{
+	}
+
+	public PortReference(String address)
+	{
+		setAddress(address);
+	}
+
+	public void setAddress(String address)
+	{
+		_address = address;
+	}
+
+	public String getAddress()
+	{
+		return _address;
+	}
+
+	public void addExtension(PortReference.Extension extension)
+	{
+		_extensions.add(extension);
+	}
+
+	// all extensions are added as the Arjuna namespace.
+
+	public void addExtension(String value)
+	{
+		addExtension(XMLUtil.INSTANCE_IDENTIFIER_TAG, XMLUtil.JBOSSESB_PREFIX,
+				XMLUtil.JBOSSESB_NAMESPACE_URI, value,
+				Extension.REFERENCE_PROPERTIES);
+	}
+
+	public void addExtension(String tag, String value)
+	{
+		addExtension(tag, XMLUtil.JBOSSESB_PREFIX,
+				XMLUtil.JBOSSESB_NAMESPACE_URI, value,
+				Extension.REFERENCE_PROPERTIES);
+	}
+
+	/**
+	 * Define the tag, prefix and namespace URI for the extension value. The
+	 * parent is a refProperty.
+	 */
+
+	public void addExtension(String tag, String prefix, String uri, String value)
+	{
+		_extensions.add(new Extension(tag, prefix, uri, value,
+				Extension.REFERENCE_PROPERTIES));
+	}
+
+	/**
+	 * Define the tag, prefix and namespace URI for the extension value. The
+	 * parent field defines whether the attribute has a refParam, refProp or
+	 * neither as its parent.
+	 */
+
+	public void addExtension(String tag, String prefix, String uri,
+			String value, int parent)
+	{
+		_extensions.add(new Extension(tag, prefix, uri, value, parent));
+	}
+
+	// placeholders only
+
+	public void addPortType(String qName)
+	{
+	}
+
+	public void addServiceName(String portName, String qName)
+	{
+	}
+
+	public void addPolicy()
+	{
+	}
+
+	public String getExtensionValue(String tag)
+	{
+		String extensionValue = null;
+		Iterator iterator = _extensions.iterator();
+
+		while (iterator.hasNext() && (extensionValue == null))
+		{
+			Extension extension = (Extension) iterator.next();
+
+			if (tag.equals(extension.getTag()))
+				extensionValue = extension.getValue();
+		}
+
+		return extensionValue;
+	}
+
+	public Iterator<Extension> getExtensions()
+	{
+		return _extensions.iterator();
+	}
+
+	public void clearExtensions()
+	{
+		_extensions.clear();
+	}
+
+	public String toString()
+	{
+		return "PortReference < " + _address + " >";
+	}
+
+	public String extendedToString()
+	{
+		String addr = "<" + XMLUtil.WSA_PREFIX + ":Address " + _address + "/>";
+
+		Iterator extensions = getExtensions();
+
+		while (extensions.hasNext())
+		{
+			Extension ext = (Extension) extensions.next();
+
+			addr += ", <" + XMLUtil.WSA_PREFIX + ":"
+					+ XMLUtil.REFERENCE_PROPERTIES_TAG + " " + ext.getPrefix()
+					+ ":" + ext.getTag() + " : " + ext.getValue() + "/>";
+		}
+
+		return "PortReference < " + addr + " >";
+	}
+
+	/**
+	 * Is this object equal to the specified parameter?
+	 * 
+	 * @param rhs
+	 *            The rhs object.
+	 * @return true if the specified object is equal, false otherwise.
+	 */
+	public boolean equals(final Object rhs)
+	{
+		if ((rhs != null) && (rhs.getClass() == getClass()))
+		{
+			// This should really only include reference property extensions
+			final PortReference rhsPortReference = (PortReference) rhs;
+			return (equalsObject(_address, rhsPortReference._address)
+					&& equalsObject(_extensions, rhsPortReference._extensions)
+					&& equalsObject(_portType, rhsPortReference._portType)
+					&& equalsObject(_serviceName, rhsPortReference._serviceName) && equalsObject(
+					_policies, rhsPortReference._policies));
+		}
+		return false;
+	}
+
+	/**
+	 * Return the hash code for this object.
+	 * 
+	 * @return the hash code value.
+	 */
+	public int hashCode()
+	{
+		// Not checked for spread.
+		return (objectHashCode(_address, 0x1)
+				^ objectHashCode(_extensions, 0x2)
+				^ objectHashCode(_portType, 0x4)
+				^ objectHashCode(_serviceName, 0x8) ^ objectHashCode(_policies,
+				0x10));
+	}
+
+	public static class Extension
+	{
+		public static final int REFERENCE_PROPERTIES = 0;
+		public static final int REFERENCE_PARAMETERS = 1;
+		public static final int NEITHER = 2;
+
+		public Extension(String tag, String prefix, String uri)
+		{
+			this(tag, prefix, uri, null, REFERENCE_PROPERTIES);
+		}
+
+		public Extension(String tag, String prefix, String uri, String value)
+		{
+			this(tag, prefix, uri, value, REFERENCE_PROPERTIES);
+		}
+
+		public Extension(String tag, String prefix, String uri, String value,
+				int parent)
+		{
+			_tag = tag;
+			_prefix = prefix;
+			_uri = uri;
+			_value = value;
+			_parent = parent;
+			
+			/*
+			 * If XML was loaded via DOM1 then prefix and namespace won't work!
+			 */
+			
+			if (_uri == null)
+				_uri = XMLUtil.JBOSSESB_NAMESPACE_URI;
+			
+			if (_prefix == null)
+				_prefix = XMLUtil.JBOSSESB_PREFIX;
+			
+			if (_tag.contains(":"))
+			{
+				int colon = _tag.indexOf(':');
+				
+				_tag = _tag.substring(colon+1);
+			}
+		}
+
+		public int getParent()
+		{
+			return _parent;
+		}
+
+		public String getTag()
+		{
+			return _tag;
+		}
+
+		public String getPrefix()
+		{
+			return _prefix;
+		}
+
+		public String getURI()
+		{
+			return _uri;
+		}
+
+		public String getValue()
+		{
+			return _value;
+		}
+
+		public LinkedList getChildren()
+		{
+			return _extensions;
+		}
+
+		public HashMap getAttributes()
+		{
+			return _attributes;
+		}
+
+		public void addAttributes(HashMap props)
+		{
+			_attributes = props;
+		}
+
+		public void addChild(Extension child)
+		{
+			if (_extensions == null)
+				_extensions = new LinkedList<Extension>();
+
+			_extensions.add(child);
+		}
+
+		public String toString()
+		{
+			return new String("< " + _tag + ", " + _prefix + ", " + _uri + ", "
+					+ _value + " >");
+		}
+
+		/**
+		 * Is this object equal to the specified parameter (ignoring prefix)?
+		 * 
+		 * @param rhs
+		 *            The rhs object.
+		 * @return true if the specified object is equal, false otherwise.
+		 */
+		public boolean equals(final Object rhs)
+		{
+			if ((rhs != null) && (rhs.getClass() == getClass()))
+			{
+				final Extension rhsExtension = (Extension) rhs;
+				return (equalsObject(_tag, rhsExtension._tag)
+						&& equalsObject(_uri, rhsExtension._uri)
+						&& equalsObject(_value, rhsExtension._value)
+						&& equalsObject(_extensions, rhsExtension._extensions) && (_parent == rhsExtension._parent));
+			}
+			return false;
+		}
+
+		/**
+		 * Return the hash code for this object.
+		 * 
+		 * @return the hash code value.
+		 */
+		public int hashCode()
+		{
+			// Not checked for spread.
+			return (_parent ^ objectHashCode(_tag, 0x4)
+					^ objectHashCode(_uri, 0x8) ^ objectHashCode(_value, 0x10) ^ objectHashCode(
+					_extensions, 0x20));
+		}
+
+		private String _tag = null;
+
+		private String _prefix = null;
+
+		private String _uri = null;
+
+		private String _value = null;
+
+		private int _parent = NEITHER;
+
+		private LinkedList<Extension> _extensions = null;
+
+		private HashMap _attributes = null;
+
+	}
+
+	/**
+	 * Get the hash code from the object or use the default if null.
+	 * 
+	 * @param obj
+	 *            The object.
+	 * @param defaultHashCode
+	 *            The default hash code.
+	 * @return The hash code.
+	 */
+	static int objectHashCode(final Object obj, final int defaultHashCode)
+	{
+		return (obj == null ? defaultHashCode : obj.hashCode());
+	}
+
+	/**
+	 * Are the two objects equal?
+	 * 
+	 * @param lhs
+	 *            The lhs object.
+	 * @param rhs
+	 *            The rhs object.
+	 * @return true if equal or both null, false otherwise.
+	 */
+	static boolean equalsObject(final Object lhs, final Object rhs)
+	{
+		if (lhs == null)
+		{
+			return (rhs == null);
+		} else
+		{
+			return lhs.equals(rhs);
+		}
+	}
+
+	private String _address = null;
+	private LinkedList<Extension> _extensions = new LinkedList<Extension>();
+	private Extension _portType = null;
+	private Extension _serviceName = null;
+	private List _policies = null;
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,62 +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 mark.little at jboss.com
- */
-
-/*
- * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
- *
- * XMLUtil.java
- */
-
-package org.jboss.soa.esb.addressing;
-
-public class XMLUtil
-{
-    // WS-Addr
-
-    public static final String WSA_PREFIX = "wsa";
-    public static final String WSA_NAMESPACE_URI = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
-
-    public static final String ENDPOINT_REFERENCE_TAG   = "EndpointReference";
-    public static final String MESSAGE_IDENTIFIER_TAG   = "MessageID";
-    public static final String REFERENCE_PROPERTIES_TAG = "ReferenceProperties";
-    public static final String REFERENCE_PARAMETERS_TAG = "ReferenceParameters";
-    public static final String REPLY_TO_TAG             = "ReplyTo";
-    public static final String FROM_TAG            		= "From";
-
-    public static final String TO_TAG                   = "To";
-    public static final String ADDRESS_TAG              = "Address";
-    public static final String ACTION_TAG               = "Action";
-    public static final String RELATES_TO_TAG           = "RelatesTo";
-    public static final String FAULT_TO_TAG             = "FaultTo";
-    
-    // JBossESB
-
-    public static final String JBOSSESB_PREFIX        = "jbossesb";
-    public static final String JBOSSESB_NAMESPACE_URI = "http://schemas.jboss.com/ws/2007/01/jbossesb";
-
-    public static final String INSTANCE_IDENTIFIER_TAG = "InstanceIdentifier";
-
-    public static final String UNKNOWNERROR_ERROR_CODE = "UnknownError";
-    
-    // XML Namespace
-    public static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/" ;
-    public static final String XMLNS_PREFIX = "xmlns:" ;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/XMLUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,62 @@
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/*
+ * Copyright (c) 2002, 2003, Arjuna Technologies Limited.
+ *
+ * XMLUtil.java
+ */
+
+package org.jboss.soa.esb.addressing;
+
+public class XMLUtil
+{
+    // WS-Addr
+
+    public static final String WSA_PREFIX = "wsa";
+    public static final String WSA_NAMESPACE_URI = "http://schemas.xmlsoap.org/ws/2004/08/addressing";
+
+    public static final String ENDPOINT_REFERENCE_TAG   = "EndpointReference";
+    public static final String MESSAGE_IDENTIFIER_TAG   = "MessageID";
+    public static final String REFERENCE_PROPERTIES_TAG = "ReferenceProperties";
+    public static final String REFERENCE_PARAMETERS_TAG = "ReferenceParameters";
+    public static final String REPLY_TO_TAG             = "ReplyTo";
+    public static final String FROM_TAG            		= "From";
+
+    public static final String TO_TAG                   = "To";
+    public static final String ADDRESS_TAG              = "Address";
+    public static final String ACTION_TAG               = "Action";
+    public static final String RELATES_TO_TAG           = "RelatesTo";
+    public static final String FAULT_TO_TAG             = "FaultTo";
+    
+    // JBossESB
+
+    public static final String JBOSSESB_PREFIX        = "jbossesb";
+    public static final String JBOSSESB_NAMESPACE_URI = "http://schemas.jboss.com/ws/2007/01/jbossesb";
+
+    public static final String INSTANCE_IDENTIFIER_TAG = "InstanceIdentifier";
+
+    public static final String UNKNOWNERROR_ERROR_CODE = "UnknownError";
+    
+    // XML Namespace
+    public static final String XMLNS_URI = "http://www.w3.org/2000/xmlns/" ;
+    public static final String XMLNS_PREFIX = "xmlns:" ;
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFileReplyToEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFileReplyToEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFileReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,47 +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,
- */
-
-
-package org.jboss.soa.esb.addressing.eprs;
-
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.util.UUID;
-
-public class DefaultFileReplyToEpr extends FileEpr
-{
-	
-	public DefaultFileReplyToEpr (FileEpr epr)
-		throws URISyntaxException, MalformedURLException
-	{
-		super(epr.getURL());
-		String suffix = uniqueFileSuffix(epr);
-		setInputSuffix(suffix);
-		setPostSuffix(suffix);
-		setPostDelete(true);
-	}
-	
-	
-	static String uniqueFileSuffix(FileEpr epr)
-		throws URISyntaxException
-	{
-		String inputSuffix = epr.getInputSuffix(); 
-		return ((null==inputSuffix)?"":inputSuffix)+"."+FileEpr.DEFAULT_REPLY_TO_FILE_SUFFIX+UUID.randomUUID().toString();
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFileReplyToEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFileReplyToEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFileReplyToEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFileReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,47 @@
+/* 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,
+ */
+
+
+package org.jboss.soa.esb.addressing.eprs;
+
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.util.UUID;
+
+public class DefaultFileReplyToEpr extends FileEpr
+{
+	
+	public DefaultFileReplyToEpr (FileEpr epr)
+		throws URISyntaxException, MalformedURLException
+	{
+		super(epr.getURL());
+		String suffix = uniqueFileSuffix(epr);
+		setInputSuffix(suffix);
+		setPostSuffix(suffix);
+		setPostDelete(true);
+	}
+	
+	
+	static String uniqueFileSuffix(FileEpr epr)
+		throws URISyntaxException
+	{
+		String inputSuffix = epr.getInputSuffix(); 
+		return ((null==inputSuffix)?"":inputSuffix)+"."+FileEpr.DEFAULT_REPLY_TO_FILE_SUFFIX+UUID.randomUUID().toString();
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFtpReplyToEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFtpReplyToEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFtpReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,41 +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,
- */
-
-package org.jboss.soa.esb.addressing.eprs;
-
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-
-public class DefaultFtpReplyToEpr extends FTPEpr 
-{
-	
-	public DefaultFtpReplyToEpr(FTPEpr epr)
-		throws URISyntaxException, MalformedURLException
-	{
-		super(epr.getURL());
-		String suffix = DefaultFileReplyToEpr.uniqueFileSuffix(epr);
-		setInputSuffix(suffix);
-		setPostSuffix(suffix);
-		setPostDelete(true);
-
-		setPassive(epr.getPassive());
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFtpReplyToEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFtpReplyToEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFtpReplyToEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultFtpReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,41 @@
+/*
+ * 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,
+ */
+
+package org.jboss.soa.esb.addressing.eprs;
+
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+
+public class DefaultFtpReplyToEpr extends FTPEpr 
+{
+	
+	public DefaultFtpReplyToEpr(FTPEpr epr)
+		throws URISyntaxException, MalformedURLException
+	{
+		super(epr.getURL());
+		String suffix = DefaultFileReplyToEpr.uniqueFileSuffix(epr);
+		setInputSuffix(suffix);
+		setPostSuffix(suffix);
+		setPostDelete(true);
+
+		setPassive(epr.getPassive());
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,39 +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.addressing.eprs;
-
-import java.net.URISyntaxException;
-
-public class DefaultHibernateReplyToEpr extends HibernateEpr
-{
-
-	public DefaultHibernateReplyToEpr(HibernateEpr epr) throws URISyntaxException
-	{
-		super(epr);
-		setClassName(replyToClassName(epr));
-	}
-		
-	public static String replyToClassName(HibernateEpr epr) throws URISyntaxException
-	{
-		return epr.getClassName()+HibernateEpr.DEFAULT_REPLY_TO_CLASS_SUFFIX;
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultHibernateReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,39 @@
+/*
+ * 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.addressing.eprs;
+
+import java.net.URISyntaxException;
+
+public class DefaultHibernateReplyToEpr extends HibernateEpr
+{
+
+	public DefaultHibernateReplyToEpr(HibernateEpr epr) throws URISyntaxException
+	{
+		super(epr);
+		setClassName(replyToClassName(epr));
+	}
+		
+	public static String replyToClassName(HibernateEpr epr) throws URISyntaxException
+	{
+		return epr.getClassName()+HibernateEpr.DEFAULT_REPLY_TO_CLASS_SUFFIX;
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,38 +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,
- */
-
-package org.jboss.soa.esb.addressing.eprs;
-
-import java.net.URISyntaxException;
-
-public class DefaultJdbcReplyToEpr extends JDBCEpr
-{
-
-	public DefaultJdbcReplyToEpr(JDBCEpr epr) throws URISyntaxException
-	{
-		super(epr);
-		setTableName(replyToTableName(epr));
-	}
-	
-	public static String replyToTableName(JDBCEpr epr) throws URISyntaxException
-	{
-		return epr.getTableName()+JDBCEpr.DEFAULT_REPLY_TO_TABLE_SUFFIX;
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJdbcReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,38 @@
+/*
+ * 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,
+ */
+
+package org.jboss.soa.esb.addressing.eprs;
+
+import java.net.URISyntaxException;
+
+public class DefaultJdbcReplyToEpr extends JDBCEpr
+{
+
+	public DefaultJdbcReplyToEpr(JDBCEpr epr) throws URISyntaxException
+	{
+		super(epr);
+		setTableName(replyToTableName(epr));
+	}
+	
+	public static String replyToTableName(JDBCEpr epr) throws URISyntaxException
+	{
+		return epr.getTableName()+JDBCEpr.DEFAULT_REPLY_TO_TABLE_SUFFIX;
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,69 +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,
- */
-
-package org.jboss.soa.esb.addressing.eprs;
-
-import java.net.URISyntaxException;
-import java.util.UUID;
-
-import org.jboss.soa.esb.util.Util;
-
-public class DefaultJmsReplyToEpr extends JMSEpr{
-
-	public static final String REPLY_UUID_TAG = "jbossESBresponseUUID";
-
-	public DefaultJmsReplyToEpr(JMSEpr epr)
-		throws URISyntaxException
-	{
-		super(	epr.getDestinationType()
-				,replyDestinationName(epr)
-				,epr.getConnectionFactory()
-				,epr.getJndiEnvironment()
-				,replySelector(epr)
-			 );
-	}
-	private static String replyDestinationName(JMSEpr toEpr)
-		throws URISyntaxException
-	{
-		return toEpr.getDestinationName()+JMSEpr.DEFAULT_REPLY_TO_DESTINATION_SUFFIX;
-	}
-	
-	/**
-	 * Unique reply message selector
-	 * 
-	 * @return String - the generated unique reply selector.
-	 */
-	@SuppressWarnings("unused")
-    private static String replySelector(JMSEpr epr)
-		throws URISyntaxException
-	{
-		StringBuilder sb = new StringBuilder();
-		
-		String oldSelector = epr.getMessageSelector();
-		// If there was a message selector, use it
-		if (!Util.isNullString(oldSelector))
-			sb.append(oldSelector).append(" AND ");
-		// And add a unique reply UUID
-		sb.append(REPLY_UUID_TAG)
-		  .append("='").append(UUID.randomUUID().toString()).append("'");
-		return sb.toString();
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultJmsReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,69 @@
+/*
+ * 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,
+ */
+
+package org.jboss.soa.esb.addressing.eprs;
+
+import java.net.URISyntaxException;
+import java.util.UUID;
+
+import org.jboss.soa.esb.util.Util;
+
+public class DefaultJmsReplyToEpr extends JMSEpr{
+
+	public static final String REPLY_UUID_TAG = "jbossESBresponseUUID";
+
+	public DefaultJmsReplyToEpr(JMSEpr epr)
+		throws URISyntaxException
+	{
+		super(	epr.getDestinationType()
+				,replyDestinationName(epr)
+				,epr.getConnectionFactory()
+				,epr.getJndiEnvironment()
+				,replySelector(epr)
+			 );
+	}
+	private static String replyDestinationName(JMSEpr toEpr)
+		throws URISyntaxException
+	{
+		return toEpr.getDestinationName()+JMSEpr.DEFAULT_REPLY_TO_DESTINATION_SUFFIX;
+	}
+	
+	/**
+	 * Unique reply message selector
+	 * 
+	 * @return String - the generated unique reply selector.
+	 */
+	@SuppressWarnings("unused")
+    private static String replySelector(JMSEpr epr)
+		throws URISyntaxException
+	{
+		StringBuilder sb = new StringBuilder();
+		
+		String oldSelector = epr.getMessageSelector();
+		// If there was a message selector, use it
+		if (!Util.isNullString(oldSelector))
+			sb.append(oldSelector).append(" AND ");
+		// And add a unique reply UUID
+		sb.append(REPLY_UUID_TAG)
+		  .append("='").append(UUID.randomUUID().toString()).append("'");
+		return sb.toString();
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultSftpReplyToEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultSftpReplyToEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultSftpReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,42 +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,
- */
-
-package org.jboss.soa.esb.addressing.eprs;
-
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-
-public class DefaultSftpReplyToEpr extends SFTPEpr 
-{
-	
-	public DefaultSftpReplyToEpr(SFTPEpr epr)
-		throws URISyntaxException, MalformedURLException
-	{
-		super(epr.getURL());
-		String suffix = DefaultFileReplyToEpr.uniqueFileSuffix(epr);
-		setInputSuffix(suffix);
-		setPostSuffix(suffix);
-		setPostDelete(true);
-		
-		setPassive(epr.getPassive());
-		setCertificateURL(epr.getCertificateURL());
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultSftpReplyToEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultSftpReplyToEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultSftpReplyToEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/DefaultSftpReplyToEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,42 @@
+/*
+ * 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,
+ */
+
+package org.jboss.soa.esb.addressing.eprs;
+
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+
+public class DefaultSftpReplyToEpr extends SFTPEpr 
+{
+	
+	public DefaultSftpReplyToEpr(SFTPEpr epr)
+		throws URISyntaxException, MalformedURLException
+	{
+		super(epr.getURL());
+		String suffix = DefaultFileReplyToEpr.uniqueFileSuffix(epr);
+		setInputSuffix(suffix);
+		setPostSuffix(suffix);
+		setPostDelete(true);
+		
+		setPassive(epr.getPassive());
+		setCertificateURL(epr.getCertificateURL());
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,225 +0,0 @@
-package org.jboss.soa.esb.addressing.eprs;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-
-/**
- * This class represents the endpoint reference for services.
- */
-
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.PortReference;
-import org.jboss.soa.esb.addressing.XMLUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * A helper class for using email style EPRs. Simply create and use instances of
- * this type.
- * 
- * @author marklittle
- *
- */
-public class EmailEpr extends EPR
-{  
-	public static final String DEFAULT_PORT = "25";
-	public static final String DEFAULT_USERNAME = "";
-	public static final String DEFAULT_PASSWORD = "";
-	
-	public static final String SMTP_PROTOCOL = "smtp";
-	public static final String POP_PROTOCOL = "pop";
-	
-	public static final String USERNAME_TAG = "username";
-	public static final String PASSWORD_TAG = "password";
-	
-	private static final String PROTOCOL_SEPARATOR = "://";
-	private static final String PORT_SEPARATOR = ":";
-	
-	public EmailEpr (EPR epr)
-	{
-		copy(epr);
-	}
-	
-	public EmailEpr (EPR epr, Element header)
-	{
-		copy(epr);
-		
-		NodeList nl = header.getChildNodes();
-
-		for (int i = 0; i < nl.getLength(); i++)
-		{
-			try
-			{
-				String prefix = nl.item(i).getPrefix();
-				String tag = nl.item(i).getLocalName();
-				
-				if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
-				{
-					if ((tag != null) && (tag.equals(USERNAME_TAG)))
-					{
-						getAddr().addExtension(USERNAME_TAG, nl.item(i).getTextContent());
-					}
-					else
-					{
-						if ((tag != null) && (tag.equals(PASSWORD_TAG)))
-							getAddr().addExtension(PASSWORD_TAG, nl.item(i).getTextContent());
-					}
-				}
-			}
-			catch (Exception ex)
-			{
-				ex.printStackTrace();
-			}
-		}
-	}
-	
-	/**
-	 * Create a new email EPR. The port number will be assumed to be 25,
-	 * and there are no values for username and password.
-	 * 
-	 * @param protocol the protocol to use.
-	 * @param host the host name.
-	 */
-	
-	public EmailEpr (String protocol, String host)
-	{
-		this(protocol, host, DEFAULT_PORT, DEFAULT_USERNAME, DEFAULT_PASSWORD);
-	}
-	
-	/**
-	 * Create a new email EPR.
-	 * 
-	 * @param protocol the protocol to use.
-	 * @param host the host name.
-	 * @param port the port to use.
-	 * @param username the username for sending/receiving.
-	 * @param password the password for sending/receiving.
-	 */
-	
-	public EmailEpr (String protocol, String host, String port, String username, String password)
-	{
-		// how many of these do we really need? modify accordingly.
-		
-		if ((protocol == null) || (host == null) || (port == null))
-			throw new IllegalArgumentException();
-		
-		if ((protocol.equals(SMTP_PROTOCOL) || (protocol.equals(POP_PROTOCOL))))
-		{
-			PortReference addr = new PortReference(protocol+PROTOCOL_SEPARATOR+host+PORT_SEPARATOR+port);
-			
-			if (username != null)
-				addr.addExtension(USERNAME_TAG, username);
-			
-			if (password != null)
-				addr.addExtension(PASSWORD_TAG, password);
-			
-			setAddr(addr);
-		}
-		else
-			throw new IllegalArgumentException("Invalid email protocol!");
-	}
-	
-	/**
-	 * @return the email protocol used.
-	 * @throws URISyntaxException thrown if the address is malformed.
-	 */
-	
-	public final String getProtocol () throws URISyntaxException
-	{
-		URI addr = new URI(getAddr().getAddress());
-		
-		return addr.getScheme();
-	}
-	
-	/**
-	 * @return the email host used.
-	 * @throws URISyntaxException thrown if the address is malformed.
-	 */
-	
-	public final String getHost () throws URISyntaxException
-	{	
-		URI addr = new URI(getAddr().getAddress());
-		
-		return addr.getHost();
-	}
-	
-	/**
-	 * @return the email port used, or -1 if not specified.
-	 * @throws URISyntaxException thrown if the address is malformed.
-	 */
-
-	public final int getPort () throws URISyntaxException
-	{
-		URI addr = new URI(getAddr().getAddress());
-		
-		return addr.getPort();
-	}
-	
-	/*
-	 * There are deliberately no setters for the values once the EPR is created.
-	 */
-	
-	/**
-	 * @return the password for this EPR, or <code>null</code> if none is set.
-	 * @throws URISyntaxException thrown if the address is malformed.
-	 */
-	
-	public final String getPassword () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(PASSWORD_TAG);
-	}
-	
-	/**
-	 * @return the username for this EPR, or <code>null</code> if none is set.
-	 * @throws URISyntaxException thrown if the address is malformed.
-	 */
-	
-	public final String getUserName () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(USERNAME_TAG);
-	}
-
-	public static final URI type ()
-	{
-	    return _type;
-	}
-	
-	private static URI _type;
-
-	static
-	{
-	    try
-		{
-		    _type = new URI("urn:jboss/esb/epr/type/email");
-		}
-		catch (Exception ex)
-		{
-		    ex.printStackTrace();
-		    
-		    throw new ExceptionInInitializerError(ex.toString());
-		}
-	}
-} 
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/EmailEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,225 @@
+package org.jboss.soa.esb.addressing.eprs;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+
+/**
+ * This class represents the endpoint reference for services.
+ */
+
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * A helper class for using email style EPRs. Simply create and use instances of
+ * this type.
+ * 
+ * @author marklittle
+ *
+ */
+public class EmailEpr extends EPR
+{  
+	public static final String DEFAULT_PORT = "25";
+	public static final String DEFAULT_USERNAME = "";
+	public static final String DEFAULT_PASSWORD = "";
+	
+	public static final String SMTP_PROTOCOL = "smtp";
+	public static final String POP_PROTOCOL = "pop";
+	
+	public static final String USERNAME_TAG = "username";
+	public static final String PASSWORD_TAG = "password";
+	
+	private static final String PROTOCOL_SEPARATOR = "://";
+	private static final String PORT_SEPARATOR = ":";
+	
+	public EmailEpr (EPR epr)
+	{
+		copy(epr);
+	}
+	
+	public EmailEpr (EPR epr, Element header)
+	{
+		copy(epr);
+		
+		NodeList nl = header.getChildNodes();
+
+		for (int i = 0; i < nl.getLength(); i++)
+		{
+			try
+			{
+				String prefix = nl.item(i).getPrefix();
+				String tag = nl.item(i).getLocalName();
+				
+				if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
+				{
+					if ((tag != null) && (tag.equals(USERNAME_TAG)))
+					{
+						getAddr().addExtension(USERNAME_TAG, nl.item(i).getTextContent());
+					}
+					else
+					{
+						if ((tag != null) && (tag.equals(PASSWORD_TAG)))
+							getAddr().addExtension(PASSWORD_TAG, nl.item(i).getTextContent());
+					}
+				}
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+			}
+		}
+	}
+	
+	/**
+	 * Create a new email EPR. The port number will be assumed to be 25,
+	 * and there are no values for username and password.
+	 * 
+	 * @param protocol the protocol to use.
+	 * @param host the host name.
+	 */
+	
+	public EmailEpr (String protocol, String host)
+	{
+		this(protocol, host, DEFAULT_PORT, DEFAULT_USERNAME, DEFAULT_PASSWORD);
+	}
+	
+	/**
+	 * Create a new email EPR.
+	 * 
+	 * @param protocol the protocol to use.
+	 * @param host the host name.
+	 * @param port the port to use.
+	 * @param username the username for sending/receiving.
+	 * @param password the password for sending/receiving.
+	 */
+	
+	public EmailEpr (String protocol, String host, String port, String username, String password)
+	{
+		// how many of these do we really need? modify accordingly.
+		
+		if ((protocol == null) || (host == null) || (port == null))
+			throw new IllegalArgumentException();
+		
+		if ((protocol.equals(SMTP_PROTOCOL) || (protocol.equals(POP_PROTOCOL))))
+		{
+			PortReference addr = new PortReference(protocol+PROTOCOL_SEPARATOR+host+PORT_SEPARATOR+port);
+			
+			if (username != null)
+				addr.addExtension(USERNAME_TAG, username);
+			
+			if (password != null)
+				addr.addExtension(PASSWORD_TAG, password);
+			
+			setAddr(addr);
+		}
+		else
+			throw new IllegalArgumentException("Invalid email protocol!");
+	}
+	
+	/**
+	 * @return the email protocol used.
+	 * @throws URISyntaxException thrown if the address is malformed.
+	 */
+	
+	public final String getProtocol () throws URISyntaxException
+	{
+		URI addr = new URI(getAddr().getAddress());
+		
+		return addr.getScheme();
+	}
+	
+	/**
+	 * @return the email host used.
+	 * @throws URISyntaxException thrown if the address is malformed.
+	 */
+	
+	public final String getHost () throws URISyntaxException
+	{	
+		URI addr = new URI(getAddr().getAddress());
+		
+		return addr.getHost();
+	}
+	
+	/**
+	 * @return the email port used, or -1 if not specified.
+	 * @throws URISyntaxException thrown if the address is malformed.
+	 */
+
+	public final int getPort () throws URISyntaxException
+	{
+		URI addr = new URI(getAddr().getAddress());
+		
+		return addr.getPort();
+	}
+	
+	/*
+	 * There are deliberately no setters for the values once the EPR is created.
+	 */
+	
+	/**
+	 * @return the password for this EPR, or <code>null</code> if none is set.
+	 * @throws URISyntaxException thrown if the address is malformed.
+	 */
+	
+	public final String getPassword () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(PASSWORD_TAG);
+	}
+	
+	/**
+	 * @return the username for this EPR, or <code>null</code> if none is set.
+	 * @throws URISyntaxException thrown if the address is malformed.
+	 */
+	
+	public final String getUserName () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(USERNAME_TAG);
+	}
+
+	public static final URI type ()
+	{
+	    return _type;
+	}
+	
+	private static URI _type;
+
+	static
+	{
+	    try
+		{
+		    _type = new URI("urn:jboss/esb/epr/type/email");
+		}
+		catch (Exception ex)
+		{
+		    ex.printStackTrace();
+		    
+		    throw new ExceptionInInitializerError(ex.toString());
+		}
+	}
+} 
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,248 +0,0 @@
-package org.jboss.soa.esb.addressing.eprs;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-
-/**
- * This class represents the endpoint reference for services.
- */
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.PortReference;
-import org.jboss.soa.esb.addressing.XMLUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * A helper class for using FTP style EPRs. Simply create instances of this
- * class instead of the base EPR. Since URLs can use FTP, we try to leverage
- * that as much as possible.
- * 
- * @author marklittle
- *
- */
-public class FTPEpr extends FileEpr
-{
-	public static final String USERNAME_TAG = "username";
-	public static final String PASSWORD_TAG = "password";
-	public static final String PASSIVE_TAG = "passive";
-	
-	public FTPEpr (EPR epr)
-	{
-		super(epr);
-		
-		copy(epr);
-	}
-	
-	public FTPEpr (EPR epr, Element header)
-	{
-		super(epr, header);
-		
-		copy(epr);
-		
-		NodeList nl = header.getChildNodes();
-
-		for (int i = 0; i < nl.getLength(); i++)
-		{
-			try
-			{
-				String prefix = nl.item(i).getPrefix();
-				String tag = nl.item(i).getLocalName();
-				
-				if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
-				{
-					if (tag != null)
-					{
-						if (tag.equals(USERNAME_TAG))
-							getAddr().addExtension(USERNAME_TAG, nl.item(i).getTextContent());
-						else
-						{
-							if (tag.equals(PASSWORD_TAG))
-								getAddr().addExtension(PASSWORD_TAG, nl.item(i).getTextContent());
-							else
-							{
-								if (tag.equals(PASSIVE_TAG))
-									getAddr().addExtension(PASSIVE_TAG, nl.item(i).getTextContent());
-							}
-						}
-					}
-				}
-			}
-			catch (Exception ex)
-			{
-				ex.printStackTrace();
-			}
-		}
-	}
-			
-	public FTPEpr (URL url) throws URISyntaxException
-	{
-		super(new URI(url.toString()));
-	}
-	
-	public FTPEpr (String url) throws URISyntaxException
-	{
-		super(new URI(url));
-	}
-
-	/**
-	 * Set the URL for this endpoint.
-	 * 
-	 * @param url the address.
-	 */
-	
-	public final void setURL (URL url)
-	{
-		super.setAddr(new PortReference(url.toString()));
-	}
-	
-	/**
-	 * Get the URL address.
-	 * 
-	 * @return the address.
-	 * @throws URISyntaxException thrown if the address is invalid.
-	 */
-	
-	public final URL getURL () throws MalformedURLException, URISyntaxException
-	{
-		return new URL(super.getAddr().getAddress());
-	}
-
-	/**
-	 * Set the username for this FTP EPR. In case it cannot be put in the URL.
-	 * 
-	 * @param username the user's name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setUserName (String username) throws URISyntaxException
-	{
-		if (username == null)
-			throw new IllegalArgumentException();
-		
-		if (userSet)
-			throw new IllegalStateException("Username already set.");
-		
-		getAddr().addExtension(USERNAME_TAG, username);
-		userSet = true;
-	}
-	
-	/**
-	 * @return the user's name associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getUserName () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(USERNAME_TAG);
-	}
-	
-	/**
-	 * Set the password for this FTP EPR.
-	 * 
-	 * @param password the user's name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setPassword (String password) throws URISyntaxException
-	{
-		if (password == null)
-			throw new IllegalArgumentException();
-		
-		if (passwordSet)
-			throw new IllegalStateException("Cannot change password");
-		
-		getAddr().addExtension(PASSWORD_TAG, password);
-		passwordSet = true;
-	}
-	
-	/**
-	 * @return the password associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getPassword () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(PASSWORD_TAG);
-	}
-	
-	/**
-	 * Passive FTP?
-	 * 
-	 * @param passive the value.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setPassive (boolean passive) throws URISyntaxException
-	{
-		if (passiveSet)
-			throw new IllegalStateException("Cannot change passive");
-		
-		if (passive)
-			getAddr().addExtension(PASSIVE_TAG, "true");
-		else
-			getAddr().addExtension(PASSIVE_TAG, "false");
-		
-		passiveSet = true;
-	}
-	
-	/**
-	 * @return the passive value associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final boolean getPassive () throws URISyntaxException
-	{
-		return "true".equals(getAddr().getExtensionValue(PASSIVE_TAG));
-	}
-	
-	
-	public static URI type ()
-	{
-	    return _type;
-	}
-
-	private boolean passwordSet = false;
-	private boolean userSet = false;
-	private boolean passiveSet = false;
-	
-	private static URI _type;
-	
-	static
-	{
-	    try
-		{
-		    _type = new URI("urn:jboss/esb/epr/type/ftp");
-		}
-		catch (Exception ex)
-		{
-		    ex.printStackTrace();
-		    
-		    throw new ExceptionInInitializerError(ex.toString());
-		}
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FTPEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,248 @@
+package org.jboss.soa.esb.addressing.eprs;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+
+/**
+ * This class represents the endpoint reference for services.
+ */
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * A helper class for using FTP style EPRs. Simply create instances of this
+ * class instead of the base EPR. Since URLs can use FTP, we try to leverage
+ * that as much as possible.
+ * 
+ * @author marklittle
+ *
+ */
+public class FTPEpr extends FileEpr
+{
+	public static final String USERNAME_TAG = "username";
+	public static final String PASSWORD_TAG = "password";
+	public static final String PASSIVE_TAG = "passive";
+	
+	public FTPEpr (EPR epr)
+	{
+		super(epr);
+		
+		copy(epr);
+	}
+	
+	public FTPEpr (EPR epr, Element header)
+	{
+		super(epr, header);
+		
+		copy(epr);
+		
+		NodeList nl = header.getChildNodes();
+
+		for (int i = 0; i < nl.getLength(); i++)
+		{
+			try
+			{
+				String prefix = nl.item(i).getPrefix();
+				String tag = nl.item(i).getLocalName();
+				
+				if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
+				{
+					if (tag != null)
+					{
+						if (tag.equals(USERNAME_TAG))
+							getAddr().addExtension(USERNAME_TAG, nl.item(i).getTextContent());
+						else
+						{
+							if (tag.equals(PASSWORD_TAG))
+								getAddr().addExtension(PASSWORD_TAG, nl.item(i).getTextContent());
+							else
+							{
+								if (tag.equals(PASSIVE_TAG))
+									getAddr().addExtension(PASSIVE_TAG, nl.item(i).getTextContent());
+							}
+						}
+					}
+				}
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+			}
+		}
+	}
+			
+	public FTPEpr (URL url) throws URISyntaxException
+	{
+		super(new URI(url.toString()));
+	}
+	
+	public FTPEpr (String url) throws URISyntaxException
+	{
+		super(new URI(url));
+	}
+
+	/**
+	 * Set the URL for this endpoint.
+	 * 
+	 * @param url the address.
+	 */
+	
+	public final void setURL (URL url)
+	{
+		super.setAddr(new PortReference(url.toString()));
+	}
+	
+	/**
+	 * Get the URL address.
+	 * 
+	 * @return the address.
+	 * @throws URISyntaxException thrown if the address is invalid.
+	 */
+	
+	public final URL getURL () throws MalformedURLException, URISyntaxException
+	{
+		return new URL(super.getAddr().getAddress());
+	}
+
+	/**
+	 * Set the username for this FTP EPR. In case it cannot be put in the URL.
+	 * 
+	 * @param username the user's name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setUserName (String username) throws URISyntaxException
+	{
+		if (username == null)
+			throw new IllegalArgumentException();
+		
+		if (userSet)
+			throw new IllegalStateException("Username already set.");
+		
+		getAddr().addExtension(USERNAME_TAG, username);
+		userSet = true;
+	}
+	
+	/**
+	 * @return the user's name associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getUserName () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(USERNAME_TAG);
+	}
+	
+	/**
+	 * Set the password for this FTP EPR.
+	 * 
+	 * @param password the user's name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setPassword (String password) throws URISyntaxException
+	{
+		if (password == null)
+			throw new IllegalArgumentException();
+		
+		if (passwordSet)
+			throw new IllegalStateException("Cannot change password");
+		
+		getAddr().addExtension(PASSWORD_TAG, password);
+		passwordSet = true;
+	}
+	
+	/**
+	 * @return the password associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getPassword () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(PASSWORD_TAG);
+	}
+	
+	/**
+	 * Passive FTP?
+	 * 
+	 * @param passive the value.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setPassive (boolean passive) throws URISyntaxException
+	{
+		if (passiveSet)
+			throw new IllegalStateException("Cannot change passive");
+		
+		if (passive)
+			getAddr().addExtension(PASSIVE_TAG, "true");
+		else
+			getAddr().addExtension(PASSIVE_TAG, "false");
+		
+		passiveSet = true;
+	}
+	
+	/**
+	 * @return the passive value associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final boolean getPassive () throws URISyntaxException
+	{
+		return "true".equals(getAddr().getExtensionValue(PASSIVE_TAG));
+	}
+	
+	
+	public static URI type ()
+	{
+	    return _type;
+	}
+
+	private boolean passwordSet = false;
+	private boolean userSet = false;
+	private boolean passiveSet = false;
+	
+	private static URI _type;
+	
+	static
+	{
+	    try
+		{
+		    _type = new URI("urn:jboss/esb/epr/type/ftp");
+		}
+		catch (Exception ex)
+		{
+		    ex.printStackTrace();
+		    
+		    throw new ExceptionInInitializerError(ex.toString());
+		}
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,430 +0,0 @@
-package org.jboss.soa.esb.addressing.eprs;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-
-/**
- * This class represents the endpoint reference for services.
- */
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.PortReference;
-import org.jboss.soa.esb.addressing.XMLUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * A helper class for using file based  EPRs. Simply create instances of this
- * class instead of the base EPR. Since URLs can use file:// as the protocol, we try to leverage
- * that as much as possible.
- * 
- * @author marklittle
- *
- */
-public class FileEpr extends EPR
-{
-	public static final String INPUT_SUFFIX_TAG = "inputSuffix";
-	public static final String WORK_SUFFIX_TAG 	= "workSuffix";
-	public static final String POST_DIR_TAG 	= "postDir";
-	public static final String POST_SUFFIX_TAG 	= "postSuffix";
-	public static final String POST_DEL_TAG 	= "postDelete";
-	public static final String ERROR_DIR_TAG 	= "errorDir";
-	public static final String ERROR_SUFFIX_TAG	= "errorSuffix";
-	public static final String ERROR_DEL_TAG 	= "errorDelete";
-	public static final String URL_TAG = "URL";
-	
-	public static final String DEFAULT_REPLY_TO_FILE_SUFFIX = "_reply";
-	
-	public FileEpr (EPR epr)
-	{
-		copy(epr);
-	}
-	
-	public FileEpr (EPR epr, Element header)
-	{
-		copy(epr);
-		
-		NodeList nl = header.getChildNodes();
-
-		for (int i = 0; i < nl.getLength(); i++)
-		{
-			try
-			{
-				String prefix = nl.item(i).getPrefix();
-				String tag = nl.item(i).getLocalName();
-				
-				if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
-				{
-					if (tag != null)
-					{
-						if (tag.equals(INPUT_SUFFIX_TAG))
-							getAddr().addExtension(INPUT_SUFFIX_TAG, nl.item(i).getTextContent());
-						else
-						{
-							if (tag.equals(POST_DIR_TAG))
-								getAddr().addExtension(POST_DIR_TAG, nl.item(i).getTextContent());
-							else
-							{
-								if (tag.equals(POST_SUFFIX_TAG))
-									getAddr().addExtension(POST_SUFFIX_TAG, nl.item(i).getTextContent());
-								else
-								{
-									if (tag.equals(POST_DEL_TAG))
-										getAddr().addExtension(POST_DEL_TAG, nl.item(i).getTextContent());
-									else
-									{
-										if (tag.equals(ERROR_DIR_TAG))
-										{
-											getAddr().addExtension(ERROR_DIR_TAG, nl.item(i).getTextContent());
-										}
-										else
-										{
-											if (tag.equals((ERROR_SUFFIX_TAG)))
-												getAddr().addExtension(ERROR_SUFFIX_TAG, nl.item(i).getTextContent());
-											else
-											{
-												if (tag.equals((ERROR_DEL_TAG)))
-													getAddr().addExtension(ERROR_DEL_TAG, nl.item(i).getTextContent());
-											}
-										}
-									}
-								}
-							}
-						}	
-					}
-				}
-			}
-			catch (Exception ex)
-			{
-				ex.printStackTrace();
-			}
-		}
-	}
-
-	public FileEpr (URL url) throws URISyntaxException
-	{
-		super(new URI(url.toString()));
-	}
-	
-	public FileEpr (String url) throws URISyntaxException
-	{
-		super(new URI(url));
-	}
-
-	/**
-	 * Set the URL for this endpoint.
-	 * 
-	 * @param url the address.
-	 */
-	
-	public void setURL (URL url)
-	{
-		super.setAddr(new PortReference(url.toString()));
-	}
-	
-	/**
-	 * Get the URL address.
-	 * 
-	 * @return the address.
-	 * @throws URISyntaxException thrown if the address is invalid.
-	 */
-	
-	public URL getURL () throws MalformedURLException, URISyntaxException
-	{
-		return new URL(super.getAddr().getAddress());
-	}
-
-	/**
-	 * Set the file input suffix.
-	 * 
-	 * @param suffix the input suffix to use.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setInputSuffix (String suffix) throws URISyntaxException
-	{
-		if (suffix == null)
-			throw new IllegalArgumentException();
-		
-		if (inputSet)
-			throw new IllegalStateException("Input suffix already set.");
-		
-		getAddr().addExtension(INPUT_SUFFIX_TAG, suffix);
-		inputSet = true;
-	}
-	
-	/**
-	 * @return the input suffix associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getInputSuffix () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(INPUT_SUFFIX_TAG);
-	}
-	
-	/**
-	 * Set the work suffix for this EPR.
-	 * 
-	 * @param suffix the suffix to use.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setWorkSuffix (String suffix) throws URISyntaxException
-	{
-		if (suffix == null)
-			throw new IllegalArgumentException();
-		
-		if (workSet)
-			throw new IllegalStateException("Cannot change work suffix");
-		
-		getAddr().addExtension(WORK_SUFFIX_TAG, suffix);
-		workSet = true;
-	}
-	
-	/**
-	 * @return the work suffix associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getWorkSuffix () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(WORK_SUFFIX_TAG);
-	}
-	
-	/**
-	 * Set the post directory for this EPR.
-	 * 
-	 * @param dir the directory to use.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setPostDirectory (String dir) throws URISyntaxException
-	{
-		if (dir == null)
-			throw new IllegalArgumentException();
-		
-		if (postDirSet)
-			throw new IllegalStateException("Cannot change post directory");
-		
-		getAddr().addExtension(POST_DIR_TAG, dir);
-		postDirSet = true;
-	}
-	
-	/**
-	 * @return the post directory associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getPostDirectory () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(POST_DIR_TAG);
-	}
-	
-	/**
-	 * Set the post suffix for this EPR.
-	 * 
-	 * @param suffix the suffix to use.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setPostSuffix (String suffix) throws URISyntaxException
-	{
-		if (suffix == null)
-			throw new IllegalArgumentException();
-		
-		if (postSuffixSet)
-			throw new IllegalStateException("Cannot change post suffix");
-		
-		getAddr().addExtension(POST_SUFFIX_TAG, suffix);
-		postSuffixSet = true;
-	}
-	
-	/**
-	 * @return the post suffix associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getPostSuffix () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(POST_SUFFIX_TAG);
-	}
-	
-	/**
-	 * Set the post delete for this EPR.
-	 * 
-	 * @param del the deleted value to use.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setPostDelete (boolean del) throws URISyntaxException
-	{		
-		if (postDelSet)
-			throw new IllegalStateException("Cannot change post delete");
-		
-		if (del)
-			getAddr().addExtension(POST_DEL_TAG, "true");
-		else
-			getAddr().addExtension(POST_DEL_TAG, "false");
-		
-		postDelSet = true;
-	}
-	
-	/**
-	 * @return the delete vazlue associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final boolean getPostDelete () throws URISyntaxException
-	{
-		return ("true".equals(getAddr().getExtensionValue(POST_DEL_TAG)));
-	}
-		
-	/**
-	 * Set the error directory for this EPR.
-	 * 
-	 * @param dir the directory to use.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setErrorDirectory (String dir) throws URISyntaxException
-	{
-		if (dir == null)
-			throw new IllegalArgumentException();
-		
-		if (errorDirSet)
-			throw new IllegalStateException("Cannot change error directory");
-		
-		getAddr().addExtension(ERROR_DIR_TAG, dir);
-		errorDirSet = true;
-	}
-	
-	/**
-	 * @return the error directory associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getErrorDirectory () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(ERROR_DIR_TAG);
-	}
-	
-	/**
-	 * Set the error suffix for this EPR.
-	 * 
-	 * @param suffix the suffix to use.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setErrorSuffix (String suffix) throws URISyntaxException
-	{
-		if (suffix == null)
-			throw new IllegalArgumentException();
-		
-		if (errorSuffixSet)
-			throw new IllegalStateException("Cannot change error suffix");
-		
-		getAddr().addExtension(ERROR_SUFFIX_TAG, suffix);
-		errorSuffixSet = true;
-	}
-	
-	/**
-	 * @return the error suffix associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getErrorSuffix () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(ERROR_SUFFIX_TAG);
-	}
-	
-	/**
-	 * Set the error delete for this EPR. (invalid Message files will be deleted)
-	 * 
-	 * @param del the deleted value to use.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setErrorDelete (boolean del) throws URISyntaxException
-	{		
-		if (errorDelSet)
-			throw new IllegalStateException("Cannot change error delete");
-		
-		if (del)
-			getAddr().addExtension(ERROR_DEL_TAG, "true");
-		else
-			getAddr().addExtension(ERROR_DEL_TAG, "false");
-		
-		errorDelSet = true;
-	}
-	
-	/**
-	 * Attention - Default 
-	 * @return the error delete value associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final boolean getErrorDelete () throws URISyntaxException
-	{
-		return (! "false".equals(getAddr().getExtensionValue(ERROR_DEL_TAG)));
-	}
-		
-	public static URI type ()
-	{
-	    return _type;
-	}
-	
-	protected FileEpr (URI uri)
-	{
-		super(uri);
-	}
-
-	private boolean inputSet = false;
-	private boolean workSet = false;
-	private boolean postDirSet = false;
-	private boolean postSuffixSet = false;
-	private boolean postDelSet = false;
-	private boolean errorDirSet = false;
-	private boolean errorSuffixSet = false;
-	private boolean errorDelSet = false;
-	
-	private static URI _type;
-	
-	static
-	{
-	    try
-		{
-		    _type = new URI("urn:jboss/esb/epr/type/file");
-		}
-		catch (Exception ex)
-		{
-		    ex.printStackTrace();
-		    
-		    throw new ExceptionInInitializerError(ex.toString());
-		}
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/FileEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,430 @@
+package org.jboss.soa.esb.addressing.eprs;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+
+/**
+ * This class represents the endpoint reference for services.
+ */
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * A helper class for using file based  EPRs. Simply create instances of this
+ * class instead of the base EPR. Since URLs can use file:// as the protocol, we try to leverage
+ * that as much as possible.
+ * 
+ * @author marklittle
+ *
+ */
+public class FileEpr extends EPR
+{
+	public static final String INPUT_SUFFIX_TAG = "inputSuffix";
+	public static final String WORK_SUFFIX_TAG 	= "workSuffix";
+	public static final String POST_DIR_TAG 	= "postDir";
+	public static final String POST_SUFFIX_TAG 	= "postSuffix";
+	public static final String POST_DEL_TAG 	= "postDelete";
+	public static final String ERROR_DIR_TAG 	= "errorDir";
+	public static final String ERROR_SUFFIX_TAG	= "errorSuffix";
+	public static final String ERROR_DEL_TAG 	= "errorDelete";
+	public static final String URL_TAG = "URL";
+	
+	public static final String DEFAULT_REPLY_TO_FILE_SUFFIX = "_reply";
+	
+	public FileEpr (EPR epr)
+	{
+		copy(epr);
+	}
+	
+	public FileEpr (EPR epr, Element header)
+	{
+		copy(epr);
+		
+		NodeList nl = header.getChildNodes();
+
+		for (int i = 0; i < nl.getLength(); i++)
+		{
+			try
+			{
+				String prefix = nl.item(i).getPrefix();
+				String tag = nl.item(i).getLocalName();
+				
+				if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
+				{
+					if (tag != null)
+					{
+						if (tag.equals(INPUT_SUFFIX_TAG))
+							getAddr().addExtension(INPUT_SUFFIX_TAG, nl.item(i).getTextContent());
+						else
+						{
+							if (tag.equals(POST_DIR_TAG))
+								getAddr().addExtension(POST_DIR_TAG, nl.item(i).getTextContent());
+							else
+							{
+								if (tag.equals(POST_SUFFIX_TAG))
+									getAddr().addExtension(POST_SUFFIX_TAG, nl.item(i).getTextContent());
+								else
+								{
+									if (tag.equals(POST_DEL_TAG))
+										getAddr().addExtension(POST_DEL_TAG, nl.item(i).getTextContent());
+									else
+									{
+										if (tag.equals(ERROR_DIR_TAG))
+										{
+											getAddr().addExtension(ERROR_DIR_TAG, nl.item(i).getTextContent());
+										}
+										else
+										{
+											if (tag.equals((ERROR_SUFFIX_TAG)))
+												getAddr().addExtension(ERROR_SUFFIX_TAG, nl.item(i).getTextContent());
+											else
+											{
+												if (tag.equals((ERROR_DEL_TAG)))
+													getAddr().addExtension(ERROR_DEL_TAG, nl.item(i).getTextContent());
+											}
+										}
+									}
+								}
+							}
+						}	
+					}
+				}
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+			}
+		}
+	}
+
+	public FileEpr (URL url) throws URISyntaxException
+	{
+		super(new URI(url.toString()));
+	}
+	
+	public FileEpr (String url) throws URISyntaxException
+	{
+		super(new URI(url));
+	}
+
+	/**
+	 * Set the URL for this endpoint.
+	 * 
+	 * @param url the address.
+	 */
+	
+	public void setURL (URL url)
+	{
+		super.setAddr(new PortReference(url.toString()));
+	}
+	
+	/**
+	 * Get the URL address.
+	 * 
+	 * @return the address.
+	 * @throws URISyntaxException thrown if the address is invalid.
+	 */
+	
+	public URL getURL () throws MalformedURLException, URISyntaxException
+	{
+		return new URL(super.getAddr().getAddress());
+	}
+
+	/**
+	 * Set the file input suffix.
+	 * 
+	 * @param suffix the input suffix to use.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setInputSuffix (String suffix) throws URISyntaxException
+	{
+		if (suffix == null)
+			throw new IllegalArgumentException();
+		
+		if (inputSet)
+			throw new IllegalStateException("Input suffix already set.");
+		
+		getAddr().addExtension(INPUT_SUFFIX_TAG, suffix);
+		inputSet = true;
+	}
+	
+	/**
+	 * @return the input suffix associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getInputSuffix () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(INPUT_SUFFIX_TAG);
+	}
+	
+	/**
+	 * Set the work suffix for this EPR.
+	 * 
+	 * @param suffix the suffix to use.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setWorkSuffix (String suffix) throws URISyntaxException
+	{
+		if (suffix == null)
+			throw new IllegalArgumentException();
+		
+		if (workSet)
+			throw new IllegalStateException("Cannot change work suffix");
+		
+		getAddr().addExtension(WORK_SUFFIX_TAG, suffix);
+		workSet = true;
+	}
+	
+	/**
+	 * @return the work suffix associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getWorkSuffix () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(WORK_SUFFIX_TAG);
+	}
+	
+	/**
+	 * Set the post directory for this EPR.
+	 * 
+	 * @param dir the directory to use.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setPostDirectory (String dir) throws URISyntaxException
+	{
+		if (dir == null)
+			throw new IllegalArgumentException();
+		
+		if (postDirSet)
+			throw new IllegalStateException("Cannot change post directory");
+		
+		getAddr().addExtension(POST_DIR_TAG, dir);
+		postDirSet = true;
+	}
+	
+	/**
+	 * @return the post directory associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getPostDirectory () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(POST_DIR_TAG);
+	}
+	
+	/**
+	 * Set the post suffix for this EPR.
+	 * 
+	 * @param suffix the suffix to use.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setPostSuffix (String suffix) throws URISyntaxException
+	{
+		if (suffix == null)
+			throw new IllegalArgumentException();
+		
+		if (postSuffixSet)
+			throw new IllegalStateException("Cannot change post suffix");
+		
+		getAddr().addExtension(POST_SUFFIX_TAG, suffix);
+		postSuffixSet = true;
+	}
+	
+	/**
+	 * @return the post suffix associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getPostSuffix () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(POST_SUFFIX_TAG);
+	}
+	
+	/**
+	 * Set the post delete for this EPR.
+	 * 
+	 * @param del the deleted value to use.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setPostDelete (boolean del) throws URISyntaxException
+	{		
+		if (postDelSet)
+			throw new IllegalStateException("Cannot change post delete");
+		
+		if (del)
+			getAddr().addExtension(POST_DEL_TAG, "true");
+		else
+			getAddr().addExtension(POST_DEL_TAG, "false");
+		
+		postDelSet = true;
+	}
+	
+	/**
+	 * @return the delete vazlue associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final boolean getPostDelete () throws URISyntaxException
+	{
+		return ("true".equals(getAddr().getExtensionValue(POST_DEL_TAG)));
+	}
+		
+	/**
+	 * Set the error directory for this EPR.
+	 * 
+	 * @param dir the directory to use.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setErrorDirectory (String dir) throws URISyntaxException
+	{
+		if (dir == null)
+			throw new IllegalArgumentException();
+		
+		if (errorDirSet)
+			throw new IllegalStateException("Cannot change error directory");
+		
+		getAddr().addExtension(ERROR_DIR_TAG, dir);
+		errorDirSet = true;
+	}
+	
+	/**
+	 * @return the error directory associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getErrorDirectory () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(ERROR_DIR_TAG);
+	}
+	
+	/**
+	 * Set the error suffix for this EPR.
+	 * 
+	 * @param suffix the suffix to use.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setErrorSuffix (String suffix) throws URISyntaxException
+	{
+		if (suffix == null)
+			throw new IllegalArgumentException();
+		
+		if (errorSuffixSet)
+			throw new IllegalStateException("Cannot change error suffix");
+		
+		getAddr().addExtension(ERROR_SUFFIX_TAG, suffix);
+		errorSuffixSet = true;
+	}
+	
+	/**
+	 * @return the error suffix associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getErrorSuffix () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(ERROR_SUFFIX_TAG);
+	}
+	
+	/**
+	 * Set the error delete for this EPR. (invalid Message files will be deleted)
+	 * 
+	 * @param del the deleted value to use.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setErrorDelete (boolean del) throws URISyntaxException
+	{		
+		if (errorDelSet)
+			throw new IllegalStateException("Cannot change error delete");
+		
+		if (del)
+			getAddr().addExtension(ERROR_DEL_TAG, "true");
+		else
+			getAddr().addExtension(ERROR_DEL_TAG, "false");
+		
+		errorDelSet = true;
+	}
+	
+	/**
+	 * Attention - Default 
+	 * @return the error delete value associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final boolean getErrorDelete () throws URISyntaxException
+	{
+		return (! "false".equals(getAddr().getExtensionValue(ERROR_DEL_TAG)));
+	}
+		
+	public static URI type ()
+	{
+	    return _type;
+	}
+	
+	protected FileEpr (URI uri)
+	{
+		super(uri);
+	}
+
+	private boolean inputSet = false;
+	private boolean workSet = false;
+	private boolean postDirSet = false;
+	private boolean postSuffixSet = false;
+	private boolean postDelSet = false;
+	private boolean errorDirSet = false;
+	private boolean errorSuffixSet = false;
+	private boolean errorDelSet = false;
+	
+	private static URI _type;
+	
+	static
+	{
+	    try
+		{
+		    _type = new URI("urn:jboss/esb/epr/type/file");
+		}
+		catch (Exception ex)
+		{
+		    ex.printStackTrace();
+		    
+		    throw new ExceptionInInitializerError(ex.toString());
+		}
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,111 +0,0 @@
-package org.jboss.soa.esb.addressing.eprs;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-
-/**
- * This class represents the endpoint reference for services.
- */
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.PortReference;
-import org.w3c.dom.Element;
-
-/**
- * A helper class for using HTTP style EPRs. Simply create instances of this
- * class instead of the base EPR.
- * 
- * @author marklittle
- *
- */
-public class HTTPEpr extends EPR
-{
-
-	public HTTPEpr (EPR epr)
-	{
-		copy(epr);
-	}
-	
-	public HTTPEpr (EPR epr, Element header)
-	{
-		copy(epr);
-	}
-	
-	public HTTPEpr (URL url) throws URISyntaxException
-	{
-		super(new URI(url.toString()));
-	}
-	
-	public HTTPEpr (String url) throws URISyntaxException
-	{
-		super(new URI(url));
-	}
-	
-	/**
-	 * Set the URL for this endpoint.
-	 * 
-	 * @param url the address.
-	 */
-	
-	public final void setURL (URL url)
-	{
-		super.setAddr(new PortReference(url.toString()));
-	}
-	
-	/**
-	 * Get the URL address.
-	 * 
-	 * @return the address.
-	 * @throws URISyntaxException thrown if the address is invalid.
-	 */
-	
-	public final URL getURL () throws MalformedURLException, URISyntaxException
-	{
-		return new URL(super.getAddr().getAddress());
-	}
-	
-	public static final URI type ()
-	{
-	    return _type;
-	}
-
-	private static URI _type;
-	
-	static
-	{
-	    try
-		{
-		    _type = new URI("urn:jboss/esb/epr/type/http");
-		}
-		catch (Exception ex)
-		{
-		    ex.printStackTrace();
-		    
-		    throw new ExceptionInInitializerError(ex.toString());
-		}
-	}
-} 
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HTTPEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,111 @@
+package org.jboss.soa.esb.addressing.eprs;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+
+/**
+ * This class represents the endpoint reference for services.
+ */
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.w3c.dom.Element;
+
+/**
+ * A helper class for using HTTP style EPRs. Simply create instances of this
+ * class instead of the base EPR.
+ * 
+ * @author marklittle
+ *
+ */
+public class HTTPEpr extends EPR
+{
+
+	public HTTPEpr (EPR epr)
+	{
+		copy(epr);
+	}
+	
+	public HTTPEpr (EPR epr, Element header)
+	{
+		copy(epr);
+	}
+	
+	public HTTPEpr (URL url) throws URISyntaxException
+	{
+		super(new URI(url.toString()));
+	}
+	
+	public HTTPEpr (String url) throws URISyntaxException
+	{
+		super(new URI(url));
+	}
+	
+	/**
+	 * Set the URL for this endpoint.
+	 * 
+	 * @param url the address.
+	 */
+	
+	public final void setURL (URL url)
+	{
+		super.setAddr(new PortReference(url.toString()));
+	}
+	
+	/**
+	 * Get the URL address.
+	 * 
+	 * @return the address.
+	 * @throws URISyntaxException thrown if the address is invalid.
+	 */
+	
+	public final URL getURL () throws MalformedURLException, URISyntaxException
+	{
+		return new URL(super.getAddr().getAddress());
+	}
+	
+	public static final URI type ()
+	{
+	    return _type;
+	}
+
+	private static URI _type;
+	
+	static
+	{
+	    try
+		{
+		    _type = new URI("urn:jboss/esb/epr/type/http");
+		}
+		catch (Exception ex)
+		{
+		    ex.printStackTrace();
+		    
+		    throw new ExceptionInInitializerError(ex.toString());
+		}
+	}
+} 
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,367 +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.addressing.eprs;
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.PortReference;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * This class is a helper class for using Hibernate EPRs.
- *
- * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
- */
-public class HibernateEpr extends EPR {
-	// TODO: Need to remove String constants and getter/setters for messagefield,
-	// status-field, data-field, insert-timestamp-field, postDelete, errorDelete 
-	// all of which are unused.
-	
-	public static final String LOAD_LISTENER = "loadListener";
-	public static final String SAVE_LISTENER = "saveListener";
-	public static final String DELETE_LISTENER = "deleteListener";
-
-	public static final String CLASS_NAME_TAG 			= "classname";
-	public static final String EVENT_TAG				= "event";
-	public static final String HIBERNATE_CFG_TAG		= "hibernate-cfg-file";
-		
-	
-	
-	public static final String MESSAGE_FIELD_TAG 		= "message-field";
-	public static final String STATUS_FIELD_TAG 		= "status-field";
-	public static final String DATA_FIELD_TAG 			= "data-field";
-	public static final String TIMESTAMP_FIELD_TAG 		= "insert-timestamp-field";
-	public static final String POST_DEL_TAG				= "postDelete";
-	public static final String ERROR_DEL_TAG			= "errorDelete";
-	
-
-	public static final String DEFAULT_REPLY_TO_CLASS_SUFFIX = "_reply_table";
-	
-	private boolean loadListener = true;
-	private boolean saveListener = true;
-	private boolean deleteListener = true;
-	private boolean cfgFileSet = false;
-	private boolean classNameSet = false;
-	private boolean statusSet = false;
-	private boolean messageSet = false;
-	private boolean timestampSet = false;
-	private boolean dataSet = false;
-
-	private static URI m_type;
-
-	
-	public HibernateEpr(EPR epr) {
-		copy(epr);
-	}
-	
-	public HibernateEpr (EPR epr, Element header)
-	{
-		copy(epr);
-		
-		NodeList nl = header.getChildNodes();
-		for (int i = 0; i < nl.getLength(); i++)
-		{
-			try
-			{
-				String tag = nl.item(i).getLocalName();
-				
-				if (tag != null)
-				{
-					if (tag.equals(HIBERNATE_CFG_TAG)) {
-						getAddr().addExtension(HIBERNATE_CFG_TAG, nl.item(i).getTextContent());
-					} else if (tag.equals(CLASS_NAME_TAG)) {
-						getAddr().addExtension(CLASS_NAME_TAG, nl.item(i).getTextContent());
-					} else if (tag.equals(EVENT_TAG)) {
-						getAddr().addExtension(EVENT_TAG, nl.item(i).getTextContent());
-					}
-				}
-			} catch (Exception ex) {
-				ex.printStackTrace();
-			}
-		}
-	}
-	
-	@Override
-	public PortReference getAddr() {
-		// TODO Auto-generated method stub
-		return super.getAddr();
-	}
-
-	@Override
-	public void setAddr(PortReference uri) {
-		// TODO Auto-generated method stub
-		super.setAddr(uri);
-	}
-	
-	/**
-	 * @return the driver used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getHibernateCfgFile () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(HIBERNATE_CFG_TAG);
-	}
-	
-	/**
-	 * Set the tablename that is used by this EPR.
-	 * 
-	 * @param cfgFile the table name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setHibernateCfgFile(String cfgFile) throws URISyntaxException
-	{
-		if (cfgFile == null)
-			throw new IllegalArgumentException();
-		
-		if (cfgFileSet)
-			throw new IllegalStateException("Table name already set.");
-		
-		getAddr().addExtension(HIBERNATE_CFG_TAG, cfgFile);
-		cfgFileSet = true;
-	}
-	
-	/**
-	 * Set the tablename that is used by this EPR.
-	 * 
-	 * @param className the table name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setClassName (String className) throws URISyntaxException
-	{
-		if (className == null)
-			throw new IllegalArgumentException();
-		
-		if (classNameSet)
-			throw new IllegalStateException("Table name already set.");
-		
-		getAddr().addExtension(CLASS_NAME_TAG, className);
-		classNameSet = true;
-	}
-	
-	/**
-	 * @return the table name used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getClassName () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(CLASS_NAME_TAG);
-	}
-	
-	
-	
-	
-	/**
-	 * Set the event that is used by this EPR.
-	 * 
-	 * @param eventName the table name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setEvent (String eventName) throws URISyntaxException
-	{
-		if (eventName == null)
-			throw new IllegalArgumentException();
-		
-		if (classNameSet)
-			throw new IllegalStateException("Table name already set.");
-		
-		getAddr().addExtension(EVENT_TAG, eventName);
-		classNameSet = true;
-	}
-	
-	/**
-	 * @return the table name used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getEvent () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(EVENT_TAG);
-	}
-	
-	/**
-	 * Set the status column that is used by this EPR.
-	 * 
-	 * @param statusField the status field.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setStatusField (String statusField) throws URISyntaxException
-	{
-		if (statusField == null)
-			throw new IllegalArgumentException();
-		
-		if (statusSet)
-			throw new IllegalStateException("Status column already set.");
-		
-		getAddr().addExtension(STATUS_FIELD_TAG, statusField);
-		statusSet = true;
-	}
-	
-	/**
-	 * @return the status column name used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getStatusField () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(STATUS_FIELD_TAG);
-	}
-	
-	/**
-	 * 
-	 * @param messageFieldName 
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setMessageField (String messageFieldName) throws URISyntaxException
-	{
-		if (messageFieldName == null)
-			throw new IllegalArgumentException();
-		
-		if (messageSet)
-			throw new IllegalStateException("Message Id column already set.");
-		
-		getAddr().addExtension(MESSAGE_FIELD_TAG, messageFieldName);
-		messageSet = true;
-	}
-	
-	/**
-	 * @return the message id column used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getMessageField () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(MESSAGE_FIELD_TAG);
-	}
-	
-	
-	/**
-	 * Set the column that is used by this EPR to store timestamp when the message was inserted.
-	 * 
-	 * @param timeField the column name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setTimestampField (String timeField) throws URISyntaxException
-	{
-		if (timeField == null)
-			throw new IllegalArgumentException();
-		
-		if (timestampSet)
-			throw new IllegalStateException("Timestamp column already set.");
-		
-		getAddr().addExtension(TIMESTAMP_FIELD_TAG, timeField);
-		timestampSet = true;
-	}
-	
-	/**
-	 * @return the timestamp column name used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getTimestampColumn () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(TIMESTAMP_FIELD_TAG);
-	}
-	
-	/**
-	 * Set the field that is used by this EPR to store message data.
-	 * 
-	 * @param dataField the column name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setDataField (String dataField) throws URISyntaxException
-	{
-		if (dataField == null)
-			throw new IllegalArgumentException();
-		
-		if (dataSet)
-			throw new IllegalStateException("Data field already set.");
-		
-		getAddr().addExtension(DATA_FIELD_TAG, dataField);
-		dataSet = true;
-	}
-	
-	/**
-	 * @return the data column name used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getDataField () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(DATA_FIELD_TAG);
-	}
-	
-	
-	public boolean isDeleteListener() {
-		return deleteListener;
-	}
-
-	public void setDeleteListener(boolean deleteListener) {
-		this.deleteListener = deleteListener;
-	}
-
-	public boolean isLoadListener() {
-		return loadListener;
-	}
-
-	public void setLoadListener(boolean loadListener) {
-		this.loadListener = loadListener;
-	}
-
-	public boolean isSaveListener() {
-		return saveListener;
-	}
-
-	public void setSaveListener(boolean saveListener) {
-		this.saveListener = saveListener;
-	}	
-	
-	public static final URI type ()
-	{
-	    return m_type;
-	}
-	
-	static
-	{
-	    try
-		{
-		    m_type = new URI("urn:jboss/esb/epr/type/hibernate");
-		}
-		catch (Exception ex)
-		{
-		    ex.printStackTrace();
-		    
-		    throw new ExceptionInInitializerError(ex.toString());
-		}
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/HibernateEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,367 @@
+/*
+ * 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.addressing.eprs;
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * This class is a helper class for using Hibernate EPRs.
+ *
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ */
+public class HibernateEpr extends EPR {
+	// TODO: Need to remove String constants and getter/setters for messagefield,
+	// status-field, data-field, insert-timestamp-field, postDelete, errorDelete 
+	// all of which are unused.
+	
+	public static final String LOAD_LISTENER = "loadListener";
+	public static final String SAVE_LISTENER = "saveListener";
+	public static final String DELETE_LISTENER = "deleteListener";
+
+	public static final String CLASS_NAME_TAG 			= "classname";
+	public static final String EVENT_TAG				= "event";
+	public static final String HIBERNATE_CFG_TAG		= "hibernate-cfg-file";
+		
+	
+	
+	public static final String MESSAGE_FIELD_TAG 		= "message-field";
+	public static final String STATUS_FIELD_TAG 		= "status-field";
+	public static final String DATA_FIELD_TAG 			= "data-field";
+	public static final String TIMESTAMP_FIELD_TAG 		= "insert-timestamp-field";
+	public static final String POST_DEL_TAG				= "postDelete";
+	public static final String ERROR_DEL_TAG			= "errorDelete";
+	
+
+	public static final String DEFAULT_REPLY_TO_CLASS_SUFFIX = "_reply_table";
+	
+	private boolean loadListener = true;
+	private boolean saveListener = true;
+	private boolean deleteListener = true;
+	private boolean cfgFileSet = false;
+	private boolean classNameSet = false;
+	private boolean statusSet = false;
+	private boolean messageSet = false;
+	private boolean timestampSet = false;
+	private boolean dataSet = false;
+
+	private static URI m_type;
+
+	
+	public HibernateEpr(EPR epr) {
+		copy(epr);
+	}
+	
+	public HibernateEpr (EPR epr, Element header)
+	{
+		copy(epr);
+		
+		NodeList nl = header.getChildNodes();
+		for (int i = 0; i < nl.getLength(); i++)
+		{
+			try
+			{
+				String tag = nl.item(i).getLocalName();
+				
+				if (tag != null)
+				{
+					if (tag.equals(HIBERNATE_CFG_TAG)) {
+						getAddr().addExtension(HIBERNATE_CFG_TAG, nl.item(i).getTextContent());
+					} else if (tag.equals(CLASS_NAME_TAG)) {
+						getAddr().addExtension(CLASS_NAME_TAG, nl.item(i).getTextContent());
+					} else if (tag.equals(EVENT_TAG)) {
+						getAddr().addExtension(EVENT_TAG, nl.item(i).getTextContent());
+					}
+				}
+			} catch (Exception ex) {
+				ex.printStackTrace();
+			}
+		}
+	}
+	
+	@Override
+	public PortReference getAddr() {
+		// TODO Auto-generated method stub
+		return super.getAddr();
+	}
+
+	@Override
+	public void setAddr(PortReference uri) {
+		// TODO Auto-generated method stub
+		super.setAddr(uri);
+	}
+	
+	/**
+	 * @return the driver used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getHibernateCfgFile () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(HIBERNATE_CFG_TAG);
+	}
+	
+	/**
+	 * Set the tablename that is used by this EPR.
+	 * 
+	 * @param cfgFile the table name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setHibernateCfgFile(String cfgFile) throws URISyntaxException
+	{
+		if (cfgFile == null)
+			throw new IllegalArgumentException();
+		
+		if (cfgFileSet)
+			throw new IllegalStateException("Table name already set.");
+		
+		getAddr().addExtension(HIBERNATE_CFG_TAG, cfgFile);
+		cfgFileSet = true;
+	}
+	
+	/**
+	 * Set the tablename that is used by this EPR.
+	 * 
+	 * @param className the table name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setClassName (String className) throws URISyntaxException
+	{
+		if (className == null)
+			throw new IllegalArgumentException();
+		
+		if (classNameSet)
+			throw new IllegalStateException("Table name already set.");
+		
+		getAddr().addExtension(CLASS_NAME_TAG, className);
+		classNameSet = true;
+	}
+	
+	/**
+	 * @return the table name used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getClassName () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(CLASS_NAME_TAG);
+	}
+	
+	
+	
+	
+	/**
+	 * Set the event that is used by this EPR.
+	 * 
+	 * @param eventName the table name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setEvent (String eventName) throws URISyntaxException
+	{
+		if (eventName == null)
+			throw new IllegalArgumentException();
+		
+		if (classNameSet)
+			throw new IllegalStateException("Table name already set.");
+		
+		getAddr().addExtension(EVENT_TAG, eventName);
+		classNameSet = true;
+	}
+	
+	/**
+	 * @return the table name used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getEvent () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(EVENT_TAG);
+	}
+	
+	/**
+	 * Set the status column that is used by this EPR.
+	 * 
+	 * @param statusField the status field.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setStatusField (String statusField) throws URISyntaxException
+	{
+		if (statusField == null)
+			throw new IllegalArgumentException();
+		
+		if (statusSet)
+			throw new IllegalStateException("Status column already set.");
+		
+		getAddr().addExtension(STATUS_FIELD_TAG, statusField);
+		statusSet = true;
+	}
+	
+	/**
+	 * @return the status column name used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getStatusField () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(STATUS_FIELD_TAG);
+	}
+	
+	/**
+	 * 
+	 * @param messageFieldName 
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setMessageField (String messageFieldName) throws URISyntaxException
+	{
+		if (messageFieldName == null)
+			throw new IllegalArgumentException();
+		
+		if (messageSet)
+			throw new IllegalStateException("Message Id column already set.");
+		
+		getAddr().addExtension(MESSAGE_FIELD_TAG, messageFieldName);
+		messageSet = true;
+	}
+	
+	/**
+	 * @return the message id column used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getMessageField () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(MESSAGE_FIELD_TAG);
+	}
+	
+	
+	/**
+	 * Set the column that is used by this EPR to store timestamp when the message was inserted.
+	 * 
+	 * @param timeField the column name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setTimestampField (String timeField) throws URISyntaxException
+	{
+		if (timeField == null)
+			throw new IllegalArgumentException();
+		
+		if (timestampSet)
+			throw new IllegalStateException("Timestamp column already set.");
+		
+		getAddr().addExtension(TIMESTAMP_FIELD_TAG, timeField);
+		timestampSet = true;
+	}
+	
+	/**
+	 * @return the timestamp column name used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getTimestampColumn () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(TIMESTAMP_FIELD_TAG);
+	}
+	
+	/**
+	 * Set the field that is used by this EPR to store message data.
+	 * 
+	 * @param dataField the column name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setDataField (String dataField) throws URISyntaxException
+	{
+		if (dataField == null)
+			throw new IllegalArgumentException();
+		
+		if (dataSet)
+			throw new IllegalStateException("Data field already set.");
+		
+		getAddr().addExtension(DATA_FIELD_TAG, dataField);
+		dataSet = true;
+	}
+	
+	/**
+	 * @return the data column name used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getDataField () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(DATA_FIELD_TAG);
+	}
+	
+	
+	public boolean isDeleteListener() {
+		return deleteListener;
+	}
+
+	public void setDeleteListener(boolean deleteListener) {
+		this.deleteListener = deleteListener;
+	}
+
+	public boolean isLoadListener() {
+		return loadListener;
+	}
+
+	public void setLoadListener(boolean loadListener) {
+		this.loadListener = loadListener;
+	}
+
+	public boolean isSaveListener() {
+		return saveListener;
+	}
+
+	public void setSaveListener(boolean saveListener) {
+		this.saveListener = saveListener;
+	}	
+	
+	public static final URI type ()
+	{
+	    return m_type;
+	}
+	
+	static
+	{
+	    try
+		{
+		    m_type = new URI("urn:jboss/esb/epr/type/hibernate");
+		}
+		catch (Exception ex)
+		{
+		    ex.printStackTrace();
+		    
+		    throw new ExceptionInInitializerError(ex.toString());
+		}
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,502 +0,0 @@
-package org.jboss.soa.esb.addressing.eprs;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-
-/**
- * This class represents the endpoint reference for services.
- */
-
-import java.net.URI;
-import java.net.URISyntaxException;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.PortReference;
-import org.jboss.soa.esb.addressing.XMLUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * A helper class for using database style EPRs. Simply create instances of this
- * class instead of the base EPR.
- * 
- * @author marklittle
- *
- */
-
-public class JDBCEpr extends EPR
-{
-	public static final String JDBC_PROTOCOL = "jdbc";
-	
-	public static final String USERNAME_TAG = "username";
-	public static final String PASSWORD_TAG = "password";
-	public static final String SQL_TAG = "sql";
-	public static final String DRIVER_TAG = "driver";
-	public static final String URL_TAG = "URL";
-
-	public static final String TABLE_NAME_TAG 			= "tablename";
-	public static final String MESSAGE_ID_COLUMN_TAG 	= "message_id_column";
-	public static final String STATUS_COLUMN_TAG 		= "status_column";
-	public static final String DATA_COLUMN_TAG 			= "message_column";
-	public static final String TIMESTAMP_COLUMN_TAG 	= "insert_timestamp_column";
-	public static final String POST_DEL_TAG				= "postDelete";
-	public static final String ERROR_DEL_TAG			= "errorDelete";
-	
-	public static final String DEFAULT_REPLY_TO_TABLE_SUFFIX = "_reply_table";
-	
-	public JDBCEpr (EPR epr)
-	{
-		copy(epr);
-	}
-	
-	public JDBCEpr (EPR epr, Element header)
-	{
-		copy(epr);
-		
-		NodeList nl = header.getChildNodes();
-
-		for (int i = 0; i < nl.getLength(); i++)
-		{
-			try
-			{
-				String prefix = nl.item(i).getPrefix();
-				String tag = nl.item(i).getLocalName();
-				
-				if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
-				{
-					if (tag != null)
-					{
-						if (tag.equals(USERNAME_TAG))
-							getAddr().addExtension(USERNAME_TAG, nl.item(i).getTextContent());
-						else
-						{
-							if (tag.equals(PASSWORD_TAG))
-								getAddr().addExtension(PASSWORD_TAG, nl.item(i).getTextContent());
-							else
-							{
-								if (tag.equals(SQL_TAG))
-									getAddr().addExtension(SQL_TAG, nl.item(i).getTextContent());
-								else
-								{
-									if (tag.equals(DRIVER_TAG))
-										getAddr().addExtension(DRIVER_TAG, nl.item(i).getTextContent());
-									else
-									{
-										if (tag.equals(URL_TAG))
-											getAddr().addExtension(URL_TAG, nl.item(i).getTextContent());
-										else
-										{
-											if (tag.equals(TABLE_NAME_TAG))
-												getAddr().addExtension(TABLE_NAME_TAG, nl.item(i).getTextContent());
-											else
-											{
-												if (tag.equals(MESSAGE_ID_COLUMN_TAG))
-													getAddr().addExtension(MESSAGE_ID_COLUMN_TAG, nl.item(i).getTextContent());
-												else
-												{
-													if (tag.equals(STATUS_COLUMN_TAG))
-														getAddr().addExtension(STATUS_COLUMN_TAG, nl.item(i).getTextContent());
-													else
-													{
-														if (tag.equals(DATA_COLUMN_TAG))
-															getAddr().addExtension(DATA_COLUMN_TAG, nl.item(i).getTextContent());
-														else
-														{
-															if (tag.equals(TIMESTAMP_COLUMN_TAG))
-																getAddr().addExtension(TIMESTAMP_COLUMN_TAG, nl.item(i).getTextContent());
-															else
-															{
-																if (tag.equals(POST_DEL_TAG))
-																	getAddr().addExtension(POST_DEL_TAG, nl.item(i).getTextContent());
-																else
-																{
-																	if (tag.equals(ERROR_DEL_TAG))
-																		getAddr().addExtension(ERROR_DEL_TAG, nl.item(i).getTextContent());
-																}
-															}
-														}
-													}
-												}
-											}
-										}
-									}
-								}
-							}
-						}
-					}
-				}
-			}
-			catch (Exception ex)
-			{
-				ex.printStackTrace();
-			}
-		}
-	}			
-	
-	public JDBCEpr (String url, String sql) throws URISyntaxException
-	{
-		super(new URI(url));
-		
-		setSQL(sql);
-	}
-
-	public JDBCEpr (String url) throws URISyntaxException
-	{
-		this(url,true,true);
-	}
-
-	public JDBCEpr (String url, boolean postDelete, boolean errorDelete) throws URISyntaxException
-	{
-		super(new URI(url));
-		if (postDelete)
-			getAddr().addExtension(POST_DEL_TAG,Boolean.toString(postDelete));
-		if (errorDelete)
-			getAddr().addExtension(ERROR_DEL_TAG,Boolean.toString(errorDelete));
-	}
-
-	/**
-	 * Set the URL for this endpoint.
-	 * 
-	 * @param url the address.
-	 */
-	
-	public final void setURL (String url)
-	{
-		super.setAddr(new PortReference(url));
-	}
-	
-	/**
-	 * Get the URL address.
-	 * 
-	 * @return the address.
-	 * @throws URISyntaxException thrown if the address is invalid.
-	 */
-	
-	public final String getURL () throws URISyntaxException
-	{
-		return getAddr().getAddress();
-	}
-
-	/**
-	 * Set the username for this FTP EPR.
-	 * 
-	 * @param username the user's name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setUserName (String username) throws URISyntaxException
-	{
-		if (username == null)
-			throw new IllegalArgumentException();
-		
-		if (userSet)
-			throw new IllegalStateException("Username already set.");
-		
-		getAddr().addExtension(USERNAME_TAG, username);
-		userSet = true;
-	}
-	
-	/**
-	 * @return the user's name associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getUserName () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(USERNAME_TAG);
-	}
-	
-	/**
-	 * Set the password for this FTP EPR.
-	 * 
-	 * @param password the user's name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setPassword (String password) throws URISyntaxException
-	{
-		if (password == null)
-			throw new IllegalArgumentException();
-		
-		if (passwordSet)
-			throw new IllegalStateException("Password already set.");
-		
-		getAddr().addExtension(PASSWORD_TAG, password);
-		passwordSet = true;
-	}
-	
-	/**
-	 * @return the password associated with this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getPassword () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(PASSWORD_TAG);
-	}
-	
-	/**
-	 * Set the SQL command that is used by this EPR.
-	 * 
-	 * @param sql the statement.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setSQL (String sql) throws URISyntaxException
-	{
-		if (sql == null)
-			throw new IllegalArgumentException();
-		
-		if (sqlSet)
-			throw new IllegalStateException("SQL already set.");
-		
-		getAddr().addExtension(SQL_TAG, sql);
-		sqlSet = true;
-	}
-	
-	/**
-	 * @return the SQL statement for this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getSQL () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(SQL_TAG);
-	}
-	
-	/**
-	 * Set the driver that is used by this EPR.
-	 * 
-	 * @param driver the driver.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setDriver (String driver) throws URISyntaxException
-	{
-		if (driver == null)
-			throw new IllegalArgumentException();
-		
-		if (driverSet)
-			throw new IllegalStateException("Driver already set.");
-		
-		getAddr().addExtension(DRIVER_TAG, driver);
-		driverSet = true;
-	}
-	
-	/**
-	 * @return the driver used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getDriver () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(DRIVER_TAG);
-	}
-	
-	/**
-	 * Set the tablename that is used by this EPR.
-	 * 
-	 * @param tableName the table name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setTableName (String tableName) throws URISyntaxException
-	{
-		if (tableName == null)
-			throw new IllegalArgumentException();
-		
-		if (tableNameSet)
-			throw new IllegalStateException("Table name already set.");
-		
-		getAddr().addExtension(TABLE_NAME_TAG, tableName);
-		tableNameSet = true;
-	}
-	
-	/**
-	 * @return the table name used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getTableName () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(TABLE_NAME_TAG);
-	}
-	
-	/**
-	 * Set the message id column name that is used by this EPR.
-	 * 
-	 * @param columnName the column name for the message ID.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setMessageIdColumn (String columnName) throws URISyntaxException
-	{
-		if (columnName == null)
-			throw new IllegalArgumentException();
-		
-		if (messageIdSet)
-			throw new IllegalStateException("Message Id column already set.");
-		
-		getAddr().addExtension(MESSAGE_ID_COLUMN_TAG, columnName);
-		messageIdSet = true;
-	}
-	
-	/**
-	 * @return the message id column used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getMessageIdColumn () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(MESSAGE_ID_COLUMN_TAG);
-	}
-	
-	/**
-	 * Set the status column that is used by this EPR.
-	 * 
-	 * @param statusColumn the status column.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setStatusColumn (String statusColumn) throws URISyntaxException
-	{
-		if (statusColumn == null)
-			throw new IllegalArgumentException();
-		
-		if (statusSet)
-			throw new IllegalStateException("Status column already set.");
-		
-		getAddr().addExtension(STATUS_COLUMN_TAG, statusColumn);
-		statusSet = true;
-	}
-	
-	/**
-	 * @return the status column name used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getStatusColumn () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(STATUS_COLUMN_TAG);
-	}
-	
-	/**
-	 * Set the column that is used by this EPR to store message data.
-	 * 
-	 * @param dataColumn the column name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setDataColumn (String dataColumn) throws URISyntaxException
-	{
-		if (dataColumn == null)
-			throw new IllegalArgumentException();
-		
-		if (dataSet)
-			throw new IllegalStateException("Data column already set.");
-		
-		getAddr().addExtension(DATA_COLUMN_TAG, dataColumn);
-		dataSet = true;
-	}
-	
-	/**
-	 * @return the data column name used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getDataColumn () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(DATA_COLUMN_TAG);
-	}
-	
-	/**
-	 * Set the column that is used by this EPR to store timestamp when the message was inserted.
-	 * 
-	 * @param timeColumn the column name.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final void setTimestampColumn (String timeColumn) throws URISyntaxException
-	{
-		if (timeColumn == null)
-			throw new IllegalArgumentException();
-		
-		if (timestampSet)
-			throw new IllegalStateException("Timestamp column already set.");
-		
-		getAddr().addExtension(TIMESTAMP_COLUMN_TAG, timeColumn);
-		timestampSet = true;
-	}
-	
-	/**
-	 * @return the timestamp column name used by this EPR.
-	 * @throws URISyntaxException thrown if this EPR is malformed.
-	 */
-	
-	public final String getTimestampColumn () throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(TIMESTAMP_COLUMN_TAG);
-	}
-	
-	
-	public final String getPostDelete() throws URISyntaxException
-	{
-	    return getAddr().getExtensionValue(POST_DEL_TAG);
-	}
-	
-	public final String getErrorDelete() throws URISyntaxException
-	{
-	    return getAddr().getExtensionValue(ERROR_DEL_TAG);
-	}
-	
-	public static final URI type ()
-	{
-	    return _type;
-	}
-	
-	private boolean userSet = false;
-	private boolean passwordSet = false;
-	private boolean sqlSet = false;
-	private boolean driverSet = false;
-	private boolean tableNameSet = false;
-	private boolean messageIdSet = false;
-	private boolean statusSet = false;
-	private boolean dataSet = false;
-	private boolean timestampSet = false;
-	
-	private static URI _type;
-	
-	static
-	{
-	    try
-		{
-		    _type = new URI("urn:jboss/esb/epr/type/jdbc");
-		}
-		catch (Exception ex)
-		{
-		    ex.printStackTrace();
-		    
-		    throw new ExceptionInInitializerError(ex.toString());
-		}
-	}
-	
-} 
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JDBCEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,502 @@
+package org.jboss.soa.esb.addressing.eprs;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+
+/**
+ * This class represents the endpoint reference for services.
+ */
+
+import java.net.URI;
+import java.net.URISyntaxException;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * A helper class for using database style EPRs. Simply create instances of this
+ * class instead of the base EPR.
+ * 
+ * @author marklittle
+ *
+ */
+
+public class JDBCEpr extends EPR
+{
+	public static final String JDBC_PROTOCOL = "jdbc";
+	
+	public static final String USERNAME_TAG = "username";
+	public static final String PASSWORD_TAG = "password";
+	public static final String SQL_TAG = "sql";
+	public static final String DRIVER_TAG = "driver";
+	public static final String URL_TAG = "URL";
+
+	public static final String TABLE_NAME_TAG 			= "tablename";
+	public static final String MESSAGE_ID_COLUMN_TAG 	= "message_id_column";
+	public static final String STATUS_COLUMN_TAG 		= "status_column";
+	public static final String DATA_COLUMN_TAG 			= "message_column";
+	public static final String TIMESTAMP_COLUMN_TAG 	= "insert_timestamp_column";
+	public static final String POST_DEL_TAG				= "postDelete";
+	public static final String ERROR_DEL_TAG			= "errorDelete";
+	
+	public static final String DEFAULT_REPLY_TO_TABLE_SUFFIX = "_reply_table";
+	
+	public JDBCEpr (EPR epr)
+	{
+		copy(epr);
+	}
+	
+	public JDBCEpr (EPR epr, Element header)
+	{
+		copy(epr);
+		
+		NodeList nl = header.getChildNodes();
+
+		for (int i = 0; i < nl.getLength(); i++)
+		{
+			try
+			{
+				String prefix = nl.item(i).getPrefix();
+				String tag = nl.item(i).getLocalName();
+				
+				if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
+				{
+					if (tag != null)
+					{
+						if (tag.equals(USERNAME_TAG))
+							getAddr().addExtension(USERNAME_TAG, nl.item(i).getTextContent());
+						else
+						{
+							if (tag.equals(PASSWORD_TAG))
+								getAddr().addExtension(PASSWORD_TAG, nl.item(i).getTextContent());
+							else
+							{
+								if (tag.equals(SQL_TAG))
+									getAddr().addExtension(SQL_TAG, nl.item(i).getTextContent());
+								else
+								{
+									if (tag.equals(DRIVER_TAG))
+										getAddr().addExtension(DRIVER_TAG, nl.item(i).getTextContent());
+									else
+									{
+										if (tag.equals(URL_TAG))
+											getAddr().addExtension(URL_TAG, nl.item(i).getTextContent());
+										else
+										{
+											if (tag.equals(TABLE_NAME_TAG))
+												getAddr().addExtension(TABLE_NAME_TAG, nl.item(i).getTextContent());
+											else
+											{
+												if (tag.equals(MESSAGE_ID_COLUMN_TAG))
+													getAddr().addExtension(MESSAGE_ID_COLUMN_TAG, nl.item(i).getTextContent());
+												else
+												{
+													if (tag.equals(STATUS_COLUMN_TAG))
+														getAddr().addExtension(STATUS_COLUMN_TAG, nl.item(i).getTextContent());
+													else
+													{
+														if (tag.equals(DATA_COLUMN_TAG))
+															getAddr().addExtension(DATA_COLUMN_TAG, nl.item(i).getTextContent());
+														else
+														{
+															if (tag.equals(TIMESTAMP_COLUMN_TAG))
+																getAddr().addExtension(TIMESTAMP_COLUMN_TAG, nl.item(i).getTextContent());
+															else
+															{
+																if (tag.equals(POST_DEL_TAG))
+																	getAddr().addExtension(POST_DEL_TAG, nl.item(i).getTextContent());
+																else
+																{
+																	if (tag.equals(ERROR_DEL_TAG))
+																		getAddr().addExtension(ERROR_DEL_TAG, nl.item(i).getTextContent());
+																}
+															}
+														}
+													}
+												}
+											}
+										}
+									}
+								}
+							}
+						}
+					}
+				}
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+			}
+		}
+	}			
+	
+	public JDBCEpr (String url, String sql) throws URISyntaxException
+	{
+		super(new URI(url));
+		
+		setSQL(sql);
+	}
+
+	public JDBCEpr (String url) throws URISyntaxException
+	{
+		this(url,true,true);
+	}
+
+	public JDBCEpr (String url, boolean postDelete, boolean errorDelete) throws URISyntaxException
+	{
+		super(new URI(url));
+		if (postDelete)
+			getAddr().addExtension(POST_DEL_TAG,Boolean.toString(postDelete));
+		if (errorDelete)
+			getAddr().addExtension(ERROR_DEL_TAG,Boolean.toString(errorDelete));
+	}
+
+	/**
+	 * Set the URL for this endpoint.
+	 * 
+	 * @param url the address.
+	 */
+	
+	public final void setURL (String url)
+	{
+		super.setAddr(new PortReference(url));
+	}
+	
+	/**
+	 * Get the URL address.
+	 * 
+	 * @return the address.
+	 * @throws URISyntaxException thrown if the address is invalid.
+	 */
+	
+	public final String getURL () throws URISyntaxException
+	{
+		return getAddr().getAddress();
+	}
+
+	/**
+	 * Set the username for this FTP EPR.
+	 * 
+	 * @param username the user's name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setUserName (String username) throws URISyntaxException
+	{
+		if (username == null)
+			throw new IllegalArgumentException();
+		
+		if (userSet)
+			throw new IllegalStateException("Username already set.");
+		
+		getAddr().addExtension(USERNAME_TAG, username);
+		userSet = true;
+	}
+	
+	/**
+	 * @return the user's name associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getUserName () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(USERNAME_TAG);
+	}
+	
+	/**
+	 * Set the password for this FTP EPR.
+	 * 
+	 * @param password the user's name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setPassword (String password) throws URISyntaxException
+	{
+		if (password == null)
+			throw new IllegalArgumentException();
+		
+		if (passwordSet)
+			throw new IllegalStateException("Password already set.");
+		
+		getAddr().addExtension(PASSWORD_TAG, password);
+		passwordSet = true;
+	}
+	
+	/**
+	 * @return the password associated with this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getPassword () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(PASSWORD_TAG);
+	}
+	
+	/**
+	 * Set the SQL command that is used by this EPR.
+	 * 
+	 * @param sql the statement.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setSQL (String sql) throws URISyntaxException
+	{
+		if (sql == null)
+			throw new IllegalArgumentException();
+		
+		if (sqlSet)
+			throw new IllegalStateException("SQL already set.");
+		
+		getAddr().addExtension(SQL_TAG, sql);
+		sqlSet = true;
+	}
+	
+	/**
+	 * @return the SQL statement for this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getSQL () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(SQL_TAG);
+	}
+	
+	/**
+	 * Set the driver that is used by this EPR.
+	 * 
+	 * @param driver the driver.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setDriver (String driver) throws URISyntaxException
+	{
+		if (driver == null)
+			throw new IllegalArgumentException();
+		
+		if (driverSet)
+			throw new IllegalStateException("Driver already set.");
+		
+		getAddr().addExtension(DRIVER_TAG, driver);
+		driverSet = true;
+	}
+	
+	/**
+	 * @return the driver used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getDriver () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(DRIVER_TAG);
+	}
+	
+	/**
+	 * Set the tablename that is used by this EPR.
+	 * 
+	 * @param tableName the table name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setTableName (String tableName) throws URISyntaxException
+	{
+		if (tableName == null)
+			throw new IllegalArgumentException();
+		
+		if (tableNameSet)
+			throw new IllegalStateException("Table name already set.");
+		
+		getAddr().addExtension(TABLE_NAME_TAG, tableName);
+		tableNameSet = true;
+	}
+	
+	/**
+	 * @return the table name used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getTableName () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(TABLE_NAME_TAG);
+	}
+	
+	/**
+	 * Set the message id column name that is used by this EPR.
+	 * 
+	 * @param columnName the column name for the message ID.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setMessageIdColumn (String columnName) throws URISyntaxException
+	{
+		if (columnName == null)
+			throw new IllegalArgumentException();
+		
+		if (messageIdSet)
+			throw new IllegalStateException("Message Id column already set.");
+		
+		getAddr().addExtension(MESSAGE_ID_COLUMN_TAG, columnName);
+		messageIdSet = true;
+	}
+	
+	/**
+	 * @return the message id column used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getMessageIdColumn () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(MESSAGE_ID_COLUMN_TAG);
+	}
+	
+	/**
+	 * Set the status column that is used by this EPR.
+	 * 
+	 * @param statusColumn the status column.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setStatusColumn (String statusColumn) throws URISyntaxException
+	{
+		if (statusColumn == null)
+			throw new IllegalArgumentException();
+		
+		if (statusSet)
+			throw new IllegalStateException("Status column already set.");
+		
+		getAddr().addExtension(STATUS_COLUMN_TAG, statusColumn);
+		statusSet = true;
+	}
+	
+	/**
+	 * @return the status column name used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getStatusColumn () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(STATUS_COLUMN_TAG);
+	}
+	
+	/**
+	 * Set the column that is used by this EPR to store message data.
+	 * 
+	 * @param dataColumn the column name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setDataColumn (String dataColumn) throws URISyntaxException
+	{
+		if (dataColumn == null)
+			throw new IllegalArgumentException();
+		
+		if (dataSet)
+			throw new IllegalStateException("Data column already set.");
+		
+		getAddr().addExtension(DATA_COLUMN_TAG, dataColumn);
+		dataSet = true;
+	}
+	
+	/**
+	 * @return the data column name used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getDataColumn () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(DATA_COLUMN_TAG);
+	}
+	
+	/**
+	 * Set the column that is used by this EPR to store timestamp when the message was inserted.
+	 * 
+	 * @param timeColumn the column name.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final void setTimestampColumn (String timeColumn) throws URISyntaxException
+	{
+		if (timeColumn == null)
+			throw new IllegalArgumentException();
+		
+		if (timestampSet)
+			throw new IllegalStateException("Timestamp column already set.");
+		
+		getAddr().addExtension(TIMESTAMP_COLUMN_TAG, timeColumn);
+		timestampSet = true;
+	}
+	
+	/**
+	 * @return the timestamp column name used by this EPR.
+	 * @throws URISyntaxException thrown if this EPR is malformed.
+	 */
+	
+	public final String getTimestampColumn () throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(TIMESTAMP_COLUMN_TAG);
+	}
+	
+	
+	public final String getPostDelete() throws URISyntaxException
+	{
+	    return getAddr().getExtensionValue(POST_DEL_TAG);
+	}
+	
+	public final String getErrorDelete() throws URISyntaxException
+	{
+	    return getAddr().getExtensionValue(ERROR_DEL_TAG);
+	}
+	
+	public static final URI type ()
+	{
+	    return _type;
+	}
+	
+	private boolean userSet = false;
+	private boolean passwordSet = false;
+	private boolean sqlSet = false;
+	private boolean driverSet = false;
+	private boolean tableNameSet = false;
+	private boolean messageIdSet = false;
+	private boolean statusSet = false;
+	private boolean dataSet = false;
+	private boolean timestampSet = false;
+	
+	private static URI _type;
+	
+	static
+	{
+	    try
+		{
+		    _type = new URI("urn:jboss/esb/epr/type/jdbc");
+		}
+		catch (Exception ex)
+		{
+		    ex.printStackTrace();
+		    
+		    throw new ExceptionInInitializerError(ex.toString());
+		}
+	}
+	
+} 
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,357 +0,0 @@
-package org.jboss.soa.esb.addressing.eprs;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * This class represents the endpoint reference for services.
- */
-
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Iterator;
-import java.util.Properties;
-
-import javax.naming.Context;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.PortReference;
-import org.jboss.soa.esb.addressing.XMLUtil;
-import org.jboss.soa.esb.addressing.PortReference.Extension;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * A helper class for using JMS style EPRs. Simply create and use instances of
- * this type.
- * 
- * @author marklittle
- * 
- */
-
-public class JMSEpr extends EPR
-{
-	public static final String JMS_PROTOCOL = "jms";
-
-	public static final String PROTOCOL_SEPARATOR = "://";
-
-	public static final String ONE_ONE_PROTOCOL = "1.1";
-
-	public static final String ONE_ZERO_TWO_PROTOCOL = "1.0.2b";
-
-	public static final String SPECIFICATION_VERSION_TAG = "specification-version";
-
-	public static final String DESTINATION_TYPE_TAG = "destination-type";
-
-	public static final String DESTINATION_NAME_TAG = "destination-name";
-
-	public static final String CONNECTION_FACTORY_TAG = "connection-factory";
-
-	public static final String JNDI_PKG_PREFIX_TAG = "jndi-pkg-prefix";
-
-	public static final String JNDI_URL_TAG = "jndi-URL";
-
-	public static final String JNDI_CONTEXT_FACTORY_TAG = "jndi-context-factory";
-
-	public static final String MESSAGE_SELECTOR_TAG = "message-selector";
-
-	public static final String QUEUE_TYPE = "queue";
-
-	public static final String TOPIC_TYPE = "topic";
-	
-	public static final String DEFAULT_REPLY_TO_DESTINATION_SUFFIX = "_reply";
-
-	public JMSEpr(EPR epr)
-	{
-		copy(epr);
-	}
-	
-	public JMSEpr(EPR epr, Element header)
-	{
-		copy(epr);
-		
-		NodeList nl = header.getChildNodes();
-		String uri = null;
-		String name = null;
-		
-		for (int i = 0; i < nl.getLength(); i++)
-		{
-			String prefix = nl.item(i).getPrefix();
-			String tag = nl.item(i).getLocalName();
-			
-			if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
-			{
-				if (tag != null)
-				{
-                    if (tag.startsWith("java.naming.")) {
-                        getAddr().addExtension(tag, nl.item(i).getTextContent());
-                    } else if (tag.equals(SPECIFICATION_VERSION_TAG)) {
-						getAddr().addExtension(SPECIFICATION_VERSION_TAG, nl.item(i).getTextContent());
-                    } else if (tag.equals(DESTINATION_NAME_TAG)) {
-						name = nl.item(i).getTextContent();
-                    } else if (tag.equals(CONNECTION_FACTORY_TAG)) {
-						getAddr().addExtension(CONNECTION_FACTORY_TAG, nl.item(i).getTextContent());
-                    } else if (tag.equals(JNDI_CONTEXT_FACTORY_TAG)) {
-						getAddr().addExtension(Context.INITIAL_CONTEXT_FACTORY, nl.item(i).getTextContent());
-                    } else if (tag.equals(JNDI_PKG_PREFIX_TAG)) {
-						getAddr().addExtension(Context.URL_PKG_PREFIXES, nl.item(i).getTextContent());
-                    } else if (tag.equals(JNDI_URL_TAG)) {
-                    	uri = nl.item(i).getTextContent();
-                    } else if (tag.equals(MESSAGE_SELECTOR_TAG)) {
-                    	getAddr().addExtension(MESSAGE_SELECTOR_TAG, nl.item(i).getTextContent());
-					}
-				}
-			}
-		}
-		
-		if (uri != null)
-			setAddr(new PortReference(JMS_PROTOCOL + PROTOCOL_SEPARATOR + uri + "/" + name));
-	}
-
-	/**
-	 * Create a new JMS EPR. The protocol version is assumed to be 1.1. ,
-	 * jndi_type="", jndi_url="", messageSelector=null
-	 * 
-	 * @param destinationType
-	 *            the type of destination (queue/topic).
-	 * @param destinationName
-	 *            name of the queue/topic.
-	 * @param connection
-	 *            reference to the connection factory.
-	 */
-
-	public JMSEpr(String destinationType, String destinationName,
-			String connection)
-	{
-		this(ONE_ONE_PROTOCOL, destinationType, destinationName, connection,
-				null, null);
-	}
-
-	/**
-	 * Create a new JMS EPR. The protocol version is assumed to be 1.1.
-	 * 
-	 * @param destinationType
-	 *            the type of destination (queue/topic).
-	 * @param destinationName
-	 *            name of the queue/topic.
-	 * @param connection
-	 *            reference to the connection factory.
-	 * @param environment
-	 *            reference to the jndi properties
-	 * @param messageSelector
-	 *            reference to the connection factory.
-	 */
-
-	public JMSEpr(String destinationType, String destinationName,
-			String connection, Properties environment, String messageSelector)
-	{
-		this(ONE_ONE_PROTOCOL, destinationType, destinationName, connection,
-				environment, messageSelector);
-	}
-
-	/**
-	 * Create a new JMS EPR.
-	 * 
-	 * @param protocol
-	 *            the protocol version.
-	 * @param destinationType
-	 *            the type of destination (queue/topic).
-	 * @param destinationName
-	 *            name of the queue/topic.
-	 * @param connection
-	 *            reference to the connection factory.
-	 * @param environment
-	 *            reference to the jndi properties
-	 * @param messageSelector
-	 *            reference to the connection factory.
-	 */
-
-	public JMSEpr(String protocol, String destinationType,
-			String destinationName, String connection, Properties environment,
-			String messageSelector)
-	{
-		// how many of these do we really need? modify accordingly.
-
-		if ((protocol == null) || (destinationType == null)
-				|| (destinationName == null) || (connection == null))
-			throw new IllegalArgumentException();
-
-		if (protocol.equals(ONE_ONE_PROTOCOL)
-				|| (protocol.equals(ONE_ZERO_TWO_PROTOCOL)))
-		{
-			if (destinationType.equals(QUEUE_TYPE)
-					|| destinationType.equals(TOPIC_TYPE))
-			{
-				String uri = "localhost"; // a default URI
-				String name = null;
-				PortReference addr = new PortReference();
-				
-                if (environment!=null) {
-                    for (Object key : environment.keySet()) {
-                    	if (key.toString().equals(JNDI_URL_TAG))
-                    		uri = environment.getProperty(key.toString());
-                    	else
-                    	{
-                    		if (key.toString().equals(DESTINATION_NAME_TAG))
-                    		{
-                    			name = environment.getProperty(key.toString());
-                    			
-                    			if ((destinationName != null) && !name.equals(destinationName))
-                    				throw new IllegalArgumentException("Destination name inconsistency: < "+name+", "+destinationName+" >");
-                    		}
-                    		else
-                    			addr.addExtension(key.toString(), environment.getProperty(key.toString()));
-                    	}
-                    }
-                    
-                    
-                }
-	
-                if (name == null)
-                	name = destinationName;
-                
-                addr.setAddress(JMS_PROTOCOL + PROTOCOL_SEPARATOR + uri + "/" + name);
-
-				addr.addExtension(DESTINATION_TYPE_TAG, destinationType);
-				
-				addr.addExtension(SPECIFICATION_VERSION_TAG, protocol);
-
-				if (connection != null)
-					addr.addExtension(CONNECTION_FACTORY_TAG, connection);
-
-				if (messageSelector != null)
-					addr.addExtension(MESSAGE_SELECTOR_TAG, messageSelector);
-                
-				
-				setAddr(addr);
-			}
-			else
-				throw new IllegalArgumentException("Invalid destination type! "+destinationType);
-		}
-		else
-			throw new IllegalArgumentException("Invalid specification version!");
-	}
-
-	/*
-	 * There are deliberately no setters for the values once the EPR is created.
-	 */
-
-	/**
-	 * @return the destination type used.
-	 * @throws URISyntaxException
-	 *             thrown if the address is malformed.
-	 */
-
-	public final String getDestinationType() throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(DESTINATION_TYPE_TAG);
-	}
-
-	/**
-	 * @return the specification version used.
-	 * @throws URISyntaxException
-	 *             thrown if the address is malformed.
-	 */
-
-	public final String getVersion() throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(SPECIFICATION_VERSION_TAG);
-	}
-
-	/**
-	 * @return the destination name used.
-	 * @throws URISyntaxException
-	 *             thrown if the address is malformed.
-	 */
-
-	public final String getDestinationName() throws URISyntaxException
-	{
-		URI uri = new URI(getAddr().getAddress());
-
-		return uri.getPath().substring(1);
-	}
-
-	/**
-	 * @return the connection factory for this EPR, or <code>null</code> if
-	 *         none is set.
-	 * @throws URISyntaxException
-	 *             thrown if the address is malformed.
-	 */
-
-	public final String getConnectionFactory() throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(CONNECTION_FACTORY_TAG);
-	}
-    
-    /**
-     * @return the jndi context factory for this EPR, or <code>null</code> if
-     *         none is set.
-     * @throws URISyntaxException
-     *             thrown if the address is malformed.
-     */
-
-    public final Properties getJndiEnvironment() throws URISyntaxException
-    {
-        Properties properties = new Properties();
-        Iterator<Extension> iter = getAddr().getExtensions();
-        while (iter.hasNext()) {
-            Extension extension = iter.next();
-            if (extension.getTag().startsWith("java.naming.") && extension.getValue()!=null) {
-                properties.put(extension.getTag(), extension.getValue());
-            }
-        }
-        return properties;
-    }
-
-	/**
-	 * @return the message selector for this EPR, or <code>null</code> if none
-	 *         is set.
-	 * @throws URISyntaxException
-	 *             thrown if the address is malformed.
-	 */
-
-	public final String getMessageSelector() throws URISyntaxException
-	{
-		return getAddr().getExtensionValue(MESSAGE_SELECTOR_TAG);
-	}
-
-	public static final URI type()
-	{
-		return _type;
-	}
-
-	private static URI _type;
-
-	static
-	{
-		try
-		{
-			_type = new URI("urn:jboss/esb/epr/type/jms");
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-
-			throw new ExceptionInInitializerError(ex.toString());
-		}
-	}
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/JMSEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,357 @@
+package org.jboss.soa.esb.addressing.eprs;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * This class represents the endpoint reference for services.
+ */
+
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Iterator;
+import java.util.Properties;
+
+import javax.naming.Context;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.jboss.soa.esb.addressing.PortReference.Extension;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * A helper class for using JMS style EPRs. Simply create and use instances of
+ * this type.
+ * 
+ * @author marklittle
+ * 
+ */
+
+public class JMSEpr extends EPR
+{
+	public static final String JMS_PROTOCOL = "jms";
+
+	public static final String PROTOCOL_SEPARATOR = "://";
+
+	public static final String ONE_ONE_PROTOCOL = "1.1";
+
+	public static final String ONE_ZERO_TWO_PROTOCOL = "1.0.2b";
+
+	public static final String SPECIFICATION_VERSION_TAG = "specification-version";
+
+	public static final String DESTINATION_TYPE_TAG = "destination-type";
+
+	public static final String DESTINATION_NAME_TAG = "destination-name";
+
+	public static final String CONNECTION_FACTORY_TAG = "connection-factory";
+
+	public static final String JNDI_PKG_PREFIX_TAG = "jndi-pkg-prefix";
+
+	public static final String JNDI_URL_TAG = "jndi-URL";
+
+	public static final String JNDI_CONTEXT_FACTORY_TAG = "jndi-context-factory";
+
+	public static final String MESSAGE_SELECTOR_TAG = "message-selector";
+
+	public static final String QUEUE_TYPE = "queue";
+
+	public static final String TOPIC_TYPE = "topic";
+	
+	public static final String DEFAULT_REPLY_TO_DESTINATION_SUFFIX = "_reply";
+
+	public JMSEpr(EPR epr)
+	{
+		copy(epr);
+	}
+	
+	public JMSEpr(EPR epr, Element header)
+	{
+		copy(epr);
+		
+		NodeList nl = header.getChildNodes();
+		String uri = null;
+		String name = null;
+		
+		for (int i = 0; i < nl.getLength(); i++)
+		{
+			String prefix = nl.item(i).getPrefix();
+			String tag = nl.item(i).getLocalName();
+			
+			if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
+			{
+				if (tag != null)
+				{
+                    if (tag.startsWith("java.naming.")) {
+                        getAddr().addExtension(tag, nl.item(i).getTextContent());
+                    } else if (tag.equals(SPECIFICATION_VERSION_TAG)) {
+						getAddr().addExtension(SPECIFICATION_VERSION_TAG, nl.item(i).getTextContent());
+                    } else if (tag.equals(DESTINATION_NAME_TAG)) {
+						name = nl.item(i).getTextContent();
+                    } else if (tag.equals(CONNECTION_FACTORY_TAG)) {
+						getAddr().addExtension(CONNECTION_FACTORY_TAG, nl.item(i).getTextContent());
+                    } else if (tag.equals(JNDI_CONTEXT_FACTORY_TAG)) {
+						getAddr().addExtension(Context.INITIAL_CONTEXT_FACTORY, nl.item(i).getTextContent());
+                    } else if (tag.equals(JNDI_PKG_PREFIX_TAG)) {
+						getAddr().addExtension(Context.URL_PKG_PREFIXES, nl.item(i).getTextContent());
+                    } else if (tag.equals(JNDI_URL_TAG)) {
+                    	uri = nl.item(i).getTextContent();
+                    } else if (tag.equals(MESSAGE_SELECTOR_TAG)) {
+                    	getAddr().addExtension(MESSAGE_SELECTOR_TAG, nl.item(i).getTextContent());
+					}
+				}
+			}
+		}
+		
+		if (uri != null)
+			setAddr(new PortReference(JMS_PROTOCOL + PROTOCOL_SEPARATOR + uri + "/" + name));
+	}
+
+	/**
+	 * Create a new JMS EPR. The protocol version is assumed to be 1.1. ,
+	 * jndi_type="", jndi_url="", messageSelector=null
+	 * 
+	 * @param destinationType
+	 *            the type of destination (queue/topic).
+	 * @param destinationName
+	 *            name of the queue/topic.
+	 * @param connection
+	 *            reference to the connection factory.
+	 */
+
+	public JMSEpr(String destinationType, String destinationName,
+			String connection)
+	{
+		this(ONE_ONE_PROTOCOL, destinationType, destinationName, connection,
+				null, null);
+	}
+
+	/**
+	 * Create a new JMS EPR. The protocol version is assumed to be 1.1.
+	 * 
+	 * @param destinationType
+	 *            the type of destination (queue/topic).
+	 * @param destinationName
+	 *            name of the queue/topic.
+	 * @param connection
+	 *            reference to the connection factory.
+	 * @param environment
+	 *            reference to the jndi properties
+	 * @param messageSelector
+	 *            reference to the connection factory.
+	 */
+
+	public JMSEpr(String destinationType, String destinationName,
+			String connection, Properties environment, String messageSelector)
+	{
+		this(ONE_ONE_PROTOCOL, destinationType, destinationName, connection,
+				environment, messageSelector);
+	}
+
+	/**
+	 * Create a new JMS EPR.
+	 * 
+	 * @param protocol
+	 *            the protocol version.
+	 * @param destinationType
+	 *            the type of destination (queue/topic).
+	 * @param destinationName
+	 *            name of the queue/topic.
+	 * @param connection
+	 *            reference to the connection factory.
+	 * @param environment
+	 *            reference to the jndi properties
+	 * @param messageSelector
+	 *            reference to the connection factory.
+	 */
+
+	public JMSEpr(String protocol, String destinationType,
+			String destinationName, String connection, Properties environment,
+			String messageSelector)
+	{
+		// how many of these do we really need? modify accordingly.
+
+		if ((protocol == null) || (destinationType == null)
+				|| (destinationName == null) || (connection == null))
+			throw new IllegalArgumentException();
+
+		if (protocol.equals(ONE_ONE_PROTOCOL)
+				|| (protocol.equals(ONE_ZERO_TWO_PROTOCOL)))
+		{
+			if (destinationType.equals(QUEUE_TYPE)
+					|| destinationType.equals(TOPIC_TYPE))
+			{
+				String uri = "localhost"; // a default URI
+				String name = null;
+				PortReference addr = new PortReference();
+				
+                if (environment!=null) {
+                    for (Object key : environment.keySet()) {
+                    	if (key.toString().equals(JNDI_URL_TAG))
+                    		uri = environment.getProperty(key.toString());
+                    	else
+                    	{
+                    		if (key.toString().equals(DESTINATION_NAME_TAG))
+                    		{
+                    			name = environment.getProperty(key.toString());
+                    			
+                    			if ((destinationName != null) && !name.equals(destinationName))
+                    				throw new IllegalArgumentException("Destination name inconsistency: < "+name+", "+destinationName+" >");
+                    		}
+                    		else
+                    			addr.addExtension(key.toString(), environment.getProperty(key.toString()));
+                    	}
+                    }
+                    
+                    
+                }
+	
+                if (name == null)
+                	name = destinationName;
+                
+                addr.setAddress(JMS_PROTOCOL + PROTOCOL_SEPARATOR + uri + "/" + name);
+
+				addr.addExtension(DESTINATION_TYPE_TAG, destinationType);
+				
+				addr.addExtension(SPECIFICATION_VERSION_TAG, protocol);
+
+				if (connection != null)
+					addr.addExtension(CONNECTION_FACTORY_TAG, connection);
+
+				if (messageSelector != null)
+					addr.addExtension(MESSAGE_SELECTOR_TAG, messageSelector);
+                
+				
+				setAddr(addr);
+			}
+			else
+				throw new IllegalArgumentException("Invalid destination type! "+destinationType);
+		}
+		else
+			throw new IllegalArgumentException("Invalid specification version!");
+	}
+
+	/*
+	 * There are deliberately no setters for the values once the EPR is created.
+	 */
+
+	/**
+	 * @return the destination type used.
+	 * @throws URISyntaxException
+	 *             thrown if the address is malformed.
+	 */
+
+	public final String getDestinationType() throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(DESTINATION_TYPE_TAG);
+	}
+
+	/**
+	 * @return the specification version used.
+	 * @throws URISyntaxException
+	 *             thrown if the address is malformed.
+	 */
+
+	public final String getVersion() throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(SPECIFICATION_VERSION_TAG);
+	}
+
+	/**
+	 * @return the destination name used.
+	 * @throws URISyntaxException
+	 *             thrown if the address is malformed.
+	 */
+
+	public final String getDestinationName() throws URISyntaxException
+	{
+		URI uri = new URI(getAddr().getAddress());
+
+		return uri.getPath().substring(1);
+	}
+
+	/**
+	 * @return the connection factory for this EPR, or <code>null</code> if
+	 *         none is set.
+	 * @throws URISyntaxException
+	 *             thrown if the address is malformed.
+	 */
+
+	public final String getConnectionFactory() throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(CONNECTION_FACTORY_TAG);
+	}
+    
+    /**
+     * @return the jndi context factory for this EPR, or <code>null</code> if
+     *         none is set.
+     * @throws URISyntaxException
+     *             thrown if the address is malformed.
+     */
+
+    public final Properties getJndiEnvironment() throws URISyntaxException
+    {
+        Properties properties = new Properties();
+        Iterator<Extension> iter = getAddr().getExtensions();
+        while (iter.hasNext()) {
+            Extension extension = iter.next();
+            if (extension.getTag().startsWith("java.naming.") && extension.getValue()!=null) {
+                properties.put(extension.getTag(), extension.getValue());
+            }
+        }
+        return properties;
+    }
+
+	/**
+	 * @return the message selector for this EPR, or <code>null</code> if none
+	 *         is set.
+	 * @throws URISyntaxException
+	 *             thrown if the address is malformed.
+	 */
+
+	public final String getMessageSelector() throws URISyntaxException
+	{
+		return getAddr().getExtensionValue(MESSAGE_SELECTOR_TAG);
+	}
+
+	public static final URI type()
+	{
+		return _type;
+	}
+
+	private static URI _type;
+
+	static
+	{
+		try
+		{
+			_type = new URI("urn:jboss/esb/epr/type/jms");
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+
+			throw new ExceptionInInitializerError(ex.toString());
+		}
+	}
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,164 +0,0 @@
-package org.jboss.soa.esb.addressing.eprs;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * This class represents the endpoint reference for services.
- */
-
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.XMLUtil;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * A helper class for using FTP style EPRs. Simply create instances of this
- * class instead of the base EPR. Since URLs can use FTP, we try to leverage
- * that as much as possible.
- * 
- * @author marklittle
- * 
- */
-public class SFTPEpr extends FTPEpr
-{
-	public static final String CERTIFICATE_TAG = "certificate";
-
-	public SFTPEpr(EPR epr)
-	{
-		super(epr);
-
-		copy(epr);
-	}
-	
-	public SFTPEpr (EPR epr, Element header)
-	{
-		super(epr, header);
-		
-		copy(epr);
-		
-		NodeList nl = header.getChildNodes();
-
-		for (int i = 0; i < nl.getLength(); i++)
-		{
-			String prefix = nl.item(i).getPrefix();
-			String tag = nl.item(i).getLocalName();
-			
-			try
-			{
-				if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
-				{
-					if ((tag != null) && (tag.equals(CERTIFICATE_TAG)))
-						getAddr().addExtension(CERTIFICATE_TAG, nl.item(i).getTextContent());
-				}
-			}
-			catch (Exception ex)
-			{
-				ex.printStackTrace();
-			}
-		}
-	}
-
-	public SFTPEpr(URL url) throws URISyntaxException
-	{
-		super(url);
-	}
-
-	public SFTPEpr(URL url, URL cert) throws URISyntaxException
-	{
-		super(url);
-		
-		setCertificateURL(cert);
-	}
-
-	public SFTPEpr(String url, String cert) throws URISyntaxException, MalformedURLException
-	{
-		super(url);	
-
-		setCertificateURL(new URL(cert));
-	}
-
-	/**
-	 * Set the Certificate URL for this endpoint.
-	 * 
-	 * @param cert
-	 *            the address.
-	 * @throws URISyntaxException
-	 *             thrown if this EPR is malformed.
-	 */
-
-	public final void setCertificateURL(URL cert) throws URISyntaxException
-	{
-		if (cert == null)
-			throw new IllegalArgumentException();
-
-		if (certificateSet)
-			throw new IllegalStateException("Certificate URL already set.");
-
-		getAddr().addExtension(CERTIFICATE_TAG, cert.toString());
-		certificateSet = true;
-	}
-
-	/**
-	 * @return the certificate URL for this EPR.
-	 * @throws URISyntaxException
-	 *             thrown if this EPR is malformed.
-	 */
-
-	public final URL getCertificateURL () throws URISyntaxException,
-			MalformedURLException
-	{
-		String cert = getAddr().getExtensionValue(CERTIFICATE_TAG);
-
-		if (cert != null)
-			return new URL(cert);
-		else
-			return null;
-	}
-
-	public static URI type ()
-	{
-		return _type;
-	}
-
-	private boolean certificateSet = false;
-
-	private static URI _type;
-
-	static
-	{
-		try
-		{
-			_type = new URI("urn:jboss/esb/epr/type/sftp");
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-
-			throw new ExceptionInInitializerError(ex.toString());
-		}
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/eprs/SFTPEpr.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,164 @@
+package org.jboss.soa.esb.addressing.eprs;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * This class represents the endpoint reference for services.
+ */
+
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * A helper class for using FTP style EPRs. Simply create instances of this
+ * class instead of the base EPR. Since URLs can use FTP, we try to leverage
+ * that as much as possible.
+ * 
+ * @author marklittle
+ * 
+ */
+public class SFTPEpr extends FTPEpr
+{
+	public static final String CERTIFICATE_TAG = "certificate";
+
+	public SFTPEpr(EPR epr)
+	{
+		super(epr);
+
+		copy(epr);
+	}
+	
+	public SFTPEpr (EPR epr, Element header)
+	{
+		super(epr, header);
+		
+		copy(epr);
+		
+		NodeList nl = header.getChildNodes();
+
+		for (int i = 0; i < nl.getLength(); i++)
+		{
+			String prefix = nl.item(i).getPrefix();
+			String tag = nl.item(i).getLocalName();
+			
+			try
+			{
+				if ((prefix != null) && (prefix.equals(XMLUtil.JBOSSESB_PREFIX)))
+				{
+					if ((tag != null) && (tag.equals(CERTIFICATE_TAG)))
+						getAddr().addExtension(CERTIFICATE_TAG, nl.item(i).getTextContent());
+				}
+			}
+			catch (Exception ex)
+			{
+				ex.printStackTrace();
+			}
+		}
+	}
+
+	public SFTPEpr(URL url) throws URISyntaxException
+	{
+		super(url);
+	}
+
+	public SFTPEpr(URL url, URL cert) throws URISyntaxException
+	{
+		super(url);
+		
+		setCertificateURL(cert);
+	}
+
+	public SFTPEpr(String url, String cert) throws URISyntaxException, MalformedURLException
+	{
+		super(url);	
+
+		setCertificateURL(new URL(cert));
+	}
+
+	/**
+	 * Set the Certificate URL for this endpoint.
+	 * 
+	 * @param cert
+	 *            the address.
+	 * @throws URISyntaxException
+	 *             thrown if this EPR is malformed.
+	 */
+
+	public final void setCertificateURL(URL cert) throws URISyntaxException
+	{
+		if (cert == null)
+			throw new IllegalArgumentException();
+
+		if (certificateSet)
+			throw new IllegalStateException("Certificate URL already set.");
+
+		getAddr().addExtension(CERTIFICATE_TAG, cert.toString());
+		certificateSet = true;
+	}
+
+	/**
+	 * @return the certificate URL for this EPR.
+	 * @throws URISyntaxException
+	 *             thrown if this EPR is malformed.
+	 */
+
+	public final URL getCertificateURL () throws URISyntaxException,
+			MalformedURLException
+	{
+		String cert = getAddr().getExtensionValue(CERTIFICATE_TAG);
+
+		if (cert != null)
+			return new URL(cert);
+		else
+			return null;
+	}
+
+	public static URI type ()
+	{
+		return _type;
+	}
+
+	private boolean certificateSet = false;
+
+	private static URI _type;
+
+	static
+	{
+		try
+		{
+			_type = new URI("urn:jboss/esb/epr/type/sftp");
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+
+			throw new ExceptionInInitializerError(ex.toString());
+		}
+	}
+}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,233 +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 mark.little at jboss.com
- */
-
-package org.jboss.soa.esb.addressing.util;
-
-import java.io.File;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.Hashtable;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.xml.sax.SAXException;
-
-/**
- * Allows EPRs to be saved to and loaded from files. Mainly for testing
- * purposes. This version assumes XML as the output format.
- * 
- * @author marklittle
- * 
- */
-
-public class EPRManager
-{
-
-	/**
-	 * All EPRs are saves in files within the current working directory.
-	 * 
-	 * @return the manager for the cwd.
-	 */
-
-	public static final EPRManager getInstance()
-	{
-		return getInstance("");
-	}
-
-	/**
-	 * All EPRs are saves in files within a defined directory. Get the right
-	 * manager for that directory.
-	 * 
-	 * @param domain
-	 *            the name of the directory. If <code>null</code> then the
-	 *            null String is assumed.
-	 * @return the manager for the directory. If it does not exist, then one
-	 *         will be created.
-	 */
-
-	public static final EPRManager getInstance(String domain)
-	{
-		if (domain == null)
-			domain = "";
-
-		synchronized (_instances)
-		{
-			EPRManager theInstance = _instances.get(domain);
-
-			if (theInstance == null)
-			{
-				theInstance = new EPRManager(domain);
-
-				_instances.put(domain, theInstance);
-			}
-
-			return theInstance;
-		}
-	}
-
-	public final String getDomain()
-	{
-		return _directory;
-	}
-
-	public boolean equals(Object manager)
-	{
-		if (manager instanceof EPRManager)
-		{
-			EPRManager comp = (EPRManager) manager;
-
-			if (_directory.equals(comp.getDomain()))
-				return true;
-		}
-
-		return false;
-	}
-
-	/**
-	 * Save the EPR into the specified file.
-	 * 
-	 * @param name
-	 *            the name of the file to use (the logical service name).
-	 * @param address
-	 *            the EPR to save.
-	 * 
-	 * @throws IOException
-	 *             thrown if there is an error.
-	 */
-
-	public final void saveEPR(String name, EPR address) throws IOException
-	{
-		if ((name == null) || (address == null))
-			throw new IllegalArgumentException();
-
-		try
-		{
-			String documentAsString = EPRHelper.toXMLString(address);
-
-			FileOutputStream output = new FileOutputStream(_directory
-					+ File.separator + name);
-
-                        try
-                        {
-                            output.write(documentAsString.getBytes());
-                            output.flush();
-                            output.getFD().sync(); // make sure it's on disk!
-                        }
-                        finally
-                        {
-                            output.close() ;
-                        }
-		}
-		catch (Exception ex)
-		{
-			throw new IOException(ex.toString());
-		}
-	}
-
-	/**
-	 * Remove the EPR-to-file association.
-	 * 
-	 * @param name
-	 *            the logical name for the service.
-	 * @throws IOException
-	 *             thrown if there are any errors.
-	 */
-
-	public final void removeEPR(String name) throws IOException
-	{
-		if (name == null)
-			throw new IllegalArgumentException();
-
-		File theFile = new File(_directory + File.separator + name);
-
-		if (theFile.exists())
-			theFile.delete();
-		else
-			throw new FileNotFoundException();
-	}
-
-	/**
-	 * Get the EPR specified by the logical name.
-	 * 
-	 * @param name
-	 *            the service name.
-	 * @return the EPR, or <code>null</code> if none exists.
-	 * @throws IOException
-	 *             thrown if there is an error.
-	 */
-
-	public final EPR loadEPR(String name) throws IOException
-	{
-		if (name == null)
-			throw new IllegalArgumentException();
-
-		File theFile = new File(_directory + File.separator + name);
-
-		try
-		{
-			if (theFile.exists())
-			{
-				DocumentBuilderFactory factory = DocumentBuilderFactory
-						.newInstance();
-				
-				factory.setNamespaceAware(true);
-				
-				DocumentBuilder builder = factory.newDocumentBuilder();
-				Document doc = builder.parse(theFile);
-				Element rootElement = doc.getDocumentElement();
-
-				return EPRHelper.fromXML(rootElement);
-			}
-			else
-				throw new FileNotFoundException(theFile.toString());
-		}
-		catch (UnmarshalException ex)
-		{
-			throw new IOException(ex.toString());
-		}
-		catch (SAXException ex)
-		{
-			throw new IOException(ex.toString());
-		}
-		catch (ParserConfigurationException ex)
-		{
-			throw new IllegalArgumentException(ex.toString());
-		}
-	}
-
-	protected EPRManager(String domain)
-	{
-		_directory = domain;
-	}
-
-	private String _directory;
-
-	private static Hashtable<String, EPRManager> _instances = new Hashtable<String, EPRManager>();
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/addressing/util/EPRManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,233 @@
+/*
+ * 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 mark.little at jboss.com
+ */
+
+package org.jboss.soa.esb.addressing.util;
+
+import java.io.File;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.Hashtable;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.xml.sax.SAXException;
+
+/**
+ * Allows EPRs to be saved to and loaded from files. Mainly for testing
+ * purposes. This version assumes XML as the output format.
+ * 
+ * @author marklittle
+ * 
+ */
+
+public class EPRManager
+{
+
+	/**
+	 * All EPRs are saves in files within the current working directory.
+	 * 
+	 * @return the manager for the cwd.
+	 */
+
+	public static final EPRManager getInstance()
+	{
+		return getInstance("");
+	}
+
+	/**
+	 * All EPRs are saves in files within a defined directory. Get the right
+	 * manager for that directory.
+	 * 
+	 * @param domain
+	 *            the name of the directory. If <code>null</code> then the
+	 *            null String is assumed.
+	 * @return the manager for the directory. If it does not exist, then one
+	 *         will be created.
+	 */
+
+	public static final EPRManager getInstance(String domain)
+	{
+		if (domain == null)
+			domain = "";
+
+		synchronized (_instances)
+		{
+			EPRManager theInstance = _instances.get(domain);
+
+			if (theInstance == null)
+			{
+				theInstance = new EPRManager(domain);
+
+				_instances.put(domain, theInstance);
+			}
+
+			return theInstance;
+		}
+	}
+
+	public final String getDomain()
+	{
+		return _directory;
+	}
+
+	public boolean equals(Object manager)
+	{
+		if (manager instanceof EPRManager)
+		{
+			EPRManager comp = (EPRManager) manager;
+
+			if (_directory.equals(comp.getDomain()))
+				return true;
+		}
+
+		return false;
+	}
+
+	/**
+	 * Save the EPR into the specified file.
+	 * 
+	 * @param name
+	 *            the name of the file to use (the logical service name).
+	 * @param address
+	 *            the EPR to save.
+	 * 
+	 * @throws IOException
+	 *             thrown if there is an error.
+	 */
+
+	public final void saveEPR(String name, EPR address) throws IOException
+	{
+		if ((name == null) || (address == null))
+			throw new IllegalArgumentException();
+
+		try
+		{
+			String documentAsString = EPRHelper.toXMLString(address);
+
+			FileOutputStream output = new FileOutputStream(_directory
+					+ File.separator + name);
+
+                        try
+                        {
+                            output.write(documentAsString.getBytes());
+                            output.flush();
+                            output.getFD().sync(); // make sure it's on disk!
+                        }
+                        finally
+                        {
+                            output.close() ;
+                        }
+		}
+		catch (Exception ex)
+		{
+			throw new IOException(ex.toString());
+		}
+	}
+
+	/**
+	 * Remove the EPR-to-file association.
+	 * 
+	 * @param name
+	 *            the logical name for the service.
+	 * @throws IOException
+	 *             thrown if there are any errors.
+	 */
+
+	public final void removeEPR(String name) throws IOException
+	{
+		if (name == null)
+			throw new IllegalArgumentException();
+
+		File theFile = new File(_directory + File.separator + name);
+
+		if (theFile.exists())
+			theFile.delete();
+		else
+			throw new FileNotFoundException();
+	}
+
+	/**
+	 * Get the EPR specified by the logical name.
+	 * 
+	 * @param name
+	 *            the service name.
+	 * @return the EPR, or <code>null</code> if none exists.
+	 * @throws IOException
+	 *             thrown if there is an error.
+	 */
+
+	public final EPR loadEPR(String name) throws IOException
+	{
+		if (name == null)
+			throw new IllegalArgumentException();
+
+		File theFile = new File(_directory + File.separator + name);
+
+		try
+		{
+			if (theFile.exists())
+			{
+				DocumentBuilderFactory factory = DocumentBuilderFactory
+						.newInstance();
+				
+				factory.setNamespaceAware(true);
+				
+				DocumentBuilder builder = factory.newDocumentBuilder();
+				Document doc = builder.parse(theFile);
+				Element rootElement = doc.getDocumentElement();
+
+				return EPRHelper.fromXML(rootElement);
+			}
+			else
+				throw new FileNotFoundException(theFile.toString());
+		}
+		catch (UnmarshalException ex)
+		{
+			throw new IOException(ex.toString());
+		}
+		catch (SAXException ex)
+		{
+			throw new IOException(ex.toString());
+		}
+		catch (ParserConfigurationException ex)
+		{
+			throw new IllegalArgumentException(ex.toString());
+		}
+	}
+
+	protected EPRManager(String domain)
+	{
+		_directory = domain;
+	}
+
+	private String _directory;
+
+	private static Hashtable<String, EPRManager> _instances = new Hashtable<String, EPRManager>();
+
+}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/common)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,370 +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.common;
-
-import java.util.Properties;
-
-import javax.jms.ConnectionFactory;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.helpers.NamingContext;
-
-public class Configuration
-{
-    private static Logger _logger = Logger.getLogger(Configuration.class);
-    
-	private static KeyValuePair[] s_oaKV = new KeyValuePair[]
-	{
-			new KeyValuePair(Environment.SMTP_HOST, 					getSmtpHost()),
-			new KeyValuePair(Environment.SMTP_USERNAME, 				getSmtpUsername()),
-			new KeyValuePair(Environment.SMTP_PASSWORD, 				getSmtpPassword()),
-			new KeyValuePair(Environment.SMTP_PORT, 					getSmtpPort()),
-			new KeyValuePair(Environment.SMTP_FROM, 					getSmtpFrom()),
-			new KeyValuePair(Environment.SMTP_AUTH, 					getSmtpAuth()),
-			new KeyValuePair(Environment.JNDI_SERVER_URL, 				getJndiServerURL()),
-			new KeyValuePair(Environment.JNDI_SERVER_CONTEXT_FACTORY,   getJndiServerContextFactory()),
-			new KeyValuePair(Environment.JNDI_SERVER_PKG_PREFIX, 	    getJndiServerPkgPrefix()),
-			new KeyValuePair(Environment.REGISTRY_QUERY_MANAGER_URI, 	getRegistryQueryManageURI()),
-			new KeyValuePair(Environment.REGISTRY_LIFECYCLE_MANAGER_URI,getRegistryLifecycleManagerURI()),
-			new KeyValuePair(Environment.REGISTRY_IMPEMENTATION_CLASS,  getRegistryImplementationClass()),
-			new KeyValuePair(Environment.REGISTRY_FACTORY_CLASS, 		getRegistryFactoryClass()),
-			new KeyValuePair(Environment.REGISTRY_USER, 				getRegistryUser()),
-			new KeyValuePair(Environment.REGISTRY_PASSWORD, 			getRegistryPassword()),
-			new KeyValuePair(Environment.REGISTRY_SCOUT_TRANSPORT_CLASS,getRegistryScoutTransportClass()),
-			new KeyValuePair(Environment.PARAMS_REPOS_IMPL_CLASS,		getParamRepositoryImplClass()),
-			new KeyValuePair(Environment.OBJECT_STORE_CONFIG_FILE, 		getObjStoreConfigFile()),
-			new KeyValuePair(Environment.ENCRYPT_FACTORY_CLASS, 		getEncryptionFactoryClass()),
-			new KeyValuePair(Environment.MSG_STORE_DB_CONNECTION_URL, 	getStoreUrl()),
-			new KeyValuePair(Environment.MSG_STORE_DB_JDBC_DRIVER, 		getStoreDriver()),
-			new KeyValuePair(Environment.MSG_STORE_DB_CONNECTION_USER, 	getStoreUser()),
-			new KeyValuePair(Environment.MSG_STORE_DB_CONNECTION_PWD, 	getStorePwd()),
-			new KeyValuePair(Environment.MSG_STORE_DB_POOL_MIN_SIZE, 	getStorePoolMinSize()),
-			new KeyValuePair(Environment.MSG_STORE_DB_POOL_MAX_SIZE, 	getStorePoolMaxSize()),
-			new KeyValuePair(Environment.MSG_STORE_DB_POOL_INITIAL_SIZE,getStorePoolInitialSize()),
-			new KeyValuePair(Environment.MSG_STORE_DB_POOL_TEST_TABLE,  getStorePoolTestTable()),
-			new KeyValuePair(Environment.MSG_STORE_DB_POOL_TIMEOUT_MILLIS,getStorePoolTimeoutMillis()),
-			new KeyValuePair(Environment.MSG_STORE_DB_CONN_MANAGER		,getStoreDBConnectionManager()),
-			new KeyValuePair(Environment.MSG_STORE_DB_DATASOURCE_NAME	,getStoreDBDatasourceName())
-	};
-
-	public static String dump()
-	{
-		StringBuilder sb = new StringBuilder("Dump of SystemProperties:\n");
-		for (KeyValuePair oCurr : s_oaKV)
-		{
-			sb.append(oCurr.getKey()).append("=").append(oCurr.getValue())
-					.append("\n");
-		}
-		return sb.append("______________________________________").toString();
-	} // ________________________________
-
-	public static String getSmtpHost()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_HOST, Environment.DEFAULT_HOST);
-	}
-
-	public static String getSmtpUsername()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_USERNAME,
-				Environment.DEFAULT_USERNAME);
-	}
-
-	public static String getSmtpPassword()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_PASSWORD,
-				Environment.DEFAULT_PASSWORD);
-	}
-
-	public static String getSmtpPort()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_PORT, Environment.DEFAULT_PORT);
-	}
-
-	public static String getSmtpFrom()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_FROM);
-	}
-
-	public static String getSmtpAuth()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_AUTH);
-	}
-
-	public static String getJndiServerURL()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.JNDI_SERVER_URL,
-				Environment.DEFAULT_HOST);
-	}
-	
-	public static String getJndiServerContextFactory()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.JNDI_SERVER_CONTEXT_FACTORY,
-				Environment.DEFAULT_JNDI_CONTEXT_FACTORY);
-	}
-	
-	public static String getJndiServerPkgPrefix()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.JNDI_SERVER_PKG_PREFIX,
-				Environment.DEFAULT_JNDI_PKG_PREFIX);
-	}
-	/**
-	 * The Registry Query Manager URI can be used to obtain information about services and their endPoints.
-	 * @return Registry Query Manager URI String
-	 */
-	public static String getRegistryQueryManageURI()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_QUERY_MANAGER_URI);
-	}
-	/**
-	 * The Registry Lifecycle Manager URI can be use to publish services.
-	 * @return Registry Lifecycle Manager URI String
-	 */
-	public static String getRegistryLifecycleManagerURI()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_LIFECYCLE_MANAGER_URI);
-	}
-	/**
-	 * The Registry Factory Class setting specifies which JAXR implementation should be used.
-	 * @return Registry Factory Class String
-	 */
-	public static String getRegistryFactoryClass()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_FACTORY_CLASS);
-	}
-	/**
-	 * The Registry Implememtation Class defines wrapper class
-	 * @return Registry Implementation Class String
-	 */
-	public static String getRegistryImplementationClass()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS);
-	}
-	/**
-	 * The Registry Scout Transport Class defines which communication protocol Scout should use to communicate
-	 * with the UDDI registry. Note that this parameter is Scout specific.
-	 * @return Registry Scout Transport Class String
-	 */
-	public static String getRegistryScoutTransportClass()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_SCOUT_TRANSPORT_CLASS);
-	}
-	/**
-	 * The Registry User is used to inquire and publish to the Registry.
-	 * @return Registry User String
-	 */
-	public static String getRegistryUser()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_USER);
-	}
-	/**
-	 * The Registry Password that goes with the Registry User.
-	 * @return Registry Password String
-	 */
-	public static String getRegistryPassword()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_PASSWORD);
-	}
-	
-	public static String getParamRepositoryImplClass()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.PARAMS_REPOS_IMPL_CLASS);
-	}
-
-	public static String getObjStoreConfigFile()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.OBJECT_STORE_CONFIG_FILE);
-		return property;
-	}
-
-	public static String getEncryptionFactoryClass()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.ENCRYPT_FACTORY_CLASS,
-				org.jboss.soa.esb.services.DefaultEncryptionFactory.class
-						.getName());
-	}
-	
-	public static String getStoreUrl()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONNECTION_URL);
-		return property;
-	}
-	
-	public static String getStoreDriver()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_JDBC_DRIVER);
-		return property;
-	}	
-	
-	public static String getStorePwd()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONNECTION_PWD);
-		return property;
-	}
-	
-	public static String getStoreUser()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONNECTION_USER);
-		return property;
-	}
-	
-	public static String getStorePoolInitialSize()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_INITIAL_SIZE);
-		return property;
-	}
-	
-	public static String getStorePoolMinSize()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_MIN_SIZE);
-		return property;
-	}
-	
-	public static String getStorePoolMaxSize()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_MAX_SIZE);
-		return property;
-	}
-	
-	public static String getStorePoolTestTable()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_TEST_TABLE);
-		return property;
-	}
-	
-	public static String getStorePoolTimeoutMillis()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_TIMEOUT_MILLIS);
-		return property;
-	}
-	
-	public static String getStoreDBConnectionManager()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONN_MANAGER);
-		return property;
-	}
-	
-	public static String getStoreDBDatasourceName()
-	{
-		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_DATASOURCE_NAME);
-		return property;
-	}
-	
-	public static String getJcrStoreJNDIPath()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_JCR_JNDI_PATH);
-	}
-	
-	public static String getJcrStoreUsername()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_JCR_USERNAME);
-	}
-	
-	public static String getJcrStorePassword()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_JCR_PASSWORD);
-	}
-	
-	public static String getJcrStoreRootNodePath()
-	{
-		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_JCR_ROOT_NODE_PATH);
-	}
-	
-	/**
-	 * Construct a naming context based on the connection details outlined
-	 * in the named configuration module/section.
-	 * <p/>
-	 * The module/section parameters are:
-	 * <ol>
-	 * 	<li><b>{@link Context#PROVIDER_URL}</b>: Value defaults to "{@link NamingContext#JBOSS_PROVIDER_URL}".</li>
-	 * 	<li><b>{@link Context#INITIAL_CONTEXT_FACTORY}</b>: Value defaults to "{@link NamingContext#JBOSS_INITIAL_CONTEXT_FACTORY}".</li>
-	 * 	<li><b>{@link Context#URL_PKG_PREFIXES}</b>: Value defaults to "{@link NamingContext#JBOSS_URL_PKG_PREFIX}".</li>
-	 * </ol>
-	 * 
-	 * @param contextModuleName Conficuration module/section name.
-	 * @return The context instance.
-	 * @throws ConfigurationException Unable to connect to context.
-	 */
-	public static Context getNamingContext(String contextModuleName) throws ConfigurationException {
-		String providerUrl = ModulePropertyManager.getPropertyManager(contextModuleName).getProperty(Context.PROVIDER_URL, NamingContext.JBOSS_PROVIDER_URL);
-		String initialContextFactory = ModulePropertyManager.getPropertyManager(contextModuleName).getProperty(Context.INITIAL_CONTEXT_FACTORY, NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
-		String urlPackagePrefix = ModulePropertyManager.getPropertyManager(contextModuleName).getProperty(Context.URL_PKG_PREFIXES, NamingContext.JBOSS_URL_PKG_PREFIX);
-		Properties environment = new Properties();
-        environment.setProperty(Context.PROVIDER_URL, providerUrl);
-        environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
-        environment.setProperty(Context.URL_PKG_PREFIXES, urlPackagePrefix);
-		
-        Context context = NamingContext.getServerContext(environment);
-		if(context == null) {
-			// Would be nice if NamingContext.getServerContext threw an exception with
-			// details attached.
-			throw new ConfigurationException("Failed to JNDI context [" + contextModuleName + "].");
-		}
-		
-		return context;
-	}
-	
-	/**
-	 * Lookup the JMS Connection Factory based on the connection details outlined
-	 * in the named configuration module/section.
-	 * <p/>
-	 * The module/section parameters are:
-	 * <ol>
-	 * 	<li><b>{@link Context#PROVIDER_URL}</b>: Value defaults to "{@link NamingContext#JBOSS_PROVIDER_URL}".</li>
-	 * 	<li><b>{@link Context#INITIAL_CONTEXT_FACTORY}</b>: Value defaults to "{@link NamingContext#JBOSS_INITIAL_CONTEXT_FACTORY}".</li>
-	 * 	<li><b>{@link Context#URL_PKG_PREFIXES}</b>: Value defaults to "{@link NamingContext#JBOSS_URL_PKG_PREFIX}".</li>
-	 * 	<li><b>javax.jms.ConnectionFactory</b>: Value defaults to "".</li>
-	 * </ol>
-	 * 
-	 * @param jmsConnectionFactoryModuleName Configuration module/section name.
-	 * @return The JMS ConnectionFactory instance.
-	 * @throws ConfigurationException Lookup failed either because it was unable to 
-	 * lookup the context, or the ConnectionFactory lookup failed.
-	 */
-	public static ConnectionFactory getJmsConnectionFactory(String jmsConnectionFactoryModuleName) throws ConfigurationException {
-		Context context = getNamingContext(jmsConnectionFactoryModuleName);
-		String connectionFactoryRuntime = ModulePropertyManager.getPropertyManager(jmsConnectionFactoryModuleName).getProperty(ConnectionFactory.class.getName(), "ConnectionFactory");
-		ConnectionFactory factory = null;
-		
-		try {
-			factory = (ConnectionFactory) context.lookup(connectionFactoryRuntime);
-		} catch (NamingException e) {
-			throw new ConfigurationException("JNDI lookup of JMS Connection Factory [" + connectionFactoryRuntime + "] failed.", e);
-		} catch (ClassCastException e) {
-			throw new ConfigurationException("JNDI lookup of JMS Connection Factory failed.  Class [" + connectionFactoryRuntime + "] is not an instance of [" + ConnectionFactory.class.getName() + "].", e);
-		} finally {
-            if (context!=null) {
-                try {
-                    context.close();
-                } catch (NamingException ne) {
-                    _logger.error(ne.getMessage(), ne);
-                }
-            }   
-        }
-		
-		return factory;
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Configuration.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,370 @@
+/*
+ * 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.common;
+
+import java.util.Properties;
+
+import javax.jms.ConnectionFactory;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.helpers.NamingContext;
+
+public class Configuration
+{
+    private static Logger _logger = Logger.getLogger(Configuration.class);
+    
+	private static KeyValuePair[] s_oaKV = new KeyValuePair[]
+	{
+			new KeyValuePair(Environment.SMTP_HOST, 					getSmtpHost()),
+			new KeyValuePair(Environment.SMTP_USERNAME, 				getSmtpUsername()),
+			new KeyValuePair(Environment.SMTP_PASSWORD, 				getSmtpPassword()),
+			new KeyValuePair(Environment.SMTP_PORT, 					getSmtpPort()),
+			new KeyValuePair(Environment.SMTP_FROM, 					getSmtpFrom()),
+			new KeyValuePair(Environment.SMTP_AUTH, 					getSmtpAuth()),
+			new KeyValuePair(Environment.JNDI_SERVER_URL, 				getJndiServerURL()),
+			new KeyValuePair(Environment.JNDI_SERVER_CONTEXT_FACTORY,   getJndiServerContextFactory()),
+			new KeyValuePair(Environment.JNDI_SERVER_PKG_PREFIX, 	    getJndiServerPkgPrefix()),
+			new KeyValuePair(Environment.REGISTRY_QUERY_MANAGER_URI, 	getRegistryQueryManageURI()),
+			new KeyValuePair(Environment.REGISTRY_LIFECYCLE_MANAGER_URI,getRegistryLifecycleManagerURI()),
+			new KeyValuePair(Environment.REGISTRY_IMPEMENTATION_CLASS,  getRegistryImplementationClass()),
+			new KeyValuePair(Environment.REGISTRY_FACTORY_CLASS, 		getRegistryFactoryClass()),
+			new KeyValuePair(Environment.REGISTRY_USER, 				getRegistryUser()),
+			new KeyValuePair(Environment.REGISTRY_PASSWORD, 			getRegistryPassword()),
+			new KeyValuePair(Environment.REGISTRY_SCOUT_TRANSPORT_CLASS,getRegistryScoutTransportClass()),
+			new KeyValuePair(Environment.PARAMS_REPOS_IMPL_CLASS,		getParamRepositoryImplClass()),
+			new KeyValuePair(Environment.OBJECT_STORE_CONFIG_FILE, 		getObjStoreConfigFile()),
+			new KeyValuePair(Environment.ENCRYPT_FACTORY_CLASS, 		getEncryptionFactoryClass()),
+			new KeyValuePair(Environment.MSG_STORE_DB_CONNECTION_URL, 	getStoreUrl()),
+			new KeyValuePair(Environment.MSG_STORE_DB_JDBC_DRIVER, 		getStoreDriver()),
+			new KeyValuePair(Environment.MSG_STORE_DB_CONNECTION_USER, 	getStoreUser()),
+			new KeyValuePair(Environment.MSG_STORE_DB_CONNECTION_PWD, 	getStorePwd()),
+			new KeyValuePair(Environment.MSG_STORE_DB_POOL_MIN_SIZE, 	getStorePoolMinSize()),
+			new KeyValuePair(Environment.MSG_STORE_DB_POOL_MAX_SIZE, 	getStorePoolMaxSize()),
+			new KeyValuePair(Environment.MSG_STORE_DB_POOL_INITIAL_SIZE,getStorePoolInitialSize()),
+			new KeyValuePair(Environment.MSG_STORE_DB_POOL_TEST_TABLE,  getStorePoolTestTable()),
+			new KeyValuePair(Environment.MSG_STORE_DB_POOL_TIMEOUT_MILLIS,getStorePoolTimeoutMillis()),
+			new KeyValuePair(Environment.MSG_STORE_DB_CONN_MANAGER		,getStoreDBConnectionManager()),
+			new KeyValuePair(Environment.MSG_STORE_DB_DATASOURCE_NAME	,getStoreDBDatasourceName())
+	};
+
+	public static String dump()
+	{
+		StringBuilder sb = new StringBuilder("Dump of SystemProperties:\n");
+		for (KeyValuePair oCurr : s_oaKV)
+		{
+			sb.append(oCurr.getKey()).append("=").append(oCurr.getValue())
+					.append("\n");
+		}
+		return sb.append("______________________________________").toString();
+	} // ________________________________
+
+	public static String getSmtpHost()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_HOST, Environment.DEFAULT_HOST);
+	}
+
+	public static String getSmtpUsername()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_USERNAME,
+				Environment.DEFAULT_USERNAME);
+	}
+
+	public static String getSmtpPassword()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_PASSWORD,
+				Environment.DEFAULT_PASSWORD);
+	}
+
+	public static String getSmtpPort()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_PORT, Environment.DEFAULT_PORT);
+	}
+
+	public static String getSmtpFrom()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_FROM);
+	}
+
+	public static String getSmtpAuth()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.TRANSPORTS_MODULE).getProperty(Environment.SMTP_AUTH);
+	}
+
+	public static String getJndiServerURL()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.JNDI_SERVER_URL,
+				Environment.DEFAULT_HOST);
+	}
+	
+	public static String getJndiServerContextFactory()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.JNDI_SERVER_CONTEXT_FACTORY,
+				Environment.DEFAULT_JNDI_CONTEXT_FACTORY);
+	}
+	
+	public static String getJndiServerPkgPrefix()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.JNDI_SERVER_PKG_PREFIX,
+				Environment.DEFAULT_JNDI_PKG_PREFIX);
+	}
+	/**
+	 * The Registry Query Manager URI can be used to obtain information about services and their endPoints.
+	 * @return Registry Query Manager URI String
+	 */
+	public static String getRegistryQueryManageURI()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_QUERY_MANAGER_URI);
+	}
+	/**
+	 * The Registry Lifecycle Manager URI can be use to publish services.
+	 * @return Registry Lifecycle Manager URI String
+	 */
+	public static String getRegistryLifecycleManagerURI()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_LIFECYCLE_MANAGER_URI);
+	}
+	/**
+	 * The Registry Factory Class setting specifies which JAXR implementation should be used.
+	 * @return Registry Factory Class String
+	 */
+	public static String getRegistryFactoryClass()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_FACTORY_CLASS);
+	}
+	/**
+	 * The Registry Implememtation Class defines wrapper class
+	 * @return Registry Implementation Class String
+	 */
+	public static String getRegistryImplementationClass()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS);
+	}
+	/**
+	 * The Registry Scout Transport Class defines which communication protocol Scout should use to communicate
+	 * with the UDDI registry. Note that this parameter is Scout specific.
+	 * @return Registry Scout Transport Class String
+	 */
+	public static String getRegistryScoutTransportClass()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_SCOUT_TRANSPORT_CLASS);
+	}
+	/**
+	 * The Registry User is used to inquire and publish to the Registry.
+	 * @return Registry User String
+	 */
+	public static String getRegistryUser()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_USER);
+	}
+	/**
+	 * The Registry Password that goes with the Registry User.
+	 * @return Registry Password String
+	 */
+	public static String getRegistryPassword()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE).getProperty(Environment.REGISTRY_PASSWORD);
+	}
+	
+	public static String getParamRepositoryImplClass()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.PARAMS_REPOS_IMPL_CLASS);
+	}
+
+	public static String getObjStoreConfigFile()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.OBJECT_STORE_CONFIG_FILE);
+		return property;
+	}
+
+	public static String getEncryptionFactoryClass()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperty(Environment.ENCRYPT_FACTORY_CLASS,
+				org.jboss.soa.esb.services.DefaultEncryptionFactory.class
+						.getName());
+	}
+	
+	public static String getStoreUrl()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONNECTION_URL);
+		return property;
+	}
+	
+	public static String getStoreDriver()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_JDBC_DRIVER);
+		return property;
+	}	
+	
+	public static String getStorePwd()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONNECTION_PWD);
+		return property;
+	}
+	
+	public static String getStoreUser()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONNECTION_USER);
+		return property;
+	}
+	
+	public static String getStorePoolInitialSize()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_INITIAL_SIZE);
+		return property;
+	}
+	
+	public static String getStorePoolMinSize()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_MIN_SIZE);
+		return property;
+	}
+	
+	public static String getStorePoolMaxSize()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_MAX_SIZE);
+		return property;
+	}
+	
+	public static String getStorePoolTestTable()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_TEST_TABLE);
+		return property;
+	}
+	
+	public static String getStorePoolTimeoutMillis()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_POOL_TIMEOUT_MILLIS);
+		return property;
+	}
+	
+	public static String getStoreDBConnectionManager()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_CONN_MANAGER);
+		return property;
+	}
+	
+	public static String getStoreDBDatasourceName()
+	{
+		String property = ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_DB_DATASOURCE_NAME);
+		return property;
+	}
+	
+	public static String getJcrStoreJNDIPath()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_JCR_JNDI_PATH);
+	}
+	
+	public static String getJcrStoreUsername()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_JCR_USERNAME);
+	}
+	
+	public static String getJcrStorePassword()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_JCR_PASSWORD);
+	}
+	
+	public static String getJcrStoreRootNodePath()
+	{
+		return ModulePropertyManager.getPropertyManager(ModulePropertyManager.DBSTORE_MODULE).getProperty(Environment.MSG_STORE_JCR_ROOT_NODE_PATH);
+	}
+	
+	/**
+	 * Construct a naming context based on the connection details outlined
+	 * in the named configuration module/section.
+	 * <p/>
+	 * The module/section parameters are:
+	 * <ol>
+	 * 	<li><b>{@link Context#PROVIDER_URL}</b>: Value defaults to "{@link NamingContext#JBOSS_PROVIDER_URL}".</li>
+	 * 	<li><b>{@link Context#INITIAL_CONTEXT_FACTORY}</b>: Value defaults to "{@link NamingContext#JBOSS_INITIAL_CONTEXT_FACTORY}".</li>
+	 * 	<li><b>{@link Context#URL_PKG_PREFIXES}</b>: Value defaults to "{@link NamingContext#JBOSS_URL_PKG_PREFIX}".</li>
+	 * </ol>
+	 * 
+	 * @param contextModuleName Conficuration module/section name.
+	 * @return The context instance.
+	 * @throws ConfigurationException Unable to connect to context.
+	 */
+	public static Context getNamingContext(String contextModuleName) throws ConfigurationException {
+		String providerUrl = ModulePropertyManager.getPropertyManager(contextModuleName).getProperty(Context.PROVIDER_URL, NamingContext.JBOSS_PROVIDER_URL);
+		String initialContextFactory = ModulePropertyManager.getPropertyManager(contextModuleName).getProperty(Context.INITIAL_CONTEXT_FACTORY, NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
+		String urlPackagePrefix = ModulePropertyManager.getPropertyManager(contextModuleName).getProperty(Context.URL_PKG_PREFIXES, NamingContext.JBOSS_URL_PKG_PREFIX);
+		Properties environment = new Properties();
+        environment.setProperty(Context.PROVIDER_URL, providerUrl);
+        environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, initialContextFactory);
+        environment.setProperty(Context.URL_PKG_PREFIXES, urlPackagePrefix);
+		
+        Context context = NamingContext.getServerContext(environment);
+		if(context == null) {
+			// Would be nice if NamingContext.getServerContext threw an exception with
+			// details attached.
+			throw new ConfigurationException("Failed to JNDI context [" + contextModuleName + "].");
+		}
+		
+		return context;
+	}
+	
+	/**
+	 * Lookup the JMS Connection Factory based on the connection details outlined
+	 * in the named configuration module/section.
+	 * <p/>
+	 * The module/section parameters are:
+	 * <ol>
+	 * 	<li><b>{@link Context#PROVIDER_URL}</b>: Value defaults to "{@link NamingContext#JBOSS_PROVIDER_URL}".</li>
+	 * 	<li><b>{@link Context#INITIAL_CONTEXT_FACTORY}</b>: Value defaults to "{@link NamingContext#JBOSS_INITIAL_CONTEXT_FACTORY}".</li>
+	 * 	<li><b>{@link Context#URL_PKG_PREFIXES}</b>: Value defaults to "{@link NamingContext#JBOSS_URL_PKG_PREFIX}".</li>
+	 * 	<li><b>javax.jms.ConnectionFactory</b>: Value defaults to "".</li>
+	 * </ol>
+	 * 
+	 * @param jmsConnectionFactoryModuleName Configuration module/section name.
+	 * @return The JMS ConnectionFactory instance.
+	 * @throws ConfigurationException Lookup failed either because it was unable to 
+	 * lookup the context, or the ConnectionFactory lookup failed.
+	 */
+	public static ConnectionFactory getJmsConnectionFactory(String jmsConnectionFactoryModuleName) throws ConfigurationException {
+		Context context = getNamingContext(jmsConnectionFactoryModuleName);
+		String connectionFactoryRuntime = ModulePropertyManager.getPropertyManager(jmsConnectionFactoryModuleName).getProperty(ConnectionFactory.class.getName(), "ConnectionFactory");
+		ConnectionFactory factory = null;
+		
+		try {
+			factory = (ConnectionFactory) context.lookup(connectionFactoryRuntime);
+		} catch (NamingException e) {
+			throw new ConfigurationException("JNDI lookup of JMS Connection Factory [" + connectionFactoryRuntime + "] failed.", e);
+		} catch (ClassCastException e) {
+			throw new ConfigurationException("JNDI lookup of JMS Connection Factory failed.  Class [" + connectionFactoryRuntime + "] is not an instance of [" + ConnectionFactory.class.getName() + "].", e);
+		} finally {
+            if (context!=null) {
+                try {
+                    context.close();
+                } catch (NamingException ne) {
+                    _logger.error(ne.getMessage(), ne);
+                }
+            }   
+        }
+		
+		return factory;
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,145 +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.common;
-
-public class Environment
-{
-	public enum Transports
-	{
-		File, FTP, JMS, SQL, Hibernate;
-	}
-	
-	public static final String PROPERTIES_FILE = "org.jboss.soa.esb.propertyFile";
-	
-	/*
-	 * Transport specific properties.
-	 */
-	
-	public static final String SMTP_HOST     = "org.jboss.soa.esb.mail.smtp.host";
-	public static final String SMTP_USERNAME = "org.jboss.soa.esb.mail.smtp.user";
-	public static final String SMTP_PASSWORD = "org.jboss.soa.esb.mail.smtp.password";
-	public static final String SMTP_PORT     = "org.jboss.soa.esb.mail.smtp.port";
-	public static final String SMTP_FROM     = "org.jboss.soa.esb.mail.smtp.from";
-	public static final String SMTP_AUTH     = "org.jboss.soa.esb.mail.smtp.auth";
-	
-	public static final String FTP_LOCALDIR  = "org.jboss.soa.esb.ftp.localdir";
-	public static final String FTP_REMOTEDIR = "org.jboss.soa.esb.ftp.remotedir";
-	
-	/*
-	 * Code properties
-	 */
-	public static final String JNDI_SERVER_URL                = "org.jboss.soa.esb.jndi.server.url";
-	public static final String JNDI_SERVER_CONTEXT_FACTORY    = "org.jboss.soa.esb.jndi.server.context.factory";
-	public static final String JNDI_SERVER_PKG_PREFIX         = "org.jboss.soa.esb.jndi.server.pkg.prefix";
-	public static final String PARAMS_REPOS_IMPL_CLASS        = "org.jboss.soa.esb.paramsRepository.class";
-	public static final String OBJECT_STORE_CONFIG_FILE       = "org.jboss.soa.esb.objStore.configFile";
-	public static final String ENCRYPT_FACTORY_CLASS          = "org.jboss.soa.esb.encryption.factory.class";
-	/** 
-	 * The Registry Query Manager URI defines the endPoint where registry queries can be made. 
-	 */
-	public static final String REGISTRY_QUERY_MANAGER_URI     = "org.jboss.soa.esb.registry.queryManagerURI";
-	/** 
-	 * The Registry Lifecycle Manager URI defines the endPoint where service information can be published to.
-	 */
-	public static final String REGISTRY_LIFECYCLE_MANAGER_URI = "org.jboss.soa.esb.registry.lifeCycleManagerURI";
-    /**
-     * The Registry Implementation class, a light wrapper class.
-     */
-	public static final String REGISTRY_IMPEMENTATION_CLASS = "org.jboss.soa.esb.registry.implementationClass";
-	/** 
-	 * The Registry Factory Class setting specifies which JAXR implementation should be used.
-	 */
-	public static final String REGISTRY_FACTORY_CLASS         = "org.jboss.soa.esb.registry.factoryClass";
-	/**
-	 * The user used to query and publish to the registry.
-	 */
-	public static final String REGISTRY_USER                  = "org.jboss.soa.esb.registry.user";
-	/**
-	 * The password for the registry user.
-	 */
-	public static final String REGISTRY_PASSWORD              = "org.jboss.soa.esb.registry.password";
-	/** 
-	 * The Registry Scout Transport Class property defines which communication protocol Scout should use to communicate
-	 * with the UDDI registry. Note that this parameter is Scout specific.
-	 */
-	public static final String REGISTRY_SCOUT_TRANSPORT_CLASS = "org.jboss.soa.esb.scout.proxy.transportClass";
-	/** 
-	 * Property that holds directory to use with the helper EPRManager class.
-	 */
-	public static final String REGISTRY_FILE_HELPER_DIR       = "org.jboss.soa.esb.registry.file.directory";
-	
-	/*
-	 * Some default values.
-	 */
-	public static final String DEFAULT_PROPERTY_FILE                  = "jbossesb-properties.xml";
-	public static final String DEFAULT_HOST                           = "localhost";
-	public static final String DEFAULT_USERNAME                       = "";
-	public static final String DEFAULT_PASSWORD                       = "";
-	public static final String DEFAULT_PORT                           = "25";
-	public static final String DEFAULT_JNDI_CONTEXT_FACTORY           = "org.jnp.interfaces.NamingContextFactory";
-	public static final String DEFAULT_JNDI_PKG_PREFIX                = "org.jnp.interfaces";
-	
-	/*
-	 * DatabaseMessageStore Persistence Store properties.
-	 */
-	public static final String MSG_STORE_DB_CONNECTION_URL 		= "org.jboss.soa.esb.persistence.db.connection.url";
-	public static final String MSG_STORE_DB_CONNECTION_USER 	= "org.jboss.soa.esb.persistence.db.user";
-	public static final String MSG_STORE_DB_CONNECTION_PWD 		= "org.jboss.soa.esb.persistence.db.pwd";
-	public static final String MSG_STORE_DB_TABLE_NAME 			= "org.jboss.soa.esb.persistence.db.table";
-	public static final String MSG_STORE_DB_JDBC_DRIVER			= "org.jboss.soa.esb.persistence.db.jdbc.driver";
-	public static final String MSG_STORE_DB_POOL_INITIAL_SIZE	= "org.jboss.soa.esb.persistence.db.pool.initial.size";
-	public static final String MSG_STORE_DB_POOL_MIN_SIZE		= "org.jboss.soa.esb.persistence.db.pool.min.size";
-	public static final String MSG_STORE_DB_POOL_MAX_SIZE		= "org.jboss.soa.esb.persistence.db.pool.max.size";
-	public static final String MSG_STORE_DB_POOL_TEST_TABLE		= "org.jboss.soa.esb.persistence.db.pool.test.table";
-	public static final String MSG_STORE_DB_POOL_TIMEOUT_MILLIS	= "org.jboss.soa.esb.persistence.db.pool.timeout.millis";
-	public static final String MSG_STORE_DB_CONN_MANAGER		= "org.jboss.soa.esb.persistence.db.conn.manager";
-	public static final String MSG_STORE_DB_DATASOURCE_NAME		= "org.jboss.soa.esb.persistence.db.datasource.name";
-	
-	/*
-	 * JcrMessageStore Persistence Store properties.
-	 */
-	public static final String MSG_STORE_JCR_JNDI_PATH			= "org.jboss.soa.esb.persistence.jcr.jndi.path";	
-	public static final String MSG_STORE_JCR_USERNAME			= "org.jboss.soa.esb.persistence.jcr.username";	
-	public static final String MSG_STORE_JCR_PASSWORD			= "org.jboss.soa.esb.persistence.jcr.password";	
-	public static final String MSG_STORE_JCR_ROOT_NODE_PATH		= "org.jboss.soa.esb.persistence.jcr.root.node.path";	
-	
-	/*
-	 * Some message properties.
-	 */
-	
-	public static final String TRANSPORT_TYPE = "org.jboss.soa.esb.message.transport.type";
-	public static final String MESSAGE_SOURCE = "org.jboss.soa.esb.message.source";
-	public static final String MESSAGE_ENTRY_TIME = "org.jboss.soa.esb.message.time.dob"; // time born
-	public static final String MESSAGE_EXIT_TIME = "org.jboss.soa.esb.message.time.dod";  // time died
-	
-	/*
-	 * Filter properties should be identified by:
-	 * 
-	 * org.jboss.soa.esb.courier.filter.<number>
-	 * 
-	 * and will be called in increasing order of <number>. Same <number> may be
-	 * called arbitrarily.
-	 */
-
-	public static final String FILTER_NAME = "org.jboss.soa.esb.courier.filter";
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/Environment.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,145 @@
+/*
+ * 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.common;
+
+public class Environment
+{
+	public enum Transports
+	{
+		File, FTP, JMS, SQL, Hibernate;
+	}
+	
+	public static final String PROPERTIES_FILE = "org.jboss.soa.esb.propertyFile";
+	
+	/*
+	 * Transport specific properties.
+	 */
+	
+	public static final String SMTP_HOST     = "org.jboss.soa.esb.mail.smtp.host";
+	public static final String SMTP_USERNAME = "org.jboss.soa.esb.mail.smtp.user";
+	public static final String SMTP_PASSWORD = "org.jboss.soa.esb.mail.smtp.password";
+	public static final String SMTP_PORT     = "org.jboss.soa.esb.mail.smtp.port";
+	public static final String SMTP_FROM     = "org.jboss.soa.esb.mail.smtp.from";
+	public static final String SMTP_AUTH     = "org.jboss.soa.esb.mail.smtp.auth";
+	
+	public static final String FTP_LOCALDIR  = "org.jboss.soa.esb.ftp.localdir";
+	public static final String FTP_REMOTEDIR = "org.jboss.soa.esb.ftp.remotedir";
+	
+	/*
+	 * Code properties
+	 */
+	public static final String JNDI_SERVER_URL                = "org.jboss.soa.esb.jndi.server.url";
+	public static final String JNDI_SERVER_CONTEXT_FACTORY    = "org.jboss.soa.esb.jndi.server.context.factory";
+	public static final String JNDI_SERVER_PKG_PREFIX         = "org.jboss.soa.esb.jndi.server.pkg.prefix";
+	public static final String PARAMS_REPOS_IMPL_CLASS        = "org.jboss.soa.esb.paramsRepository.class";
+	public static final String OBJECT_STORE_CONFIG_FILE       = "org.jboss.soa.esb.objStore.configFile";
+	public static final String ENCRYPT_FACTORY_CLASS          = "org.jboss.soa.esb.encryption.factory.class";
+	/** 
+	 * The Registry Query Manager URI defines the endPoint where registry queries can be made. 
+	 */
+	public static final String REGISTRY_QUERY_MANAGER_URI     = "org.jboss.soa.esb.registry.queryManagerURI";
+	/** 
+	 * The Registry Lifecycle Manager URI defines the endPoint where service information can be published to.
+	 */
+	public static final String REGISTRY_LIFECYCLE_MANAGER_URI = "org.jboss.soa.esb.registry.lifeCycleManagerURI";
+    /**
+     * The Registry Implementation class, a light wrapper class.
+     */
+	public static final String REGISTRY_IMPEMENTATION_CLASS = "org.jboss.soa.esb.registry.implementationClass";
+	/** 
+	 * The Registry Factory Class setting specifies which JAXR implementation should be used.
+	 */
+	public static final String REGISTRY_FACTORY_CLASS         = "org.jboss.soa.esb.registry.factoryClass";
+	/**
+	 * The user used to query and publish to the registry.
+	 */
+	public static final String REGISTRY_USER                  = "org.jboss.soa.esb.registry.user";
+	/**
+	 * The password for the registry user.
+	 */
+	public static final String REGISTRY_PASSWORD              = "org.jboss.soa.esb.registry.password";
+	/** 
+	 * The Registry Scout Transport Class property defines which communication protocol Scout should use to communicate
+	 * with the UDDI registry. Note that this parameter is Scout specific.
+	 */
+	public static final String REGISTRY_SCOUT_TRANSPORT_CLASS = "org.jboss.soa.esb.scout.proxy.transportClass";
+	/** 
+	 * Property that holds directory to use with the helper EPRManager class.
+	 */
+	public static final String REGISTRY_FILE_HELPER_DIR       = "org.jboss.soa.esb.registry.file.directory";
+	
+	/*
+	 * Some default values.
+	 */
+	public static final String DEFAULT_PROPERTY_FILE                  = "jbossesb-properties.xml";
+	public static final String DEFAULT_HOST                           = "localhost";
+	public static final String DEFAULT_USERNAME                       = "";
+	public static final String DEFAULT_PASSWORD                       = "";
+	public static final String DEFAULT_PORT                           = "25";
+	public static final String DEFAULT_JNDI_CONTEXT_FACTORY           = "org.jnp.interfaces.NamingContextFactory";
+	public static final String DEFAULT_JNDI_PKG_PREFIX                = "org.jnp.interfaces";
+	
+	/*
+	 * DatabaseMessageStore Persistence Store properties.
+	 */
+	public static final String MSG_STORE_DB_CONNECTION_URL 		= "org.jboss.soa.esb.persistence.db.connection.url";
+	public static final String MSG_STORE_DB_CONNECTION_USER 	= "org.jboss.soa.esb.persistence.db.user";
+	public static final String MSG_STORE_DB_CONNECTION_PWD 		= "org.jboss.soa.esb.persistence.db.pwd";
+	public static final String MSG_STORE_DB_TABLE_NAME 			= "org.jboss.soa.esb.persistence.db.table";
+	public static final String MSG_STORE_DB_JDBC_DRIVER			= "org.jboss.soa.esb.persistence.db.jdbc.driver";
+	public static final String MSG_STORE_DB_POOL_INITIAL_SIZE	= "org.jboss.soa.esb.persistence.db.pool.initial.size";
+	public static final String MSG_STORE_DB_POOL_MIN_SIZE		= "org.jboss.soa.esb.persistence.db.pool.min.size";
+	public static final String MSG_STORE_DB_POOL_MAX_SIZE		= "org.jboss.soa.esb.persistence.db.pool.max.size";
+	public static final String MSG_STORE_DB_POOL_TEST_TABLE		= "org.jboss.soa.esb.persistence.db.pool.test.table";
+	public static final String MSG_STORE_DB_POOL_TIMEOUT_MILLIS	= "org.jboss.soa.esb.persistence.db.pool.timeout.millis";
+	public static final String MSG_STORE_DB_CONN_MANAGER		= "org.jboss.soa.esb.persistence.db.conn.manager";
+	public static final String MSG_STORE_DB_DATASOURCE_NAME		= "org.jboss.soa.esb.persistence.db.datasource.name";
+	
+	/*
+	 * JcrMessageStore Persistence Store properties.
+	 */
+	public static final String MSG_STORE_JCR_JNDI_PATH			= "org.jboss.soa.esb.persistence.jcr.jndi.path";	
+	public static final String MSG_STORE_JCR_USERNAME			= "org.jboss.soa.esb.persistence.jcr.username";	
+	public static final String MSG_STORE_JCR_PASSWORD			= "org.jboss.soa.esb.persistence.jcr.password";	
+	public static final String MSG_STORE_JCR_ROOT_NODE_PATH		= "org.jboss.soa.esb.persistence.jcr.root.node.path";	
+	
+	/*
+	 * Some message properties.
+	 */
+	
+	public static final String TRANSPORT_TYPE = "org.jboss.soa.esb.message.transport.type";
+	public static final String MESSAGE_SOURCE = "org.jboss.soa.esb.message.source";
+	public static final String MESSAGE_ENTRY_TIME = "org.jboss.soa.esb.message.time.dob"; // time born
+	public static final String MESSAGE_EXIT_TIME = "org.jboss.soa.esb.message.time.dod";  // time died
+	
+	/*
+	 * Filter properties should be identified by:
+	 * 
+	 * org.jboss.soa.esb.courier.filter.<number>
+	 * 
+	 * and will be called in increasing order of <number>. Same <number> may be
+	 * called arbitrarily.
+	 */
+
+	public static final String FILTER_NAME = "org.jboss.soa.esb.courier.filter";
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,184 +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.
- */
-/*
- * Copyright (C) 2002
- *
- * Arjuna Solutions Limited,
- * Newcastle upon Tyne,
- * Tyne and Wear,
- * UK.
- *
- * $Id: arjPropertyManager.java 2342 2006-03-30 13:06:17Z  $
- */
-
-package org.jboss.soa.esb.common;
-
-import java.util.Hashtable;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.FatalError;
-
-import com.arjuna.common.internal.util.propertyservice.plugins.io.XMLFilePlugin;
-import com.arjuna.common.util.exceptions.LoadPropertiesException;
-import com.arjuna.common.util.propertyservice.PropertyManager;
-import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
-
-/**
- * The ESB configuration file is split into modules, each concerned with a
- * specific capability. Each module may also depend upon another module. We use
- * a PropertyManager per module to manage properties and relationships.
- * 
- * All properties are grouped within <properties/> sections and individual
- * properties by <property/>. If you look at some you'll see that they may be
- * named and may have a depends value, which relates to another section. This
- * tells the PropertyManager to load the depends section first. A property value
- * may be overridden by a dependant section, but the PropertyManager remembers
- * the hierarchy, so if you want to you can inspect and change the lower level
- * value and the PropertyManager can be used to preserve these changes if the
- * values are written back out to the source location.
- * 
- * The way the PropertyManager works means that it builds up a list of dependant
- * modules in a directed acyclic graph. This means that there is a root, which
- * can see every property below it, but nodes below cannot see properties above
- * them: there is a level of isolation.
- * 
- * When creating PropertyManagers, you need to specify where in the graph it is
- * to "tie in". This obviously has an affect on what that instance can then see
- * or do: if it goes in at the wrong level, it won't be able to see properties
- * it may need (unless they were defined to be "system" properties, and in which
- * case they are globally accessible.)
- * 
- * This means that we now have isolated PropertyManagers for each module. It
- * helps the management side of things a lot, but does mean that we have to
- * consider where in the graph a property needs to be, or which PropertyManager
- * we want to use to try to access it.
- * 
- * @author marklittle
- * 
- */
-public class ModulePropertyManager
-{
-
-	/*
-	 * The names of the various modules in the property file.
-	 */
-
-	public static final String CORE_MODULE = "core";
-
-	public static final String CONNECTION_MODULE = "connection";
-
-	public static final String REGISTRY_MODULE = "registry";
-
-	public static final String TRANSPORTS_MODULE = "transports";
-
-	public static final String DBSTORE_MODULE = "dbstore";
-	
-	public static final String FILTER_MODULE = "filters";
-
-	/**
-	 * Get the property manager responsible for the module component in the
-	 * file.
-	 * 
-	 * @param name
-	 *            the name of the module.
-	 * @return the relevant property manager.
-	 */
-
-	public static PropertyManager getPropertyManager(String name)
-	{
-		synchronized (managers)
-		{
-			PropertyManager theManager = managers.get(name);
-
-			if (theManager == null)
-			{
-				theManager = initialise(name);
-
-				if (theManager != null)
-				{
-					managers.put(name, theManager);
-				}
-			}
-
-			return theManager;
-		}
-	}
-
-	private static final PropertyManager initialise(String name)
-	{
-		/**
-		 * Retrieve the property manager from the factory and add the ESB
-		 * properties file to it.
-		 * 
-		 * set com.arjuna.common.util.propertyservice.verbosePropertyManager=ON
-		 * for verbose output from the PropertyManager.
-		 */
-
-		try
-		{
-			PropertyManager propertyManager = PropertyManagerFactory
-					.getPropertyManager(
-							"org.jboss.soa.esb.propertymanager." + name, name);
-	
-			String propertiesFilename = System.getProperty(
-					Environment.PROPERTIES_FILE, Environment.DEFAULT_PROPERTY_FILE);
-	
-			/*
-			 * Does not cause reloading of the same file over and over. Once it is
-			 * loaded, subsequent attempts to reload are ignored internally.
-			 */
-	
-			try
-			{
-				propertyManager.load(XMLFilePlugin.class.getName(),
-						propertiesFilename);
-			}
-			catch (LoadPropertiesException ex)
-			{
-				_logger.fatal("ModulePropertyManager failed to load property file "+propertiesFilename);
-				
-				throw new FatalError(ex);
-			}
-			catch (ClassNotFoundException e)
-			{
-				// something seriously wrong; better to terminate.
-				
-				_logger.fatal("ModulePropertyManager failed to load XML plugin", e);
-				
-				throw new FatalError(e);
-			}
-	
-			return propertyManager;
-		}
-		catch (Exception e)
-		{
-			// something seriously wrong; better to terminate.
-			
-			_logger.fatal("ModulePropertyManager failed to load PropertyManager", e);
-			
-			throw new FatalError(e);
-		}
-	}
-
-	private static Hashtable<String, PropertyManager> managers = new Hashtable<String, PropertyManager>();
-	
-	private static Logger _logger = Logger.getLogger(ModulePropertyManager.class);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/ModulePropertyManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,184 @@
+/*
+ * 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.
+ */
+/*
+ * Copyright (C) 2002
+ *
+ * Arjuna Solutions Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: arjPropertyManager.java 2342 2006-03-30 13:06:17Z  $
+ */
+
+package org.jboss.soa.esb.common;
+
+import java.util.Hashtable;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.FatalError;
+
+import com.arjuna.common.internal.util.propertyservice.plugins.io.XMLFilePlugin;
+import com.arjuna.common.util.exceptions.LoadPropertiesException;
+import com.arjuna.common.util.propertyservice.PropertyManager;
+import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
+
+/**
+ * The ESB configuration file is split into modules, each concerned with a
+ * specific capability. Each module may also depend upon another module. We use
+ * a PropertyManager per module to manage properties and relationships.
+ * 
+ * All properties are grouped within <properties/> sections and individual
+ * properties by <property/>. If you look at some you'll see that they may be
+ * named and may have a depends value, which relates to another section. This
+ * tells the PropertyManager to load the depends section first. A property value
+ * may be overridden by a dependant section, but the PropertyManager remembers
+ * the hierarchy, so if you want to you can inspect and change the lower level
+ * value and the PropertyManager can be used to preserve these changes if the
+ * values are written back out to the source location.
+ * 
+ * The way the PropertyManager works means that it builds up a list of dependant
+ * modules in a directed acyclic graph. This means that there is a root, which
+ * can see every property below it, but nodes below cannot see properties above
+ * them: there is a level of isolation.
+ * 
+ * When creating PropertyManagers, you need to specify where in the graph it is
+ * to "tie in". This obviously has an affect on what that instance can then see
+ * or do: if it goes in at the wrong level, it won't be able to see properties
+ * it may need (unless they were defined to be "system" properties, and in which
+ * case they are globally accessible.)
+ * 
+ * This means that we now have isolated PropertyManagers for each module. It
+ * helps the management side of things a lot, but does mean that we have to
+ * consider where in the graph a property needs to be, or which PropertyManager
+ * we want to use to try to access it.
+ * 
+ * @author marklittle
+ * 
+ */
+public class ModulePropertyManager
+{
+
+	/*
+	 * The names of the various modules in the property file.
+	 */
+
+	public static final String CORE_MODULE = "core";
+
+	public static final String CONNECTION_MODULE = "connection";
+
+	public static final String REGISTRY_MODULE = "registry";
+
+	public static final String TRANSPORTS_MODULE = "transports";
+
+	public static final String DBSTORE_MODULE = "dbstore";
+	
+	public static final String FILTER_MODULE = "filters";
+
+	/**
+	 * Get the property manager responsible for the module component in the
+	 * file.
+	 * 
+	 * @param name
+	 *            the name of the module.
+	 * @return the relevant property manager.
+	 */
+
+	public static PropertyManager getPropertyManager(String name)
+	{
+		synchronized (managers)
+		{
+			PropertyManager theManager = managers.get(name);
+
+			if (theManager == null)
+			{
+				theManager = initialise(name);
+
+				if (theManager != null)
+				{
+					managers.put(name, theManager);
+				}
+			}
+
+			return theManager;
+		}
+	}
+
+	private static final PropertyManager initialise(String name)
+	{
+		/**
+		 * Retrieve the property manager from the factory and add the ESB
+		 * properties file to it.
+		 * 
+		 * set com.arjuna.common.util.propertyservice.verbosePropertyManager=ON
+		 * for verbose output from the PropertyManager.
+		 */
+
+		try
+		{
+			PropertyManager propertyManager = PropertyManagerFactory
+					.getPropertyManager(
+							"org.jboss.soa.esb.propertymanager." + name, name);
+	
+			String propertiesFilename = System.getProperty(
+					Environment.PROPERTIES_FILE, Environment.DEFAULT_PROPERTY_FILE);
+	
+			/*
+			 * Does not cause reloading of the same file over and over. Once it is
+			 * loaded, subsequent attempts to reload are ignored internally.
+			 */
+	
+			try
+			{
+				propertyManager.load(XMLFilePlugin.class.getName(),
+						propertiesFilename);
+			}
+			catch (LoadPropertiesException ex)
+			{
+				_logger.fatal("ModulePropertyManager failed to load property file "+propertiesFilename);
+				
+				throw new FatalError(ex);
+			}
+			catch (ClassNotFoundException e)
+			{
+				// something seriously wrong; better to terminate.
+				
+				_logger.fatal("ModulePropertyManager failed to load XML plugin", e);
+				
+				throw new FatalError(e);
+			}
+	
+			return propertyManager;
+		}
+		catch (Exception e)
+		{
+			// something seriously wrong; better to terminate.
+			
+			_logger.fatal("ModulePropertyManager failed to load PropertyManager", e);
+			
+			throw new FatalError(e);
+		}
+	}
+
+	private static Hashtable<String, PropertyManager> managers = new Hashtable<String, PropertyManager>();
+	
+	private static Logger _logger = Logger.getLogger(ModulePropertyManager.class);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/TagNames.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/common/TagNames.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/TagNames.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,38 +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.common;
-
-/**
- * Base class to hold commonly used tagnames.
- * <br/>Semantics of what these tags hold will be context sensitive
- * 
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- *
- */
-public class TagNames 
-{
-	/** Common  **/
-	public static final String URL_TAG    					= "url";
-	public static final String USERNAME_TAG					= "username";
-	public static final String PASSWORD_TAG    				= "password";
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/TagNames.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/common/TagNames.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/TagNames.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/common/TagNames.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,38 @@
+/*
+ * 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.common;
+
+/**
+ * Base class to hold commonly used tagnames.
+ * <br/>Semantics of what these tags hold will be context sensitive
+ * 
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ *
+ */
+public class TagNames 
+{
+	/** Common  **/
+	public static final String URL_TAG    					= "url";
+	public static final String USERNAME_TAG					= "username";
+	public static final String PASSWORD_TAG    				= "password";
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/Courier.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/Courier.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/Courier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.couriers;
-
-import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.message.Message;
-/**
- * Courier interface. Deals relatively low level Message transport options.
- * 
- * @author esteban
- * @author kstam at redhat.com
- *
- */
-public interface Courier extends DeliverOnlyCourier
-{
-	/**
-	 * Try to deliverAsync an ESB message. This is a one shot delivery.
-	 * 
-	 * @param message Message - the message to deliverAsync
-	 * @return boolean - the result of the delivery
-	 * @throws CourierException - if problems were encountered
-	 */
-	public boolean deliver(Message message) throws CourierException, MalformedEPRException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/Courier.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/Courier.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/Courier.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/Courier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,45 @@
+/*
+ * 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.couriers;
+
+import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.message.Message;
+/**
+ * Courier interface. Deals relatively low level Message transport options.
+ * 
+ * @author esteban
+ * @author kstam at redhat.com
+ *
+ */
+public interface Courier extends DeliverOnlyCourier
+{
+	/**
+	 * Try to deliverAsync an ESB message. This is a one shot delivery.
+	 * 
+	 * @param message Message - the message to deliverAsync
+	 * @return boolean - the result of the delivery
+	 * @throws CourierException - if problems were encountered
+	 */
+	public boolean deliver(Message message) throws CourierException, MalformedEPRException;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierCollection.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierCollection.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierCollection.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,117 +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.couriers;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.message.Message;
-/**
- * Handle delivery of a message to a collection of Couriers.
- * 
- * @author kevin
- */
-public class CourierCollection
-{
-    /**
-     * The array of couriers.
-     */
-    private final Courier[] couriers ;
-    
-    /**
-     * Construct the courier collection.
-     * @param eprs The collection of courier eprs.
-     */
-    public CourierCollection(final Collection<EPR> eprs)
-        throws MalformedEPRException, CourierException
-    {
-        if ((eprs != null) && (eprs.size() > 0))
-        {
-            final ArrayList<Courier> courierList = new ArrayList<Courier>() ;
-            try
-            {
-                for (EPR epr: eprs)
-                {
-                    final Courier courier = CourierFactory.getCourier(epr) ;
-                    if (courier == null)
-                    {
-                        throw new CourierException("Null courier returned for EPR: " + epr) ;
-                    }
-                    courierList.add(courier) ;
-                }
-                couriers = courierList.toArray(new Courier[courierList.size()]) ;
-                courierList.clear() ;
-            }
-            finally
-            {
-                if (courierList.size() > 0)
-                {
-                    for(Courier courier: courierList)
-                    {
-                        CourierUtil.cleanCourier(courier) ;
-                    }
-                }
-            }
-        }
-        else
-        {
-            couriers = null ;
-        }
-    }
-    
-    /**
-     * Deliver the message to the list of couriers.
-     * @param message The message to deliverAsync.
-     * @throws CourierException For processing errors.
-     * @throws MalformedEPRException For configuration errors.
-     */
-    public boolean deliver(final Message message)
-        throws CourierException, MalformedEPRException
-    {
-        if (couriers != null)
-        {
-            for(Courier courier: couriers)
-            {
-                courier.deliver(message) ;
-            }
-            return true ;
-        }
-        else
-        {
-            return false ;
-        }
-    }
-    
-    /**
-     * Cleanup and release all couriers.
-     */
-    public void cleanup()
-    {
-        for(Courier courier: couriers)
-        {
-            CourierUtil.cleanCourier(courier) ;
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierCollection.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierCollection.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierCollection.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierCollection.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,117 @@
+/*
+ * 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.couriers;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.message.Message;
+/**
+ * Handle delivery of a message to a collection of Couriers.
+ * 
+ * @author kevin
+ */
+public class CourierCollection
+{
+    /**
+     * The array of couriers.
+     */
+    private final Courier[] couriers ;
+    
+    /**
+     * Construct the courier collection.
+     * @param eprs The collection of courier eprs.
+     */
+    public CourierCollection(final Collection<EPR> eprs)
+        throws MalformedEPRException, CourierException
+    {
+        if ((eprs != null) && (eprs.size() > 0))
+        {
+            final ArrayList<Courier> courierList = new ArrayList<Courier>() ;
+            try
+            {
+                for (EPR epr: eprs)
+                {
+                    final Courier courier = CourierFactory.getCourier(epr) ;
+                    if (courier == null)
+                    {
+                        throw new CourierException("Null courier returned for EPR: " + epr) ;
+                    }
+                    courierList.add(courier) ;
+                }
+                couriers = courierList.toArray(new Courier[courierList.size()]) ;
+                courierList.clear() ;
+            }
+            finally
+            {
+                if (courierList.size() > 0)
+                {
+                    for(Courier courier: courierList)
+                    {
+                        CourierUtil.cleanCourier(courier) ;
+                    }
+                }
+            }
+        }
+        else
+        {
+            couriers = null ;
+        }
+    }
+    
+    /**
+     * Deliver the message to the list of couriers.
+     * @param message The message to deliverAsync.
+     * @throws CourierException For processing errors.
+     * @throws MalformedEPRException For configuration errors.
+     */
+    public boolean deliver(final Message message)
+        throws CourierException, MalformedEPRException
+    {
+        if (couriers != null)
+        {
+            for(Courier courier: couriers)
+            {
+                courier.deliver(message) ;
+            }
+            return true ;
+        }
+        else
+        {
+            return false ;
+        }
+    }
+    
+    /**
+     * Cleanup and release all couriers.
+     */
+    public void cleanup()
+    {
+        for(Courier courier: couriers)
+        {
+            CourierUtil.cleanCourier(courier) ;
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.couriers;
-
-import org.jboss.soa.esb.BaseException;
-
-/**
- * Dispatch Exception.
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- */
-public class CourierException extends BaseException 
-{
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-     * Construct an exception instance. 
-     * @param message Exception message.
-     */
-    public CourierException(String message) { super(message); }
-
-    /**
-     * Construct an exception instance. 
-     * @param message Exception message.
-     * @param cause Exception cause.
-     */
-    public CourierException(String message, Throwable cause) { super(message, cause); }
-
-    /**
-     * Construct an exception instance. 
-     * @param cause Exception cause.
-     */
-    public CourierException(Throwable cause) { super(cause); }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.couriers;
+
+import org.jboss.soa.esb.BaseException;
+
+/**
+ * Dispatch Exception.
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ */
+public class CourierException extends BaseException 
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     */
+    public CourierException(String message) { super(message); }
+
+    /**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     * @param cause Exception cause.
+     */
+    public CourierException(String message, Throwable cause) { super(message, cause); }
+
+    /**
+     * Construct an exception instance. 
+     * @param cause Exception cause.
+     */
+    public CourierException(Throwable cause) { super(cause); }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,256 +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.couriers;
-/**
- * 
- * @author - esteban
- * @author - kstam at redhat.com
- *
- */
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.lifecycle.LifecycleIdentity;
-
-public class CourierFactory
-{
-    /**
-     * The logger for this instance.
-     */
-    private static final Logger LOGGER = Logger.getLogger(CourierFactory.class) ;
-        
-    /**
-     * Track lifecycle couriers.
-     */
-    private static final Map<String, Map<TwoWayCourier, Exception>> lifecycleCouriers = new HashMap<String, Map<TwoWayCourier, Exception>>() ;
-
-    /**
-     * Factory singleton instance.
-     */
-    private static CourierFactory instance = new CourierFactory();
-
-    static
-    {
-        lifecycleCouriers.put(null, new HashMap<TwoWayCourier, Exception>()) ;
-    }
-	
-	// protected default constructor
-	protected CourierFactory() {}
-
-    /**
-     * Get the CourierFactory method.
-     * @return The Courier factory instance.
-     */
-    public static CourierFactory getInstance()	{
-		return instance;
-	}
-
-    /**
-     * Set the CourierFactory method.
-     * <p/>
-     * Supports unit testing.
-     *
-     * @param instance New factory instance.
-     */
-    protected static void setInstance(CourierFactory instance) {
-        CourierFactory.instance = instance;
-    }
-
-    /**
-	 * Obtain a courier which can perform deliveries only and prime it with the "to address" (toEPR).
-	 *
-	 * @param toEPR - the 'to address', the address on where to deliverAsync a Message.
-	 * @return The courier.
-	 * @throws CourierException if the specific courier implementation cannot be created.
-	 */
-	public TwoWayCourier getMessageCourier(EPR toEPR) throws CourierException, MalformedEPRException {
-        return getCourier(toEPR, null);
-    }
-
-    /**
-	 * Obtain a courier which can perform deliveries only and prime it with the "to address" (toEPR).
-	 * 
-	 * @param toEPR - the 'to address', the address on where to deliverAsync a Message.
-	 * @return Courier
-	 * @throws CourierException if the specific courier implementation cannot be created.
-	 */
-	public static Courier getCourier(EPR toEPR) throws CourierException, MalformedEPRException
-	{
-		return getCourier(toEPR, null);
-	}
-	/**
-	 * Obtain a courier which can perform pickups only and prime it with the "to address" (toEPR) 
-	 * and the "replyTo address" (replyToEPR). 
-	 * 
-	 * @param replyToEPR - the 'replyTo address', the address where to deliverAsync the Message we pickup.
-	 * @return TwoWayCourier
-	 * @throws CourierException if the specific courier implementation cannot be created.
-	 */
-	public static TwoWayCourier getPickupCourier(EPR replyToEPR) throws CourierException, MalformedEPRException
-	{
-		return getCourier(null, replyToEPR);
-	}
-	/**
-	 * Obtain a courier which can perform both deliveries and pickups and prime it with 
-	 * the "to address" (toEPR) and the "replyTo address" (replyToEPR). 
-	 * 
-	 * @param toEPR      - the 'to address', the address on where to deliverAsync a Message.
-	 * @param replyToEPR - the 'replyTo address', the address where to deliverAsync the Message we pickup.
-	 * @return TwoWayCourier
-	 * @throws CourierException if the specific courier implementation cannot be created.
-	 */
-	public static TwoWayCourier getCourier(EPR toEPR, EPR replyToEPR) throws CourierException, MalformedEPRException
-	{
-		final TwoWayCourier result = new TwoWayCourierImpl(toEPR, replyToEPR);
-                registerCourier(result) ;
-                return result ;
-	}
-        
-        /**
-         * Initialise the association for the current lifecycle identify.
-         * @param lifecycleIdentity The lifecycle identiy.
-         */
-        public synchronized static void initialiseLifecycleIdentityMap(final String lifecycleIdentity)
-        {
-            if (lifecycleIdentity != null)
-            {
-                lifecycleCouriers.put(lifecycleIdentity, new HashMap<TwoWayCourier, Exception>()) ;
-            }
-        }
-        
-        /**
-         * Destroy the association for the current lifecycle identify.
-         * @param lifecycleIdentity The lifecycle identiy.
-         */
-        public synchronized static void destroyLifecycleIdentityMap(final String lifecycleIdentity)
-        {
-            if (lifecycleIdentity != null)
-            {
-                lifecycleCouriers.remove(lifecycleIdentity) ;
-            }
-        }
-        
-        /**
-         * Register the courier as part of the current set.
-         * @param courier The current courier.
-         */
-        private static synchronized void registerCourier(final TwoWayCourier courier)
-        {
-            final Exception ex ;
-            if (LOGGER.isDebugEnabled())
-            {
-                ex = new Exception("Courier Assignment stacktrace") ;
-            }
-            else
-            {
-                ex = null ;
-            }
-            getMap().put(courier, ex) ;
-        }
-        
-        /**
-         * Get the current map.
-         * @return The current map.
-         */
-        private static synchronized Map<TwoWayCourier, Exception> getMap()
-        {
-            final String lifecycleIdentity = LifecycleIdentity.getSingleton().getThreadLifecycleIdentity() ;
-            Map<TwoWayCourier, Exception> map = lifecycleCouriers.get(lifecycleIdentity) ;
-            if (map == null)
-            {
-                map = lifecycleCouriers.get(null) ;
-            }
-            return map ;
-        }
-        
-        /**
-         * Get and clear the current map.
-         * @return The current map.
-         */
-        private static synchronized Map<TwoWayCourier, Exception> getAndClearMap()
-        {
-            final String lifecycleIdentity = LifecycleIdentity.getSingleton().getThreadLifecycleIdentity() ;
-            Map<TwoWayCourier, Exception> map = lifecycleCouriers.get(lifecycleIdentity) ;
-            final String key ;
-            if (map != null)
-            {
-                key = lifecycleIdentity ;
-            }
-            else
-            {
-                key = null ;
-                map = lifecycleCouriers.get(null) ;
-            }
-            if (map.size() > 0)
-            {
-                lifecycleCouriers.put(key, new HashMap<TwoWayCourier, Exception>()) ;
-            }
-            return map ;
-        }
-        
-        /**
-         * Deregister the courier from the current set.
-         * @param courier The current courier.
-         */
-        public static synchronized void deregisterCourier(final TwoWayCourier courier)
-        {
-            getMap().remove(courier) ;
-        }
-        
-        /**
-         * Release all couriers.
-         */
-        public static void releaseCouriers()
-        {
-            final Map<TwoWayCourier, Exception> couriers = getAndClearMap() ;
-            if (couriers.size() > 0)
-            {
-                LOGGER.warn("Calling cleanup on existing couriers for identity " +
-                        LifecycleIdentity.getSingleton().getThreadLifecycleIdentity()) ;
-                final Iterator<Entry<TwoWayCourier, Exception>> entryIter = couriers.entrySet().iterator() ;
-                while(entryIter.hasNext())
-                {
-                    final Entry<TwoWayCourier, Exception> entry = entryIter.next();
-                    entryIter.remove() ;
-                    if (LOGGER.isDebugEnabled() && (entry.getValue() != null))
-                    {
-                        LOGGER.debug("Courier allocation stacktrace", entry.getValue()) ;
-                    }
-                    
-                    try
-                    {
-                        entry.getKey().cleanup() ;
-                    }
-                    catch (final Exception ex)
-                    {
-                        LOGGER.warn("Unexpected exception cleaning up courier", ex) ;
-                    }
-                }
-            }
-        }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,256 @@
+/*
+ * 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.couriers;
+/**
+ * 
+ * @author - esteban
+ * @author - kstam at redhat.com
+ *
+ */
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.TwoWayCourierImpl;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.lifecycle.LifecycleIdentity;
+
+public class CourierFactory
+{
+    /**
+     * The logger for this instance.
+     */
+    private static final Logger LOGGER = Logger.getLogger(CourierFactory.class) ;
+        
+    /**
+     * Track lifecycle couriers.
+     */
+    private static final Map<String, Map<TwoWayCourier, Exception>> lifecycleCouriers = new HashMap<String, Map<TwoWayCourier, Exception>>() ;
+
+    /**
+     * Factory singleton instance.
+     */
+    private static CourierFactory instance = new CourierFactory();
+
+    static
+    {
+        lifecycleCouriers.put(null, new HashMap<TwoWayCourier, Exception>()) ;
+    }
+	
+	// protected default constructor
+	protected CourierFactory() {}
+
+    /**
+     * Get the CourierFactory method.
+     * @return The Courier factory instance.
+     */
+    public static CourierFactory getInstance()	{
+		return instance;
+	}
+
+    /**
+     * Set the CourierFactory method.
+     * <p/>
+     * Supports unit testing.
+     *
+     * @param instance New factory instance.
+     */
+    protected static void setInstance(CourierFactory instance) {
+        CourierFactory.instance = instance;
+    }
+
+    /**
+	 * Obtain a courier which can perform deliveries only and prime it with the "to address" (toEPR).
+	 *
+	 * @param toEPR - the 'to address', the address on where to deliverAsync a Message.
+	 * @return The courier.
+	 * @throws CourierException if the specific courier implementation cannot be created.
+	 */
+	public TwoWayCourier getMessageCourier(EPR toEPR) throws CourierException, MalformedEPRException {
+        return getCourier(toEPR, null);
+    }
+
+    /**
+	 * Obtain a courier which can perform deliveries only and prime it with the "to address" (toEPR).
+	 * 
+	 * @param toEPR - the 'to address', the address on where to deliverAsync a Message.
+	 * @return Courier
+	 * @throws CourierException if the specific courier implementation cannot be created.
+	 */
+	public static Courier getCourier(EPR toEPR) throws CourierException, MalformedEPRException
+	{
+		return getCourier(toEPR, null);
+	}
+	/**
+	 * Obtain a courier which can perform pickups only and prime it with the "to address" (toEPR) 
+	 * and the "replyTo address" (replyToEPR). 
+	 * 
+	 * @param replyToEPR - the 'replyTo address', the address where to deliverAsync the Message we pickup.
+	 * @return TwoWayCourier
+	 * @throws CourierException if the specific courier implementation cannot be created.
+	 */
+	public static TwoWayCourier getPickupCourier(EPR replyToEPR) throws CourierException, MalformedEPRException
+	{
+		return getCourier(null, replyToEPR);
+	}
+	/**
+	 * Obtain a courier which can perform both deliveries and pickups and prime it with 
+	 * the "to address" (toEPR) and the "replyTo address" (replyToEPR). 
+	 * 
+	 * @param toEPR      - the 'to address', the address on where to deliverAsync a Message.
+	 * @param replyToEPR - the 'replyTo address', the address where to deliverAsync the Message we pickup.
+	 * @return TwoWayCourier
+	 * @throws CourierException if the specific courier implementation cannot be created.
+	 */
+	public static TwoWayCourier getCourier(EPR toEPR, EPR replyToEPR) throws CourierException, MalformedEPRException
+	{
+		final TwoWayCourier result = new TwoWayCourierImpl(toEPR, replyToEPR);
+                registerCourier(result) ;
+                return result ;
+	}
+        
+        /**
+         * Initialise the association for the current lifecycle identify.
+         * @param lifecycleIdentity The lifecycle identiy.
+         */
+        public synchronized static void initialiseLifecycleIdentityMap(final String lifecycleIdentity)
+        {
+            if (lifecycleIdentity != null)
+            {
+                lifecycleCouriers.put(lifecycleIdentity, new HashMap<TwoWayCourier, Exception>()) ;
+            }
+        }
+        
+        /**
+         * Destroy the association for the current lifecycle identify.
+         * @param lifecycleIdentity The lifecycle identiy.
+         */
+        public synchronized static void destroyLifecycleIdentityMap(final String lifecycleIdentity)
+        {
+            if (lifecycleIdentity != null)
+            {
+                lifecycleCouriers.remove(lifecycleIdentity) ;
+            }
+        }
+        
+        /**
+         * Register the courier as part of the current set.
+         * @param courier The current courier.
+         */
+        private static synchronized void registerCourier(final TwoWayCourier courier)
+        {
+            final Exception ex ;
+            if (LOGGER.isDebugEnabled())
+            {
+                ex = new Exception("Courier Assignment stacktrace") ;
+            }
+            else
+            {
+                ex = null ;
+            }
+            getMap().put(courier, ex) ;
+        }
+        
+        /**
+         * Get the current map.
+         * @return The current map.
+         */
+        private static synchronized Map<TwoWayCourier, Exception> getMap()
+        {
+            final String lifecycleIdentity = LifecycleIdentity.getSingleton().getThreadLifecycleIdentity() ;
+            Map<TwoWayCourier, Exception> map = lifecycleCouriers.get(lifecycleIdentity) ;
+            if (map == null)
+            {
+                map = lifecycleCouriers.get(null) ;
+            }
+            return map ;
+        }
+        
+        /**
+         * Get and clear the current map.
+         * @return The current map.
+         */
+        private static synchronized Map<TwoWayCourier, Exception> getAndClearMap()
+        {
+            final String lifecycleIdentity = LifecycleIdentity.getSingleton().getThreadLifecycleIdentity() ;
+            Map<TwoWayCourier, Exception> map = lifecycleCouriers.get(lifecycleIdentity) ;
+            final String key ;
+            if (map != null)
+            {
+                key = lifecycleIdentity ;
+            }
+            else
+            {
+                key = null ;
+                map = lifecycleCouriers.get(null) ;
+            }
+            if (map.size() > 0)
+            {
+                lifecycleCouriers.put(key, new HashMap<TwoWayCourier, Exception>()) ;
+            }
+            return map ;
+        }
+        
+        /**
+         * Deregister the courier from the current set.
+         * @param courier The current courier.
+         */
+        public static synchronized void deregisterCourier(final TwoWayCourier courier)
+        {
+            getMap().remove(courier) ;
+        }
+        
+        /**
+         * Release all couriers.
+         */
+        public static void releaseCouriers()
+        {
+            final Map<TwoWayCourier, Exception> couriers = getAndClearMap() ;
+            if (couriers.size() > 0)
+            {
+                LOGGER.warn("Calling cleanup on existing couriers for identity " +
+                        LifecycleIdentity.getSingleton().getThreadLifecycleIdentity()) ;
+                final Iterator<Entry<TwoWayCourier, Exception>> entryIter = couriers.entrySet().iterator() ;
+                while(entryIter.hasNext())
+                {
+                    final Entry<TwoWayCourier, Exception> entry = entryIter.next();
+                    entryIter.remove() ;
+                    if (LOGGER.isDebugEnabled() && (entry.getValue() != null))
+                    {
+                        LOGGER.debug("Courier allocation stacktrace", entry.getValue()) ;
+                    }
+                    
+                    try
+                    {
+                        entry.getKey().cleanup() ;
+                    }
+                    catch (final Exception ex)
+                    {
+                        LOGGER.warn("Unexpected exception cleaning up courier", ex) ;
+                    }
+                }
+            }
+        }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTimeoutException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTimeoutException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTimeoutException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.couriers;
-
-import org.jboss.soa.esb.BaseException;
-
-/**
- * Timeout exception.
- * 
- * @author kstam at redhat.com
- */
-public class CourierTimeoutException extends BaseException 
-{
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-     * Construct an exception instance. 
-     * @param message Exception message.
-     */
-    public CourierTimeoutException(String message) { super(message); }
-
-    /**
-     * Construct an exception instance. 
-     * @param message Exception message.
-     * @param cause Exception cause.
-     */
-    public CourierTimeoutException(String message, Throwable cause) { super(message, cause); }
-
-    /**
-     * Construct an exception instance. 
-     * @param cause Exception cause.
-     */
-    public CourierTimeoutException(Throwable cause) { super(cause); }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTimeoutException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTimeoutException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTimeoutException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierTimeoutException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.couriers;
+
+import org.jboss.soa.esb.BaseException;
+
+/**
+ * Timeout exception.
+ * 
+ * @author kstam at redhat.com
+ */
+public class CourierTimeoutException extends BaseException 
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     */
+    public CourierTimeoutException(String message) { super(message); }
+
+    /**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     * @param cause Exception cause.
+     */
+    public CourierTimeoutException(String message, Throwable cause) { super(message, cause); }
+
+    /**
+     * Construct an exception instance. 
+     * @param cause Exception cause.
+     */
+    public CourierTimeoutException(Throwable cause) { super(cause); }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,318 +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.couriers;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.Serializable;
-import java.io.StreamCorruptedException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.util.Properties;
-
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
-import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.DefaultFileReplyToEpr;
-import org.jboss.soa.esb.addressing.eprs.DefaultFtpReplyToEpr;
-import org.jboss.soa.esb.addressing.eprs.DefaultHibernateReplyToEpr;
-import org.jboss.soa.esb.addressing.eprs.DefaultJdbcReplyToEpr;
-import org.jboss.soa.esb.addressing.eprs.DefaultJmsReplyToEpr;
-import org.jboss.soa.esb.addressing.eprs.DefaultSftpReplyToEpr;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.Util;
-import org.xml.sax.SAXException;
-
-public class CourierUtil
-{
-	private CourierUtil() {}
-
-	/**
-	 * Obtain a default replyToEPR (based on the toEpr) to which we can reply to.
-	 *
-	 * @param toEpr - the toEPR which will be used a basis to generate the replyToEPR.
-	 * @return EPR - the EPR to which the pickup will be delivered.
-	 * @throws URISyntaxException,
-	 *             CourierException
-	 */
-	public static EPR getDefaultReplyToEpr(EPR toEpr)
-			throws CourierException, MalformedEPRException
-	{
-        // TODO: Is this really a "Courier" utility?  Looks more like an EPR/EPRFactory utility?
-        try
-		{
-			if (null==toEpr)				
-				throw new IllegalArgumentException("toEpr must not be null");
-			if (toEpr instanceof JMSEpr)	
-				return new DefaultJmsReplyToEpr((JMSEpr)toEpr);
-			// Check for SFTPEpr first, as it extends FTPEpr
-			if(toEpr instanceof SFTPEpr)
-				return new DefaultSftpReplyToEpr((SFTPEpr)toEpr);
-			// Check for FTPEpr first, as it extends FileEpr
-			if(toEpr instanceof FTPEpr)
-				return new DefaultFtpReplyToEpr((FTPEpr)toEpr);
-			if(toEpr instanceof FileEpr)
-				return new DefaultFileReplyToEpr((FileEpr)toEpr);
-			if(toEpr instanceof JDBCEpr)
-				return new DefaultJdbcReplyToEpr((JDBCEpr)toEpr);
-			if(toEpr instanceof HibernateEpr)
-				return new DefaultHibernateReplyToEpr((HibernateEpr)toEpr);
-		}
-		catch (MalformedURLException ex)
-		{
-			throw new MalformedEPRException(ex);
-		}
-		catch (URISyntaxException ex)
-		{
-			throw new MalformedEPRException(ex);
-		}
-
-		throw new CourierException("Unsupported temporary reply to EPR "
-				+toEpr.getClass().getSimpleName());
-	}
-
-	/**
-	 * Obtain properties and values used in a JMS message selector
-	 * @param selector  A valid JMS message selector
-	 * @return Properties  A Properties object containing the keys and values in the message selector
-	 * @throws ConfigurationException
-	 */
-	public static Properties propertiesFromSelector(String selector)
-		throws ConfigurationException
-	{
-		Properties oRet = new Properties();
-		if (!Util.isNullString(selector))
-		{
-			for (String sCurr : selector.split(","))
-			{
-				String[] sa = sCurr.split("=");
-				if (sa.length != 2 || sa[1].charAt(0) != '\''
-						|| sa[1].charAt(-1 + sa[1].length()) != '\'')
-					throw new ConfigurationException("Illegal message selector syntax <"
-							+ selector + ">  list of comma separated key='value' expected");
-				KeyValuePair oNew = new KeyValuePair(sa[0], sa[1].substring(0,
-						-1 + sa[1].length()).substring(1));
-				oRet.put(oNew.getKey(), oNew.getValue());
-			}
-		}
-		return oRet;
-	}
-	
-
-	public static File messageToLocalFile(File directory, Message message)
-			throws IOException, ParserConfigurationException
-	{
-		File tmpFile = File.createTempFile("EsbFileCourier_", ".__esbPart",
-				directory);
-		Serializable serial = Util.serialize(message);
-		FileOutputStream writer = null;
-		try
-		{
-			writer = new FileOutputStream(tmpFile);
-			new ObjectOutputStream(writer).writeObject(serial);
-			
-			writer.flush();
-		}
-		finally
-		{
-			if (null != writer)
-				writer.close();
-		}
-		return tmpFile;
-	}
-
-	public static Message messageFromLocalFile(File from)
-			throws FileNotFoundException, IOException, ClassNotFoundException,
-			ClassCastException, ParserConfigurationException, SAXException,
-			CourierException
-	{
-		FileInputStream reader = null;
-		Serializable serial = null;
-		int retry = 10; // TODO magic number
-		
-		/*
-		 * Just because a file is in the file system doesn't mean it
-		 * has been completely written!
-		 */
-		
-		while (retry > 0)
-		{
-			try
-			{
-				reader = new FileInputStream(from);
-				serial = (Serializable) new ObjectInputStream(reader).readObject();
-				return Util.deserialize(serial);
-			}
-			catch (StreamCorruptedException ex)
-			{
-				// file present but not ready to read - wait
-				
-				retry--;
-			}
-			catch (Exception e)
-			{
-				e.printStackTrace();
-				
-				_logger.debug(from+" "+e.toString());
-				throw new CourierException(e);
-			}
-			finally
-			{
-				if (null != reader)
-					reader.close();
-			}
-			
-			try
-			{
-				Thread.sleep(1000);  // TODO magic number
-			}
-			catch (Exception ex)
-			{
-			}
-		}
-		
-		throw new IOException();
-	}
-
-	public static byte[] bytesFromLocalFile(File from) throws IOException
-	{
-		ByteArrayOutputStream out = new ByteArrayOutputStream();
-		FileInputStream in = new FileInputStream(from);
-		byte[] buff = new byte[1000];
-		int iQ = 0;
-		try
-		{
-			while ((iQ = in.read(buff)) >= 0)
-				if (iQ > 0)
-					out.write(buff, 0, iQ);
-		}
-		finally
-		{
-			if (null != in)
-				in.close();
-			if (null != out)
-				out.close();
-		}
-		return out.toByteArray();
-	}
-
-	public static void bytesToLocalFile(byte[] bytes, File to)
-			throws IOException
-	{
-		FileOutputStream out = null;
-		try
-		{
-			out = new FileOutputStream(to);
-			out.write(bytes);
-		}
-		finally
-		{
-			if (null != out)
-				out.close();
-		}
-	}
-
-	public static void deliverMessage(Message message)
-			throws URISyntaxException, CourierException, MalformedEPRException
-	{
-		EPR toEpr = message.getHeader().getCall().getTo();
-		Courier courier = CourierFactory.getCourier(toEpr);
-                try
-                {
-                    courier.deliver(message);
-                }
-                finally
-                {
-                    CourierUtil.cleanCourier(courier) ;
-                }
-	}
-
-    public static void cleanCourier (PickUpOnlyCourier courier)
-    {
-        if (null!=courier)
-        {
-            try
-            {
-                courier.cleanup() ;
-            }
-            catch (Exception e)
-            {
-                _logger.error("Problems invoking clean() Method for class "
-                                +courier.getClass().getSimpleName(),e);
-            }
-        }
-    }
-    
-    public static void cleanCourier (DeliverOnlyCourier courier)
-    {
-        if (null!=courier)
-        {
-            try
-            {
-                courier.cleanup() ;
-            }
-            catch (Exception e)
-            {
-                _logger.error("Problems invoking clean() Method for class "
-                                +courier.getClass().getSimpleName(),e);
-            }
-        }
-    }
-    
-    public static void cleanCourier (TwoWayCourier courier)
-    {
-        if (null!=courier)
-        {
-            try
-            {
-                courier.cleanup() ;
-            }
-            catch (Exception e)
-            {
-                _logger.error("Problems invoking clean() Method for class "
-                                +courier.getClass().getSimpleName(),e);
-            }
-        }
-    }
-	    
-
-	protected static Logger _logger = Logger.getLogger(CourierUtil.class);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/CourierUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,318 @@
+/*
+ * 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.couriers;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.Serializable;
+import java.io.StreamCorruptedException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.util.Properties;
+
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
+import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.DefaultFileReplyToEpr;
+import org.jboss.soa.esb.addressing.eprs.DefaultFtpReplyToEpr;
+import org.jboss.soa.esb.addressing.eprs.DefaultHibernateReplyToEpr;
+import org.jboss.soa.esb.addressing.eprs.DefaultJdbcReplyToEpr;
+import org.jboss.soa.esb.addressing.eprs.DefaultJmsReplyToEpr;
+import org.jboss.soa.esb.addressing.eprs.DefaultSftpReplyToEpr;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.Util;
+import org.xml.sax.SAXException;
+
+public class CourierUtil
+{
+	private CourierUtil() {}
+
+	/**
+	 * Obtain a default replyToEPR (based on the toEpr) to which we can reply to.
+	 *
+	 * @param toEpr - the toEPR which will be used a basis to generate the replyToEPR.
+	 * @return EPR - the EPR to which the pickup will be delivered.
+	 * @throws URISyntaxException,
+	 *             CourierException
+	 */
+	public static EPR getDefaultReplyToEpr(EPR toEpr)
+			throws CourierException, MalformedEPRException
+	{
+        // TODO: Is this really a "Courier" utility?  Looks more like an EPR/EPRFactory utility?
+        try
+		{
+			if (null==toEpr)				
+				throw new IllegalArgumentException("toEpr must not be null");
+			if (toEpr instanceof JMSEpr)	
+				return new DefaultJmsReplyToEpr((JMSEpr)toEpr);
+			// Check for SFTPEpr first, as it extends FTPEpr
+			if(toEpr instanceof SFTPEpr)
+				return new DefaultSftpReplyToEpr((SFTPEpr)toEpr);
+			// Check for FTPEpr first, as it extends FileEpr
+			if(toEpr instanceof FTPEpr)
+				return new DefaultFtpReplyToEpr((FTPEpr)toEpr);
+			if(toEpr instanceof FileEpr)
+				return new DefaultFileReplyToEpr((FileEpr)toEpr);
+			if(toEpr instanceof JDBCEpr)
+				return new DefaultJdbcReplyToEpr((JDBCEpr)toEpr);
+			if(toEpr instanceof HibernateEpr)
+				return new DefaultHibernateReplyToEpr((HibernateEpr)toEpr);
+		}
+		catch (MalformedURLException ex)
+		{
+			throw new MalformedEPRException(ex);
+		}
+		catch (URISyntaxException ex)
+		{
+			throw new MalformedEPRException(ex);
+		}
+
+		throw new CourierException("Unsupported temporary reply to EPR "
+				+toEpr.getClass().getSimpleName());
+	}
+
+	/**
+	 * Obtain properties and values used in a JMS message selector
+	 * @param selector  A valid JMS message selector
+	 * @return Properties  A Properties object containing the keys and values in the message selector
+	 * @throws ConfigurationException
+	 */
+	public static Properties propertiesFromSelector(String selector)
+		throws ConfigurationException
+	{
+		Properties oRet = new Properties();
+		if (!Util.isNullString(selector))
+		{
+			for (String sCurr : selector.split(","))
+			{
+				String[] sa = sCurr.split("=");
+				if (sa.length != 2 || sa[1].charAt(0) != '\''
+						|| sa[1].charAt(-1 + sa[1].length()) != '\'')
+					throw new ConfigurationException("Illegal message selector syntax <"
+							+ selector + ">  list of comma separated key='value' expected");
+				KeyValuePair oNew = new KeyValuePair(sa[0], sa[1].substring(0,
+						-1 + sa[1].length()).substring(1));
+				oRet.put(oNew.getKey(), oNew.getValue());
+			}
+		}
+		return oRet;
+	}
+	
+
+	public static File messageToLocalFile(File directory, Message message)
+			throws IOException, ParserConfigurationException
+	{
+		File tmpFile = File.createTempFile("EsbFileCourier_", ".__esbPart",
+				directory);
+		Serializable serial = Util.serialize(message);
+		FileOutputStream writer = null;
+		try
+		{
+			writer = new FileOutputStream(tmpFile);
+			new ObjectOutputStream(writer).writeObject(serial);
+			
+			writer.flush();
+		}
+		finally
+		{
+			if (null != writer)
+				writer.close();
+		}
+		return tmpFile;
+	}
+
+	public static Message messageFromLocalFile(File from)
+			throws FileNotFoundException, IOException, ClassNotFoundException,
+			ClassCastException, ParserConfigurationException, SAXException,
+			CourierException
+	{
+		FileInputStream reader = null;
+		Serializable serial = null;
+		int retry = 10; // TODO magic number
+		
+		/*
+		 * Just because a file is in the file system doesn't mean it
+		 * has been completely written!
+		 */
+		
+		while (retry > 0)
+		{
+			try
+			{
+				reader = new FileInputStream(from);
+				serial = (Serializable) new ObjectInputStream(reader).readObject();
+				return Util.deserialize(serial);
+			}
+			catch (StreamCorruptedException ex)
+			{
+				// file present but not ready to read - wait
+				
+				retry--;
+			}
+			catch (Exception e)
+			{
+				e.printStackTrace();
+				
+				_logger.debug(from+" "+e.toString());
+				throw new CourierException(e);
+			}
+			finally
+			{
+				if (null != reader)
+					reader.close();
+			}
+			
+			try
+			{
+				Thread.sleep(1000);  // TODO magic number
+			}
+			catch (Exception ex)
+			{
+			}
+		}
+		
+		throw new IOException();
+	}
+
+	public static byte[] bytesFromLocalFile(File from) throws IOException
+	{
+		ByteArrayOutputStream out = new ByteArrayOutputStream();
+		FileInputStream in = new FileInputStream(from);
+		byte[] buff = new byte[1000];
+		int iQ = 0;
+		try
+		{
+			while ((iQ = in.read(buff)) >= 0)
+				if (iQ > 0)
+					out.write(buff, 0, iQ);
+		}
+		finally
+		{
+			if (null != in)
+				in.close();
+			if (null != out)
+				out.close();
+		}
+		return out.toByteArray();
+	}
+
+	public static void bytesToLocalFile(byte[] bytes, File to)
+			throws IOException
+	{
+		FileOutputStream out = null;
+		try
+		{
+			out = new FileOutputStream(to);
+			out.write(bytes);
+		}
+		finally
+		{
+			if (null != out)
+				out.close();
+		}
+	}
+
+	public static void deliverMessage(Message message)
+			throws URISyntaxException, CourierException, MalformedEPRException
+	{
+		EPR toEpr = message.getHeader().getCall().getTo();
+		Courier courier = CourierFactory.getCourier(toEpr);
+                try
+                {
+                    courier.deliver(message);
+                }
+                finally
+                {
+                    CourierUtil.cleanCourier(courier) ;
+                }
+	}
+
+    public static void cleanCourier (PickUpOnlyCourier courier)
+    {
+        if (null!=courier)
+        {
+            try
+            {
+                courier.cleanup() ;
+            }
+            catch (Exception e)
+            {
+                _logger.error("Problems invoking clean() Method for class "
+                                +courier.getClass().getSimpleName(),e);
+            }
+        }
+    }
+    
+    public static void cleanCourier (DeliverOnlyCourier courier)
+    {
+        if (null!=courier)
+        {
+            try
+            {
+                courier.cleanup() ;
+            }
+            catch (Exception e)
+            {
+                _logger.error("Problems invoking clean() Method for class "
+                                +courier.getClass().getSimpleName(),e);
+            }
+        }
+    }
+    
+    public static void cleanCourier (TwoWayCourier courier)
+    {
+        if (null!=courier)
+        {
+            try
+            {
+                courier.cleanup() ;
+            }
+            catch (Exception e)
+            {
+                _logger.error("Problems invoking clean() Method for class "
+                                +courier.getClass().getSimpleName(),e);
+            }
+        }
+    }
+	    
+
+	protected static Logger _logger = Logger.getLogger(CourierUtil.class);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/TwoWayCourier.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/TwoWayCourier.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/TwoWayCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,69 +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.couriers;
-
-import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.message.Message;
-
-public interface TwoWayCourier extends Courier, PickUpOnlyCourier
-{
-	/**
-     * Instruct the courier to wait for a pickup in the replyToEpr
-     * 
-     * @param waitTime         - Pickup timeout for before giving up on this pickup. Time in millis.
-     * @return                 - the message that was picked up.
-     * @throws CourierException the courier fails (i.e. gets a flat tire).
-	 * @throws CourierTimeoutException if the pickup timed out (nobody home).
-     */
-	public Message pickup(long waitTime) throws CourierException, CourierTimeoutException;
-	/**
-     * Instruct the courier to wait for a pickup in the specified EPR
-     * 
-     * @param waitTime         - Pickup timeout for before giving up on this pickup. Time in millis.
-     * @param epr              - Pickup address
-     * @return                 - the message that was picked up.
-     * @throws CourierException the courier fails (i.e. gets a flat tire).
-	 * @throws CourierTimeoutException if the pickup timed out (nobody home).
-     */
-	public Message pickup(long waitTime, EPR epr) throws CourierException, CourierTimeoutException, MalformedEPRException;
-	/**
-	 * Sets the toEPR. This can be used if the toEPR is not know at construction time of
-	 * the Courier.
-	 * 
-	 * @param toEPR - EPR specifying the 'to' address.
-	 * @throws CourierException
-	 */
-
-	public void setToEpr(EPR toEPR) throws CourierException, MalformedEPRException;
-	/**
-	 * Sets the replyToEPR. This can be used if the replyToEPR is not know at construction time of
-	 * the Courier.
-	 * 
-	 * @param replyToEPR - EPR specifying the reply to address.
-	 * @throws CourierException
-	 */
-
-	public void setReplyToEpr(EPR replyToEPR) throws CourierException, MalformedEPRException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/TwoWayCourier.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/TwoWayCourier.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/TwoWayCourier.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/TwoWayCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,69 @@
+/*
+ * 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.couriers;
+
+import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.message.Message;
+
+public interface TwoWayCourier extends Courier, PickUpOnlyCourier
+{
+	/**
+     * Instruct the courier to wait for a pickup in the replyToEpr
+     * 
+     * @param waitTime         - Pickup timeout for before giving up on this pickup. Time in millis.
+     * @return                 - the message that was picked up.
+     * @throws CourierException the courier fails (i.e. gets a flat tire).
+	 * @throws CourierTimeoutException if the pickup timed out (nobody home).
+     */
+	public Message pickup(long waitTime) throws CourierException, CourierTimeoutException;
+	/**
+     * Instruct the courier to wait for a pickup in the specified EPR
+     * 
+     * @param waitTime         - Pickup timeout for before giving up on this pickup. Time in millis.
+     * @param epr              - Pickup address
+     * @return                 - the message that was picked up.
+     * @throws CourierException the courier fails (i.e. gets a flat tire).
+	 * @throws CourierTimeoutException if the pickup timed out (nobody home).
+     */
+	public Message pickup(long waitTime, EPR epr) throws CourierException, CourierTimeoutException, MalformedEPRException;
+	/**
+	 * Sets the toEPR. This can be used if the toEPR is not know at construction time of
+	 * the Courier.
+	 * 
+	 * @param toEPR - EPR specifying the 'to' address.
+	 * @throws CourierException
+	 */
+
+	public void setToEpr(EPR toEPR) throws CourierException, MalformedEPRException;
+	/**
+	 * Sets the replyToEPR. This can be used if the replyToEPR is not know at construction time of
+	 * the Courier.
+	 * 
+	 * @param replyToEPR - EPR specifying the reply to address.
+	 * @throws CourierException
+	 */
+
+	public void setReplyToEpr(EPR replyToEPR) throws CourierException, MalformedEPRException;
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/FilterManager.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/FilterManager.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/FilterManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,181 +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.couriers.filter;
-
-import java.util.Collection;
-import java.util.Enumeration;
-import java.util.Iterator;
-import java.util.Properties;
-import java.util.TreeMap;
-
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.ClassUtil;
-
-import com.arjuna.common.util.propertyservice.PropertyManager;
-
-/**
- * The FilterManager process messages through the various input and
- * output filters that have been registered via the configuration file.
- * Currently this is the same processing for all services/clients, i.e., there
- * is no per-process/per-client processing, it is all at the ESB instance
- * level.
- * 
- * @author marklittle
- */
-
-public class FilterManager
-{
-	public static final synchronized FilterManager getInstance ()
-	{
-		if (_instance == null)
-			_instance = new FilterManager();
-		
-		return _instance;
-	}
-	
-	/**
-	 * Iterate through the registered output filters, allowing them to augment/modify
-	 * the message. The first error causes the iteration to stop and the send to fail.
-	 * 
-	 * @param msg the original message.
-	 * @return the resultant message.
-	 * @throws CourierException thrown if there is any error during processing.
-	 */
-	
-	public Message doOutputWork (Message msg) throws CourierException
-	{
-		if ((_filters == null) || (msg == null))
-			return msg;
-		
-		for (int i = 0; i < _filters.length; i++)
-		{
-			if (_filters[i] != null)
-				msg = _filters[i].onOutput(msg);
-		}
-		
-		return msg;
-	}
-	
-	/**
-	 * Iterate through the registered input filters, allowing them to augment/modify
-	 * the message. The first error causes the iteration to stop and the receive to fail.
-	 * 
-	 * @param msg the original message.
-	 * @return the resultant message.
-	 * @throws CourierException thrown if there is any error during processing.
-	 */
-	
-	public Message doInputWork (Message msg) throws CourierException
-	{
-                if ((_filters == null) || (msg == null))
-			return msg;
-		
-		for (int i = 0; i < _filters.length; i++)
-		{
-			if (_filters[i] != null)
-				msg = _filters[i].onInput(msg);
-		}
-		
-		return msg;
-	}
-	
-	private FilterManager ()
-	{
-		PropertyManager pm = ModulePropertyManager.getPropertyManager(ModulePropertyManager.FILTER_MODULE);
-		Properties props = pm.getProperties();
-
-		if (props != null)
-		{
-			Enumeration names = props.propertyNames();
-			TreeMap<Integer, String> map = new TreeMap<Integer, String>();
-			
-			/*
-			 * Go through the list of attributes and pull out those that refer
-			 * to filters. Make sure we order them according to their names.
-			 */
-			
-			while (names.hasMoreElements())
-			{
-				String attrName = (String) names.nextElement();
-
-				if (attrName.startsWith(Environment.FILTER_NAME))
-				{
-					String order = attrName.substring(Environment.FILTER_NAME.length()+1);
-					Integer value;
-					
-					try
-					{
-						value = new Integer(order);
-					}
-					catch (NumberFormatException ex)
-					{
-						throw new RuntimeException("Filter name "+order+" is invalid!");
-					}
-				
-					map.put(value, props.getProperty(attrName));
-				}
-			}
-			
-			if (map.size() > 0)
-			{
-				Collection<String> ordered = map.values();
-				Iterator<String> iter = ordered.iterator();
-				int index = 0;
-				
-				_filters = new InputOutputFilter[map.size()];
-				
-				while (iter.hasNext())
-				{
-					String filterName = iter.next();
-				
-					try
-					{
-						Class c = ClassUtil.forName(filterName, getClass());
-						InputOutputFilter theFilter = (InputOutputFilter) c.newInstance();
-
-						_filters[index++] = theFilter;
-					}
-					catch (ClassNotFoundException ex)
-					{
-						ex.printStackTrace();
-					}
-					catch (IllegalAccessException ex)
-					{
-						ex.printStackTrace();
-					}
-					catch (InstantiationException ex)
-					{
-						ex.printStackTrace();
-					}
-				}
-			}
-		}
-	}
-	
-	private InputOutputFilter[] _filters;
-	
-	private static FilterManager _instance = null;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/FilterManager.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/FilterManager.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/FilterManager.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/FilterManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,181 @@
+/*
+ * 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.couriers.filter;
+
+import java.util.Collection;
+import java.util.Enumeration;
+import java.util.Iterator;
+import java.util.Properties;
+import java.util.TreeMap;
+
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.ClassUtil;
+
+import com.arjuna.common.util.propertyservice.PropertyManager;
+
+/**
+ * The FilterManager process messages through the various input and
+ * output filters that have been registered via the configuration file.
+ * Currently this is the same processing for all services/clients, i.e., there
+ * is no per-process/per-client processing, it is all at the ESB instance
+ * level.
+ * 
+ * @author marklittle
+ */
+
+public class FilterManager
+{
+	public static final synchronized FilterManager getInstance ()
+	{
+		if (_instance == null)
+			_instance = new FilterManager();
+		
+		return _instance;
+	}
+	
+	/**
+	 * Iterate through the registered output filters, allowing them to augment/modify
+	 * the message. The first error causes the iteration to stop and the send to fail.
+	 * 
+	 * @param msg the original message.
+	 * @return the resultant message.
+	 * @throws CourierException thrown if there is any error during processing.
+	 */
+	
+	public Message doOutputWork (Message msg) throws CourierException
+	{
+		if ((_filters == null) || (msg == null))
+			return msg;
+		
+		for (int i = 0; i < _filters.length; i++)
+		{
+			if (_filters[i] != null)
+				msg = _filters[i].onOutput(msg);
+		}
+		
+		return msg;
+	}
+	
+	/**
+	 * Iterate through the registered input filters, allowing them to augment/modify
+	 * the message. The first error causes the iteration to stop and the receive to fail.
+	 * 
+	 * @param msg the original message.
+	 * @return the resultant message.
+	 * @throws CourierException thrown if there is any error during processing.
+	 */
+	
+	public Message doInputWork (Message msg) throws CourierException
+	{
+                if ((_filters == null) || (msg == null))
+			return msg;
+		
+		for (int i = 0; i < _filters.length; i++)
+		{
+			if (_filters[i] != null)
+				msg = _filters[i].onInput(msg);
+		}
+		
+		return msg;
+	}
+	
+	private FilterManager ()
+	{
+		PropertyManager pm = ModulePropertyManager.getPropertyManager(ModulePropertyManager.FILTER_MODULE);
+		Properties props = pm.getProperties();
+
+		if (props != null)
+		{
+			Enumeration names = props.propertyNames();
+			TreeMap<Integer, String> map = new TreeMap<Integer, String>();
+			
+			/*
+			 * Go through the list of attributes and pull out those that refer
+			 * to filters. Make sure we order them according to their names.
+			 */
+			
+			while (names.hasMoreElements())
+			{
+				String attrName = (String) names.nextElement();
+
+				if (attrName.startsWith(Environment.FILTER_NAME))
+				{
+					String order = attrName.substring(Environment.FILTER_NAME.length()+1);
+					Integer value;
+					
+					try
+					{
+						value = new Integer(order);
+					}
+					catch (NumberFormatException ex)
+					{
+						throw new RuntimeException("Filter name "+order+" is invalid!");
+					}
+				
+					map.put(value, props.getProperty(attrName));
+				}
+			}
+			
+			if (map.size() > 0)
+			{
+				Collection<String> ordered = map.values();
+				Iterator<String> iter = ordered.iterator();
+				int index = 0;
+				
+				_filters = new InputOutputFilter[map.size()];
+				
+				while (iter.hasNext())
+				{
+					String filterName = iter.next();
+				
+					try
+					{
+						Class c = ClassUtil.forName(filterName, getClass());
+						InputOutputFilter theFilter = (InputOutputFilter) c.newInstance();
+
+						_filters[index++] = theFilter;
+					}
+					catch (ClassNotFoundException ex)
+					{
+						ex.printStackTrace();
+					}
+					catch (IllegalAccessException ex)
+					{
+						ex.printStackTrace();
+					}
+					catch (InstantiationException ex)
+					{
+						ex.printStackTrace();
+					}
+				}
+			}
+		}
+	}
+	
+	private InputOutputFilter[] _filters;
+	
+	private static FilterManager _instance = null;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/InputOutputFilter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/InputOutputFilter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/InputOutputFilter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,64 +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.couriers.filter;
-
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * An inputoutput filter is called when the message is being received/sent and after it
- * has been received from the transport/before it is passed to the transport.
- * Implementations may augment or modify the message en route. Implementations that
- * are pure output or pure input can just override the desired operation.
- * 
- * @author marklittle
- */
-
-public class InputOutputFilter
-{
-	/**
-	 * Called as the message flows towards the transport.
-	 * 
-	 * @param msg the message
-	 * @return an augmented message (or the original message)
-	 * @throws CourierException thrown if an error occurs.
-	 */
-	
-	public Message onOutput (Message msg) throws CourierException
-	{
-		return msg;
-	}
-	
-	/**
-	 * Called immediately after the message is received from the transport.
-	 * 
-	 * @param msg the message
-	 * @return an augmented message (or the original message)
-	 * @throws CourierException thrown if an error occurs.
-	 */
-	
-	public Message onInput (Message msg) throws CourierException
-	{
-		return msg;
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/InputOutputFilter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/InputOutputFilter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/InputOutputFilter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/couriers/filter/InputOutputFilter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,64 @@
+/*
+ * 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.couriers.filter;
+
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * An inputoutput filter is called when the message is being received/sent and after it
+ * has been received from the transport/before it is passed to the transport.
+ * Implementations may augment or modify the message en route. Implementations that
+ * are pure output or pure input can just override the desired operation.
+ * 
+ * @author marklittle
+ */
+
+public class InputOutputFilter
+{
+	/**
+	 * Called as the message flows towards the transport.
+	 * 
+	 * @param msg the message
+	 * @return an augmented message (or the original message)
+	 * @throws CourierException thrown if an error occurs.
+	 */
+	
+	public Message onOutput (Message msg) throws CourierException
+	{
+		return msg;
+	}
+	
+	/**
+	 * Called immediately after the message is received from the transport.
+	 * 
+	 * @param msg the message
+	 * @return an augmented message (or the original message)
+	 * @throws CourierException thrown if an error occurs.
+	 */
+	
+	public Message onInput (Message msg) throws CourierException
+	{
+		return msg;
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/dom (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/dom)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,436 +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.dom;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.List;
-import java.util.Vector;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.FactoryConfigurationError;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.soa.esb.ConfigurationException;
-import org.w3c.dom.Attr;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-
-/**
- * Yet another set of DOM utility methods.
- * <p/>
- * PLEASE DO NOT USE THIS CLASS OUTSIDE THIS PACKAGE. It will be removed as soon as we find
- * equivalent DOM support methods somewhere else, or find a more appropriate home for these.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class YADOMUtil {
-
-	// If there are another set of the same utilities somewhere, or another DOMUtil type class
-	// that we can add them too, we should do that :-)
-	
-	/**
-	 * Create a new W3C Document.
-	 * <p/>
-	 * Handles exceptions etc.
-	 * @return The new Document instance.
-	 * @throws ConfigurationException 
-	 */
-	public static Document createDocument() throws ConfigurationException {
-		Document doc = null;
-		
-		try {
-			doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
-		} catch (ParserConfigurationException e) {
-			throw new ConfigurationException("Failed to create ESB Configuration Document instance.", e);
-		}
-		
-		return doc;
-	}
-
-    /**
-     * Parse the supplied XML String and return the associated W3C Document object.
-     *
-     * @param xml XML String.
-     * @return The W3C Document object associated with the input stream.
-     */
-    public static Document parse(String xml) throws SAXException, IOException {
-        return parseStream(new ByteArrayInputStream(xml.getBytes()), false, false);
-    }
-
-    /**
-     * Parse the XML stream and return the associated W3C Document object.
-     * <p/>
-     * Performs a namespace unaware parse.
-     *
-     * @param stream
-     *            The stream to be parsed.
-     * @param validate
-     *            True if the document is to be validated, otherwise false.
-     * @param expandEntityRefs
-     *            Expand entity References as per
-     *            {@link DocumentBuilderFactory#setExpandEntityReferences(boolean)}.
-     * @return The W3C Document object associated with the input stream.
-     */
-    public static Document parseStream(InputStream stream, boolean validate,
-            boolean expandEntityRefs) throws SAXException, IOException {
-        return parseStream(stream, validate, expandEntityRefs, false);
-    }
-
-    /**
-     * Parse the XML stream and return the associated W3C Document object.
-     *
-     * @param stream
-     *            The stream to be parsed.
-     * @param validate
-     *            True if the document is to be validated, otherwise false.
-     * @param expandEntityRefs
-     *            Expand entity References as per
-     *            {@link DocumentBuilderFactory#setExpandEntityReferences(boolean)}.
-     * @param namespaceAware
-     *            True if the document parse is to be namespace aware,
-     *            otherwise false.
-     * @return The W3C Document object associated with the input stream.
-     */
-    public static Document parseStream(InputStream stream, boolean validate,
-            boolean expandEntityRefs, boolean namespaceAware) throws SAXException, IOException {
-        if (stream == null) {
-            throw new IllegalArgumentException(
-                    "null 'stream' arg in method call.");
-        }
-        try {
-            DocumentBuilderFactory factory = DocumentBuilderFactory
-                    .newInstance();
-            DocumentBuilder docBuilder = null;
-
-            factory.setValidating(validate);
-            factory.setExpandEntityReferences(expandEntityRefs);
-            factory.setNamespaceAware(namespaceAware);
-            docBuilder = factory.newDocumentBuilder();
-
-            return docBuilder.parse(stream);
-        } catch (ParserConfigurationException e) {
-            IllegalStateException state = new IllegalStateException(
-                    "Unable to parse XML stream - XML Parser not configured correctly.");
-            state.initCause(e);
-            throw state;
-        } catch (FactoryConfigurationError e) {
-            IllegalStateException state = new IllegalStateException(
-                    "Unable to parse XML stream - DocumentBuilderFactory not configured correctly.");
-            state.initCause(e);
-            throw state;
-        }
-    }
-
-    /**
-	 * Add an Element node to the supplied parent name.
-	 * @param parent The parent to to which the new Element node is to be added.
-	 * @param elementName The name of the Element to be added.
-	 * @return The new Element.
-	 */
-	public static Element addElement(Node parent, String elementName) {
-		Element element = null;
-		
-		if(parent instanceof Document) {
-			element = ((Document)parent).createElement(elementName);
-		} else {
-			element = parent.getOwnerDocument().createElement(elementName);
-		}
-		parent.appendChild(element);
-		
-		return element;
-	}
-	
-	/**
-	 * Remove all attributes having an empty value.
-	 * @param element The element to be processed.
-	 */
-	public static void removeEmptyAttributes(Element element) {
-		NamedNodeMap attributes = element.getAttributes();
-		int attribCount = attributes.getLength();
-		
-		for(int i = attribCount - 1; i >= 0; i--) {
-			Attr attribute = (Attr) attributes.item(i);
-			
-			// Note - doesn't account for namespaces.  Not needed here !
-			if(attribute.getValue().equals("")) {
-				attributes.removeNamedItem(attribute.getName());
-			}
-		}
-	}
-
-	/**
-	 * Serialize the supplied DOM node to the specified file in the specified output directory.
-	 * @param node The DOM node to be serialised.
-	 * @param outdir The directory into which the file is to be serialised.
-	 * @param fileName The name of the file.
-	 * @throws ConfigurationException Unable to serialise the node.
-	 */
-	public static void serialize(Node node, File outdir, String fileName) throws ConfigurationException {
-		serialize(node, new StreamResult(new File(outdir, fileName)));
-	}
-
-    public static void serialize(Node node, OutputStream out) throws ConfigurationException {
-      serialize(node, new StreamResult(out));
-    }
-
-    /**
-      * Serialize the supplied DOM node to the supplied DOM StreamResult instance.
-      * @param node The DOM node to be serialised.
-      * @param streamRes The StreamResult into which the node is to be serialised.
-      * @throws ConfigurationException Unable to serialise the node.
-      */
-    public static void serialize(Node node, StreamResult streamRes) throws ConfigurationException {
-        serialize(node, streamRes, false);
-    }
-
-   /**
-	 * Serialize the supplied DOM node to the supplied DOM StreamResult instance.
-	 * @param node The DOM node to be serialised.
-	 * @param streamRes The StreamResult into which the node is to be serialised.
-     * @param omitXmlDecl Omit the XML declaration.
-	 * @throws ConfigurationException Unable to serialise the node.
-	 */
-	public static void serialize(Node node, StreamResult streamRes, boolean omitXmlDecl) throws ConfigurationException {
-		DOMSource domSource = new DOMSource(node);
-		
-		try {
-			Transformer transformer = TransformerFactory.newInstance().newTransformer();
-
-            // There's a bug in Java 5 re this code (formatting).
-            // See http://forum.java.sun.com/thread.jspa?threadID=562510&start=0 and it explains the
-            // whys of the following code.
-            // transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "4");
-			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-            transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, (omitXmlDecl?"yes":"no"));
-			transformer.transform(domSource, streamRes);
-		} catch (Exception e) {
-			throw new ConfigurationException("Failed to serialize ESB Configuration Document instance.", e);
-		}
-	}
-
-    /**
-     * Count the DOM element nodes before the supplied node, having the specified
-     * tag name, not including the node itself.
-     * <p/>
-     * Counts the sibling nodes.
-     *
-     * @param node    Node whose element siblings are to be counted.
-     * @param tagName The tag name of the sibling elements to be counted.
-     * @return The number of siblings elements before the supplied node with the
-     *         specified tag name.
-     */
-    public static int countElementsBefore(Node node, String tagName) {
-        Node parent = node.getParentNode();
-
-        NodeList siblings = parent.getChildNodes();
-        int count = 0;
-        int siblingCount = siblings.getLength();
-
-        for (int i = 0; i < siblingCount; i++) {
-            Node sibling = siblings.item(i);
-
-            if (sibling == node) {
-                break;
-            }
-            if (sibling.getNodeType() == Node.ELEMENT_NODE && ((Element) sibling).getTagName().equals(tagName)) {
-                count++;
-            }
-        }
-
-        return count;
-    }
-
-    /**
-     * Copy the nodes of a NodeList into the supplied list.
-     * <p/>
-     * This is not a cloneCollectionTemplateElement.  It's just a copy of the node references.
-     * <p/>
-     * Allows iteration over the Nodelist using the copy in the knowledge that
-     * the list will remain the same length, even if we modify the underlying NodeList.
-     * Using the NodeList can result in problems because elements can get removed from
-     * the list while we're iterating over it.
-     * <p/>
-     * <i>This code was acquired donated by the Milyn Smooks project.</i>
-     *
-     * @param nodeList Nodelist to copy.
-     * @return List copy.
-     */
-    public static List<Node> copyNodeList(NodeList nodeList) {
-        List<Node> copy = new Vector<Node>();
-
-        if (nodeList != null) {
-            int nodeCount = nodeList.getLength();
-
-            for (int i = 0; i < nodeCount; i++) {
-                copy.add(nodeList.item(i));
-            }
-        }
-
-        return copy;
-    }
-    
-    public static Element getNextSiblingElement(Node node) {
-        Node nextSibling = node.getNextSibling();
-
-        while (nextSibling != null) {
-            if (nextSibling.getNodeType() == Node.ELEMENT_NODE) {
-                return (Element) nextSibling;
-            }
-            nextSibling = nextSibling.getNextSibling();
-        }
-
-        return null;
-    }
-
-    public static Node getFirstChildByType(Element element, int nodeType) {
-        NodeList children = element.getChildNodes();
-        int childCount = children.getLength();
-
-        for(int i = 0; i < childCount; i++) {
-            Node child = children.item(i);
-            if (child.getNodeType() == nodeType) {
-                return child;
-            }
-        }
-
-        return null;
-    }
-
-    private static String ELEMENT_NAME_FUNC = "/name()";
-
-    private static XPathFactory xPathFactory = XPathFactory.newInstance();
-
-    /**
-     * Get the W3C NodeList instance associated with the XPath selection
-     * supplied.
-     * <p/>
-     * <b>NOTE</b>: Taken from Milyn Commons.
-     *
-     * @param node  The document node to be searched.
-     * @param xpath The XPath String to be used in the selection.
-     * @return The W3C NodeList instance at the specified location in the
-     *         document, or null.
-     */
-    public static NodeList getNodeList(Node node, String xpath) {
-        if (node == null) {
-            throw new IllegalArgumentException(
-                    "null 'document' arg in method call.");
-        } else if (xpath == null) {
-            throw new IllegalArgumentException(
-                    "null 'xpath' arg in method call.");
-        }
-        try {
-            XPath xpathEvaluater = xPathFactory.newXPath();
-
-            if (xpath.endsWith(ELEMENT_NAME_FUNC)) {
-                return (NodeList) xpathEvaluater.evaluate(xpath.substring(0,
-                        xpath.length() - ELEMENT_NAME_FUNC.length()), node,
-                        XPathConstants.NODESET);
-            } else {
-                return (NodeList) xpathEvaluater.evaluate(xpath, node,
-                        XPathConstants.NODESET);
-            }
-        } catch (XPathExpressionException e) {
-            throw new IllegalArgumentException("bad 'xpath' expression ["
-                    + xpath + "].");
-        }
-    }
-
-    /**
-     * Get the W3C Node instance associated with the XPath selection supplied.
-     * <p/>
-     * <b>NOTE</b>: Taken from Milyn Commons.
-     *
-     * @param node  The document node to be searched.
-     * @param xpath The XPath String to be used in the selection.
-     * @return The W3C Node instance at the specified location in the document,
-     *         or null.
-     */
-    public static Node getNode(Node node, String xpath) {
-        NodeList nodeList = getNodeList(node, xpath);
-
-        if (nodeList == null || nodeList.getLength() == 0) {
-            return null;
-        } else {
-            return nodeList.item(0);
-        }
-    }
-
-    /**
-     * Get the name from the supplied element.
-     * <p/>
-     * Returns the {@link Node#getLocalName() localName} of the element
-     * if set (namespaced element), otherwise the
-     * element's {@link Element#getTagName() tagName} is returned.
-     * <p/>
-     * <b>NOTE</b>: Taken from Milyn Smooks.
-     *
-     * @param element The element.
-     * @return The element name.
-     */
-    public static String getName(Element element) {
-        AssertArgument.isNotNull(element, "element");
-
-        String name = element.getLocalName();
-
-        if(name != null) {
-            return name;
-        } else {
-            return element.getTagName();
-        }
-    }
-    /**
-     * Copy child node references from source to target.
-     * @param source Source Node.
-     * @param target Target Node.
-     */
-    public static void copyChildNodes(Node source, Node target) {
-        AssertArgument.isNotNull(source, "source");
-        AssertArgument.isNotNull(target, "target");
-        
-        List nodeList = copyNodeList(source.getChildNodes());
-        int childCount = nodeList.size();
-        
-        for(int i = 0; i < childCount; i++) {
-            target.appendChild((Node)nodeList.get(i));
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/dom/YADOMUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,436 @@
+/*
+ * 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.dom;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.List;
+import java.util.Vector;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.FactoryConfigurationError;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.ConfigurationException;
+import org.w3c.dom.Attr;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+
+/**
+ * Yet another set of DOM utility methods.
+ * <p/>
+ * PLEASE DO NOT USE THIS CLASS OUTSIDE THIS PACKAGE. It will be removed as soon as we find
+ * equivalent DOM support methods somewhere else, or find a more appropriate home for these.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class YADOMUtil {
+
+	// If there are another set of the same utilities somewhere, or another DOMUtil type class
+	// that we can add them too, we should do that :-)
+	
+	/**
+	 * Create a new W3C Document.
+	 * <p/>
+	 * Handles exceptions etc.
+	 * @return The new Document instance.
+	 * @throws ConfigurationException 
+	 */
+	public static Document createDocument() throws ConfigurationException {
+		Document doc = null;
+		
+		try {
+			doc = DocumentBuilderFactory.newInstance().newDocumentBuilder().newDocument();
+		} catch (ParserConfigurationException e) {
+			throw new ConfigurationException("Failed to create ESB Configuration Document instance.", e);
+		}
+		
+		return doc;
+	}
+
+    /**
+     * Parse the supplied XML String and return the associated W3C Document object.
+     *
+     * @param xml XML String.
+     * @return The W3C Document object associated with the input stream.
+     */
+    public static Document parse(String xml) throws SAXException, IOException {
+        return parseStream(new ByteArrayInputStream(xml.getBytes()), false, false);
+    }
+
+    /**
+     * Parse the XML stream and return the associated W3C Document object.
+     * <p/>
+     * Performs a namespace unaware parse.
+     *
+     * @param stream
+     *            The stream to be parsed.
+     * @param validate
+     *            True if the document is to be validated, otherwise false.
+     * @param expandEntityRefs
+     *            Expand entity References as per
+     *            {@link DocumentBuilderFactory#setExpandEntityReferences(boolean)}.
+     * @return The W3C Document object associated with the input stream.
+     */
+    public static Document parseStream(InputStream stream, boolean validate,
+            boolean expandEntityRefs) throws SAXException, IOException {
+        return parseStream(stream, validate, expandEntityRefs, false);
+    }
+
+    /**
+     * Parse the XML stream and return the associated W3C Document object.
+     *
+     * @param stream
+     *            The stream to be parsed.
+     * @param validate
+     *            True if the document is to be validated, otherwise false.
+     * @param expandEntityRefs
+     *            Expand entity References as per
+     *            {@link DocumentBuilderFactory#setExpandEntityReferences(boolean)}.
+     * @param namespaceAware
+     *            True if the document parse is to be namespace aware,
+     *            otherwise false.
+     * @return The W3C Document object associated with the input stream.
+     */
+    public static Document parseStream(InputStream stream, boolean validate,
+            boolean expandEntityRefs, boolean namespaceAware) throws SAXException, IOException {
+        if (stream == null) {
+            throw new IllegalArgumentException(
+                    "null 'stream' arg in method call.");
+        }
+        try {
+            DocumentBuilderFactory factory = DocumentBuilderFactory
+                    .newInstance();
+            DocumentBuilder docBuilder = null;
+
+            factory.setValidating(validate);
+            factory.setExpandEntityReferences(expandEntityRefs);
+            factory.setNamespaceAware(namespaceAware);
+            docBuilder = factory.newDocumentBuilder();
+
+            return docBuilder.parse(stream);
+        } catch (ParserConfigurationException e) {
+            IllegalStateException state = new IllegalStateException(
+                    "Unable to parse XML stream - XML Parser not configured correctly.");
+            state.initCause(e);
+            throw state;
+        } catch (FactoryConfigurationError e) {
+            IllegalStateException state = new IllegalStateException(
+                    "Unable to parse XML stream - DocumentBuilderFactory not configured correctly.");
+            state.initCause(e);
+            throw state;
+        }
+    }
+
+    /**
+	 * Add an Element node to the supplied parent name.
+	 * @param parent The parent to to which the new Element node is to be added.
+	 * @param elementName The name of the Element to be added.
+	 * @return The new Element.
+	 */
+	public static Element addElement(Node parent, String elementName) {
+		Element element = null;
+		
+		if(parent instanceof Document) {
+			element = ((Document)parent).createElement(elementName);
+		} else {
+			element = parent.getOwnerDocument().createElement(elementName);
+		}
+		parent.appendChild(element);
+		
+		return element;
+	}
+	
+	/**
+	 * Remove all attributes having an empty value.
+	 * @param element The element to be processed.
+	 */
+	public static void removeEmptyAttributes(Element element) {
+		NamedNodeMap attributes = element.getAttributes();
+		int attribCount = attributes.getLength();
+		
+		for(int i = attribCount - 1; i >= 0; i--) {
+			Attr attribute = (Attr) attributes.item(i);
+			
+			// Note - doesn't account for namespaces.  Not needed here !
+			if(attribute.getValue().equals("")) {
+				attributes.removeNamedItem(attribute.getName());
+			}
+		}
+	}
+
+	/**
+	 * Serialize the supplied DOM node to the specified file in the specified output directory.
+	 * @param node The DOM node to be serialised.
+	 * @param outdir The directory into which the file is to be serialised.
+	 * @param fileName The name of the file.
+	 * @throws ConfigurationException Unable to serialise the node.
+	 */
+	public static void serialize(Node node, File outdir, String fileName) throws ConfigurationException {
+		serialize(node, new StreamResult(new File(outdir, fileName)));
+	}
+
+    public static void serialize(Node node, OutputStream out) throws ConfigurationException {
+      serialize(node, new StreamResult(out));
+    }
+
+    /**
+      * Serialize the supplied DOM node to the supplied DOM StreamResult instance.
+      * @param node The DOM node to be serialised.
+      * @param streamRes The StreamResult into which the node is to be serialised.
+      * @throws ConfigurationException Unable to serialise the node.
+      */
+    public static void serialize(Node node, StreamResult streamRes) throws ConfigurationException {
+        serialize(node, streamRes, false);
+    }
+
+   /**
+	 * Serialize the supplied DOM node to the supplied DOM StreamResult instance.
+	 * @param node The DOM node to be serialised.
+	 * @param streamRes The StreamResult into which the node is to be serialised.
+     * @param omitXmlDecl Omit the XML declaration.
+	 * @throws ConfigurationException Unable to serialise the node.
+	 */
+	public static void serialize(Node node, StreamResult streamRes, boolean omitXmlDecl) throws ConfigurationException {
+		DOMSource domSource = new DOMSource(node);
+		
+		try {
+			Transformer transformer = TransformerFactory.newInstance().newTransformer();
+
+            // There's a bug in Java 5 re this code (formatting).
+            // See http://forum.java.sun.com/thread.jspa?threadID=562510&start=0 and it explains the
+            // whys of the following code.
+            // transformer.setOutputProperty("{http://xml.apache.org/xalan}indent-amount", "4");
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+            transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, (omitXmlDecl?"yes":"no"));
+			transformer.transform(domSource, streamRes);
+		} catch (Exception e) {
+			throw new ConfigurationException("Failed to serialize ESB Configuration Document instance.", e);
+		}
+	}
+
+    /**
+     * Count the DOM element nodes before the supplied node, having the specified
+     * tag name, not including the node itself.
+     * <p/>
+     * Counts the sibling nodes.
+     *
+     * @param node    Node whose element siblings are to be counted.
+     * @param tagName The tag name of the sibling elements to be counted.
+     * @return The number of siblings elements before the supplied node with the
+     *         specified tag name.
+     */
+    public static int countElementsBefore(Node node, String tagName) {
+        Node parent = node.getParentNode();
+
+        NodeList siblings = parent.getChildNodes();
+        int count = 0;
+        int siblingCount = siblings.getLength();
+
+        for (int i = 0; i < siblingCount; i++) {
+            Node sibling = siblings.item(i);
+
+            if (sibling == node) {
+                break;
+            }
+            if (sibling.getNodeType() == Node.ELEMENT_NODE && ((Element) sibling).getTagName().equals(tagName)) {
+                count++;
+            }
+        }
+
+        return count;
+    }
+
+    /**
+     * Copy the nodes of a NodeList into the supplied list.
+     * <p/>
+     * This is not a cloneCollectionTemplateElement.  It's just a copy of the node references.
+     * <p/>
+     * Allows iteration over the Nodelist using the copy in the knowledge that
+     * the list will remain the same length, even if we modify the underlying NodeList.
+     * Using the NodeList can result in problems because elements can get removed from
+     * the list while we're iterating over it.
+     * <p/>
+     * <i>This code was acquired donated by the Milyn Smooks project.</i>
+     *
+     * @param nodeList Nodelist to copy.
+     * @return List copy.
+     */
+    public static List<Node> copyNodeList(NodeList nodeList) {
+        List<Node> copy = new Vector<Node>();
+
+        if (nodeList != null) {
+            int nodeCount = nodeList.getLength();
+
+            for (int i = 0; i < nodeCount; i++) {
+                copy.add(nodeList.item(i));
+            }
+        }
+
+        return copy;
+    }
+    
+    public static Element getNextSiblingElement(Node node) {
+        Node nextSibling = node.getNextSibling();
+
+        while (nextSibling != null) {
+            if (nextSibling.getNodeType() == Node.ELEMENT_NODE) {
+                return (Element) nextSibling;
+            }
+            nextSibling = nextSibling.getNextSibling();
+        }
+
+        return null;
+    }
+
+    public static Node getFirstChildByType(Element element, int nodeType) {
+        NodeList children = element.getChildNodes();
+        int childCount = children.getLength();
+
+        for(int i = 0; i < childCount; i++) {
+            Node child = children.item(i);
+            if (child.getNodeType() == nodeType) {
+                return child;
+            }
+        }
+
+        return null;
+    }
+
+    private static String ELEMENT_NAME_FUNC = "/name()";
+
+    private static XPathFactory xPathFactory = XPathFactory.newInstance();
+
+    /**
+     * Get the W3C NodeList instance associated with the XPath selection
+     * supplied.
+     * <p/>
+     * <b>NOTE</b>: Taken from Milyn Commons.
+     *
+     * @param node  The document node to be searched.
+     * @param xpath The XPath String to be used in the selection.
+     * @return The W3C NodeList instance at the specified location in the
+     *         document, or null.
+     */
+    public static NodeList getNodeList(Node node, String xpath) {
+        if (node == null) {
+            throw new IllegalArgumentException(
+                    "null 'document' arg in method call.");
+        } else if (xpath == null) {
+            throw new IllegalArgumentException(
+                    "null 'xpath' arg in method call.");
+        }
+        try {
+            XPath xpathEvaluater = xPathFactory.newXPath();
+
+            if (xpath.endsWith(ELEMENT_NAME_FUNC)) {
+                return (NodeList) xpathEvaluater.evaluate(xpath.substring(0,
+                        xpath.length() - ELEMENT_NAME_FUNC.length()), node,
+                        XPathConstants.NODESET);
+            } else {
+                return (NodeList) xpathEvaluater.evaluate(xpath, node,
+                        XPathConstants.NODESET);
+            }
+        } catch (XPathExpressionException e) {
+            throw new IllegalArgumentException("bad 'xpath' expression ["
+                    + xpath + "].");
+        }
+    }
+
+    /**
+     * Get the W3C Node instance associated with the XPath selection supplied.
+     * <p/>
+     * <b>NOTE</b>: Taken from Milyn Commons.
+     *
+     * @param node  The document node to be searched.
+     * @param xpath The XPath String to be used in the selection.
+     * @return The W3C Node instance at the specified location in the document,
+     *         or null.
+     */
+    public static Node getNode(Node node, String xpath) {
+        NodeList nodeList = getNodeList(node, xpath);
+
+        if (nodeList == null || nodeList.getLength() == 0) {
+            return null;
+        } else {
+            return nodeList.item(0);
+        }
+    }
+
+    /**
+     * Get the name from the supplied element.
+     * <p/>
+     * Returns the {@link Node#getLocalName() localName} of the element
+     * if set (namespaced element), otherwise the
+     * element's {@link Element#getTagName() tagName} is returned.
+     * <p/>
+     * <b>NOTE</b>: Taken from Milyn Smooks.
+     *
+     * @param element The element.
+     * @return The element name.
+     */
+    public static String getName(Element element) {
+        AssertArgument.isNotNull(element, "element");
+
+        String name = element.getLocalName();
+
+        if(name != null) {
+            return name;
+        } else {
+            return element.getTagName();
+        }
+    }
+    /**
+     * Copy child node references from source to target.
+     * @param source Source Node.
+     * @param target Target Node.
+     */
+    public static void copyChildNodes(Node source, Node target) {
+        AssertArgument.isNotNull(source, "source");
+        AssertArgument.isNotNull(target, "target");
+        
+        List nodeList = copyNodeList(source.getChildNodes());
+        int childCount = nodeList.size();
+        
+        for(int i = 0; i < childCount; i++) {
+            target.appendChild((Node)nodeList.get(i));
+        }
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,644 +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.helpers;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.Serializable;
-import java.io.UnsupportedEncodingException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.ListIterator;
-import java.util.Map;
-import java.util.Set;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerConfigurationException;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-import org.w3c.dom.NodeList;
-import org.xml.sax.SAXException;
-/**
- * Objects of this class are to be used for run time configuration of ESB components 
- * <p/>  This should gradually replace the ConfigTree class
- * <br/> It is a subset of Tree that accepts a Map of attributes, and a List of children
- * <br/> children can only be String values, or objects of this class
- * <p/> fromXml() and toXml() methods allow 'visible' representations of objects of this class
- * and run time loading/dumping from/to standard XML documents
- * 
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- *
- */
-public class ConfigTree implements Serializable, Cloneable
-{
-	private static final long serialVersionUID = 1L;
-/**
- * Constructor of a root node (an uppermost ConfigTree)
- * @param name String - the element name of 'this'
- */
-	public ConfigTree(String name) { this(name,null); }
-/**
- * Constructor of a ConfigTree as a child of another (second arg)
- * @param name String - element name of 'this'
- * @param dad ConfigTree - whom 'this' will be hanging from
- */
-	public ConfigTree(String name, ConfigTree dad)
-	{
-		setName(name);
-		setParent(dad);
-	} // _______________________________
-/**
- * protected constructor
- * @param other - Where to get values for deep copy
- */
-	protected ConfigTree(ConfigTree other)
-	{
-		copyFrom(other);
-	} // _______________________________
-
-	/**
-	 * 
-	 * @return String - the name of this tree (element name for XML representation)
-	 */
-	public String getName() 			{ return _name; }
-	/**
-	 * assign a name to 'this'
-	 * @param name String - The name for this object
-	 */
-	public void   setName(String name) 	
-	{
-		if (null==name)
-			throw new IllegalArgumentException();
-		_name = name; 
-	} // _______________________________
-
-	/**
-	 * whose child is 'this' (null if root)
-	 * @return ConfigTree - the parent tree of 'this' 
-	 */
-	public ConfigTree getParent() 			{ return _dad; }
-	
-	private  void   setParent(ConfigTree dad)	
-	{ 
-		if (null!=_dad && null!=_dad._childs)
-				_dad._childs.remove(this);
-		if (null!=dad)
-			dad.addChild(this); 
-	} 	
-	/**
-	 * assign a value to a named attribute 
-	 * @param name String - the name (key) for the new attribute 
-	 * @param value String - the value assigned to the key (if null - old value will be deleted)
-	 * @return String - old value assigned to the name (null if there was none)
-	 */
-	public String setAttribute(String name,String value)
-	{
-		if (null==name)
-			throw new IllegalArgumentException("Attribute name must be non null");
-		if (null==_attributes)
-			_attributes = new HashMap<String,String>();
-		String oldVal = _attributes.remove(name);
-		if(null!=value)
-			_attributes.put(name,value);
-		return oldVal;
-	} // _______________________________
-	/**
-	 * 
-	 * @return int - the number of non null attributes that this node has been assigned
-	 */
-	public int attributeCount()
-	{
-		return (null==_attributes) ? 0 : _attributes.size();
-	} // _______________________________
-	/**
-	 * Retrieve the value assigned to an attribute key.
-	 * @param name String - the search key.
-	 * @return String - the value assigned to the specified key, or null if the
-	 * attribute is not defined.
-	 */
-	public String getAttribute(String name)
-	{
-		return (null==_attributes) ? null : _attributes.get(name);
-	} // _______________________________
-	/**
-	 * Retrieve the value assigned to an attribute key, returning the supplied default
-	 * if the attribute is not defined.
-	 * @param name String - the search key.
-	 * @param defaultValue String - the default value to return if attribute is not set.
-	 * @return String - the value assigned to the specified key, or the default if
-	 * the value is not defined.
-	 */
-	public String getAttribute(String name, String defaultValue)
-	{
-		String ret = (null==_attributes) ? null : _attributes.get(name);
-		return (ret !=null?ret:defaultValue);
-	} // _______________________________
-	
-	/**
-	 * Get the value of a requred property, throwing a {@link ConfigurationException}
-	 * if the property is not defined. 
-	 * @param name String - the search key.
-	 * @return The value assigned to the specified property.
-	 * @throws ConfigurationException The propery is not defined.
-	 */
-	public String getRequiredAttribute(String name) throws ConfigurationException {
-		String ret = getAttribute(name);
-		
-		if(ret == null) {
-			throw new ConfigurationException("Required configuration property '" + name + "' not defined on configuration '" + _name + "'.");
-		}
-		
-		return ret;
-	}
-	
-	/**
-	 * obtain the list of all attribute names
-	 * @return Set<String>  - the set of keys that have been assigned a non null value
-	 */
-	public Set<String>getAttributeNames() 
-	{ return (null==_attributes) 
-		? new HashSet<String>() 
-		: _attributes.keySet();
-	} // _______________________________
-	/**
-	 * obtain the list of all attribute as a List<KeyValuePair>
-	 * @return List<KeyValuePair> - containing all attributes
-	 */
-	public List<KeyValuePair> attributesAsList() 
-	{
-		List<KeyValuePair> oRet = new ArrayList<KeyValuePair>();
-		if (null!=_attributes) 
-			for (Map.Entry<String,String> oCurr : _attributes.entrySet())
-				oRet.add(new KeyValuePair(oCurr.getKey(),oCurr.getValue()));
-		return oRet;
-	} // _______________________________
-	/**
-	 * obtain the list of all child "property" elements as a List<KeyValuePair>
-	 * @return List<KeyValuePair> - containing all child elements with tag name "property"
-	 */
-	public List<KeyValuePair> childPropertyList() 
-	{
-		List<KeyValuePair> oRet = new ArrayList<KeyValuePair>();
-		for (ConfigTree current : getChildren("property"))
-		{
-			String name = current.getAttribute("name");
-			if (null!=name)
-				oRet.add(new KeyValuePair(name,current.getAttribute("value")));
-		}
-		return oRet;
-	} // _______________________________
-	/**
-	 * concatenated values of all child String values that have been added to 'this'
-	 * <br/>"" (zero length String) if no String child nodes
-	 * @return String - concatenation of all String segments (equivalent to xml text nodes)
-	 */
-	public String getWholeText() 
-	{
-		if (null==_childs)
-			return "";
-		StringBuilder sb = null;
-		for (Child child : _childs)
-		{	if (! (child._obj instanceof String))
-				continue;
-			if (null==sb)
-				sb = new StringBuilder((String)child._obj);
-			else
-				sb.append((String)child._obj);
-		}
-		return sb.toString();
-				
-	} // _______________________________
-/**
- * <b>first</b> child containing only text, with name=arg0
- * @param name String - the name to filter
- * @return full text content of first 'pure text' child element under that name - &lt;null&gt; if none
- */
-	public String getFirstTextChild(String name) 
-	{
-		if (null==name)
-			throw new IllegalArgumentException();
-		if (null!=_childs)
-			for (Child oCurr : _childs)
-			{
-				ConfigTree tree = oCurr.getTree();
-				if (null != tree && tree.isPureText() && name.equals(tree.getName()))
-					 return tree.getWholeText();
-			}
-		return null;
-	} // _______________________________
-
-	/**
- * Obtain all String values with the same name
- * @param name String - filter for child String nodes
- * @return String[]
- */
-	public String[] getTextChildren(String name) 
-	{
-		if (null==name)
-			throw new IllegalArgumentException();
-		if (null==_childs)
-			return new String[0];
-		List<String>oRet = new ArrayList<String>();
-		for (Child oCurr : _childs)
-		{
-			ConfigTree tree = oCurr.getTree();
-			if (null != tree && tree.isPureText() && name.equals(tree.getName()))
-				oRet.add(tree.getWholeText());
-		}
-		return oRet.toArray(new String[oRet.size()]);
-	} // _______________________________
-/**
- * add a child element that consists only of the text in arg0
- * @param value String - the text to assign to the added child node
- */
-	public void addTextChild (String value) { new Child(value); }
-	
-	private void addChild(ConfigTree child)	
-		{ child._dad = this; new Child(child); }
-/**
- * retrieve list of child elements of 'this' that are instances of ConfigTree
- * @return ConfigTree[] - Array containing all child elements of class ConfigTree
- */
-	public ConfigTree[] getAllChildren() 
-	{
-		if (null==_childs) 
-			return new ConfigTree[]{};
-		List<ConfigTree>oRet = new ArrayList<ConfigTree>();
-		for (Child oCurr : _childs)
-			if (null != oCurr.getTree())
-				oRet.add(oCurr.getTree());
-		return oRet.toArray(new ConfigTree[oRet.size()]);
-	} // _______________________________
-
-	/**
-	 * list of child elements of 'this' that are instances of ConfigTree, with name = arg0
-	 * @param name String - the name of child nodes to filter
-	 * @return ConfigTree[] - child elements of class ConfigTree with name provided
-	 */
-	public ConfigTree[] getChildren(String name) 
-	{
-		if (null==name)
-			throw new IllegalArgumentException();
-		if (null==_childs)
-			return new ConfigTree[0];
-		List<ConfigTree>oRet = new ArrayList<ConfigTree>();
-		for (Child oCurr : _childs)
-			if (name.equals(oCurr.getName()))
-					oRet.add(oCurr.getTree());
-		return oRet.toArray(new ConfigTree[oRet.size()]);
-	} // _______________________________
-/**
- * <b>first</b> child of class ConfigTree with name=arg0
- * @param name String - the name to filter
- * @return first child element under that name - &lt;null&gt; if none
- */
-	public ConfigTree getFirstChild(String name) 
-	{
-		if (null==name)
-			throw new IllegalArgumentException();
-		if (null!=_childs)
-			for (Child oCurr : _childs)
-				if (name.equals(oCurr.getName()))
-					return oCurr.getTree();
-		return null;
-	} // _______________________________
-/**
- * purge the list of children
- */
-	public void removeAllChildren() 
-	{
-		_childs = null;
-	} // _______________________________
-
-	/**
-	 * remove children by name
-	 * @param name String - only children by that name will be removed
-	 */
-	public void removeChildrenByName(String name) 
-	{
-		if (null==name)
-			throw new IllegalArgumentException();
-		if (null!=_childs)
-			for (ListIterator<Child> II=_childs.listIterator(); II.hasNext();)
-				if (name.equals(II.next().getName()))
-					II.remove();
-	} // __________________________________
-
-	/**
-	 * 
-	 * @return the number of child nodes (of any type)
-	 */
-	public int childCount()
-	{
-		return (null==_childs) ? 0 : _childs.size();
-	} // __________________________________
-
-	@Override
-	public Object clone() { return cloneObj(); }
-
-	/**
-	 * instantiate a new ConfigTree with the same topology and contents of 'this'
-	 * <br/>Contained ConfigTree child elements will also be cloned
-	 * <br/>Transient objects are NOT copied nor cloned
-	 * @return ConfigTree - Deep copy of 'this'
-	 */
-	public ConfigTree cloneObj() {return cloneSubtree(null); } 
-
-	/**
-	 * @return ConfigTree - Deep copy of 'this'
-	 */
-	private ConfigTree cloneSubtree(ConfigTree dad)
-	{
-		ConfigTree oRet = new ConfigTree(_name, dad);
-		if (null!=_attributes)
-			for (Map.Entry<String,String> oAtt: _attributes.entrySet())
-				oRet.setAttribute(oAtt.getKey(),oAtt.getValue());
-		if (null!= _childs)
-			for (Child oChild : _childs)
-			{	
-				ConfigTree tree = oChild.getTree();
-				if (null!=tree)
-					tree.cloneSubtree(oRet);
-				else
-					oRet.addTextChild(oChild._obj.toString());
-			}
-		return oRet;
-	} // __________________________________
-	/**
-	 * Deep copy of other tree
-	 * @param other - from where to copy values
-	 */
-	protected void copyFrom(ConfigTree other)
-	{
-		this.setName(other.getName());
-		this._pureText	= other._pureText;
-
-		if (null != other._attributes)
-			for (Map.Entry<String,String> oneAtt : other._attributes.entrySet())
-				setAttribute(oneAtt.getKey(),oneAtt.getValue());
-		if (null != other._childs)
-			for (Child child : other._childs)
-				new Child(child);
-			
-	} // __________________________________
-/**
- * obtain an instance of this class, from a 'normalized' xml format, with the default encoding
- * <p/> the 'normalized' xml format is the output of the toXml() instance method
- * @param xml String - what to parse
- * @return ConfigTree - an object of this class
- * @throws SAXException - if xml format is invalid
- */
-	public static ConfigTree fromXml(String xml) throws SAXException
-	{
-		try { return fromXml(xml,java.nio.charset.Charset.defaultCharset().toString()); }
-		catch (UnsupportedEncodingException e)
-		{
-			//  This can't happen
-			_logger.fatal("Received unexpected exception: ",e);
-			return null;
-		}
-	} // __________________________________
-	
-	/**
-	 * obtain an instance of this class, from a 'normalized' xml format, with the encoding defined in arg1
-	 * <p/> the 'normalized' xml format is the output of the toXml() instance method
-	 * @param xml String - what to parse
-	 * @param encoding String - The encoding of arg 0
-	 * @return ConfigTree - an object of this class
-	 * @throws SAXException - if xml format is invalid
-	 */
-	public static ConfigTree fromXml(String xml, String encoding)
-		throws UnsupportedEncodingException, SAXException
-	{
-		if (null==xml)
-			throw new IllegalArgumentException("Xml source String is null");
-		try { return fromInputStream(new ByteArrayInputStream(xml.getBytes(encoding))); }
-		catch (IOException e)
-		{
-			_logger.fatal("Received unexpected IOException: ",e);
-			return null;
-		}
-	} // __________________________________
-
-	/**
-	 * obtain an instance of this class, from a 'normalized' xml format contained in an input stream
-	 * <p/> the 'normalized' xml format is the output of the toXml() instance method
-	 * @param input InputStream - where to parse from
-	 * @return ConfigTree - an object of this class
-	 * @throws SAXException - if xml format is invalid
-	 * @throws IOException - if an input/output error occurs
-	 */
-	public static ConfigTree fromInputStream(InputStream input) 
-		throws SAXException, IOException
-	{
-		if (null==input)
-			throw new IllegalArgumentException();
-		DocumentBuilder builder = null;
-		try { builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); }
-		catch (ParserConfigurationException e2)
-		{	_logger.error("Problems with default Parser Configuration",e2);
-			return null;
-		}
-		Document oDoc = builder.parse(input);
-		oDoc.normalize();
-		
-		return fromElement(oDoc.getDocumentElement());
-		
-	} // __________________________________
-
-	public static ConfigTree fromElement(Element elem)
-	{
-		ConfigTree tree = new ConfigTree(elem.getNodeName());
-		NamedNodeMap NM = elem.getAttributes();
-		if (null!=NM)
-			for (int i1=0; i1<NM.getLength(); i1++)
-			{
-				Node node = NM.item(i1);
-				tree.setAttribute(node.getNodeName(),node.getNodeValue());
-			}
-		NodeList NL = elem.getChildNodes();
-		if (null!=NL)
-			for (int i1=0; i1<NL.getLength(); i1++)
-			{
-				Node node = NL.item(i1);
-				switch (node.getNodeType())
-				{	
-					case Node.ELEMENT_NODE:
-						tree.addChild(ConfigTree.fromElement((Element)node));
-						break;
-					case Node.TEXT_NODE:
-						tree.addTextChild(node.getNodeValue());
-						break;
-				}
-			}
-		
-		return tree;
-	} // __________________________________
-
-	private Element toElement(Document doc)
-	{
-		Element elem = doc.createElement(_name);
-		if (null!=_attributes)
-			for (Map.Entry<String,String> oAtt : _attributes.entrySet())
-				elem.setAttribute(oAtt.getKey(),oAtt.getValue());
-		if (null!=_childs)
-			for (Child child : _childs)
-			{
-				ConfigTree tree = child.getTree();
-				if (null!=tree)
-					elem.appendChild(tree.toElement(doc));
-				else
-					elem.appendChild(doc.createTextNode(child._obj.toString()));
-			}
-		return elem;
-	} // __________________________________
-	/**
-	 * Equivalent to a call to toXml()
-	 * @return String - a String with the 'standard' xml representation of 'this',
-	 * using the default encoding
-	 */
-	public String toString() { return toXml(); }
-	/**
-	 * Equivalent to a call to toXml(encoding)
-	 * @param encoding String - 
-	 * @return String - a String with the 'standard' xml representation of 'this',
-	 * using the encoding specified in arg 0
-	 */
-
-	public String toString(String encoding) { return toXml(encoding); }
-	/**
-	 * @return String - a String with the 'standard' xml representation of 'this',
-	 * using the default encoding
-	 */
-	public String toXml()
-	{
-		return toXml(java.nio.charset.Charset.defaultCharset().toString());
-	} // __________________________________
-	
-	/**
-	 * Serialize this object - Transient objects are
-	 * @param encoding String - String 
-	 * @return String - a String with the 'standard' xml representation of 'this',
-	 * using encoding specified in arg0
-	 */
-	public String toXml(String encoding)
-	{
-		Transformer transf = null;
-		try { transf = TransformerFactory.newInstance().newTransformer(); }
-		catch (TransformerConfigurationException e1)
-		{	_logger.error("Cannot obtain transformer to render XML output",e1);
-			return null;
-		}
-		transf.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"yes");
-		transf.setOutputProperty(OutputKeys.INDENT, "no");
-		transf.setOutputProperty(OutputKeys.ENCODING, encoding);
-
-		DocumentBuilder builder = null;
-		try { builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); }
-		catch (ParserConfigurationException e2)
-		{	_logger.error("Problems with default Parser Configuration",e2);
-			return null;
-		}
-		Document oDoc = builder.newDocument();
-		oDoc.appendChild(toElement(oDoc));
-		oDoc.normalize();
-		DOMSource src = new DOMSource(oDoc);
-
-		ByteArrayOutputStream oStrm = new ByteArrayOutputStream(5000);
-		StreamResult res = new StreamResult(oStrm);
-
-		try { transf.transform(src, res); }
-		catch (TransformerException e3)
-		{	_logger.error("Problems with XML transformation",e3);
-			return null;
-		}
-
-		return oStrm.toString();
-	} // __________________________________
-	
-	/**
-	 * 
-	 * @return boolean - indicating if 'this' element has ONLY text children (and consequently no ConfigTree children)
-	 */
-	public boolean isPureText() { return _pureText; }
-
-	private class Child
-	{
-		Object _obj;
-		ConfigTree getTree() 
-		{	return (_obj instanceof ConfigTree)? (ConfigTree) _obj : null;
-		}
-		String getName() 
-		{	return (_obj instanceof ConfigTree)? ((ConfigTree) _obj)._name : null;
-		}
-		private Child(ConfigTree obj)	{addToDad(obj); _pureText = false;}
-		private Child(String obj)		{addToDad(obj); }
-		private Child(Child other)		
-		{	
-			if (other._obj instanceof ConfigTree)
-			{
-				addToDad(((ConfigTree)other._obj).cloneObj());
-				_pureText	= false;
-				return;
-			}
-			if (other._obj instanceof String)
-			{
-				addToDad((String)other._obj);
-				return;
-			}
-
-		}
-		private void addToDad(Object obj)
-		{	if (null==_childs)
-				_childs = new ArrayList<Child>();
-			_obj	= obj;
-			_childs.add(this);
-		}
-		
-	}
-
-	private boolean				_pureText=true;
-	private ConfigTree 			_dad;
-	private String 				_name;
-	private Map<String,String> 	_attributes;
-	private List<Child>			_childs;
-
-	private static transient Logger			_logger = Logger.getLogger(ConfigTree.class);
-} //____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/ConfigTree.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,644 @@
+/*
+ * 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.helpers;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Serializable;
+import java.io.UnsupportedEncodingException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.ListIterator;
+import java.util.Map;
+import java.util.Set;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerConfigurationException;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+import org.w3c.dom.NodeList;
+import org.xml.sax.SAXException;
+/**
+ * Objects of this class are to be used for run time configuration of ESB components 
+ * <p/>  This should gradually replace the ConfigTree class
+ * <br/> It is a subset of Tree that accepts a Map of attributes, and a List of children
+ * <br/> children can only be String values, or objects of this class
+ * <p/> fromXml() and toXml() methods allow 'visible' representations of objects of this class
+ * and run time loading/dumping from/to standard XML documents
+ * 
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ *
+ */
+public class ConfigTree implements Serializable, Cloneable
+{
+	private static final long serialVersionUID = 1L;
+/**
+ * Constructor of a root node (an uppermost ConfigTree)
+ * @param name String - the element name of 'this'
+ */
+	public ConfigTree(String name) { this(name,null); }
+/**
+ * Constructor of a ConfigTree as a child of another (second arg)
+ * @param name String - element name of 'this'
+ * @param dad ConfigTree - whom 'this' will be hanging from
+ */
+	public ConfigTree(String name, ConfigTree dad)
+	{
+		setName(name);
+		setParent(dad);
+	} // _______________________________
+/**
+ * protected constructor
+ * @param other - Where to get values for deep copy
+ */
+	protected ConfigTree(ConfigTree other)
+	{
+		copyFrom(other);
+	} // _______________________________
+
+	/**
+	 * 
+	 * @return String - the name of this tree (element name for XML representation)
+	 */
+	public String getName() 			{ return _name; }
+	/**
+	 * assign a name to 'this'
+	 * @param name String - The name for this object
+	 */
+	public void   setName(String name) 	
+	{
+		if (null==name)
+			throw new IllegalArgumentException();
+		_name = name; 
+	} // _______________________________
+
+	/**
+	 * whose child is 'this' (null if root)
+	 * @return ConfigTree - the parent tree of 'this' 
+	 */
+	public ConfigTree getParent() 			{ return _dad; }
+	
+	private  void   setParent(ConfigTree dad)	
+	{ 
+		if (null!=_dad && null!=_dad._childs)
+				_dad._childs.remove(this);
+		if (null!=dad)
+			dad.addChild(this); 
+	} 	
+	/**
+	 * assign a value to a named attribute 
+	 * @param name String - the name (key) for the new attribute 
+	 * @param value String - the value assigned to the key (if null - old value will be deleted)
+	 * @return String - old value assigned to the name (null if there was none)
+	 */
+	public String setAttribute(String name,String value)
+	{
+		if (null==name)
+			throw new IllegalArgumentException("Attribute name must be non null");
+		if (null==_attributes)
+			_attributes = new HashMap<String,String>();
+		String oldVal = _attributes.remove(name);
+		if(null!=value)
+			_attributes.put(name,value);
+		return oldVal;
+	} // _______________________________
+	/**
+	 * 
+	 * @return int - the number of non null attributes that this node has been assigned
+	 */
+	public int attributeCount()
+	{
+		return (null==_attributes) ? 0 : _attributes.size();
+	} // _______________________________
+	/**
+	 * Retrieve the value assigned to an attribute key.
+	 * @param name String - the search key.
+	 * @return String - the value assigned to the specified key, or null if the
+	 * attribute is not defined.
+	 */
+	public String getAttribute(String name)
+	{
+		return (null==_attributes) ? null : _attributes.get(name);
+	} // _______________________________
+	/**
+	 * Retrieve the value assigned to an attribute key, returning the supplied default
+	 * if the attribute is not defined.
+	 * @param name String - the search key.
+	 * @param defaultValue String - the default value to return if attribute is not set.
+	 * @return String - the value assigned to the specified key, or the default if
+	 * the value is not defined.
+	 */
+	public String getAttribute(String name, String defaultValue)
+	{
+		String ret = (null==_attributes) ? null : _attributes.get(name);
+		return (ret !=null?ret:defaultValue);
+	} // _______________________________
+	
+	/**
+	 * Get the value of a requred property, throwing a {@link ConfigurationException}
+	 * if the property is not defined. 
+	 * @param name String - the search key.
+	 * @return The value assigned to the specified property.
+	 * @throws ConfigurationException The propery is not defined.
+	 */
+	public String getRequiredAttribute(String name) throws ConfigurationException {
+		String ret = getAttribute(name);
+		
+		if(ret == null) {
+			throw new ConfigurationException("Required configuration property '" + name + "' not defined on configuration '" + _name + "'.");
+		}
+		
+		return ret;
+	}
+	
+	/**
+	 * obtain the list of all attribute names
+	 * @return Set<String>  - the set of keys that have been assigned a non null value
+	 */
+	public Set<String>getAttributeNames() 
+	{ return (null==_attributes) 
+		? new HashSet<String>() 
+		: _attributes.keySet();
+	} // _______________________________
+	/**
+	 * obtain the list of all attribute as a List<KeyValuePair>
+	 * @return List<KeyValuePair> - containing all attributes
+	 */
+	public List<KeyValuePair> attributesAsList() 
+	{
+		List<KeyValuePair> oRet = new ArrayList<KeyValuePair>();
+		if (null!=_attributes) 
+			for (Map.Entry<String,String> oCurr : _attributes.entrySet())
+				oRet.add(new KeyValuePair(oCurr.getKey(),oCurr.getValue()));
+		return oRet;
+	} // _______________________________
+	/**
+	 * obtain the list of all child "property" elements as a List<KeyValuePair>
+	 * @return List<KeyValuePair> - containing all child elements with tag name "property"
+	 */
+	public List<KeyValuePair> childPropertyList() 
+	{
+		List<KeyValuePair> oRet = new ArrayList<KeyValuePair>();
+		for (ConfigTree current : getChildren("property"))
+		{
+			String name = current.getAttribute("name");
+			if (null!=name)
+				oRet.add(new KeyValuePair(name,current.getAttribute("value")));
+		}
+		return oRet;
+	} // _______________________________
+	/**
+	 * concatenated values of all child String values that have been added to 'this'
+	 * <br/>"" (zero length String) if no String child nodes
+	 * @return String - concatenation of all String segments (equivalent to xml text nodes)
+	 */
+	public String getWholeText() 
+	{
+		if (null==_childs)
+			return "";
+		StringBuilder sb = null;
+		for (Child child : _childs)
+		{	if (! (child._obj instanceof String))
+				continue;
+			if (null==sb)
+				sb = new StringBuilder((String)child._obj);
+			else
+				sb.append((String)child._obj);
+		}
+		return sb.toString();
+				
+	} // _______________________________
+/**
+ * <b>first</b> child containing only text, with name=arg0
+ * @param name String - the name to filter
+ * @return full text content of first 'pure text' child element under that name - &lt;null&gt; if none
+ */
+	public String getFirstTextChild(String name) 
+	{
+		if (null==name)
+			throw new IllegalArgumentException();
+		if (null!=_childs)
+			for (Child oCurr : _childs)
+			{
+				ConfigTree tree = oCurr.getTree();
+				if (null != tree && tree.isPureText() && name.equals(tree.getName()))
+					 return tree.getWholeText();
+			}
+		return null;
+	} // _______________________________
+
+	/**
+ * Obtain all String values with the same name
+ * @param name String - filter for child String nodes
+ * @return String[]
+ */
+	public String[] getTextChildren(String name) 
+	{
+		if (null==name)
+			throw new IllegalArgumentException();
+		if (null==_childs)
+			return new String[0];
+		List<String>oRet = new ArrayList<String>();
+		for (Child oCurr : _childs)
+		{
+			ConfigTree tree = oCurr.getTree();
+			if (null != tree && tree.isPureText() && name.equals(tree.getName()))
+				oRet.add(tree.getWholeText());
+		}
+		return oRet.toArray(new String[oRet.size()]);
+	} // _______________________________
+/**
+ * add a child element that consists only of the text in arg0
+ * @param value String - the text to assign to the added child node
+ */
+	public void addTextChild (String value) { new Child(value); }
+	
+	private void addChild(ConfigTree child)	
+		{ child._dad = this; new Child(child); }
+/**
+ * retrieve list of child elements of 'this' that are instances of ConfigTree
+ * @return ConfigTree[] - Array containing all child elements of class ConfigTree
+ */
+	public ConfigTree[] getAllChildren() 
+	{
+		if (null==_childs) 
+			return new ConfigTree[]{};
+		List<ConfigTree>oRet = new ArrayList<ConfigTree>();
+		for (Child oCurr : _childs)
+			if (null != oCurr.getTree())
+				oRet.add(oCurr.getTree());
+		return oRet.toArray(new ConfigTree[oRet.size()]);
+	} // _______________________________
+
+	/**
+	 * list of child elements of 'this' that are instances of ConfigTree, with name = arg0
+	 * @param name String - the name of child nodes to filter
+	 * @return ConfigTree[] - child elements of class ConfigTree with name provided
+	 */
+	public ConfigTree[] getChildren(String name) 
+	{
+		if (null==name)
+			throw new IllegalArgumentException();
+		if (null==_childs)
+			return new ConfigTree[0];
+		List<ConfigTree>oRet = new ArrayList<ConfigTree>();
+		for (Child oCurr : _childs)
+			if (name.equals(oCurr.getName()))
+					oRet.add(oCurr.getTree());
+		return oRet.toArray(new ConfigTree[oRet.size()]);
+	} // _______________________________
+/**
+ * <b>first</b> child of class ConfigTree with name=arg0
+ * @param name String - the name to filter
+ * @return first child element under that name - &lt;null&gt; if none
+ */
+	public ConfigTree getFirstChild(String name) 
+	{
+		if (null==name)
+			throw new IllegalArgumentException();
+		if (null!=_childs)
+			for (Child oCurr : _childs)
+				if (name.equals(oCurr.getName()))
+					return oCurr.getTree();
+		return null;
+	} // _______________________________
+/**
+ * purge the list of children
+ */
+	public void removeAllChildren() 
+	{
+		_childs = null;
+	} // _______________________________
+
+	/**
+	 * remove children by name
+	 * @param name String - only children by that name will be removed
+	 */
+	public void removeChildrenByName(String name) 
+	{
+		if (null==name)
+			throw new IllegalArgumentException();
+		if (null!=_childs)
+			for (ListIterator<Child> II=_childs.listIterator(); II.hasNext();)
+				if (name.equals(II.next().getName()))
+					II.remove();
+	} // __________________________________
+
+	/**
+	 * 
+	 * @return the number of child nodes (of any type)
+	 */
+	public int childCount()
+	{
+		return (null==_childs) ? 0 : _childs.size();
+	} // __________________________________
+
+	@Override
+	public Object clone() { return cloneObj(); }
+
+	/**
+	 * instantiate a new ConfigTree with the same topology and contents of 'this'
+	 * <br/>Contained ConfigTree child elements will also be cloned
+	 * <br/>Transient objects are NOT copied nor cloned
+	 * @return ConfigTree - Deep copy of 'this'
+	 */
+	public ConfigTree cloneObj() {return cloneSubtree(null); } 
+
+	/**
+	 * @return ConfigTree - Deep copy of 'this'
+	 */
+	private ConfigTree cloneSubtree(ConfigTree dad)
+	{
+		ConfigTree oRet = new ConfigTree(_name, dad);
+		if (null!=_attributes)
+			for (Map.Entry<String,String> oAtt: _attributes.entrySet())
+				oRet.setAttribute(oAtt.getKey(),oAtt.getValue());
+		if (null!= _childs)
+			for (Child oChild : _childs)
+			{	
+				ConfigTree tree = oChild.getTree();
+				if (null!=tree)
+					tree.cloneSubtree(oRet);
+				else
+					oRet.addTextChild(oChild._obj.toString());
+			}
+		return oRet;
+	} // __________________________________
+	/**
+	 * Deep copy of other tree
+	 * @param other - from where to copy values
+	 */
+	protected void copyFrom(ConfigTree other)
+	{
+		this.setName(other.getName());
+		this._pureText	= other._pureText;
+
+		if (null != other._attributes)
+			for (Map.Entry<String,String> oneAtt : other._attributes.entrySet())
+				setAttribute(oneAtt.getKey(),oneAtt.getValue());
+		if (null != other._childs)
+			for (Child child : other._childs)
+				new Child(child);
+			
+	} // __________________________________
+/**
+ * obtain an instance of this class, from a 'normalized' xml format, with the default encoding
+ * <p/> the 'normalized' xml format is the output of the toXml() instance method
+ * @param xml String - what to parse
+ * @return ConfigTree - an object of this class
+ * @throws SAXException - if xml format is invalid
+ */
+	public static ConfigTree fromXml(String xml) throws SAXException
+	{
+		try { return fromXml(xml,java.nio.charset.Charset.defaultCharset().toString()); }
+		catch (UnsupportedEncodingException e)
+		{
+			//  This can't happen
+			_logger.fatal("Received unexpected exception: ",e);
+			return null;
+		}
+	} // __________________________________
+	
+	/**
+	 * obtain an instance of this class, from a 'normalized' xml format, with the encoding defined in arg1
+	 * <p/> the 'normalized' xml format is the output of the toXml() instance method
+	 * @param xml String - what to parse
+	 * @param encoding String - The encoding of arg 0
+	 * @return ConfigTree - an object of this class
+	 * @throws SAXException - if xml format is invalid
+	 */
+	public static ConfigTree fromXml(String xml, String encoding)
+		throws UnsupportedEncodingException, SAXException
+	{
+		if (null==xml)
+			throw new IllegalArgumentException("Xml source String is null");
+		try { return fromInputStream(new ByteArrayInputStream(xml.getBytes(encoding))); }
+		catch (IOException e)
+		{
+			_logger.fatal("Received unexpected IOException: ",e);
+			return null;
+		}
+	} // __________________________________
+
+	/**
+	 * obtain an instance of this class, from a 'normalized' xml format contained in an input stream
+	 * <p/> the 'normalized' xml format is the output of the toXml() instance method
+	 * @param input InputStream - where to parse from
+	 * @return ConfigTree - an object of this class
+	 * @throws SAXException - if xml format is invalid
+	 * @throws IOException - if an input/output error occurs
+	 */
+	public static ConfigTree fromInputStream(InputStream input) 
+		throws SAXException, IOException
+	{
+		if (null==input)
+			throw new IllegalArgumentException();
+		DocumentBuilder builder = null;
+		try { builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); }
+		catch (ParserConfigurationException e2)
+		{	_logger.error("Problems with default Parser Configuration",e2);
+			return null;
+		}
+		Document oDoc = builder.parse(input);
+		oDoc.normalize();
+		
+		return fromElement(oDoc.getDocumentElement());
+		
+	} // __________________________________
+
+	public static ConfigTree fromElement(Element elem)
+	{
+		ConfigTree tree = new ConfigTree(elem.getNodeName());
+		NamedNodeMap NM = elem.getAttributes();
+		if (null!=NM)
+			for (int i1=0; i1<NM.getLength(); i1++)
+			{
+				Node node = NM.item(i1);
+				tree.setAttribute(node.getNodeName(),node.getNodeValue());
+			}
+		NodeList NL = elem.getChildNodes();
+		if (null!=NL)
+			for (int i1=0; i1<NL.getLength(); i1++)
+			{
+				Node node = NL.item(i1);
+				switch (node.getNodeType())
+				{	
+					case Node.ELEMENT_NODE:
+						tree.addChild(ConfigTree.fromElement((Element)node));
+						break;
+					case Node.TEXT_NODE:
+						tree.addTextChild(node.getNodeValue());
+						break;
+				}
+			}
+		
+		return tree;
+	} // __________________________________
+
+	private Element toElement(Document doc)
+	{
+		Element elem = doc.createElement(_name);
+		if (null!=_attributes)
+			for (Map.Entry<String,String> oAtt : _attributes.entrySet())
+				elem.setAttribute(oAtt.getKey(),oAtt.getValue());
+		if (null!=_childs)
+			for (Child child : _childs)
+			{
+				ConfigTree tree = child.getTree();
+				if (null!=tree)
+					elem.appendChild(tree.toElement(doc));
+				else
+					elem.appendChild(doc.createTextNode(child._obj.toString()));
+			}
+		return elem;
+	} // __________________________________
+	/**
+	 * Equivalent to a call to toXml()
+	 * @return String - a String with the 'standard' xml representation of 'this',
+	 * using the default encoding
+	 */
+	public String toString() { return toXml(); }
+	/**
+	 * Equivalent to a call to toXml(encoding)
+	 * @param encoding String - 
+	 * @return String - a String with the 'standard' xml representation of 'this',
+	 * using the encoding specified in arg 0
+	 */
+
+	public String toString(String encoding) { return toXml(encoding); }
+	/**
+	 * @return String - a String with the 'standard' xml representation of 'this',
+	 * using the default encoding
+	 */
+	public String toXml()
+	{
+		return toXml(java.nio.charset.Charset.defaultCharset().toString());
+	} // __________________________________
+	
+	/**
+	 * Serialize this object - Transient objects are
+	 * @param encoding String - String 
+	 * @return String - a String with the 'standard' xml representation of 'this',
+	 * using encoding specified in arg0
+	 */
+	public String toXml(String encoding)
+	{
+		Transformer transf = null;
+		try { transf = TransformerFactory.newInstance().newTransformer(); }
+		catch (TransformerConfigurationException e1)
+		{	_logger.error("Cannot obtain transformer to render XML output",e1);
+			return null;
+		}
+		transf.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,"yes");
+		transf.setOutputProperty(OutputKeys.INDENT, "no");
+		transf.setOutputProperty(OutputKeys.ENCODING, encoding);
+
+		DocumentBuilder builder = null;
+		try { builder = DocumentBuilderFactory.newInstance().newDocumentBuilder(); }
+		catch (ParserConfigurationException e2)
+		{	_logger.error("Problems with default Parser Configuration",e2);
+			return null;
+		}
+		Document oDoc = builder.newDocument();
+		oDoc.appendChild(toElement(oDoc));
+		oDoc.normalize();
+		DOMSource src = new DOMSource(oDoc);
+
+		ByteArrayOutputStream oStrm = new ByteArrayOutputStream(5000);
+		StreamResult res = new StreamResult(oStrm);
+
+		try { transf.transform(src, res); }
+		catch (TransformerException e3)
+		{	_logger.error("Problems with XML transformation",e3);
+			return null;
+		}
+
+		return oStrm.toString();
+	} // __________________________________
+	
+	/**
+	 * 
+	 * @return boolean - indicating if 'this' element has ONLY text children (and consequently no ConfigTree children)
+	 */
+	public boolean isPureText() { return _pureText; }
+
+	private class Child
+	{
+		Object _obj;
+		ConfigTree getTree() 
+		{	return (_obj instanceof ConfigTree)? (ConfigTree) _obj : null;
+		}
+		String getName() 
+		{	return (_obj instanceof ConfigTree)? ((ConfigTree) _obj)._name : null;
+		}
+		private Child(ConfigTree obj)	{addToDad(obj); _pureText = false;}
+		private Child(String obj)		{addToDad(obj); }
+		private Child(Child other)		
+		{	
+			if (other._obj instanceof ConfigTree)
+			{
+				addToDad(((ConfigTree)other._obj).cloneObj());
+				_pureText	= false;
+				return;
+			}
+			if (other._obj instanceof String)
+			{
+				addToDad((String)other._obj);
+				return;
+			}
+
+		}
+		private void addToDad(Object obj)
+		{	if (null==_childs)
+				_childs = new ArrayList<Child>();
+			_obj	= obj;
+			_childs.add(this);
+		}
+		
+	}
+
+	private boolean				_pureText=true;
+	private ConfigTree 			_dad;
+	private String 				_name;
+	private Map<String,String> 	_attributes;
+	private List<Child>			_childs;
+
+	private static transient Logger			_logger = Logger.getLogger(ConfigTree.class);
+} //____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/Email.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/Email.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/Email.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,437 +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.helpers;
-
-import java.util.Properties;
-import java.util.StringTokenizer;
-
-import javax.activation.DataHandler;
-import javax.activation.FileDataSource;
-import javax.mail.Address;
-import javax.mail.Authenticator;
-import javax.mail.BodyPart;
-import javax.mail.MessagingException;
-import javax.mail.Multipart;
-import javax.mail.PasswordAuthentication;
-import javax.mail.Session;
-import javax.mail.Transport;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.common.Configuration;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.util.Util;
-
-/**
- * Simplifies sending of e-mails with attachments from java.
- * <p/>
- * The message is sent via a subsequent call to the {@link #sendMessage()}
- * method.
- * 
- * <h3 id="p_oMessageParms">Message Parmeters</h3>
- * The class constructor is supplied the following parameters via a
- * {@link org.jboss.soa.esb.helpers.ConfigTree} instance:
- * <ol>
- * 	<li><b>FROM</b>: valid e-mail address</li>
- * 	<li><b>SENDTO</b>: valid comma separated list of e-mail addresses</li>
- * 	<li><b>SUBJECT</b>: free text that will appear as subject of the e-mail</li>
- * 	<li><b>MESSAGE</b>: free text that will appear as contents of the e-mail</li>
- * 	<li><b>ATTACH</b>: list (as Text children) of valid accessible filenames to
- * 			attach to the e-mail</li>
- * </ol>
- * All parameters except 'ATTACH' are attributes of the ConfigTree argument. ATTACH
- * parameters (attachments) are added as child ConfigTrees of the  supplied
- * ConfigTree.
- * 
- * @author Heuristica - Buenos Aires - Argentina
- */
-public class Email {
-	
-	/**
-	 * Class logger.
-	 */
-	private static Logger logger = Logger.getLogger(Email.class);
-	/**
-	 * ConfigTree attribute : will be the contents of the From: field in the
-	 * outgoing message
-	 */
-	public static final String FROM = "from";
-
-	/**
-	 * ConfigTree attribute : comma separated list of recipients
-	 */
-	public static final String SENDTO = "sendTo";
-
-	/**
-	 * ConfigTree attribute : comma separated list of Copy recipients
-	 */
-	public static final String COPYTO = "ccTo";
-
-	/**
-	 * ConfigTree attribute : will be the contents of the Subject: field in the
-	 * outgoing message
-	 */
-	public static final String SUBJECT = "subject";
-
-	/**
-	 * ConfigTree attribute : Value of this attribute will be the content of the
-	 * e-mail's text
-	 */
-	public static final String ATTACH = "attachment";
-
-	/**
-	 * ConfigTree child Text elements : Each child represents the name of a file
-	 * to be attached in the outgoing message
-	 */
-	public static final String MESSAGE = "message";
-    
-    /**
-     * will be the contents of the From: field in the outgoing message
-     */
-    private String from = null;
-
-    /**
-     * comma separated list of recipients
-     */
-    private String sendTo = null;
-
-    /**
-     * comma separated list of copy recipients
-     */
-    private String copyTo = null;
-
-    /**
-     * This attribute will be the content of the subject of the mail message
-     */
-    private String subject = null;
-
-    /**
-     * Comma separated list of attachment file names
-     */
-    private String[] attachments = null;
-    
-    /**
-     * Value of this attribute will be the content of the e-mail's text
-     */
-    private String message = null;    
-
-	/**
-	 * The message to b sent via a subsequent call to {@link #sendMessage()}.
-	 */
-	private MimeMessage mailMessage;
-    
-    /**
-     * The mail Session to use
-     */
-    private Session oMailSess = null;
-
-	/**
-	 * Public constructor.
-	 * <p/>
-	 * Initialises the mail server session and creates the mail message using 
-	 * the information provided in the p_oMessageParms 
-	 * <a href="p_oMessageParms">listed above</a>.
-	 * <p/>
-	 * The message is sent via a subsequent call to the {@link #sendMessage()}
-	 * method.
-	 * 
-	 * @throws MessagingException 
-	 * @throws AddressException 
-	 * @see ConfigTree
-	 * 
-	 */
-	public Email() throws AddressException, MessagingException {
-		// REVIEW: How about typing the parameters a little better??? Looks as though that might have a huge ripple-on effect accross the codebase!!
-		// REVIEW: Does the session need to ne initialised every time???
-		this.oMailSess = initMailServerSession();
-		
-		// Message can be "sent" via a subsequent call to the sendMessage method!
-	} // __________________________________
-
-	/**
-	 * Send the mail message associated with this instance.
-	 * @throws MessagingException Unable to transport the message associated with this
-	 * Email instance.
-	 */
-	public void sendMessage() throws MessagingException {
-		Transport.send(this.getMailMessage());
-	}
-	
-	/**
-	 * Get the {@link MimeMessage mail message} associated with this EsbMail
-	 * instance.
-	 * @return The mailMessage property value.
-	 */
-	public MimeMessage getMailMessage() throws MessagingException {
-        if (this.mailMessage == null){
-            this.mailMessage = this.createMailMessage(this.oMailSess);
-        }
-		return mailMessage;
-	}    
-
-	/**
-     * @return Returns the attachments.
-     */
-    public String[] getAttachments() {
-        return this.attachments;
-    }
-
-    /**
-     * @param attachments The attachments to set.
-     */
-    public void setAttachments(String[] attachments) {
-        this.attachments = attachments;
-    }
-
-    /**
-     * @return Returns the copyTo.
-     */
-    public String getCopyTo() {
-        return this.copyTo;
-    }
-
-    /**
-     * @param copyTo The copyTo to set.
-     */
-    public void setCopyTo(String copyTo) {
-        this.copyTo = copyTo;
-    }
-
-    /**
-     * @return Returns the from.
-     */
-    public String getFrom() {
-        return this.from;
-    }
-
-    /**
-     * @param from The from to set.
-     */
-    public void setFrom(String from) {
-        this.from = from;
-    }
-
-    /**
-     * @return Returns the sendTo.
-     */
-    public String getSendTo() {
-        return this.sendTo;
-    }
-
-    /**
-     * @param sendTo The sendTo to set.
-     */
-    public void setSendTo(String sendTo) {
-        this.sendTo = sendTo;
-    }
-
-    /**
-     * @return Returns the subject.
-     */
-    public String getSubject() {
-        return this.subject;
-    }
-
-    /**
-     * @param subject The subject to set.
-     */
-    public void setSubject(String subject) {
-        this.subject = subject;
-    }
-
-    /**
-     * @return Returns the message.
-     */
-    public String getMessage() {
-        return this.message;
-    }
-
-    /**
-     * @param message The message to set.
-     */
-    public void setMessage(String message) {
-        this.message = message;
-    } 
-
-    /**
-	 * Create the mail message instance to be {@link #sendMessage() sent}.
-	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
-	 * @param oMailSess Mail session on which the message is to be transported.
-	 * @return The message.
-	 * @throws AddressException
-	 * @throws MessagingException
-	 */
-	private MimeMessage createMailMessage(Session oMailSess) throws AddressException, MessagingException {
-		MimeMessage oMessage = new MimeMessage(oMailSess);
-		
-		// Populate the message with the data supplied in the p_oMessageParms ConfigTree.
-		addMessageAddressing(oMessage);
-		addMessageSubject( oMessage);
-		addMessageContent(oMessage);
-		
-		return oMessage;
-	}
-
-	/**
-	 * Add the message addressing information to the message.
-	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
-	 * @param oMessage The message.
-	 * @throws AddressException
-	 * @throws MessagingException
-	 */
-	private void addMessageAddressing(MimeMessage oMessage) throws AddressException, MessagingException {		
-		InternetAddress oFrom = new InternetAddress(this.from);
-	
-		oMessage.setFrom(oFrom);
-		oMessage.setReplyTo(new Address[] { oFrom });
-		InternetAddress[] oaTo = 
-			InternetAddress.parse(this.sendTo);
-		
-		for (int i1 = 0; i1 < oaTo.length; i1++) {
-			oMessage.addRecipient(MimeMessage.RecipientType.TO, oaTo[i1]);
-		}
-			
-		if (null != this.copyTo) {
-			oaTo = InternetAddress.parse(this.copyTo);
-			for (int i1 = 0; i1 < oaTo.length; i1++) {
-				oMessage.addRecipient(MimeMessage.RecipientType.CC, oaTo[i1]);
-			}
-		}
-	}
-
-	/**
-	 * Add the message Subject to the message.
-	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
-	 * @param oMessage The message.
-	 * @throws MessagingException
-	 */
-	private void addMessageSubject(MimeMessage oMessage) throws MessagingException {		
-		if (null != this.subject) {
-			oMessage.setSubject(this.subject);
-		}
-	}
-
-	/**
-	 * Add the message content (body, attachments etc) to from the
-	 * message parameters to the message.
-	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
-	 * @param oMessage The message.
-	 * @throws MessagingException
-	 */
-	private void addMessageContent(MimeMessage oMessage) throws MessagingException {
-		BodyPart oBodyP = new MimeBodyPart();
-		Multipart oMultiP = new MimeMultipart();
-
-		oMultiP.addBodyPart(oBodyP);
-		oMessage.setContent(oMultiP);
-		if (null == this.message) {
-            this.message = "";
-		}
-		oBodyP.setText(this.message + "\n");
-
-        
-        if (null != attachments) {
-			for (int i1 = 0; i1 < this.attachments.length; i1++) {
-	            oMultiP.addBodyPart(oBodyP = new MimeBodyPart());
-	            String sFile = this.attachments[i1];
-	            oBodyP.setDataHandler(new DataHandler(new FileDataSource(sFile)));
-	            oBodyP.setFileName(sFile.substring(1 + sFile.lastIndexOf("\\")));
-	        }
-        }
-	}
-
-	/**
-	 * Initialise an authenticated {@link javax.mail.Session} with the mail server.
-	 * @return The {@link javax.mail.Session}. 
-	 */
-	private Session initMailServerSession() {
-		Authenticator oAuth = null;
-		String sSmtpUser = Configuration.getSmtpUsername();
-		
-		if (! Util.isNullString(sSmtpUser)) {
-			oAuth = new MyAuth(sSmtpUser, Configuration.getSmtpPassword());			
-		}
-
-		Properties oMailP = new Properties();
-		oMailP.setProperty("mail.smtp.host", Configuration.getSmtpHost());
-		String sAuth = Configuration.getSmtpAuth();
-		if(sAuth != null) {
-			if(!sAuth.trim().equals("")) {
-				logger.warn("'" + Environment.SMTP_AUTH + "' set to an empty value.");
-			}
-			oMailP.setProperty("mail.smtp.auth", sAuth);
-		}
-		
-		try {
-			String sPort = Configuration.getSmtpPort();			
-			this.from = Configuration.getSmtpFrom();
-			Integer.parseInt(sPort);
-			oMailP.setProperty("mail.smtp.port", sPort);						
-		} 
-		catch (Exception e) { /* OK just leave standard port */ }
-
-		logger.info("Initialising mail server sesson. Properties: " + oMailP);
-		javax.mail.Session oMailSess = javax.mail.Session.getDefaultInstance(oMailP, oAuth);
-		
-		return oMailSess;
-	}
-    
-    /**  
-     * Method parsing filename from a string containing a comma separated list of filenames
-     * @param attachments the string containing the comma separated list of filenames
-     * @return a String array containing an entry for every filename in the given comma separated list
-     */
-    @SuppressWarnings("unused")
-	private String[] getFileNamesAsArray(String attachments) {
-        if (attachments.indexOf(',') != -1){
-            StringTokenizer st = new StringTokenizer(attachments,",");
-            String[] attachmentFileNames = new String[st.countTokens()];
-            int index = 0;
-            while (st.hasMoreTokens()) {
-                attachmentFileNames[index] = st.nextToken();
-                index++;
-            }
-            return attachmentFileNames;
-        }
-        return new String[]{attachments};
-    }
-
-	private class MyAuth extends Authenticator {
-		private String m_sUser, m_sPwd;
-
-		private MyAuth(String p_sU, String p_sP) {
-			m_sUser = p_sU;
-			m_sPwd = p_sP;
-		}
-
-		protected PasswordAuthentication getPasswordAuthentication() {
-			return new PasswordAuthentication(m_sUser, m_sPwd);
-		} // ________________________________
-	} // ______________________________________________________
-
-} // ____________________________________________________________________________
-

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/Email.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/Email.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/Email.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/Email.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,437 @@
+/*
+ * 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.helpers;
+
+import java.util.Properties;
+import java.util.StringTokenizer;
+
+import javax.activation.DataHandler;
+import javax.activation.FileDataSource;
+import javax.mail.Address;
+import javax.mail.Authenticator;
+import javax.mail.BodyPart;
+import javax.mail.MessagingException;
+import javax.mail.Multipart;
+import javax.mail.PasswordAuthentication;
+import javax.mail.Session;
+import javax.mail.Transport;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * Simplifies sending of e-mails with attachments from java.
+ * <p/>
+ * The message is sent via a subsequent call to the {@link #sendMessage()}
+ * method.
+ * 
+ * <h3 id="p_oMessageParms">Message Parmeters</h3>
+ * The class constructor is supplied the following parameters via a
+ * {@link org.jboss.soa.esb.helpers.ConfigTree} instance:
+ * <ol>
+ * 	<li><b>FROM</b>: valid e-mail address</li>
+ * 	<li><b>SENDTO</b>: valid comma separated list of e-mail addresses</li>
+ * 	<li><b>SUBJECT</b>: free text that will appear as subject of the e-mail</li>
+ * 	<li><b>MESSAGE</b>: free text that will appear as contents of the e-mail</li>
+ * 	<li><b>ATTACH</b>: list (as Text children) of valid accessible filenames to
+ * 			attach to the e-mail</li>
+ * </ol>
+ * All parameters except 'ATTACH' are attributes of the ConfigTree argument. ATTACH
+ * parameters (attachments) are added as child ConfigTrees of the  supplied
+ * ConfigTree.
+ * 
+ * @author Heuristica - Buenos Aires - Argentina
+ */
+public class Email {
+	
+	/**
+	 * Class logger.
+	 */
+	private static Logger logger = Logger.getLogger(Email.class);
+	/**
+	 * ConfigTree attribute : will be the contents of the From: field in the
+	 * outgoing message
+	 */
+	public static final String FROM = "from";
+
+	/**
+	 * ConfigTree attribute : comma separated list of recipients
+	 */
+	public static final String SENDTO = "sendTo";
+
+	/**
+	 * ConfigTree attribute : comma separated list of Copy recipients
+	 */
+	public static final String COPYTO = "ccTo";
+
+	/**
+	 * ConfigTree attribute : will be the contents of the Subject: field in the
+	 * outgoing message
+	 */
+	public static final String SUBJECT = "subject";
+
+	/**
+	 * ConfigTree attribute : Value of this attribute will be the content of the
+	 * e-mail's text
+	 */
+	public static final String ATTACH = "attachment";
+
+	/**
+	 * ConfigTree child Text elements : Each child represents the name of a file
+	 * to be attached in the outgoing message
+	 */
+	public static final String MESSAGE = "message";
+    
+    /**
+     * will be the contents of the From: field in the outgoing message
+     */
+    private String from = null;
+
+    /**
+     * comma separated list of recipients
+     */
+    private String sendTo = null;
+
+    /**
+     * comma separated list of copy recipients
+     */
+    private String copyTo = null;
+
+    /**
+     * This attribute will be the content of the subject of the mail message
+     */
+    private String subject = null;
+
+    /**
+     * Comma separated list of attachment file names
+     */
+    private String[] attachments = null;
+    
+    /**
+     * Value of this attribute will be the content of the e-mail's text
+     */
+    private String message = null;    
+
+	/**
+	 * The message to b sent via a subsequent call to {@link #sendMessage()}.
+	 */
+	private MimeMessage mailMessage;
+    
+    /**
+     * The mail Session to use
+     */
+    private Session oMailSess = null;
+
+	/**
+	 * Public constructor.
+	 * <p/>
+	 * Initialises the mail server session and creates the mail message using 
+	 * the information provided in the p_oMessageParms 
+	 * <a href="p_oMessageParms">listed above</a>.
+	 * <p/>
+	 * The message is sent via a subsequent call to the {@link #sendMessage()}
+	 * method.
+	 * 
+	 * @throws MessagingException 
+	 * @throws AddressException 
+	 * @see ConfigTree
+	 * 
+	 */
+	public Email() throws AddressException, MessagingException {
+		// REVIEW: How about typing the parameters a little better??? Looks as though that might have a huge ripple-on effect accross the codebase!!
+		// REVIEW: Does the session need to ne initialised every time???
+		this.oMailSess = initMailServerSession();
+		
+		// Message can be "sent" via a subsequent call to the sendMessage method!
+	} // __________________________________
+
+	/**
+	 * Send the mail message associated with this instance.
+	 * @throws MessagingException Unable to transport the message associated with this
+	 * Email instance.
+	 */
+	public void sendMessage() throws MessagingException {
+		Transport.send(this.getMailMessage());
+	}
+	
+	/**
+	 * Get the {@link MimeMessage mail message} associated with this EsbMail
+	 * instance.
+	 * @return The mailMessage property value.
+	 */
+	public MimeMessage getMailMessage() throws MessagingException {
+        if (this.mailMessage == null){
+            this.mailMessage = this.createMailMessage(this.oMailSess);
+        }
+		return mailMessage;
+	}    
+
+	/**
+     * @return Returns the attachments.
+     */
+    public String[] getAttachments() {
+        return this.attachments;
+    }
+
+    /**
+     * @param attachments The attachments to set.
+     */
+    public void setAttachments(String[] attachments) {
+        this.attachments = attachments;
+    }
+
+    /**
+     * @return Returns the copyTo.
+     */
+    public String getCopyTo() {
+        return this.copyTo;
+    }
+
+    /**
+     * @param copyTo The copyTo to set.
+     */
+    public void setCopyTo(String copyTo) {
+        this.copyTo = copyTo;
+    }
+
+    /**
+     * @return Returns the from.
+     */
+    public String getFrom() {
+        return this.from;
+    }
+
+    /**
+     * @param from The from to set.
+     */
+    public void setFrom(String from) {
+        this.from = from;
+    }
+
+    /**
+     * @return Returns the sendTo.
+     */
+    public String getSendTo() {
+        return this.sendTo;
+    }
+
+    /**
+     * @param sendTo The sendTo to set.
+     */
+    public void setSendTo(String sendTo) {
+        this.sendTo = sendTo;
+    }
+
+    /**
+     * @return Returns the subject.
+     */
+    public String getSubject() {
+        return this.subject;
+    }
+
+    /**
+     * @param subject The subject to set.
+     */
+    public void setSubject(String subject) {
+        this.subject = subject;
+    }
+
+    /**
+     * @return Returns the message.
+     */
+    public String getMessage() {
+        return this.message;
+    }
+
+    /**
+     * @param message The message to set.
+     */
+    public void setMessage(String message) {
+        this.message = message;
+    } 
+
+    /**
+	 * Create the mail message instance to be {@link #sendMessage() sent}.
+	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
+	 * @param oMailSess Mail session on which the message is to be transported.
+	 * @return The message.
+	 * @throws AddressException
+	 * @throws MessagingException
+	 */
+	private MimeMessage createMailMessage(Session oMailSess) throws AddressException, MessagingException {
+		MimeMessage oMessage = new MimeMessage(oMailSess);
+		
+		// Populate the message with the data supplied in the p_oMessageParms ConfigTree.
+		addMessageAddressing(oMessage);
+		addMessageSubject( oMessage);
+		addMessageContent(oMessage);
+		
+		return oMessage;
+	}
+
+	/**
+	 * Add the message addressing information to the message.
+	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
+	 * @param oMessage The message.
+	 * @throws AddressException
+	 * @throws MessagingException
+	 */
+	private void addMessageAddressing(MimeMessage oMessage) throws AddressException, MessagingException {		
+		InternetAddress oFrom = new InternetAddress(this.from);
+	
+		oMessage.setFrom(oFrom);
+		oMessage.setReplyTo(new Address[] { oFrom });
+		InternetAddress[] oaTo = 
+			InternetAddress.parse(this.sendTo);
+		
+		for (int i1 = 0; i1 < oaTo.length; i1++) {
+			oMessage.addRecipient(MimeMessage.RecipientType.TO, oaTo[i1]);
+		}
+			
+		if (null != this.copyTo) {
+			oaTo = InternetAddress.parse(this.copyTo);
+			for (int i1 = 0; i1 < oaTo.length; i1++) {
+				oMessage.addRecipient(MimeMessage.RecipientType.CC, oaTo[i1]);
+			}
+		}
+	}
+
+	/**
+	 * Add the message Subject to the message.
+	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
+	 * @param oMessage The message.
+	 * @throws MessagingException
+	 */
+	private void addMessageSubject(MimeMessage oMessage) throws MessagingException {		
+		if (null != this.subject) {
+			oMessage.setSubject(this.subject);
+		}
+	}
+
+	/**
+	 * Add the message content (body, attachments etc) to from the
+	 * message parameters to the message.
+	 * @param p_oMessageParms <a href="p_oMessageParms">Message parameters.</a>.
+	 * @param oMessage The message.
+	 * @throws MessagingException
+	 */
+	private void addMessageContent(MimeMessage oMessage) throws MessagingException {
+		BodyPart oBodyP = new MimeBodyPart();
+		Multipart oMultiP = new MimeMultipart();
+
+		oMultiP.addBodyPart(oBodyP);
+		oMessage.setContent(oMultiP);
+		if (null == this.message) {
+            this.message = "";
+		}
+		oBodyP.setText(this.message + "\n");
+
+        
+        if (null != attachments) {
+			for (int i1 = 0; i1 < this.attachments.length; i1++) {
+	            oMultiP.addBodyPart(oBodyP = new MimeBodyPart());
+	            String sFile = this.attachments[i1];
+	            oBodyP.setDataHandler(new DataHandler(new FileDataSource(sFile)));
+	            oBodyP.setFileName(sFile.substring(1 + sFile.lastIndexOf("\\")));
+	        }
+        }
+	}
+
+	/**
+	 * Initialise an authenticated {@link javax.mail.Session} with the mail server.
+	 * @return The {@link javax.mail.Session}. 
+	 */
+	private Session initMailServerSession() {
+		Authenticator oAuth = null;
+		String sSmtpUser = Configuration.getSmtpUsername();
+		
+		if (! Util.isNullString(sSmtpUser)) {
+			oAuth = new MyAuth(sSmtpUser, Configuration.getSmtpPassword());			
+		}
+
+		Properties oMailP = new Properties();
+		oMailP.setProperty("mail.smtp.host", Configuration.getSmtpHost());
+		String sAuth = Configuration.getSmtpAuth();
+		if(sAuth != null) {
+			if(!sAuth.trim().equals("")) {
+				logger.warn("'" + Environment.SMTP_AUTH + "' set to an empty value.");
+			}
+			oMailP.setProperty("mail.smtp.auth", sAuth);
+		}
+		
+		try {
+			String sPort = Configuration.getSmtpPort();			
+			this.from = Configuration.getSmtpFrom();
+			Integer.parseInt(sPort);
+			oMailP.setProperty("mail.smtp.port", sPort);						
+		} 
+		catch (Exception e) { /* OK just leave standard port */ }
+
+		logger.info("Initialising mail server sesson. Properties: " + oMailP);
+		javax.mail.Session oMailSess = javax.mail.Session.getDefaultInstance(oMailP, oAuth);
+		
+		return oMailSess;
+	}
+    
+    /**  
+     * Method parsing filename from a string containing a comma separated list of filenames
+     * @param attachments the string containing the comma separated list of filenames
+     * @return a String array containing an entry for every filename in the given comma separated list
+     */
+    @SuppressWarnings("unused")
+	private String[] getFileNamesAsArray(String attachments) {
+        if (attachments.indexOf(',') != -1){
+            StringTokenizer st = new StringTokenizer(attachments,",");
+            String[] attachmentFileNames = new String[st.countTokens()];
+            int index = 0;
+            while (st.hasMoreTokens()) {
+                attachmentFileNames[index] = st.nextToken();
+                index++;
+            }
+            return attachmentFileNames;
+        }
+        return new String[]{attachments};
+    }
+
+	private class MyAuth extends Authenticator {
+		private String m_sUser, m_sPwd;
+
+		private MyAuth(String p_sU, String p_sP) {
+			m_sUser = p_sU;
+			m_sPwd = p_sP;
+		}
+
+		protected PasswordAuthentication getPasswordAuthentication() {
+			return new PasswordAuthentication(m_sUser, m_sPwd);
+		} // ________________________________
+	} // ______________________________________________________
+
+} // ____________________________________________________________________________
+

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/KeyValuePair.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/KeyValuePair.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/KeyValuePair.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,163 +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.helpers;
-
-import java.io.Serializable;
-import java.util.List;
-
-public class KeyValuePair implements Serializable {
-	private static final long serialVersionUID = 1L;
-
-	private String mKey, mVal;
-
-	public KeyValuePair(String pKey, String pVal) {
-		if(pKey == null || pKey.trim().equals("")) {
-			throw new IllegalArgumentException("null or empty 'pKey' arg in call.");
-		}
-		
-		mKey = pKey;
-		mVal = pVal;
-	}
-
-	public String getKey() {
-		return mKey;
-	}
-
-	public String getValue() {
-		return mVal;
-	}
-
-	public String toString() {
-		return mVal;
-	}
-
-	public String dump() {
-		return "KVpair[" + mKey + "=" + mVal + "]";
-	}
-    
-    /**
-     * Get the value associated with the specified key from the supplied list of Key Value Pairs.
-     * <p/>
-     * Returns the value from the first matching key.
-     * @param key The key to search for.
-     * @param list The list of KeyValuePairs to search.
-     * @return The value associated with the supplied key, or null if key not found.
-     */
-    public static String getValue(String key, List<KeyValuePair> list) {
-        if(key == null) {
-            throw new IllegalArgumentException("null 'key' arg in call.");
-        }
-        if(list == null) {
-            throw new IllegalArgumentException("null 'list' arg in call.");
-        }
-        
-        for(KeyValuePair kvp : list) {
-            if(kvp.mKey.equals(key)) {
-                return kvp.mVal;
-            }
-        }
-        
-        return null;
-    }
-    
-    /**
-     * Get the value associated with the specified key from the supplied list of Key Value Pairs.
-     * <p/>
-     * Returns the value from the first matching key.
-     * @param key The key to search for.
-     * @param list The list of KeyValuePairs to search.
-     * @param defaultVal The default value to be returned where there's no value available for the specified key. 
-     * @return The value associated with the supplied key, or null if key not found.
-     */
-    public static String getValue(String key, List<KeyValuePair> list, String defaultVal) {
-        String value = getValue(key, list);
-        
-        if(value == null) {
-            return defaultVal;
-        }
-        
-        return value;
-    }
-    
-    /**
-     * Get the boolean equivalent value associated with the specified key 
-     * from the supplied list of Key Value Pairs.
-     * <p/>
-     * Returns:
-     * <ul>
-     *  <li><b><code>true</code></b>: If value equals "true" or "yes" or "y" (ignoring case).</li>
-     *  <li><b><code>false</code></b>: If value equals "false" or "no" or "n" (ignoring case).</li>
-     *  <li><b><i>defaultVal</i></b>: If none of the above hold true.</li>
-     * </ul>
-     * <p/>
-     * Returns the value from the first matching key.
-     * @param key The key to search for.
-     * @param list The list of KeyValuePairs to search.
-     * @param defaultVal The default value to be returned where the above listed conditions do not hold
-     * for the associated value, or the value is not specified.
-     * @return The boolean equivalent value associated with the specified key according to the above specified
-     * rules, otherwise the <b><i>defaultVal</i></b> is returned.
-     */
-    public static boolean getBooleanValue(String key, List<KeyValuePair> list, boolean defaultVal) {
-        String value = getValue(key, list);
-        
-        if(value == null) {
-            return defaultVal;
-        }
-        
-        if(value.equalsIgnoreCase("true") || value.equalsIgnoreCase("y") || value.equalsIgnoreCase("yes")) {
-            return true;
-        } else if(value.equalsIgnoreCase("false") || value.equalsIgnoreCase("n") || value.equalsIgnoreCase("no")) {
-            return false;
-        } else {
-            return defaultVal;
-        }
-    }
-
-    /**
-     * Get the numeric <code>double</code> equivalent value associated with the specified key 
-     * from the supplied list of Key Value Pairs.
-     * <p/>
-     * Returns the value from the first matching key.
-     * @param key The key to search for.
-     * @param list The list of KeyValuePairs to search.
-     * @param defaultVal The default value to be returned where the value is not found or is non-numeric.
-     * @return The <code>double</code> equivalent value associated with the specified key if the value is found
-     * and is numeric, otherwise the <b><i>defaultVal</i></b> is returned.
-     */
-    public static double getDoubleValue(String key, List<KeyValuePair> list, double defaultVal) {
-        String value = getValue(key, list);
-        
-        if(value == null) {
-            return defaultVal;
-        }
-
-        try {
-            return Double.parseDouble(value);
-        } catch(NumberFormatException e) {
-            // return the default...
-        }
-        
-        return defaultVal;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/KeyValuePair.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/KeyValuePair.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/KeyValuePair.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/KeyValuePair.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,163 @@
+/*
+ * 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.helpers;
+
+import java.io.Serializable;
+import java.util.List;
+
+public class KeyValuePair implements Serializable {
+	private static final long serialVersionUID = 1L;
+
+	private String mKey, mVal;
+
+	public KeyValuePair(String pKey, String pVal) {
+		if(pKey == null || pKey.trim().equals("")) {
+			throw new IllegalArgumentException("null or empty 'pKey' arg in call.");
+		}
+		
+		mKey = pKey;
+		mVal = pVal;
+	}
+
+	public String getKey() {
+		return mKey;
+	}
+
+	public String getValue() {
+		return mVal;
+	}
+
+	public String toString() {
+		return mVal;
+	}
+
+	public String dump() {
+		return "KVpair[" + mKey + "=" + mVal + "]";
+	}
+    
+    /**
+     * Get the value associated with the specified key from the supplied list of Key Value Pairs.
+     * <p/>
+     * Returns the value from the first matching key.
+     * @param key The key to search for.
+     * @param list The list of KeyValuePairs to search.
+     * @return The value associated with the supplied key, or null if key not found.
+     */
+    public static String getValue(String key, List<KeyValuePair> list) {
+        if(key == null) {
+            throw new IllegalArgumentException("null 'key' arg in call.");
+        }
+        if(list == null) {
+            throw new IllegalArgumentException("null 'list' arg in call.");
+        }
+        
+        for(KeyValuePair kvp : list) {
+            if(kvp.mKey.equals(key)) {
+                return kvp.mVal;
+            }
+        }
+        
+        return null;
+    }
+    
+    /**
+     * Get the value associated with the specified key from the supplied list of Key Value Pairs.
+     * <p/>
+     * Returns the value from the first matching key.
+     * @param key The key to search for.
+     * @param list The list of KeyValuePairs to search.
+     * @param defaultVal The default value to be returned where there's no value available for the specified key. 
+     * @return The value associated with the supplied key, or null if key not found.
+     */
+    public static String getValue(String key, List<KeyValuePair> list, String defaultVal) {
+        String value = getValue(key, list);
+        
+        if(value == null) {
+            return defaultVal;
+        }
+        
+        return value;
+    }
+    
+    /**
+     * Get the boolean equivalent value associated with the specified key 
+     * from the supplied list of Key Value Pairs.
+     * <p/>
+     * Returns:
+     * <ul>
+     *  <li><b><code>true</code></b>: If value equals "true" or "yes" or "y" (ignoring case).</li>
+     *  <li><b><code>false</code></b>: If value equals "false" or "no" or "n" (ignoring case).</li>
+     *  <li><b><i>defaultVal</i></b>: If none of the above hold true.</li>
+     * </ul>
+     * <p/>
+     * Returns the value from the first matching key.
+     * @param key The key to search for.
+     * @param list The list of KeyValuePairs to search.
+     * @param defaultVal The default value to be returned where the above listed conditions do not hold
+     * for the associated value, or the value is not specified.
+     * @return The boolean equivalent value associated with the specified key according to the above specified
+     * rules, otherwise the <b><i>defaultVal</i></b> is returned.
+     */
+    public static boolean getBooleanValue(String key, List<KeyValuePair> list, boolean defaultVal) {
+        String value = getValue(key, list);
+        
+        if(value == null) {
+            return defaultVal;
+        }
+        
+        if(value.equalsIgnoreCase("true") || value.equalsIgnoreCase("y") || value.equalsIgnoreCase("yes")) {
+            return true;
+        } else if(value.equalsIgnoreCase("false") || value.equalsIgnoreCase("n") || value.equalsIgnoreCase("no")) {
+            return false;
+        } else {
+            return defaultVal;
+        }
+    }
+
+    /**
+     * Get the numeric <code>double</code> equivalent value associated with the specified key 
+     * from the supplied list of Key Value Pairs.
+     * <p/>
+     * Returns the value from the first matching key.
+     * @param key The key to search for.
+     * @param list The list of KeyValuePairs to search.
+     * @param defaultVal The default value to be returned where the value is not found or is non-numeric.
+     * @return The <code>double</code> equivalent value associated with the specified key if the value is found
+     * and is numeric, otherwise the <b><i>defaultVal</i></b> is returned.
+     */
+    public static double getDoubleValue(String key, List<KeyValuePair> list, double defaultVal) {
+        String value = getValue(key, list);
+        
+        if(value == null) {
+            return defaultVal;
+        }
+
+        try {
+            return Double.parseDouble(value);
+        } catch(NumberFormatException e) {
+            // return the default...
+        }
+        
+        return defaultVal;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,136 +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.helpers;
-
-import java.util.Properties;
-import java.util.concurrent.ConcurrentHashMap;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-
-/**
- * Obtains JNDI naming context.
- * 
- */
-public class NamingContext 
-{
-	/**
-	 * Logger for this class
-	 */
-	private static final Logger _logger = Logger.getLogger(NamingContext.class);
-	public static final int MAX_RETRIES = 10;
-	public static final String JBOSS_PROVIDER_URL = "localhost";
-	public static final String JBOSS_INITIAL_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory";
-	public static final String JBOSS_URL_PKG_PREFIX = ""; //"org.jboss.naming:org.jnp.interfaces"
-    private static ConcurrentHashMap<String,Context> _contextCache = new ConcurrentHashMap<String, Context>();
-	/**
-	 * Tries to connect to the server to obtain the server Context.
-	 * 
-	 * @param properties - the JNDI environment.
-	 * @return the InitialContext.
-	 */
-	public static Context getServerContext(Properties properties) 
-	{
-        String key = getKey(properties);
-	    if (_contextCache.containsKey(key)) {
-            return _contextCache.get(key);
-        }
-		boolean bCtxOK = false;
-		Context oCtx = null;
-		for (int i1 = 0; (!bCtxOK) && i1 < MAX_RETRIES; i1++) {
-			// check if context is valid
-			try {
-                oCtx = new InitialContext(properties);
-				oCtx.list("__dummy2@#$%");
-				bCtxOK = true;
-			} catch (NamingException nex) {
-				bCtxOK = true;
-			}
-		}
-		if (bCtxOK) {
-            _contextCache.put(key, oCtx);
-			return oCtx;
-		} else {
-			_logger.error("Can't connect to JNDI Server <" + properties.get(Context.PROVIDER_URL) + ">");
-			return null;
-		}
-	}
-    /**
-     * Refreshing the cached JNDI context, return the new context.
-     * @param properties
-     * @return Context
-     */
-    public static Context getFreshServerContext(Properties properties)
-    {
-        String key = getKey(properties);
-        if (_contextCache.containsKey(key)) {
-            Context context = _contextCache.get(key);
-            try {
-                context.close();
-            } catch (NamingException ne) {
-                _logger.warn("Could not close JNDI connection.");
-            }
-            _contextCache.remove(key);
-        }
-        return getServerContext(properties);
-    }
-    /**
-     * Takes properties and serializes this into a long string which is
-     * the key into the contextCache.
-     * @param properties - property Bag.
-     * @return key into the contextCache.
-     */
-    private static String getKey(Properties properties) 
-    {
-        //Can't handle nulls
-        if (properties==null) {
-            properties=new Properties();
-        }
-        //Contruct the composite key, buy serializing the properties into one String.
-        StringBuffer compositeKey= new StringBuffer("-");
-        for (Object keyObject : properties.keySet()) {
-            String key = (String) keyObject;
-            String value=(String)properties.getProperty(key);
-            compositeKey.append(key).append("=").append(value).append("-");
-        }
-        return compositeKey.toString();
-    }
-    /**
-     * Closes all Contexts, and removes them from the contextCache.
-     */
-    public static void closeAllContexts()
-    {
-        for (String key : _contextCache.keySet()) {
-            try {
-                _logger.debug("Closing JNDI connection for key: " + key);
-                _contextCache.get(key).close();
-            } catch (NamingException ne) {
-                _logger.warn("Could not close JNDI connection for key: " + key);
-             }
-            _contextCache.remove(key);
-        }
-    }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/NamingContext.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,136 @@
+/*
+ * 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.helpers;
+
+import java.util.Properties;
+import java.util.concurrent.ConcurrentHashMap;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Obtains JNDI naming context.
+ * 
+ */
+public class NamingContext 
+{
+	/**
+	 * Logger for this class
+	 */
+	private static final Logger _logger = Logger.getLogger(NamingContext.class);
+	public static final int MAX_RETRIES = 10;
+	public static final String JBOSS_PROVIDER_URL = "localhost";
+	public static final String JBOSS_INITIAL_CONTEXT_FACTORY = "org.jnp.interfaces.NamingContextFactory";
+	public static final String JBOSS_URL_PKG_PREFIX = ""; //"org.jboss.naming:org.jnp.interfaces"
+    private static ConcurrentHashMap<String,Context> _contextCache = new ConcurrentHashMap<String, Context>();
+	/**
+	 * Tries to connect to the server to obtain the server Context.
+	 * 
+	 * @param properties - the JNDI environment.
+	 * @return the InitialContext.
+	 */
+	public static Context getServerContext(Properties properties) 
+	{
+        String key = getKey(properties);
+	    if (_contextCache.containsKey(key)) {
+            return _contextCache.get(key);
+        }
+		boolean bCtxOK = false;
+		Context oCtx = null;
+		for (int i1 = 0; (!bCtxOK) && i1 < MAX_RETRIES; i1++) {
+			// check if context is valid
+			try {
+                oCtx = new InitialContext(properties);
+				oCtx.list("__dummy2@#$%");
+				bCtxOK = true;
+			} catch (NamingException nex) {
+				bCtxOK = true;
+			}
+		}
+		if (bCtxOK) {
+            _contextCache.put(key, oCtx);
+			return oCtx;
+		} else {
+			_logger.error("Can't connect to JNDI Server <" + properties.get(Context.PROVIDER_URL) + ">");
+			return null;
+		}
+	}
+    /**
+     * Refreshing the cached JNDI context, return the new context.
+     * @param properties
+     * @return Context
+     */
+    public static Context getFreshServerContext(Properties properties)
+    {
+        String key = getKey(properties);
+        if (_contextCache.containsKey(key)) {
+            Context context = _contextCache.get(key);
+            try {
+                context.close();
+            } catch (NamingException ne) {
+                _logger.warn("Could not close JNDI connection.");
+            }
+            _contextCache.remove(key);
+        }
+        return getServerContext(properties);
+    }
+    /**
+     * Takes properties and serializes this into a long string which is
+     * the key into the contextCache.
+     * @param properties - property Bag.
+     * @return key into the contextCache.
+     */
+    private static String getKey(Properties properties) 
+    {
+        //Can't handle nulls
+        if (properties==null) {
+            properties=new Properties();
+        }
+        //Contruct the composite key, buy serializing the properties into one String.
+        StringBuffer compositeKey= new StringBuffer("-");
+        for (Object keyObject : properties.keySet()) {
+            String key = (String) keyObject;
+            String value=(String)properties.getProperty(key);
+            compositeKey.append(key).append("=").append(value).append("-");
+        }
+        return compositeKey.toString();
+    }
+    /**
+     * Closes all Contexts, and removes them from the contextCache.
+     */
+    public static void closeAllContexts()
+    {
+        for (String key : _contextCache.keySet()) {
+            try {
+                _logger.debug("Closing JNDI connection for key: " + key);
+                _contextCache.get(key).close();
+            } catch (NamingException ne) {
+                _logger.warn("Could not close JNDI connection for key: " + key);
+             }
+            _contextCache.remove(key);
+        }
+    }
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,137 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.helpers.persist;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-import org.hibernate.cfg.Environment;
-import org.jboss.soa.esb.ConfigurationException;
-
-/**
- * HibernateSessionFactory is a singleton for hibernate's SessionFactory object.    The Listener
- * uses JNDI to store the Hibernate SessionFactory.
- * 
- * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
- * @since Version 4.2
- * 
- */
-public class HibernateSessionFactory {
-	public static final String HIBERNATE_JNDI = "java:comp/env/hibernate/SessionFactory";
-	
-	private static final Logger m_Logger = Logger.getLogger(HibernateSessionFactory.class);	
-	
-	private HibernateSessionFactory() {
-	}
-				
-	public static SessionFactory getInstance(Configuration f_cfg) throws ConfigurationException {
-		return init(f_cfg);		
-	}
-		
-	/**
-	 * Checks whether the SessionFactory exists within JNDI and whether it is closed.
-	 * @param f_cfg Hibernate Configuration - needed for SESSION_FACTORY_NAME
-	 * @return whether the Hibernate SessionFactory is in JNDI and is alive
-	 */
-	public static boolean isAlive(Configuration f_cfg) {
-		boolean result = false; 
-		SessionFactory sf = null;
-		String cfgName = f_cfg.getProperty(Environment.SESSION_FACTORY_NAME);
-
-		Context ic = null;
-		// Look up SessionFactory in JNDI
-		if (cfgName != null) {
-			try {
-				ic = new InitialContext();
-				sf = (SessionFactory) ic.lookup(cfgName);
-				result = ! sf.isClosed();
-				m_Logger.debug("Connection isAlive is " + result + ".");
-			} catch (NamingException ne) {
-			}
-		}
-		return result;
-	}
-	
-	/**
-	 * Grab InitialContext out of JNDI.
-	 * @param f_cfg hibernate configuration
-	 * @throws ConfigurationException
-	 */
-	private static SessionFactory init(Configuration f_cfg) throws ConfigurationException {
-		String cfgName = f_cfg.getProperty(Environment.SESSION_FACTORY_NAME);
-		SessionFactory sf = null;
-		Context ic = null;
-		// Look up SessionFactory in JNDI
-		if (cfgName != null) {
-			try {
-				ic = new InitialContext();
-				sf = (SessionFactory) ic.lookup(cfgName);
-				m_Logger.debug("Found SessionFactory in JNDI.");
-			} catch (NamingException ne) {
-				m_Logger.debug("Could not find SessionFactory in JNDI.", ne);
-			}
-		} else {
-			f_cfg.setProperty(Environment.SESSION_FACTORY_NAME, HIBERNATE_JNDI);
-			cfgName = HIBERNATE_JNDI;
-		}
-		
-		if (sf == null) {
-	        if (f_cfg != null) {
-	            // Let Hibernate bind it to JNDI
-				m_Logger.debug("Build SessionFactory from Configuration.");
-	            f_cfg.buildSessionFactory();
-	        } else {
-	        	throw new ConfigurationException("Hibernate Configuration is null");
-	        }
-		}
-		return sf;
-	}
-
-	/**
-	 * Close the SessionFactory stored in JNDI at SESSION_FACTORY_NAME.
-	 * @param f_cfg hibernate configuration
-	 */
-	public static void close(Configuration f_cfg) {
-		SessionFactory sf = null;
-		
-		String cfgName = f_cfg.getProperty(Environment.SESSION_FACTORY_NAME);
-
-		Context ic = null;
-		// Look up SessionFactory in JNDI
-		if (cfgName != null) {
-			try {
-				ic = new InitialContext();
-				sf = (SessionFactory) ic.lookup(cfgName);
-			} catch (Exception e) {
-			}
-		}
-		
-		if (sf != null) {
-			sf.close();	
-		}
-		sf = null;
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/HibernateSessionFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,137 @@
+/*
+ * 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.helpers.persist;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.hibernate.cfg.Environment;
+import org.jboss.soa.esb.ConfigurationException;
+
+/**
+ * HibernateSessionFactory is a singleton for hibernate's SessionFactory object.    The Listener
+ * uses JNDI to store the Hibernate SessionFactory.
+ * 
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @since Version 4.2
+ * 
+ */
+public class HibernateSessionFactory {
+	public static final String HIBERNATE_JNDI = "java:comp/env/hibernate/SessionFactory";
+	
+	private static final Logger m_Logger = Logger.getLogger(HibernateSessionFactory.class);	
+	
+	private HibernateSessionFactory() {
+	}
+				
+	public static SessionFactory getInstance(Configuration f_cfg) throws ConfigurationException {
+		return init(f_cfg);		
+	}
+		
+	/**
+	 * Checks whether the SessionFactory exists within JNDI and whether it is closed.
+	 * @param f_cfg Hibernate Configuration - needed for SESSION_FACTORY_NAME
+	 * @return whether the Hibernate SessionFactory is in JNDI and is alive
+	 */
+	public static boolean isAlive(Configuration f_cfg) {
+		boolean result = false; 
+		SessionFactory sf = null;
+		String cfgName = f_cfg.getProperty(Environment.SESSION_FACTORY_NAME);
+
+		Context ic = null;
+		// Look up SessionFactory in JNDI
+		if (cfgName != null) {
+			try {
+				ic = new InitialContext();
+				sf = (SessionFactory) ic.lookup(cfgName);
+				result = ! sf.isClosed();
+				m_Logger.debug("Connection isAlive is " + result + ".");
+			} catch (NamingException ne) {
+			}
+		}
+		return result;
+	}
+	
+	/**
+	 * Grab InitialContext out of JNDI.
+	 * @param f_cfg hibernate configuration
+	 * @throws ConfigurationException
+	 */
+	private static SessionFactory init(Configuration f_cfg) throws ConfigurationException {
+		String cfgName = f_cfg.getProperty(Environment.SESSION_FACTORY_NAME);
+		SessionFactory sf = null;
+		Context ic = null;
+		// Look up SessionFactory in JNDI
+		if (cfgName != null) {
+			try {
+				ic = new InitialContext();
+				sf = (SessionFactory) ic.lookup(cfgName);
+				m_Logger.debug("Found SessionFactory in JNDI.");
+			} catch (NamingException ne) {
+				m_Logger.debug("Could not find SessionFactory in JNDI.", ne);
+			}
+		} else {
+			f_cfg.setProperty(Environment.SESSION_FACTORY_NAME, HIBERNATE_JNDI);
+			cfgName = HIBERNATE_JNDI;
+		}
+		
+		if (sf == null) {
+	        if (f_cfg != null) {
+	            // Let Hibernate bind it to JNDI
+				m_Logger.debug("Build SessionFactory from Configuration.");
+	            f_cfg.buildSessionFactory();
+	        } else {
+	        	throw new ConfigurationException("Hibernate Configuration is null");
+	        }
+		}
+		return sf;
+	}
+
+	/**
+	 * Close the SessionFactory stored in JNDI at SESSION_FACTORY_NAME.
+	 * @param f_cfg hibernate configuration
+	 */
+	public static void close(Configuration f_cfg) {
+		SessionFactory sf = null;
+		
+		String cfgName = f_cfg.getProperty(Environment.SESSION_FACTORY_NAME);
+
+		Context ic = null;
+		// Look up SessionFactory in JNDI
+		if (cfgName != null) {
+			try {
+				ic = new InitialContext();
+				sf = (SessionFactory) ic.lookup(cfgName);
+			} catch (Exception e) {
+			}
+		}
+		
+		if (sf != null) {
+			sf.close();	
+		}
+		sf = null;
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,251 +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.helpers.persist;
-
-import java.sql.Connection;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.sql.DataSource;
-
-import org.apache.log4j.Logger;
-
-public class JdbcCleanConn
-{
-	private DataSource m_oDS = null;
-
-	private Connection m_conn = null;
-
-	protected List<PreparedStatement> m_olPrepSt = new ArrayList<PreparedStatement>();
-
-	protected Logger m_oLogger;
-
-	public JdbcCleanConn(DataSource p_oDS)
-	{
-		m_oDS = p_oDS;
-		m_oLogger = Logger.getLogger(this.getClass());
-	}
-
-	public void commit() throws SQLException
-	{
-		if (null != m_conn)
-		{
-			m_conn.commit();
-		}
-	}
-
-	public void rollback() throws SQLException
-	{
-		if (null != m_conn)
-		{
-			m_conn.rollback();
-		}
-	}
-
-	public void release()
-	{
-		if (null != m_conn)
-		{
-			try
-			{
-				m_conn.rollback();
-			}
-			catch (Exception eRoll)
-			{
-			}
-
-			for (PreparedStatement PS : m_olPrepSt)
-				try
-				{
-					PS.close();
-				}
-				catch (Exception e)
-				{
-				}
-			try
-			{
-				m_conn.close();
-			}
-			catch (Exception e1)
-			{
-			}
-		}
-		m_olPrepSt.clear();
-		m_conn = null;
-	} // __________________________________
-
-	public PreparedStatement prepareStatement(String p_sSt, int p_i1, int p_i2)
-			throws SQLException
-	{
-		if (null == m_conn)
-		{
-			connect();
-		}
-		PreparedStatement PS = m_conn.prepareStatement(p_sSt, p_i1, p_i2);
-		m_olPrepSt.add(PS);
-		return PS;
-	} // __________________________________
-
-	public PreparedStatement prepareStatement(String p_sSt) throws SQLException
-	{
-		if (null == m_conn)
-		{
-			connect();
-		}
-
-		PreparedStatement PS = m_conn.prepareStatement(p_sSt);
-		m_olPrepSt.add(PS);
-		return PS;
-	} // __________________________________
-
-	public ResultSet execQueryWait(PreparedStatement p_PS, int p_iQtry)
-			throws SQLException
-	{
-		if (null == m_conn)
-		{
-			connect();
-		}
-
-		SQLException eRet = null;
-		int iQtry = (p_iQtry < 1) ? 1 : (p_iQtry < 50) ? p_iQtry : 50;
-		for (int i1 = 0; i1 < iQtry; i1++)
-		{
-			try
-			{
-				return p_PS.executeQuery();
-			}
-			catch (SQLException e)
-			{
-				if (null == eRet)
-					eRet = e;
-
-				// TODO magic number!!
-
-				try
-				{
-					Thread.sleep(100 + (new Double(100 * Math.random()))
-							.longValue());
-				}
-				catch (InterruptedException ex)
-				{
-					m_oLogger.debug("Thread interrupted.", ex);
-				}
-			}
-		}
-		m_oLogger.debug("execQueryWait() FAILED", eRet);
-		throw eRet;
-	} // __________________________________
-
-	public int execUpdWait(PreparedStatement p_PS, int p_iQtry)
-			throws SQLException
-	{
-		if (null == m_conn)
-		{
-			connect();
-		}
-
-		SQLException eRet = null;
-		int iQtry = (p_iQtry < 1) ? 1 : (p_iQtry < 50) ? p_iQtry : 50;
-		for (int i1 = 0; i1 < iQtry; i1++)
-		{
-			try
-			{
-				return p_PS.executeUpdate();
-			}
-			catch (SQLException e)
-			{
-				if (null == eRet)
-					eRet = e;
-				
-				try
-				{
-					Thread.sleep(100 + (new Double(100 * Math.random()))
-							.longValue());
-				}
-				catch (InterruptedException ex)
-				{
-					m_oLogger.debug("Thread interrupted.", ex);
-				}
-			}
-		}
-		m_oLogger.debug("execUpdWait() FAILED", eRet);
-		throw eRet;
-	} // __________________________________
-
-	private void connect() throws SQLException
-	{
-		if (m_conn != null)
-		{
-			return;
-		}
-
-		SQLException eRet = null;
-		for (int i1 = 0; i1 < 5; i1++)
-		{
-			try
-			{
-				m_conn = m_oDS.getConnection();
-				eRet = null;
-				break;
-			}
-			catch (SQLException e)
-			{
-				if (null == eRet)
-					eRet = e;
-
-				// TODO magic number!!
-
-				try
-				{
-					Thread.sleep(2000 + (new Double(100 * Math.random()))
-							.longValue());
-				}
-				catch (InterruptedException ex)
-				{
-					m_oLogger.debug("Thread interrupted.", ex);
-				}
-			}
-		}
-
-		if (eRet != null)
-		{
-			m_oLogger.debug("connect() FAILED", eRet);
-			throw eRet;
-		}
-
-		if (m_conn == null)
-		{
-			throw new RuntimeException("connect() FAILED: no connection");
-		}
-
-		m_conn.setAutoCommit(false);
-		m_conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
-
-		m_olPrepSt.clear();
-
-	} // __________________________________
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConn.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,251 @@
+/*
+ * 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.helpers.persist;
+
+import java.sql.Connection;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.sql.DataSource;
+
+import org.apache.log4j.Logger;
+
+public class JdbcCleanConn
+{
+	private DataSource m_oDS = null;
+
+	private Connection m_conn = null;
+
+	protected List<PreparedStatement> m_olPrepSt = new ArrayList<PreparedStatement>();
+
+	protected Logger m_oLogger;
+
+	public JdbcCleanConn(DataSource p_oDS)
+	{
+		m_oDS = p_oDS;
+		m_oLogger = Logger.getLogger(this.getClass());
+	}
+
+	public void commit() throws SQLException
+	{
+		if (null != m_conn)
+		{
+			m_conn.commit();
+		}
+	}
+
+	public void rollback() throws SQLException
+	{
+		if (null != m_conn)
+		{
+			m_conn.rollback();
+		}
+	}
+
+	public void release()
+	{
+		if (null != m_conn)
+		{
+			try
+			{
+				m_conn.rollback();
+			}
+			catch (Exception eRoll)
+			{
+			}
+
+			for (PreparedStatement PS : m_olPrepSt)
+				try
+				{
+					PS.close();
+				}
+				catch (Exception e)
+				{
+				}
+			try
+			{
+				m_conn.close();
+			}
+			catch (Exception e1)
+			{
+			}
+		}
+		m_olPrepSt.clear();
+		m_conn = null;
+	} // __________________________________
+
+	public PreparedStatement prepareStatement(String p_sSt, int p_i1, int p_i2)
+			throws SQLException
+	{
+		if (null == m_conn)
+		{
+			connect();
+		}
+		PreparedStatement PS = m_conn.prepareStatement(p_sSt, p_i1, p_i2);
+		m_olPrepSt.add(PS);
+		return PS;
+	} // __________________________________
+
+	public PreparedStatement prepareStatement(String p_sSt) throws SQLException
+	{
+		if (null == m_conn)
+		{
+			connect();
+		}
+
+		PreparedStatement PS = m_conn.prepareStatement(p_sSt);
+		m_olPrepSt.add(PS);
+		return PS;
+	} // __________________________________
+
+	public ResultSet execQueryWait(PreparedStatement p_PS, int p_iQtry)
+			throws SQLException
+	{
+		if (null == m_conn)
+		{
+			connect();
+		}
+
+		SQLException eRet = null;
+		int iQtry = (p_iQtry < 1) ? 1 : (p_iQtry < 50) ? p_iQtry : 50;
+		for (int i1 = 0; i1 < iQtry; i1++)
+		{
+			try
+			{
+				return p_PS.executeQuery();
+			}
+			catch (SQLException e)
+			{
+				if (null == eRet)
+					eRet = e;
+
+				// TODO magic number!!
+
+				try
+				{
+					Thread.sleep(100 + (new Double(100 * Math.random()))
+							.longValue());
+				}
+				catch (InterruptedException ex)
+				{
+					m_oLogger.debug("Thread interrupted.", ex);
+				}
+			}
+		}
+		m_oLogger.debug("execQueryWait() FAILED", eRet);
+		throw eRet;
+	} // __________________________________
+
+	public int execUpdWait(PreparedStatement p_PS, int p_iQtry)
+			throws SQLException
+	{
+		if (null == m_conn)
+		{
+			connect();
+		}
+
+		SQLException eRet = null;
+		int iQtry = (p_iQtry < 1) ? 1 : (p_iQtry < 50) ? p_iQtry : 50;
+		for (int i1 = 0; i1 < iQtry; i1++)
+		{
+			try
+			{
+				return p_PS.executeUpdate();
+			}
+			catch (SQLException e)
+			{
+				if (null == eRet)
+					eRet = e;
+				
+				try
+				{
+					Thread.sleep(100 + (new Double(100 * Math.random()))
+							.longValue());
+				}
+				catch (InterruptedException ex)
+				{
+					m_oLogger.debug("Thread interrupted.", ex);
+				}
+			}
+		}
+		m_oLogger.debug("execUpdWait() FAILED", eRet);
+		throw eRet;
+	} // __________________________________
+
+	private void connect() throws SQLException
+	{
+		if (m_conn != null)
+		{
+			return;
+		}
+
+		SQLException eRet = null;
+		for (int i1 = 0; i1 < 5; i1++)
+		{
+			try
+			{
+				m_conn = m_oDS.getConnection();
+				eRet = null;
+				break;
+			}
+			catch (SQLException e)
+			{
+				if (null == eRet)
+					eRet = e;
+
+				// TODO magic number!!
+
+				try
+				{
+					Thread.sleep(2000 + (new Double(100 * Math.random()))
+							.longValue());
+				}
+				catch (InterruptedException ex)
+				{
+					m_oLogger.debug("Thread interrupted.", ex);
+				}
+			}
+		}
+
+		if (eRet != null)
+		{
+			m_oLogger.debug("connect() FAILED", eRet);
+			throw eRet;
+		}
+
+		if (m_conn == null)
+		{
+			throw new RuntimeException("connect() FAILED: no connection");
+		}
+
+		m_conn.setAutoCommit(false);
+		m_conn.setTransactionIsolation(Connection.TRANSACTION_SERIALIZABLE);
+
+		m_olPrepSt.clear();
+
+	} // __________________________________
+
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SimpleDataSource.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SimpleDataSource.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SimpleDataSource.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,167 +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.helpers.persist;
-
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.DriverManager;
-
-import javax.sql.DataSource;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * <p>
- * Obtain a connection that implements the DataSource interface
- * </p>
- * <p>
- * Description: Enable compatible use of JdbcCleanConn from outside a J2EE app
- * container
- * </p>
- * 
- * @version 1.0
- * @see JdbcCleanConn
- * @see ConfigTree
- */
-public class SimpleDataSource implements DataSource
-{
-	private PrintWriter m_oPW = new PrintWriter(System.out);
-
-	private int m_iTO = 10;
-
-	private String m_sUrl, m_sUsr, m_sPwd;
-
-	private Connection m_oConn;
-
-	public static final String DRIVER = "driver-class";
-
-	public static final String URL = "connection-url";
-
-	public static final String USER = "user-name";
-
-	public static final String PASSWORD = "password";
-
-	private static final Logger _logger = Logger
-			.getLogger(SimpleDataSource.class);
-
-	// Disable default constructor
-	private SimpleDataSource ()
-	{
-	}
-
-	/**
-	 * Obtain a DataSource by providing connection parameters. ConfigTree
-	 * argument must contain the following attributes
-	 * <p>
-	 * <li> driver-class</li>
-	 * <li> connection-url</li>
-	 * <li> user-name</li>
-	 * <li> password</li>
-	 * </p>
-	 * 
-	 * @param p_oP
-	 *            ConfigTree - Parameter tree that contains the 4 attributes
-	 *            needed
-	 * @see ConfigTree
-	 * @see SimpleDataSource#SimpleDataSource(String,String,String,String)
-	 * @see javax.sql.DataSource
-	 */
-	public SimpleDataSource (ConfigTree p_oP)
-	{
-		this(p_oP.getAttribute(DRIVER), p_oP.getAttribute(URL), p_oP
-				.getAttribute(USER), p_oP.getAttribute(PASSWORD));
-	} // ________________________________
-
-	/**
-	 * Obtain a connection to a DB using the provided arguments to call
-	 * 
-	 * @param p_sDriver
-	 *            String - Java class of the JDBC driver to use (e.g.
-	 *            org.postgresql.Driver)
-	 * @param p_sDbURL
-	 *            String - The URL of the database (e.g.
-	 *            jdbc:postgresql://chodedb1:5432/cq3)
-	 * @param p_sUsr
-	 *            String - Username
-	 * @param p_sPwd
-	 *            String - Password
-	 * @see DriverManager#getConnection(String,String,String)
-	 * @see javax.sql.DataSource
-	 */
-	public SimpleDataSource (String p_sDriver, String p_sDbURL, String p_sUsr,
-			String p_sPwd)
-	{
-		try
-		{
-         ClassUtil.forName(p_sDriver, getClass());
-         m_sUrl = p_sDbURL;
-			getConnection(p_sUsr, p_sPwd);
-		}
-		catch (ClassNotFoundException ex)
-		{
-			throw new IllegalArgumentException(ex);
-		}
-	} // ________________________________
-
-	public Connection getConnection ()
-	{
-		return m_oConn;
-	}
-
-	public Connection getConnection (String username, String password)
-	{
-		m_sUsr = username;
-		m_sPwd = password;
-		try
-		{
-			m_oConn = DriverManager.getConnection(m_sUrl, m_sUsr, m_sPwd);
-		}
-		catch (Exception e)
-		{
-			_logger.error("Can't obtain datasource", e);
-			m_oConn = null;
-		}
-		return m_oConn;
-	} // ________________________________
-
-	public int getLoginTimeout ()
-	{
-		return m_iTO;
-	}
-
-	public PrintWriter getLogWriter ()
-	{
-		return m_oPW;
-	}
-
-	public void setLoginTimeout (int seconds)
-	{
-		m_iTO = seconds;
-	}
-
-	public void setLogWriter (PrintWriter out)
-	{
-		m_oPW = out;
-	}
-} // ______________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SimpleDataSource.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SimpleDataSource.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SimpleDataSource.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SimpleDataSource.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,167 @@
+/*
+ * 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.helpers.persist;
+
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.DriverManager;
+
+import javax.sql.DataSource;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * <p>
+ * Obtain a connection that implements the DataSource interface
+ * </p>
+ * <p>
+ * Description: Enable compatible use of JdbcCleanConn from outside a J2EE app
+ * container
+ * </p>
+ * 
+ * @version 1.0
+ * @see JdbcCleanConn
+ * @see ConfigTree
+ */
+public class SimpleDataSource implements DataSource
+{
+	private PrintWriter m_oPW = new PrintWriter(System.out);
+
+	private int m_iTO = 10;
+
+	private String m_sUrl, m_sUsr, m_sPwd;
+
+	private Connection m_oConn;
+
+	public static final String DRIVER = "driver-class";
+
+	public static final String URL = "connection-url";
+
+	public static final String USER = "user-name";
+
+	public static final String PASSWORD = "password";
+
+	private static final Logger _logger = Logger
+			.getLogger(SimpleDataSource.class);
+
+	// Disable default constructor
+	private SimpleDataSource ()
+	{
+	}
+
+	/**
+	 * Obtain a DataSource by providing connection parameters. ConfigTree
+	 * argument must contain the following attributes
+	 * <p>
+	 * <li> driver-class</li>
+	 * <li> connection-url</li>
+	 * <li> user-name</li>
+	 * <li> password</li>
+	 * </p>
+	 * 
+	 * @param p_oP
+	 *            ConfigTree - Parameter tree that contains the 4 attributes
+	 *            needed
+	 * @see ConfigTree
+	 * @see SimpleDataSource#SimpleDataSource(String,String,String,String)
+	 * @see javax.sql.DataSource
+	 */
+	public SimpleDataSource (ConfigTree p_oP)
+	{
+		this(p_oP.getAttribute(DRIVER), p_oP.getAttribute(URL), p_oP
+				.getAttribute(USER), p_oP.getAttribute(PASSWORD));
+	} // ________________________________
+
+	/**
+	 * Obtain a connection to a DB using the provided arguments to call
+	 * 
+	 * @param p_sDriver
+	 *            String - Java class of the JDBC driver to use (e.g.
+	 *            org.postgresql.Driver)
+	 * @param p_sDbURL
+	 *            String - The URL of the database (e.g.
+	 *            jdbc:postgresql://chodedb1:5432/cq3)
+	 * @param p_sUsr
+	 *            String - Username
+	 * @param p_sPwd
+	 *            String - Password
+	 * @see DriverManager#getConnection(String,String,String)
+	 * @see javax.sql.DataSource
+	 */
+	public SimpleDataSource (String p_sDriver, String p_sDbURL, String p_sUsr,
+			String p_sPwd)
+	{
+		try
+		{
+         ClassUtil.forName(p_sDriver, getClass());
+         m_sUrl = p_sDbURL;
+			getConnection(p_sUsr, p_sPwd);
+		}
+		catch (ClassNotFoundException ex)
+		{
+			throw new IllegalArgumentException(ex);
+		}
+	} // ________________________________
+
+	public Connection getConnection ()
+	{
+		return m_oConn;
+	}
+
+	public Connection getConnection (String username, String password)
+	{
+		m_sUsr = username;
+		m_sPwd = password;
+		try
+		{
+			m_oConn = DriverManager.getConnection(m_sUrl, m_sUsr, m_sPwd);
+		}
+		catch (Exception e)
+		{
+			_logger.error("Can't obtain datasource", e);
+			m_oConn = null;
+		}
+		return m_oConn;
+	} // ________________________________
+
+	public int getLoginTimeout ()
+	{
+		return m_iTO;
+	}
+
+	public PrintWriter getLogWriter ()
+	{
+		return m_oPW;
+	}
+
+	public void setLoginTimeout (int seconds)
+	{
+		m_iTO = seconds;
+	}
+
+	public void setLogWriter (PrintWriter out)
+	{
+		m_oPW = out;
+	}
+} // ______________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlDbTable.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlDbTable.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlDbTable.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,203 +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.helpers.persist;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.util.ClassUtil;
-
-public abstract class SqlDbTable
-{
-	protected String m_sTableName;
-
-	protected SqlField[] m_oaFields;
-
-	protected PreparedStatement[] m_oaPS;
-
-	private JdbcCleanConn m_oConn;
-
-	public JdbcCleanConn getConn ()
-	{
-		return m_oConn;
-	}
-
-	public final String getTableName ()
-	{
-		return m_sTableName;
-	}
-
-	public final SqlField[] getAllFields ()
-	{
-		return m_oaFields;
-	}
-
-	private String m_sInsertSql, m_sUpdateSql, m_sDeleteSql;
-
-	protected String m_sSelectSql;
-
-	public SqlDbTable (JdbcCleanConn p_oC, String p_sTblNm) throws SQLException, ConfigurationException
-	{
-		m_oConn = p_oC;
-		m_sTableName = p_sTblNm;
-		initFields();
-	} // ________________________________
-
-	public abstract int setInsValues (PreparedStatement p_PS, Object bobj)
-			throws SQLException;
-
-	public abstract Object getFromRS (ResultSet p_oRS) throws SQLException;
-
-	protected abstract String getSelectFields ();
-
-	public String getFldName (int p_i)
-	{
-		return (null == m_oaFields) ? null : (p_i < 0) ? null : (p_i >= m_oaFields.length) ? null : m_oaFields[p_i]
-				.getFieldName();
-	} // ________________________________
-
-	public String getSelectStatement ()
-	{
-		if (m_sSelectSql != null) return m_sSelectSql;
-		StringBuffer sb = new StringBuffer("select ").append(getSelectFields());
-		m_sSelectSql = sb.append(" from ").append(getTableName()).toString();
-		return m_sSelectSql;
-	} // ________________________________
-
-	public String getInsertStatement ()
-	{
-		if (m_sInsertSql != null) return m_sInsertSql;
-
-		StringBuffer sb = new StringBuffer(256);
-		sb.append("insert into ").append(getTableName());
-
-		sb.append(" values (");
-		for (int i = 0; i < m_oaFields.length; i++)
-			((i < 1) ? sb : sb.append(",")).append('?');
-		sb.append(')');
-
-		return (m_sInsertSql = sb.toString());
-	} // ________________________________
-
-	public String getUpdateStatement ()
-	{
-		if (m_sUpdateSql != null) return m_sUpdateSql;
-
-		StringBuffer sb = new StringBuffer(256);
-		sb.append("update ").append(getTableName()).append(" set ");
-
-		StringBuffer sbWhere = new StringBuffer(" where ");
-
-		int iVal = 0;
-		int iWh = 0;
-		for (int i = 0; i < m_oaFields.length; i++)
-		{
-			SqlField oCurr = m_oaFields[i];
-			if (oCurr.isPrimaryKey()) ((iWh++ < 1) ? sbWhere : sbWhere
-					.append(" and ")).append(oCurr.getFieldName()).append(
-					" = ?");
-			else
-				((iVal++ < 1) ? sb : sb.append(",")).append(
-						oCurr.getFieldName()).append(" = ?");
-		}
-		sb.append(sbWhere);
-
-		return (m_sUpdateSql = sb.toString());
-	} // ________________________________
-
-	public String getDeleteStatement ()
-	{
-		if (m_sDeleteSql != null) return m_sDeleteSql;
-
-		StringBuffer sb = new StringBuffer(256);
-		sb.append("delete from ").append(getTableName()).append(" where ");
-
-		int iWh = 0;
-		for (int i = 0; i < m_oaFields.length; i++)
-		{
-			SqlField oCurr = m_oaFields[i];
-			if (!oCurr.isPrimaryKey()) continue;
-			((iWh++ < 1) ? sb : sb.append(" and "))
-					.append(oCurr.getFieldName()).append(" = ?");
-		}
-
-		return (m_sDeleteSql = sb.toString());
-	} // ________________________________
-
-	public void setObject (PreparedStatement p_PS, int p_iFld, Object p_sFldVal)
-			throws SQLException
-	{
-		if (null != p_sFldVal) if (p_sFldVal instanceof String)
-		{
-			String sTr = ((String) p_sFldVal).trim();
-			p_sFldVal = (sTr.length() > 0) ? sTr : null;
-		}
-		;
-		int iSqlIdx = 1 + p_iFld;
-		if (null == p_sFldVal) p_PS.setNull(iSqlIdx, m_oaFields[p_iFld]
-				.getSqlType());
-		else
-			p_PS.setObject(iSqlIdx, p_sFldVal);
-	} // ________________________________
-
-	public void setLong (PreparedStatement p_PS, int p_iFld, long p_lVal)
-			throws SQLException
-	{
-		p_PS.setLong(1 + p_iFld, p_lVal);
-	} // ________________________________
-
-	public void setInt (PreparedStatement p_PS, int p_iFld, int p_iVal)
-			throws SQLException
-	{
-		p_PS.setInt(1 + p_iFld, p_iVal);
-	} // ________________________________
-
-	private void initFields () throws SQLException, ConfigurationException
-	{
-		PreparedStatement PS = m_oConn.prepareStatement(getSelectStatement());
-
-		ResultSetMetaData MD = m_oConn.execQueryWait(PS, 3).getMetaData();
-		m_oaFields = new SqlField[MD.getColumnCount()];
-		
-		try
-		{
-			for (int i1 = 0; i1 < m_oaFields.length; i1++)
-			{
-				int iCol = 1 + i1;
-				String sFN = MD.getColumnName(iCol);
-				Class oCL = ClassUtil.forName(MD.getColumnClassName(iCol), getClass());
-				int iTP = MD.getColumnType(iCol);
-				int iSZ = MD.getColumnDisplaySize(iCol);
-				m_oaFields[i1] = new SqlField(sFN, oCL, iTP, iSZ, false);
-			}
-		}
-		catch (ClassNotFoundException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-		
-		PS.close();
-	} // ________________________________
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlDbTable.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlDbTable.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlDbTable.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlDbTable.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,203 @@
+/*
+ * 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.helpers.persist;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.util.ClassUtil;
+
+public abstract class SqlDbTable
+{
+	protected String m_sTableName;
+
+	protected SqlField[] m_oaFields;
+
+	protected PreparedStatement[] m_oaPS;
+
+	private JdbcCleanConn m_oConn;
+
+	public JdbcCleanConn getConn ()
+	{
+		return m_oConn;
+	}
+
+	public final String getTableName ()
+	{
+		return m_sTableName;
+	}
+
+	public final SqlField[] getAllFields ()
+	{
+		return m_oaFields;
+	}
+
+	private String m_sInsertSql, m_sUpdateSql, m_sDeleteSql;
+
+	protected String m_sSelectSql;
+
+	public SqlDbTable (JdbcCleanConn p_oC, String p_sTblNm) throws SQLException, ConfigurationException
+	{
+		m_oConn = p_oC;
+		m_sTableName = p_sTblNm;
+		initFields();
+	} // ________________________________
+
+	public abstract int setInsValues (PreparedStatement p_PS, Object bobj)
+			throws SQLException;
+
+	public abstract Object getFromRS (ResultSet p_oRS) throws SQLException;
+
+	protected abstract String getSelectFields ();
+
+	public String getFldName (int p_i)
+	{
+		return (null == m_oaFields) ? null : (p_i < 0) ? null : (p_i >= m_oaFields.length) ? null : m_oaFields[p_i]
+				.getFieldName();
+	} // ________________________________
+
+	public String getSelectStatement ()
+	{
+		if (m_sSelectSql != null) return m_sSelectSql;
+		StringBuffer sb = new StringBuffer("select ").append(getSelectFields());
+		m_sSelectSql = sb.append(" from ").append(getTableName()).toString();
+		return m_sSelectSql;
+	} // ________________________________
+
+	public String getInsertStatement ()
+	{
+		if (m_sInsertSql != null) return m_sInsertSql;
+
+		StringBuffer sb = new StringBuffer(256);
+		sb.append("insert into ").append(getTableName());
+
+		sb.append(" values (");
+		for (int i = 0; i < m_oaFields.length; i++)
+			((i < 1) ? sb : sb.append(",")).append('?');
+		sb.append(')');
+
+		return (m_sInsertSql = sb.toString());
+	} // ________________________________
+
+	public String getUpdateStatement ()
+	{
+		if (m_sUpdateSql != null) return m_sUpdateSql;
+
+		StringBuffer sb = new StringBuffer(256);
+		sb.append("update ").append(getTableName()).append(" set ");
+
+		StringBuffer sbWhere = new StringBuffer(" where ");
+
+		int iVal = 0;
+		int iWh = 0;
+		for (int i = 0; i < m_oaFields.length; i++)
+		{
+			SqlField oCurr = m_oaFields[i];
+			if (oCurr.isPrimaryKey()) ((iWh++ < 1) ? sbWhere : sbWhere
+					.append(" and ")).append(oCurr.getFieldName()).append(
+					" = ?");
+			else
+				((iVal++ < 1) ? sb : sb.append(",")).append(
+						oCurr.getFieldName()).append(" = ?");
+		}
+		sb.append(sbWhere);
+
+		return (m_sUpdateSql = sb.toString());
+	} // ________________________________
+
+	public String getDeleteStatement ()
+	{
+		if (m_sDeleteSql != null) return m_sDeleteSql;
+
+		StringBuffer sb = new StringBuffer(256);
+		sb.append("delete from ").append(getTableName()).append(" where ");
+
+		int iWh = 0;
+		for (int i = 0; i < m_oaFields.length; i++)
+		{
+			SqlField oCurr = m_oaFields[i];
+			if (!oCurr.isPrimaryKey()) continue;
+			((iWh++ < 1) ? sb : sb.append(" and "))
+					.append(oCurr.getFieldName()).append(" = ?");
+		}
+
+		return (m_sDeleteSql = sb.toString());
+	} // ________________________________
+
+	public void setObject (PreparedStatement p_PS, int p_iFld, Object p_sFldVal)
+			throws SQLException
+	{
+		if (null != p_sFldVal) if (p_sFldVal instanceof String)
+		{
+			String sTr = ((String) p_sFldVal).trim();
+			p_sFldVal = (sTr.length() > 0) ? sTr : null;
+		}
+		;
+		int iSqlIdx = 1 + p_iFld;
+		if (null == p_sFldVal) p_PS.setNull(iSqlIdx, m_oaFields[p_iFld]
+				.getSqlType());
+		else
+			p_PS.setObject(iSqlIdx, p_sFldVal);
+	} // ________________________________
+
+	public void setLong (PreparedStatement p_PS, int p_iFld, long p_lVal)
+			throws SQLException
+	{
+		p_PS.setLong(1 + p_iFld, p_lVal);
+	} // ________________________________
+
+	public void setInt (PreparedStatement p_PS, int p_iFld, int p_iVal)
+			throws SQLException
+	{
+		p_PS.setInt(1 + p_iFld, p_iVal);
+	} // ________________________________
+
+	private void initFields () throws SQLException, ConfigurationException
+	{
+		PreparedStatement PS = m_oConn.prepareStatement(getSelectStatement());
+
+		ResultSetMetaData MD = m_oConn.execQueryWait(PS, 3).getMetaData();
+		m_oaFields = new SqlField[MD.getColumnCount()];
+		
+		try
+		{
+			for (int i1 = 0; i1 < m_oaFields.length; i1++)
+			{
+				int iCol = 1 + i1;
+				String sFN = MD.getColumnName(iCol);
+				Class oCL = ClassUtil.forName(MD.getColumnClassName(iCol), getClass());
+				int iTP = MD.getColumnType(iCol);
+				int iSZ = MD.getColumnDisplaySize(iCol);
+				m_oaFields[i1] = new SqlField(sFN, oCL, iTP, iSZ, false);
+			}
+		}
+		catch (ClassNotFoundException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+		
+		PS.close();
+	} // ________________________________
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlField.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlField.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlField.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,83 +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.helpers.persist;
-
-public class SqlField {
-	private int m_sqlType;
-
-	private Class m_javaType;
-
-	private int m_sqlLength;
-
-	private String m_fieldName;
-
-	private boolean m_primaryKey;
-
-	public SqlField(String pFldName, Class pJavaType, int pSqlType,
-			int pFieldLength, boolean pk) {
-		m_fieldName = pFldName;
-		m_javaType = pJavaType;
-		m_sqlType = pSqlType;
-		m_sqlLength = pFieldLength;
-		m_primaryKey = pk;
-	}
-
-	public int getSqlType() {
-		return m_sqlType;
-	}
-
-	public Class getJavaType() {
-		return m_javaType;
-	}
-
-	public int getSqlLength() {
-		return this.m_sqlLength;
-	}
-
-	public String getFieldName() {
-		return this.m_fieldName;
-	}
-
-	public boolean isPrimaryKey() {
-		return this.m_primaryKey;
-	}
-
-	public void setSqlType(int pSqlType) {
-		m_sqlType = pSqlType;
-	}
-
-	public void setJavaType(Class pJavaType) {
-		m_javaType = pJavaType;
-	}
-
-	public void setSqlLength(int pSqlLength) {
-		m_sqlLength = pSqlLength;
-	}
-
-	public void setFieldName(String pFieldName) {
-		m_fieldName = pFieldName;
-	}
-
-	public void setPrimaryKey(boolean pPrimaryKey) {
-		m_primaryKey = pPrimaryKey;
-	}
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlField.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlField.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlField.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/helpers/persist/SqlField.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,83 @@
+/*
+ * 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.helpers.persist;
+
+public class SqlField {
+	private int m_sqlType;
+
+	private Class m_javaType;
+
+	private int m_sqlLength;
+
+	private String m_fieldName;
+
+	private boolean m_primaryKey;
+
+	public SqlField(String pFldName, Class pJavaType, int pSqlType,
+			int pFieldLength, boolean pk) {
+		m_fieldName = pFldName;
+		m_javaType = pJavaType;
+		m_sqlType = pSqlType;
+		m_sqlLength = pFieldLength;
+		m_primaryKey = pk;
+	}
+
+	public int getSqlType() {
+		return m_sqlType;
+	}
+
+	public Class getJavaType() {
+		return m_javaType;
+	}
+
+	public int getSqlLength() {
+		return this.m_sqlLength;
+	}
+
+	public String getFieldName() {
+		return this.m_fieldName;
+	}
+
+	public boolean isPrimaryKey() {
+		return this.m_primaryKey;
+	}
+
+	public void setSqlType(int pSqlType) {
+		m_sqlType = pSqlType;
+	}
+
+	public void setJavaType(Class pJavaType) {
+		m_javaType = pJavaType;
+	}
+
+	public void setSqlLength(int pSqlLength) {
+		m_sqlLength = pSqlLength;
+	}
+
+	public void setFieldName(String pFieldName) {
+		m_fieldName = pFieldName;
+	}
+
+	public void setPrimaryKey(boolean pPrimaryKey) {
+		m_primaryKey = pPrimaryKey;
+	}
+} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleIdentity.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleIdentity.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleIdentity.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,82 +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.lifecycle;
-
-/**
- * Utility to handle lifecycle identities.
- * @author kevin
- */
-public class LifecycleIdentity 
-{
-    /**
-     * The lifecycle identity singleton.
-     */
-    private static final LifecycleIdentity SINGLETON = new LifecycleIdentity() ;
-    
-    /**
-     * The lifecycle identity associated with the current thread.
-     */
-    private static final InheritableThreadLocal<String> threadLifecycleIdentiy = new InheritableThreadLocal<String>() ;
-    
-    /**
-     * The identity counter.
-     */
-    private long identifyCounter ;
-    
-    public String getNextLifecycleIdentity()
-    {
-        final long lifecycleIdentity ;
-        synchronized(this)
-        {
-            lifecycleIdentity = identifyCounter++ ;
-        }
-        return "LifecycleIdentity:" + Long.valueOf(lifecycleIdentity) ;
-    }
-    
-    /**
-     * Set the lifecycle identity associated with the current thread.
-     * @param lifecycleIdentity The lifecycle identity or null to clear.
-     */
-    public void setThreadLifecycleIdentity(final String lifecycleIdentity)
-    {
-        threadLifecycleIdentiy.set(lifecycleIdentity) ;
-    }
-    
-    /**
-     * Get the lifecycle identity associated with the current thread.
-     * @return The lifecycle identity or null if not set.
-     */
-    public String getThreadLifecycleIdentity()
-    {
-        return threadLifecycleIdentiy.get() ;
-    }
-    
-    
-    /**
-     * Get the lifecycle identify singleton.
-     * @return the lifecycle identity singleton.
-     */
-    public static LifecycleIdentity getSingleton()
-    {
-        return SINGLETON ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleIdentity.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleIdentity.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleIdentity.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/lifecycle/LifecycleIdentity.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,82 @@
+/*
+ * 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.lifecycle;
+
+/**
+ * Utility to handle lifecycle identities.
+ * @author kevin
+ */
+public class LifecycleIdentity 
+{
+    /**
+     * The lifecycle identity singleton.
+     */
+    private static final LifecycleIdentity SINGLETON = new LifecycleIdentity() ;
+    
+    /**
+     * The lifecycle identity associated with the current thread.
+     */
+    private static final InheritableThreadLocal<String> threadLifecycleIdentiy = new InheritableThreadLocal<String>() ;
+    
+    /**
+     * The identity counter.
+     */
+    private long identifyCounter ;
+    
+    public String getNextLifecycleIdentity()
+    {
+        final long lifecycleIdentity ;
+        synchronized(this)
+        {
+            lifecycleIdentity = identifyCounter++ ;
+        }
+        return "LifecycleIdentity:" + Long.valueOf(lifecycleIdentity) ;
+    }
+    
+    /**
+     * Set the lifecycle identity associated with the current thread.
+     * @param lifecycleIdentity The lifecycle identity or null to clear.
+     */
+    public void setThreadLifecycleIdentity(final String lifecycleIdentity)
+    {
+        threadLifecycleIdentiy.set(lifecycleIdentity) ;
+    }
+    
+    /**
+     * Get the lifecycle identity associated with the current thread.
+     * @return The lifecycle identity or null if not set.
+     */
+    public String getThreadLifecycleIdentity()
+    {
+        return threadLifecycleIdentiy.get() ;
+    }
+    
+    
+    /**
+     * Get the lifecycle identify singleton.
+     * @return the lifecycle identity singleton.
+     */
+    public static LifecycleIdentity getSingleton()
+    {
+        return SINGLETON ;
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/LifecycleUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/LifecycleUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/LifecycleUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,184 +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;
-
-import java.lang.reflect.Constructor;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.parameters.ParamRepositoryException;
-import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.xml.sax.SAXException;
-
-/**
- * Lifecycle helper methods
- * @author kevin
- */
-public class LifecycleUtil
-{
-    /**
-     * Default constructor.
-     */
-    private LifecycleUtil()
-    {
-    }
-    
-    /**
-     * Get the managed listeners from the specified parameter entry in the repository.
-     * @param param The listener parameter.
-     * @return The managed listeners.
-     * 
-     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
-     * @throws SAXException For errors associated with parsing the configuration.
-     * @throws ManagedLifecycleException For errors associated with the managed instance.
-     */
-    public static List<ManagedLifecycle> getListeners(final String param)
-        throws ParamRepositoryException, SAXException, ManagedLifecycleException
-    {
-        return getListeners(getConfigTree(param)) ;
-    }
-    
-    /**
-     * Get the managed listeners from the specified config tree.
-     * @param tree The config tree.
-     * @return The managed listeners.
-     * 
-     * @throws ManagedLifecycleException For errors associated with the managed instance.
-     */
-    public static List<ManagedLifecycle> getListeners(final ConfigTree tree)
-        throws ManagedLifecycleException
-    {
-        return getManagedInstances(tree, ListenerTagNames.LISTENER_CLASS_TAG) ;
-    }
-    
-    /**
-     * Get the managed gateways from the specified parameter entry in the repository.
-     * @param param The gateway parameter.
-     * @return The managed gateways.
-     * 
-     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
-     * @throws SAXException For errors associated with parsing the configuration.
-     * @throws ManagedLifecycleException For errors associated with the managed instance.
-     */
-    public static List<ManagedLifecycle> getGateways(final String param)
-        throws ParamRepositoryException, SAXException, ManagedLifecycleException
-    {
-        return getGateways(getConfigTree(param)) ;
-    }
-    
-    /**
-     * Get the managed gateways from the specified config tree.
-     * @param tree The config tree.
-     * @return The managed gateways.
-     * 
-     * @throws ManagedLifecycleException For errors associated with the managed instance.
-     */
-    public static List<ManagedLifecycle> getGateways(final ConfigTree tree)
-        throws ManagedLifecycleException
-    {
-        return getManagedInstances(tree, ListenerTagNames.GATEWAY_CLASS_TAG) ;
-    }
-    
-    /**
-     * Get the managed instances from the specified config tree.
-     * @param tree The config tree.
-     * @return The managed instances.
-     * 
-     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
-     * @throws SAXException For errors associated with parsing the configuration.
-     * @throws ManagedLifecycleException For errors associated with the managed instance.
-     */
-    private static List<ManagedLifecycle> getManagedInstances(final ConfigTree tree, final String classTag)
-        throws ManagedLifecycleException
-    {
-        final ArrayList<ManagedLifecycle> instances = new ArrayList<ManagedLifecycle>() ;
-        
-        for(ConfigTree child : tree.getAllChildren())
-        {
-            final String classname = child.getAttribute(classTag) ;
-            if (classname != null)
-            {
-                final Class instanceClass ;
-                try
-                {
-                    instanceClass = ClassUtil.forName(classname, LifecycleUtil.class) ;
-                }
-                catch (final ClassNotFoundException cnfe)
-                {
-                    throw new ManagedLifecycleException("Could not locate managed instance " + classname) ;
-                }
-                
-                if (!ManagedLifecycle.class.isAssignableFrom(instanceClass))
-                {
-                    throw new ManagedLifecycleException("Managed instance " + classname + " does not implement ManagedLifecycle") ;
-                }
-                
-                final Constructor constructor ;
-                try
-                {
-                    constructor = instanceClass.getConstructor(new Class[] {ConfigTree.class}) ;
-                }
-                catch (final NoSuchMethodException nsme)
-                {
-                    throw new ManagedLifecycleException("Managed instance [" + classname +
-                            "] does not have correct constructor.  This class must contain a public constructor of the form 'public " +
-                            instanceClass.getSimpleName() + "(" + ConfigTree.class.getName() + " config);'");
-                }
-                final ManagedLifecycle instance ;
-                try
-                {
-                    instance = (ManagedLifecycle)constructor.newInstance(child) ;
-                }
-                catch (final Exception ex)
-                {
-                    throw new ManagedLifecycleException("Unexpected exception while instantiating managed instance", ex) ;
-                }
-                instances.add(instance) ;
-            }
-        }
-        
-        return instances ;
-    }
-    
-    /**
-     * Get the config tree from the specified parameter entry in the repository.
-     * @param param The parameter.
-     * @return The config tree.
-     * 
-     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
-     * @throws SAXException For errors associated with parsing the configuration.
-     */
-    public static ConfigTree getConfigTree(final String param)
-        throws ParamRepositoryException, SAXException
-    {
-        final String xml = ParamRepositoryFactory.getInstance().get(param) ;
-        final ConfigTree tree = ConfigTree.fromXml(xml) ;
-        
-        tree.setAttribute("configSource", "param-repository:" + param) ;
-        return tree ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/LifecycleUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/LifecycleUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/LifecycleUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/LifecycleUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,184 @@
+/*
+ * 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;
+
+import java.lang.reflect.Constructor;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.parameters.ParamRepositoryException;
+import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.xml.sax.SAXException;
+
+/**
+ * Lifecycle helper methods
+ * @author kevin
+ */
+public class LifecycleUtil
+{
+    /**
+     * Default constructor.
+     */
+    private LifecycleUtil()
+    {
+    }
+    
+    /**
+     * Get the managed listeners from the specified parameter entry in the repository.
+     * @param param The listener parameter.
+     * @return The managed listeners.
+     * 
+     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
+     * @throws SAXException For errors associated with parsing the configuration.
+     * @throws ManagedLifecycleException For errors associated with the managed instance.
+     */
+    public static List<ManagedLifecycle> getListeners(final String param)
+        throws ParamRepositoryException, SAXException, ManagedLifecycleException
+    {
+        return getListeners(getConfigTree(param)) ;
+    }
+    
+    /**
+     * Get the managed listeners from the specified config tree.
+     * @param tree The config tree.
+     * @return The managed listeners.
+     * 
+     * @throws ManagedLifecycleException For errors associated with the managed instance.
+     */
+    public static List<ManagedLifecycle> getListeners(final ConfigTree tree)
+        throws ManagedLifecycleException
+    {
+        return getManagedInstances(tree, ListenerTagNames.LISTENER_CLASS_TAG) ;
+    }
+    
+    /**
+     * Get the managed gateways from the specified parameter entry in the repository.
+     * @param param The gateway parameter.
+     * @return The managed gateways.
+     * 
+     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
+     * @throws SAXException For errors associated with parsing the configuration.
+     * @throws ManagedLifecycleException For errors associated with the managed instance.
+     */
+    public static List<ManagedLifecycle> getGateways(final String param)
+        throws ParamRepositoryException, SAXException, ManagedLifecycleException
+    {
+        return getGateways(getConfigTree(param)) ;
+    }
+    
+    /**
+     * Get the managed gateways from the specified config tree.
+     * @param tree The config tree.
+     * @return The managed gateways.
+     * 
+     * @throws ManagedLifecycleException For errors associated with the managed instance.
+     */
+    public static List<ManagedLifecycle> getGateways(final ConfigTree tree)
+        throws ManagedLifecycleException
+    {
+        return getManagedInstances(tree, ListenerTagNames.GATEWAY_CLASS_TAG) ;
+    }
+    
+    /**
+     * Get the managed instances from the specified config tree.
+     * @param tree The config tree.
+     * @return The managed instances.
+     * 
+     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
+     * @throws SAXException For errors associated with parsing the configuration.
+     * @throws ManagedLifecycleException For errors associated with the managed instance.
+     */
+    private static List<ManagedLifecycle> getManagedInstances(final ConfigTree tree, final String classTag)
+        throws ManagedLifecycleException
+    {
+        final ArrayList<ManagedLifecycle> instances = new ArrayList<ManagedLifecycle>() ;
+        
+        for(ConfigTree child : tree.getAllChildren())
+        {
+            final String classname = child.getAttribute(classTag) ;
+            if (classname != null)
+            {
+                final Class instanceClass ;
+                try
+                {
+                    instanceClass = ClassUtil.forName(classname, LifecycleUtil.class) ;
+                }
+                catch (final ClassNotFoundException cnfe)
+                {
+                    throw new ManagedLifecycleException("Could not locate managed instance " + classname) ;
+                }
+                
+                if (!ManagedLifecycle.class.isAssignableFrom(instanceClass))
+                {
+                    throw new ManagedLifecycleException("Managed instance " + classname + " does not implement ManagedLifecycle") ;
+                }
+                
+                final Constructor constructor ;
+                try
+                {
+                    constructor = instanceClass.getConstructor(new Class[] {ConfigTree.class}) ;
+                }
+                catch (final NoSuchMethodException nsme)
+                {
+                    throw new ManagedLifecycleException("Managed instance [" + classname +
+                            "] does not have correct constructor.  This class must contain a public constructor of the form 'public " +
+                            instanceClass.getSimpleName() + "(" + ConfigTree.class.getName() + " config);'");
+                }
+                final ManagedLifecycle instance ;
+                try
+                {
+                    instance = (ManagedLifecycle)constructor.newInstance(child) ;
+                }
+                catch (final Exception ex)
+                {
+                    throw new ManagedLifecycleException("Unexpected exception while instantiating managed instance", ex) ;
+                }
+                instances.add(instance) ;
+            }
+        }
+        
+        return instances ;
+    }
+    
+    /**
+     * Get the config tree from the specified parameter entry in the repository.
+     * @param param The parameter.
+     * @return The config tree.
+     * 
+     * @throws ParamRepositoryException For errors associated with accessing the parameter repository.
+     * @throws SAXException For errors associated with parsing the configuration.
+     */
+    public static ConfigTree getConfigTree(final String param)
+        throws ParamRepositoryException, SAXException
+    {
+        final String xml = ParamRepositoryFactory.getInstance().get(param) ;
+        final ConfigTree tree = ConfigTree.fromXml(xml) ;
+        
+        tree.setAttribute("configSource", "param-repository:" + param) ;
+        return tree ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerInitializationException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerInitializationException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerInitializationException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,47 +0,0 @@
-package org.jboss.soa.esb.listeners;
-
-import org.jboss.soa.esb.BaseException;
-
-/**
- * @author <a href="mailto:johan.kumps at telenet.be">Johan Kumps</a>
- */
-public class ListenerInitializationException extends BaseException{
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = -6872003497155955428L;
-	
-	/**
-	 * Public Default Constructor.
-	 */
-	public ListenerInitializationException() {
-		super();
-	}
-
-	/**
-	 * Public Constructor.
-	 * @param message Exception message.
-	 */
-	public ListenerInitializationException(String message) {
-		super(message);
-	}
-
-	/**
-	 * Public Constructor.
-	 * @param message Exception message.
-	 * @param cause Exception cause.
-	 */
-	public ListenerInitializationException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-	/**
-	 * Public Constructor.
-	 * @param cause Exception cause.
-	 */
-	public ListenerInitializationException(Throwable cause) {
-		super(cause);
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerInitializationException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerInitializationException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerInitializationException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerInitializationException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,47 @@
+package org.jboss.soa.esb.listeners;
+
+import org.jboss.soa.esb.BaseException;
+
+/**
+ * @author <a href="mailto:johan.kumps at telenet.be">Johan Kumps</a>
+ */
+public class ListenerInitializationException extends BaseException{
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = -6872003497155955428L;
+	
+	/**
+	 * Public Default Constructor.
+	 */
+	public ListenerInitializationException() {
+		super();
+	}
+
+	/**
+	 * Public Constructor.
+	 * @param message Exception message.
+	 */
+	public ListenerInitializationException(String message) {
+		super(message);
+	}
+
+	/**
+	 * Public Constructor.
+	 * @param message Exception message.
+	 * @param cause Exception cause.
+	 */
+	public ListenerInitializationException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	/**
+	 * Public Constructor.
+	 * @param cause Exception cause.
+	 */
+	public ListenerInitializationException(Throwable cause) {
+		super(cause);
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.
- */
-/**
- * Contains tag names as they can be used in the configuration.
- * 
- */
-package org.jboss.soa.esb.listeners;
-
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-
-public class ListenerTagNames 
-{
-	/** EPRs */
-	public static final String EPR_TAG						= "EPR";
-	public static final String REPLY_TO_EPR_TAG				= "replyToEPR";
-	public static final String URL_TAG						= JDBCEpr.URL_TAG; // change only in one place // TODO huh?!
-	public static final String PROTOCOL_TAG					= "protocol";
-
-	/** Threading */
-	public static final String MAX_THREADS_TAG				= "maxThreads";
-
-        /* Reloading */
-        public static final String RELOAD_SECONDS_TAG = "parameterReloadSecs";
-        public static final String END_TIME_TAG = "endTime";
-
-	/** Registry */
-    public static final String SERVICE_CATEGORY_NAME_TAG    = "service-category";
-	public static final String SERVICE_NAME_TAG			    = "service-name";
-	public static final String SERVICE_DESCRIPTION_TAG      = "service-description";
-	public static final String EPR_DESCRIPTION_TAG          = "epr-description";
-
-	/**  Gateways  */
-    public static final String TARGET_SERVICE_CATEGORY_TAG	= "target-service-category";
-	public static final String TARGET_SERVICE_NAME_TAG	    = "target-service-name";
-	public static final String GATEWAY_CLASS_TAG            = "gatewayClass";
-	
-	/** Listeners */
-	public static final String LISTENER_CLASS_TAG            = "listenerClass";
-    
-	/** ActionProcessingPipeline */
-    public static final String ACTION_ELEMENT_TAG		    = "action";
-    public static final String ACTION_CLASS_TAG			    = "class";
-    public static final String PROCESS_METHOD_TAG		    = "process";
-    public static final String ACTION_PROPERTY_TAG   	    = "property";
-    public static final String NORMAL_COMPLETION_METHOD_TAG = "okMethod";
-    public static final String EXCEPTION_METHOD_TAG		    = "exceptionMethod";
-    public static final String HTTP_ROUTER_ROUTE_URL        = "routeUrl";
-    
-    /** Gateway Composer */
-    public static final String GATEWAY_COMPOSER_CLASS_TAG   = "composer-class";
-    public static final String GATEWAY_COMPOSER_METHOD_TAG  = "composer-process";
-    public static final String GATEWAY_RESPONDER_METHOD_TAG = "responder-process";
-    public static final String GATEWAY_WAIT_MILLIS_TAG 		= "max-millis-for-response";
-    /** Routing */
-    public static final String DESTINATION_NAME_TAG         = "destination-name";
-    /** Content Based Routing */
-    /** RuleSet reference (Filename) */
-    public static final String CBR_CLASS                    = "cbrClass";
-    public static final String RULE_SET_TAG                 = "ruleSet";
-    public static final String RULE_LANGUAGE_TAG            = "ruleLanguage";
-    public static final String RULE_RELOAD_TAG              = "ruleReload";
-
-    /** Poller tagnames   */
-    public static final String POLL_LATENCY_SECS_TAG		= "pollLatencySeconds";
-    
-    /** File Actions  */
-    public static final String FILE_INPUT_DIR_TAG			= "inputDir";
-    public static final String FILE_INPUT_SFX_TAG			= "inputSuffix";
-    public static final String FILE_WORK_SFX_TAG			= "workSuffix";
-    public static final String FILE_ERROR_DIR_TAG			= "errorDir";
-    public static final String FILE_ERROR_SFX_TAG			= "errorSuffix";
-    public static final String FILE_POST_DIR_TAG			= "postDir";
-    public static final String FILE_POST_SFX_TAG			= "postSuffix";
-    public static final String FILE_POST_DEL_TAG			= "postDelete";
-    
-    /** Hibernate related */
-    public static final String HIBERNATE_OBJECT_DATA_TAG	= "hibernateObject";
-    
-    /** SQL related  */
-    public static final String SQL_ROW_DATA_TAG				= "sqlRowData";
-
-    public static final String SQL_TABLE_NAME_TAG			= "tableName";
-    public static final String SQL_SELECT_FIELDS_TAG		= "selectFields";
-    public static final String SQL_KEY_FIELDS_TAG			= "keyFields";
-    public static final String SQL_IN_PROCESS_FIELD_TAG		= "inProcessField";
-    public static final String SQL_IN_PROCESS_VALUES_TAG	= "inProcessValues";
-    public static final String SQL_WHERE_CONDITION_TAG		= "whereCondition";
-    public static final String SQL_ORDER_BY_TAG				= "orderBy";
-    public static final String SQL_POST_DEL_TAG				= "postDelete";
-
-    /** Reply Listener */
-    public static final String REPLY_LISTENER_TIMEOUT_TAG   = "replyListenerTimeout";
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerTagNames.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,112 @@
+/*
+ * 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.
+ */
+/**
+ * Contains tag names as they can be used in the configuration.
+ * 
+ */
+package org.jboss.soa.esb.listeners;
+
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+
+public class ListenerTagNames 
+{
+	/** EPRs */
+	public static final String EPR_TAG						= "EPR";
+	public static final String REPLY_TO_EPR_TAG				= "replyToEPR";
+	public static final String URL_TAG						= JDBCEpr.URL_TAG; // change only in one place // TODO huh?!
+	public static final String PROTOCOL_TAG					= "protocol";
+
+	/** Threading */
+	public static final String MAX_THREADS_TAG				= "maxThreads";
+
+        /* Reloading */
+        public static final String RELOAD_SECONDS_TAG = "parameterReloadSecs";
+        public static final String END_TIME_TAG = "endTime";
+
+	/** Registry */
+    public static final String SERVICE_CATEGORY_NAME_TAG    = "service-category";
+	public static final String SERVICE_NAME_TAG			    = "service-name";
+	public static final String SERVICE_DESCRIPTION_TAG      = "service-description";
+	public static final String EPR_DESCRIPTION_TAG          = "epr-description";
+
+	/**  Gateways  */
+    public static final String TARGET_SERVICE_CATEGORY_TAG	= "target-service-category";
+	public static final String TARGET_SERVICE_NAME_TAG	    = "target-service-name";
+	public static final String GATEWAY_CLASS_TAG            = "gatewayClass";
+	
+	/** Listeners */
+	public static final String LISTENER_CLASS_TAG            = "listenerClass";
+    
+	/** ActionProcessingPipeline */
+    public static final String ACTION_ELEMENT_TAG		    = "action";
+    public static final String ACTION_CLASS_TAG			    = "class";
+    public static final String PROCESS_METHOD_TAG		    = "process";
+    public static final String ACTION_PROPERTY_TAG   	    = "property";
+    public static final String NORMAL_COMPLETION_METHOD_TAG = "okMethod";
+    public static final String EXCEPTION_METHOD_TAG		    = "exceptionMethod";
+    public static final String HTTP_ROUTER_ROUTE_URL        = "routeUrl";
+    
+    /** Gateway Composer */
+    public static final String GATEWAY_COMPOSER_CLASS_TAG   = "composer-class";
+    public static final String GATEWAY_COMPOSER_METHOD_TAG  = "composer-process";
+    public static final String GATEWAY_RESPONDER_METHOD_TAG = "responder-process";
+    public static final String GATEWAY_WAIT_MILLIS_TAG 		= "max-millis-for-response";
+    /** Routing */
+    public static final String DESTINATION_NAME_TAG         = "destination-name";
+    /** Content Based Routing */
+    /** RuleSet reference (Filename) */
+    public static final String CBR_CLASS                    = "cbrClass";
+    public static final String RULE_SET_TAG                 = "ruleSet";
+    public static final String RULE_LANGUAGE_TAG            = "ruleLanguage";
+    public static final String RULE_RELOAD_TAG              = "ruleReload";
+
+    /** Poller tagnames   */
+    public static final String POLL_LATENCY_SECS_TAG		= "pollLatencySeconds";
+    
+    /** File Actions  */
+    public static final String FILE_INPUT_DIR_TAG			= "inputDir";
+    public static final String FILE_INPUT_SFX_TAG			= "inputSuffix";
+    public static final String FILE_WORK_SFX_TAG			= "workSuffix";
+    public static final String FILE_ERROR_DIR_TAG			= "errorDir";
+    public static final String FILE_ERROR_SFX_TAG			= "errorSuffix";
+    public static final String FILE_POST_DIR_TAG			= "postDir";
+    public static final String FILE_POST_SFX_TAG			= "postSuffix";
+    public static final String FILE_POST_DEL_TAG			= "postDelete";
+    
+    /** Hibernate related */
+    public static final String HIBERNATE_OBJECT_DATA_TAG	= "hibernateObject";
+    
+    /** SQL related  */
+    public static final String SQL_ROW_DATA_TAG				= "sqlRowData";
+
+    public static final String SQL_TABLE_NAME_TAG			= "tableName";
+    public static final String SQL_SELECT_FIELDS_TAG		= "selectFields";
+    public static final String SQL_KEY_FIELDS_TAG			= "keyFields";
+    public static final String SQL_IN_PROCESS_FIELD_TAG		= "inProcessField";
+    public static final String SQL_IN_PROCESS_VALUES_TAG	= "inProcessValues";
+    public static final String SQL_WHERE_CONDITION_TAG		= "whereCondition";
+    public static final String SQL_ORDER_BY_TAG				= "orderBy";
+    public static final String SQL_POST_DEL_TAG				= "postDelete";
+
+    /** Reply Listener */
+    public static final String REPLY_LISTENER_TIMEOUT_TAG   = "replyListenerTimeout";
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,408 +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;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.util.Collection;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.naming.Context;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-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;
-
-public class ListenerUtil
-{
-
-	private ListenerUtil()
-	{
-	}
-
-	public static EPR tryToDeliver(Message message, String category, String name)
-			throws CourierException, RegistryException, MalformedEPRException
-	{
-		Courier courier = null;
-		Registry reg = RegistryFactory.getRegistry();
-		Collection<EPR> all = reg.findEPRs(category, name);
-		if (null != all)
-			for (EPR epr : all)
-			{
-				try
-				{
-					courier = CourierFactory.getCourier(epr);
-					if (!courier.deliver(message))
-						continue;
-					return epr;
-				}
-				finally
-				{
-					CourierUtil.cleanCourier(courier);
-				}
-			}
-		String service = "[" + category + "," + name + "]";
-		String txt = (null == all || all.size() < 1) ? "No EPRs registered for "
-				+ service
-				: "Unable to deliverAsync message to registered EPRs for " + service;
-		throw new CourierException(txt);
-	} // ________________________________
-
-	public static EPR assembleEpr(ConfigTree tree)
-			throws ConfigurationException
-	{
-		String urlString = tree.getAttribute(ListenerTagNames.URL_TAG);
-		String protocol = (null == urlString) ? tree
-				.getAttribute(ListenerTagNames.PROTOCOL_TAG) : urlString
-				.split(":")[0];
-
-		try
-		{
-			if ("jms".equals(protocol))
-				return jmsEprFromElement(tree);
-			if ("file".equals(protocol))
-				return fileEprFromElement(tree);
-			if ("ftp".equals(protocol))
-				return fileEprFromElement(tree);
-			if ("jdbc".equals(protocol))
-				return jdbcEprFromElement(tree);
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-			
-			_logger.error("Problem", e);
-			throw new ConfigurationException(e);
-		}
-
-		throw new ConfigurationException("Unknown protocol <" + protocol + ">");
-
-	} // ________________________________
-
-	public static JMSEpr jmsEprFromElement(ConfigTree tree)
-			throws ConfigurationException
-	{
-		try
-		{
-
-			String name = tree.getRequiredAttribute(JMSEpr.DESTINATION_NAME_TAG);
-            Set<String> names=tree.getAttributeNames();
-            Properties environment = new Properties();
-            for (String attributeName : names) {
-                if (attributeName.startsWith("java.naming.")) {
-                    environment.setProperty(attributeName, tree.getAttribute(attributeName));
-                }
-            }
-			String type = getAttrAndWarn(tree, JMSEpr.DESTINATION_TYPE_TAG,
-					"queue");
-			String jndiURL = tree.getAttribute(JMSEpr.JNDI_URL_TAG);
-            if (jndiURL!=null) environment.setProperty(Context.PROVIDER_URL, jndiURL);
-			String jndiContextFactory = tree.getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG);
-            if (jndiContextFactory!=null) environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, jndiContextFactory);
-			String jndiPkgPrefix = tree.getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG);
-            if (jndiPkgPrefix!=null ) environment.setProperty(Context.URL_PKG_PREFIXES, jndiPkgPrefix);
-            
-			String jmsFactoryClass = getAttrAndWarn(tree,
-					JMSEpr.CONNECTION_FACTORY_TAG, "ConnectionFactory");
-
-			String selector = tree.getAttribute(JMSEpr.MESSAGE_SELECTOR_TAG);
-			if (Util.isNullString(selector))
-				_logger.debug("No value specified for "
-						+ JMSEpr.MESSAGE_SELECTOR_TAG + " attribute"
-						+ " -  All messages in queue <" + name
-						+ "> will be picked up by listener");
-
-			JMSEpr epr = new JMSEpr(type, name, jmsFactoryClass, environment, selector);
-
-			return epr;
-		}
-		catch (Exception e)
-		{
-			throw new ConfigurationException(e);
-		}
-	} // ________________________________
-
-	public static FileEpr fileEprFromElement(ConfigTree tree) throws ConfigurationException
-	{
-		try
-		{
-			URL url = new URL(tree.getRequiredAttribute(ListenerTagNames.URL_TAG));
-			String protocol = url.getProtocol();
-	
-			if ("file".equals(protocol))
-			{
-				if (!new File(url.getFile()).isDirectory())
-					throw new ConfigurationException("Attribute "
-							+ ListenerTagNames.URL_TAG
-							+ " must reference a directory");
-			}
-	
-			FileEpr epr = ("file".equals(protocol)) ? new FileEpr(url) : ("ftp"
-					.equals(protocol)) ? new FTPEpr(url) : null;
-			if (null == epr)
-				throw new ConfigurationException("Unsupported file protocol : "
-						+ protocol);
-	
-			String inputSuffix = tree.getAttribute(FileEpr.INPUT_SUFFIX_TAG);
-	
-			if (!Util.isNullString(inputSuffix))
-				epr.setInputSuffix(inputSuffix);
-	
-			boolean bErrorDel = Boolean.parseBoolean(getAttrAndWarn(tree,
-					FileEpr.ERROR_DEL_TAG, "true"));
-			String errorDir = tree.getAttribute(FileEpr.ERROR_DIR_TAG);
-			String errorSuffix = tree.getAttribute(FileEpr.ERROR_SUFFIX_TAG);
-			
-			if (bErrorDel)
-			{
-				if (null != errorDir || null != errorSuffix)
-					_logger
-							.warn("If you don't specify "
-									+ FileEpr.ERROR_DEL_TAG
-									+ "'false' ,"
-									+ FileEpr.ERROR_DIR_TAG
-									+ " and "
-									+ FileEpr.ERROR_SUFFIX_TAG
-									+ " will have no effect because files in error will be deleted");
-			}
-			if (null == errorDir)
-			{
-				errorDir = url.getFile();
-				warnDefault(FileEpr.ERROR_DIR_TAG, errorDir);
-			}
-			if (null == errorSuffix)
-			{
-				errorSuffix = ".esbERROR";
-				warnDefault(FileEpr.ERROR_SUFFIX_TAG, errorSuffix);
-			}
-			epr.setErrorDelete(bErrorDel);
-			epr.setErrorDirectory(errorDir);
-			epr.setErrorSuffix(errorSuffix);
-	
-			boolean bPostDel = Boolean.parseBoolean(getAttrAndWarn(tree,
-					FileEpr.POST_DEL_TAG, "true"));
-	
-			String postDir = tree.getAttribute(FileEpr.POST_DIR_TAG);
-			String postSuffix = tree.getAttribute(FileEpr.POST_SUFFIX_TAG);
-			if (bPostDel)
-			{
-				if (null != postDir || null != postSuffix)
-					_logger
-							.warn("If you don't specify "
-									+ FileEpr.POST_DEL_TAG
-									+ "'false' ,"
-									+ FileEpr.POST_DIR_TAG
-									+ " and "
-									+ FileEpr.POST_SUFFIX_TAG
-									+ " will have no effect because processed input messages will be deleted");
-			}
-			if (null == postDir)
-			{
-				postDir = url.getFile();
-				warnDefault(FileEpr.POST_DIR_TAG, postDir);
-			}
-			if (null == postSuffix)
-			{
-				postSuffix = ".esbDONE";
-				warnDefault(FileEpr.POST_SUFFIX_TAG, postSuffix);
-			}
-			epr.setPostDelete(bPostDel);
-			epr.setPostDirectory(postDir);
-			epr.setPostSuffix(postSuffix);
-	
-			if (epr instanceof FTPEpr)
-			{
-				FTPEpr ftp = (FTPEpr) epr;
-				ftp.setPassive(Boolean.valueOf(getAttrAndWarn(tree,
-						FTPEpr.PASSIVE_TAG, "false")));
-			}
-			return epr;
-		}
-		catch (URISyntaxException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-		catch (MalformedURLException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-	} // ________________________________
-
-	public static JDBCEpr jdbcEprFromElement(ConfigTree tree) throws ConfigurationException
-	{
-		String url = tree.getRequiredAttribute(JDBCEpr.URL_TAG);
-		if (!url.toLowerCase().startsWith("jdbc"))
-			throw new ConfigurationException("URL in "
-					+ ListenerTagNames.URL_TAG + " must be a jdbc URL");
-
-		try
-		{
-			boolean bPostDel = Boolean.valueOf(tree.getAttribute(
-					JDBCEpr.POST_DEL_TAG, "true"));
-			boolean bErrorDel = Boolean.valueOf(tree.getAttribute(
-					JDBCEpr.ERROR_DEL_TAG, "true"));
-			JDBCEpr epr = new JDBCEpr(url, bPostDel, bErrorDel);
-			epr.setDriver(tree.getRequiredAttribute(JDBCEpr.DRIVER_TAG));
-			epr.setUserName(getAttrAndWarn(tree, JDBCEpr.USERNAME_TAG, ""));
-			epr.setPassword(getAttrAndWarn(tree, JDBCEpr.PASSWORD_TAG, ""));
-			epr.setTableName(tree.getRequiredAttribute(JDBCEpr.TABLE_NAME_TAG));
-			epr.setMessageIdColumn(getColName(tree, JDBCEpr.MESSAGE_ID_COLUMN_TAG));
-			epr.setStatusColumn(getColName(tree, JDBCEpr.STATUS_COLUMN_TAG));
-			epr.setDataColumn(getColName(tree, JDBCEpr.DATA_COLUMN_TAG));
-			epr.setTimestampColumn(getColName(tree, JDBCEpr.TIMESTAMP_COLUMN_TAG));
-	
-			return epr;
-		}
-		catch (URISyntaxException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-	} // ________________________________
-
-	private static final String s_Sfx = "_column";
-
-	private static String getColName(ConfigTree tree, String tag)
-			throws ConfigurationException
-	{
-		String defaultColname = (tag.endsWith(s_Sfx) ? tag.substring(0, tag
-				.length()
-				- s_Sfx.length()) : null);
-		return getAttrAndWarn(tree, tag, defaultColname);
-	} // ________________________________
-
-	public static String getAttrAndWarn(ConfigTree tree, String tag,
-			String defaultValue) throws ConfigurationException
-	{
-		String value = null;
-		try
-		{
-			value = tree.getAttribute(tag);
-			if (null == value)
-				if (null == defaultValue)
-					throw new ConfigurationException("Missing or invalid "
-							+ tag + " attribute");
-				else
-				{
-					warnDefault(tag, defaultValue);
-					value = defaultValue;
-				}
-			return value;
-		}
-		catch (Exception e)
-		{
-			throw new ConfigurationException(e);
-		}
-	} // ________________________________
-
-	
-        /**
-         * Find an attribute in the tree (arg 0) or assign default value (arg 2)
-         * 
-         * @param p_oP
-         *            ConfigTree - look for attributes in this Element only
-         * @param p_sAtt
-         *            String - Name of attribute to find
-         * @param p_sDefault
-         *            String -default value if requested attribute is not there
-         * @return String - value of attribute, or default value (if null)
-         * @throws ConfigurationException -
-         *             If requested attribute not found and no default value
-         *             supplied by invoker
-         */
-        public static String obtainAtt (ConfigTree p_oP, String p_sAtt, String p_sDefault)
-                        throws ConfigurationException
-        {
-                String sVal = p_oP.getAttribute(p_sAtt);
-                if ((null == sVal) && (null == p_sDefault))
-                        throw new ConfigurationException(
-                                        "Missing or invalid <" + p_sAtt + "> attribute");
-
-                return (null != sVal) ? sVal : p_sDefault;
-        } // ________________________________
-
-	private static final boolean LOGWARN = true;
-
-	private static void warnDefault(String tag, String defaultValue)
-	{
-		if (LOGWARN)
-			_logger.debug("No value specified for " + tag + " attribute"
-					+ " -  Using default value: '" + defaultValue + "'");
-	} // ________________________________
-	
-	public static long getMaxMillisGatewayWait(ConfigTree tree, Logger logr, boolean hasResponder)
-		throws ConfigurationException
-	{
-		long maxWait = -1;
-		String sAux = tree.getAttribute(ListenerTagNames.GATEWAY_WAIT_MILLIS_TAG);
-		if (!Util.isNullString(sAux))
-		{
-			try
-			{
-				maxWait = Long.parseLong(sAux);
-				if (maxWait < 1)
-					logr.warn("Value specified for "
-							+ ListenerTagNames.GATEWAY_WAIT_MILLIS_TAG
-							+ " ("+maxWait
-							+") implies that this will be an 'inbound-only' gateway");
-				else if (! hasResponder)
-					throw new ConfigurationException(
-							"For two-way gateways (max-millis-for-response>0)"
-							+", you must specify the '"
-							+ListenerTagNames.GATEWAY_RESPONDER_METHOD_TAG
-							+"' attribute");
-			}
-			catch (NumberFormatException e)
-			{
-				throw new ConfigurationException("Invalid value for "
-						+ListenerTagNames.GATEWAY_WAIT_MILLIS_TAG,e);
-			}
-		}
-		else
-		{
-			logr.warn("No value specified for: "
-					+ ListenerTagNames.GATEWAY_WAIT_MILLIS_TAG
-					+ " -  This will be an 'inbound-only' gateway");
-		}
-		return maxWait;
-	} //________________________________
-
-	private static final Logger _logger = Logger.getLogger(ListenerUtil.class);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ListenerUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,395 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.jms.JMSException;
+import javax.naming.Context;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.Util;
+
+public class ListenerUtil
+{
+
+	private ListenerUtil()
+	{
+	}
+
+    /**
+     * For unittest/quickstart use, to deliver a message. This method closes all
+     * JmsCOnnectionPools.
+     * 
+     * @param message
+     * @param category
+     * @param name
+     * @throws MessageDeliverException
+     * @throws RegistryException
+     * @throws JMSException
+     */
+	public static void tryToDeliver(Message message, String category, String name)
+			throws MessageDeliverException, RegistryException, JMSException
+	{
+        MessageDeliveryAdapter adapter = new MessageDeliveryAdapter(category, name);
+        adapter.deliverAsync(message);
+        JmsConnectionPoolContainer.removeAllPools();
+	}
+
+	public static EPR assembleEpr(ConfigTree tree)
+			throws ConfigurationException
+	{
+		String urlString = tree.getAttribute(ListenerTagNames.URL_TAG);
+		String protocol = (null == urlString) ? tree
+				.getAttribute(ListenerTagNames.PROTOCOL_TAG) : urlString
+				.split(":")[0];
+
+		try
+		{
+			if ("jms".equals(protocol))
+				return jmsEprFromElement(tree);
+			if ("file".equals(protocol))
+				return fileEprFromElement(tree);
+			if ("ftp".equals(protocol))
+				return fileEprFromElement(tree);
+			if ("jdbc".equals(protocol))
+				return jdbcEprFromElement(tree);
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+			
+			_logger.error("Problem", e);
+			throw new ConfigurationException(e);
+		}
+
+		throw new ConfigurationException("Unknown protocol <" + protocol + ">");
+
+	} // ________________________________
+
+	public static JMSEpr jmsEprFromElement(ConfigTree tree)
+			throws ConfigurationException
+	{
+		try
+		{
+
+			String name = tree.getRequiredAttribute(JMSEpr.DESTINATION_NAME_TAG);
+            Set<String> names=tree.getAttributeNames();
+            Properties environment = new Properties();
+            for (String attributeName : names) {
+                if (attributeName.startsWith("java.naming.")) {
+                    environment.setProperty(attributeName, tree.getAttribute(attributeName));
+                }
+            }
+			String type = getAttrAndWarn(tree, JMSEpr.DESTINATION_TYPE_TAG,
+					"queue");
+			String jndiURL = tree.getAttribute(JMSEpr.JNDI_URL_TAG);
+            if (jndiURL!=null) environment.setProperty(Context.PROVIDER_URL, jndiURL);
+			String jndiContextFactory = tree.getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG);
+            if (jndiContextFactory!=null) environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, jndiContextFactory);
+			String jndiPkgPrefix = tree.getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG);
+            if (jndiPkgPrefix!=null ) environment.setProperty(Context.URL_PKG_PREFIXES, jndiPkgPrefix);
+            
+			String jmsFactoryClass = getAttrAndWarn(tree,
+					JMSEpr.CONNECTION_FACTORY_TAG, "ConnectionFactory");
+
+			String selector = tree.getAttribute(JMSEpr.MESSAGE_SELECTOR_TAG);
+			if (Util.isNullString(selector))
+				_logger.debug("No value specified for "
+						+ JMSEpr.MESSAGE_SELECTOR_TAG + " attribute"
+						+ " -  All messages in queue <" + name
+						+ "> will be picked up by listener");
+
+			JMSEpr epr = new JMSEpr(type, name, jmsFactoryClass, environment, selector);
+
+			return epr;
+		}
+		catch (Exception e)
+		{
+			throw new ConfigurationException(e);
+		}
+	} // ________________________________
+
+	public static FileEpr fileEprFromElement(ConfigTree tree) throws ConfigurationException
+	{
+		try
+		{
+			URL url = new URL(tree.getRequiredAttribute(ListenerTagNames.URL_TAG));
+			String protocol = url.getProtocol();
+	
+			if ("file".equals(protocol))
+			{
+				if (!new File(url.getFile()).isDirectory())
+					throw new ConfigurationException("Attribute "
+							+ ListenerTagNames.URL_TAG
+							+ " must reference a directory");
+			}
+	
+			FileEpr epr = ("file".equals(protocol)) ? new FileEpr(url) : ("ftp"
+					.equals(protocol)) ? new FTPEpr(url) : null;
+			if (null == epr)
+				throw new ConfigurationException("Unsupported file protocol : "
+						+ protocol);
+	
+			String inputSuffix = tree.getAttribute(FileEpr.INPUT_SUFFIX_TAG);
+	
+			if (!Util.isNullString(inputSuffix))
+				epr.setInputSuffix(inputSuffix);
+	
+			boolean bErrorDel = Boolean.parseBoolean(getAttrAndWarn(tree,
+					FileEpr.ERROR_DEL_TAG, "true"));
+			String errorDir = tree.getAttribute(FileEpr.ERROR_DIR_TAG);
+			String errorSuffix = tree.getAttribute(FileEpr.ERROR_SUFFIX_TAG);
+			
+			if (bErrorDel)
+			{
+				if (null != errorDir || null != errorSuffix)
+					_logger
+							.warn("If you don't specify "
+									+ FileEpr.ERROR_DEL_TAG
+									+ "'false' ,"
+									+ FileEpr.ERROR_DIR_TAG
+									+ " and "
+									+ FileEpr.ERROR_SUFFIX_TAG
+									+ " will have no effect because files in error will be deleted");
+			}
+			if (null == errorDir)
+			{
+				errorDir = url.getFile();
+				warnDefault(FileEpr.ERROR_DIR_TAG, errorDir);
+			}
+			if (null == errorSuffix)
+			{
+				errorSuffix = ".esbERROR";
+				warnDefault(FileEpr.ERROR_SUFFIX_TAG, errorSuffix);
+			}
+			epr.setErrorDelete(bErrorDel);
+			epr.setErrorDirectory(errorDir);
+			epr.setErrorSuffix(errorSuffix);
+	
+			boolean bPostDel = Boolean.parseBoolean(getAttrAndWarn(tree,
+					FileEpr.POST_DEL_TAG, "true"));
+	
+			String postDir = tree.getAttribute(FileEpr.POST_DIR_TAG);
+			String postSuffix = tree.getAttribute(FileEpr.POST_SUFFIX_TAG);
+			if (bPostDel)
+			{
+				if (null != postDir || null != postSuffix)
+					_logger
+							.warn("If you don't specify "
+									+ FileEpr.POST_DEL_TAG
+									+ "'false' ,"
+									+ FileEpr.POST_DIR_TAG
+									+ " and "
+									+ FileEpr.POST_SUFFIX_TAG
+									+ " will have no effect because processed input messages will be deleted");
+			}
+			if (null == postDir)
+			{
+				postDir = url.getFile();
+				warnDefault(FileEpr.POST_DIR_TAG, postDir);
+			}
+			if (null == postSuffix)
+			{
+				postSuffix = ".esbDONE";
+				warnDefault(FileEpr.POST_SUFFIX_TAG, postSuffix);
+			}
+			epr.setPostDelete(bPostDel);
+			epr.setPostDirectory(postDir);
+			epr.setPostSuffix(postSuffix);
+	
+			if (epr instanceof FTPEpr)
+			{
+				FTPEpr ftp = (FTPEpr) epr;
+				ftp.setPassive(Boolean.valueOf(getAttrAndWarn(tree,
+						FTPEpr.PASSIVE_TAG, "false")));
+			}
+			return epr;
+		}
+		catch (URISyntaxException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+		catch (MalformedURLException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+	} // ________________________________
+
+	public static JDBCEpr jdbcEprFromElement(ConfigTree tree) throws ConfigurationException
+	{
+		String url = tree.getRequiredAttribute(JDBCEpr.URL_TAG);
+		if (!url.toLowerCase().startsWith("jdbc"))
+			throw new ConfigurationException("URL in "
+					+ ListenerTagNames.URL_TAG + " must be a jdbc URL");
+
+		try
+		{
+			boolean bPostDel = Boolean.valueOf(tree.getAttribute(
+					JDBCEpr.POST_DEL_TAG, "true"));
+			boolean bErrorDel = Boolean.valueOf(tree.getAttribute(
+					JDBCEpr.ERROR_DEL_TAG, "true"));
+			JDBCEpr epr = new JDBCEpr(url, bPostDel, bErrorDel);
+			epr.setDriver(tree.getRequiredAttribute(JDBCEpr.DRIVER_TAG));
+			epr.setUserName(getAttrAndWarn(tree, JDBCEpr.USERNAME_TAG, ""));
+			epr.setPassword(getAttrAndWarn(tree, JDBCEpr.PASSWORD_TAG, ""));
+			epr.setTableName(tree.getRequiredAttribute(JDBCEpr.TABLE_NAME_TAG));
+			epr.setMessageIdColumn(getColName(tree, JDBCEpr.MESSAGE_ID_COLUMN_TAG));
+			epr.setStatusColumn(getColName(tree, JDBCEpr.STATUS_COLUMN_TAG));
+			epr.setDataColumn(getColName(tree, JDBCEpr.DATA_COLUMN_TAG));
+			epr.setTimestampColumn(getColName(tree, JDBCEpr.TIMESTAMP_COLUMN_TAG));
+	
+			return epr;
+		}
+		catch (URISyntaxException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+	} // ________________________________
+
+	private static final String s_Sfx = "_column";
+
+	private static String getColName(ConfigTree tree, String tag)
+			throws ConfigurationException
+	{
+		String defaultColname = (tag.endsWith(s_Sfx) ? tag.substring(0, tag
+				.length()
+				- s_Sfx.length()) : null);
+		return getAttrAndWarn(tree, tag, defaultColname);
+	} // ________________________________
+
+	public static String getAttrAndWarn(ConfigTree tree, String tag,
+			String defaultValue) throws ConfigurationException
+	{
+		String value = null;
+		try
+		{
+			value = tree.getAttribute(tag);
+			if (null == value)
+				if (null == defaultValue)
+					throw new ConfigurationException("Missing or invalid "
+							+ tag + " attribute");
+				else
+				{
+					warnDefault(tag, defaultValue);
+					value = defaultValue;
+				}
+			return value;
+		}
+		catch (Exception e)
+		{
+			throw new ConfigurationException(e);
+		}
+	} // ________________________________
+
+	
+        /**
+         * Find an attribute in the tree (arg 0) or assign default value (arg 2)
+         * 
+         * @param p_oP
+         *            ConfigTree - look for attributes in this Element only
+         * @param p_sAtt
+         *            String - Name of attribute to find
+         * @param p_sDefault
+         *            String -default value if requested attribute is not there
+         * @return String - value of attribute, or default value (if null)
+         * @throws ConfigurationException -
+         *             If requested attribute not found and no default value
+         *             supplied by invoker
+         */
+        public static String obtainAtt (ConfigTree p_oP, String p_sAtt, String p_sDefault)
+                        throws ConfigurationException
+        {
+                String sVal = p_oP.getAttribute(p_sAtt);
+                if ((null == sVal) && (null == p_sDefault))
+                        throw new ConfigurationException(
+                                        "Missing or invalid <" + p_sAtt + "> attribute");
+
+                return (null != sVal) ? sVal : p_sDefault;
+        } // ________________________________
+
+	private static final boolean LOGWARN = true;
+
+	private static void warnDefault(String tag, String defaultValue)
+	{
+		if (LOGWARN)
+			_logger.debug("No value specified for " + tag + " attribute"
+					+ " -  Using default value: '" + defaultValue + "'");
+	} // ________________________________
+	
+	public static long getMaxMillisGatewayWait(ConfigTree tree, Logger logr, boolean hasResponder)
+		throws ConfigurationException
+	{
+		long maxWait = -1;
+		String sAux = tree.getAttribute(ListenerTagNames.GATEWAY_WAIT_MILLIS_TAG);
+		if (!Util.isNullString(sAux))
+		{
+			try
+			{
+				maxWait = Long.parseLong(sAux);
+				if (maxWait < 1)
+					logr.warn("Value specified for "
+							+ ListenerTagNames.GATEWAY_WAIT_MILLIS_TAG
+							+ " ("+maxWait
+							+") implies that this will be an 'inbound-only' gateway");
+				else if (! hasResponder)
+					throw new ConfigurationException(
+							"For two-way gateways (max-millis-for-response>0)"
+							+", you must specify the '"
+							+ListenerTagNames.GATEWAY_RESPONDER_METHOD_TAG
+							+"' attribute");
+			}
+			catch (NumberFormatException e)
+			{
+				throw new ConfigurationException("Invalid value for "
+						+ListenerTagNames.GATEWAY_WAIT_MILLIS_TAG,e);
+			}
+		}
+		else
+		{
+			logr.warn("No value specified for: "
+					+ ListenerTagNames.GATEWAY_WAIT_MILLIS_TAG
+					+ " -  This will be an 'inbound-only' gateway");
+		}
+		return maxWait;
+	} //________________________________
+
+	private static final Logger _logger = Logger.getLogger(ListenerUtil.class);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,230 +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;
-
-import java.io.IOException;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.apache.log4j.Logger;
-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.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
-
-import com.arjuna.common.util.propertyservice.PropertyManager;
-
-/**
- * Extraction of common registry utility methods.
- * @author kevin
- */
-public class RegistryUtil
-{
-    /**
-     * The logger for this class.
-     */
-    private static final Logger logger = Logger.getLogger(RegistryUtil.class) ;
-
-    /**
-     * The lock for the registry.
-     */
-    private static final Lock registryLock = new ReentrantLock() ;
-    
-    /**
-     * Get the EPR manager.
-     * @return The EPR manager.
-     */
-    public static EPRManager getEprManager()
-    {
-        final PropertyManager manager = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE) ;
-        final String dir = manager.getProperty(Environment.REGISTRY_FILE_HELPER_DIR, ".") ;
-        return EPRManager.getInstance(dir) ;
-    }
-
-    /**
-     * Register a service with the EPR manager.
-     * @param name The service name
-     * @param address The service address
-     * @throws RegistryException for registration errors.
-     */
-    private static void register(final String name, final EPR address)
-        throws RegistryException
-    {
-        try
-        {
-            getEprManager().saveEPR(name, address) ;
-        }
-        catch (final IOException ioe)
-        {
-            logger.error("Cannot register service", ioe) ;
-            throw new RegistryException("Cannot register service", ioe) ;
-        }
-    }
-
-    /**
-     * Unregister a service with the EPR manager.
-     * @param name The service name
-     */
-    private static void unregister(final String name)
-    {
-        try
-        {
-            getEprManager().removeEPR(name) ;
-        }
-        catch (final IOException ioe)
-        {
-            logger.warn("Failed to unregister service", ioe) ;
-        }
-    }
-
-    /**
-     * 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 for registration errors.
-     */
-    public static void register(final ConfigTree config, final EPR epr)
-        throws RegistryException
-    {
-        final String category = config.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG) ;
-        final String name = config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG) ;
-
-        if ("eprManager".equalsIgnoreCase(category))
-        {
-            register(name, epr) ;
-        }
-        else
-        {
-            final String serviceDescription = config.getAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG) ;
-            final String eprDescription = config.getAttribute(ListenerTagNames.EPR_DESCRIPTION_TAG) ;
-            final Registry registry = RegistryFactory.getRegistry() ;
-
-            if (logger.isDebugEnabled())
-            {
-                logger.debug("Registering < " + name + ", " + epr + " >") ;
-            }
-
-            registryLock.lock();
-            try
-            {
-                registry.registerEPR(category, name,
-                    serviceDescription, epr, eprDescription) ;
-            }
-            finally
-            {
-                registryLock.unlock() ;
-            }
-        }
-    }
-
-    /**
-     * Unregister the EPR from the registry.
-     * 
-     * @param category The category name of the service
-     * @param name The name of the service
-     * @param epr The service EPR.
-     */
-    public static void unregister(final String category, final String name, final EPR epr)
-    {
-        if ("eprManager".equalsIgnoreCase(category))
-        {
-            unregister(name) ;
-        }
-        else
-        {
-            registryLock.lock() ;
-            try
-            {
-                final Registry registry = RegistryFactory.getRegistry() ;
-                registry.unRegisterEPR(category, name, epr) ;
-            }
-            catch (final RegistryException re)
-            {
-                logger.warn("Failed to unregister service", re) ;
-            }
-            finally
-            {
-                registryLock.unlock() ;
-            }
-        }
-    }
-
-    /**
-     * Get the EPRs associated with the specified service.
-     * @param category The category name of the service
-     * @param name The name of the service
-     * @return The collection of EPRs associated with the specified service.
-     * 
-     * @throws RegistryException for registration errors.
-     */
-    public static Collection<EPR> getEprs(final String category, final String name)
-            throws RegistryException
-    {
-        if ("eprManager".equalsIgnoreCase(category))
-        {
-            final EPR epr ;
-            try
-            {
-                epr = getEprManager().loadEPR(name) ;
-            }
-            catch (final IOException ioe)
-            {
-                throw new RegistryException("No EPRs found for <" + category
-                    + "><" + name + ">") ;
-            }
-            return Arrays.asList(new EPR[] {epr}) ;
-        }
-
-        final Registry reg = RegistryFactory.getRegistry() ;
-        RegistryException eReg = null ;
-        for (int count = 0; count < 5; count++)
-        {
-            try
-            {
-                return reg.findEPRs(category, name) ;
-            }
-            catch (final RegistryException re)
-            {
-                if (null == eReg)
-                    eReg = re ;
-                try
-                {
-                    Thread.sleep(500) ;  // TODO magic number
-                }
-                catch (final InterruptedException ie)
-                {
-                    break ;
-                }
-            }
-        }
-        throw eReg ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/RegistryUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,230 @@
+/*
+ * 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;
+
+import java.io.IOException;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.apache.log4j.Logger;
+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.services.registry.Registry;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.RegistryFactory;
+
+import com.arjuna.common.util.propertyservice.PropertyManager;
+
+/**
+ * Extraction of common registry utility methods.
+ * @author kevin
+ */
+public class RegistryUtil
+{
+    /**
+     * The logger for this class.
+     */
+    private static final Logger logger = Logger.getLogger(RegistryUtil.class) ;
+
+    /**
+     * The lock for the registry.
+     */
+    private static final Lock registryLock = new ReentrantLock() ;
+    
+    /**
+     * Get the EPR manager.
+     * @return The EPR manager.
+     */
+    public static EPRManager getEprManager()
+    {
+        final PropertyManager manager = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE) ;
+        final String dir = manager.getProperty(Environment.REGISTRY_FILE_HELPER_DIR, ".") ;
+        return EPRManager.getInstance(dir) ;
+    }
+
+    /**
+     * Register a service with the EPR manager.
+     * @param name The service name
+     * @param address The service address
+     * @throws RegistryException for registration errors.
+     */
+    private static void register(final String name, final EPR address)
+        throws RegistryException
+    {
+        try
+        {
+            getEprManager().saveEPR(name, address) ;
+        }
+        catch (final IOException ioe)
+        {
+            logger.error("Cannot register service", ioe) ;
+            throw new RegistryException("Cannot register service", ioe) ;
+        }
+    }
+
+    /**
+     * Unregister a service with the EPR manager.
+     * @param name The service name
+     */
+    private static void unregister(final String name)
+    {
+        try
+        {
+            getEprManager().removeEPR(name) ;
+        }
+        catch (final IOException ioe)
+        {
+            logger.warn("Failed to unregister service", ioe) ;
+        }
+    }
+
+    /**
+     * 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 for registration errors.
+     */
+    public static void register(final ConfigTree config, final EPR epr)
+        throws RegistryException
+    {
+        final String category = config.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG) ;
+        final String name = config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG) ;
+
+        if ("eprManager".equalsIgnoreCase(category))
+        {
+            register(name, epr) ;
+        }
+        else
+        {
+            final String serviceDescription = config.getAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG) ;
+            final String eprDescription = config.getAttribute(ListenerTagNames.EPR_DESCRIPTION_TAG) ;
+            final Registry registry = RegistryFactory.getRegistry() ;
+
+            if (logger.isDebugEnabled())
+            {
+                logger.debug("Registering < " + name + ", " + epr + " >") ;
+            }
+
+            registryLock.lock();
+            try
+            {
+                registry.registerEPR(category, name,
+                    serviceDescription, epr, eprDescription) ;
+            }
+            finally
+            {
+                registryLock.unlock() ;
+            }
+        }
+    }
+
+    /**
+     * Unregister the EPR from the registry.
+     * 
+     * @param category The category name of the service
+     * @param name The name of the service
+     * @param epr The service EPR.
+     */
+    public static void unregister(final String category, final String name, final EPR epr)
+    {
+        if ("eprManager".equalsIgnoreCase(category))
+        {
+            unregister(name) ;
+        }
+        else
+        {
+            registryLock.lock() ;
+            try
+            {
+                final Registry registry = RegistryFactory.getRegistry() ;
+                registry.unRegisterEPR(category, name, epr) ;
+            }
+            catch (final RegistryException re)
+            {
+                logger.warn("Failed to unregister service", re) ;
+            }
+            finally
+            {
+                registryLock.unlock() ;
+            }
+        }
+    }
+
+    /**
+     * Get the EPRs associated with the specified service.
+     * @param category The category name of the service
+     * @param name The name of the service
+     * @return The collection of EPRs associated with the specified service.
+     * 
+     * @throws RegistryException for registration errors.
+     */
+    public static Collection<EPR> getEprs(final String category, final String name)
+            throws RegistryException
+    {
+        if ("eprManager".equalsIgnoreCase(category))
+        {
+            final EPR epr ;
+            try
+            {
+                epr = getEprManager().loadEPR(name) ;
+            }
+            catch (final IOException ioe)
+            {
+                throw new RegistryException("No EPRs found for <" + category
+                    + "><" + name + ">") ;
+            }
+            return Arrays.asList(new EPR[] {epr}) ;
+        }
+
+        final Registry reg = RegistryFactory.getRegistry() ;
+        RegistryException eReg = null ;
+        for (int count = 0; count < 5; count++)
+        {
+            try
+            {
+                return reg.findEPRs(category, name) ;
+            }
+            catch (final RegistryException re)
+            {
+                if (null == eReg)
+                    eReg = re ;
+                try
+                {
+                    Thread.sleep(500) ;  // TODO magic number
+                }
+                catch (final InterruptedException ie)
+                {
+                    break ;
+                }
+            }
+        }
+        throw eReg ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,110 +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;
-
-import java.util.Collection;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-
-/**
- * At initialization, this object looks up target EPR for a given service/category.
- * The postMessage method invokes on a target EPR.
- *
- * This class is really for use with Gateways, but could be used by clients to pre-initialize a service lookup
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class ServiceInvoker
-{
-   private String name;
-   private String category;
-
-   private Collection<EPR> targetEprs;
-
-
-   public String getName()
-   {
-      return name;
-   }
-
-   public void setName(String name)
-   {
-      this.name = name;
-   }
-
-   public String getCategory()
-   {
-      return category;
-   }
-
-   public void setCategory(String category)
-   {
-      this.category = category;
-   }
-
-   public void start()
-   {
-      try
-      {
-          targetEprs = RegistryUtil.getEprs(category, name);
-      }
-      catch (final RegistryException re)
-      {
-          throw new RuntimeException("Unexpected registry exception", re) ;
-      }
-
-   }
-
-   public void postMessage(Message message) throws CourierException, MalformedEPRException
-   {
-      boolean bSent = false;
-      for (EPR current : targetEprs)
-      {
-         Courier courier = CourierFactory.getCourier(current);
-         try
-         {
-            if (courier.deliver(message))
-            {
-               bSent = true;
-               break;
-            }
-         }
-         finally
-         {
-            CourierUtil.cleanCourier(courier);
-         }
-      }
-      if (!bSent)
-      {
-         String text = "Target service <" + category + "," + name + "> is not registered";
-         throw new CourierException(text);
-      }
-   }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/ServiceInvoker.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,110 @@
+/*
+* 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;
+
+import java.util.Collection;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+
+/**
+ * At initialization, this object looks up target EPR for a given service/category.
+ * The postMessage method invokes on a target EPR.
+ *
+ * This class is really for use with Gateways, but could be used by clients to pre-initialize a service lookup
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class ServiceInvoker
+{
+   private String name;
+   private String category;
+
+   private Collection<EPR> targetEprs;
+
+
+   public String getName()
+   {
+      return name;
+   }
+
+   public void setName(String name)
+   {
+      this.name = name;
+   }
+
+   public String getCategory()
+   {
+      return category;
+   }
+
+   public void setCategory(String category)
+   {
+      this.category = category;
+   }
+
+   public void start()
+   {
+      try
+      {
+          targetEprs = RegistryUtil.getEprs(category, name);
+      }
+      catch (final RegistryException re)
+      {
+          throw new RuntimeException("Unexpected registry exception", re) ;
+      }
+
+   }
+
+   public void postMessage(Message message) throws CourierException, MalformedEPRException
+   {
+      boolean bSent = false;
+      for (EPR current : targetEprs)
+      {
+         Courier courier = CourierFactory.getCourier(current);
+         try
+         {
+            if (courier.deliver(message))
+            {
+               bSent = true;
+               break;
+            }
+         }
+         finally
+         {
+            CourierUtil.cleanCourier(courier);
+         }
+      }
+      if (!bSent)
+      {
+         String text = "Target service <" + category + "," + name + "> is not registered";
+         throw new CourierException(text);
+      }
+   }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/StandAloneBootStrapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/StandAloneBootStrapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/StandAloneBootStrapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,208 +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;
-
-import java.io.File;
-
-import org.apache.log4j.Logger;
-import org.apache.log4j.xml.DOMConfigurator;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.listeners.config.ConfigurationController;
-
-public class StandAloneBootStrapper
-{
-	private ConfigurationController _confController;
-
-	private static Logger _logger = Logger
-			.getLogger(StandAloneBootStrapper.class);
-
-	public static void main (String[] args) throws Exception
-	{
-        System.out.println("+----------------------------------------------------------+");
-        System.out.println("|                                                          |");
-        System.out.println("|     Starting JBossESB...                                 |");
-        System.out.println("|                                                          |");
-        System.out.println("+----------------------------------------------------------+");
-        
-		Exception eT = null;
-		if (args.length < 1)
-		{
-			eT = new Exception(
-					"No configuration file specified - Ending immediately");
-			_logger.fatal(eT);
-			throw eT;
-		}
-
-		String configName = args[0];
-        File configFile = new File(configName);
-        if (configFile.exists()) {
-           System.out.println("Reading config from " + configFile.getAbsolutePath());
-            String loggerConfig = configFile.getParent() + "/log4j.xml";
-            DOMConfigurator.configure(loggerConfig);
-        } else {
-            
-        }
-        
-		long lSecondsToRun = 365 * 24 * 3600; // run for 1 year (is it enough
-												// ?)
-		if (args.length > 1) try
-		{
-			lSecondsToRun = Long.parseLong(args[1]);
-		}
-		catch (Exception e)
-		{
-			_logger.fatal(e);
-			throw e;
-		}
-			final StandAloneBootStrapper boot = new StandAloneBootStrapper(configName);
-                        final Thread hook = new Thread() {
-                            @Override
-                            public void run() {
-                                System.out.println("+----------------------------------------------------------+");
-                                System.out.println("|                                                          |");
-                                System.out.println("|     Stopping JBossESB...                                 |");
-                                System.out.println("|                                                          |");
-                                System.out.println("+----------------------------------------------------------+");
-                                boot.requestEnd() ;
-                            }
-                        } ;
-                        Runtime.getRuntime().addShutdownHook(hook) ;
-			if (lSecondsToRun < 5) lSecondsToRun = 5;
-			long lRunTo = System.currentTimeMillis() + 1000 * lSecondsToRun;
-
-			while (System.currentTimeMillis() < lRunTo)
-			{
-				try
-				{
-					Thread.sleep(1000);
-				}
-				catch (InterruptedException e)
-				{
-					break;
-				}
-			}
-	}
-
-	public StandAloneBootStrapper (String configName) throws ConfigurationException
-	{
-		this(configName, null);
-	}
-
-	public StandAloneBootStrapper (String configName, String validationFileName)
-			throws ConfigurationException
-	{
-        System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
-		runBefore();
-
-		// TODO hardwired names?
-
-		String listenerConfig = "jbossesb-listener.xml";
-		String gatewayConfig = "jbossesb-gateway.xml";
-
-		try
-		{
-			File configFile = new File(configName);
-			String sParent = configFile.getParent();
-			if (null == sParent) sParent = new File("").getAbsolutePath();
-			else
-				if (sParent.endsWith("/.") || sParent.endsWith("\\."))
-					sParent = sParent.substring(0, -2 + sParent.length());
-			configFile = new File(sParent, configFile.getName());
-
-			_confController = initiateController(configFile.getAbsolutePath(),
-					validationFileName, gatewayConfig, listenerConfig);
-
-                        _logger.info("Listeners Ready");
-		}
-		catch (ConfigurationException ex)
-		{
-			requestEnd();
-			
-			throw ex;
-		}
-		catch (Exception ex)
-		{
-			requestEnd();
-			
-			throw new ConfigurationException("Cannot instantiate "+this.getClass().getSimpleName(),ex);
-		}
-
-	} // ________________________________
-
-	public void requestEnd ()
-	{
-		if (_confController != null)
-                {
-                    _confController.requestEnd();
-                    _confController.waitUntilEnded() ;
-                }
-		runAfter();
-	} // ________________________________
-
-	protected void runBefore ()
-	{
-	} // placeholder for classes that extend this bootstrapper
-
-	protected void runAfter ()
-	{
-	} // placeholder for classes that extend this bootstrapper
-
-	public ConfigurationController initiateController (String configName,
-			String validationName, String gwConf, String esbConf)
-			throws ConfigurationException
-	{
-		if (null == configName)
-			throw new IllegalArgumentException(
-					"Null configuration file specified");
-
-		File configFile = new File(configName);
-		if (!configFile.exists())
-			throw new IllegalArgumentException(
-					"Missing esb configuration file: " + configFile);
-
-		// Remove the listener and gateway configuration files if the exist
-		File configDir = configFile.getParentFile();
-		if (null == configDir) configDir = new File("");
-		File listenerFile = new File(configDir, esbConf);
-		if (listenerFile.exists())
-		{
-			listenerFile.delete();
-		}
-		File gatewayFile = new File(configDir, gwConf);
-		if (gatewayFile.exists())
-		{
-			gatewayFile.delete();
-		}
-
-		ConfigurationController conf = new ConfigurationController(configFile
-				.toString(), validationName);
-		if (listenerFile.exists() && gatewayFile.exists())
-		{
-                    new Thread(conf).start() ;
-                    return conf;
-		}
-
-		throw new ConfigurationException(
-				"Unable to generate gateway and listener configurations");
-	} // ________________________________
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/StandAloneBootStrapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/StandAloneBootStrapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/StandAloneBootStrapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/StandAloneBootStrapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,208 @@
+/*
+ * 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;
+
+import java.io.File;
+
+import org.apache.log4j.Logger;
+import org.apache.log4j.xml.DOMConfigurator;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.listeners.config.ConfigurationController;
+
+public class StandAloneBootStrapper
+{
+	private ConfigurationController _confController;
+
+	private static Logger _logger = Logger
+			.getLogger(StandAloneBootStrapper.class);
+
+	public static void main (String[] args) throws Exception
+	{
+        System.out.println("+----------------------------------------------------------+");
+        System.out.println("|                                                          |");
+        System.out.println("|     Starting JBossESB...                                 |");
+        System.out.println("|                                                          |");
+        System.out.println("+----------------------------------------------------------+");
+        
+		Exception eT = null;
+		if (args.length < 1)
+		{
+			eT = new Exception(
+					"No configuration file specified - Ending immediately");
+			_logger.fatal(eT);
+			throw eT;
+		}
+
+		String configName = args[0];
+        File configFile = new File(configName);
+        if (configFile.exists()) {
+           System.out.println("Reading config from " + configFile.getAbsolutePath());
+            String loggerConfig = configFile.getParent() + "/log4j.xml";
+            DOMConfigurator.configure(loggerConfig);
+        } else {
+            
+        }
+        
+		long lSecondsToRun = 365 * 24 * 3600; // run for 1 year (is it enough
+												// ?)
+		if (args.length > 1) try
+		{
+			lSecondsToRun = Long.parseLong(args[1]);
+		}
+		catch (Exception e)
+		{
+			_logger.fatal(e);
+			throw e;
+		}
+			final StandAloneBootStrapper boot = new StandAloneBootStrapper(configName);
+                        final Thread hook = new Thread() {
+                            @Override
+                            public void run() {
+                                System.out.println("+----------------------------------------------------------+");
+                                System.out.println("|                                                          |");
+                                System.out.println("|     Stopping JBossESB...                                 |");
+                                System.out.println("|                                                          |");
+                                System.out.println("+----------------------------------------------------------+");
+                                boot.requestEnd() ;
+                            }
+                        } ;
+                        Runtime.getRuntime().addShutdownHook(hook) ;
+			if (lSecondsToRun < 5) lSecondsToRun = 5;
+			long lRunTo = System.currentTimeMillis() + 1000 * lSecondsToRun;
+
+			while (System.currentTimeMillis() < lRunTo)
+			{
+				try
+				{
+					Thread.sleep(1000);
+				}
+				catch (InterruptedException e)
+				{
+					break;
+				}
+			}
+	}
+
+	public StandAloneBootStrapper (String configName) throws ConfigurationException
+	{
+		this(configName, null);
+	}
+
+	public StandAloneBootStrapper (String configName, String validationFileName)
+			throws ConfigurationException
+	{
+        System.setProperty("javax.xml.registry.ConnectionFactoryClass","org.apache.ws.scout.registry.ConnectionFactoryImpl");
+		runBefore();
+
+		// TODO hardwired names?
+
+		String listenerConfig = "jbossesb-listener.xml";
+		String gatewayConfig = "jbossesb-gateway.xml";
+
+		try
+		{
+			File configFile = new File(configName);
+			String sParent = configFile.getParent();
+			if (null == sParent) sParent = new File("").getAbsolutePath();
+			else
+				if (sParent.endsWith("/.") || sParent.endsWith("\\."))
+					sParent = sParent.substring(0, -2 + sParent.length());
+			configFile = new File(sParent, configFile.getName());
+
+			_confController = initiateController(configFile.getAbsolutePath(),
+					validationFileName, gatewayConfig, listenerConfig);
+
+                        _logger.info("Listeners Ready");
+		}
+		catch (ConfigurationException ex)
+		{
+			requestEnd();
+			
+			throw ex;
+		}
+		catch (Exception ex)
+		{
+			requestEnd();
+			
+			throw new ConfigurationException("Cannot instantiate "+this.getClass().getSimpleName(),ex);
+		}
+
+	} // ________________________________
+
+	public void requestEnd ()
+	{
+		if (_confController != null)
+                {
+                    _confController.requestEnd();
+                    _confController.waitUntilEnded() ;
+                }
+		runAfter();
+	} // ________________________________
+
+	protected void runBefore ()
+	{
+	} // placeholder for classes that extend this bootstrapper
+
+	protected void runAfter ()
+	{
+	} // placeholder for classes that extend this bootstrapper
+
+	public ConfigurationController initiateController (String configName,
+			String validationName, String gwConf, String esbConf)
+			throws ConfigurationException
+	{
+		if (null == configName)
+			throw new IllegalArgumentException(
+					"Null configuration file specified");
+
+		File configFile = new File(configName);
+		if (!configFile.exists())
+			throw new IllegalArgumentException(
+					"Missing esb configuration file: " + configFile);
+
+		// Remove the listener and gateway configuration files if the exist
+		File configDir = configFile.getParentFile();
+		if (null == configDir) configDir = new File("");
+		File listenerFile = new File(configDir, esbConf);
+		if (listenerFile.exists())
+		{
+			listenerFile.delete();
+		}
+		File gatewayFile = new File(configDir, gwConf);
+		if (gatewayFile.exists())
+		{
+			gatewayFile.delete();
+		}
+
+		ConfigurationController conf = new ConfigurationController(configFile
+				.toString(), validationName);
+		if (listenerFile.exists() && gatewayFile.exists())
+		{
+                    new Thread(conf).start() ;
+                    return conf;
+		}
+
+		throw new ConfigurationException(
+				"Unable to generate gateway and listener configurations");
+	} // ________________________________
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/State.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/State.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/State.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,39 +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 state. 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public enum State {
-	Uninitialised, Loading_parameters, Running, Ready, Shutting_down, Done_OK, Exception_thrown;
-	
-	/**
-	 * Is this state instance in one of the states leading up to (but not including) the "Ready" state.
-	 * @return True if this state instance in one of the states leading up to (but not including)
-	 *  the "Ready" state, otherwise false.
-	 */
-	public boolean isGettingReady() {
-		return (this.ordinal() < Ready.ordinal());
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/State.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/State.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/State.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/State.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,39 @@
+/*
+ * 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 state. 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public enum State {
+	Uninitialised, Loading_parameters, Running, Ready, Shutting_down, Done_OK, Exception_thrown;
+	
+	/**
+	 * Is this state instance in one of the states leading up to (but not including) the "Ready" state.
+	 * @return True if this state instance in one of the states leading up to (but not including)
+	 *  the "Ready" state, otherwise false.
+	 */
+	public boolean isGettingReady() {
+		return (this.ordinal() < Ready.ordinal());
+	}
+}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,122 +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.config;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.net.URL;
-import java.util.List;
-
-import javax.xml.transform.stream.StreamSource;
-
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.LifecycleUtil;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.xml.sax.InputSource;
-
-/**
- * comment
- *
- * @author <a href="kurt.stam at jboss.com">Kurt Stam</a>
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class Configuration
-{
-   private static final String JBOSSESB_XSD = "/jbossesb-1.0.1.xsd";
-
-   public static String getStringFromStream(InputStream is) throws Exception
-   {
-      byte[] bytes = StreamUtils.readStream(is);
-      return new String(bytes, "UTF-8");
-   }
-
-   public static ManagedLifecycleController create(URL jbossEsbXml)
-   {
-      String configXml = null;
-      try
-      {
-         configXml = getStringFromStream(jbossEsbXml.openStream());
-         return create(configXml);
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException("Failed to load jbossesb.xml file: " + jbossEsbXml, e);
-      }
-   }
-
-   public static ManagedLifecycleController create(String configXml)
-   {
-      InputStream validationInputStream = ClassUtil.getResourceAsStream(JBOSSESB_XSD, Configuration.class);
-      //if this fails try using the
-      if (validationInputStream == null)
-      {
-         throw new IllegalStateException("ESB validation file [" + JBOSSESB_XSD + "] not found.");
-      }
-      StreamSource validationInputSource = new StreamSource(validationInputStream);
-
-      try
-      {
-         InputSource xmlInputSource = new InputSource(new StringReader(configXml));
-         XmlValidator validator = new XmlValidatorImpl();
-         if (validator.validate(xmlInputSource, validationInputSource))
-         {
-            ByteArrayOutputStream listenerXml = new ByteArrayOutputStream();
-            ByteArrayOutputStream gatewayXml = new ByteArrayOutputStream();
-            Generator generator = new Generator(new ByteArrayInputStream(configXml.getBytes()), listenerXml, gatewayXml);
-            generator.generate();
-            byte[] listenerBytes = listenerXml.toByteArray();
-            //System.out.println("*************** listenerBytes: " + new String(listenerBytes));
-            ByteArrayInputStream listenerIs = new ByteArrayInputStream(listenerBytes);
-            ConfigTree listenerConfig = ConfigTree.fromInputStream(listenerIs);
-            List<ManagedLifecycle> instances = LifecycleUtil.getListeners(listenerConfig);
-
-            byte[] gatewayBytes = gatewayXml.toByteArray();
-            //System.out.println("*************** gatewayBytes: " + new String(gatewayBytes));
-            ByteArrayInputStream gatewayIs = new ByteArrayInputStream(gatewayBytes);
-            ConfigTree gatewayConfig = ConfigTree.fromInputStream(gatewayIs);
-            instances.addAll(LifecycleUtil.getGateways(gatewayConfig));
-
-             ManagedLifecycleController controller = new ManagedLifecycleController(instances);
-
-             // In parallel, create a map of the contract publication info...
-             ServicePublisher.addServicePublishers(controller, generator.getModel());
-
-            return controller;
-         }
-         else
-         {
-            throw new IllegalStateException("ESB file had validation errors.");
-
-         }
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Configuration.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,122 @@
+/*
+* 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.config;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.net.URL;
+import java.util.List;
+
+import javax.xml.transform.stream.StreamSource;
+
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.LifecycleUtil;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.xml.sax.InputSource;
+
+/**
+ * comment
+ *
+ * @author <a href="kurt.stam at jboss.com">Kurt Stam</a>
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class Configuration
+{
+   private static final String JBOSSESB_XSD = "/jbossesb-1.0.1.xsd";
+
+   public static String getStringFromStream(InputStream is) throws Exception
+   {
+      byte[] bytes = StreamUtils.readStream(is);
+      return new String(bytes, "UTF-8");
+   }
+
+   public static ManagedLifecycleController create(URL jbossEsbXml)
+   {
+      String configXml = null;
+      try
+      {
+         configXml = getStringFromStream(jbossEsbXml.openStream());
+         return create(configXml);
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException("Failed to load jbossesb.xml file: " + jbossEsbXml, e);
+      }
+   }
+
+   public static ManagedLifecycleController create(String configXml)
+   {
+      InputStream validationInputStream = ClassUtil.getResourceAsStream(JBOSSESB_XSD, Configuration.class);
+      //if this fails try using the
+      if (validationInputStream == null)
+      {
+         throw new IllegalStateException("ESB validation file [" + JBOSSESB_XSD + "] not found.");
+      }
+      StreamSource validationInputSource = new StreamSource(validationInputStream);
+
+      try
+      {
+         InputSource xmlInputSource = new InputSource(new StringReader(configXml));
+         XmlValidator validator = new XmlValidatorImpl();
+         if (validator.validate(xmlInputSource, validationInputSource))
+         {
+            ByteArrayOutputStream listenerXml = new ByteArrayOutputStream();
+            ByteArrayOutputStream gatewayXml = new ByteArrayOutputStream();
+            Generator generator = new Generator(new ByteArrayInputStream(configXml.getBytes()), listenerXml, gatewayXml);
+            generator.generate();
+            byte[] listenerBytes = listenerXml.toByteArray();
+            //System.out.println("*************** listenerBytes: " + new String(listenerBytes));
+            ByteArrayInputStream listenerIs = new ByteArrayInputStream(listenerBytes);
+            ConfigTree listenerConfig = ConfigTree.fromInputStream(listenerIs);
+            List<ManagedLifecycle> instances = LifecycleUtil.getListeners(listenerConfig);
+
+            byte[] gatewayBytes = gatewayXml.toByteArray();
+            //System.out.println("*************** gatewayBytes: " + new String(gatewayBytes));
+            ByteArrayInputStream gatewayIs = new ByteArrayInputStream(gatewayBytes);
+            ConfigTree gatewayConfig = ConfigTree.fromInputStream(gatewayIs);
+            instances.addAll(LifecycleUtil.getGateways(gatewayConfig));
+
+             ManagedLifecycleController controller = new ManagedLifecycleController(instances);
+
+             // In parallel, create a map of the contract publication info...
+             ServicePublisher.addServicePublishers(controller, generator.getModel());
+
+            return controller;
+         }
+         else
+         {
+            throw new IllegalStateException("ESB file had validation errors.");
+
+         }
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,392 +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.config;
-
-import java.io.ByteArrayInputStream;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.InputStream;
-import java.io.StringReader;
-import java.util.Date;
-import java.util.List;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.listeners.LifecycleUtil;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.xml.sax.InputSource;
-
-/**
- * The controller monitors changes in the jbossesb configuration file call jbossesb.xml. When
- * changes are detected it validates the XML, and when it passes validation it goes on and
- * generates the jbossesb-listener.xml and jbossesb-gateway.xml.
- * 
- * @author kstam
- *
- */
-public class ConfigurationController implements Runnable
-{
-	private static final int SLEEP_MILLIS       = 1000; // default interval between parameter reloads
-        private static final int ENDED_MILLIS       = 20000; // default interval between parameter reloads
-	private static final String JBOSSESB_XSD = "/jbossesb-1.0.1.xsd";
-	private final Logger mLogger = Logger.getLogger(this.getClass());
-        private final Lock endedLock = new ReentrantLock() ;
-        private final Condition endedChanged = endedLock.newCondition() ;
-        private final Condition endRequested = endedLock.newCondition() ;
-	private final String mConfigFileName;
-	private final String mValidationFileName;
-	private final File mConfigDirectory;
-        private final String mListenerConfigFile;
-        private final String mGatewayConfigFile;
-	private long mPreviousFileTimestamp;
-	private boolean mIsEndRequested;
-	private boolean ended;
-    private ManagedLifecycleController controller ;
-
-    /**
-	 * Start the Controller externally.
-	 * @param args - arg[0] - the parameter file name
-	 */
-	
-	public static void main(String[] args)
-	{
-		ConfigurationController configurationController = new ConfigurationController(args[0],null);
-		configurationController.run();
-	}
-	/**
-	 * Construct a Configuration Manager from the named repository based
-	 * configuration. The default jbossesb-1.0.1.xsd will be used for validation.
-	 * 
-	 * @param configFileName - Name of the configuration repository.
-	 *   
-	 */
-	public ConfigurationController(String configFileName)
-	{
-		this(configFileName, null);
-	}
-	/**
-	 * Construct a Configuration Manager from the named repository based
-	 * configuration.
-	 * 
-	 * @param configFileName - Name of the configuration repository.
-	 * @param validationFileName - Name of the file name used for validation (xsd or dtd).
-	 *   
-	 */
-	public ConfigurationController(String configFileName, String validationFileName)
-	{
-		mConfigFileName = configFileName;
-		File configFile = new File(configFileName);
-		File parent = configFile.getParentFile();
-		mConfigDirectory = (null!=parent) ? parent : new File("");
-                final File listenerConfigFile = new File(mConfigDirectory, Generator.ESB_CONFIG_XML_FILE) ;
-                mListenerConfigFile = listenerConfigFile.getAbsolutePath() ;
-                final File gatewayConfigFile = new File(mConfigDirectory, Generator.ESB_CONFIG_GATEWAY_XML_FILE) ;
-                mGatewayConfigFile = gatewayConfigFile.getAbsolutePath() ;
-		//Try to obtain a handle to the validation file (xsd)
-		if (validationFileName==null) {
-			mValidationFileName=JBOSSESB_XSD;
-		} else {
-			mValidationFileName = validationFileName;
-		}
-
-		processConfiguration() ;
-	}
-    /**
-     * Thread that observes the configuration (file). If the configuration is updated it is
-     * validated and new set jbossesb-listener.xml and jbossesb-gateway.xml is created for the
-     * current server.
-     */
- 	public void run() 
-	{
-		mLogger.info("Configuration Controller instance started.");
-		try {
-			if (mConfigFileName!=null) {
-                                do {
-					processConfiguration() ;
-				} while(!waitForRequestedEnd(SLEEP_MILLIS)) ;
-                                stopController() ;
-			} else {
-				mLogger.fatal("The name of the configuran file was null: " + mConfigFileName);
-			}
-		} finally {
-			mLogger.info("Exiting Config Controller...");
-			setEnded(true) ;
-		}
-	}
-
-	/**
-	 * Has the controller instance ended.
-	 * @return True if this controller instance has ended, otherwise false..
-	 */
-	public boolean hasEnded() {
-            endedLock.lock() ;
-            try
-            {
-		return ended ;
-            }
-            finally
-            {
-                endedLock.unlock() ;
-            }
-	}
-        
-        /**
-         * Set the ended flag.
-         * @param ended The value of the ended flag.
-         */
-        private void setEnded(final boolean ended)
-        {
-            endedLock.lock() ;
-            try
-            {
-                this.ended = ended ;
-                endedChanged.signalAll() ;
-            }
-            finally
-            {
-                endedLock.unlock() ;
-            }
-        }
-        
-        /**
-         * Wait until the ended flag has been set.
-         * @return true if the ended flag has been set, false otherwise
-         */
-        public boolean waitUntilEnded()
-        {
-            return waitUntilEnded(ENDED_MILLIS) ;
-        }
-        
-        /**
-         * Wait until the ended flag has been set.
-         * @param maxDelay The maximum time to wait for the flag to be set.
-         * @return true if the ended flag has been set, false otherwise
-         */
-        public boolean waitUntilEnded(final long maxDelay)
-        {
-            final long endTime = System.currentTimeMillis() + maxDelay ;
-            endedLock.lock() ;
-            try
-            {
-                try
-                {
-                    while (!ended)
-                    {
-                        final long delay = endTime - System.currentTimeMillis() ;
-                        if ((delay <= 0) || !endedChanged.await(delay, TimeUnit.MILLISECONDS))
-                        {
-                            break ;
-                        }
-                    }
-                }
-                catch (final InterruptedException ie) {} // ignore
-                
-                return ended ;
-            }
-            finally
-            {
-                endedLock.unlock() ;
-            }
-        }
-        
-        /**
-         * Wait for a request to end.
-         * @param maxDelay The maximum time to wait in milliseconds.
-         */
-        public boolean waitForRequestedEnd(final long maxDelay)
-        {
-            final long endTime = System.currentTimeMillis() + maxDelay ;
-            endedLock.lock() ;
-            try
-            {
-                try
-                {
-                    while (!mIsEndRequested)
-                    {
-                        final long delay = endTime - System.currentTimeMillis() ;
-                        if ((delay <= 0) || !endRequested.await(delay, TimeUnit.MILLISECONDS))
-                        {
-                            break ;
-                        }
-                    }
-                }
-                catch (final InterruptedException ie) {} // ignore
-                
-                return mIsEndRequested ;
-            }
-            finally
-            {
-                endedLock.unlock() ;
-            }
-        }
-	
-	/**
-	 * To request the end of processing.
-	 */
-	public void requestEnd()
-    {
-        endedLock.lock() ;
-        try
-        {
-            mIsEndRequested = true;
-            endRequested.signalAll() ;
-        }
-        finally
-        {
-            endedLock.unlock() ;
-        }
-	}
-	
-	/**
-	 * Process the configuration.
-	 */
-	private void processConfiguration()
-	{
-		if (isReloadNeeded()) { 
-			try {
-				StreamSource validationInputSource=null;
-				InputStream validationInputStream = ClassUtil.getResourceAsStream(mValidationFileName, getClass());
-				//if this fails try using the 
-				if (validationInputStream==null) {
-					File validationFile = new File(mValidationFileName);
-					mLogger.debug("Validation file " + mValidationFileName + " exists?:" + validationFile.exists());
-					try {
-						validationInputStream = new FileInputStream(validationFile);
-					} catch (FileNotFoundException e) {
-						mLogger.error(e.getMessage(),e);
-						throw new IllegalStateException("ESB validation file [" + (new File(mValidationFileName)).getAbsolutePath() + "] not found.", e);
-					}
-				}
-				if (validationInputStream==null) {
-					mLogger.warn("Could not obtain validation file " + mValidationFileName);
-				} else {
-					mLogger.debug("Reading validation info from " + mValidationFileName);
-					validationInputSource = new StreamSource(validationInputStream);
-				}
-				
-				mLogger.info("loading configuration..");
-				String configXml = ParamRepositoryFactory.getInstance().get(mConfigFileName);
-				mLogger.debug("Start validation on configXml=" + configXml);
-				InputSource xmlInputSource = new InputSource(new StringReader(configXml));
-				XmlValidator validator = new XmlValidatorImpl();
-				if (validator.validate(xmlInputSource, validationInputSource)) {
-					mLogger.debug("Configuration file " + mConfigFileName + " passed validation. Starting " +
-							" the generation process of the jbossesb-listener.xml and the jbossesb-gateway.xml.");
-					Generator generator = new Generator(new ByteArrayInputStream(configXml.getBytes()));
-					generator.generate(mConfigDirectory);
-
-                    mLogger.info("Parameter reload completed.");
-                    stopController() ;
-
-                    final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(mListenerConfigFile) ;
-                    instances.addAll(LifecycleUtil.getGateways(mGatewayConfigFile)) ;
-
-                    controller = new ManagedLifecycleController(instances) ;
-                    try
-                    {
-                        controller.start() ;
-
-                        // In parallel, create a map of the contract publication info...
-                        ServicePublisher.addServicePublishers(controller, generator.getModel());
-                    }
-                    catch (final ManagedLifecycleException mle)
-                    {
-                        controller = null ;
-                        mLogger.error("Unexpected exception starting controller", mle) ;
-                    }
-				} else {
-					StringBuffer buffer = new StringBuffer("The configuration file "
-							+ mConfigFileName + "\n did not pass validation for the following reasons: \n");
-					int i=0;
-				    for (String error: validator.getValidationResults())
-					{
-						buffer.append("** " + ++i + ". "+ error + "\n");
-					}
-				    mLogger.debug(buffer);
-				    mLogger.error(buffer);
-					mLogger.info("The current configuration is kept in place until "
-							+ " validation passes.");
-				}
-			} catch (Exception e) {
-				mLogger.error("The current versions of the jbossesb-listener.xml and/or"
-						    + " jbossesb-gateway.xml are kept in place until the error is resolved: "
-						    +  e.getMessage(), e);
-			} 
-		}
-	}
-
-    /**
-	 * Check the file timestamp and return true when it changes. In other
-	 * words this only works for files for now.
-	 * 
-	 * @return true if the file timestamp changed.
-	 */
-	private boolean isReloadNeeded() 
-	{
-		File configFile = new File(mConfigFileName);
-		if (configFile.exists()) {
-			long currentFileTimestamp = configFile.lastModified();
-			if (mPreviousFileTimestamp==0 || currentFileTimestamp > mPreviousFileTimestamp) {
-				if (mLogger.isDebugEnabled()) {
-					mLogger.debug("The previous timestamp on the file was: " + new Date(mPreviousFileTimestamp)
-						+ " the new timestamp on the file is: " + new Date(currentFileTimestamp));
-				}
-				mPreviousFileTimestamp = currentFileTimestamp;
-				return true;
-			}
-		} else {
-			mLogger.error("The configuration file " + configFile + " could not be found.");
-		}
-		return false;
-	}
-        
-        /**
-         * Stop the controller if it is active.
-         */
-        private void stopController()
-        {
-            if (controller != null)
-            {
-                try
-                {
-                    ServicePublisher.removeServicePublishers(controller);
-                    controller.stop();
-                }
-                catch (final ManagedLifecycleException mle)
-                {
-                    mLogger.error("Unexpected exception stopping controller", mle) ;
-                }
-                controller = null ;
-            }
-        }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationController.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,392 @@
+/*
+ * 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.config;
+
+import java.io.ByteArrayInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.InputStream;
+import java.io.StringReader;
+import java.util.Date;
+import java.util.List;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.listeners.LifecycleUtil;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.xml.sax.InputSource;
+
+/**
+ * The controller monitors changes in the jbossesb configuration file call jbossesb.xml. When
+ * changes are detected it validates the XML, and when it passes validation it goes on and
+ * generates the jbossesb-listener.xml and jbossesb-gateway.xml.
+ * 
+ * @author kstam
+ *
+ */
+public class ConfigurationController implements Runnable
+{
+	private static final int SLEEP_MILLIS       = 1000; // default interval between parameter reloads
+        private static final int ENDED_MILLIS       = 20000; // default interval between parameter reloads
+	private static final String JBOSSESB_XSD = "/jbossesb-1.0.1.xsd";
+	private final Logger mLogger = Logger.getLogger(this.getClass());
+        private final Lock endedLock = new ReentrantLock() ;
+        private final Condition endedChanged = endedLock.newCondition() ;
+        private final Condition endRequested = endedLock.newCondition() ;
+	private final String mConfigFileName;
+	private final String mValidationFileName;
+	private final File mConfigDirectory;
+        private final String mListenerConfigFile;
+        private final String mGatewayConfigFile;
+	private long mPreviousFileTimestamp;
+	private boolean mIsEndRequested;
+	private boolean ended;
+    private ManagedLifecycleController controller ;
+
+    /**
+	 * Start the Controller externally.
+	 * @param args - arg[0] - the parameter file name
+	 */
+	
+	public static void main(String[] args)
+	{
+		ConfigurationController configurationController = new ConfigurationController(args[0],null);
+		configurationController.run();
+	}
+	/**
+	 * Construct a Configuration Manager from the named repository based
+	 * configuration. The default jbossesb-1.0.1.xsd will be used for validation.
+	 * 
+	 * @param configFileName - Name of the configuration repository.
+	 *   
+	 */
+	public ConfigurationController(String configFileName)
+	{
+		this(configFileName, null);
+	}
+	/**
+	 * Construct a Configuration Manager from the named repository based
+	 * configuration.
+	 * 
+	 * @param configFileName - Name of the configuration repository.
+	 * @param validationFileName - Name of the file name used for validation (xsd or dtd).
+	 *   
+	 */
+	public ConfigurationController(String configFileName, String validationFileName)
+	{
+		mConfigFileName = configFileName;
+		File configFile = new File(configFileName);
+		File parent = configFile.getParentFile();
+		mConfigDirectory = (null!=parent) ? parent : new File("");
+                final File listenerConfigFile = new File(mConfigDirectory, Generator.ESB_CONFIG_XML_FILE) ;
+                mListenerConfigFile = listenerConfigFile.getAbsolutePath() ;
+                final File gatewayConfigFile = new File(mConfigDirectory, Generator.ESB_CONFIG_GATEWAY_XML_FILE) ;
+                mGatewayConfigFile = gatewayConfigFile.getAbsolutePath() ;
+		//Try to obtain a handle to the validation file (xsd)
+		if (validationFileName==null) {
+			mValidationFileName=JBOSSESB_XSD;
+		} else {
+			mValidationFileName = validationFileName;
+		}
+
+		processConfiguration() ;
+	}
+    /**
+     * Thread that observes the configuration (file). If the configuration is updated it is
+     * validated and new set jbossesb-listener.xml and jbossesb-gateway.xml is created for the
+     * current server.
+     */
+ 	public void run() 
+	{
+		mLogger.info("Configuration Controller instance started.");
+		try {
+			if (mConfigFileName!=null) {
+                                do {
+					processConfiguration() ;
+				} while(!waitForRequestedEnd(SLEEP_MILLIS)) ;
+                                stopController() ;
+			} else {
+				mLogger.fatal("The name of the configuran file was null: " + mConfigFileName);
+			}
+		} finally {
+			mLogger.info("Exiting Config Controller...");
+			setEnded(true) ;
+		}
+	}
+
+	/**
+	 * Has the controller instance ended.
+	 * @return True if this controller instance has ended, otherwise false..
+	 */
+	public boolean hasEnded() {
+            endedLock.lock() ;
+            try
+            {
+		return ended ;
+            }
+            finally
+            {
+                endedLock.unlock() ;
+            }
+	}
+        
+        /**
+         * Set the ended flag.
+         * @param ended The value of the ended flag.
+         */
+        private void setEnded(final boolean ended)
+        {
+            endedLock.lock() ;
+            try
+            {
+                this.ended = ended ;
+                endedChanged.signalAll() ;
+            }
+            finally
+            {
+                endedLock.unlock() ;
+            }
+        }
+        
+        /**
+         * Wait until the ended flag has been set.
+         * @return true if the ended flag has been set, false otherwise
+         */
+        public boolean waitUntilEnded()
+        {
+            return waitUntilEnded(ENDED_MILLIS) ;
+        }
+        
+        /**
+         * Wait until the ended flag has been set.
+         * @param maxDelay The maximum time to wait for the flag to be set.
+         * @return true if the ended flag has been set, false otherwise
+         */
+        public boolean waitUntilEnded(final long maxDelay)
+        {
+            final long endTime = System.currentTimeMillis() + maxDelay ;
+            endedLock.lock() ;
+            try
+            {
+                try
+                {
+                    while (!ended)
+                    {
+                        final long delay = endTime - System.currentTimeMillis() ;
+                        if ((delay <= 0) || !endedChanged.await(delay, TimeUnit.MILLISECONDS))
+                        {
+                            break ;
+                        }
+                    }
+                }
+                catch (final InterruptedException ie) {} // ignore
+                
+                return ended ;
+            }
+            finally
+            {
+                endedLock.unlock() ;
+            }
+        }
+        
+        /**
+         * Wait for a request to end.
+         * @param maxDelay The maximum time to wait in milliseconds.
+         */
+        public boolean waitForRequestedEnd(final long maxDelay)
+        {
+            final long endTime = System.currentTimeMillis() + maxDelay ;
+            endedLock.lock() ;
+            try
+            {
+                try
+                {
+                    while (!mIsEndRequested)
+                    {
+                        final long delay = endTime - System.currentTimeMillis() ;
+                        if ((delay <= 0) || !endRequested.await(delay, TimeUnit.MILLISECONDS))
+                        {
+                            break ;
+                        }
+                    }
+                }
+                catch (final InterruptedException ie) {} // ignore
+                
+                return mIsEndRequested ;
+            }
+            finally
+            {
+                endedLock.unlock() ;
+            }
+        }
+	
+	/**
+	 * To request the end of processing.
+	 */
+	public void requestEnd()
+    {
+        endedLock.lock() ;
+        try
+        {
+            mIsEndRequested = true;
+            endRequested.signalAll() ;
+        }
+        finally
+        {
+            endedLock.unlock() ;
+        }
+	}
+	
+	/**
+	 * Process the configuration.
+	 */
+	private void processConfiguration()
+	{
+		if (isReloadNeeded()) { 
+			try {
+				StreamSource validationInputSource=null;
+				InputStream validationInputStream = ClassUtil.getResourceAsStream(mValidationFileName, getClass());
+				//if this fails try using the 
+				if (validationInputStream==null) {
+					File validationFile = new File(mValidationFileName);
+					mLogger.debug("Validation file " + mValidationFileName + " exists?:" + validationFile.exists());
+					try {
+						validationInputStream = new FileInputStream(validationFile);
+					} catch (FileNotFoundException e) {
+						mLogger.error(e.getMessage(),e);
+						throw new IllegalStateException("ESB validation file [" + (new File(mValidationFileName)).getAbsolutePath() + "] not found.", e);
+					}
+				}
+				if (validationInputStream==null) {
+					mLogger.warn("Could not obtain validation file " + mValidationFileName);
+				} else {
+					mLogger.debug("Reading validation info from " + mValidationFileName);
+					validationInputSource = new StreamSource(validationInputStream);
+				}
+				
+				mLogger.info("loading configuration..");
+				String configXml = ParamRepositoryFactory.getInstance().get(mConfigFileName);
+				mLogger.debug("Start validation on configXml=" + configXml);
+				InputSource xmlInputSource = new InputSource(new StringReader(configXml));
+				XmlValidator validator = new XmlValidatorImpl();
+				if (validator.validate(xmlInputSource, validationInputSource)) {
+					mLogger.debug("Configuration file " + mConfigFileName + " passed validation. Starting " +
+							" the generation process of the jbossesb-listener.xml and the jbossesb-gateway.xml.");
+					Generator generator = new Generator(new ByteArrayInputStream(configXml.getBytes()));
+					generator.generate(mConfigDirectory);
+
+                    mLogger.info("Parameter reload completed.");
+                    stopController() ;
+
+                    final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(mListenerConfigFile) ;
+                    instances.addAll(LifecycleUtil.getGateways(mGatewayConfigFile)) ;
+
+                    controller = new ManagedLifecycleController(instances) ;
+                    try
+                    {
+                        controller.start() ;
+
+                        // In parallel, create a map of the contract publication info...
+                        ServicePublisher.addServicePublishers(controller, generator.getModel());
+                    }
+                    catch (final ManagedLifecycleException mle)
+                    {
+                        controller = null ;
+                        mLogger.error("Unexpected exception starting controller", mle) ;
+                    }
+				} else {
+					StringBuffer buffer = new StringBuffer("The configuration file "
+							+ mConfigFileName + "\n did not pass validation for the following reasons: \n");
+					int i=0;
+				    for (String error: validator.getValidationResults())
+					{
+						buffer.append("** " + ++i + ". "+ error + "\n");
+					}
+				    mLogger.debug(buffer);
+				    mLogger.error(buffer);
+					mLogger.info("The current configuration is kept in place until "
+							+ " validation passes.");
+				}
+			} catch (Exception e) {
+				mLogger.error("The current versions of the jbossesb-listener.xml and/or"
+						    + " jbossesb-gateway.xml are kept in place until the error is resolved: "
+						    +  e.getMessage(), e);
+			} 
+		}
+	}
+
+    /**
+	 * Check the file timestamp and return true when it changes. In other
+	 * words this only works for files for now.
+	 * 
+	 * @return true if the file timestamp changed.
+	 */
+	private boolean isReloadNeeded() 
+	{
+		File configFile = new File(mConfigFileName);
+		if (configFile.exists()) {
+			long currentFileTimestamp = configFile.lastModified();
+			if (mPreviousFileTimestamp==0 || currentFileTimestamp > mPreviousFileTimestamp) {
+				if (mLogger.isDebugEnabled()) {
+					mLogger.debug("The previous timestamp on the file was: " + new Date(mPreviousFileTimestamp)
+						+ " the new timestamp on the file is: " + new Date(currentFileTimestamp));
+				}
+				mPreviousFileTimestamp = currentFileTimestamp;
+				return true;
+			}
+		} else {
+			mLogger.error("The configuration file " + configFile + " could not be found.");
+		}
+		return false;
+	}
+        
+        /**
+         * Stop the controller if it is active.
+         */
+        private void stopController()
+        {
+            if (controller != null)
+            {
+                try
+                {
+                    ServicePublisher.removeServicePublishers(controller);
+                    controller.stop();
+                }
+                catch (final ManagedLifecycleException mle)
+                {
+                    mLogger.error("Unexpected exception stopping controller", mle) ;
+                }
+                controller = null ;
+            }
+        }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,75 +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.config;
-
-import java.net.URI;
-
-import org.apache.log4j.Logger;
-import org.jboss.system.ServiceMBeanSupport;
-/**
- * Service to manage the configurationController when deployed to the appserver.
- * 
- * @author Kurt Stam
- *
- */
-public class ConfigurationControllerService extends ServiceMBeanSupport implements ConfigurationControllerServiceMBean
-{
-	private ConfigurationController	configurationController;
-	private Logger logger = Logger.getLogger(this.getClass());
-	private String configurationFile="jbossesb.xml";
-	/**
-	 * Starts the gateways.
-	 */
-	protected void startService() throws Exception 
-	{
-		logger.info("starting message configuration controller with config file " + configurationFile);
-		String confDir = System.getProperty("jboss.server.config.url");
-		URI uri = new URI(confDir);
-		confDir = uri.getPath();
-		String configFile = confDir + configurationFile;
-		configurationController = new ConfigurationController(configFile,null);
-//		 TODO tidy up		
-		new Thread(configurationController).start();
-	}
-	/**
-	 * Stops the gateways.
-	 */
-	protected void stopService() throws Exception 
-	{
-		logger.info("shutting down message aware listener...");
-		configurationController.requestEnd();
-                configurationController.waitUntilEnded() ;
-	}
-	/**
-	 * Gets the config file. The name of the file can be set in the jboss-service.xml.
-	 */
-	public String getConfigurationFile() {
-		return configurationFile;
-	}
-	/**
-	 * Sets the config file.
-	 */
-	public void setConfigurationFile(String configurationFile) {
-		this.configurationFile = configurationFile;
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerService.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,75 @@
+/*
+ * 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.config;
+
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+import org.jboss.system.ServiceMBeanSupport;
+/**
+ * Service to manage the configurationController when deployed to the appserver.
+ * 
+ * @author Kurt Stam
+ *
+ */
+public class ConfigurationControllerService extends ServiceMBeanSupport implements ConfigurationControllerServiceMBean
+{
+	private ConfigurationController	configurationController;
+	private Logger logger = Logger.getLogger(this.getClass());
+	private String configurationFile="jbossesb.xml";
+	/**
+	 * Starts the gateways.
+	 */
+	protected void startService() throws Exception 
+	{
+		logger.info("starting message configuration controller with config file " + configurationFile);
+		String confDir = System.getProperty("jboss.server.config.url");
+		URI uri = new URI(confDir);
+		confDir = uri.getPath();
+		String configFile = confDir + configurationFile;
+		configurationController = new ConfigurationController(configFile,null);
+//		 TODO tidy up		
+		new Thread(configurationController).start();
+	}
+	/**
+	 * Stops the gateways.
+	 */
+	protected void stopService() throws Exception 
+	{
+		logger.info("shutting down message aware listener...");
+		configurationController.requestEnd();
+                configurationController.waitUntilEnded() ;
+	}
+	/**
+	 * Gets the config file. The name of the file can be set in the jboss-service.xml.
+	 */
+	public String getConfigurationFile() {
+		return configurationFile;
+	}
+	/**
+	 * Sets the config file.
+	 */
+	public void setConfigurationFile(String configurationFile) {
+		this.configurationFile = configurationFile;
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.config;
-
-import org.jboss.system.ServiceMBean;
-/**
- * 
- * @author Kurt Stam
- *
- */
-public interface ConfigurationControllerServiceMBean extends ServiceMBean
-{
-   // Configure getters and setters for the configFile attribute
-   String getConfigurationFile();
-   void setConfigurationFile(String ConfigurationFile);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,35 @@
+/*
+ * 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.config;
+
+import org.jboss.system.ServiceMBean;
+/**
+ * 
+ * @author Kurt Stam
+ *
+ */
+public interface ConfigurationControllerServiceMBean extends ServiceMBean
+{
+   // Configure getters and setters for the configFile attribute
+   String getConfigurationFile();
+   void setConfigurationFile(String ConfigurationFile);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,128 +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.config;
-
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.config.FsListenerDocument.FsListener;
-import org.jboss.soa.esb.listeners.config.FtpListenerDocument.FtpListener;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.JmsListenerDocument.JmsListener;
-import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
-import org.jboss.soa.esb.listeners.config.SqlListenerDocument.SqlListener;
-import org.jboss.soa.esb.listeners.config.mappers.ActionMapper;
-import org.jboss.soa.esb.listeners.config.mappers.FsListenerMapper;
-import org.jboss.soa.esb.listeners.config.mappers.FtpListenerMapper;
-import org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapper;
-import org.jboss.soa.esb.listeners.config.mappers.NotificationMapper;
-import org.jboss.soa.esb.listeners.config.mappers.SqlListenerMapper;
-import org.jboss.soa.esb.listeners.config.mappers.UntypedListenerMapper;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * ESB Aware Listeners Configuration Generator.
- * <p/>
- * Generates a "ConfigTree" style configuration for the ESB Aware Listeners. 
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class ESBAwareGenerator {
-
-    private static final Logger logger = Logger.getLogger(ESBAwareGenerator.class);
-
-    /**
-	 * XMLBeans based configuration model instance.
-	 */
-	@SuppressWarnings("unused")
-	private XMLBeansModel model;
-	
-	/**
-	 * Public constructor.
-	 * @param model XMLBeans based configuration model instance.
-	 */
-	public ESBAwareGenerator(XMLBeansModel model) {
-		this.model = model;
-	}
-
-	/**
-	 * Generate the configuration DOM for the target Server.
-	 * @return The configuration DOM.
-	 * @throws ConfigurationException Error creating configuration. 
-	 */
-	public Document generate() throws ConfigurationException {
-		Document doc = YADOMUtil.createDocument();
-		Element root;
-		
-		doc.appendChild(doc.createComment("\n\tNOTE: DO NOT MODIFY\n\tThis file was auto-generated.\n"));
-		root = YADOMUtil.addElement(doc, "jbossesb-listeners");
-		root.setAttribute("parameterReloadSecs", model.getParameterReloadSecs());
-		
-		// Iterate over all the ESB Aware listner configs and map them to the listener configuration...
-		List<Listener> listeners = model.getESBAwareListeners();
-		for(Listener listener : listeners) {
-			addESBAwareConfig(root, listener);
-		}
-		
-		return doc;
-	}
-
-	/**
-	 * Add a single ESB Aware Listener configuration node to configuration root. 
-	 * @param root Configuration root node.
-	 * @param listener The ESB Aware Listener configuration to be added.
-	 * @throws ConfigurationException Invalid listener configuration.
-	 */
-	private void addESBAwareConfig(Element root, Listener listener) throws ConfigurationException {
-		Element listenerConfigTree;
-		Service listenerService;
-		
-		// Of course we could do the following reflectively if we really want to - TODO perhaps!!
-		if(listener instanceof JmsListener) {
-			listenerConfigTree = JmsListenerMapper.map(root, (JmsListener)listener, model);
-      } else if(listener instanceof FsListener) {
-         listenerConfigTree = FsListenerMapper.map(root, (FsListener)listener, model);
-		} else if (listener instanceof FtpListener) {
-			listenerConfigTree = FtpListenerMapper.map(root, (FtpListener)listener, model);
-		} else if (listener instanceof SqlListener) {
-			listenerConfigTree = SqlListenerMapper.map(root, (SqlListener)listener, model);
-        } else if (listener instanceof JbrListenerDocument.JbrListener) {
-            logger.error("JbossRemoting listener only supported in Gateway mode.");
-            return;
-        } else if (listener instanceof GroovyListenerDocument.GroovyListener) {
-            logger.error("Groovy listener only supported in Gateway mode.");
-            return;
-		} else {
-			listenerConfigTree = UntypedListenerMapper.map(root, listener, model);
-		}
-		
-		// Locate the Service to which the listener is bound...
-		listenerService = model.getService(listener);
-		
-		// Map the actions and notiications...
-		ActionMapper.map(listenerConfigTree, listenerService, model);
-		NotificationMapper.map(listenerConfigTree, listenerService, model);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ESBAwareGenerator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,128 @@
+/*
+ * 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.config;
+
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.FsListenerDocument.FsListener;
+import org.jboss.soa.esb.listeners.config.FtpListenerDocument.FtpListener;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.JmsListenerDocument.JmsListener;
+import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
+import org.jboss.soa.esb.listeners.config.SqlListenerDocument.SqlListener;
+import org.jboss.soa.esb.listeners.config.mappers.ActionMapper;
+import org.jboss.soa.esb.listeners.config.mappers.FsListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.FtpListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.NotificationMapper;
+import org.jboss.soa.esb.listeners.config.mappers.SqlListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.UntypedListenerMapper;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * ESB Aware Listeners Configuration Generator.
+ * <p/>
+ * Generates a "ConfigTree" style configuration for the ESB Aware Listeners. 
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ESBAwareGenerator {
+
+    private static final Logger logger = Logger.getLogger(ESBAwareGenerator.class);
+
+    /**
+	 * XMLBeans based configuration model instance.
+	 */
+	@SuppressWarnings("unused")
+	private XMLBeansModel model;
+	
+	/**
+	 * Public constructor.
+	 * @param model XMLBeans based configuration model instance.
+	 */
+	public ESBAwareGenerator(XMLBeansModel model) {
+		this.model = model;
+	}
+
+	/**
+	 * Generate the configuration DOM for the target Server.
+	 * @return The configuration DOM.
+	 * @throws ConfigurationException Error creating configuration. 
+	 */
+	public Document generate() throws ConfigurationException {
+		Document doc = YADOMUtil.createDocument();
+		Element root;
+		
+		doc.appendChild(doc.createComment("\n\tNOTE: DO NOT MODIFY\n\tThis file was auto-generated.\n"));
+		root = YADOMUtil.addElement(doc, "jbossesb-listeners");
+		root.setAttribute("parameterReloadSecs", model.getParameterReloadSecs());
+		
+		// Iterate over all the ESB Aware listner configs and map them to the listener configuration...
+		List<Listener> listeners = model.getESBAwareListeners();
+		for(Listener listener : listeners) {
+			addESBAwareConfig(root, listener);
+		}
+		
+		return doc;
+	}
+
+	/**
+	 * Add a single ESB Aware Listener configuration node to configuration root. 
+	 * @param root Configuration root node.
+	 * @param listener The ESB Aware Listener configuration to be added.
+	 * @throws ConfigurationException Invalid listener configuration.
+	 */
+	private void addESBAwareConfig(Element root, Listener listener) throws ConfigurationException {
+		Element listenerConfigTree;
+		Service listenerService;
+		
+		// Of course we could do the following reflectively if we really want to - TODO perhaps!!
+		if(listener instanceof JmsListener) {
+			listenerConfigTree = JmsListenerMapper.map(root, (JmsListener)listener, model);
+      } else if(listener instanceof FsListener) {
+         listenerConfigTree = FsListenerMapper.map(root, (FsListener)listener, model);
+		} else if (listener instanceof FtpListener) {
+			listenerConfigTree = FtpListenerMapper.map(root, (FtpListener)listener, model);
+		} else if (listener instanceof SqlListener) {
+			listenerConfigTree = SqlListenerMapper.map(root, (SqlListener)listener, model);
+        } else if (listener instanceof JbrListenerDocument.JbrListener) {
+            logger.error("JbossRemoting listener only supported in Gateway mode.");
+            return;
+        } else if (listener instanceof GroovyListenerDocument.GroovyListener) {
+            logger.error("Groovy listener only supported in Gateway mode.");
+            return;
+		} else {
+			listenerConfigTree = UntypedListenerMapper.map(root, listener, model);
+		}
+		
+		// Locate the Service to which the listener is bound...
+		listenerService = model.getService(listener);
+		
+		// Map the actions and notiications...
+		ActionMapper.map(listenerConfigTree, listenerService, model);
+		NotificationMapper.map(listenerConfigTree, listenerService, model);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,121 +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.config;
-
-import java.util.List;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.config.FsListenerDocument.FsListener;
-import org.jboss.soa.esb.listeners.config.FtpListenerDocument.FtpListener;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.GroovyListenerDocument.GroovyListener;
-import org.jboss.soa.esb.listeners.config.HibernateListenerDocument.HibernateListener;
-import org.jboss.soa.esb.listeners.config.JbrListenerDocument.JbrListener;
-import org.jboss.soa.esb.listeners.config.JmsListenerDocument.JmsListener;
-import org.jboss.soa.esb.listeners.config.SqlListenerDocument.SqlListener;
-import org.jboss.soa.esb.listeners.config.mappers.FsListenerMapper;
-import org.jboss.soa.esb.listeners.config.mappers.FtpListenerMapper;
-import org.jboss.soa.esb.listeners.config.mappers.GroovyListenerMapper;
-import org.jboss.soa.esb.listeners.config.mappers.HibernateListenerMapper;
-import org.jboss.soa.esb.listeners.config.mappers.JbrListenerMapper;
-import org.jboss.soa.esb.listeners.config.mappers.JcaGatewayMapper;
-import org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapper;
-import org.jboss.soa.esb.listeners.config.mappers.SqlListenerMapper;
-import org.jboss.soa.esb.listeners.config.mappers.UntypedListenerMapper;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Gateway Listeners Configuration Generator.
- * <p/>
- * Generates a "ConfigTree" style configuration for the Gateways Listeners. 
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class GatewayGenerator {
-
-	/**
-	 * XMLBeans based configuration model instance.
-	 */
-	@SuppressWarnings("unused")
-	private XMLBeansModel model;
-	
-	/**
-	 * Public constructor.
-	 * @param model XMLBeans based configuration model instance.
-	 */
-	public GatewayGenerator(XMLBeansModel model) {
-		this.model = model;
-	}
-
-	/**
-	 * Generate the configuration DOM for the target Server.
-	 * @return The configuration DOM.
-	 * @throws ConfigurationException Error creating configuration. 
-	 */
-	public Document generate() throws ConfigurationException {
-		Document doc = YADOMUtil.createDocument();
-		Element root;
-		
-		doc.appendChild(doc.createComment("\n\tNOTE: DO NOT MODIFY\n\tThis file was auto-generated.\n"));
-		root = YADOMUtil.addElement(doc, "jbossesb-gateways");
-		root.setAttribute("parameterReloadSecs", model.getParameterReloadSecs());
-		
-		// Iterate over all the gateway configs and map them to the gateway configuration...
-		List<Listener> gateways = model.getGatewayListeners();
-		for(Listener gateway : gateways) {
-			addGatewayConfig(root, gateway);
-		}
-		
-		return doc;
-	}
-
-	/**
-	 * Add a single gateway configuration node to configuration root. 
-	 * @param root Configuration root node.
-	 * @param gateway The Gateway Listener configuration to be added.
-	 * @throws ConfigurationException Invalid listener configuration.
-	 */
-	private void addGatewayConfig(Element root, Listener gateway) throws ConfigurationException {
-		// Of course we could do the following reflectively if we really want to - TODO perhaps!!
-		if(gateway instanceof JmsListener) {
-			JmsListenerMapper.map(root, (JmsListener)gateway, model);
-		} else if (gateway instanceof FsListener){
-			FsListenerMapper.map(root, (FsListener)gateway, model);
-		} else if(gateway instanceof JcaGatewayDocument.JcaGateway) {
-			JcaGatewayMapper.map(root, (JcaGatewayDocument.JcaGateway)gateway, model);
-		} else if (gateway instanceof FtpListener) {
-			FtpListenerMapper.map(root, (FtpListener)gateway, model);
-		} else if (gateway instanceof SqlListener) {
-			SqlListenerMapper.map(root, (SqlListener)gateway, model);
-        } else if (gateway instanceof JbrListener) {
-            JbrListenerMapper.map(root, (JbrListener)gateway, model);
-        } else if (gateway instanceof GroovyListener) {
-            GroovyListenerMapper.map(root, (GroovyListener)gateway, model);
-        } else if (gateway instanceof HibernateListener) {
-        	HibernateListenerMapper.map(root, (HibernateListener)gateway, model);
-        } else {
-			UntypedListenerMapper.map(root, gateway, model);
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/GatewayGenerator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,121 @@
+/*
+ * 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.config;
+
+import java.util.List;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.FsListenerDocument.FsListener;
+import org.jboss.soa.esb.listeners.config.FtpListenerDocument.FtpListener;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.GroovyListenerDocument.GroovyListener;
+import org.jboss.soa.esb.listeners.config.HibernateListenerDocument.HibernateListener;
+import org.jboss.soa.esb.listeners.config.JbrListenerDocument.JbrListener;
+import org.jboss.soa.esb.listeners.config.JmsListenerDocument.JmsListener;
+import org.jboss.soa.esb.listeners.config.SqlListenerDocument.SqlListener;
+import org.jboss.soa.esb.listeners.config.mappers.FsListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.FtpListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.GroovyListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.HibernateListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.JbrListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.JcaGatewayMapper;
+import org.jboss.soa.esb.listeners.config.mappers.JmsListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.SqlListenerMapper;
+import org.jboss.soa.esb.listeners.config.mappers.UntypedListenerMapper;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Gateway Listeners Configuration Generator.
+ * <p/>
+ * Generates a "ConfigTree" style configuration for the Gateways Listeners. 
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class GatewayGenerator {
+
+	/**
+	 * XMLBeans based configuration model instance.
+	 */
+	@SuppressWarnings("unused")
+	private XMLBeansModel model;
+	
+	/**
+	 * Public constructor.
+	 * @param model XMLBeans based configuration model instance.
+	 */
+	public GatewayGenerator(XMLBeansModel model) {
+		this.model = model;
+	}
+
+	/**
+	 * Generate the configuration DOM for the target Server.
+	 * @return The configuration DOM.
+	 * @throws ConfigurationException Error creating configuration. 
+	 */
+	public Document generate() throws ConfigurationException {
+		Document doc = YADOMUtil.createDocument();
+		Element root;
+		
+		doc.appendChild(doc.createComment("\n\tNOTE: DO NOT MODIFY\n\tThis file was auto-generated.\n"));
+		root = YADOMUtil.addElement(doc, "jbossesb-gateways");
+		root.setAttribute("parameterReloadSecs", model.getParameterReloadSecs());
+		
+		// Iterate over all the gateway configs and map them to the gateway configuration...
+		List<Listener> gateways = model.getGatewayListeners();
+		for(Listener gateway : gateways) {
+			addGatewayConfig(root, gateway);
+		}
+		
+		return doc;
+	}
+
+	/**
+	 * Add a single gateway configuration node to configuration root. 
+	 * @param root Configuration root node.
+	 * @param gateway The Gateway Listener configuration to be added.
+	 * @throws ConfigurationException Invalid listener configuration.
+	 */
+	private void addGatewayConfig(Element root, Listener gateway) throws ConfigurationException {
+		// Of course we could do the following reflectively if we really want to - TODO perhaps!!
+		if(gateway instanceof JmsListener) {
+			JmsListenerMapper.map(root, (JmsListener)gateway, model);
+		} else if (gateway instanceof FsListener){
+			FsListenerMapper.map(root, (FsListener)gateway, model);
+		} else if(gateway instanceof JcaGatewayDocument.JcaGateway) {
+			JcaGatewayMapper.map(root, (JcaGatewayDocument.JcaGateway)gateway, model);
+		} else if (gateway instanceof FtpListener) {
+			FtpListenerMapper.map(root, (FtpListener)gateway, model);
+		} else if (gateway instanceof SqlListener) {
+			SqlListenerMapper.map(root, (SqlListener)gateway, model);
+        } else if (gateway instanceof JbrListener) {
+            JbrListenerMapper.map(root, (JbrListener)gateway, model);
+        } else if (gateway instanceof GroovyListener) {
+            GroovyListenerMapper.map(root, (GroovyListener)gateway, model);
+        } else if (gateway instanceof HibernateListener) {
+        	HibernateListenerMapper.map(root, (HibernateListener)gateway, model);
+        } else {
+			UntypedListenerMapper.map(root, gateway, model);
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,325 +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.config;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.OutputStream;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.apache.xmlbeans.XmlException;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.config.JbossesbDocument.Jbossesb;
-import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
-import org.jboss.soa.esb.listeners.config.ServicesDocument.Services;
-import org.w3c.dom.Document;
-
-/**
- * ESB Configuration Generator.
- * <p/>
- * Generates a legacy/deprecated configuration fileset in accordance with the
- * {@link org.jboss.soa.esb.helpers.ConfigTree} approach to ESB configuration.  The
- * generator input should be a configuration that has been validated against the
- * JBoss ESB configuration schema (XMLSchema).
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class Generator {
-	
-	private static Logger logger = Logger.getLogger(Generator.class);
-	
-	/**
-	 * Gateway Listeners config file.
-	 */
-	public static final String ESB_CONFIG_GATEWAY_XML_FILE = "jbossesb-gateway.xml";
-	/**
-	 * ESB Aware Listeners config file.
-	 */
-	public static final String ESB_CONFIG_XML_FILE = "jbossesb-listener.xml";
-	/**
-	 * Configuration model.
-	 */
-	private XMLBeansModel model;
-
-   private OutputStream gatewayOutputStream;
-
-   private OutputStream listenerOutputStream;
-
-
-   public Generator(InputStream config, OutputStream listenerOutputStream, OutputStream gatewayOutputStream) throws ConfigurationException, IOException
-   {
-      this(config);
-      this.gatewayOutputStream = gatewayOutputStream;
-      this.listenerOutputStream = listenerOutputStream;
-   }
-
-   /**
-	 * Public constructor.
-	 * @param config The input configuration stream.
-	 * @throws ConfigurationException Bad listener ESB configuration. 
-	 * @throws IOException Unable to read the ESB listener configuration.
-	 */
-	public Generator(InputStream config) throws ConfigurationException, IOException {
-		if(config == null) {
-			throw new IllegalArgumentException("null 'config' arg in constructor call.");
-		}
-		
-		// Parse the config into our internal model instance...
-       model = parseConfig(config);
-   }
-
-   /**
-    * Parse the supplied config into a config model.
-    * @param config The input configuration stream.
-    * @return Config model.
-    * @throws ConfigurationException Bad listener ESB configuration.
-    * @throws IOException Unable to read the ESB listener configuration.
-    */
-   public static XMLBeansModel parseConfig(InputStream config) throws IOException, ConfigurationException {
-       try {
-           JbossesbDocument doc = JbossesbDocument.Factory.parse(config);
-
-           // TODO: Get validation working from here - would save
-           // doc.validate();
-
-           return new XMLBeansModel(doc);
-       } catch (XmlException e) {
-           throw new ConfigurationException("Error while processing ESB Listener configuration stream.", e);
-       }
-   }
-
-   /**
-    * Generate the configuration set in the supplied output directory and store it in the member outputstreams.
-    * @throws ConfigurationException Failed to generate configuration set.
-    */
-   public void generate() throws ConfigurationException {
-      // Generate and serialise the configuration for the ESB Aware listeners...
-      ESBAwareGenerator awareGenerator = new ESBAwareGenerator(model);
-      Document awareConfig = awareGenerator.generate();
-
-      YADOMUtil.serialize(awareConfig, listenerOutputStream);
-
-      // Generate and serialise the configuration for the Gateway listeners...
-      GatewayGenerator gatewayGenerator = new GatewayGenerator(model);
-      Document gatewayConfig = gatewayGenerator.generate();
-
-      YADOMUtil.serialize(gatewayConfig, gatewayOutputStream);
-   }
-
-	/**
-	 * Generate the configuration set in the supplied output directory.
-	 * <p/>
-	 * The names of the generated files will be esb-config.xml (ESB Aware Listeners configuration)
-	 * and esb-config-gateway.xml (Gateway Listeners configuration).
-	 * 
-	 * @param outdir The output directory to where the configuration set is to be generated.
-	 * The directory will be created if it doesn't already exist.
-	 * @throws ConfigurationException Failed to generate configuration set.
-	 */
-	public void generate(File outdir) throws ConfigurationException {
-		if(outdir == null) {
-			throw new IllegalArgumentException("null 'outdir' arg in method call.");
-		}
-		if(!outdir.exists()) {
-			outdir.mkdirs();
-			if(!outdir.exists()) {
-				throw new IllegalArgumentException("Failed to create 'outdir' [" + outdir.getAbsolutePath() + "].");
-			}
-		}
-		if(!outdir.isDirectory()) {
-			throw new IllegalArgumentException("'outdir' exists, but is not a directory.");
-		}
-
-		// Generate and serialise the configuration for the ESB Aware listeners...
-		ESBAwareGenerator awareGenerator = new ESBAwareGenerator(model);
-		Document awareConfig = awareGenerator.generate();
-
-		logger.info("Serializing ESB Aware Listener 'ConfigTree' configuration to [" + (new File(outdir, ESB_CONFIG_XML_FILE)).getAbsolutePath() + "].");
-		YADOMUtil.serialize(awareConfig, outdir, ESB_CONFIG_XML_FILE);
-
-		// Generate and serialise the configuration for the Gateway listeners...
-		GatewayGenerator gatewayGenerator = new GatewayGenerator(model);
-		Document gatewayConfig = gatewayGenerator.generate();
-		
-		logger.info("Serializing ESB Gateway 'ConfigTree' configuration to [" + (new File(outdir, ESB_CONFIG_GATEWAY_XML_FILE)).getAbsolutePath() + "].");
-		YADOMUtil.serialize(gatewayConfig, outdir, ESB_CONFIG_GATEWAY_XML_FILE);
-	}
-
-	/**
-	 * Get the model instance associate with the configuration used to create this Generator instance. 
-	 * @return Returns the model.
-	 */
-	protected XMLBeansModel getModel() {
-		return model;
-	}
-	
-	/**
-	 * XMLBeans based model implementation.
-	 * 
-	 * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
-	 */
-	public static class XMLBeansModel {
-
-		/**
-		 * XMLBeans config model instance.
-		 */
-		private Jbossesb jbossesb;
-		
-		/**
-		 * Constructor.
-		 * @param xmlBeansDoc XMLBeans config model.
-		 */
-		private XMLBeansModel(JbossesbDocument xmlBeansDoc) {
-			this.jbossesb = xmlBeansDoc.getJbossesb();
-		}
-
-        /**
-		 * Get the list of ESB Gateway Listeners from the configuration.
-		 * @return The list of ESB Gateway Listeners from the configuration.
-		 */
-		public List<Listener> getGatewayListeners() {
-			return getListeners(true);
-		}
-
-		/**
-		 * Get the list of ESB Aware Listeners from the configuration.
-		 * @return The list of ESB Aware Listeners from the configuration.
-		 */
-		public List<Listener> getESBAwareListeners() {
-			return getListeners(false);
-		}
-
-        /**
-		 * Get the Service to which the supplied {@link Listener} configuration instance is bound.
-		 * @param listener The listener instance (Gateway or ESB Aware).
-		 * @return The Service to which the 
-		 */
-		public Service getService(Listener listener) {
-            List<Service> services = getServices();
-
-            for(Service service : services) {
-				for(Listener serviceListener : service.getListeners().getListenerList()) {
-					if(serviceListener == listener) {
-						return service;
-					}
-				}
-			}
-			
-			throw new IllegalStateException("No Service instance found for the supplied Listener instance.  This should not be possible if the Listener instance was provided by this configuration.  Where has this Listener instance come from?");
-		}
-
-        /**
-         * Get the Service list.
-         * @return Service list.
-         */
-        public List<Service> getServices() {
-            final Services services = jbossesb.getServices();
-            if (services != null) {
-                return jbossesb.getServices().getServiceList();
-            } else {
-                return Collections.emptyList();
-            }
-        }
-
-        /**
-		 * Get the &lt;bus&gt; configuration matching the supplied busid reference value.
-		 * @param busid The required &lt;bus&gt; configuration reference value.
-		 * @return The Bus configuration instance.
-		 * @throws ConfigurationException Unknown busid reference value.
-		 */
-		public Bus getBus(String busid) throws ConfigurationException {
-			List<Provider> providers = jbossesb.getProviders().getProviderList();
-			
-			for(Provider provider : providers) {
-				List<Bus> buses = provider.getBusList();
-				
-				for(Bus bus : buses) {
-					if(bus.getBusid().equals(busid)) {
-						return bus;
-					}
-				}
-			}
-			
-			throw new ConfigurationException("Invalid ESB Configuration: No <bus> configuration matching busid reference value [" + busid + "].");
-		}
-
-		/**
-		 * Get the &lt;provider&gt; configuration containing the supplied Bus configuration instance.
-		 * @param bus The Bus config instance whose Provider is being sought.
-		 * @return The Provider configuration instance.
-		 */
-		public Provider getProvider(Bus bus) {
-			List<Provider> providers = jbossesb.getProviders().getProviderList();
-			
-			for(Provider provider : providers) {
-				List<Bus> buses = provider.getBusList();
-				
-				for(Bus installedBus : buses) {
-					if(installedBus == bus) {
-						return provider;
-					}
-				}
-			}
-			
-			throw new IllegalStateException("No Provider instance found for the supplied Bus config instance.  This should not be possible if the Bus instance was provided by this configuration.  Where has this Bus instance come from?");
-		}
-      private boolean isGateway(Listener listener)
-      {
-         return listener.getIsGateway() || (listener instanceof JcaGatewayDocument.JcaGateway);
-      }
-
-      /**
-		 * Get the list of ESB Listeners based on their Gateway flag.
-		 * @return The list of ESB Aware or Gateway Listeners from the configuration.
-         * @param isGateway Is the listener a gateway or ESB aware listener.
-		 */
-		private List<Listener> getListeners(boolean isGateway) {
-			List<Listener> gateways = new ArrayList<Listener>();
-			if (jbossesb.getServices() != null) {
-                List<Service> services = getServices();
-
-                for(Service service : services) {
-					for(Listener listener : service.getListeners().getListenerList()) {
-						if(isGateway(listener) == isGateway) {
-							gateways.add(listener);
-						}
-					}
-				}
-			}
-			
-			return gateways;
-		}
-		/**
-		 * Gets the setting for the number of seconds between reloads.
-		 * 
-		 * @return The param reload seconds config value.
-		 */
-		public String getParameterReloadSecs() {
-			return jbossesb.getParameterReloadSecs().getStringValue();
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/Generator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,325 @@
+/*
+ * 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.config;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.apache.xmlbeans.XmlException;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.JbossesbDocument.Jbossesb;
+import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
+import org.jboss.soa.esb.listeners.config.ServicesDocument.Services;
+import org.w3c.dom.Document;
+
+/**
+ * ESB Configuration Generator.
+ * <p/>
+ * Generates a legacy/deprecated configuration fileset in accordance with the
+ * {@link org.jboss.soa.esb.helpers.ConfigTree} approach to ESB configuration.  The
+ * generator input should be a configuration that has been validated against the
+ * JBoss ESB configuration schema (XMLSchema).
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class Generator {
+	
+	private static Logger logger = Logger.getLogger(Generator.class);
+	
+	/**
+	 * Gateway Listeners config file.
+	 */
+	public static final String ESB_CONFIG_GATEWAY_XML_FILE = "jbossesb-gateway.xml";
+	/**
+	 * ESB Aware Listeners config file.
+	 */
+	public static final String ESB_CONFIG_XML_FILE = "jbossesb-listener.xml";
+	/**
+	 * Configuration model.
+	 */
+	private XMLBeansModel model;
+
+   private OutputStream gatewayOutputStream;
+
+   private OutputStream listenerOutputStream;
+
+
+   public Generator(InputStream config, OutputStream listenerOutputStream, OutputStream gatewayOutputStream) throws ConfigurationException, IOException
+   {
+      this(config);
+      this.gatewayOutputStream = gatewayOutputStream;
+      this.listenerOutputStream = listenerOutputStream;
+   }
+
+   /**
+	 * Public constructor.
+	 * @param config The input configuration stream.
+	 * @throws ConfigurationException Bad listener ESB configuration. 
+	 * @throws IOException Unable to read the ESB listener configuration.
+	 */
+	public Generator(InputStream config) throws ConfigurationException, IOException {
+		if(config == null) {
+			throw new IllegalArgumentException("null 'config' arg in constructor call.");
+		}
+		
+		// Parse the config into our internal model instance...
+       model = parseConfig(config);
+   }
+
+   /**
+    * Parse the supplied config into a config model.
+    * @param config The input configuration stream.
+    * @return Config model.
+    * @throws ConfigurationException Bad listener ESB configuration.
+    * @throws IOException Unable to read the ESB listener configuration.
+    */
+   public static XMLBeansModel parseConfig(InputStream config) throws IOException, ConfigurationException {
+       try {
+           JbossesbDocument doc = JbossesbDocument.Factory.parse(config);
+
+           // TODO: Get validation working from here - would save
+           // doc.validate();
+
+           return new XMLBeansModel(doc);
+       } catch (XmlException e) {
+           throw new ConfigurationException("Error while processing ESB Listener configuration stream.", e);
+       }
+   }
+
+   /**
+    * Generate the configuration set in the supplied output directory and store it in the member outputstreams.
+    * @throws ConfigurationException Failed to generate configuration set.
+    */
+   public void generate() throws ConfigurationException {
+      // Generate and serialise the configuration for the ESB Aware listeners...
+      ESBAwareGenerator awareGenerator = new ESBAwareGenerator(model);
+      Document awareConfig = awareGenerator.generate();
+
+      YADOMUtil.serialize(awareConfig, listenerOutputStream);
+
+      // Generate and serialise the configuration for the Gateway listeners...
+      GatewayGenerator gatewayGenerator = new GatewayGenerator(model);
+      Document gatewayConfig = gatewayGenerator.generate();
+
+      YADOMUtil.serialize(gatewayConfig, gatewayOutputStream);
+   }
+
+	/**
+	 * Generate the configuration set in the supplied output directory.
+	 * <p/>
+	 * The names of the generated files will be esb-config.xml (ESB Aware Listeners configuration)
+	 * and esb-config-gateway.xml (Gateway Listeners configuration).
+	 * 
+	 * @param outdir The output directory to where the configuration set is to be generated.
+	 * The directory will be created if it doesn't already exist.
+	 * @throws ConfigurationException Failed to generate configuration set.
+	 */
+	public void generate(File outdir) throws ConfigurationException {
+		if(outdir == null) {
+			throw new IllegalArgumentException("null 'outdir' arg in method call.");
+		}
+		if(!outdir.exists()) {
+			outdir.mkdirs();
+			if(!outdir.exists()) {
+				throw new IllegalArgumentException("Failed to create 'outdir' [" + outdir.getAbsolutePath() + "].");
+			}
+		}
+		if(!outdir.isDirectory()) {
+			throw new IllegalArgumentException("'outdir' exists, but is not a directory.");
+		}
+
+		// Generate and serialise the configuration for the ESB Aware listeners...
+		ESBAwareGenerator awareGenerator = new ESBAwareGenerator(model);
+		Document awareConfig = awareGenerator.generate();
+
+		logger.info("Serializing ESB Aware Listener 'ConfigTree' configuration to [" + (new File(outdir, ESB_CONFIG_XML_FILE)).getAbsolutePath() + "].");
+		YADOMUtil.serialize(awareConfig, outdir, ESB_CONFIG_XML_FILE);
+
+		// Generate and serialise the configuration for the Gateway listeners...
+		GatewayGenerator gatewayGenerator = new GatewayGenerator(model);
+		Document gatewayConfig = gatewayGenerator.generate();
+		
+		logger.info("Serializing ESB Gateway 'ConfigTree' configuration to [" + (new File(outdir, ESB_CONFIG_GATEWAY_XML_FILE)).getAbsolutePath() + "].");
+		YADOMUtil.serialize(gatewayConfig, outdir, ESB_CONFIG_GATEWAY_XML_FILE);
+	}
+
+	/**
+	 * Get the model instance associate with the configuration used to create this Generator instance. 
+	 * @return Returns the model.
+	 */
+	protected XMLBeansModel getModel() {
+		return model;
+	}
+	
+	/**
+	 * XMLBeans based model implementation.
+	 * 
+	 * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+	 */
+	public static class XMLBeansModel {
+
+		/**
+		 * XMLBeans config model instance.
+		 */
+		private Jbossesb jbossesb;
+		
+		/**
+		 * Constructor.
+		 * @param xmlBeansDoc XMLBeans config model.
+		 */
+		private XMLBeansModel(JbossesbDocument xmlBeansDoc) {
+			this.jbossesb = xmlBeansDoc.getJbossesb();
+		}
+
+        /**
+		 * Get the list of ESB Gateway Listeners from the configuration.
+		 * @return The list of ESB Gateway Listeners from the configuration.
+		 */
+		public List<Listener> getGatewayListeners() {
+			return getListeners(true);
+		}
+
+		/**
+		 * Get the list of ESB Aware Listeners from the configuration.
+		 * @return The list of ESB Aware Listeners from the configuration.
+		 */
+		public List<Listener> getESBAwareListeners() {
+			return getListeners(false);
+		}
+
+        /**
+		 * Get the Service to which the supplied {@link Listener} configuration instance is bound.
+		 * @param listener The listener instance (Gateway or ESB Aware).
+		 * @return The Service to which the 
+		 */
+		public Service getService(Listener listener) {
+            List<Service> services = getServices();
+
+            for(Service service : services) {
+				for(Listener serviceListener : service.getListeners().getListenerList()) {
+					if(serviceListener == listener) {
+						return service;
+					}
+				}
+			}
+			
+			throw new IllegalStateException("No Service instance found for the supplied Listener instance.  This should not be possible if the Listener instance was provided by this configuration.  Where has this Listener instance come from?");
+		}
+
+        /**
+         * Get the Service list.
+         * @return Service list.
+         */
+        public List<Service> getServices() {
+            final Services services = jbossesb.getServices();
+            if (services != null) {
+                return jbossesb.getServices().getServiceList();
+            } else {
+                return Collections.emptyList();
+            }
+        }
+
+        /**
+		 * Get the &lt;bus&gt; configuration matching the supplied busid reference value.
+		 * @param busid The required &lt;bus&gt; configuration reference value.
+		 * @return The Bus configuration instance.
+		 * @throws ConfigurationException Unknown busid reference value.
+		 */
+		public Bus getBus(String busid) throws ConfigurationException {
+			List<Provider> providers = jbossesb.getProviders().getProviderList();
+			
+			for(Provider provider : providers) {
+				List<Bus> buses = provider.getBusList();
+				
+				for(Bus bus : buses) {
+					if(bus.getBusid().equals(busid)) {
+						return bus;
+					}
+				}
+			}
+			
+			throw new ConfigurationException("Invalid ESB Configuration: No <bus> configuration matching busid reference value [" + busid + "].");
+		}
+
+		/**
+		 * Get the &lt;provider&gt; configuration containing the supplied Bus configuration instance.
+		 * @param bus The Bus config instance whose Provider is being sought.
+		 * @return The Provider configuration instance.
+		 */
+		public Provider getProvider(Bus bus) {
+			List<Provider> providers = jbossesb.getProviders().getProviderList();
+			
+			for(Provider provider : providers) {
+				List<Bus> buses = provider.getBusList();
+				
+				for(Bus installedBus : buses) {
+					if(installedBus == bus) {
+						return provider;
+					}
+				}
+			}
+			
+			throw new IllegalStateException("No Provider instance found for the supplied Bus config instance.  This should not be possible if the Bus instance was provided by this configuration.  Where has this Bus instance come from?");
+		}
+      private boolean isGateway(Listener listener)
+      {
+         return listener.getIsGateway() || (listener instanceof JcaGatewayDocument.JcaGateway);
+      }
+
+      /**
+		 * Get the list of ESB Listeners based on their Gateway flag.
+		 * @return The list of ESB Aware or Gateway Listeners from the configuration.
+         * @param isGateway Is the listener a gateway or ESB aware listener.
+		 */
+		private List<Listener> getListeners(boolean isGateway) {
+			List<Listener> gateways = new ArrayList<Listener>();
+			if (jbossesb.getServices() != null) {
+                List<Service> services = getServices();
+
+                for(Service service : services) {
+					for(Listener listener : service.getListeners().getListenerList()) {
+						if(isGateway(listener) == isGateway) {
+							gateways.add(listener);
+						}
+					}
+				}
+			}
+			
+			return gateways;
+		}
+		/**
+		 * Gets the setting for the number of seconds between reloads.
+		 * 
+		 * @return The param reload seconds config value.
+		 */
+		public String getParameterReloadSecs() {
+			return jbossesb.getParameterReloadSecs().getStringValue();
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,323 +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.config;
-
-import java.io.File;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Iterator;
-
-import javax.management.ObjectName;
-
-import org.jboss.deployment.DeploymentException;
-import org.jboss.deployment.DeploymentInfo;
-import org.jboss.deployment.SubDeployer;
-import org.jboss.deployment.SubDeployerSupport;
-import org.jboss.logging.Logger;
-import org.jboss.metadata.MetaData;
-import org.jboss.metadata.XmlFileLoader;
-import org.jboss.mx.loading.LoaderRepositoryFactory;
-import org.jboss.mx.util.MBeanProxyExt;
-import org.jboss.mx.util.ObjectNameConverter;
-import org.jboss.system.ServiceControllerMBean;
-import org.w3c.dom.Element;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class JBoss4ESBDeployer extends SubDeployerSupport
-        implements SubDeployer, JBoss4ESBDeployerMBean
-{
-   private final static Logger log = Logger.getLogger(JBoss4ESBDeployer.class);
-
-   private ServiceControllerMBean serviceController;
-   
-   /**
-    * Default CTOR used to set default values to the Suffixes and RelativeOrder
-    * attributes. Those are read at subdeployer registration time by the MainDeployer
-    * to alter its SuffixOrder.
-    */
-   public JBoss4ESBDeployer()
-   {
-      setSuffixes(new String[]{".esb"});
-      setRelativeOrder(1000); // before old EJB 2.1 deployer
-   }
-
-   public static boolean hasFile(DeploymentInfo di, String filePath)
-   {
-      String urlStr = di.url.getFile();
-      try
-      {
-         URL dd = di.localCl.findResource(filePath);
-         if (dd != null)
-         {
-
-            // If the DD url is not a subset of the urlStr then this is coming
-            // from a jar referenced by the deployment jar manifest and the
-            // this deployment jar it should not be treated as persistence
-            if (di.localUrl != null)
-            {
-               urlStr = di.localUrl.toString();
-            }
-
-            String ddStr = dd.toString();
-            if (ddStr.indexOf(urlStr) >= 0)
-            {
-               return true;
-            }
-         }
-      }
-      catch (Exception ignore)
-      {
-      }
-      return false;
-   }
-
-   /**
-    * Returns true if this deployer can deploy the given DeploymentInfo.
-    *
-    * @return True if this deployer can deploy the given DeploymentInfo.
-    * @jmx:managed-operation
-    */
-   public boolean accepts(DeploymentInfo di)
-   {
-      String urlStr = di.url.toString();
-      return urlStr.endsWith(".esb") || urlStr.endsWith(".esb/") ||
-              urlStr.endsWith("-esb.xml");
-   }
-
-   /**
-    * Get a reference to the ServiceController
-    */
-   protected void startService() throws Exception
-   {
-      serviceController = (ServiceControllerMBean)
-              MBeanProxyExt.create(ServiceControllerMBean.class,
-                      ServiceControllerMBean.OBJECT_NAME, server);
-
-      mainDeployer.addDeployer(this);
-   }
-
-
-   protected URL getDocumentUrl(DeploymentInfo di)
-   {
-      String urlStr = di.url.toString();
-      if (urlStr.endsWith(".esb") || urlStr.endsWith(".esb/"))
-      {
-         return di.localCl.getResource("META-INF/jboss-esb.xml");
-      }
-      return di.url;
-   }
-
-   public void init(DeploymentInfo di) throws DeploymentException
-   {
-      try
-      {
-         if (di.url.getProtocol().equalsIgnoreCase("file"))
-         {
-            File file = new File(di.url.getFile());
-
-            if (!file.isDirectory())
-            {
-               // If not directory we watch the package
-               di.watch = di.url;
-            }
-            else
-            {
-               // If directory we watch the xml files
-               di.watch = new URL(di.url, "META-INF/jboss-esb.xml");
-            }
-         }
-         else
-         {
-            // We watch the top only, no directory support
-            di.watch = di.url;
-         }
-
-         XmlFileLoader xfl = new XmlFileLoader();
-         InputStream in = di.localCl.getResourceAsStream("META-INF/deployment.xml");
-         if (in != null)
-         {
-            try
-            {
-               Element jboss = xfl.getDocument(in, "META-INF/esb-deployment.xml").getDocumentElement();
-               // Check for a ejb level class loading config
-               Element loader = MetaData.getOptionalChild(jboss, "loader-repository");
-               if (loader != null)
-               {
-                  LoaderRepositoryFactory.LoaderRepositoryConfig config =
-                          LoaderRepositoryFactory.parseRepositoryConfig(loader);
-                  di.setRepositoryInfo(config);
-               }
-
-            }
-            finally
-            {
-               in.close();
-            }
-         }
-      }
-      catch (Exception e)
-      {
-         if (e instanceof DeploymentException)
-         {
-            throw(DeploymentException) e;
-         }
-         throw new DeploymentException("failed to initialize", e);
-      }
-
-      // invoke super-class initialization
-      super.init(di);
-   }
-
-   public synchronized void create(DeploymentInfo di) throws DeploymentException
-   {
-      log.info("create esb service, " + di.shortName);
-      URL document = getDocumentUrl(di);
-      if (document == null)
-      {
-         throw new DeploymentException("Unable to find document url of META-INF/jboss-esb.xml in: "
-                 + di.url);
-      }
-      try
-      {
-         ArrayList<ObjectName> deps = new ArrayList<ObjectName>();
-         InputStream in = di.localCl.getResourceAsStream("META-INF/deployment.xml");
-         if (in != null)
-         {
-            try
-            {
-               XmlFileLoader xfl = new XmlFileLoader();
-               Element jboss = xfl.getDocument(in, "META-INF/deployment.xml").getDocumentElement();
-               // Check for a ejb level class loading config
-               Iterator depends = MetaData.getChildrenByTagName(jboss, "depends");
-               if (depends != null)
-               {
-                  while (depends.hasNext())
-                  {
-                     Element depend = (Element)depends.next();
-                     ObjectName depOn = new ObjectName(MetaData.getElementContent(depend));
-                     deps.add(depOn);
-                  }
-               }
-
-            }
-            finally
-            {
-               in.close();
-            }
-         }
-
-         InputStream inputStream = document.openStream();
-         String jbossEsbXml = Configuration.getStringFromStream(inputStream);
-         inputStream.close();
-         JBoss4ESBDeployment deployment = new JBoss4ESBDeployment(jbossEsbXml);
-         deployment.setClassloader(di.ucl);
-         String name = "jboss.esb:deployment=" + di.shortName;
-         ObjectName on = ObjectNameConverter.convert(name);
-         // Check that the name is not registered
-         if (server.isRegistered(on) == true)
-         {
-            log.debug("The ESBModule name: " + name
-                      + "is already registered, adding uid=" + System.identityHashCode(deployment));
-            name = name + ",uid=" + System.identityHashCode(deployment);
-            on = ObjectNameConverter.convert(name);
-         }
-         server.registerMBean(deployment, on);
-         di.deployedObject = on;
-         log.debug("Deploying: " + di.url);
-         // Invoke the create life cycle method
-         serviceController.create(di.deployedObject, deps);
-      }
-      catch (Exception e)
-      {
-         throw new DeploymentException("Error during create of ESB Module: "
-                 + di.url, e);
-      }
-      super.create(di);
-   }
-
-   public synchronized void start(DeploymentInfo di)
-           throws DeploymentException
-   {
-      try
-      {
-         serviceController.start(di.deployedObject);
-      }
-      catch (Exception e)
-      {
-         try
-         {
-            stop(di);
-            destroy(di);
-         }
-         catch (DeploymentException ignore)
-         {
-         }
-         throw new DeploymentException("Error during start of ESB Module: "
-                 + di.url, e);
-      }
-
-      super.start(di);
-   }
-
-   public void stop(DeploymentInfo di)
-           throws DeploymentException
-   {
-      if (di.deployedObject != null)
-      {
-         try
-         {
-            serviceController.stop(di.deployedObject);
-         }
-         catch (Exception e)
-         {
-            throw new DeploymentException("Error during stop of ESB Module: "
-                    + di.url, e);
-         }
-      }
-      super.stop(di);
-   }
-
-   public void destroy(DeploymentInfo di)
-           throws DeploymentException
-   {
-      if (di.deployedObject != null)
-      {
-         try
-         {
-            serviceController.destroy(di.deployedObject);
-            server.unregisterMBean(di.deployedObject);
-         }
-         catch (Exception e)
-         {
-            throw new DeploymentException("Error during stop of ESB Module: "
-                    + di.url, e);
-         }
-      }
-      super.destroy(di);
-   }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,323 @@
+/*
+* 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.config;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.URL;
+import java.util.ArrayList;
+import java.util.Iterator;
+
+import javax.management.ObjectName;
+
+import org.jboss.deployment.DeploymentException;
+import org.jboss.deployment.DeploymentInfo;
+import org.jboss.deployment.SubDeployer;
+import org.jboss.deployment.SubDeployerSupport;
+import org.jboss.logging.Logger;
+import org.jboss.metadata.MetaData;
+import org.jboss.metadata.XmlFileLoader;
+import org.jboss.mx.loading.LoaderRepositoryFactory;
+import org.jboss.mx.util.MBeanProxyExt;
+import org.jboss.mx.util.ObjectNameConverter;
+import org.jboss.system.ServiceControllerMBean;
+import org.w3c.dom.Element;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBoss4ESBDeployer extends SubDeployerSupport
+        implements SubDeployer, JBoss4ESBDeployerMBean
+{
+   private final static Logger log = Logger.getLogger(JBoss4ESBDeployer.class);
+
+   private ServiceControllerMBean serviceController;
+   
+   /**
+    * Default CTOR used to set default values to the Suffixes and RelativeOrder
+    * attributes. Those are read at subdeployer registration time by the MainDeployer
+    * to alter its SuffixOrder.
+    */
+   public JBoss4ESBDeployer()
+   {
+      setSuffixes(new String[]{".esb"});
+      setRelativeOrder(1000); // before old EJB 2.1 deployer
+   }
+
+   public static boolean hasFile(DeploymentInfo di, String filePath)
+   {
+      String urlStr = di.url.getFile();
+      try
+      {
+         URL dd = di.localCl.findResource(filePath);
+         if (dd != null)
+         {
+
+            // If the DD url is not a subset of the urlStr then this is coming
+            // from a jar referenced by the deployment jar manifest and the
+            // this deployment jar it should not be treated as persistence
+            if (di.localUrl != null)
+            {
+               urlStr = di.localUrl.toString();
+            }
+
+            String ddStr = dd.toString();
+            if (ddStr.indexOf(urlStr) >= 0)
+            {
+               return true;
+            }
+         }
+      }
+      catch (Exception ignore)
+      {
+      }
+      return false;
+   }
+
+   /**
+    * Returns true if this deployer can deploy the given DeploymentInfo.
+    *
+    * @return True if this deployer can deploy the given DeploymentInfo.
+    * @jmx:managed-operation
+    */
+   public boolean accepts(DeploymentInfo di)
+   {
+      String urlStr = di.url.toString();
+      return urlStr.endsWith(".esb") || urlStr.endsWith(".esb/") ||
+              urlStr.endsWith("-esb.xml");
+   }
+
+   /**
+    * Get a reference to the ServiceController
+    */
+   protected void startService() throws Exception
+   {
+      serviceController = (ServiceControllerMBean)
+              MBeanProxyExt.create(ServiceControllerMBean.class,
+                      ServiceControllerMBean.OBJECT_NAME, server);
+
+      mainDeployer.addDeployer(this);
+   }
+
+
+   protected URL getDocumentUrl(DeploymentInfo di)
+   {
+      String urlStr = di.url.toString();
+      if (urlStr.endsWith(".esb") || urlStr.endsWith(".esb/"))
+      {
+         return di.localCl.getResource("META-INF/jboss-esb.xml");
+      }
+      return di.url;
+   }
+
+   public void init(DeploymentInfo di) throws DeploymentException
+   {
+      try
+      {
+         if (di.url.getProtocol().equalsIgnoreCase("file"))
+         {
+            File file = new File(di.url.getFile());
+
+            if (!file.isDirectory())
+            {
+               // If not directory we watch the package
+               di.watch = di.url;
+            }
+            else
+            {
+               // If directory we watch the xml files
+               di.watch = new URL(di.url, "META-INF/jboss-esb.xml");
+            }
+         }
+         else
+         {
+            // We watch the top only, no directory support
+            di.watch = di.url;
+         }
+
+         XmlFileLoader xfl = new XmlFileLoader();
+         InputStream in = di.localCl.getResourceAsStream("META-INF/deployment.xml");
+         if (in != null)
+         {
+            try
+            {
+               Element jboss = xfl.getDocument(in, "META-INF/esb-deployment.xml").getDocumentElement();
+               // Check for a ejb level class loading config
+               Element loader = MetaData.getOptionalChild(jboss, "loader-repository");
+               if (loader != null)
+               {
+                  LoaderRepositoryFactory.LoaderRepositoryConfig config =
+                          LoaderRepositoryFactory.parseRepositoryConfig(loader);
+                  di.setRepositoryInfo(config);
+               }
+
+            }
+            finally
+            {
+               in.close();
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         if (e instanceof DeploymentException)
+         {
+            throw(DeploymentException) e;
+         }
+         throw new DeploymentException("failed to initialize", e);
+      }
+
+      // invoke super-class initialization
+      super.init(di);
+   }
+
+   public synchronized void create(DeploymentInfo di) throws DeploymentException
+   {
+      log.info("create esb service, " + di.shortName);
+      URL document = getDocumentUrl(di);
+      if (document == null)
+      {
+         throw new DeploymentException("Unable to find document url of META-INF/jboss-esb.xml in: "
+                 + di.url);
+      }
+      try
+      {
+         ArrayList<ObjectName> deps = new ArrayList<ObjectName>();
+         InputStream in = di.localCl.getResourceAsStream("META-INF/deployment.xml");
+         if (in != null)
+         {
+            try
+            {
+               XmlFileLoader xfl = new XmlFileLoader();
+               Element jboss = xfl.getDocument(in, "META-INF/deployment.xml").getDocumentElement();
+               // Check for a ejb level class loading config
+               Iterator depends = MetaData.getChildrenByTagName(jboss, "depends");
+               if (depends != null)
+               {
+                  while (depends.hasNext())
+                  {
+                     Element depend = (Element)depends.next();
+                     ObjectName depOn = new ObjectName(MetaData.getElementContent(depend));
+                     deps.add(depOn);
+                  }
+               }
+
+            }
+            finally
+            {
+               in.close();
+            }
+         }
+
+         InputStream inputStream = document.openStream();
+         String jbossEsbXml = Configuration.getStringFromStream(inputStream);
+         inputStream.close();
+         JBoss4ESBDeployment deployment = new JBoss4ESBDeployment(jbossEsbXml);
+         deployment.setClassloader(di.ucl);
+         String name = "jboss.esb:deployment=" + di.shortName;
+         ObjectName on = ObjectNameConverter.convert(name);
+         // Check that the name is not registered
+         if (server.isRegistered(on) == true)
+         {
+            log.debug("The ESBModule name: " + name
+                      + "is already registered, adding uid=" + System.identityHashCode(deployment));
+            name = name + ",uid=" + System.identityHashCode(deployment);
+            on = ObjectNameConverter.convert(name);
+         }
+         server.registerMBean(deployment, on);
+         di.deployedObject = on;
+         log.debug("Deploying: " + di.url);
+         // Invoke the create life cycle method
+         serviceController.create(di.deployedObject, deps);
+      }
+      catch (Exception e)
+      {
+         throw new DeploymentException("Error during create of ESB Module: "
+                 + di.url, e);
+      }
+      super.create(di);
+   }
+
+   public synchronized void start(DeploymentInfo di)
+           throws DeploymentException
+   {
+      try
+      {
+         serviceController.start(di.deployedObject);
+      }
+      catch (Exception e)
+      {
+         try
+         {
+            stop(di);
+            destroy(di);
+         }
+         catch (DeploymentException ignore)
+         {
+         }
+         throw new DeploymentException("Error during start of ESB Module: "
+                 + di.url, e);
+      }
+
+      super.start(di);
+   }
+
+   public void stop(DeploymentInfo di)
+           throws DeploymentException
+   {
+      if (di.deployedObject != null)
+      {
+         try
+         {
+            serviceController.stop(di.deployedObject);
+         }
+         catch (Exception e)
+         {
+            throw new DeploymentException("Error during stop of ESB Module: "
+                    + di.url, e);
+         }
+      }
+      super.stop(di);
+   }
+
+   public void destroy(DeploymentInfo di)
+           throws DeploymentException
+   {
+      if (di.deployedObject != null)
+      {
+         try
+         {
+            serviceController.destroy(di.deployedObject);
+            server.unregisterMBean(di.deployedObject);
+         }
+         catch (Exception e)
+         {
+            throw new DeploymentException("Error during stop of ESB Module: "
+                    + di.url, e);
+         }
+      }
+      super.destroy(di);
+   }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,34 +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.config;
-
-import org.jboss.deployment.SubDeployerMBean;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public interface JBoss4ESBDeployerMBean extends SubDeployerMBean
-{
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployerMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,34 @@
+/*
+* 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.config;
+
+import org.jboss.deployment.SubDeployerMBean;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface JBoss4ESBDeployerMBean extends SubDeployerMBean
+{
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,104 +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.config;
-
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
-import org.jboss.system.ServiceMBeanSupport;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class JBoss4ESBDeployment extends ServiceMBeanSupport implements JBoss4ESBDeploymentMBean
-{
-   private String jbossEsbXml;
-   private ManagedLifecycleController controller;
-   private ClassLoader classloader;
-
-
-   public JBoss4ESBDeployment(String jbossEsbXml)
-   {
-      this.jbossEsbXml = jbossEsbXml;
-   }
-
-   public String getJbossEsbXml()
-   {
-      return jbossEsbXml;
-   }
-
-   public String getJbossEsbXmlAsHtml()
-   {
-      return jbossEsbXml.replace("<", "&lt;").replace(">", "&gt;");
-   }
-
-
-   public void setClassloader(ClassLoader classloader)
-   {
-      this.classloader = classloader;
-   }
-
-   public ManagedLifecycleController getController()
-   {
-      return controller;
-   }
-
-   @Override
-   public void createService()
-   {
-   }
-
-   @Override
-   public void startService() throws Exception
-   {
-      ClassLoader old = Thread.currentThread().getContextClassLoader();
-      try
-      {
-         Thread.currentThread().setContextClassLoader(classloader);
-         controller = Configuration.create(jbossEsbXml);
-         controller.start();
-      }
-      finally
-      {
-         Thread.currentThread().setContextClassLoader(old);
-      }
-
-   }
-
-   @Override
-   public void stopService() throws Exception
-   {
-      ClassLoader old = Thread.currentThread().getContextClassLoader();
-      try
-      {
-         Thread.currentThread().setContextClassLoader(classloader);
-         ServicePublisher.removeServicePublishers(controller);          
-         controller.stop();
-      }
-      finally
-      {
-         Thread.currentThread().setContextClassLoader(old);
-      }
-   }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeployment.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,104 @@
+/*
+* 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.config;
+
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+import org.jboss.system.ServiceMBeanSupport;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBoss4ESBDeployment extends ServiceMBeanSupport implements JBoss4ESBDeploymentMBean
+{
+   private String jbossEsbXml;
+   private ManagedLifecycleController controller;
+   private ClassLoader classloader;
+
+
+   public JBoss4ESBDeployment(String jbossEsbXml)
+   {
+      this.jbossEsbXml = jbossEsbXml;
+   }
+
+   public String getJbossEsbXml()
+   {
+      return jbossEsbXml;
+   }
+
+   public String getJbossEsbXmlAsHtml()
+   {
+      return jbossEsbXml.replace("<", "&lt;").replace(">", "&gt;");
+   }
+
+
+   public void setClassloader(ClassLoader classloader)
+   {
+      this.classloader = classloader;
+   }
+
+   public ManagedLifecycleController getController()
+   {
+      return controller;
+   }
+
+   @Override
+   public void createService()
+   {
+   }
+
+   @Override
+   public void startService() throws Exception
+   {
+      ClassLoader old = Thread.currentThread().getContextClassLoader();
+      try
+      {
+         Thread.currentThread().setContextClassLoader(classloader);
+         controller = Configuration.create(jbossEsbXml);
+         controller.start();
+      }
+      finally
+      {
+         Thread.currentThread().setContextClassLoader(old);
+      }
+
+   }
+
+   @Override
+   public void stopService() throws Exception
+   {
+      ClassLoader old = Thread.currentThread().getContextClassLoader();
+      try
+      {
+         Thread.currentThread().setContextClassLoader(classloader);
+         ServicePublisher.removeServicePublishers(controller);          
+         controller.stop();
+      }
+      finally
+      {
+         Thread.currentThread().setContextClassLoader(old);
+      }
+   }
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,39 +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.config;
-
-import org.jboss.system.ServiceMBean;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public interface JBoss4ESBDeploymentMBean extends ServiceMBean
-{
-   String getJbossEsbXml()
-           ;
-
-   String getJbossEsbXmlAsHtml()
-           ;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/JBoss4ESBDeploymentMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,39 @@
+/*
+* 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.config;
+
+import org.jboss.system.ServiceMBean;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface JBoss4ESBDeploymentMBean extends ServiceMBean
+{
+   String getJbossEsbXml()
+           ;
+
+   String getJbossEsbXmlAsHtml()
+           ;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.listeners.config;
-
-import java.util.Collection;
-
-import javax.xml.transform.stream.StreamSource;
-
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-
-public class MockXmlValidatorImpl implements XmlValidator
-{
-
-	public Collection<String> getValidationResults() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	public Document getXMLDocument() {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	public boolean validate(InputSource xmlInputSource) throws XmlValidatorException {
-		// TODO Auto-generated method stub
-		return true;
-	}
-
-	public boolean validate(InputSource xmlInputSource, StreamSource validationSource) throws XmlValidatorException {
-		// TODO Auto-generated method stub
-		return false;
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.listeners.config;
+
+import java.util.Collection;
+
+import javax.xml.transform.stream.StreamSource;
+
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+
+public class MockXmlValidatorImpl implements XmlValidator
+{
+
+	public Collection<String> getValidationResults() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public Document getXMLDocument() {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public boolean validate(InputSource xmlInputSource) throws XmlValidatorException {
+		// TODO Auto-generated method stub
+		return true;
+	}
+
+	public boolean validate(InputSource xmlInputSource, StreamSource validationSource) throws XmlValidatorException {
+		// TODO Auto-generated method stub
+		return false;
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,173 +0,0 @@
-package org.jboss.soa.esb.listeners.config;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.LinkedHashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.internal.soa.esb.publish.ActionContractPublisher;
-import org.jboss.internal.soa.esb.publish.ContractPublisher;
-import org.jboss.internal.soa.esb.publish.Publish;
-import org.jboss.soa.esb.listeners.config.ActionDocument.Action;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * Service contract publisher.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class ServicePublisher {
-
-    private String serviceName;
-    private String category;
-    private String description;
-    private ContractPublisher contractPublisher;
-    private static Map<ManagedLifecycleController, List<ServicePublisher>> servicePublishers = new LinkedHashMap<ManagedLifecycleController, List<ServicePublisher>>();
-
-    /**
-     * Public constructor.
-     *
-     * @param name     Service name.
-     * @param category Service category.
-     * @param contractPublisher Contract publisher implementation.
-     */
-    protected ServicePublisher(String name, String category, ContractPublisher contractPublisher) {
-        AssertArgument.isNotNullAndNotEmpty(name, "name");
-        AssertArgument.isNotNullAndNotEmpty(category, "category");
-
-        this.serviceName = name;
-        this.category = category;
-        this.contractPublisher = contractPublisher;
-    }
-
-    /**
-     * Get the service description.
-     * @return Service description.
-     */
-    public String getDescription() {
-        return description;
-    }
-
-    /**
-     * Set the service description.
-     * @param description Service description.
-     */
-    public void setDescription(String description) {
-        this.description = description;
-    }
-
-    /**
-     * Get the name of the Service.
-     *
-     * @return The service name.
-     */
-    public String getServiceName() {
-        return serviceName;
-    }
-
-    /**
-     * Get the Service category.
-     *
-     * @return The service category.
-     */
-    public String getCategory() {
-        return category;
-    }
-
-    /**
-     * Get the contract publisher for the Service associated with this publisher.
-     *
-     * @return The contract publisher.
-     */
-    public ContractPublisher getContractPublisher() {
-        return contractPublisher;
-    }
-
-    /**
-     * Add service publication from the suppplied configuration, keying them under the
-     * controller that is managing these services.
-     * <p/>
-     * This is used later to publish as service list, their EPRs (from the reg),
-     * links to their contract definitions, and the contract definitions
-     * (e.g. wsdls) themselves.
-     *
-     * @param model The configuration model.
-     */
-    public static void addServicePublishers(ManagedLifecycleController controller, XMLBeansModel model) {
-        List<Service> serviceConfigs = model.getServices();
-        List<ServicePublisher> publishers = new ArrayList<ServicePublisher>();
-
-        publishers.clear();
-        for (Service service : serviceConfigs) {
-            ContractPublisher contractPublisher = getConractPublisher(service);
-            ServicePublisher servicePublisher = new ServicePublisher(service.getName(), service.getCategory(), contractPublisher);
-
-            servicePublisher.setDescription(service.getDescription());
-            publishers.add(servicePublisher);
-        }
-
-        servicePublishers.put(controller, publishers);
-    }
-
-    /**
-     * Get the full list of publishers registered against all active {@link ManagedLifecycleController}
-     * instances.
-     * @return The full list of publishers.
-     */
-    public static List<ServicePublisher> getServicePublishers() {
-        List<ServicePublisher> publishers = new ArrayList<ServicePublisher>();
-        Collection<List<ServicePublisher>> allPublishers = servicePublishers.values();
-
-        for(List<ServicePublisher> curPublisherList : allPublishers) {
-            publishers.addAll(curPublisherList);
-        }
-
-        return publishers;
-    }
-
-    /**
-     * Remove the service publications for the services under the control of the supplied controller.
-     * @param controller Controller.
-     */
-    public static void removeServicePublishers(ManagedLifecycleController controller) {
-        servicePublishers.remove(controller);
-    }
-
-    @SuppressWarnings("unchecked")
-    private static ContractPublisher getConractPublisher(Service service) {
-        for (Action action : service.getActions().getActionList()) {
-            Class<Class> actionClass;
-
-            try {
-                actionClass = (Class<Class>) ClassUtil.forName(action.getClass1(), ServicePublisher.class);
-            } catch (ClassNotFoundException e) {
-                throw new RuntimeException("Failed to find action class '" + action.getClass1() + "'.");
-            }
-
-            Publish publishAnnotation = (Publish) actionClass.getAnnotation(Publish.class);
-            if (publishAnnotation != null) {
-                Class publisherClass;
-                ActionContractPublisher publisher = null;
-
-                publisherClass = publishAnnotation.value();
-                try {
-                    publisher = (ActionContractPublisher) publisherClass.newInstance();
-                    publisher.setActionConfig(action);
-                    return publisher;
-                } catch (ClassCastException e) {
-                    throw new RuntimeException("Action Contract Publisher class '" + publisherClass.getName() + "' must implement " + ActionContractPublisher.class.getName());
-                } catch (Exception e) {
-                    throw new RuntimeException("Failed to instantiate Contract Publisher '" + publisherClass.getName() + "'. Class must implement a public default constructor.", e);
-                }
-            }
-        }
-
-        // No publisher configured on any of the actions in the processing chain...
-        return null;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/ServicePublisher.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,173 @@
+package org.jboss.soa.esb.listeners.config;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.LinkedHashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.internal.soa.esb.publish.ActionContractPublisher;
+import org.jboss.internal.soa.esb.publish.ContractPublisher;
+import org.jboss.internal.soa.esb.publish.Publish;
+import org.jboss.soa.esb.listeners.config.ActionDocument.Action;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Service contract publisher.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ServicePublisher {
+
+    private String serviceName;
+    private String category;
+    private String description;
+    private ContractPublisher contractPublisher;
+    private static Map<ManagedLifecycleController, List<ServicePublisher>> servicePublishers = new LinkedHashMap<ManagedLifecycleController, List<ServicePublisher>>();
+
+    /**
+     * Public constructor.
+     *
+     * @param name     Service name.
+     * @param category Service category.
+     * @param contractPublisher Contract publisher implementation.
+     */
+    protected ServicePublisher(String name, String category, ContractPublisher contractPublisher) {
+        AssertArgument.isNotNullAndNotEmpty(name, "name");
+        AssertArgument.isNotNullAndNotEmpty(category, "category");
+
+        this.serviceName = name;
+        this.category = category;
+        this.contractPublisher = contractPublisher;
+    }
+
+    /**
+     * Get the service description.
+     * @return Service description.
+     */
+    public String getDescription() {
+        return description;
+    }
+
+    /**
+     * Set the service description.
+     * @param description Service description.
+     */
+    public void setDescription(String description) {
+        this.description = description;
+    }
+
+    /**
+     * Get the name of the Service.
+     *
+     * @return The service name.
+     */
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    /**
+     * Get the Service category.
+     *
+     * @return The service category.
+     */
+    public String getCategory() {
+        return category;
+    }
+
+    /**
+     * Get the contract publisher for the Service associated with this publisher.
+     *
+     * @return The contract publisher.
+     */
+    public ContractPublisher getContractPublisher() {
+        return contractPublisher;
+    }
+
+    /**
+     * Add service publication from the suppplied configuration, keying them under the
+     * controller that is managing these services.
+     * <p/>
+     * This is used later to publish as service list, their EPRs (from the reg),
+     * links to their contract definitions, and the contract definitions
+     * (e.g. wsdls) themselves.
+     *
+     * @param model The configuration model.
+     */
+    public static void addServicePublishers(ManagedLifecycleController controller, XMLBeansModel model) {
+        List<Service> serviceConfigs = model.getServices();
+        List<ServicePublisher> publishers = new ArrayList<ServicePublisher>();
+
+        publishers.clear();
+        for (Service service : serviceConfigs) {
+            ContractPublisher contractPublisher = getConractPublisher(service);
+            ServicePublisher servicePublisher = new ServicePublisher(service.getName(), service.getCategory(), contractPublisher);
+
+            servicePublisher.setDescription(service.getDescription());
+            publishers.add(servicePublisher);
+        }
+
+        servicePublishers.put(controller, publishers);
+    }
+
+    /**
+     * Get the full list of publishers registered against all active {@link ManagedLifecycleController}
+     * instances.
+     * @return The full list of publishers.
+     */
+    public static List<ServicePublisher> getServicePublishers() {
+        List<ServicePublisher> publishers = new ArrayList<ServicePublisher>();
+        Collection<List<ServicePublisher>> allPublishers = servicePublishers.values();
+
+        for(List<ServicePublisher> curPublisherList : allPublishers) {
+            publishers.addAll(curPublisherList);
+        }
+
+        return publishers;
+    }
+
+    /**
+     * Remove the service publications for the services under the control of the supplied controller.
+     * @param controller Controller.
+     */
+    public static void removeServicePublishers(ManagedLifecycleController controller) {
+        servicePublishers.remove(controller);
+    }
+
+    @SuppressWarnings("unchecked")
+    private static ContractPublisher getConractPublisher(Service service) {
+        for (Action action : service.getActions().getActionList()) {
+            Class<Class> actionClass;
+
+            try {
+                actionClass = (Class<Class>) ClassUtil.forName(action.getClass1(), ServicePublisher.class);
+            } catch (ClassNotFoundException e) {
+                throw new RuntimeException("Failed to find action class '" + action.getClass1() + "'.");
+            }
+
+            Publish publishAnnotation = (Publish) actionClass.getAnnotation(Publish.class);
+            if (publishAnnotation != null) {
+                Class publisherClass;
+                ActionContractPublisher publisher = null;
+
+                publisherClass = publishAnnotation.value();
+                try {
+                    publisher = (ActionContractPublisher) publisherClass.newInstance();
+                    publisher.setActionConfig(action);
+                    return publisher;
+                } catch (ClassCastException e) {
+                    throw new RuntimeException("Action Contract Publisher class '" + publisherClass.getName() + "' must implement " + ActionContractPublisher.class.getName());
+                } catch (Exception e) {
+                    throw new RuntimeException("Failed to instantiate Contract Publisher '" + publisherClass.getName() + "'. Class must implement a public default constructor.", e);
+                }
+            }
+        }
+
+        // No publisher configured on any of the actions in the processing chain...
+        return null;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidator.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,68 +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.config;
-
-import java.util.Collection;
-
-import javax.xml.transform.stream.StreamSource;
-
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-/**
- * Interface for validating an xml given it's xsd or dtd.
- * 
- * @author kstam
- * @author ddegroff
- *
- */
-public interface XmlValidator 
-{
-	/**
-	 * Validates an xml for it's wellformedness.
-	 * 
-	 * @param xmlInputSource of the xml that needs to be validated.
-	 * @return boolean, true if  it passed validation, false if it failed.
-	 * @throws XmlValidatorException
-	 */
-	public boolean validate(InputSource xmlInputSource) throws XmlValidatorException;
-	/**
-	 * Validates an xml using the xsd or dtd given in the second argument.
-	 * 
-	 * @param xmlInputSource of the xml that needs to be validated.
-	 * @param validationSource to the xsd or dtd.
-	 * @return boolean, true if  it passed validation, false if it failed.
-	 * @throws XmlValidatorException
-	 */
-	public boolean validate(InputSource xmlInputSource, StreamSource validationSource) throws XmlValidatorException;
-	/**
-	 * If the validation fails, more details can be obtained about the reasons why.
-	 * 
-	 * @return Collection Strings
-	 */
-	public Collection<String> getValidationResults();
-	/**
-	 * After validation the parsed document can be obtained for further processing.
-	 * 
-	 * @return Document, the parsed XML Document.
-	 */
-	public Document getXMLDocument();
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidator.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidator.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,68 @@
+/*
+ * 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.config;
+
+import java.util.Collection;
+
+import javax.xml.transform.stream.StreamSource;
+
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+/**
+ * Interface for validating an xml given it's xsd or dtd.
+ * 
+ * @author kstam
+ * @author ddegroff
+ *
+ */
+public interface XmlValidator 
+{
+	/**
+	 * Validates an xml for it's wellformedness.
+	 * 
+	 * @param xmlInputSource of the xml that needs to be validated.
+	 * @return boolean, true if  it passed validation, false if it failed.
+	 * @throws XmlValidatorException
+	 */
+	public boolean validate(InputSource xmlInputSource) throws XmlValidatorException;
+	/**
+	 * Validates an xml using the xsd or dtd given in the second argument.
+	 * 
+	 * @param xmlInputSource of the xml that needs to be validated.
+	 * @param validationSource to the xsd or dtd.
+	 * @return boolean, true if  it passed validation, false if it failed.
+	 * @throws XmlValidatorException
+	 */
+	public boolean validate(InputSource xmlInputSource, StreamSource validationSource) throws XmlValidatorException;
+	/**
+	 * If the validation fails, more details can be obtained about the reasons why.
+	 * 
+	 * @return Collection Strings
+	 */
+	public Collection<String> getValidationResults();
+	/**
+	 * After validation the parsed document can be obtained for further processing.
+	 * 
+	 * @return Document, the parsed XML Document.
+	 */
+	public Document getXMLDocument();
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,42 +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.config;
-
-/**
- * @author Kurt Stam
- *
- */
-public class XmlValidatorException extends Exception {
-    private static final long serialVersionUID = 1L;
-    
-    public XmlValidatorException(){
-        super();
-    }
-    
-    public XmlValidatorException (String msg){
-        super(msg);
-    }
-    
-    public XmlValidatorException (String msg, Throwable cause){
-        super (msg, cause);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,42 @@
+/*
+ * 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.config;
+
+/**
+ * @author Kurt Stam
+ *
+ */
+public class XmlValidatorException extends Exception {
+    private static final long serialVersionUID = 1L;
+    
+    public XmlValidatorException(){
+        super();
+    }
+    
+    public XmlValidatorException (String msg){
+        super(msg);
+    }
+    
+    public XmlValidatorException (String msg, Throwable cause){
+        super (msg, cause);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,229 +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.config;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Collection;
-import java.util.HashSet;
-
-import javax.xml.XMLConstants;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.Source;
-import javax.xml.transform.stream.StreamSource;
-import javax.xml.validation.Schema;
-import javax.xml.validation.SchemaFactory;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.w3c.dom.Document;
-import org.xml.sax.ErrorHandler;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * A Helper classes used to validate xml files against supplied schemas.
- * 
- * @author $Revision$ $Id$
- */
- at SuppressWarnings("unchecked")
-public class XmlValidatorImpl implements XmlValidator {
-
-	/**
-	 * Our Logger
-	 */
-	private Logger log = Logger.getLogger(this.getClass());
-
-	@SuppressWarnings("unused")
-	private InputSource xmlSource, validationSource;
-
-	private String defaultSchema = "etc/schemas/xml/jbossesb-1.0.1.xsd";
-	/**
-	 * The path separator
-	 */
-	@SuppressWarnings("unused")
-	private static String SEP = System.getProperty("file.separator");
-
-	private boolean isValid = true;
-
-	private Collection<String> validationResults = new HashSet();
-
-	private Document xmlDocument;
-
-	public XmlValidatorImpl() {
-		File defaultSchemaFile = new File (defaultSchema);
-		if (defaultSchemaFile.exists()) {
-			log.debug("defaultSchema "+defaultSchema+" exists");
-		}
-	}
-
-	public XmlValidatorImpl(InputSource xmlSource) {
-		setXMLDocument(xmlSource);		
-
-		File defaultSchemaFile = new File (defaultSchema);
-		if (defaultSchemaFile.exists()) {
-			log.debug("defaultSchema "+defaultSchema+" exists");
-		}
-	}
-
-	/**
-	 * Validation method used to validate an xml file against a default xsd
-	 * (jbossesb-1.0.1.xsd).
-	 * 
-	 * @param xmlSource
-	 *            The xml input source to be validated.
-	 * @return Boolean true/false indicating successful validation.
-	 * @throws XmlValidatorException
-	 *             Failure during validation.
-	 */
-	public boolean validate(InputSource xmlSource) throws XmlValidatorException {
-		StreamSource validationInputSource = null;
-
-		InputStream validationInputStream = ClassUtil.getResourceAsStream(defaultSchema, getClass());
-		// if this fails try using the
-		if (validationInputStream==null) {
-			File validationFile = new File(defaultSchema);
-			log.debug("Validation file " + defaultSchema + " exists?:" + validationFile.exists());
-			try {
-				validationInputStream = new FileInputStream(validationFile);
-			} catch (FileNotFoundException e) {
-				log.error(e.getMessage(),e);
-			}
-		}
-		if (validationInputStream==null) {
-			log.warn("Could not obtain validation file " + defaultSchema);
-		} else {
-			log.debug("Reading validation info from " + defaultSchema);
-			validationInputSource = new StreamSource(validationInputStream);
-		}
-		return validate(xmlSource,validationInputSource);
-	}
-
-	/**
-	 * Validation method used to validate an xml input source against an xsd
-	 * input source.
-	 * 
-	 * @param xmlSource
-	 *            The xml input source to be validated.
-	 * @param validationSource
-	 *            The schema input source to validate against.
-	 * @return Boolean true/false indicating successful validation.
-	 * @throws XmlValidationException
-	 *             Failure during validation.
-	 */
-	public boolean validate(InputSource xmlSource, StreamSource validationSource) throws XmlValidatorException 
-	{
-		try {
-			Schema schema = null;
-			SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
-			if (validationSource == null) {
-				Source schemaFile = new StreamSource(defaultSchema);
-				try {
-					schema = factory.newSchema(schemaFile);
-				} catch (SAXException e) {
-					log.error("Failed to validate xml: "+e);
-					isValid = false;
-				}
-			}
-			else {
-				schema = factory.newSchema(validationSource);
-			}
-			DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
-			builderFactory.setNamespaceAware(true);
-			builderFactory.setSchema(schema);
-			DocumentBuilder parser = null;
-			try {
-				parser = builderFactory.newDocumentBuilder();
-				parser.setErrorHandler(new XmlErrorHandler());
-			} catch (ParserConfigurationException e) {
-				log.error("ParserConfigurationException occurred: " + e.getMessage(),e); 
-				isValid = false;
-			}
-			try {
-				xmlDocument = parser.parse(xmlSource); 
-			} catch (IOException e) {
-				log.error("parser.parse(): IOException occurred: " + e.getMessage(),e); 
-				isValid = false;
-			}      
-		} catch (SAXException e) {
-			log.error("SAXException occurred: " + e.getMessage());
-			isValid = false;
-		}
-		return isValid;
-	}
-
-	class XmlErrorHandler implements ErrorHandler 
-	{
-		public void warning(SAXParseException exception) throws SAXException {
-			// Bring things to a crashing halt
-			validationResults.add("WARNING-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
-			log.warn("WARNING-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
-		}
-
-		public void error(SAXParseException exception) throws SAXException {
-			// Bring things to a crashing halt
-			validationResults.add("ERROR-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
-			log.error(validationResults.size()+"-ERROR-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
-			isValid = false;
-		}
-
-		public void fatalError(SAXParseException exception) throws SAXException {
-			// Bring things to a crashing halt
-			validationResults.add("FATAL-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
-			log.fatal("FATAL-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
-			isValid = false;
-		}
-	}
-
-	public Collection<String> getValidationResults() 
-	{
-		return validationResults;
-	}
-
-	public void setXMLDocument(InputSource xmlSource) 
-	{
-		try {       
-			DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder parser = builderFactory.newDocumentBuilder();
-
-			xmlDocument = parser.parse(xmlSource); 
-			log.info(xmlDocument.toString());
-		} catch (SAXException e) {
-			log.error(e.getMessage());
-		} catch (ParserConfigurationException e) {
-			log.error(e.getMessage());
-		} catch (IOException e) {
-			log.error(e.getMessage());
-		}      
-	}
-
-	public Document getXMLDocument() {
-		return xmlDocument;
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/XmlValidatorImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,229 @@
+/*
+ * 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.config;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Collection;
+import java.util.HashSet;
+
+import javax.xml.XMLConstants;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.Source;
+import javax.xml.transform.stream.StreamSource;
+import javax.xml.validation.Schema;
+import javax.xml.validation.SchemaFactory;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.w3c.dom.Document;
+import org.xml.sax.ErrorHandler;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/**
+ * A Helper classes used to validate xml files against supplied schemas.
+ * 
+ * @author $Revision$ $Id$
+ */
+ at SuppressWarnings("unchecked")
+public class XmlValidatorImpl implements XmlValidator {
+
+	/**
+	 * Our Logger
+	 */
+	private Logger log = Logger.getLogger(this.getClass());
+
+	@SuppressWarnings("unused")
+	private InputSource xmlSource, validationSource;
+
+	private String defaultSchema = "etc/schemas/xml/jbossesb-1.0.1.xsd";
+	/**
+	 * The path separator
+	 */
+	@SuppressWarnings("unused")
+	private static String SEP = System.getProperty("file.separator");
+
+	private boolean isValid = true;
+
+	private Collection<String> validationResults = new HashSet();
+
+	private Document xmlDocument;
+
+	public XmlValidatorImpl() {
+		File defaultSchemaFile = new File (defaultSchema);
+		if (defaultSchemaFile.exists()) {
+			log.debug("defaultSchema "+defaultSchema+" exists");
+		}
+	}
+
+	public XmlValidatorImpl(InputSource xmlSource) {
+		setXMLDocument(xmlSource);		
+
+		File defaultSchemaFile = new File (defaultSchema);
+		if (defaultSchemaFile.exists()) {
+			log.debug("defaultSchema "+defaultSchema+" exists");
+		}
+	}
+
+	/**
+	 * Validation method used to validate an xml file against a default xsd
+	 * (jbossesb-1.0.1.xsd).
+	 * 
+	 * @param xmlSource
+	 *            The xml input source to be validated.
+	 * @return Boolean true/false indicating successful validation.
+	 * @throws XmlValidatorException
+	 *             Failure during validation.
+	 */
+	public boolean validate(InputSource xmlSource) throws XmlValidatorException {
+		StreamSource validationInputSource = null;
+
+		InputStream validationInputStream = ClassUtil.getResourceAsStream(defaultSchema, getClass());
+		// if this fails try using the
+		if (validationInputStream==null) {
+			File validationFile = new File(defaultSchema);
+			log.debug("Validation file " + defaultSchema + " exists?:" + validationFile.exists());
+			try {
+				validationInputStream = new FileInputStream(validationFile);
+			} catch (FileNotFoundException e) {
+				log.error(e.getMessage(),e);
+			}
+		}
+		if (validationInputStream==null) {
+			log.warn("Could not obtain validation file " + defaultSchema);
+		} else {
+			log.debug("Reading validation info from " + defaultSchema);
+			validationInputSource = new StreamSource(validationInputStream);
+		}
+		return validate(xmlSource,validationInputSource);
+	}
+
+	/**
+	 * Validation method used to validate an xml input source against an xsd
+	 * input source.
+	 * 
+	 * @param xmlSource
+	 *            The xml input source to be validated.
+	 * @param validationSource
+	 *            The schema input source to validate against.
+	 * @return Boolean true/false indicating successful validation.
+	 * @throws XmlValidationException
+	 *             Failure during validation.
+	 */
+	public boolean validate(InputSource xmlSource, StreamSource validationSource) throws XmlValidatorException 
+	{
+		try {
+			Schema schema = null;
+			SchemaFactory factory = SchemaFactory.newInstance(XMLConstants.W3C_XML_SCHEMA_NS_URI);
+			if (validationSource == null) {
+				Source schemaFile = new StreamSource(defaultSchema);
+				try {
+					schema = factory.newSchema(schemaFile);
+				} catch (SAXException e) {
+					log.error("Failed to validate xml: "+e);
+					isValid = false;
+				}
+			}
+			else {
+				schema = factory.newSchema(validationSource);
+			}
+			DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
+			builderFactory.setNamespaceAware(true);
+			builderFactory.setSchema(schema);
+			DocumentBuilder parser = null;
+			try {
+				parser = builderFactory.newDocumentBuilder();
+				parser.setErrorHandler(new XmlErrorHandler());
+			} catch (ParserConfigurationException e) {
+				log.error("ParserConfigurationException occurred: " + e.getMessage(),e); 
+				isValid = false;
+			}
+			try {
+				xmlDocument = parser.parse(xmlSource); 
+			} catch (IOException e) {
+				log.error("parser.parse(): IOException occurred: " + e.getMessage(),e); 
+				isValid = false;
+			}      
+		} catch (SAXException e) {
+			log.error("SAXException occurred: " + e.getMessage());
+			isValid = false;
+		}
+		return isValid;
+	}
+
+	class XmlErrorHandler implements ErrorHandler 
+	{
+		public void warning(SAXParseException exception) throws SAXException {
+			// Bring things to a crashing halt
+			validationResults.add("WARNING-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
+			log.warn("WARNING-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
+		}
+
+		public void error(SAXParseException exception) throws SAXException {
+			// Bring things to a crashing halt
+			validationResults.add("ERROR-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
+			log.error(validationResults.size()+"-ERROR-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
+			isValid = false;
+		}
+
+		public void fatalError(SAXParseException exception) throws SAXException {
+			// Bring things to a crashing halt
+			validationResults.add("FATAL-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
+			log.fatal("FATAL-"+exception.getSystemId()+"-"+exception.getLineNumber()+":"+exception.getMessage());        
+			isValid = false;
+		}
+	}
+
+	public Collection<String> getValidationResults() 
+	{
+		return validationResults;
+	}
+
+	public void setXMLDocument(InputSource xmlSource) 
+	{
+		try {       
+			DocumentBuilderFactory builderFactory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder parser = builderFactory.newDocumentBuilder();
+
+			xmlDocument = parser.parse(xmlSource); 
+			log.info(xmlDocument.toString());
+		} catch (SAXException e) {
+			log.error(e.getMessage());
+		} catch (ParserConfigurationException e) {
+			log.error(e.getMessage());
+		} catch (IOException e) {
+			log.error(e.getMessage());
+		}      
+	}
+
+	public Document getXMLDocument() {
+		return xmlDocument;
+	}
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,90 +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.config.mappers;
-
-import java.util.List;
-
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.config.ActionDocument.Action;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.PropertyDocument.Property;
-import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
-import org.w3c.dom.Element;
-
-/**
- * Performs the mapping of XSD based configuration service actions onto a "ConfigTree"
- * style listener configuration.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class ActionMapper {
-
-	/**
-	 * Perform the mapping.
-	 * @param listenerConfigTree The listener ConfigTree to which the actions are to be added.
-	 * @param listenerService The Service to which the listener is bound.  The Service defines the actions.
-	 * @param model The configuration model from which the mapping is being performed.
-	 */
-	public static void map(Element listenerConfigTree, Service listenerService, XMLBeansModel model) {
-		if (listenerService.getActions()!=null) {
-			List<Action> actions = listenerService.getActions().getActionList();
-			
-			for(Action action : actions) {
-				mapAction(listenerConfigTree, action);
-			}
-		}
-	}
-
-	/**
-	 * Map an action instance onto the listener ConfigTree.
-	 * @param listenerConfigTree The target listener ConfigTree.
-	 * @param action The action instance.
-	 */
-	private static void mapAction(Element listenerConfigTree, Action action) {
-		Element actionConfigTree = YADOMUtil.addElement(listenerConfigTree, "action");
-		List<Property> properties = action.getPropertyList();
-		
-		actionConfigTree.setAttribute(ListenerTagNames.ACTION_ELEMENT_TAG, action.getName());
-		actionConfigTree.setAttribute(ListenerTagNames.ACTION_CLASS_TAG, action.getClass1());
-		actionConfigTree.setAttribute(ListenerTagNames.PROCESS_METHOD_TAG, action.getProcess());
-		// The "okMethods" and "exceptionMethod" attributes are supported by adding them as child <property> elements.
-		
-		// Map the property elements to action attributes...
-		for(Property property : properties) {
-			Element propertyElement = listenerConfigTree.getOwnerDocument().createElement("property");
-			
-			MapperUtil.serialize(property, propertyElement);
-
-			// If the property has child content, add that directy to the action.  Of course it only really
-			// makes sense to do this with one property!
-			if(propertyElement.hasChildNodes()) {
-				YADOMUtil.copyChildNodes(propertyElement, actionConfigTree);
-			} else {
-				actionConfigTree.setAttribute(property.getName(), property.getValue());
-			}
-		}
-		
-		// Remove any empty attributes set on the action config...
-		YADOMUtil.removeEmptyAttributes(actionConfigTree);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/ActionMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,90 @@
+/*
+ * 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.config.mappers;
+
+import java.util.List;
+
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.ActionDocument.Action;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.PropertyDocument.Property;
+import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of XSD based configuration service actions onto a "ConfigTree"
+ * style listener configuration.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ActionMapper {
+
+	/**
+	 * Perform the mapping.
+	 * @param listenerConfigTree The listener ConfigTree to which the actions are to be added.
+	 * @param listenerService The Service to which the listener is bound.  The Service defines the actions.
+	 * @param model The configuration model from which the mapping is being performed.
+	 */
+	public static void map(Element listenerConfigTree, Service listenerService, XMLBeansModel model) {
+		if (listenerService.getActions()!=null) {
+			List<Action> actions = listenerService.getActions().getActionList();
+			
+			for(Action action : actions) {
+				mapAction(listenerConfigTree, action);
+			}
+		}
+	}
+
+	/**
+	 * Map an action instance onto the listener ConfigTree.
+	 * @param listenerConfigTree The target listener ConfigTree.
+	 * @param action The action instance.
+	 */
+	private static void mapAction(Element listenerConfigTree, Action action) {
+		Element actionConfigTree = YADOMUtil.addElement(listenerConfigTree, "action");
+		List<Property> properties = action.getPropertyList();
+		
+		actionConfigTree.setAttribute(ListenerTagNames.ACTION_ELEMENT_TAG, action.getName());
+		actionConfigTree.setAttribute(ListenerTagNames.ACTION_CLASS_TAG, action.getClass1());
+		actionConfigTree.setAttribute(ListenerTagNames.PROCESS_METHOD_TAG, action.getProcess());
+		// The "okMethods" and "exceptionMethod" attributes are supported by adding them as child <property> elements.
+		
+		// Map the property elements to action attributes...
+		for(Property property : properties) {
+			Element propertyElement = listenerConfigTree.getOwnerDocument().createElement("property");
+			
+			MapperUtil.serialize(property, propertyElement);
+
+			// If the property has child content, add that directy to the action.  Of course it only really
+			// makes sense to do this with one property!
+			if(propertyElement.hasChildNodes()) {
+				YADOMUtil.copyChildNodes(propertyElement, actionConfigTree);
+			} else {
+				actionConfigTree.setAttribute(property.getName(), property.getValue());
+			}
+		}
+		
+		// Remove any empty attributes set on the action config...
+		YADOMUtil.removeEmptyAttributes(actionConfigTree);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FsListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FsListenerMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FsListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,119 +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,
- */
-
-package org.jboss.soa.esb.listeners.config.mappers;
-
-import java.io.File;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.config.FsBusDocument.FsBus;
-import org.jboss.soa.esb.listeners.config.FsListenerDocument.FsListener;
-import org.jboss.soa.esb.listeners.config.FsMessageFilterDocument.FsMessageFilter;
-import org.jboss.soa.esb.listeners.config.FsProviderDocument.FsProvider;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.gateway.FileGatewayListener;
-import org.w3c.dom.Element;
-
-/**
- * Performs the mapping of a &lt;fs-listener&gt; XSD based configuration to the "ConfigTree"
- * style configuration, adding the "ConfigTree" listener config to the "root" node.
- * 
- * @author <a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>
- */
-public class FsListenerMapper {
-
-	/**
-	 * Perform the mapping.
-	 * @param root The "ConfigTree" configuration root node.
-	 * @param listener The Jmslistener to be mapped into the ConfigTree.
-	 * @param model The configuration model from which the mapping is being performed.
-	 * @return The ConfigTree listener configuration node.
-	 * @throws ConfigurationException Invalid listener configuration.
-	 */
-	public static Element map(Element root, FsListener listener, XMLBeansModel model) throws ConfigurationException {
-		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
-		FsBus bus;
-		FsProvider provider;
-		
-		try {
-			bus = (FsBus) model.getBus(listener.getBusidref());
-		} catch (ClassCastException e) {
-			throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <fs-listener> must reference a <fs-bus>.");
-		}
-		try {
-			provider = (FsProvider) model.getProvider(bus);
-		} catch (ClassCastException e) {
-			throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <fs-provider> instance.  Unexpected exception - this should have caused a validation error!");
-		}
-		
-		FsMessageFilter messageFilter = listener.getFsMessageFilter();
-		if(messageFilter == null) {
-			messageFilter = bus.getFsMessageFilter();
-			if(messageFilter == null) {
-				throw new ConfigurationException("No <fs-detination> defined on either <fs-listener> [" + listener.getName() + "] or <fs-bus> [" + bus.getBusid() + "].");
-			}
-		}
-		listenerNode.setAttribute("pollLatencySeconds", String.valueOf(listener.getPollFrequencySeconds()));
-		// Map the standard listener attributes - common across all listener types...
-		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
-		// Map the <property> elements targeted at the listener - from the listener itself.
-		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);			
-		if(listener.getIsGateway()) {
-			listenerNode.setAttribute("gatewayClass", FileGatewayListener.class.getName());
-			// Map EPR related attributes onto the listener - from the bus and provider and listener.
-			// Note: This will change - the Gateways will also support the EPR element...
-			mapFsEprProperties(listenerNode, provider, messageFilter);
-			MapperUtil.mapEPRProperties(listener, listenerNode, model);
-		} else {
-			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
-
-			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
-			mapFsEprProperties(eprNode, provider, messageFilter);
-			MapperUtil.mapEPRProperties(listener, eprNode, model);
-			// Remove any empty attributes set on the EPR config...
-			YADOMUtil.removeEmptyAttributes(eprNode);
-		}
-		
-		// Remove any empty attributes set on the listener config...
-		YADOMUtil.removeEmptyAttributes(listenerNode);
-		
-		return listenerNode;
-	}
-
-	private static void mapFsEprProperties(Element toElement, FsProvider provider, FsMessageFilter messageFilter) {
-		final File directory = new File(messageFilter.getDirectory()) ;
-		toElement.setAttribute(ListenerTagNames.URL_TAG, directory.toURI().toString());
-		toElement.setAttribute(FileEpr.INPUT_SUFFIX_TAG, messageFilter.getInputSuffix());
-		toElement.setAttribute(FileEpr.WORK_SUFFIX_TAG, messageFilter.getWorkSuffix());
-		toElement.setAttribute(FileEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
-		if (!messageFilter.getPostDelete()) {
-			toElement.setAttribute(FileEpr.POST_DIR_TAG, messageFilter.getPostDirectory());
-			toElement.setAttribute(FileEpr.POST_SUFFIX_TAG, messageFilter.getPostSuffix());
-		}
-		toElement.setAttribute(FileEpr.ERROR_DEL_TAG, String.valueOf(messageFilter.getErrorDelete()));
-		if (!messageFilter.getErrorDelete()) {
-			toElement.setAttribute(FileEpr.ERROR_DIR_TAG, messageFilter.getErrorDirectory());
-			toElement.setAttribute(FileEpr.ERROR_SUFFIX_TAG, messageFilter.getErrorSuffix());
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FsListenerMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FsListenerMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FsListenerMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FsListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,119 @@
+/*
+ * 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,
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers;
+
+import java.io.File;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.FsBusDocument.FsBus;
+import org.jboss.soa.esb.listeners.config.FsListenerDocument.FsListener;
+import org.jboss.soa.esb.listeners.config.FsMessageFilterDocument.FsMessageFilter;
+import org.jboss.soa.esb.listeners.config.FsProviderDocument.FsProvider;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.gateway.FileGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of a &lt;fs-listener&gt; XSD based configuration to the "ConfigTree"
+ * style configuration, adding the "ConfigTree" listener config to the "root" node.
+ * 
+ * @author <a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>
+ */
+public class FsListenerMapper {
+
+	/**
+	 * Perform the mapping.
+	 * @param root The "ConfigTree" configuration root node.
+	 * @param listener The Jmslistener to be mapped into the ConfigTree.
+	 * @param model The configuration model from which the mapping is being performed.
+	 * @return The ConfigTree listener configuration node.
+	 * @throws ConfigurationException Invalid listener configuration.
+	 */
+	public static Element map(Element root, FsListener listener, XMLBeansModel model) throws ConfigurationException {
+		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
+		FsBus bus;
+		FsProvider provider;
+		
+		try {
+			bus = (FsBus) model.getBus(listener.getBusidref());
+		} catch (ClassCastException e) {
+			throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <fs-listener> must reference a <fs-bus>.");
+		}
+		try {
+			provider = (FsProvider) model.getProvider(bus);
+		} catch (ClassCastException e) {
+			throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <fs-provider> instance.  Unexpected exception - this should have caused a validation error!");
+		}
+		
+		FsMessageFilter messageFilter = listener.getFsMessageFilter();
+		if(messageFilter == null) {
+			messageFilter = bus.getFsMessageFilter();
+			if(messageFilter == null) {
+				throw new ConfigurationException("No <fs-detination> defined on either <fs-listener> [" + listener.getName() + "] or <fs-bus> [" + bus.getBusid() + "].");
+			}
+		}
+		listenerNode.setAttribute("pollLatencySeconds", String.valueOf(listener.getPollFrequencySeconds()));
+		// Map the standard listener attributes - common across all listener types...
+		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+		// Map the <property> elements targeted at the listener - from the listener itself.
+		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);			
+		if(listener.getIsGateway()) {
+			listenerNode.setAttribute("gatewayClass", FileGatewayListener.class.getName());
+			// Map EPR related attributes onto the listener - from the bus and provider and listener.
+			// Note: This will change - the Gateways will also support the EPR element...
+			mapFsEprProperties(listenerNode, provider, messageFilter);
+			MapperUtil.mapEPRProperties(listener, listenerNode, model);
+		} else {
+			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+
+			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
+			mapFsEprProperties(eprNode, provider, messageFilter);
+			MapperUtil.mapEPRProperties(listener, eprNode, model);
+			// Remove any empty attributes set on the EPR config...
+			YADOMUtil.removeEmptyAttributes(eprNode);
+		}
+		
+		// Remove any empty attributes set on the listener config...
+		YADOMUtil.removeEmptyAttributes(listenerNode);
+		
+		return listenerNode;
+	}
+
+	private static void mapFsEprProperties(Element toElement, FsProvider provider, FsMessageFilter messageFilter) {
+		final File directory = new File(messageFilter.getDirectory()) ;
+		toElement.setAttribute(ListenerTagNames.URL_TAG, directory.toURI().toString());
+		toElement.setAttribute(FileEpr.INPUT_SUFFIX_TAG, messageFilter.getInputSuffix());
+		toElement.setAttribute(FileEpr.WORK_SUFFIX_TAG, messageFilter.getWorkSuffix());
+		toElement.setAttribute(FileEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
+		if (!messageFilter.getPostDelete()) {
+			toElement.setAttribute(FileEpr.POST_DIR_TAG, messageFilter.getPostDirectory());
+			toElement.setAttribute(FileEpr.POST_SUFFIX_TAG, messageFilter.getPostSuffix());
+		}
+		toElement.setAttribute(FileEpr.ERROR_DEL_TAG, String.valueOf(messageFilter.getErrorDelete()));
+		if (!messageFilter.getErrorDelete()) {
+			toElement.setAttribute(FileEpr.ERROR_DIR_TAG, messageFilter.getErrorDirectory());
+			toElement.setAttribute(FileEpr.ERROR_SUFFIX_TAG, messageFilter.getErrorSuffix());
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,137 +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,
- */
-
-package org.jboss.soa.esb.listeners.config.mappers;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.config.FtpBusDocument.FtpBus;
-import org.jboss.soa.esb.listeners.config.FtpListenerDocument.FtpListener;
-import org.jboss.soa.esb.listeners.config.FtpMessageFilterDocument.FtpMessageFilter;
-import org.jboss.soa.esb.listeners.config.FtpProviderDocument.FtpProvider;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.gateway.ReadOnlyRemoteGatewayListener;
-import org.jboss.soa.esb.listeners.gateway.RemoteGatewayListener;
-import org.w3c.dom.Element;
-
-/**
- * Performs the mapping of a &lt;fs-listener&gt; XSD based configuration to the "ConfigTree"
- * style configuration, adding the "ConfigTree" listener config to the "root" node.
- * 
- * @author <a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>
- */
-public class FtpListenerMapper {
-
-	/**
-	 * Perform the mapping.
-	 * @param root The "ConfigTree" configuration root node.
-	 * @param listener The Jmslistener to be mapped into the ConfigTree.
-	 * @param model The configuration model from which the mapping is being performed.
-	 * @return The ConfigTree listener configuration node.
-	 * @throws ConfigurationException Invalid listener configuration.
-	 */
-	public static Element map(Element root, FtpListener listener, XMLBeansModel model) throws ConfigurationException {
-		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
-		FtpBus bus;
-		FtpProvider provider;
-		
-		try {
-			bus = (FtpBus) model.getBus(listener.getBusidref());
-		} catch (ClassCastException e) {
-			throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <ftp-listener> must reference a <ftp-bus>.");
-		}
-		try {
-			provider = (FtpProvider) model.getProvider(bus);
-		} catch (ClassCastException e) {
-			throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <ftp-provider> instance.  Unexpected exception - this should have caused a validation error!");
-		}
-		
-		FtpMessageFilter messageFilter = listener.getFtpMessageFilter();
-		if(messageFilter == null) {
-			messageFilter = bus.getFtpMessageFilter();
-			if(messageFilter == null) {
-				throw new ConfigurationException("No <ftp-detination> defined on either <ftp-listener> [" + listener.getName() + "] or <ftp-bus> [" + bus.getBusid() + "].");
-			}
-		}
-		listenerNode.setAttribute("pollLatencySeconds", String.valueOf(listener.getPollFrequencySeconds()));
-		// Map the standard listener attributes - common across all listener types...
-		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
-		// Map the <property> elements targeted at the listener - from the listener itself.
-		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);			
-		if(listener.getIsGateway()) {
-			if ( messageFilter.getReadOnly() )
-				listenerNode.setAttribute("gatewayClass", ReadOnlyRemoteGatewayListener.class.getName());
-			else
-				listenerNode.setAttribute("gatewayClass", RemoteGatewayListener.class.getName());
-			// Map EPR related attributes onto the listener - from the bus and provider and listener.
-			// Note: This will change - the Gateways will also support the EPR element...
-			mapFtpEprProperties(listenerNode, provider, messageFilter);
-			MapperUtil.mapEPRProperties(listener, listenerNode, model);
-		} else {
-			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
-
-			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
-			mapFtpEprProperties(eprNode, provider, messageFilter);
-			MapperUtil.mapEPRProperties(listener, eprNode, model);
-			// Remove any empty attributes set on the EPR config...
-			YADOMUtil.removeEmptyAttributes(eprNode);
-		}
-		
-		// Remove any empty attributes set on the listener config...
-		YADOMUtil.removeEmptyAttributes(listenerNode);
-		
-		return listenerNode;
-	}
-	
-	/**
-	 *  The separator used by the ftp protocol to separate the
-	 *  host:port section from the path
-	 */
-	private static final String FTP_SEPARATOR = "/";
-
-	private static void mapFtpEprProperties(Element toElement, FtpProvider provider, FtpMessageFilter messageFilter) 
-	{
-		String inputDir = messageFilter.getDirectory();
-		if ( ! inputDir.startsWith( FTP_SEPARATOR ) )
-			inputDir += FTP_SEPARATOR + inputDir;
-		
-		toElement.setAttribute(ListenerTagNames.URL_TAG, messageFilter.getProtocol() + "://" + messageFilter.getUsername() + ":" 
-				+ messageFilter.getPassword() + "@" + provider.getHostname() + inputDir );
-		toElement.setAttribute(FTPEpr.INPUT_SUFFIX_TAG, messageFilter.getInputSuffix());
-		toElement.setAttribute(FTPEpr.WORK_SUFFIX_TAG, messageFilter.getWorkSuffix());
-		toElement.setAttribute(FTPEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
-		if (!messageFilter.getPostDelete()) {
-			toElement.setAttribute(FTPEpr.POST_DIR_TAG, messageFilter.getPostDirectory());
-			toElement.setAttribute(FTPEpr.POST_SUFFIX_TAG, messageFilter.getPostSuffix());
-		}
-		toElement.setAttribute(FTPEpr.ERROR_DEL_TAG, String.valueOf(messageFilter.getErrorDelete()));
-		if (!messageFilter.getErrorDelete()) {
-			toElement.setAttribute(FTPEpr.ERROR_DIR_TAG, messageFilter.getErrorDirectory());
-			toElement.setAttribute(FTPEpr.ERROR_SUFFIX_TAG, messageFilter.getErrorSuffix());
-		}
-		toElement.setAttribute(FTPEpr.PASSIVE_TAG, String.valueOf(messageFilter.getPassive()));
-		if ("sftp".equals(messageFilter.getProtocol()) || "ftps".equals(messageFilter.getProtocol())) {
-			toElement.setAttribute(SFTPEpr.CERTIFICATE_TAG, messageFilter.getCertificateUrl());
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,137 @@
+/*
+ * 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,
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.FtpBusDocument.FtpBus;
+import org.jboss.soa.esb.listeners.config.FtpListenerDocument.FtpListener;
+import org.jboss.soa.esb.listeners.config.FtpMessageFilterDocument.FtpMessageFilter;
+import org.jboss.soa.esb.listeners.config.FtpProviderDocument.FtpProvider;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.gateway.ReadOnlyRemoteGatewayListener;
+import org.jboss.soa.esb.listeners.gateway.RemoteGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of a &lt;fs-listener&gt; XSD based configuration to the "ConfigTree"
+ * style configuration, adding the "ConfigTree" listener config to the "root" node.
+ * 
+ * @author <a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>
+ */
+public class FtpListenerMapper {
+
+	/**
+	 * Perform the mapping.
+	 * @param root The "ConfigTree" configuration root node.
+	 * @param listener The Jmslistener to be mapped into the ConfigTree.
+	 * @param model The configuration model from which the mapping is being performed.
+	 * @return The ConfigTree listener configuration node.
+	 * @throws ConfigurationException Invalid listener configuration.
+	 */
+	public static Element map(Element root, FtpListener listener, XMLBeansModel model) throws ConfigurationException {
+		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
+		FtpBus bus;
+		FtpProvider provider;
+		
+		try {
+			bus = (FtpBus) model.getBus(listener.getBusidref());
+		} catch (ClassCastException e) {
+			throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <ftp-listener> must reference a <ftp-bus>.");
+		}
+		try {
+			provider = (FtpProvider) model.getProvider(bus);
+		} catch (ClassCastException e) {
+			throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <ftp-provider> instance.  Unexpected exception - this should have caused a validation error!");
+		}
+		
+		FtpMessageFilter messageFilter = listener.getFtpMessageFilter();
+		if(messageFilter == null) {
+			messageFilter = bus.getFtpMessageFilter();
+			if(messageFilter == null) {
+				throw new ConfigurationException("No <ftp-detination> defined on either <ftp-listener> [" + listener.getName() + "] or <ftp-bus> [" + bus.getBusid() + "].");
+			}
+		}
+		listenerNode.setAttribute("pollLatencySeconds", String.valueOf(listener.getPollFrequencySeconds()));
+		// Map the standard listener attributes - common across all listener types...
+		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+		// Map the <property> elements targeted at the listener - from the listener itself.
+		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);			
+		if(listener.getIsGateway()) {
+			if ( messageFilter.getReadOnly() )
+				listenerNode.setAttribute("gatewayClass", ReadOnlyRemoteGatewayListener.class.getName());
+			else
+				listenerNode.setAttribute("gatewayClass", RemoteGatewayListener.class.getName());
+			// Map EPR related attributes onto the listener - from the bus and provider and listener.
+			// Note: This will change - the Gateways will also support the EPR element...
+			mapFtpEprProperties(listenerNode, provider, messageFilter);
+			MapperUtil.mapEPRProperties(listener, listenerNode, model);
+		} else {
+			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+
+			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
+			mapFtpEprProperties(eprNode, provider, messageFilter);
+			MapperUtil.mapEPRProperties(listener, eprNode, model);
+			// Remove any empty attributes set on the EPR config...
+			YADOMUtil.removeEmptyAttributes(eprNode);
+		}
+		
+		// Remove any empty attributes set on the listener config...
+		YADOMUtil.removeEmptyAttributes(listenerNode);
+		
+		return listenerNode;
+	}
+	
+	/**
+	 *  The separator used by the ftp protocol to separate the
+	 *  host:port section from the path
+	 */
+	private static final String FTP_SEPARATOR = "/";
+
+	private static void mapFtpEprProperties(Element toElement, FtpProvider provider, FtpMessageFilter messageFilter) 
+	{
+		String inputDir = messageFilter.getDirectory();
+		if ( ! inputDir.startsWith( FTP_SEPARATOR ) )
+			inputDir += FTP_SEPARATOR + inputDir;
+		
+		toElement.setAttribute(ListenerTagNames.URL_TAG, messageFilter.getProtocol() + "://" + messageFilter.getUsername() + ":" 
+				+ messageFilter.getPassword() + "@" + provider.getHostname() + inputDir );
+		toElement.setAttribute(FTPEpr.INPUT_SUFFIX_TAG, messageFilter.getInputSuffix());
+		toElement.setAttribute(FTPEpr.WORK_SUFFIX_TAG, messageFilter.getWorkSuffix());
+		toElement.setAttribute(FTPEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
+		if (!messageFilter.getPostDelete()) {
+			toElement.setAttribute(FTPEpr.POST_DIR_TAG, messageFilter.getPostDirectory());
+			toElement.setAttribute(FTPEpr.POST_SUFFIX_TAG, messageFilter.getPostSuffix());
+		}
+		toElement.setAttribute(FTPEpr.ERROR_DEL_TAG, String.valueOf(messageFilter.getErrorDelete()));
+		if (!messageFilter.getErrorDelete()) {
+			toElement.setAttribute(FTPEpr.ERROR_DIR_TAG, messageFilter.getErrorDirectory());
+			toElement.setAttribute(FTPEpr.ERROR_SUFFIX_TAG, messageFilter.getErrorSuffix());
+		}
+		toElement.setAttribute(FTPEpr.PASSIVE_TAG, String.valueOf(messageFilter.getPassive()));
+		if ("sftp".equals(messageFilter.getProtocol()) || "ftps".equals(messageFilter.getProtocol())) {
+			toElement.setAttribute(SFTPEpr.CERTIFICATE_TAG, messageFilter.getCertificateUrl());
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/GroovyListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/GroovyListenerMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/GroovyListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,54 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.config.mappers;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.config.Generator;
-import org.jboss.soa.esb.listeners.config.GroovyListenerDocument;
-import org.jboss.soa.esb.listeners.gateway.GroovyGateway;
-import org.w3c.dom.Element;
-
-/**
- * Config mapper class for the Groovy Listener.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class GroovyListenerMapper {
-
-    public static Element map(Element root, GroovyListenerDocument.GroovyListener listener, Generator.XMLBeansModel model) throws ConfigurationException {
-        Element listenerNode = YADOMUtil.addElement(root, listener.getName());
-
-        // Map the standard listener attributes - common across all listener types...
-        MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
-        // Map the <property> elements targeted at the listener - from the listener itself.
-        MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
-
-        if(listener.getIsGateway()) {
-            listenerNode.setAttribute("gatewayClass", GroovyGateway.class.getName());
-        } else {
-            throw new ConfigurationException("Invalid <groovy-listener> config [" + listener.getName() + "].  <groovy-listener> is currently only supported as a gateway listener.");
-        }
-
-        listenerNode.setAttribute("script", listener.getScript());
-
-        return listenerNode;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/GroovyListenerMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/GroovyListenerMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/GroovyListenerMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/GroovyListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,54 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.config.mappers;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.Generator;
+import org.jboss.soa.esb.listeners.config.GroovyListenerDocument;
+import org.jboss.soa.esb.listeners.gateway.GroovyGateway;
+import org.w3c.dom.Element;
+
+/**
+ * Config mapper class for the Groovy Listener.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class GroovyListenerMapper {
+
+    public static Element map(Element root, GroovyListenerDocument.GroovyListener listener, Generator.XMLBeansModel model) throws ConfigurationException {
+        Element listenerNode = YADOMUtil.addElement(root, listener.getName());
+
+        // Map the standard listener attributes - common across all listener types...
+        MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+        // Map the <property> elements targeted at the listener - from the listener itself.
+        MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+
+        if(listener.getIsGateway()) {
+            listenerNode.setAttribute("gatewayClass", GroovyGateway.class.getName());
+        } else {
+            throw new ConfigurationException("Invalid <groovy-listener> config [" + listener.getName() + "].  <groovy-listener> is currently only supported as a gateway listener.");
+        }
+
+        listenerNode.setAttribute("script", listener.getScript());
+
+        return listenerNode;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,121 +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.config.mappers;
-
-import java.util.List;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.HibernateBusDocument.HibernateBus;
-import org.jboss.soa.esb.listeners.config.HibernateListenerDocument.HibernateListener;
-import org.jboss.soa.esb.listeners.config.HibernateMessageFilterDocument.HibernateMessageFilter;
-import org.jboss.soa.esb.listeners.config.HibernateProviderDocument.HibernateProvider;
-import org.jboss.soa.esb.listeners.gateway.HibernateGatewayListener;
-import org.w3c.dom.Element;
-
-/**
- * Performs the mapping of a &lt;fs-listener&gt; XSD based configuration to the "ConfigTree"
- * style configuration, adding the "ConfigTree" listener config to the "root" node.
- * 
- * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
- */
-public class HibernateListenerMapper {
-
-	/**
-	 * Perform the mapping.
-	 * @param root The "ConfigTree" configuration root node.
-	 * @param listener The Jmslistener to be mapped into the ConfigTree.
-	 * @param model The configuration model from which the mapping is being performed.
-	 * @return The ConfigTree listener configuration node.
-	 * @throws ConfigurationException Invalid listener configuration.
-	 */
-	public static Element map(Element root, HibernateListener listener, XMLBeansModel model) throws ConfigurationException {
-		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
-		HibernateBus bus;
-		HibernateProvider provider;
-		
-		try {
-			bus = (HibernateBus) model.getBus(listener.getBusidref());
-		} catch (ClassCastException e) {
-			throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <hibernate-listener> must reference a <hibernate-bus>.");
-		}
-		try {
-			provider = (HibernateProvider) model.getProvider(bus);
-		} catch (ClassCastException e) {
-			throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <hibernate-provider> instance.  Unexpected exception - this should have caused a validation error!");
-		}
-		
-		List<HibernateMessageFilter> messageFilters = null;
-		messageFilters = listener.getHibernateMessageFilterList();
-		
-		if(messageFilters.size() == 0) {
-			messageFilters = bus.getHibernateMessageFilterList();
-			if(messageFilters == null) {
-				throw new ConfigurationException("No <hibernate-message-filter> defined on either <hibernate-listener> [" + listener.getName() + "] or <hibernate-bus> [" + bus.getBusid() + "].");
-			}
-		}
-		listenerNode.setAttribute("pollLatencySeconds", String.valueOf(listener.getPollFrequencySeconds()));
-		// Map the standard listener attributes - common across all listener types...
-		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
-		// Map the <property> elements targeted at the listener - from the listener itself.
-		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);			
-		if(listener.getIsGateway()) {
-			listenerNode.setAttribute("gatewayClass", HibernateGatewayListener.class.getName());
-			// Map EPR related attributes onto the listener - from the bus and provider and listener.
-			// Note: This will change - the Gateways will also support the EPR element...
-			mapHibernateEprProperties(listenerNode, provider, messageFilters);
-			MapperUtil.mapEPRProperties(listener, listenerNode, model);
-		} else {
-			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
-			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
-			mapHibernateEprProperties(eprNode, provider, messageFilters);
-			MapperUtil.mapEPRProperties(listener, eprNode, model);
-			// Remove any empty attributes set on the EPR config...
-			YADOMUtil.removeEmptyAttributes(eprNode);
-		}
-		
-		// Remove any empty attributes set on the listener config...
-		YADOMUtil.removeEmptyAttributes(listenerNode);
-		
-		return listenerNode;
-	}
-
-	/**
-	 * mapHibernateEprProperties creates a ConfigTree with the details we need
-	 * from the HibernateProvider and MessageFilters.
-	 * @param toElement the element we are passing on
-	 * @param provider the provider object
-	 * @param messageFilters collection of MessageFilters we need to implement
-	 */
-	private static void mapHibernateEprProperties(Element toElement, HibernateProvider provider, List<HibernateMessageFilter> messageFilters) {
-		toElement.setAttribute(HibernateEpr.HIBERNATE_CFG_TAG, provider.getHibernateCfgFile());
-		for (HibernateMessageFilter messageFilter: messageFilters) {	
-			Element temp = YADOMUtil.addElement(toElement, "messagefilter");
-			temp.setAttribute(HibernateEpr.CLASS_NAME_TAG, messageFilter.getClassname());
-			temp.setAttribute(HibernateEpr.EVENT_TAG, messageFilter.getEvent());
-			toElement.appendChild(temp);
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/HibernateListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,121 @@
+/*
+ * 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.config.mappers;
+
+import java.util.List;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.HibernateBusDocument.HibernateBus;
+import org.jboss.soa.esb.listeners.config.HibernateListenerDocument.HibernateListener;
+import org.jboss.soa.esb.listeners.config.HibernateMessageFilterDocument.HibernateMessageFilter;
+import org.jboss.soa.esb.listeners.config.HibernateProviderDocument.HibernateProvider;
+import org.jboss.soa.esb.listeners.gateway.HibernateGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of a &lt;fs-listener&gt; XSD based configuration to the "ConfigTree"
+ * style configuration, adding the "ConfigTree" listener config to the "root" node.
+ * 
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ */
+public class HibernateListenerMapper {
+
+	/**
+	 * Perform the mapping.
+	 * @param root The "ConfigTree" configuration root node.
+	 * @param listener The Jmslistener to be mapped into the ConfigTree.
+	 * @param model The configuration model from which the mapping is being performed.
+	 * @return The ConfigTree listener configuration node.
+	 * @throws ConfigurationException Invalid listener configuration.
+	 */
+	public static Element map(Element root, HibernateListener listener, XMLBeansModel model) throws ConfigurationException {
+		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
+		HibernateBus bus;
+		HibernateProvider provider;
+		
+		try {
+			bus = (HibernateBus) model.getBus(listener.getBusidref());
+		} catch (ClassCastException e) {
+			throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <hibernate-listener> must reference a <hibernate-bus>.");
+		}
+		try {
+			provider = (HibernateProvider) model.getProvider(bus);
+		} catch (ClassCastException e) {
+			throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <hibernate-provider> instance.  Unexpected exception - this should have caused a validation error!");
+		}
+		
+		List<HibernateMessageFilter> messageFilters = null;
+		messageFilters = listener.getHibernateMessageFilterList();
+		
+		if(messageFilters.size() == 0) {
+			messageFilters = bus.getHibernateMessageFilterList();
+			if(messageFilters == null) {
+				throw new ConfigurationException("No <hibernate-message-filter> defined on either <hibernate-listener> [" + listener.getName() + "] or <hibernate-bus> [" + bus.getBusid() + "].");
+			}
+		}
+		listenerNode.setAttribute("pollLatencySeconds", String.valueOf(listener.getPollFrequencySeconds()));
+		// Map the standard listener attributes - common across all listener types...
+		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+		// Map the <property> elements targeted at the listener - from the listener itself.
+		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);			
+		if(listener.getIsGateway()) {
+			listenerNode.setAttribute("gatewayClass", HibernateGatewayListener.class.getName());
+			// Map EPR related attributes onto the listener - from the bus and provider and listener.
+			// Note: This will change - the Gateways will also support the EPR element...
+			mapHibernateEprProperties(listenerNode, provider, messageFilters);
+			MapperUtil.mapEPRProperties(listener, listenerNode, model);
+		} else {
+			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
+			mapHibernateEprProperties(eprNode, provider, messageFilters);
+			MapperUtil.mapEPRProperties(listener, eprNode, model);
+			// Remove any empty attributes set on the EPR config...
+			YADOMUtil.removeEmptyAttributes(eprNode);
+		}
+		
+		// Remove any empty attributes set on the listener config...
+		YADOMUtil.removeEmptyAttributes(listenerNode);
+		
+		return listenerNode;
+	}
+
+	/**
+	 * mapHibernateEprProperties creates a ConfigTree with the details we need
+	 * from the HibernateProvider and MessageFilters.
+	 * @param toElement the element we are passing on
+	 * @param provider the provider object
+	 * @param messageFilters collection of MessageFilters we need to implement
+	 */
+	private static void mapHibernateEprProperties(Element toElement, HibernateProvider provider, List<HibernateMessageFilter> messageFilters) {
+		toElement.setAttribute(HibernateEpr.HIBERNATE_CFG_TAG, provider.getHibernateCfgFile());
+		for (HibernateMessageFilter messageFilter: messageFilters) {	
+			Element temp = YADOMUtil.addElement(toElement, "messagefilter");
+			temp.setAttribute(HibernateEpr.CLASS_NAME_TAG, messageFilter.getClassname());
+			temp.setAttribute(HibernateEpr.EVENT_TAG, messageFilter.getEvent());
+			toElement.appendChild(temp);
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,81 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.config.mappers;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.JbrBusDocument.JbrBus;
-import org.jboss.soa.esb.listeners.config.JbrListenerDocument.JbrListener;
-import org.jboss.soa.esb.listeners.config.JbrProviderDocument.JbrProvider;
-import org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener;
-import org.w3c.dom.Element;
-
-/**
- * JBoss Remoting listener mapper.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class JbrListenerMapper {
-
-    /**
-     * Perform the mapping.
-     * @param root The "ConfigTree" configuration root node.
-     * @param listener JBoss Remoting listener config.
-     * @param model The configuration model from which the mapping is being performed.
-     * @return The ConfigTree listener configuration node.
-     * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
-     */
-    public static Element map(Element root, JbrListener listener, XMLBeansModel model) throws ConfigurationException {
-        Element listenerNode = YADOMUtil.addElement(root, listener.getName());
-        JbrBus bus;
-        JbrProvider provider;
-
-        try {
-            bus = (JbrBus) model.getBus(listener.getBusidref());
-        } catch (ClassCastException e) {
-            throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <jbr-listener> must reference a <jbr-bus>.");
-        }
-        try {
-            provider = (JbrProvider) model.getProvider(bus);
-        } catch (ClassCastException e) {
-            throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <jbr-provider> instance.  Unexpected exception - this should have caused a validation error!");
-        }
-
-        // Map the standard listener attributes - common across all listener types...
-        MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
-        // Map the <property> elements targeted at the listener - from the listener itself.
-        MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
-
-        if(listener.getIsGateway()) {
-            String host = provider.getHost();
-
-            listenerNode.setAttribute("gatewayClass", JBossRemotingGatewayListener.class.getName());
-            if(host != null) {
-                listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_HOST, host);
-            }
-            listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PROTOCOL, provider.getProtocol().toString());
-            listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PORT, Integer.toString(bus.getPort()));
-        } else {
-            throw new ConfigurationException("Invalid <jbr-listener> config [" + listener.getName() + "].  <jbr-listener> is currently only supported as a gateway listener.");
-        }
-
-        return listenerNode;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JbrListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,81 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.config.mappers;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.JbrBusDocument.JbrBus;
+import org.jboss.soa.esb.listeners.config.JbrListenerDocument.JbrListener;
+import org.jboss.soa.esb.listeners.config.JbrProviderDocument.JbrProvider;
+import org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * JBoss Remoting listener mapper.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class JbrListenerMapper {
+
+    /**
+     * Perform the mapping.
+     * @param root The "ConfigTree" configuration root node.
+     * @param listener JBoss Remoting listener config.
+     * @param model The configuration model from which the mapping is being performed.
+     * @return The ConfigTree listener configuration node.
+     * @throws org.jboss.soa.esb.ConfigurationException Invalid listener configuration.
+     */
+    public static Element map(Element root, JbrListener listener, XMLBeansModel model) throws ConfigurationException {
+        Element listenerNode = YADOMUtil.addElement(root, listener.getName());
+        JbrBus bus;
+        JbrProvider provider;
+
+        try {
+            bus = (JbrBus) model.getBus(listener.getBusidref());
+        } catch (ClassCastException e) {
+            throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <jbr-listener> must reference a <jbr-bus>.");
+        }
+        try {
+            provider = (JbrProvider) model.getProvider(bus);
+        } catch (ClassCastException e) {
+            throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <jbr-provider> instance.  Unexpected exception - this should have caused a validation error!");
+        }
+
+        // Map the standard listener attributes - common across all listener types...
+        MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+        // Map the <property> elements targeted at the listener - from the listener itself.
+        MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+
+        if(listener.getIsGateway()) {
+            String host = provider.getHost();
+
+            listenerNode.setAttribute("gatewayClass", JBossRemotingGatewayListener.class.getName());
+            if(host != null) {
+                listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_HOST, host);
+            }
+            listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PROTOCOL, provider.getProtocol().toString());
+            listenerNode.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PORT, Integer.toString(bus.getPort()));
+        } else {
+            throw new ConfigurationException("Invalid <jbr-listener> config [" + listener.getName() + "].  <jbr-listener> is currently only supported as a gateway listener.");
+        }
+
+        return listenerNode;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JcaGatewayMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JcaGatewayMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JcaGatewayMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,65 +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.config.mappers;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.config.Generator;
-import org.jboss.soa.esb.listeners.config.ServiceDocument;
-import org.jboss.soa.esb.listeners.config.JcaGatewayDocument.JcaGateway;
-import org.jboss.soa.esb.listeners.jca.JcaInflowGateway;
-import org.w3c.dom.Element;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class JcaGatewayMapper
-{
-   public static Element map(Element root, JcaGateway gateway, Generator.XMLBeansModel model) throws ConfigurationException
-   {
-      Element listenerNode = YADOMUtil.addElement(root, gateway.getName());
-      gateway.setIsGateway(true);
-
-      ServiceDocument.Service service = model.getService(gateway);
-      listenerNode.setAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG, service.getDescription());	
-      listenerNode.setAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, service.getCategory());
-      listenerNode.setAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG, service.getName());
-
-      listenerNode.setAttribute("adapter", gateway.getAdapter());
-      listenerNode.setAttribute("endpointClass", gateway.getEndpointClass());
-      listenerNode.setAttribute("messagingType", gateway.getMessagingType());
-      listenerNode.setAttribute("jcaBridge", gateway.getJcaBridge());
-
-      MapperUtil.mapProperties(gateway.getPropertyList(), listenerNode);
-      listenerNode.setAttribute("gatewayClass", JcaInflowGateway.class.getName());
-      Element activationConfig = YADOMUtil.addElement(listenerNode, "activation-config");
-      MapperUtil.serialize(gateway.getActivationConfig(), activationConfig);
-
-
-      YADOMUtil.removeEmptyAttributes(listenerNode);
-      return listenerNode;
-   }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JcaGatewayMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JcaGatewayMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JcaGatewayMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JcaGatewayMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,65 @@
+/*
+* 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.config.mappers;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.Generator;
+import org.jboss.soa.esb.listeners.config.ServiceDocument;
+import org.jboss.soa.esb.listeners.config.JcaGatewayDocument.JcaGateway;
+import org.jboss.soa.esb.listeners.jca.JcaInflowGateway;
+import org.w3c.dom.Element;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JcaGatewayMapper
+{
+   public static Element map(Element root, JcaGateway gateway, Generator.XMLBeansModel model) throws ConfigurationException
+   {
+      Element listenerNode = YADOMUtil.addElement(root, gateway.getName());
+      gateway.setIsGateway(true);
+
+      ServiceDocument.Service service = model.getService(gateway);
+      listenerNode.setAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG, service.getDescription());	
+      listenerNode.setAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, service.getCategory());
+      listenerNode.setAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG, service.getName());
+
+      listenerNode.setAttribute("adapter", gateway.getAdapter());
+      listenerNode.setAttribute("endpointClass", gateway.getEndpointClass());
+      listenerNode.setAttribute("messagingType", gateway.getMessagingType());
+      listenerNode.setAttribute("jcaBridge", gateway.getJcaBridge());
+
+      MapperUtil.mapProperties(gateway.getPropertyList(), listenerNode);
+      listenerNode.setAttribute("gatewayClass", JcaInflowGateway.class.getName());
+      Element activationConfig = YADOMUtil.addElement(listenerNode, "activation-config");
+      MapperUtil.serialize(gateway.getActivationConfig(), activationConfig);
+
+
+      YADOMUtil.removeEmptyAttributes(listenerNode);
+      return listenerNode;
+   }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,112 +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.config.mappers;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.JmsBusDocument.JmsBus;
-import org.jboss.soa.esb.listeners.config.JmsListenerDocument.JmsListener;
-import org.jboss.soa.esb.listeners.config.JmsMessageFilterDocument.JmsMessageFilter;
-import org.jboss.soa.esb.listeners.config.JmsProviderDocument.JmsProvider;
-import org.jboss.soa.esb.listeners.gateway.JmsGatewayListener;
-import org.w3c.dom.Element;
-
-/**
- * Performs the mapping of a &lt;jms-listener&gt; XSD based configuration to the "ConfigTree"
- * style configuration, adding the "ConfigTree" listener config to the "root" node.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class JmsListenerMapper {
-
-	/**
-	 * Perform the mapping.
-	 * @param root The "ConfigTree" configuration root node.
-	 * @param listener The Jmslistener to be mapped into the ConfigTree.
-	 * @param model The configuration model from which the mapping is being performed.
-	 * @return The ConfigTree listener configuration node.
-	 * @throws ConfigurationException Invalid listener configuration.
-	 */
-	public static Element map(Element root, JmsListener listener, XMLBeansModel model) throws ConfigurationException {
-		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
-		JmsBus bus;
-		JmsProvider provider;
-		
-		try {
-			bus = (JmsBus) model.getBus(listener.getBusidref());
-		} catch (ClassCastException e) {
-			throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <jms-listener> must reference a <jms-bus>.");
-		}
-		try {
-			provider = (JmsProvider) model.getProvider(bus);
-		} catch (ClassCastException e) {
-			throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <jms-provider> instance.  Unexpected exception - this should have caused a validation error!");
-		}
-		
-		JmsMessageFilter messageFilter = listener.getJmsMessageFilter();
-		if(messageFilter == null) {
-			messageFilter = bus.getJmsMessageFilter();
-			if(messageFilter == null) {
-				throw new ConfigurationException("No <jms-detination> defined on either <jms-listener> [" + listener.getName() + "] or <jms-bus> [" + bus.getBusid() + "].");
-			}
-		}
-		
-		// Map the standard listener attributes - common across all listener types...
-		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
-		// Map the <property> elements targeted at the listener - from the listener itself.
-		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);			
-		if(listener.getIsGateway()) {
-			listenerNode.setAttribute("gatewayClass", JmsGatewayListener.class.getName());
-			// Map EPR related attributes onto the listener - from the bus and provider and listener.
-			// Note: This will change - the Gateways will also support the EPR element...
-			mapJmsEprProperties(listenerNode, provider, messageFilter);
-			MapperUtil.mapEPRProperties(listener, listenerNode, model);
-		} else {
-			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
-
-			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
-			mapJmsEprProperties(eprNode, provider, messageFilter);
-			eprNode.setAttribute(ListenerTagNames.PROTOCOL_TAG, JMSEpr.JMS_PROTOCOL);
-			MapperUtil.mapEPRProperties(listener, eprNode, model);
-			// Remove any empty attributes set on the EPR config...
-			YADOMUtil.removeEmptyAttributes(eprNode);
-		}
-		
-		// Remove any empty attributes set on the listener config...
-		YADOMUtil.removeEmptyAttributes(listenerNode);
-		
-		return listenerNode;
-	}
-
-	private static void mapJmsEprProperties(Element toElement, JmsProvider provider, JmsMessageFilter messageFilter) {
-		toElement.setAttribute(JMSEpr.DESTINATION_TYPE_TAG, messageFilter.getDestType().toString().toLowerCase());
-		toElement.setAttribute(JMSEpr.DESTINATION_NAME_TAG, messageFilter.getDestName());
-		toElement.setAttribute(JMSEpr.MESSAGE_SELECTOR_TAG, messageFilter.getSelector());
-		toElement.setAttribute(JMSEpr.CONNECTION_FACTORY_TAG, provider.getConnectionFactory());
-		toElement.setAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG, provider.getJndiContextFactory());
-		toElement.setAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG, provider.getJndiPkgPrefix());
-		toElement.setAttribute(JMSEpr.JNDI_URL_TAG, provider.getJndiURL());
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/JmsListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,112 @@
+/*
+ * 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.config.mappers;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.JmsBusDocument.JmsBus;
+import org.jboss.soa.esb.listeners.config.JmsListenerDocument.JmsListener;
+import org.jboss.soa.esb.listeners.config.JmsMessageFilterDocument.JmsMessageFilter;
+import org.jboss.soa.esb.listeners.config.JmsProviderDocument.JmsProvider;
+import org.jboss.soa.esb.listeners.gateway.JmsGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of a &lt;jms-listener&gt; XSD based configuration to the "ConfigTree"
+ * style configuration, adding the "ConfigTree" listener config to the "root" node.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class JmsListenerMapper {
+
+	/**
+	 * Perform the mapping.
+	 * @param root The "ConfigTree" configuration root node.
+	 * @param listener The Jmslistener to be mapped into the ConfigTree.
+	 * @param model The configuration model from which the mapping is being performed.
+	 * @return The ConfigTree listener configuration node.
+	 * @throws ConfigurationException Invalid listener configuration.
+	 */
+	public static Element map(Element root, JmsListener listener, XMLBeansModel model) throws ConfigurationException {
+		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
+		JmsBus bus;
+		JmsProvider provider;
+		
+		try {
+			bus = (JmsBus) model.getBus(listener.getBusidref());
+		} catch (ClassCastException e) {
+			throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <jms-listener> must reference a <jms-bus>.");
+		}
+		try {
+			provider = (JmsProvider) model.getProvider(bus);
+		} catch (ClassCastException e) {
+			throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <jms-provider> instance.  Unexpected exception - this should have caused a validation error!");
+		}
+		
+		JmsMessageFilter messageFilter = listener.getJmsMessageFilter();
+		if(messageFilter == null) {
+			messageFilter = bus.getJmsMessageFilter();
+			if(messageFilter == null) {
+				throw new ConfigurationException("No <jms-detination> defined on either <jms-listener> [" + listener.getName() + "] or <jms-bus> [" + bus.getBusid() + "].");
+			}
+		}
+		
+		// Map the standard listener attributes - common across all listener types...
+		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+		// Map the <property> elements targeted at the listener - from the listener itself.
+		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);			
+		if(listener.getIsGateway()) {
+			listenerNode.setAttribute("gatewayClass", JmsGatewayListener.class.getName());
+			// Map EPR related attributes onto the listener - from the bus and provider and listener.
+			// Note: This will change - the Gateways will also support the EPR element...
+			mapJmsEprProperties(listenerNode, provider, messageFilter);
+			MapperUtil.mapEPRProperties(listener, listenerNode, model);
+		} else {
+			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+
+			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
+			mapJmsEprProperties(eprNode, provider, messageFilter);
+			eprNode.setAttribute(ListenerTagNames.PROTOCOL_TAG, JMSEpr.JMS_PROTOCOL);
+			MapperUtil.mapEPRProperties(listener, eprNode, model);
+			// Remove any empty attributes set on the EPR config...
+			YADOMUtil.removeEmptyAttributes(eprNode);
+		}
+		
+		// Remove any empty attributes set on the listener config...
+		YADOMUtil.removeEmptyAttributes(listenerNode);
+		
+		return listenerNode;
+	}
+
+	private static void mapJmsEprProperties(Element toElement, JmsProvider provider, JmsMessageFilter messageFilter) {
+		toElement.setAttribute(JMSEpr.DESTINATION_TYPE_TAG, messageFilter.getDestType().toString().toLowerCase());
+		toElement.setAttribute(JMSEpr.DESTINATION_NAME_TAG, messageFilter.getDestName());
+		toElement.setAttribute(JMSEpr.MESSAGE_SELECTOR_TAG, messageFilter.getSelector());
+		toElement.setAttribute(JMSEpr.CONNECTION_FACTORY_TAG, provider.getConnectionFactory());
+		toElement.setAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG, provider.getJndiContextFactory());
+		toElement.setAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG, provider.getJndiPkgPrefix());
+		toElement.setAttribute(JMSEpr.JNDI_URL_TAG, provider.getJndiURL());
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,165 +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.config.mappers;
-
-import java.util.List;
-
-import org.apache.xmlbeans.XmlCursor;
-import org.apache.xmlbeans.XmlObject;
-import org.apache.xmlbeans.XmlCursor.TokenType;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.config.Bus;
-import org.jboss.soa.esb.listeners.config.Listener;
-import org.jboss.soa.esb.listeners.config.Provider;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.PropertyDocument.Property;
-import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
-import org.jboss.soa.esb.listeners.message.MessageAwareListener;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-/**
- * Mapper utility methods.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-abstract class MapperUtil {
-
-	/**
-	 * Map all default listener attributes onto the target listener ConfigTree.
-	 * @param listener The listener configuration instance.
-	 * @param target The target DOM ConfigTree listener element.
-	 * @param model The model.
-	 */
-	protected static void mapDefaultAttributes(Listener listener, Element target, XMLBeansModel model) {
-		Service service = model.getService(listener);
-		
-		// Map maxThreads - appears to be a JMS only attrib...
-		target.setAttribute(ListenerTagNames.MAX_THREADS_TAG, String.valueOf(listener.getMaxThreads()));
-		target.setAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG, service.getDescription());	
-		if(listener.getIsGateway()) {
-			target.setAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, service.getCategory());			
-			target.setAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG, service.getName());			
-		} else {
-            target.setAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, service.getCategory());         
-            target.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, service.getName());          
-			target.setAttribute(ListenerTagNames.LISTENER_CLASS_TAG, MessageAwareListener.class.getName());	
-		}
-	}
-	
-	/**
-	 * Map all the properties targeted at the supplied listener onto the target element.
-	 * <p/>
-	 * This involves copying the properties from the associated bus and provider nodes.
-	 * @param listener The listener config instance.
-	 * @param target The target DOM ConfigTree listener element.
-	 * @param model The model.
-	 * @throws ConfigurationException Bad bis configuration. 
-	 */
-	protected static void mapEPRProperties(Listener listener, Element target, XMLBeansModel model) throws ConfigurationException {
-		Bus bus = model.getBus(listener.getBusidref());
-		Provider provider = model.getProvider(bus);
-		
-		// Map the properties from the provider config...
-		mapProperties(provider.getPropertyList(), target);
-		// Map the properties from the bus config...
-		mapProperties(bus.getPropertyList(), target);
-	}
-	
-	/**
-	 * Map all the supplied properties onto the target element.
-	 * @param target The target DOM element.
-	 * @param properties The properties to be mapped.
-	 */
-	protected static void mapProperties(List<Property> properties, Element target) {
-		// Map the property elements to actions attributes...
-		for(Property property : properties) {
-         Element propertyElement = target.getOwnerDocument().createElement("property");
-         serialize(property, propertyElement);
-         if (propertyElement.hasChildNodes())
-         {
-            YADOMUtil.copyChildNodes(propertyElement, target);
-         }
-         else
-         {
-            target.setAttribute(property.getName(), property.getValue());
-         }
-      }
-	}
-
-	/**
-	 * Serialise the supplied {@link XmlObject} instance to the supplied element.
-	 * @param xmlObject The XmlObject instance.
-	 * @param toElement The element to which the cursor is to be serialised.
-	 */
-	protected static void serialize(XmlObject xmlObject, Element toElement) {
-		XmlCursor cursor = xmlObject.newCursor();
-		
-		// Note there are methods on the XmlObject that "looked" as though they might be able
-		// to do this for us (save, newDomNode etc), but they kept throwing exceptions.
-		
-		serialize(cursor, toElement);
-		cursor.dispose();
-	}
-
-	/**
-	 * Serialise the XML content behind the supplied XmlCursor instance to the supplied
-	 * target element.
-	 * @param cursor The cursor instance.
-	 * @param toElement The target DOM Element.
-	 */
-	private static void serialize(XmlCursor cursor, Element toElement) {
-		TokenType token;
-		Document doc = toElement.getOwnerDocument();
-
-		while(true) {
-			token = cursor.toNextToken();
-			
-			switch (token.intValue()) {
-			case TokenType.INT_ATTR:
-				toElement.setAttribute(cursor.getName().getLocalPart(), cursor.getTextValue());
-				break;
-			case TokenType.INT_COMMENT:
-				toElement.appendChild(doc.createComment(cursor.getTextValue()));
-				break;
-			case TokenType.INT_START:
-				Element childElement = doc.createElement(cursor.getName().getLocalPart());
-				toElement.appendChild(childElement);
-				serialize(cursor, childElement);
-				break;
-			case TokenType.INT_TEXT:
-				toElement.appendChild(doc.createTextNode(cursor.getChars()));
-				break;
-			case TokenType.INT_END:
-			case TokenType.INT_STARTDOC:
-			case TokenType.INT_ENDDOC:
-			case TokenType.INT_NONE:
-				return;
-			case TokenType.INT_PROCINST:
-			case TokenType.INT_NAMESPACE:
-			default:
-				break;
-			}
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/MapperUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,165 @@
+/*
+ * 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.config.mappers;
+
+import java.util.List;
+
+import org.apache.xmlbeans.XmlCursor;
+import org.apache.xmlbeans.XmlObject;
+import org.apache.xmlbeans.XmlCursor.TokenType;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.Bus;
+import org.jboss.soa.esb.listeners.config.Listener;
+import org.jboss.soa.esb.listeners.config.Provider;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.PropertyDocument.Property;
+import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
+import org.jboss.soa.esb.listeners.message.MessageAwareListener;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+/**
+ * Mapper utility methods.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+abstract class MapperUtil {
+
+	/**
+	 * Map all default listener attributes onto the target listener ConfigTree.
+	 * @param listener The listener configuration instance.
+	 * @param target The target DOM ConfigTree listener element.
+	 * @param model The model.
+	 */
+	protected static void mapDefaultAttributes(Listener listener, Element target, XMLBeansModel model) {
+		Service service = model.getService(listener);
+		
+		// Map maxThreads - appears to be a JMS only attrib...
+		target.setAttribute(ListenerTagNames.MAX_THREADS_TAG, String.valueOf(listener.getMaxThreads()));
+		target.setAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG, service.getDescription());	
+		if(listener.getIsGateway()) {
+			target.setAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, service.getCategory());			
+			target.setAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG, service.getName());			
+		} else {
+            target.setAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, service.getCategory());         
+            target.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, service.getName());          
+			target.setAttribute(ListenerTagNames.LISTENER_CLASS_TAG, MessageAwareListener.class.getName());	
+		}
+	}
+	
+	/**
+	 * Map all the properties targeted at the supplied listener onto the target element.
+	 * <p/>
+	 * This involves copying the properties from the associated bus and provider nodes.
+	 * @param listener The listener config instance.
+	 * @param target The target DOM ConfigTree listener element.
+	 * @param model The model.
+	 * @throws ConfigurationException Bad bis configuration. 
+	 */
+	protected static void mapEPRProperties(Listener listener, Element target, XMLBeansModel model) throws ConfigurationException {
+		Bus bus = model.getBus(listener.getBusidref());
+		Provider provider = model.getProvider(bus);
+		
+		// Map the properties from the provider config...
+		mapProperties(provider.getPropertyList(), target);
+		// Map the properties from the bus config...
+		mapProperties(bus.getPropertyList(), target);
+	}
+	
+	/**
+	 * Map all the supplied properties onto the target element.
+	 * @param target The target DOM element.
+	 * @param properties The properties to be mapped.
+	 */
+	protected static void mapProperties(List<Property> properties, Element target) {
+		// Map the property elements to actions attributes...
+		for(Property property : properties) {
+         Element propertyElement = target.getOwnerDocument().createElement("property");
+         serialize(property, propertyElement);
+         if (propertyElement.hasChildNodes())
+         {
+            YADOMUtil.copyChildNodes(propertyElement, target);
+         }
+         else
+         {
+            target.setAttribute(property.getName(), property.getValue());
+         }
+      }
+	}
+
+	/**
+	 * Serialise the supplied {@link XmlObject} instance to the supplied element.
+	 * @param xmlObject The XmlObject instance.
+	 * @param toElement The element to which the cursor is to be serialised.
+	 */
+	protected static void serialize(XmlObject xmlObject, Element toElement) {
+		XmlCursor cursor = xmlObject.newCursor();
+		
+		// Note there are methods on the XmlObject that "looked" as though they might be able
+		// to do this for us (save, newDomNode etc), but they kept throwing exceptions.
+		
+		serialize(cursor, toElement);
+		cursor.dispose();
+	}
+
+	/**
+	 * Serialise the XML content behind the supplied XmlCursor instance to the supplied
+	 * target element.
+	 * @param cursor The cursor instance.
+	 * @param toElement The target DOM Element.
+	 */
+	private static void serialize(XmlCursor cursor, Element toElement) {
+		TokenType token;
+		Document doc = toElement.getOwnerDocument();
+
+		while(true) {
+			token = cursor.toNextToken();
+			
+			switch (token.intValue()) {
+			case TokenType.INT_ATTR:
+				toElement.setAttribute(cursor.getName().getLocalPart(), cursor.getTextValue());
+				break;
+			case TokenType.INT_COMMENT:
+				toElement.appendChild(doc.createComment(cursor.getTextValue()));
+				break;
+			case TokenType.INT_START:
+				Element childElement = doc.createElement(cursor.getName().getLocalPart());
+				toElement.appendChild(childElement);
+				serialize(cursor, childElement);
+				break;
+			case TokenType.INT_TEXT:
+				toElement.appendChild(doc.createTextNode(cursor.getChars()));
+				break;
+			case TokenType.INT_END:
+			case TokenType.INT_STARTDOC:
+			case TokenType.INT_ENDDOC:
+			case TokenType.INT_NONE:
+				return;
+			case TokenType.INT_PROCINST:
+			case TokenType.INT_NAMESPACE:
+			default:
+				break;
+			}
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/NotificationMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/NotificationMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/NotificationMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,44 +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.config.mappers;
-
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
-import org.w3c.dom.Element;
-
-/**
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class NotificationMapper {
-
-	/**
-	 * @param listenerConfigTree
-	 * @param listenerService
-	 * @param model
-	 */
-	public static void map(Element listenerConfigTree, Service listenerService, XMLBeansModel model) {
-		// TODO Auto-generated method stub
-		
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/NotificationMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/NotificationMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/NotificationMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/NotificationMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,44 @@
+/*
+ * 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.config.mappers;
+
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
+import org.w3c.dom.Element;
+
+/**
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NotificationMapper {
+
+	/**
+	 * @param listenerConfigTree
+	 * @param listenerService
+	 * @param model
+	 */
+	public static void map(Element listenerConfigTree, Service listenerService, XMLBeansModel model) {
+		// TODO Auto-generated method stub
+		
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,115 +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,
- */
-
-package org.jboss.soa.esb.listeners.config.mappers;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.SqlBusDocument.SqlBus;
-import org.jboss.soa.esb.listeners.config.SqlListenerDocument.SqlListener;
-import org.jboss.soa.esb.listeners.config.SqlMessageFilterDocument.SqlMessageFilter;
-import org.jboss.soa.esb.listeners.config.SqlProviderDocument.SqlProvider;
-import org.jboss.soa.esb.listeners.gateway.SqlTableGatewayListener;
-import org.w3c.dom.Element;
-
-/**
- * Performs the mapping of a &lt;fs-listener&gt; XSD based configuration to the "ConfigTree"
- * style configuration, adding the "ConfigTree" listener config to the "root" node.
- * 
- * @author <a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>
- */
-public class SqlListenerMapper {
-
-	/**
-	 * Perform the mapping.
-	 * @param root The "ConfigTree" configuration root node.
-	 * @param listener The Jmslistener to be mapped into the ConfigTree.
-	 * @param model The configuration model from which the mapping is being performed.
-	 * @return The ConfigTree listener configuration node.
-	 * @throws ConfigurationException Invalid listener configuration.
-	 */
-	public static Element map(Element root, SqlListener listener, XMLBeansModel model) throws ConfigurationException {
-		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
-		SqlBus bus;
-		SqlProvider provider;
-		
-		try {
-			bus = (SqlBus) model.getBus(listener.getBusidref());
-		} catch (ClassCastException e) {
-			throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <sql-listener> must reference a <sql-bus>.");
-		}
-		try {
-			provider = (SqlProvider) model.getProvider(bus);
-		} catch (ClassCastException e) {
-			throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <sql-provider> instance.  Unexpected exception - this should have caused a validation error!");
-		}
-		
-		SqlMessageFilter messageFilter = listener.getSqlMessageFilter();
-		if(messageFilter == null) {
-			messageFilter = bus.getSqlMessageFilter();
-			if(messageFilter == null) {
-				throw new ConfigurationException("No <sql-detination> defined on either <sql-listener> [" + listener.getName() + "] or <sql-bus> [" + bus.getBusid() + "].");
-			}
-		}
-		listenerNode.setAttribute("pollLatencySeconds", String.valueOf(listener.getPollFrequencySeconds()));
-		// Map the standard listener attributes - common across all listener types...
-		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
-		// Map the <property> elements targeted at the listener - from the listener itself.
-		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);			
-		if(listener.getIsGateway()) {
-			listenerNode.setAttribute("gatewayClass", SqlTableGatewayListener.class.getName());
-			// Map EPR related attributes onto the listener - from the bus and provider and listener.
-			// Note: This will change - the Gateways will also support the EPR element...
-			mapSqlEprProperties(listenerNode, provider, messageFilter);
-			MapperUtil.mapEPRProperties(listener, listenerNode, model);
-		} else {
-			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
-			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
-			mapSqlEprProperties(eprNode, provider, messageFilter);
-			MapperUtil.mapEPRProperties(listener, eprNode, model);
-			// Remove any empty attributes set on the EPR config...
-			YADOMUtil.removeEmptyAttributes(eprNode);
-		}
-		
-		// Remove any empty attributes set on the listener config...
-		YADOMUtil.removeEmptyAttributes(listenerNode);
-		
-		return listenerNode;
-	}
-
-	private static void mapSqlEprProperties(Element toElement, SqlProvider provider, SqlMessageFilter messageFilter) {
-		toElement.setAttribute(JDBCEpr.URL_TAG, provider.getUrl());
-		toElement.setAttribute(JDBCEpr.DRIVER_TAG, provider.getDriver());
-		toElement.setAttribute(JDBCEpr.USERNAME_TAG, provider.getUsername());
-		toElement.setAttribute(JDBCEpr.PASSWORD_TAG, provider.getPassword());
-		toElement.setAttribute(JDBCEpr.TABLE_NAME_TAG, messageFilter.getTablename());
-		toElement.setAttribute(JDBCEpr.MESSAGE_ID_COLUMN_TAG, messageFilter.getMessageIdColumn());
-		toElement.setAttribute(JDBCEpr.DATA_COLUMN_TAG, messageFilter.getMessageColumn());
-		toElement.setAttribute(JDBCEpr.STATUS_COLUMN_TAG, String.valueOf(messageFilter.getStatusColumn()));
-		toElement.setAttribute(JDBCEpr.TIMESTAMP_COLUMN_TAG, messageFilter.getInsertTimestampColumn());
-		toElement.setAttribute(JDBCEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
-		toElement.setAttribute(JDBCEpr.ERROR_DEL_TAG, String.valueOf(messageFilter.getErrorDelete()));
-		
-		
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/SqlListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,115 @@
+/*
+ * 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,
+ */
+
+package org.jboss.soa.esb.listeners.config.mappers;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.SqlBusDocument.SqlBus;
+import org.jboss.soa.esb.listeners.config.SqlListenerDocument.SqlListener;
+import org.jboss.soa.esb.listeners.config.SqlMessageFilterDocument.SqlMessageFilter;
+import org.jboss.soa.esb.listeners.config.SqlProviderDocument.SqlProvider;
+import org.jboss.soa.esb.listeners.gateway.SqlTableGatewayListener;
+import org.w3c.dom.Element;
+
+/**
+ * Performs the mapping of a &lt;fs-listener&gt; XSD based configuration to the "ConfigTree"
+ * style configuration, adding the "ConfigTree" listener config to the "root" node.
+ * 
+ * @author <a href="mailto:kurt.stam at jboss.com">kurt.stam at jboss.com</a>
+ */
+public class SqlListenerMapper {
+
+	/**
+	 * Perform the mapping.
+	 * @param root The "ConfigTree" configuration root node.
+	 * @param listener The Jmslistener to be mapped into the ConfigTree.
+	 * @param model The configuration model from which the mapping is being performed.
+	 * @return The ConfigTree listener configuration node.
+	 * @throws ConfigurationException Invalid listener configuration.
+	 */
+	public static Element map(Element root, SqlListener listener, XMLBeansModel model) throws ConfigurationException {
+		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
+		SqlBus bus;
+		SqlProvider provider;
+		
+		try {
+			bus = (SqlBus) model.getBus(listener.getBusidref());
+		} catch (ClassCastException e) {
+			throw new ConfigurationException("Invalid busid reference [" + listener.getBusidref() + "] on listener [" + listener.getName() + "].  A <sql-listener> must reference a <sql-bus>.");
+		}
+		try {
+			provider = (SqlProvider) model.getProvider(bus);
+		} catch (ClassCastException e) {
+			throw new ConfigurationException("Invalid bus config [" + listener.getBusidref() + "].  Should be contained within a <sql-provider> instance.  Unexpected exception - this should have caused a validation error!");
+		}
+		
+		SqlMessageFilter messageFilter = listener.getSqlMessageFilter();
+		if(messageFilter == null) {
+			messageFilter = bus.getSqlMessageFilter();
+			if(messageFilter == null) {
+				throw new ConfigurationException("No <sql-detination> defined on either <sql-listener> [" + listener.getName() + "] or <sql-bus> [" + bus.getBusid() + "].");
+			}
+		}
+		listenerNode.setAttribute("pollLatencySeconds", String.valueOf(listener.getPollFrequencySeconds()));
+		// Map the standard listener attributes - common across all listener types...
+		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+		// Map the <property> elements targeted at the listener - from the listener itself.
+		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);			
+		if(listener.getIsGateway()) {
+			listenerNode.setAttribute("gatewayClass", SqlTableGatewayListener.class.getName());
+			// Map EPR related attributes onto the listener - from the bus and provider and listener.
+			// Note: This will change - the Gateways will also support the EPR element...
+			mapSqlEprProperties(listenerNode, provider, messageFilter);
+			MapperUtil.mapEPRProperties(listener, listenerNode, model);
+		} else {
+			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+			// Map EPR related attributes onto the EPR - from the bus and provider and listener...
+			mapSqlEprProperties(eprNode, provider, messageFilter);
+			MapperUtil.mapEPRProperties(listener, eprNode, model);
+			// Remove any empty attributes set on the EPR config...
+			YADOMUtil.removeEmptyAttributes(eprNode);
+		}
+		
+		// Remove any empty attributes set on the listener config...
+		YADOMUtil.removeEmptyAttributes(listenerNode);
+		
+		return listenerNode;
+	}
+
+	private static void mapSqlEprProperties(Element toElement, SqlProvider provider, SqlMessageFilter messageFilter) {
+		toElement.setAttribute(JDBCEpr.URL_TAG, provider.getUrl());
+		toElement.setAttribute(JDBCEpr.DRIVER_TAG, provider.getDriver());
+		toElement.setAttribute(JDBCEpr.USERNAME_TAG, provider.getUsername());
+		toElement.setAttribute(JDBCEpr.PASSWORD_TAG, provider.getPassword());
+		toElement.setAttribute(JDBCEpr.TABLE_NAME_TAG, messageFilter.getTablename());
+		toElement.setAttribute(JDBCEpr.MESSAGE_ID_COLUMN_TAG, messageFilter.getMessageIdColumn());
+		toElement.setAttribute(JDBCEpr.DATA_COLUMN_TAG, messageFilter.getMessageColumn());
+		toElement.setAttribute(JDBCEpr.STATUS_COLUMN_TAG, String.valueOf(messageFilter.getStatusColumn()));
+		toElement.setAttribute(JDBCEpr.TIMESTAMP_COLUMN_TAG, messageFilter.getInsertTimestampColumn());
+		toElement.setAttribute(JDBCEpr.POST_DEL_TAG, String.valueOf(messageFilter.getPostDelete()));
+		toElement.setAttribute(JDBCEpr.ERROR_DEL_TAG, String.valueOf(messageFilter.getErrorDelete()));
+		
+		
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/UntypedListenerMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/UntypedListenerMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/UntypedListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,106 +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.config.mappers;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.config.Bus;
-import org.jboss.soa.esb.listeners.config.Listener;
-import org.jboss.soa.esb.listeners.config.Provider;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.impl.BusImpl;
-import org.jboss.soa.esb.listeners.config.impl.ListenerImpl;
-import org.jboss.soa.esb.listeners.config.impl.ProviderImpl;
-import org.w3c.dom.Element;
-
-/**
- * Perform a mapping for an "untyped" listener configuration.
- * <p/>
- * By "untyped" we mean that the listener type is not defined in the XSD, but instead is being
- * defined using the base &lt;listener&gt; type, mapping all it's associated
- * &lt;property&gt; values (including those of the associated bus and provider) onto the listener
- * ConfigTree as attributes.
- * <p/>
- * This is effectively like the base transform - if we don't have a mapper for the listener, this one is applied.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class UntypedListenerMapper {
-
-	/**
-	 * Perform the mapping.
-	 * @param root The "ConfigTree" configuration root node.
-	 * @param listener The listener to be mapped into the ConfigTree.
-	 * @param model The configuration model from which the mapping is being performed.
-	 * @return The ConfigTree listener configuration node.
-	 * @throws ConfigurationException Invalid listener configuration.
-	 */
-	public static Element map(Element root, Listener listener, XMLBeansModel model) throws ConfigurationException {
-		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
-		
-		assertListenerConfigOK(listener, model);
-		
-		// Map the standard listener attributes - common across all listener types...
-		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
-		// Map the <property> elements targeted at the listener - from the listener itself.
-		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
-
-		if(listener.getIsGateway()) {
-			MapperUtil.mapEPRProperties(listener, listenerNode, model);
-		} else {
-			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
-			MapperUtil.mapEPRProperties(listener, eprNode, model);
-			// Remove any empty attributes set on the EPR config...
-			YADOMUtil.removeEmptyAttributes(eprNode);
-		}
-		
-		// Remove any empty attributes set on the listener config...
-		YADOMUtil.removeEmptyAttributes(listenerNode);
-		
-		return listenerNode;
-	}
-
-	/**
-	 * Assert that a valid mapping can be performed from the supplied listener, and the bus + provider it reverences.
-	 * @param listener The listener to be checked.
-	 * @param model The config model instance.
-	 * @throws ConfigurationException Invalid mappng request.
-	 */
-
-	private static void assertListenerConfigOK(Listener listener, XMLBeansModel model) throws ConfigurationException {
-		
-		// Note we're purposely performing instanceof comparisons here...
-		
-		if(listener.getClass() != ListenerImpl.class) {
-			throw new ConfigurationException("Can only use the " + UntypedListenerMapper.class.getName() + " mapper on the base listener type.  Cannot use on " + listener.getClass().getName());
-		}
-		Bus bus = model.getBus(listener.getBusidref());
-		if(bus.getClass() != BusImpl.class) {
-			throw new ConfigurationException("The base Listener config [" + listener.getName() + "] must reference a base Bus config type (<bus>).");
-		}
-		Provider provider = model.getProvider(bus);
-		if(provider.getClass() != ProviderImpl.class) {
-			throw new ConfigurationException("A base Bus config type (<bus>) must be contained within a base Provider type (<provider>).");
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/UntypedListenerMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/UntypedListenerMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/UntypedListenerMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/config/mappers/UntypedListenerMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,106 @@
+/*
+ * 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.config.mappers;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.config.Bus;
+import org.jboss.soa.esb.listeners.config.Listener;
+import org.jboss.soa.esb.listeners.config.Provider;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.impl.BusImpl;
+import org.jboss.soa.esb.listeners.config.impl.ListenerImpl;
+import org.jboss.soa.esb.listeners.config.impl.ProviderImpl;
+import org.w3c.dom.Element;
+
+/**
+ * Perform a mapping for an "untyped" listener configuration.
+ * <p/>
+ * By "untyped" we mean that the listener type is not defined in the XSD, but instead is being
+ * defined using the base &lt;listener&gt; type, mapping all it's associated
+ * &lt;property&gt; values (including those of the associated bus and provider) onto the listener
+ * ConfigTree as attributes.
+ * <p/>
+ * This is effectively like the base transform - if we don't have a mapper for the listener, this one is applied.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class UntypedListenerMapper {
+
+	/**
+	 * Perform the mapping.
+	 * @param root The "ConfigTree" configuration root node.
+	 * @param listener The listener to be mapped into the ConfigTree.
+	 * @param model The configuration model from which the mapping is being performed.
+	 * @return The ConfigTree listener configuration node.
+	 * @throws ConfigurationException Invalid listener configuration.
+	 */
+	public static Element map(Element root, Listener listener, XMLBeansModel model) throws ConfigurationException {
+		Element listenerNode = YADOMUtil.addElement(root, listener.getName());
+		
+		assertListenerConfigOK(listener, model);
+		
+		// Map the standard listener attributes - common across all listener types...
+		MapperUtil.mapDefaultAttributes(listener, listenerNode, model);
+		// Map the <property> elements targeted at the listener - from the listener itself.
+		MapperUtil.mapProperties(listener.getPropertyList(), listenerNode);
+
+		if(listener.getIsGateway()) {
+			MapperUtil.mapEPRProperties(listener, listenerNode, model);
+		} else {
+			Element eprNode = YADOMUtil.addElement(listenerNode, ListenerTagNames.EPR_TAG);
+			MapperUtil.mapEPRProperties(listener, eprNode, model);
+			// Remove any empty attributes set on the EPR config...
+			YADOMUtil.removeEmptyAttributes(eprNode);
+		}
+		
+		// Remove any empty attributes set on the listener config...
+		YADOMUtil.removeEmptyAttributes(listenerNode);
+		
+		return listenerNode;
+	}
+
+	/**
+	 * Assert that a valid mapping can be performed from the supplied listener, and the bus + provider it reverences.
+	 * @param listener The listener to be checked.
+	 * @param model The config model instance.
+	 * @throws ConfigurationException Invalid mappng request.
+	 */
+
+	private static void assertListenerConfigOK(Listener listener, XMLBeansModel model) throws ConfigurationException {
+		
+		// Note we're purposely performing instanceof comparisons here...
+		
+		if(listener.getClass() != ListenerImpl.class) {
+			throw new ConfigurationException("Can only use the " + UntypedListenerMapper.class.getName() + " mapper on the base listener type.  Cannot use on " + listener.getClass().getName());
+		}
+		Bus bus = model.getBus(listener.getBusidref());
+		if(bus.getClass() != BusImpl.class) {
+			throw new ConfigurationException("The base Listener config [" + listener.getName() + "] must reference a base Bus config type (<bus>).");
+		}
+		Provider provider = model.getProvider(bus);
+		if(provider.getClass() != ProviderImpl.class) {
+			throw new ConfigurationException("A base Bus config type (<bus>) must be contained within a base Provider type (<provider>).");
+		}
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,612 +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.gateway;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.net.MalformedURLException;
-import java.net.URI;
-import java.net.URL;
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierTimeoutException;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.couriers.TwoWayCourier;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.ListenerUtil;
-import org.jboss.soa.esb.listeners.RegistryUtil;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.jboss.soa.esb.util.Util;
-
-/**
- * Base class for all file gateways: local filesystem, ftp, sftp and ftps.
- * <p/>Implementations for file manipulation (getFileList, getFileContents,
- * renameFile and deleteFile) must be provided by factory
- * 
- * @author <a
- *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- * 
- */
-public abstract class AbstractFileGateway extends AbstractThreadedManagedLifecycle
-{
-	abstract File[] getFileList() throws GatewayException;
-
-	abstract byte[] getFileContents(File file) throws GatewayException;
-
-	abstract boolean renameFile(File from, File to) throws GatewayException;
-
-	abstract boolean deleteFile(File file) throws GatewayException;
-
-	abstract void seeIfOkToWorkOnDir(File p_oDir) throws GatewayException;
-
-	abstract void getDefaultComposer() throws GatewayException;
-
-	abstract void bytesToFile(byte[] bytes, File file) throws GatewayException;
-
-	protected AbstractFileGateway(ConfigTree config) throws ConfigurationException, RegistryException, GatewayException
-	{
-            super(config) ;
-            _config = config;
-            _sleepBetweenPolls = 10000; // milliseconds
-            checkMyParms();
-	} // __________________________________
-        
-        /**
-         * Handle the initialisation of the managed instance.
-         * 
-         * @throws ManagedLifecycleException for errors while initialisation.
-         */
-        protected void doInitialise()
-            throws ManagedLifecycleException
-        {
-            try
-            {
-                _targetEprs = RegistryUtil.getEprs(_targetServiceCategory,_targetServiceName);
-                if (null == _targetEprs || _targetEprs.size() < 1)
-                    throw new ManagedLifecycleException("EPR <" + _targetServiceName + "> not found in registry") ;
-            }
-            catch (final RegistryException re)
-            {
-                throw new ManagedLifecycleException("Unexpected registry exception", re) ;
-            }
-        }
-
-        /**
-         * Execute on the thread.
-         */
-        protected void doRun()
-        {
-
-        	EPR 	replyEpr = null;
-        	Message replyMsg = null;
-        	
-        	if (_logger.isDebugEnabled())
-        	{
-        		_logger.debug("run() method of " + this.getClass().getSimpleName()
-    				+ " started on thread " + Thread.currentThread().getName());
-            }
-
-        	do {
-        		File[] fileList;
-			try {
-				fileList = getFileList();
-			} catch (GatewayException e) {
-				_logger.error("Can't retrieve file list", e);
-				continue;
-			}
-
-			for (File fileIn : fileList)
-			{
-				// Try to rename - if unsuccessful, somebody else got it first
-				File fileWork = getWorkFileName( fileIn, _workingSuffix);
-				try
-				{
-					if (!renameFile(fileIn, fileWork))
-						continue;
-				}
-				catch (GatewayException e)
-				{
-					_logger.error("Problems renaming file " + fileIn + " to "
-							+ fileWork);
-					continue;
-				}
-
-				Throwable thrown = null;
-				String text = null;
-				try
-				{
-					Object obj = _processMethod.invoke(_composer, new Object[]
-					{ fileWork });
-					if (null == obj)
-					{
-						_logger.warn("Action class method <"
-								+ _processMethod.getName()
-								+ "> returned a null object");
-						continue;
-					}
-					boolean bSent = false;
-
-                	Message outMessage = (Message) obj;
-                	outMessage.getProperties().setProperty(ORIGINAL_FILE_NAME_MSG_PROP, fileIn.getName());
-					for (EPR current : _targetEprs)
-					{
-						if (current instanceof FileEpr)
-						{
-							try
-							{
-								FileEpr fpr = (FileEpr) current;
-								FileEpr newEpr = new FileEpr(fpr.getURL());
-								newEpr.setPostDelete(false);
-								newEpr.setPostDirectory(fpr.getURL().getFile());
-								newEpr.setPostSuffix(fpr.getInputSuffix());
-								current = newEpr;
-							}
-							catch (Exception e)
-							{
-								_logger.error("Problems with file EPR", e);							}
-						}
-						_courier = getCourier(current);
-                        try
-                        {
-                        	replyEpr = null;
-                        	outMessage.getHeader().getCall().setTo(current);
-                        	if (_maxMillisForResponse>0)
-                        	{
-                        		replyEpr = CourierUtil.getDefaultReplyToEpr(current);
-                        		outMessage.getHeader().getCall().setReplyTo(replyEpr);
-                        	}
-                            if (_courier.deliver(outMessage))
-                            {
-                            	bSent = true;
-                            	break;
-                            }
-                        }
-                        finally
-                        {
-                            CourierUtil.cleanCourier(_courier) ;
-                        }
-                                                
-					}
-					if (!bSent)
-					{
-						text = "Target service <" + _targetServiceCategory
-								+ "," + _targetServiceName
-								+ "> is not registered";
-						thrown = new Exception(text);
-					}
-					else if (null!=replyEpr)
-					{
-						TwoWayCourier replyCourier = CourierFactory.getPickupCourier(replyEpr);
-						try
-						{
-							replyMsg = replyCourier.pickup(_maxMillisForResponse);
-							_responderMethod.invoke(_composer, new Object[] {replyMsg,fileIn});
-						}
-						catch (CourierTimeoutException e)
-						{
-							thrown = e;
-							text = "Expected response was not received from invoked service";
-							replyMsg = MessageFactory.getInstance().getMessage();
-							String timedOut = "Service <"
-								+_targetServiceCategory+","+"_targetServiceName"
-								+"> timed out without sending response";
-							replyMsg.getBody().setByteArray(timedOut.getBytes());
-							_responderMethod.invoke(_composer, new Object[] {replyMsg,fileIn});
-						}
-						finally
-						{
-							if (null!=replyCourier)
-								CourierUtil.cleanCourier(replyCourier);
-						}
-					}
-				}
-				catch (InvocationTargetException e)
-				{
-					thrown = e;
-					text = "Problems invoking method <"
-							+ _processMethod.getName() + ">";
-
-				}
-				catch (IllegalAccessException e)
-				{
-					thrown = e;
-					text = "Problems invoking method <"
-							+ _processMethod.getName() + ">";
-				}
-				catch (ClassCastException e)
-				{
-					thrown = e;
-					text = "Action class method <" + _processMethod.getName()
-							+ "> returned a non Message object";
-				}
-				catch (CourierException e)
-				{
-					thrown = e;
-					if (null != _courier)
-						text = "Courier <" + _courier.getClass().getName()
-								+ ".deliverAsync(Message) FAILED";
-					else
-						text = "NULL courier can't deliverAsync Message";
-				}
-				catch (MalformedEPRException e)
-				{
-					thrown = e;
-					if (null != _courier)
-						text = "Courier <" + _courier.getClass().getName()
-								+ ".deliverAsync(Message) FAILED with malformed EPR.";
-					else
-						text = "NULL courier can't deliverAsync Message";
-				}
-
-				if (null == thrown)
-				{
-					File fileOK = new File(_postProcessDirectory, fileIn
-							.getName()
-							+ _postProcessSuffix);
-					if (_deleteAfterOK)
-					{
-						try
-						{
-							deleteFile(fileWork);
-						}
-						catch (GatewayException e)
-						{
-							_logger
-									.error(
-											"File "
-													+ fileIn
-													+ " has been processed and renamed to "
-													+ fileWork
-													+ ", but there were problems deleting it from the input directory ",
-											e);
-						}
-					}
-					else
-					{
-						try
-						{
-							renameFile(fileWork, fileOK);
-						}
-						catch (GatewayException e)
-						{
-							_logger
-									.error(
-											"File "
-													+ fileIn
-													+ " has been processed and renamed to "
-													+ fileWork
-													+ ", but there were problems renaming it to "
-													+ fileOK, e);
-						}
-					}
-				}
-				else
-				{
-					thrown.printStackTrace();
-					_logger.error(text, thrown);
-					File fileError = new File(_errorDirectory, fileIn.getName() + _errorSuffix);
-					try
-					{
-						deleteFile(fileError);
-					}
-					catch (GatewayException e)
-					{
-						_logger.warn( "File : " + fileError + " did not exist.");
-					}
-					try
-					{
-						renameFile(fileWork, fileError);
-					}
-					catch (GatewayException e)
-					{
-						_logger.error("Problems renaming file " + fileWork + " to " + fileError, e);
-					}
-				}
-			}
-		}
-                while (!waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, _sleepBetweenPolls)) ;
-
-                if (_logger.isDebugEnabled())
-                {
-                    _logger.debug("run() method of " + this.getClass().getSimpleName()
-				+ " finished on thread " + Thread.currentThread().getName());
-                }
-	} // ________________________________
-        
-        protected File getWorkFileName( File fileIn, String suffix )
-		{
-			return new File(fileIn.toString() + _workingSuffix);
-		}
-
-		/* 
-         * Extracted to simplify testing
-         */
-        protected Courier getCourier( EPR current ) throws CourierException, MalformedEPRException
-		{
-			return CourierFactory.getCourier(current);
-		}
-
-		/**
-         * Handle the destroy of the managed instance.
-         * 
-         * @throws ManagedLifecycleException for errors while destroying.
-         */
-        protected void doDestroy()
-            throws ManagedLifecycleException
-        {
-        }
-
-        /*
-         * Is the input suffix valid for this type of gateway?
-         */
-        
-        protected void checkInputSuffix () throws ConfigurationException
-        {
-            if (_inputSuffix.length() < 1)
-		throw new ConfigurationException("Invalid "
-			+ ListenerTagNames.FILE_INPUT_SFX_TAG + " attribute");
-        }
-  
-	/**
-	 * Check for mandatory and optional attributes in parameter tree
-	 * 
-	 * @throws ConfigurationException -
-	 *             if mandatory atts are not right or actionClass not in
-	 *             classpath
-	 */
-	private void checkMyParms() throws ConfigurationException, RegistryException, GatewayException
-	{
-		// Third arg is null - Exception will be thrown if attribute is not
-		// found
-		_targetServiceCategory = ListenerUtil.obtainAtt(_config,
-				ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
-		_targetServiceName = ListenerUtil.obtainAtt(_config,
-				ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
-
-		// Polling interval
-		String sAux = _config
-				.getAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG);
-		
-		if (!Util.isNullString(sAux))
-		{
-			try
-			{
-				_sleepBetweenPolls = 1000 * Long.parseLong(sAux);
-			}
-			catch (NumberFormatException e)
-			{
-				_logger.warn("Invalid poll latency - keeping default of "
-						+ (_sleepBetweenPolls / 1000));
-			}
-		}
-		else
-		{
-			_logger.warn("No value specified for: "
-					+ ListenerTagNames.POLL_LATENCY_SECS_TAG
-					+ " -  Using default of " + (_sleepBetweenPolls / 1000));
-		}
-
-		resolveComposerClass();
-
-		boolean hasResponder = _responderMethod!=null; 
-		_maxMillisForResponse = ListenerUtil.getMaxMillisGatewayWait
-			(_config, _logger, hasResponder);
-		try
-		{
-			// INPUT directory and suffix (used for FileFilter)
-			String url = _config.getAttribute(ListenerTagNames.URL_TAG);
-			String sInpDir = (null != url) ? new URL(url).getFile() :
-                            ListenerUtil.obtainAtt(_config, ListenerTagNames.FILE_INPUT_DIR_TAG, null);
-			_inputDirectory = fileFromString(sInpDir);
-			seeIfOkToWorkOnDir(_inputDirectory);
-	
-			_inputSuffix = ListenerUtil.obtainAtt(_config,
-					ListenerTagNames.FILE_INPUT_SFX_TAG, null);
-			_inputSuffix = _inputSuffix.trim();
-			
-			checkInputSuffix();
-	
-			// WORK suffix (will rename in input directory)
-			_workingSuffix = ListenerUtil.obtainAtt(_config,
-					ListenerTagNames.FILE_WORK_SFX_TAG, ".esbWork").trim();
-			if (_workingSuffix.length() < 1)
-				throw new ConfigurationException("Invalid " + ListenerTagNames.FILE_WORK_SFX_TAG
-						+ " attribute");
-			
-			if (_inputSuffix.equals(_workingSuffix))
-				throw new ConfigurationException("Work suffix must differ from input suffix <"
-						+ _workingSuffix + ">");
-	
-			// ERROR directory and suffix (defaults to input dir and ".esbError"
-			// suffix)
-			String sErrDir = ListenerUtil.obtainAtt(_config,
-					ListenerTagNames.FILE_ERROR_DIR_TAG, sInpDir);
-			_errorDirectory = fileFromString(sErrDir);
-			seeIfOkToWorkOnDir(_errorDirectory);
-	
-			_errorSuffix = ListenerUtil.obtainAtt(_config,
-					ListenerTagNames.FILE_ERROR_SFX_TAG, ".esbError").trim();
-			if (_errorSuffix.length() < 1)
-				throw new ConfigurationException("Invalid "
-						+ ListenerTagNames.FILE_ERROR_SFX_TAG + " attribute");
-			if (_errorDirectory.equals(_inputDirectory)
-					&& _inputSuffix.equals(_errorSuffix))
-				throw new ConfigurationException("Error suffix must differ from input suffix <"
-						+ _errorSuffix + ">");
-	
-			// Do users wish to delete files that were processed OK ?
-			String sPostDel = ListenerUtil.obtainAtt(_config,
-					ListenerTagNames.FILE_POST_DEL_TAG, "false").trim();
-			_deleteAfterOK = Boolean.parseBoolean(sPostDel);
-			if (_deleteAfterOK)
-				return;
-	
-			// POST (done) directory and suffix (defaults to input dir and
-			// ".esbDone" suffix)
-			String sPostDir = ListenerUtil.obtainAtt(_config,
-					ListenerTagNames.FILE_POST_DIR_TAG, sInpDir);
-			_postProcessDirectory = fileFromString(sPostDir);
-			seeIfOkToWorkOnDir(_postProcessDirectory);
-			_postProcessSuffix = ListenerUtil.obtainAtt(_config,
-					ListenerTagNames.FILE_POST_SFX_TAG, ".esbDone").trim();
-			
-			if (_postProcessDirectory.equals(_inputDirectory))
-		        {
-					if (_postProcessSuffix.length() < 1)
-						throw new ConfigurationException("Invalid "
-								+ ListenerTagNames.FILE_POST_SFX_TAG + " attribute");
-					if (_postProcessSuffix.equals(_inputSuffix))
-						throw new ConfigurationException(
-								"Post process suffix must differ from input suffix <"
-										+ _postProcessSuffix + ">");
-		        }
-		}
-		catch (GatewayException ex)
-		{
-			throw ex;
-		}
-		catch (MalformedURLException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-	} // ________________________________
-
-	protected void resolveComposerClass() throws ConfigurationException, GatewayException
-	{
-		String sProcessMethod 	= null;
-		String sResponderMethod = null;
-		try
-		{
-			_composerName = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG);
-			if (null != _composerName)
-			{ // class attribute
-				_composerClass = ClassUtil.forName(_composerName, getClass());
-				Constructor oConst = _composerClass.getConstructor(new Class[]
-				{ ConfigTree.class });
-				_composer = oConst.newInstance(_config);
-				sProcessMethod = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_METHOD_TAG, "process");
-				sResponderMethod = _config.getAttribute(ListenerTagNames.GATEWAY_RESPONDER_METHOD_TAG);
-			}
-			else
-			{
-				getDefaultComposer();
-				sProcessMethod 	 = "process";
-				sResponderMethod = "respond";
-			}
-	
-			_processMethod = _composerClass.getMethod
-				(sProcessMethod, new Class[]{ Object.class });
-
-			_responderMethod = (null==sResponderMethod) ? null
-				: _composerClass.getMethod(sResponderMethod
-						, new Class[] {Message.class, File.class});
-		}
-		catch (InvocationTargetException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-		catch (IllegalAccessException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-		catch (InstantiationException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-		catch (NoSuchMethodException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-		catch (ClassNotFoundException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-	} // ________________________________
-
-	private File fileFromString(String file)
-	{
-		try
-		{
-			return new File(new URI(file));
-		}
-		catch (Exception e)
-		{
-			return new File(file);
-		}
-	} // ________________________________
-
-	protected final static Logger _logger = Logger
-			.getLogger(AbstractFileGateway.class);
-
-	protected ConfigTree _config;
-
-	protected long _sleepBetweenPolls; // milliseconds
-	protected long _maxMillisForResponse;
-
-	protected String _targetServiceCategory, _targetServiceName;
-
-	protected Collection<EPR> _targetEprs;
-
-	protected String _composerName;
-
-	protected Class _composerClass;
-
-	protected Object _composer;
-
-	protected Method _processMethod;
-	protected Method _responderMethod;
-
-	protected Courier _courier;
-
-	protected boolean _deleteAfterOK;
-
-	protected File _inputDirectory, _errorDirectory, _postProcessDirectory;
-
-	protected String _inputSuffix, _postProcessSuffix, _workingSuffix,
-			_errorSuffix;
-
-	protected FileFilter _fileFilter;
-	
-	/** Message property name for original filename */
-	public static final String ORIGINAL_FILE_NAME_MSG_PROP = "org.jboss.soa.esb.gateway.original.file.name";
-	
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/AbstractFileGateway.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,612 @@
+/*
+ * 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.gateway;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URI;
+import java.net.URL;
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierTimeoutException;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.couriers.TwoWayCourier;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.listeners.RegistryUtil;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * Base class for all file gateways: local filesystem, ftp, sftp and ftps.
+ * <p/>Implementations for file manipulation (getFileList, getFileContents,
+ * renameFile and deleteFile) must be provided by factory
+ * 
+ * @author <a
+ *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ * 
+ */
+public abstract class AbstractFileGateway extends AbstractThreadedManagedLifecycle
+{
+	abstract File[] getFileList() throws GatewayException;
+
+	abstract byte[] getFileContents(File file) throws GatewayException;
+
+	abstract boolean renameFile(File from, File to) throws GatewayException;
+
+	abstract boolean deleteFile(File file) throws GatewayException;
+
+	abstract void seeIfOkToWorkOnDir(File p_oDir) throws GatewayException;
+
+	abstract void getDefaultComposer() throws GatewayException;
+
+	abstract void bytesToFile(byte[] bytes, File file) throws GatewayException;
+
+	protected AbstractFileGateway(ConfigTree config) throws ConfigurationException, RegistryException, GatewayException
+	{
+            super(config) ;
+            _config = config;
+            _sleepBetweenPolls = 10000; // milliseconds
+            checkMyParms();
+	} // __________________________________
+        
+        /**
+         * Handle the initialisation of the managed instance.
+         * 
+         * @throws ManagedLifecycleException for errors while initialisation.
+         */
+        protected void doInitialise()
+            throws ManagedLifecycleException
+        {
+            try
+            {
+                _targetEprs = RegistryUtil.getEprs(_targetServiceCategory,_targetServiceName);
+                if (null == _targetEprs || _targetEprs.size() < 1)
+                    throw new ManagedLifecycleException("EPR <" + _targetServiceName + "> not found in registry") ;
+            }
+            catch (final RegistryException re)
+            {
+                throw new ManagedLifecycleException("Unexpected registry exception", re) ;
+            }
+        }
+
+        /**
+         * Execute on the thread.
+         */
+        protected void doRun()
+        {
+
+        	EPR 	replyEpr = null;
+        	Message replyMsg = null;
+        	
+        	if (_logger.isDebugEnabled())
+        	{
+        		_logger.debug("run() method of " + this.getClass().getSimpleName()
+    				+ " started on thread " + Thread.currentThread().getName());
+            }
+
+        	do {
+        		File[] fileList;
+			try {
+				fileList = getFileList();
+			} catch (GatewayException e) {
+				_logger.error("Can't retrieve file list", e);
+				continue;
+			}
+
+			for (File fileIn : fileList)
+			{
+				// Try to rename - if unsuccessful, somebody else got it first
+				File fileWork = getWorkFileName( fileIn, _workingSuffix);
+				try
+				{
+					if (!renameFile(fileIn, fileWork))
+						continue;
+				}
+				catch (GatewayException e)
+				{
+					_logger.error("Problems renaming file " + fileIn + " to "
+							+ fileWork);
+					continue;
+				}
+
+				Throwable thrown = null;
+				String text = null;
+				try
+				{
+					Object obj = _processMethod.invoke(_composer, new Object[]
+					{ fileWork });
+					if (null == obj)
+					{
+						_logger.warn("Action class method <"
+								+ _processMethod.getName()
+								+ "> returned a null object");
+						continue;
+					}
+					boolean bSent = false;
+
+                	Message outMessage = (Message) obj;
+                	outMessage.getProperties().setProperty(ORIGINAL_FILE_NAME_MSG_PROP, fileIn.getName());
+					for (EPR current : _targetEprs)
+					{
+						if (current instanceof FileEpr)
+						{
+							try
+							{
+								FileEpr fpr = (FileEpr) current;
+								FileEpr newEpr = new FileEpr(fpr.getURL());
+								newEpr.setPostDelete(false);
+								newEpr.setPostDirectory(fpr.getURL().getFile());
+								newEpr.setPostSuffix(fpr.getInputSuffix());
+								current = newEpr;
+							}
+							catch (Exception e)
+							{
+								_logger.error("Problems with file EPR", e);							}
+						}
+						_courier = getCourier(current);
+                        try
+                        {
+                        	replyEpr = null;
+                        	outMessage.getHeader().getCall().setTo(current);
+                        	if (_maxMillisForResponse>0)
+                        	{
+                        		replyEpr = CourierUtil.getDefaultReplyToEpr(current);
+                        		outMessage.getHeader().getCall().setReplyTo(replyEpr);
+                        	}
+                            if (_courier.deliver(outMessage))
+                            {
+                            	bSent = true;
+                            	break;
+                            }
+                        }
+                        finally
+                        {
+                            CourierUtil.cleanCourier(_courier) ;
+                        }
+                                                
+					}
+					if (!bSent)
+					{
+						text = "Target service <" + _targetServiceCategory
+								+ "," + _targetServiceName
+								+ "> is not registered";
+						thrown = new Exception(text);
+					}
+					else if (null!=replyEpr)
+					{
+						TwoWayCourier replyCourier = CourierFactory.getPickupCourier(replyEpr);
+						try
+						{
+							replyMsg = replyCourier.pickup(_maxMillisForResponse);
+							_responderMethod.invoke(_composer, new Object[] {replyMsg,fileIn});
+						}
+						catch (CourierTimeoutException e)
+						{
+							thrown = e;
+							text = "Expected response was not received from invoked service";
+							replyMsg = MessageFactory.getInstance().getMessage();
+							String timedOut = "Service <"
+								+_targetServiceCategory+","+"_targetServiceName"
+								+"> timed out without sending response";
+							replyMsg.getBody().setByteArray(timedOut.getBytes());
+							_responderMethod.invoke(_composer, new Object[] {replyMsg,fileIn});
+						}
+						finally
+						{
+							if (null!=replyCourier)
+								CourierUtil.cleanCourier(replyCourier);
+						}
+					}
+				}
+				catch (InvocationTargetException e)
+				{
+					thrown = e;
+					text = "Problems invoking method <"
+							+ _processMethod.getName() + ">";
+
+				}
+				catch (IllegalAccessException e)
+				{
+					thrown = e;
+					text = "Problems invoking method <"
+							+ _processMethod.getName() + ">";
+				}
+				catch (ClassCastException e)
+				{
+					thrown = e;
+					text = "Action class method <" + _processMethod.getName()
+							+ "> returned a non Message object";
+				}
+				catch (CourierException e)
+				{
+					thrown = e;
+					if (null != _courier)
+						text = "Courier <" + _courier.getClass().getName()
+								+ ".deliverAsync(Message) FAILED";
+					else
+						text = "NULL courier can't deliverAsync Message";
+				}
+				catch (MalformedEPRException e)
+				{
+					thrown = e;
+					if (null != _courier)
+						text = "Courier <" + _courier.getClass().getName()
+								+ ".deliverAsync(Message) FAILED with malformed EPR.";
+					else
+						text = "NULL courier can't deliverAsync Message";
+				}
+
+				if (null == thrown)
+				{
+					File fileOK = new File(_postProcessDirectory, fileIn
+							.getName()
+							+ _postProcessSuffix);
+					if (_deleteAfterOK)
+					{
+						try
+						{
+							deleteFile(fileWork);
+						}
+						catch (GatewayException e)
+						{
+							_logger
+									.error(
+											"File "
+													+ fileIn
+													+ " has been processed and renamed to "
+													+ fileWork
+													+ ", but there were problems deleting it from the input directory ",
+											e);
+						}
+					}
+					else
+					{
+						try
+						{
+							renameFile(fileWork, fileOK);
+						}
+						catch (GatewayException e)
+						{
+							_logger
+									.error(
+											"File "
+													+ fileIn
+													+ " has been processed and renamed to "
+													+ fileWork
+													+ ", but there were problems renaming it to "
+													+ fileOK, e);
+						}
+					}
+				}
+				else
+				{
+					thrown.printStackTrace();
+					_logger.error(text, thrown);
+					File fileError = new File(_errorDirectory, fileIn.getName() + _errorSuffix);
+					try
+					{
+						deleteFile(fileError);
+					}
+					catch (GatewayException e)
+					{
+						_logger.warn( "File : " + fileError + " did not exist.");
+					}
+					try
+					{
+						renameFile(fileWork, fileError);
+					}
+					catch (GatewayException e)
+					{
+						_logger.error("Problems renaming file " + fileWork + " to " + fileError, e);
+					}
+				}
+			}
+		}
+                while (!waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, _sleepBetweenPolls)) ;
+
+                if (_logger.isDebugEnabled())
+                {
+                    _logger.debug("run() method of " + this.getClass().getSimpleName()
+				+ " finished on thread " + Thread.currentThread().getName());
+                }
+	} // ________________________________
+        
+        protected File getWorkFileName( File fileIn, String suffix )
+		{
+			return new File(fileIn.toString() + _workingSuffix);
+		}
+
+		/* 
+         * Extracted to simplify testing
+         */
+        protected Courier getCourier( EPR current ) throws CourierException, MalformedEPRException
+		{
+			return CourierFactory.getCourier(current);
+		}
+
+		/**
+         * Handle the destroy of the managed instance.
+         * 
+         * @throws ManagedLifecycleException for errors while destroying.
+         */
+        protected void doDestroy()
+            throws ManagedLifecycleException
+        {
+        }
+
+        /*
+         * Is the input suffix valid for this type of gateway?
+         */
+        
+        protected void checkInputSuffix () throws ConfigurationException
+        {
+            if (_inputSuffix.length() < 1)
+		throw new ConfigurationException("Invalid "
+			+ ListenerTagNames.FILE_INPUT_SFX_TAG + " attribute");
+        }
+  
+	/**
+	 * Check for mandatory and optional attributes in parameter tree
+	 * 
+	 * @throws ConfigurationException -
+	 *             if mandatory atts are not right or actionClass not in
+	 *             classpath
+	 */
+	private void checkMyParms() throws ConfigurationException, RegistryException, GatewayException
+	{
+		// Third arg is null - Exception will be thrown if attribute is not
+		// found
+		_targetServiceCategory = ListenerUtil.obtainAtt(_config,
+				ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
+		_targetServiceName = ListenerUtil.obtainAtt(_config,
+				ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
+
+		// Polling interval
+		String sAux = _config
+				.getAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG);
+		
+		if (!Util.isNullString(sAux))
+		{
+			try
+			{
+				_sleepBetweenPolls = 1000 * Long.parseLong(sAux);
+			}
+			catch (NumberFormatException e)
+			{
+				_logger.warn("Invalid poll latency - keeping default of "
+						+ (_sleepBetweenPolls / 1000));
+			}
+		}
+		else
+		{
+			_logger.warn("No value specified for: "
+					+ ListenerTagNames.POLL_LATENCY_SECS_TAG
+					+ " -  Using default of " + (_sleepBetweenPolls / 1000));
+		}
+
+		resolveComposerClass();
+
+		boolean hasResponder = _responderMethod!=null; 
+		_maxMillisForResponse = ListenerUtil.getMaxMillisGatewayWait
+			(_config, _logger, hasResponder);
+		try
+		{
+			// INPUT directory and suffix (used for FileFilter)
+			String url = _config.getAttribute(ListenerTagNames.URL_TAG);
+			String sInpDir = (null != url) ? new URL(url).getFile() :
+                            ListenerUtil.obtainAtt(_config, ListenerTagNames.FILE_INPUT_DIR_TAG, null);
+			_inputDirectory = fileFromString(sInpDir);
+			seeIfOkToWorkOnDir(_inputDirectory);
+	
+			_inputSuffix = ListenerUtil.obtainAtt(_config,
+					ListenerTagNames.FILE_INPUT_SFX_TAG, null);
+			_inputSuffix = _inputSuffix.trim();
+			
+			checkInputSuffix();
+	
+			// WORK suffix (will rename in input directory)
+			_workingSuffix = ListenerUtil.obtainAtt(_config,
+					ListenerTagNames.FILE_WORK_SFX_TAG, ".esbWork").trim();
+			if (_workingSuffix.length() < 1)
+				throw new ConfigurationException("Invalid " + ListenerTagNames.FILE_WORK_SFX_TAG
+						+ " attribute");
+			
+			if (_inputSuffix.equals(_workingSuffix))
+				throw new ConfigurationException("Work suffix must differ from input suffix <"
+						+ _workingSuffix + ">");
+	
+			// ERROR directory and suffix (defaults to input dir and ".esbError"
+			// suffix)
+			String sErrDir = ListenerUtil.obtainAtt(_config,
+					ListenerTagNames.FILE_ERROR_DIR_TAG, sInpDir);
+			_errorDirectory = fileFromString(sErrDir);
+			seeIfOkToWorkOnDir(_errorDirectory);
+	
+			_errorSuffix = ListenerUtil.obtainAtt(_config,
+					ListenerTagNames.FILE_ERROR_SFX_TAG, ".esbError").trim();
+			if (_errorSuffix.length() < 1)
+				throw new ConfigurationException("Invalid "
+						+ ListenerTagNames.FILE_ERROR_SFX_TAG + " attribute");
+			if (_errorDirectory.equals(_inputDirectory)
+					&& _inputSuffix.equals(_errorSuffix))
+				throw new ConfigurationException("Error suffix must differ from input suffix <"
+						+ _errorSuffix + ">");
+	
+			// Do users wish to delete files that were processed OK ?
+			String sPostDel = ListenerUtil.obtainAtt(_config,
+					ListenerTagNames.FILE_POST_DEL_TAG, "false").trim();
+			_deleteAfterOK = Boolean.parseBoolean(sPostDel);
+			if (_deleteAfterOK)
+				return;
+	
+			// POST (done) directory and suffix (defaults to input dir and
+			// ".esbDone" suffix)
+			String sPostDir = ListenerUtil.obtainAtt(_config,
+					ListenerTagNames.FILE_POST_DIR_TAG, sInpDir);
+			_postProcessDirectory = fileFromString(sPostDir);
+			seeIfOkToWorkOnDir(_postProcessDirectory);
+			_postProcessSuffix = ListenerUtil.obtainAtt(_config,
+					ListenerTagNames.FILE_POST_SFX_TAG, ".esbDone").trim();
+			
+			if (_postProcessDirectory.equals(_inputDirectory))
+		        {
+					if (_postProcessSuffix.length() < 1)
+						throw new ConfigurationException("Invalid "
+								+ ListenerTagNames.FILE_POST_SFX_TAG + " attribute");
+					if (_postProcessSuffix.equals(_inputSuffix))
+						throw new ConfigurationException(
+								"Post process suffix must differ from input suffix <"
+										+ _postProcessSuffix + ">");
+		        }
+		}
+		catch (GatewayException ex)
+		{
+			throw ex;
+		}
+		catch (MalformedURLException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+	} // ________________________________
+
+	protected void resolveComposerClass() throws ConfigurationException, GatewayException
+	{
+		String sProcessMethod 	= null;
+		String sResponderMethod = null;
+		try
+		{
+			_composerName = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG);
+			if (null != _composerName)
+			{ // class attribute
+				_composerClass = ClassUtil.forName(_composerName, getClass());
+				Constructor oConst = _composerClass.getConstructor(new Class[]
+				{ ConfigTree.class });
+				_composer = oConst.newInstance(_config);
+				sProcessMethod = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_METHOD_TAG, "process");
+				sResponderMethod = _config.getAttribute(ListenerTagNames.GATEWAY_RESPONDER_METHOD_TAG);
+			}
+			else
+			{
+				getDefaultComposer();
+				sProcessMethod 	 = "process";
+				sResponderMethod = "respond";
+			}
+	
+			_processMethod = _composerClass.getMethod
+				(sProcessMethod, new Class[]{ Object.class });
+
+			_responderMethod = (null==sResponderMethod) ? null
+				: _composerClass.getMethod(sResponderMethod
+						, new Class[] {Message.class, File.class});
+		}
+		catch (InvocationTargetException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+		catch (IllegalAccessException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+		catch (InstantiationException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+		catch (NoSuchMethodException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+		catch (ClassNotFoundException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+	} // ________________________________
+
+	private File fileFromString(String file)
+	{
+		try
+		{
+			return new File(new URI(file));
+		}
+		catch (Exception e)
+		{
+			return new File(file);
+		}
+	} // ________________________________
+
+	protected final static Logger _logger = Logger
+			.getLogger(AbstractFileGateway.class);
+
+	protected ConfigTree _config;
+
+	protected long _sleepBetweenPolls; // milliseconds
+	protected long _maxMillisForResponse;
+
+	protected String _targetServiceCategory, _targetServiceName;
+
+	protected Collection<EPR> _targetEprs;
+
+	protected String _composerName;
+
+	protected Class _composerClass;
+
+	protected Object _composer;
+
+	protected Method _processMethod;
+	protected Method _responderMethod;
+
+	protected Courier _courier;
+
+	protected boolean _deleteAfterOK;
+
+	protected File _inputDirectory, _errorDirectory, _postProcessDirectory;
+
+	protected String _inputSuffix, _postProcessSuffix, _workingSuffix,
+			_errorSuffix;
+
+	protected FileFilter _fileFilter;
+	
+	/** Message property name for original filename */
+	public static final String ORIGINAL_FILE_NAME_MSG_PROP = "org.jboss.soa.esb.gateway.original.file.name";
+	
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,312 +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.gateway;
-
-import java.io.ByteArrayOutputStream;
-import java.io.File;
-import java.io.FileFilter;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.util.FileUtil;
-import org.jboss.soa.esb.util.Util;
-
-public class FileGatewayListener extends AbstractFileGateway
-{
-    /**
-     * serial version uid for this class
-     */
-    private static final long serialVersionUID = 8457176329093772449L;
-
-    public FileGatewayListener(ConfigTree config) throws ConfigurationException, RegistryException, GatewayException
-	{
-		super(config);
-		
-		/*
-		 * JBESB-454 allowed gateways to pull files with any extension. Obvious
-		 * security issue, but we are explicit about this in the docs and users
-		 * should beware.
-		 */
-		
-		if ((_inputSuffix == null) || (_inputSuffix.equals("")))
-		{
-		    /*
-		     * If no suffix, then inputDir must be different from outputDir
-		     * or we go into an infinite loop. Already checked through
-		     * checkMyParams.
-		     */
-		
-		    _inputFileFilter = null;
-		    
-		    /*
-		     * If no input suffix, then we must have a work suffix and we
-		     * must ignore worker files when sourcing new input files, or
-		     * we end up in an infinite loop.
-		     */
-		    
-		    _ignoreFileFilter = new IgnoreFile(_workingSuffix, _errorSuffix, _postProcessSuffix);
-		}
-		else
-		    _inputFileFilter = new FileEndsWith(_inputSuffix);
-	}
-
-	@Override
-	protected void seeIfOkToWorkOnDir(File p_oDir) throws GatewayException
-	{
-		if (!p_oDir.exists())
-			throw new GatewayException("Directory " + p_oDir.toString()
-					+ " not found");
-		if (!p_oDir.isDirectory())
-			throw new GatewayException(p_oDir.toString()
-					+ " is not a directory");
-		if (!p_oDir.canRead())
-			throw new GatewayException("Can't read directory "
-					+ p_oDir.toString());
-		if (!p_oDir.canWrite())
-			throw new GatewayException("Can't write/rename in directory "
-					+ p_oDir.toString());
-	} // ________________________________
-
-	@Override
-	boolean deleteFile(File file) throws GatewayException
-	{
-		return file.delete();
-	}
-
-	@Override
-	byte[] getFileContents(File file) throws GatewayException
-	{
-		try
-		{
-			ByteArrayOutputStream out = new ByteArrayOutputStream();
-			byte[] ba = new byte[1000];  // TODO magic number
-			int iQread;
-			FileInputStream inp = new FileInputStream(file);
-			while (-1 != (iQread = inp.read(ba)))
-				if (iQread > 0)
-					out.write(ba, 0, iQread);
-			inp.close();
-			out.close();
-			return out.toByteArray();
-		}
-		catch (IOException e)
-		{
-			throw new GatewayException(e);
-		}
-	}
-
-	@Override
-	File[] getFileList() throws GatewayException
-	{
-	    /*
-	     * JBESB-454 allows no input suffix. This means that we need to
-	     * ignore any worker files, which are written to the same directory,
-	     * but which have a well defined suffix. All other files (errors and
-	     * post processed) go into separate directories, so we don't need
-	     * to be concerned about them.
-	     */
-	    
-	    if (_inputFileFilter != null)
-	    {
-		/*
-		 * Input suffix is not null.
-		 */
-		
-		return _inputDirectory.listFiles(_inputFileFilter);
-	    }
-	    else
-	    {
-		/*
-		 * Input suffix is null so ignore any worker files.
-		 */
-		
-		return _inputDirectory.listFiles(_ignoreFileFilter);
-	    }
-	}
-
-	@Override
-	boolean renameFile(File from, File to) throws GatewayException
-	{
-		if (to.exists() && !to.delete())
-		{
-			throw new GatewayException("Cannot delete target file: "
-					+ to.getAbsolutePath());
-		}
-
-		return FileUtil.renameTo(from, to) ;
-	}
-
-	@Override
-	void getDefaultComposer() throws GatewayException
-	{
-		_composerName = PackageFileContents.class.getName();
-		_composerClass = PackageFileContents.class;
-		_composer = new PackageFileContents();
-		_logger.debug("No <" + ListenerTagNames.ACTION_ELEMENT_TAG
-				+ "> element found in gateway configuration"
-				+ " -  Using default composer class : " + _composerName);
-	}
-
-	@Override
-	void bytesToFile(byte[] bytes, File file) throws GatewayException 
-	{
-		try
-		{
-			if (file.exists() && !file.delete())
-				throw new GatewayException("Unable to delete existing file "+file);
-			FileOutputStream out = new FileOutputStream(file);
-			out.write(bytes);
-			out.close();
-		}
-		catch (Exception e) 
-		{
-			throw new GatewayException(e);
-		}
-	}
-
-	// ______________________________________________________________________________
-	/**
-	 * Default gateway action for files <p/>It will just drop the file contents
-	 * into a Message
-	 * 
-	 * @author <a
-	 *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
-	 * @since Version 4.0
-	 * 
-	 */
-	public class PackageFileContents
-	{
-		public Message process(Object obj) throws ConfigurationException, GatewayException
-		{
-			if (!(obj instanceof File))
-				throw new ConfigurationException("Object must be instance of File");
-
-			Message message = MessageFactory.getInstance().getMessage();
-			message.getBody().setByteArray(getFileContent((File) obj));
-			return message;
-		}
-
-		private byte[] getFileContent(File file) throws ConfigurationException, GatewayException
-		{
-			return getFileContents(file);
-		}
-
-		public void respond(Message msg, File file) throws Exception
-		{
-			File responseFile = new File(file.getParent(),file.getName()
-					+ FileEpr.DEFAULT_REPLY_TO_FILE_SUFFIX+"_gw");
-			bytesToFile(msg.getBody().getByteArray(), responseFile);
-		}
-
-	} // ____________________________________________________
-
-	/**
-	 * This implementation allows no input suffix, whereas the base class
-	 * requires an input suffix.
-	 */
-	
-	protected void checkInputSuffix () throws ConfigurationException
-        {
-	    // any suffix is allowed for input; set value to "" if null.
-	    
-	    if (_inputSuffix == null)
-		_inputSuffix = "";
-        }
-	
-	/**
-	 * Simple file filter for local filesystem Will accept only files that end
-	 * with the String supplied at constructor time
-	 * 
-	 */
-	private class FileEndsWith implements FileFilter
-	{
-		String m_sSuffix;
-
-		FileEndsWith(String p_sEnd) throws ConfigurationException
-		{
-			m_sSuffix = p_sEnd;
-			if (Util.isNullString(m_sSuffix))
-				throw new ConfigurationException("Must specify file extension");
-		} // ______________________________
-
-		public boolean accept(File p_f)
-		{
-			return (p_f.isFile()) ? p_f.toString().endsWith(m_sSuffix) : false;
-		}
-	}
-	
-	private class IgnoreFile implements FileFilter
-	{
-		String _workSuffix;
-		String _errorSuffix;
-		String _postSuffix;
-
-		IgnoreFile(String workSuffix, String errorSuffix, String postSuffix) throws ConfigurationException
-		{
-			_workSuffix = workSuffix;
-			_errorSuffix = errorSuffix;
-			_postSuffix = postSuffix;
-			
-			if (Util.isNullString(_workSuffix))
-				throw new ConfigurationException("Must specify workSuffix");
-			if (Util.isNullString(_errorSuffix))
-				throw new ConfigurationException("Must specify errorSuffix");
-			if (Util.isNullString(_postSuffix))
-				throw new ConfigurationException("Must specify postProcessSuffix");
-		} // ______________________________
-
-		public boolean accept(File p_f)
-		{
-		    if (p_f.isFile())
-		    {
-			/*
-			 * If file is a work file then ignore it.
-			 */
-			
-			String fileName = p_f.toString();
-			
-			if (fileName.endsWith(_workSuffix) || fileName.endsWith(_errorSuffix) || fileName.endsWith(_postSuffix))
-			{
-			    return false;
-			}
-			else
-			    return true;
-		    }
-		    else
-			return false;
-		}
-	}
-
-	private FileFilter _inputFileFilter;  // normal file filter
-	private FileFilter _ignoreFileFilter; // worker file filter (used if input suffix is null)
-
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,312 @@
+/*
+ * 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.gateway;
+
+import java.io.ByteArrayOutputStream;
+import java.io.File;
+import java.io.FileFilter;
+import java.io.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.FileUtil;
+import org.jboss.soa.esb.util.Util;
+
+public class FileGatewayListener extends AbstractFileGateway
+{
+    /**
+     * serial version uid for this class
+     */
+    private static final long serialVersionUID = 8457176329093772449L;
+
+    public FileGatewayListener(ConfigTree config) throws ConfigurationException, RegistryException, GatewayException
+	{
+		super(config);
+		
+		/*
+		 * JBESB-454 allowed gateways to pull files with any extension. Obvious
+		 * security issue, but we are explicit about this in the docs and users
+		 * should beware.
+		 */
+		
+		if ((_inputSuffix == null) || (_inputSuffix.equals("")))
+		{
+		    /*
+		     * If no suffix, then inputDir must be different from outputDir
+		     * or we go into an infinite loop. Already checked through
+		     * checkMyParams.
+		     */
+		
+		    _inputFileFilter = null;
+		    
+		    /*
+		     * If no input suffix, then we must have a work suffix and we
+		     * must ignore worker files when sourcing new input files, or
+		     * we end up in an infinite loop.
+		     */
+		    
+		    _ignoreFileFilter = new IgnoreFile(_workingSuffix, _errorSuffix, _postProcessSuffix);
+		}
+		else
+		    _inputFileFilter = new FileEndsWith(_inputSuffix);
+	}
+
+	@Override
+	protected void seeIfOkToWorkOnDir(File p_oDir) throws GatewayException
+	{
+		if (!p_oDir.exists())
+			throw new GatewayException("Directory " + p_oDir.toString()
+					+ " not found");
+		if (!p_oDir.isDirectory())
+			throw new GatewayException(p_oDir.toString()
+					+ " is not a directory");
+		if (!p_oDir.canRead())
+			throw new GatewayException("Can't read directory "
+					+ p_oDir.toString());
+		if (!p_oDir.canWrite())
+			throw new GatewayException("Can't write/rename in directory "
+					+ p_oDir.toString());
+	} // ________________________________
+
+	@Override
+	boolean deleteFile(File file) throws GatewayException
+	{
+		return file.delete();
+	}
+
+	@Override
+	byte[] getFileContents(File file) throws GatewayException
+	{
+		try
+		{
+			ByteArrayOutputStream out = new ByteArrayOutputStream();
+			byte[] ba = new byte[1000];  // TODO magic number
+			int iQread;
+			FileInputStream inp = new FileInputStream(file);
+			while (-1 != (iQread = inp.read(ba)))
+				if (iQread > 0)
+					out.write(ba, 0, iQread);
+			inp.close();
+			out.close();
+			return out.toByteArray();
+		}
+		catch (IOException e)
+		{
+			throw new GatewayException(e);
+		}
+	}
+
+	@Override
+	File[] getFileList() throws GatewayException
+	{
+	    /*
+	     * JBESB-454 allows no input suffix. This means that we need to
+	     * ignore any worker files, which are written to the same directory,
+	     * but which have a well defined suffix. All other files (errors and
+	     * post processed) go into separate directories, so we don't need
+	     * to be concerned about them.
+	     */
+	    
+	    if (_inputFileFilter != null)
+	    {
+		/*
+		 * Input suffix is not null.
+		 */
+		
+		return _inputDirectory.listFiles(_inputFileFilter);
+	    }
+	    else
+	    {
+		/*
+		 * Input suffix is null so ignore any worker files.
+		 */
+		
+		return _inputDirectory.listFiles(_ignoreFileFilter);
+	    }
+	}
+
+	@Override
+	boolean renameFile(File from, File to) throws GatewayException
+	{
+		if (to.exists() && !to.delete())
+		{
+			throw new GatewayException("Cannot delete target file: "
+					+ to.getAbsolutePath());
+		}
+
+		return FileUtil.renameTo(from, to) ;
+	}
+
+	@Override
+	void getDefaultComposer() throws GatewayException
+	{
+		_composerName = PackageFileContents.class.getName();
+		_composerClass = PackageFileContents.class;
+		_composer = new PackageFileContents();
+		_logger.debug("No <" + ListenerTagNames.ACTION_ELEMENT_TAG
+				+ "> element found in gateway configuration"
+				+ " -  Using default composer class : " + _composerName);
+	}
+
+	@Override
+	void bytesToFile(byte[] bytes, File file) throws GatewayException 
+	{
+		try
+		{
+			if (file.exists() && !file.delete())
+				throw new GatewayException("Unable to delete existing file "+file);
+			FileOutputStream out = new FileOutputStream(file);
+			out.write(bytes);
+			out.close();
+		}
+		catch (Exception e) 
+		{
+			throw new GatewayException(e);
+		}
+	}
+
+	// ______________________________________________________________________________
+	/**
+	 * Default gateway action for files <p/>It will just drop the file contents
+	 * into a Message
+	 * 
+	 * @author <a
+	 *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+	 * @since Version 4.0
+	 * 
+	 */
+	public class PackageFileContents
+	{
+		public Message process(Object obj) throws ConfigurationException, GatewayException
+		{
+			if (!(obj instanceof File))
+				throw new ConfigurationException("Object must be instance of File");
+
+			Message message = MessageFactory.getInstance().getMessage();
+			message.getBody().setByteArray(getFileContent((File) obj));
+			return message;
+		}
+
+		private byte[] getFileContent(File file) throws ConfigurationException, GatewayException
+		{
+			return getFileContents(file);
+		}
+
+		public void respond(Message msg, File file) throws Exception
+		{
+			File responseFile = new File(file.getParent(),file.getName()
+					+ FileEpr.DEFAULT_REPLY_TO_FILE_SUFFIX+"_gw");
+			bytesToFile(msg.getBody().getByteArray(), responseFile);
+		}
+
+	} // ____________________________________________________
+
+	/**
+	 * This implementation allows no input suffix, whereas the base class
+	 * requires an input suffix.
+	 */
+	
+	protected void checkInputSuffix () throws ConfigurationException
+        {
+	    // any suffix is allowed for input; set value to "" if null.
+	    
+	    if (_inputSuffix == null)
+		_inputSuffix = "";
+        }
+	
+	/**
+	 * Simple file filter for local filesystem Will accept only files that end
+	 * with the String supplied at constructor time
+	 * 
+	 */
+	private class FileEndsWith implements FileFilter
+	{
+		String m_sSuffix;
+
+		FileEndsWith(String p_sEnd) throws ConfigurationException
+		{
+			m_sSuffix = p_sEnd;
+			if (Util.isNullString(m_sSuffix))
+				throw new ConfigurationException("Must specify file extension");
+		} // ______________________________
+
+		public boolean accept(File p_f)
+		{
+			return (p_f.isFile()) ? p_f.toString().endsWith(m_sSuffix) : false;
+		}
+	}
+	
+	private class IgnoreFile implements FileFilter
+	{
+		String _workSuffix;
+		String _errorSuffix;
+		String _postSuffix;
+
+		IgnoreFile(String workSuffix, String errorSuffix, String postSuffix) throws ConfigurationException
+		{
+			_workSuffix = workSuffix;
+			_errorSuffix = errorSuffix;
+			_postSuffix = postSuffix;
+			
+			if (Util.isNullString(_workSuffix))
+				throw new ConfigurationException("Must specify workSuffix");
+			if (Util.isNullString(_errorSuffix))
+				throw new ConfigurationException("Must specify errorSuffix");
+			if (Util.isNullString(_postSuffix))
+				throw new ConfigurationException("Must specify postProcessSuffix");
+		} // ______________________________
+
+		public boolean accept(File p_f)
+		{
+		    if (p_f.isFile())
+		    {
+			/*
+			 * If file is a work file then ignore it.
+			 */
+			
+			String fileName = p_f.toString();
+			
+			if (fileName.endsWith(_workSuffix) || fileName.endsWith(_errorSuffix) || fileName.endsWith(_postSuffix))
+			{
+			    return false;
+			}
+			else
+			    return true;
+		    }
+		    else
+			return false;
+		}
+	}
+
+	private FileFilter _inputFileFilter;  // normal file filter
+	private FileFilter _ignoreFileFilter; // worker file filter (used if input suffix is null)
+
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,54 +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.gateway;
-
-import org.jboss.soa.esb.BaseException;
-
-/**
- * Gateway Exception.
- * @author b_georges
- * @since Version 4.0
- */
-public class GatewayException extends BaseException {
-    
-    private static final long serialVersionUID = 1L;
-    
-    /**
-     * Construct an exception instance.
-     * @param message Exception message.
-     */
-    public GatewayException(String message) { super(message); }
-    
-    /**
-     * Construct an exception instance.
-     * @param message Exception message.
-     * @param cause Exception cause.
-     */
-    public GatewayException(String message, Throwable cause) { super(message, cause); }
-    
-    /**
-     * Construct an exception instance.
-     * @param cause Exception cause.
-     */
-    public GatewayException(Throwable cause) { super(cause); }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,54 @@
+/*
+ * 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.gateway;
+
+import org.jboss.soa.esb.BaseException;
+
+/**
+ * Gateway Exception.
+ * @author b_georges
+ * @since Version 4.0
+ */
+public class GatewayException extends BaseException {
+    
+    private static final long serialVersionUID = 1L;
+    
+    /**
+     * Construct an exception instance.
+     * @param message Exception message.
+     */
+    public GatewayException(String message) { super(message); }
+    
+    /**
+     * Construct an exception instance.
+     * @param message Exception message.
+     * @param cause Exception cause.
+     */
+    public GatewayException(String message, Throwable cause) { super(message, cause); }
+    
+    /**
+     * Construct an exception instance.
+     * @param cause Exception cause.
+     */
+    public GatewayException(Throwable cause) { super(cause); }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerServiceMBean.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerServiceMBean.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerServiceMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.gateway;
-
-import org.jboss.system.ServiceMBean;
-/**
- * 
- * @author Kurt Stam
- *
- */
-public interface GatewayListenerControllerServiceMBean extends ServiceMBean
-{
-   // Configure getters and setters for the configFile attribute
-   String getGatewayConfigFile();
-   void setGatewayConfigFile(String messageAwareConfigFile);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerServiceMBean.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerServiceMBean.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerServiceMBean.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerServiceMBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,35 @@
+/*
+ * 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.gateway;
+
+import org.jboss.system.ServiceMBean;
+/**
+ * 
+ * @author Kurt Stam
+ *
+ */
+public interface GatewayListenerControllerServiceMBean extends ServiceMBean
+{
+   // Configure getters and setters for the configFile attribute
+   String getGatewayConfigFile();
+   void setGatewayConfigFile(String messageAwareConfigFile);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GroovyGateway.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GroovyGateway.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GroovyGateway.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,154 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.gateway;
-
-import groovy.lang.Binding;
-import groovy.lang.GroovyShell;
-import groovy.lang.Script;
-
-import java.io.IOException;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.scripting.GroovyActionProcessor;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.message.BasicMessageComposer;
-import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * Gateway listener that start the supplied Groovy script.
- * <p/>
- * The Groovy script effectively becomes the gateway listener.  The script path (classpath)
- * is specified in the "script" configuration property.
- * <p/>
- * The script is injected with references to the
- * {@link org.w3c.dom.Document config} ("config"), a {@link org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter}
- * instance for its target service ("deliveryAdapter"), and a reference to the gateway lifecycle instance ("gateway").
- * <p/>
- * <h3>Sample Config</h3>
- * <pre>
- *  &lt;groovy-listener name="soap-client" script="/org/jboss/scripts/MyScript.groovy" is-gateway="true" /&gt;
- * </pre>
- * <h3>Sample Script</h3>
- * <pre>
- *  def stopped = false;
- *  println "Starting loop in listener..."
- *  while(!stopped) {
- *      print "."
- *      stopped = gateway.{@link GroovyGateway#waitUntilStopping(long) waitUntilStopping}(200);
- *  }
- *  println ""
- *  println "loop ended"
- *
- *  println "delivering message..."
- *  {@link UncomposedMessageDeliveryAdapter deliveryAdapter}.deliverAsync({@link org.w3c.dom.Document config}.getAttribute("xxxx"));
- * </pre>
- *
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class GroovyGateway extends AbstractThreadedManagedLifecycle {
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-    /**
-     * Logger.
-     */
-    private static Logger logger = Logger.getLogger(GroovyGateway.class);
-    /**
-     * Gateway script.
-     */
-    private Script script;
-
-    /**
-     * Construct the threaded managed lifecycle.
-     *
-     * @param config The configuration associated with this instance.
-     * @throws org.jboss.soa.esb.ConfigurationException
-     *          for configuration errors during initialisation.
-     */
-    public GroovyGateway(ConfigTree config) throws ConfigurationException {
-        super(config);
-        String scriptPath = config.getAttribute("script");
-
-        scriptPath = mapToPrebundledScript(scriptPath);
-        if(scriptPath == null) {
-            throw new ConfigurationException("No Groovy script specified on listener config " + config.getAttribute("name"));
-        } else {
-            try {
-                GroovyShell shell = new GroovyShell();
-                script = shell.parse(GroovyActionProcessor.getScriptFromClasspath(scriptPath));
-            } catch (IOException e) {
-                throw new ConfigurationException("Error reading script '" + scriptPath + "' stream.");
-            }
-        }
-    }
-
-    private String mapToPrebundledScript(String scriptName) {
-        try {
-            String scriptPath = ClassUtil.getPath(getClass().getPackage()) + "/scripts/" + scriptName;
-
-            if(!scriptPath.endsWith(".groovy")) {
-                scriptPath += ".groovy";
-            }
-            if(GroovyActionProcessor.getScriptFromClasspath(scriptPath) != null) {
-                return scriptPath;
-            }
-        } catch (IOException e) {
-            // Ignore...
-        }
-
-        return scriptName;
-    }
-
-    protected void doInitialise() throws ManagedLifecycleException {
-        try {
-            // Configure the groovy script....
-            Binding binding = new Binding();
-            binding.setVariable("config", getConfig());
-            binding.setVariable("gateway", this);
-            binding.setVariable("deliveryAdapter", createDeliveryAdapter());
-            script.setBinding(binding);
-        } catch (ConfigurationException e) {
-           throw new ManagedLifecycleException("Unable to construct message delivery adapter.", e);
-        }
-    }
-
-    protected void doRun() {
-        logger.info("Starting Groovy Gateway " + getConfig().getName());
-        script.run();
-        logger.info("Stopping Groovy Gateway " + getConfig().getName());
-    }
-
-    /**
-     * Factory method for adapter creation.
-     *
-     * @return The adapter instance.
-     * @throws ConfigurationException Configuration error.
-     */
-    protected UncomposedMessageDeliveryAdapter createDeliveryAdapter() throws ConfigurationException {
-        return UncomposedMessageDeliveryAdapter.getGatewayDeliveryAdapter(getConfig(), new BasicMessageComposer());
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GroovyGateway.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GroovyGateway.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GroovyGateway.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/GroovyGateway.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,154 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import groovy.lang.Binding;
+import groovy.lang.GroovyShell;
+import groovy.lang.Script;
+
+import java.io.IOException;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.scripting.GroovyActionProcessor;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.message.BasicMessageComposer;
+import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Gateway listener that start the supplied Groovy script.
+ * <p/>
+ * The Groovy script effectively becomes the gateway listener.  The script path (classpath)
+ * is specified in the "script" configuration property.
+ * <p/>
+ * The script is injected with references to the
+ * {@link org.w3c.dom.Document config} ("config"), a {@link org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter}
+ * instance for its target service ("deliveryAdapter"), and a reference to the gateway lifecycle instance ("gateway").
+ * <p/>
+ * <h3>Sample Config</h3>
+ * <pre>
+ *  &lt;groovy-listener name="soap-client" script="/org/jboss/scripts/MyScript.groovy" is-gateway="true" /&gt;
+ * </pre>
+ * <h3>Sample Script</h3>
+ * <pre>
+ *  def stopped = false;
+ *  println "Starting loop in listener..."
+ *  while(!stopped) {
+ *      print "."
+ *      stopped = gateway.{@link GroovyGateway#waitUntilStopping(long) waitUntilStopping}(200);
+ *  }
+ *  println ""
+ *  println "loop ended"
+ *
+ *  println "delivering message..."
+ *  {@link UncomposedMessageDeliveryAdapter deliveryAdapter}.deliverAsync({@link org.w3c.dom.Document config}.getAttribute("xxxx"));
+ * </pre>
+ *
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class GroovyGateway extends AbstractThreadedManagedLifecycle {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+    /**
+     * Logger.
+     */
+    private static Logger logger = Logger.getLogger(GroovyGateway.class);
+    /**
+     * Gateway script.
+     */
+    private Script script;
+
+    /**
+     * Construct the threaded managed lifecycle.
+     *
+     * @param config The configuration associated with this instance.
+     * @throws org.jboss.soa.esb.ConfigurationException
+     *          for configuration errors during initialisation.
+     */
+    public GroovyGateway(ConfigTree config) throws ConfigurationException {
+        super(config);
+        String scriptPath = config.getAttribute("script");
+
+        scriptPath = mapToPrebundledScript(scriptPath);
+        if(scriptPath == null) {
+            throw new ConfigurationException("No Groovy script specified on listener config " + config.getAttribute("name"));
+        } else {
+            try {
+                GroovyShell shell = new GroovyShell();
+                script = shell.parse(GroovyActionProcessor.getScriptFromClasspath(scriptPath));
+            } catch (IOException e) {
+                throw new ConfigurationException("Error reading script '" + scriptPath + "' stream.");
+            }
+        }
+    }
+
+    private String mapToPrebundledScript(String scriptName) {
+        try {
+            String scriptPath = ClassUtil.getPath(getClass().getPackage()) + "/scripts/" + scriptName;
+
+            if(!scriptPath.endsWith(".groovy")) {
+                scriptPath += ".groovy";
+            }
+            if(GroovyActionProcessor.getScriptFromClasspath(scriptPath) != null) {
+                return scriptPath;
+            }
+        } catch (IOException e) {
+            // Ignore...
+        }
+
+        return scriptName;
+    }
+
+    protected void doInitialise() throws ManagedLifecycleException {
+        try {
+            // Configure the groovy script....
+            Binding binding = new Binding();
+            binding.setVariable("config", getConfig());
+            binding.setVariable("gateway", this);
+            binding.setVariable("deliveryAdapter", createDeliveryAdapter());
+            script.setBinding(binding);
+        } catch (ConfigurationException e) {
+           throw new ManagedLifecycleException("Unable to construct message delivery adapter.", e);
+        }
+    }
+
+    protected void doRun() {
+        logger.info("Starting Groovy Gateway " + getConfig().getName());
+        script.run();
+        logger.info("Stopping Groovy Gateway " + getConfig().getName());
+    }
+
+    /**
+     * Factory method for adapter creation.
+     *
+     * @return The adapter instance.
+     * @throws ConfigurationException Configuration error.
+     */
+    protected UncomposedMessageDeliveryAdapter createDeliveryAdapter() throws ConfigurationException {
+        return UncomposedMessageDeliveryAdapter.getGatewayDeliveryAdapter(getConfig(), new BasicMessageComposer());
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,79 +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.gateway;
-
-/**
- * Bean for hibernate events - contains an event and a class name.
- * 
- * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
- * @since Version 4.2
- * 
- */
-public class HibernateEventBean {
-	private String m_event;
-	private String m_className;
-	
-	public HibernateEventBean() {
-	}
-	
-	/**
-	 * Constructor
-	 * @param f_event event
-	 * @param f_className class name
-	 */
-	public HibernateEventBean(String f_event, String f_className) {
-		m_event = f_event;
-		m_className = f_className;
-	}
-	
-	/**
-	 * Accessor for class name.
-	 * @return class name
-	 */
-	public String getClassname() {
-		return m_className;
-	}
-	
-	/**
-	 * Mutator for class name
-	 * @param classname class name
-	 */
-	public void setClassname(String classname) {
-		m_className = classname;
-	}
-	
-	/**
-	 * Accessor for list of events.
-	 * @return comma separated list of events
-	 */
-	public String getEvent() {
-		return m_event;
-	}
-	
-	/**
-	 * Mutator for event
-	 * @param m_event
-	 */
-	public void setEvent(String m_event) {
-		this.m_event = m_event;
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,79 @@
+/*
+ * 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.gateway;
+
+/**
+ * Bean for hibernate events - contains an event and a class name.
+ * 
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @since Version 4.2
+ * 
+ */
+public class HibernateEventBean {
+	private String m_event;
+	private String m_className;
+	
+	public HibernateEventBean() {
+	}
+	
+	/**
+	 * Constructor
+	 * @param f_event event
+	 * @param f_className class name
+	 */
+	public HibernateEventBean(String f_event, String f_className) {
+		m_event = f_event;
+		m_className = f_className;
+	}
+	
+	/**
+	 * Accessor for class name.
+	 * @return class name
+	 */
+	public String getClassname() {
+		return m_className;
+	}
+	
+	/**
+	 * Mutator for class name
+	 * @param classname class name
+	 */
+	public void setClassname(String classname) {
+		m_className = classname;
+	}
+	
+	/**
+	 * Accessor for list of events.
+	 * @return comma separated list of events
+	 */
+	public String getEvent() {
+		return m_event;
+	}
+	
+	/**
+	 * Mutator for event
+	 * @param m_event
+	 */
+	public void setEvent(String m_event) {
+		this.m_event = m_event;
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,290 +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.gateway;
-
-import java.util.Map;
-import java.util.Set;
-import java.util.concurrent.BlockingQueue;
-import java.util.concurrent.LinkedBlockingQueue;
-
-import org.apache.log4j.Logger;
-import org.hibernate.HibernateException;
-import org.hibernate.event.AbstractEvent;
-import org.hibernate.event.AutoFlushEvent;
-import org.hibernate.event.AutoFlushEventListener;
-import org.hibernate.event.DeleteEvent;
-import org.hibernate.event.DeleteEventListener;
-import org.hibernate.event.DirtyCheckEvent;
-import org.hibernate.event.DirtyCheckEventListener;
-import org.hibernate.event.EvictEvent;
-import org.hibernate.event.EvictEventListener;
-import org.hibernate.event.FlushEntityEvent;
-import org.hibernate.event.FlushEntityEventListener;
-import org.hibernate.event.FlushEvent;
-import org.hibernate.event.FlushEventListener;
-import org.hibernate.event.InitializeCollectionEvent;
-import org.hibernate.event.InitializeCollectionEventListener;
-import org.hibernate.event.LoadEvent;
-import org.hibernate.event.LoadEventListener;
-import org.hibernate.event.LockEvent;
-import org.hibernate.event.LockEventListener;
-import org.hibernate.event.MergeEvent;
-import org.hibernate.event.MergeEventListener;
-import org.hibernate.event.PersistEvent;
-import org.hibernate.event.PersistEventListener;
-import org.hibernate.event.PostDeleteEvent;
-import org.hibernate.event.PostDeleteEventListener;
-import org.hibernate.event.PostInsertEvent;
-import org.hibernate.event.PostInsertEventListener;
-import org.hibernate.event.PostLoadEvent;
-import org.hibernate.event.PostLoadEventListener;
-import org.hibernate.event.PostUpdateEvent;
-import org.hibernate.event.PostUpdateEventListener;
-import org.hibernate.event.PreDeleteEvent;
-import org.hibernate.event.PreDeleteEventListener;
-import org.hibernate.event.PreInsertEvent;
-import org.hibernate.event.PreInsertEventListener;
-import org.hibernate.event.PreLoadEvent;
-import org.hibernate.event.PreLoadEventListener;
-import org.hibernate.event.PreUpdateEvent;
-import org.hibernate.event.PreUpdateEventListener;
-import org.hibernate.event.RefreshEvent;
-import org.hibernate.event.RefreshEventListener;
-import org.hibernate.event.ReplicateEvent;
-import org.hibernate.event.ReplicateEventListener;
-import org.hibernate.event.SaveOrUpdateEvent;
-import org.hibernate.event.SaveOrUpdateEventListener;
-
-/**
- * This class is a Hibernate EventListener which implements hooks to all the available
- * hibernate events.   It's not used at the moment, but might be a way of augmenting  
- * the Hibernate Interceptor hooks which are currently implemented.
- * 
- * Again, please note that this file is not currently used.
- * 
- * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
- */
-public class HibernateEventListener implements 
-								AutoFlushEventListener,
-								DeleteEventListener,
-								DirtyCheckEventListener,
-								EvictEventListener,
-								FlushEntityEventListener,
-								FlushEventListener,
-								InitializeCollectionEventListener,
-								LoadEventListener, 
-								LockEventListener,
-								MergeEventListener,
-								PersistEventListener,
-								PostDeleteEventListener,
-								PostInsertEventListener,
-								PostLoadEventListener,
-								PostUpdateEventListener,
-								PreDeleteEventListener,
-								PreInsertEventListener,
-								PreLoadEventListener,
-								PreUpdateEventListener,
-								RefreshEventListener,
-								ReplicateEventListener,
-								SaveOrUpdateEventListener {
-
-	private static final long serialVersionUID = 7125882028251049616L;
-	protected final static Logger m_logger = Logger.getLogger(HibernateEventListener.class);
-	
-	public HibernateEventListener() {
-		super();
-
-	}
-	
-	protected Object doPreSend() {
-		try {
-			return queue.take();
-		} catch (InterruptedException e) {
-			m_logger.warn(" interrupted while getting event off queue " , e);
-			return null;
-		}
-	}
-
-	protected BlockingQueue<AbstractEvent> queue = new LinkedBlockingQueue<AbstractEvent>();
-	
-	// Hibernate based event methods......
-		
-	public void onDelete(DeleteEvent event) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-
-		if(m_logger.isDebugEnabled()) {
-			m_logger.debug(" Receiving delete event: " + event);
-		}
-		try {
-			queue.put(event);
-		} catch (InterruptedException e) {
-			m_logger.info(" Event was interrupted onDelete on adding to queue",e);
-		}
-	}
-
-	public void onSaveOrUpdate(SaveOrUpdateEvent event) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		
-		if(m_logger.isDebugEnabled()) {
-			m_logger.debug(" Receiving save or update event: " + event);
-		}
-		try {
-			queue.put(event);
-		} catch (InterruptedException e) {
-			m_logger.info(" Event was interrupted onSaveOrUpdate on adding to queue",e);
-		}
-	}
-
-	public void onLoad(LoadEvent event, LoadType type) throws HibernateException {
-		// TODO do something with the type : type.getName()
-		System.out.println("HibernateEventLister!");
-
-		if(m_logger.isDebugEnabled()) {
-			m_logger.debug(" Receiving load event: " + event);
-		}
-		try {
-			queue.put(event);
-		} catch (InterruptedException e) {
-			m_logger.info(" Event was interrupted onLoad on adding to queue",e);
-		}
-		
-	}
-	
-	public void onDelete(DeleteEvent arg0, Set arg1) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onDelete");
-	}
-	
-	public void onPostInsert (PostInsertEvent event) {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onPostInsert");
-	}
-
-	public void onDirtyCheck(DirtyCheckEvent arg0) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onDirtyCheck");
-	}
-
-	public void onEvict(EvictEvent arg0) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onEvict");
-	}
-
-	public void onFlushEntity(FlushEntityEvent arg0) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onFlushEntity");
-	}
-
-	public void onFlush(FlushEvent arg0) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onFlush");
-	}
-
-	public void onInitializeCollection(InitializeCollectionEvent arg0) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onEvict");
-	}
-
-	public void onLock(LockEvent arg0) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onLock");
-	}
-
-	public void onMerge(MergeEvent arg0) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onMerge");
-	}
-
-	public void onMerge(MergeEvent arg0, Map arg1) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onMerge");
-	}
-
-	public void onPersist(PersistEvent arg0) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onPersist");
-	}
-
-	public void onPersist(PersistEvent arg0, Map arg1) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onPersist");
-	}
-
-	public void onPostDelete(PostDeleteEvent arg0) {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onPostDelete");
-	}
-
-	public void onPostLoad(PostLoadEvent arg0) {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onPostLoad");
-	}
-
-	public void onPostUpdate(PostUpdateEvent arg0) {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onPostUpdate");
-	}
-
-	public boolean onPreDelete(PreDeleteEvent arg0) {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onPreDelete");
-		return false;
-	}
-
-	public boolean onPreInsert(PreInsertEvent arg0) {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onPreInsert");
-		return false;
-	}
-
-	public void onPreLoad(PreLoadEvent arg0) {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onPreLoad");
-	}
-
-	public boolean onPreUpdate(PreUpdateEvent arg0) {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onPreUpdate");
-		return false;
-	}
-
-	public void onRefresh(RefreshEvent arg0) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onRefresh");
-	}
-
-	public void onRefresh(RefreshEvent arg0, Map arg1) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onRefresh");
-	}
-
-	public void onReplicate(ReplicateEvent arg0) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onReplicate");
-	}
-
-	public void onAutoFlush(AutoFlushEvent arg0) throws HibernateException {
-		System.out.println("HibernateEventLister!");
-		m_logger.error("onAutoFlush");
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateEventListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,290 @@
+/*
+ * 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.gateway;
+
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.BlockingQueue;
+import java.util.concurrent.LinkedBlockingQueue;
+
+import org.apache.log4j.Logger;
+import org.hibernate.HibernateException;
+import org.hibernate.event.AbstractEvent;
+import org.hibernate.event.AutoFlushEvent;
+import org.hibernate.event.AutoFlushEventListener;
+import org.hibernate.event.DeleteEvent;
+import org.hibernate.event.DeleteEventListener;
+import org.hibernate.event.DirtyCheckEvent;
+import org.hibernate.event.DirtyCheckEventListener;
+import org.hibernate.event.EvictEvent;
+import org.hibernate.event.EvictEventListener;
+import org.hibernate.event.FlushEntityEvent;
+import org.hibernate.event.FlushEntityEventListener;
+import org.hibernate.event.FlushEvent;
+import org.hibernate.event.FlushEventListener;
+import org.hibernate.event.InitializeCollectionEvent;
+import org.hibernate.event.InitializeCollectionEventListener;
+import org.hibernate.event.LoadEvent;
+import org.hibernate.event.LoadEventListener;
+import org.hibernate.event.LockEvent;
+import org.hibernate.event.LockEventListener;
+import org.hibernate.event.MergeEvent;
+import org.hibernate.event.MergeEventListener;
+import org.hibernate.event.PersistEvent;
+import org.hibernate.event.PersistEventListener;
+import org.hibernate.event.PostDeleteEvent;
+import org.hibernate.event.PostDeleteEventListener;
+import org.hibernate.event.PostInsertEvent;
+import org.hibernate.event.PostInsertEventListener;
+import org.hibernate.event.PostLoadEvent;
+import org.hibernate.event.PostLoadEventListener;
+import org.hibernate.event.PostUpdateEvent;
+import org.hibernate.event.PostUpdateEventListener;
+import org.hibernate.event.PreDeleteEvent;
+import org.hibernate.event.PreDeleteEventListener;
+import org.hibernate.event.PreInsertEvent;
+import org.hibernate.event.PreInsertEventListener;
+import org.hibernate.event.PreLoadEvent;
+import org.hibernate.event.PreLoadEventListener;
+import org.hibernate.event.PreUpdateEvent;
+import org.hibernate.event.PreUpdateEventListener;
+import org.hibernate.event.RefreshEvent;
+import org.hibernate.event.RefreshEventListener;
+import org.hibernate.event.ReplicateEvent;
+import org.hibernate.event.ReplicateEventListener;
+import org.hibernate.event.SaveOrUpdateEvent;
+import org.hibernate.event.SaveOrUpdateEventListener;
+
+/**
+ * This class is a Hibernate EventListener which implements hooks to all the available
+ * hibernate events.   It's not used at the moment, but might be a way of augmenting  
+ * the Hibernate Interceptor hooks which are currently implemented.
+ * 
+ * Again, please note that this file is not currently used.
+ * 
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ */
+public class HibernateEventListener implements 
+								AutoFlushEventListener,
+								DeleteEventListener,
+								DirtyCheckEventListener,
+								EvictEventListener,
+								FlushEntityEventListener,
+								FlushEventListener,
+								InitializeCollectionEventListener,
+								LoadEventListener, 
+								LockEventListener,
+								MergeEventListener,
+								PersistEventListener,
+								PostDeleteEventListener,
+								PostInsertEventListener,
+								PostLoadEventListener,
+								PostUpdateEventListener,
+								PreDeleteEventListener,
+								PreInsertEventListener,
+								PreLoadEventListener,
+								PreUpdateEventListener,
+								RefreshEventListener,
+								ReplicateEventListener,
+								SaveOrUpdateEventListener {
+
+	private static final long serialVersionUID = 7125882028251049616L;
+	protected final static Logger m_logger = Logger.getLogger(HibernateEventListener.class);
+	
+	public HibernateEventListener() {
+		super();
+
+	}
+	
+	protected Object doPreSend() {
+		try {
+			return queue.take();
+		} catch (InterruptedException e) {
+			m_logger.warn(" interrupted while getting event off queue " , e);
+			return null;
+		}
+	}
+
+	protected BlockingQueue<AbstractEvent> queue = new LinkedBlockingQueue<AbstractEvent>();
+	
+	// Hibernate based event methods......
+		
+	public void onDelete(DeleteEvent event) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+
+		if(m_logger.isDebugEnabled()) {
+			m_logger.debug(" Receiving delete event: " + event);
+		}
+		try {
+			queue.put(event);
+		} catch (InterruptedException e) {
+			m_logger.info(" Event was interrupted onDelete on adding to queue",e);
+		}
+	}
+
+	public void onSaveOrUpdate(SaveOrUpdateEvent event) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		
+		if(m_logger.isDebugEnabled()) {
+			m_logger.debug(" Receiving save or update event: " + event);
+		}
+		try {
+			queue.put(event);
+		} catch (InterruptedException e) {
+			m_logger.info(" Event was interrupted onSaveOrUpdate on adding to queue",e);
+		}
+	}
+
+	public void onLoad(LoadEvent event, LoadType type) throws HibernateException {
+		// TODO do something with the type : type.getName()
+		System.out.println("HibernateEventLister!");
+
+		if(m_logger.isDebugEnabled()) {
+			m_logger.debug(" Receiving load event: " + event);
+		}
+		try {
+			queue.put(event);
+		} catch (InterruptedException e) {
+			m_logger.info(" Event was interrupted onLoad on adding to queue",e);
+		}
+		
+	}
+	
+	public void onDelete(DeleteEvent arg0, Set arg1) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onDelete");
+	}
+	
+	public void onPostInsert (PostInsertEvent event) {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onPostInsert");
+	}
+
+	public void onDirtyCheck(DirtyCheckEvent arg0) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onDirtyCheck");
+	}
+
+	public void onEvict(EvictEvent arg0) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onEvict");
+	}
+
+	public void onFlushEntity(FlushEntityEvent arg0) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onFlushEntity");
+	}
+
+	public void onFlush(FlushEvent arg0) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onFlush");
+	}
+
+	public void onInitializeCollection(InitializeCollectionEvent arg0) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onEvict");
+	}
+
+	public void onLock(LockEvent arg0) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onLock");
+	}
+
+	public void onMerge(MergeEvent arg0) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onMerge");
+	}
+
+	public void onMerge(MergeEvent arg0, Map arg1) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onMerge");
+	}
+
+	public void onPersist(PersistEvent arg0) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onPersist");
+	}
+
+	public void onPersist(PersistEvent arg0, Map arg1) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onPersist");
+	}
+
+	public void onPostDelete(PostDeleteEvent arg0) {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onPostDelete");
+	}
+
+	public void onPostLoad(PostLoadEvent arg0) {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onPostLoad");
+	}
+
+	public void onPostUpdate(PostUpdateEvent arg0) {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onPostUpdate");
+	}
+
+	public boolean onPreDelete(PreDeleteEvent arg0) {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onPreDelete");
+		return false;
+	}
+
+	public boolean onPreInsert(PreInsertEvent arg0) {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onPreInsert");
+		return false;
+	}
+
+	public void onPreLoad(PreLoadEvent arg0) {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onPreLoad");
+	}
+
+	public boolean onPreUpdate(PreUpdateEvent arg0) {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onPreUpdate");
+		return false;
+	}
+
+	public void onRefresh(RefreshEvent arg0) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onRefresh");
+	}
+
+	public void onRefresh(RefreshEvent arg0, Map arg1) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onRefresh");
+	}
+
+	public void onReplicate(ReplicateEvent arg0) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onReplicate");
+	}
+
+	public void onAutoFlush(AutoFlushEvent arg0) throws HibernateException {
+		System.out.println("HibernateEventLister!");
+		m_logger.error("onAutoFlush");
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,131 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, 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.gateway;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.hibernate.SessionFactory;
-import org.hibernate.cfg.Configuration;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.persist.HibernateSessionFactory;
-import org.jboss.soa.esb.listeners.ListenerUtil;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-
-/**
- * HibernateGatewayListener is a listener which creates a HibernateInterceptor for 
- * the classname/events that need to be listened to.
- * 
- * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
- * @since Version 4.2
- * 
- */
-public class HibernateGatewayListener extends AbstractManagedLifecycle {
-	private static final long serialVersionUID = -8794895112076882394L;
-
-	private String m_cfgFile;
-	private ConfigTree m_config;
-	protected Object _composer;
-	protected Class _composerClass;
-	protected String _composerName;
-	protected String m_targetServiceCategory, m_targetServiceName;	
-	
-	protected Collection<EPR> m_targetEprs;
-	
-	private static final String MESSAGE_FILTER = "messagefilter";
-	
-	protected final static Logger m_logger = Logger.getLogger(HibernateGatewayListener.class);
-
-	/**
-	 * This constructor takes in a configTree element and grabs the hibernate configuration
-	 * file name.
-	 * 
-	 * @param config configtree
-	 * @throws ConfigurationException
-	 */
-	public HibernateGatewayListener(ConfigTree config) throws ConfigurationException {
-		super(config);
-		m_config = config;
-		m_cfgFile = ListenerUtil.obtainAtt(m_config, HibernateEpr.HIBERNATE_CFG_TAG, null);
-	}
-
-	@Override
-	protected void doDestroy() throws ManagedLifecycleException {
-	}
-
-	@Override
-	protected void doInitialise() throws ManagedLifecycleException {
-		ArrayList<HibernateEventBean> eventList = new ArrayList<HibernateEventBean>();
-
-		Configuration cfg = new Configuration();
-		cfg.configure(m_cfgFile);
-
-		// Need to loop through messagefilters and add them as interceptors
-		for (ConfigTree ct : m_config.getChildren(MESSAGE_FILTER)) {
-			try {
-				String tempEvent = ListenerUtil.obtainAtt(ct, HibernateEpr.EVENT_TAG, null);
-				String[] events = tempEvent.split(",");
-				for (int i = 0; i<events.length; i++) {
-					HibernateEventBean heb = new HibernateEventBean();
-					heb.setEvent(events[i]);
-					heb.setClassname(ListenerUtil.obtainAtt(ct, HibernateEpr.CLASS_NAME_TAG, null));
-					eventList.add(heb);	
-				}				
-			} catch (ConfigurationException ce) {
-				m_logger.error("Problem parsing Message Filter event/classname");
-			}
-		}
-		
-		try {
-			// Grab the session factory and close it - if we have a hot re-deploy,
-			// we need to close the SessionFactory so that the old interceptors don't get
-			// in the way.
-			if (eventList.size() != 0) {
-				cfg.setInterceptor(new HibernateInterceptor(m_config, eventList));
-			}		
-
-			// We're suppressing warnings here - we need to initialize the
-			// SessionFactory but don't really need to read from it.
-			@SuppressWarnings("unused")
-			SessionFactory sf = null;
-			HibernateSessionFactory.close(cfg);
-			
-			sf = HibernateSessionFactory.getInstance(cfg);
-
-		} catch (ConfigurationException ce) {
-			throw new ManagedLifecycleException(ce.getMessage());
-		}
-	}
-
-	@Override
-	protected void doStart() throws ManagedLifecycleException {
-	}
-
-	@Override
-	protected void doStop() throws ManagedLifecycleException {
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,131 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.gateway;
+
+import java.util.ArrayList;
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.hibernate.SessionFactory;
+import org.hibernate.cfg.Configuration;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.HibernateEpr;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.persist.HibernateSessionFactory;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+
+/**
+ * HibernateGatewayListener is a listener which creates a HibernateInterceptor for 
+ * the classname/events that need to be listened to.
+ * 
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @since Version 4.2
+ * 
+ */
+public class HibernateGatewayListener extends AbstractManagedLifecycle {
+	private static final long serialVersionUID = -8794895112076882394L;
+
+	private String m_cfgFile;
+	private ConfigTree m_config;
+	protected Object _composer;
+	protected Class _composerClass;
+	protected String _composerName;
+	protected String m_targetServiceCategory, m_targetServiceName;	
+	
+	protected Collection<EPR> m_targetEprs;
+	
+	private static final String MESSAGE_FILTER = "messagefilter";
+	
+	protected final static Logger m_logger = Logger.getLogger(HibernateGatewayListener.class);
+
+	/**
+	 * This constructor takes in a configTree element and grabs the hibernate configuration
+	 * file name.
+	 * 
+	 * @param config configtree
+	 * @throws ConfigurationException
+	 */
+	public HibernateGatewayListener(ConfigTree config) throws ConfigurationException {
+		super(config);
+		m_config = config;
+		m_cfgFile = ListenerUtil.obtainAtt(m_config, HibernateEpr.HIBERNATE_CFG_TAG, null);
+	}
+
+	@Override
+	protected void doDestroy() throws ManagedLifecycleException {
+	}
+
+	@Override
+	protected void doInitialise() throws ManagedLifecycleException {
+		ArrayList<HibernateEventBean> eventList = new ArrayList<HibernateEventBean>();
+
+		Configuration cfg = new Configuration();
+		cfg.configure(m_cfgFile);
+
+		// Need to loop through messagefilters and add them as interceptors
+		for (ConfigTree ct : m_config.getChildren(MESSAGE_FILTER)) {
+			try {
+				String tempEvent = ListenerUtil.obtainAtt(ct, HibernateEpr.EVENT_TAG, null);
+				String[] events = tempEvent.split(",");
+				for (int i = 0; i<events.length; i++) {
+					HibernateEventBean heb = new HibernateEventBean();
+					heb.setEvent(events[i]);
+					heb.setClassname(ListenerUtil.obtainAtt(ct, HibernateEpr.CLASS_NAME_TAG, null));
+					eventList.add(heb);	
+				}				
+			} catch (ConfigurationException ce) {
+				m_logger.error("Problem parsing Message Filter event/classname");
+			}
+		}
+		
+		try {
+			// Grab the session factory and close it - if we have a hot re-deploy,
+			// we need to close the SessionFactory so that the old interceptors don't get
+			// in the way.
+			if (eventList.size() != 0) {
+				cfg.setInterceptor(new HibernateInterceptor(m_config, eventList));
+			}		
+
+			// We're suppressing warnings here - we need to initialize the
+			// SessionFactory but don't really need to read from it.
+			@SuppressWarnings("unused")
+			SessionFactory sf = null;
+			HibernateSessionFactory.close(cfg);
+			
+			sf = HibernateSessionFactory.getInstance(cfg);
+
+		} catch (ConfigurationException ce) {
+			throw new ManagedLifecycleException(ce.getMessage());
+		}
+	}
+
+	@Override
+	protected void doStart() throws ManagedLifecycleException {
+	}
+
+	@Override
+	protected void doStop() throws ManagedLifecycleException {
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,335 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2007, 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.gateway;
-
-import java.io.Serializable;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-
-import org.apache.log4j.Logger;
-import org.hibernate.CallbackException;
-import org.hibernate.EmptyInterceptor;
-import org.hibernate.Transaction;
-import org.hibernate.type.Type;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.ListenerUtil;
-import org.jboss.soa.esb.listeners.RegistryUtil;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * HibernateInterceptor intercepts Hibernate events and sends the object they are 
- * being performed upon in a message.     The object is sent in the body of the message
- * with the "hibernateObject" string.   The default composer for the HibernateInterceptor
- * is PackageHibernateMessageContents.
- * 
- * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
- * @since Version 4.2
- * 
- */
-public class HibernateInterceptor extends EmptyInterceptor {
-
-	private static final long serialVersionUID = 1L;
-	private ArrayList<HibernateEventBean> m_events;
-	private final static Logger m_logger = Logger.getLogger(HibernateInterceptor.class);
-	private Courier m_courier;
-	
-	protected Class m_composerClass;
-	protected Method m_processMethod;
-	protected Object m_composer;
-	protected String m_composerName;
-	protected ConfigTree m_config;
-
-	protected Collection<EPR> m_targetEprs;
-	protected String m_targetServiceCategory, m_targetServiceName;	
-
-	// Event Strings
-	private static final String DELETE_EVENT = "onDelete";
-	private static final String SAVE_EVENT = "onSave";
-	private static final String LOAD_EVENT = "onLoad";
-	private static final String FLUSH_DIRTY_EVENT = "onFlushDirty";
-	private static final String COLLECTION_UPDATE_EVENT = "onCollectionUpdate";
-	private static final String COLLECTION_REMOVE_EVENT = "onCollectionRemove";
-	
-	
-	/**
-	 * This constructor takes in a configuration and a list of hibernate events to 
-	 * monitor.
-	 * @param f_config
-	 * @param f_list
-	 * @throws ManagedLifecycleException
-	 */
-	public HibernateInterceptor(ConfigTree f_config, ArrayList<HibernateEventBean> f_list) throws ManagedLifecycleException {
-		m_config = f_config;
-		m_events = f_list;
-		
-        try {
-        	m_targetServiceCategory = ListenerUtil.obtainAtt(m_config,
-					ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
-			m_targetServiceName = ListenerUtil.obtainAtt(m_config,
-					ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
-            m_targetEprs = RegistryUtil.getEprs(m_targetServiceCategory,m_targetServiceName);
-            if (null == m_targetEprs || m_targetEprs.size() < 1)
-                throw new ManagedLifecycleException("EPR <" + m_targetServiceName + "> not found in registry") ;
-        } catch (final RegistryException re) {
-            throw new ManagedLifecycleException("Unexpected registry exception", re) ;
-        } catch (ConfigurationException e) {
-        	throw new ManagedLifecycleException(e.getMessage(), e);
-		}
-        
-        try {
-			resolveComposerClass();
-		} catch (ConfigurationException e) {
-			// TODO Auto-generated catch block
-			throw new ManagedLifecycleException("Problem resolving composer class", e);
-		}
-
-	}
-	
-	/**
-	 * Create message and put messageObject in the body.
-	 * @param messageObject hibernate object that goes in the body of the message
-	 * @return the message just created
-	 */
-	private Message createMessage(Object messageObject) {
-		Object obj = null;
-		try {
-			obj = m_processMethod.invoke(m_composer, new Object[] { messageObject });
-			if (null == obj) {
-				m_logger.error("Action class method <" + m_processMethod
-						.getName() + "> returned a null object");
-			}
-		} catch (IllegalArgumentException e) {
-			m_logger.error("Error creating message", e);
-		} catch (IllegalAccessException e) {
-			m_logger.error("Error creating message", e);
-		} catch (InvocationTargetException e) {
-			m_logger.error("Error creating message", e);
-		}
-		Message message = (Message) obj;
-		return message;
-	}
-	
-	/**
-	 * Delivers the message.
-	 * @param messageObject 
-	 */
-	private void deliverMessage(Message message) {
-		Throwable thrown = null;
-		String text = null;
-
-		try {
-			boolean bSent = false;
-			for (EPR current : m_targetEprs) {
-				m_courier = CourierFactory.getCourier(current);
-
-				try {
-					if (m_courier.deliver(message)) {
-						bSent = true;
-                        break;
-					}
-				} finally {
-					CourierUtil.cleanCourier(m_courier) ;
-				}
-			}
-			
-			if (!bSent) {
-				text = "Target service <" + m_targetServiceCategory + "," + m_targetServiceName + "> is not registered";
-				thrown = new Exception(text);
-			}
-		} catch (ClassCastException e) {
-			thrown = e;
-			text = "Action class method <" + m_processMethod.getName() + "> returned a non Message object";
-		} catch (CourierException e) {
-			thrown = e;
-			text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED";
-		} catch (MalformedEPRException ex) {
-			thrown = ex;
-			text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED with malformed EPR.";
-		} catch (IllegalArgumentException e) {
-			thrown = e;
-			text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED with IllegalArgumentException.";
-		}
-		if (null != thrown) {
-			m_logger.error(text);
-			m_logger.debug(text, thrown);
-			//changeStatusToError();
-		}
-	}
-	
-	
-	/**
-	 * This method resolves the composer class.    As a default, the HibernateInterceptor
-	 * uses 
-	 * @throws ConfigurationException
-	 */
-	protected void resolveComposerClass() throws ConfigurationException {
-		try
-		{
-            String sProcessMethod = null;
-            m_composerName = m_config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG);
-            if (null != m_composerName) {
-                m_composerClass = ClassUtil.forName(m_composerName, getClass());
-                Constructor oConst = m_composerClass.getConstructor(new Class[] { ConfigTree.class });
-                m_composer = oConst.newInstance(m_config);
-                sProcessMethod = m_config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_METHOD_TAG, "process");
-            } else {
-				m_composerName = PackageHibernateMessageContents.class.getName();
-				m_composerClass = PackageHibernateMessageContents.class;
-				m_composer = new PackageHibernateMessageContents();
-				sProcessMethod = "process";
-				m_logger.debug("No <" + ListenerTagNames.ACTION_ELEMENT_TAG + "> element found in configuration" + " -  Using default composer class : " + m_composerName);
-			}
-	
-			m_processMethod = m_composerClass.getMethod(sProcessMethod, new Class[] { Object.class });
-		} catch (InvocationTargetException ex) {
-			m_logger.debug(ex);
-			throw new ConfigurationException(ex);
-		} catch (IllegalAccessException ex) {
-			m_logger.debug(ex);
-			throw new ConfigurationException(ex);
-		} catch (InstantiationException ex) {
-			m_logger.debug(ex);	
-			throw new ConfigurationException(ex);
-		} catch (ClassNotFoundException ex) {
-			m_logger.debug(ex);			
-			throw new ConfigurationException(ex);
-		} catch (NoSuchMethodException ex) {
-			m_logger.debug(ex);
-			throw new ConfigurationException(ex);
-		}
-	}
-	
-	public void afterTransactionBegin(Transaction arg0) {
-		m_logger.debug("afterTransactionBegin");
-	}
-
-	public void afterTransactionCompletion(Transaction arg0) {
-		m_logger.debug("afterTransactionCompletion");
-	}
-
-	public void beforeTransactionCompletion(Transaction arg0) {
-		m_logger.debug("beforeTransactionCompletion");
-	}
-
-	public void onCollectionRecreate(Object entity, Serializable id) throws CallbackException {
-		m_logger.debug("onCollectionRecreate");
-	}
- 
-	public void onCollectionRemove(Object entity, Serializable id) throws CallbackException {
-		System.out.println("onCollectionRemove");
-		for (HibernateEventBean heb: m_events) {
-			if (heb.getEvent().equals(COLLECTION_REMOVE_EVENT)) {
-				if (entity.getClass().getName().equals(heb.getClassname())) {
-					Message message = createMessage(entity);
-					deliverMessage(message);
-				}
-			}
-		}
-	}
-
-	public void onCollectionUpdate(Object entity, Serializable id) throws CallbackException {
-		System.out.println("onCollectionUpdate");
-		for (HibernateEventBean heb: m_events) {
-			if (heb.getEvent().equals(COLLECTION_UPDATE_EVENT)) {
-				if (entity.getClass().getName().equals(heb.getClassname())) {
-					Message message = createMessage(entity);
-					deliverMessage(message);		
-				}
-			}
-		}
-	}
-
-	public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
-		System.out.println("onDelete");
-		for (HibernateEventBean heb: m_events) {
-			if (heb.getEvent().equals(DELETE_EVENT)) {
-				if (entity.getClass().getName().equals(heb.getClassname())) {
-					Message message = createMessage(entity);
-					deliverMessage(message);
-				}
-			}
-		}
-	}
-
-	public boolean onFlushDirty(Object entity, Serializable id, Object[] newValues, Object[] oldValues, String[] propertyNames, Type[] types) throws CallbackException {
-		m_logger.debug("onFlushDirty");
-		for (HibernateEventBean heb: m_events) {
-			if (heb.getEvent().equals(FLUSH_DIRTY_EVENT)) {
-				if (entity.getClass().getName().equals(heb.getClassname())) {
-					Message message = createMessage(entity);
-					deliverMessage(message);
-				}
-			}
-		}
-		return false;
-	}
-
-	public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
-		System.out.println("onLoad");
-		for (HibernateEventBean heb: m_events) {
-			if (heb.getEvent().equals(LOAD_EVENT)) {
-				if (entity.getClass().getName().equals(heb.getClassname())) {
-					Message message = createMessage(entity);
-					deliverMessage(message);
-				}
-			}
-		}
-		return false;
-	}
-
-	public boolean onSave(Object entity, Serializable id, Object[] state,
-			String[] propertyNames, Type[] types) throws CallbackException {
-		System.out.println("onSave");
-		for (HibernateEventBean heb: m_events) {
-			if (heb.getEvent().equals(SAVE_EVENT)) {
-				if (entity.getClass().getName().equals(heb.getClassname())) {
-					Message message = createMessage(entity);
-					deliverMessage(message);
-				}
-			}
-		}
-		return false;
-	}
-
-	public void postFlush(Iterator arg0) throws CallbackException {
-		m_logger.debug("postFlush");
-	}
-
-	public void preFlush(Iterator arg0) throws CallbackException {
-		m_logger.debug("preFlush");
-	}	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/HibernateInterceptor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,335 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2007, 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.gateway;
+
+import java.io.Serializable;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+
+import org.apache.log4j.Logger;
+import org.hibernate.CallbackException;
+import org.hibernate.EmptyInterceptor;
+import org.hibernate.Transaction;
+import org.hibernate.type.Type;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.listeners.RegistryUtil;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * HibernateInterceptor intercepts Hibernate events and sends the object they are 
+ * being performed upon in a message.     The object is sent in the body of the message
+ * with the "hibernateObject" string.   The default composer for the HibernateInterceptor
+ * is PackageHibernateMessageContents.
+ * 
+ * @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+ * @since Version 4.2
+ * 
+ */
+public class HibernateInterceptor extends EmptyInterceptor {
+
+	private static final long serialVersionUID = 1L;
+	private ArrayList<HibernateEventBean> m_events;
+	private final static Logger m_logger = Logger.getLogger(HibernateInterceptor.class);
+	private Courier m_courier;
+	
+	protected Class m_composerClass;
+	protected Method m_processMethod;
+	protected Object m_composer;
+	protected String m_composerName;
+	protected ConfigTree m_config;
+
+	protected Collection<EPR> m_targetEprs;
+	protected String m_targetServiceCategory, m_targetServiceName;	
+
+	// Event Strings
+	private static final String DELETE_EVENT = "onDelete";
+	private static final String SAVE_EVENT = "onSave";
+	private static final String LOAD_EVENT = "onLoad";
+	private static final String FLUSH_DIRTY_EVENT = "onFlushDirty";
+	private static final String COLLECTION_UPDATE_EVENT = "onCollectionUpdate";
+	private static final String COLLECTION_REMOVE_EVENT = "onCollectionRemove";
+	
+	
+	/**
+	 * This constructor takes in a configuration and a list of hibernate events to 
+	 * monitor.
+	 * @param f_config
+	 * @param f_list
+	 * @throws ManagedLifecycleException
+	 */
+	public HibernateInterceptor(ConfigTree f_config, ArrayList<HibernateEventBean> f_list) throws ManagedLifecycleException {
+		m_config = f_config;
+		m_events = f_list;
+		
+        try {
+        	m_targetServiceCategory = ListenerUtil.obtainAtt(m_config,
+					ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
+			m_targetServiceName = ListenerUtil.obtainAtt(m_config,
+					ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
+            m_targetEprs = RegistryUtil.getEprs(m_targetServiceCategory,m_targetServiceName);
+            if (null == m_targetEprs || m_targetEprs.size() < 1)
+                throw new ManagedLifecycleException("EPR <" + m_targetServiceName + "> not found in registry") ;
+        } catch (final RegistryException re) {
+            throw new ManagedLifecycleException("Unexpected registry exception", re) ;
+        } catch (ConfigurationException e) {
+        	throw new ManagedLifecycleException(e.getMessage(), e);
+		}
+        
+        try {
+			resolveComposerClass();
+		} catch (ConfigurationException e) {
+			// TODO Auto-generated catch block
+			throw new ManagedLifecycleException("Problem resolving composer class", e);
+		}
+
+	}
+	
+	/**
+	 * Create message and put messageObject in the body.
+	 * @param messageObject hibernate object that goes in the body of the message
+	 * @return the message just created
+	 */
+	private Message createMessage(Object messageObject) {
+		Object obj = null;
+		try {
+			obj = m_processMethod.invoke(m_composer, new Object[] { messageObject });
+			if (null == obj) {
+				m_logger.error("Action class method <" + m_processMethod
+						.getName() + "> returned a null object");
+			}
+		} catch (IllegalArgumentException e) {
+			m_logger.error("Error creating message", e);
+		} catch (IllegalAccessException e) {
+			m_logger.error("Error creating message", e);
+		} catch (InvocationTargetException e) {
+			m_logger.error("Error creating message", e);
+		}
+		Message message = (Message) obj;
+		return message;
+	}
+	
+	/**
+	 * Delivers the message.
+	 * @param messageObject 
+	 */
+	private void deliverMessage(Message message) {
+		Throwable thrown = null;
+		String text = null;
+
+		try {
+			boolean bSent = false;
+			for (EPR current : m_targetEprs) {
+				m_courier = CourierFactory.getCourier(current);
+
+				try {
+					if (m_courier.deliver(message)) {
+						bSent = true;
+                        break;
+					}
+				} finally {
+					CourierUtil.cleanCourier(m_courier) ;
+				}
+			}
+			
+			if (!bSent) {
+				text = "Target service <" + m_targetServiceCategory + "," + m_targetServiceName + "> is not registered";
+				thrown = new Exception(text);
+			}
+		} catch (ClassCastException e) {
+			thrown = e;
+			text = "Action class method <" + m_processMethod.getName() + "> returned a non Message object";
+		} catch (CourierException e) {
+			thrown = e;
+			text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED";
+		} catch (MalformedEPRException ex) {
+			thrown = ex;
+			text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED with malformed EPR.";
+		} catch (IllegalArgumentException e) {
+			thrown = e;
+			text = "Courier <" + m_courier.getClass().getName() + ".deliverAsync(Message) FAILED with IllegalArgumentException.";
+		}
+		if (null != thrown) {
+			m_logger.error(text);
+			m_logger.debug(text, thrown);
+			//changeStatusToError();
+		}
+	}
+	
+	
+	/**
+	 * This method resolves the composer class.    As a default, the HibernateInterceptor
+	 * uses 
+	 * @throws ConfigurationException
+	 */
+	protected void resolveComposerClass() throws ConfigurationException {
+		try
+		{
+            String sProcessMethod = null;
+            m_composerName = m_config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG);
+            if (null != m_composerName) {
+                m_composerClass = ClassUtil.forName(m_composerName, getClass());
+                Constructor oConst = m_composerClass.getConstructor(new Class[] { ConfigTree.class });
+                m_composer = oConst.newInstance(m_config);
+                sProcessMethod = m_config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_METHOD_TAG, "process");
+            } else {
+				m_composerName = PackageHibernateMessageContents.class.getName();
+				m_composerClass = PackageHibernateMessageContents.class;
+				m_composer = new PackageHibernateMessageContents();
+				sProcessMethod = "process";
+				m_logger.debug("No <" + ListenerTagNames.ACTION_ELEMENT_TAG + "> element found in configuration" + " -  Using default composer class : " + m_composerName);
+			}
+	
+			m_processMethod = m_composerClass.getMethod(sProcessMethod, new Class[] { Object.class });
+		} catch (InvocationTargetException ex) {
+			m_logger.debug(ex);
+			throw new ConfigurationException(ex);
+		} catch (IllegalAccessException ex) {
+			m_logger.debug(ex);
+			throw new ConfigurationException(ex);
+		} catch (InstantiationException ex) {
+			m_logger.debug(ex);	
+			throw new ConfigurationException(ex);
+		} catch (ClassNotFoundException ex) {
+			m_logger.debug(ex);			
+			throw new ConfigurationException(ex);
+		} catch (NoSuchMethodException ex) {
+			m_logger.debug(ex);
+			throw new ConfigurationException(ex);
+		}
+	}
+	
+	public void afterTransactionBegin(Transaction arg0) {
+		m_logger.debug("afterTransactionBegin");
+	}
+
+	public void afterTransactionCompletion(Transaction arg0) {
+		m_logger.debug("afterTransactionCompletion");
+	}
+
+	public void beforeTransactionCompletion(Transaction arg0) {
+		m_logger.debug("beforeTransactionCompletion");
+	}
+
+	public void onCollectionRecreate(Object entity, Serializable id) throws CallbackException {
+		m_logger.debug("onCollectionRecreate");
+	}
+ 
+	public void onCollectionRemove(Object entity, Serializable id) throws CallbackException {
+		System.out.println("onCollectionRemove");
+		for (HibernateEventBean heb: m_events) {
+			if (heb.getEvent().equals(COLLECTION_REMOVE_EVENT)) {
+				if (entity.getClass().getName().equals(heb.getClassname())) {
+					Message message = createMessage(entity);
+					deliverMessage(message);
+				}
+			}
+		}
+	}
+
+	public void onCollectionUpdate(Object entity, Serializable id) throws CallbackException {
+		System.out.println("onCollectionUpdate");
+		for (HibernateEventBean heb: m_events) {
+			if (heb.getEvent().equals(COLLECTION_UPDATE_EVENT)) {
+				if (entity.getClass().getName().equals(heb.getClassname())) {
+					Message message = createMessage(entity);
+					deliverMessage(message);		
+				}
+			}
+		}
+	}
+
+	public void onDelete(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
+		System.out.println("onDelete");
+		for (HibernateEventBean heb: m_events) {
+			if (heb.getEvent().equals(DELETE_EVENT)) {
+				if (entity.getClass().getName().equals(heb.getClassname())) {
+					Message message = createMessage(entity);
+					deliverMessage(message);
+				}
+			}
+		}
+	}
+
+	public boolean onFlushDirty(Object entity, Serializable id, Object[] newValues, Object[] oldValues, String[] propertyNames, Type[] types) throws CallbackException {
+		m_logger.debug("onFlushDirty");
+		for (HibernateEventBean heb: m_events) {
+			if (heb.getEvent().equals(FLUSH_DIRTY_EVENT)) {
+				if (entity.getClass().getName().equals(heb.getClassname())) {
+					Message message = createMessage(entity);
+					deliverMessage(message);
+				}
+			}
+		}
+		return false;
+	}
+
+	public boolean onLoad(Object entity, Serializable id, Object[] state, String[] propertyNames, Type[] types) throws CallbackException {
+		System.out.println("onLoad");
+		for (HibernateEventBean heb: m_events) {
+			if (heb.getEvent().equals(LOAD_EVENT)) {
+				if (entity.getClass().getName().equals(heb.getClassname())) {
+					Message message = createMessage(entity);
+					deliverMessage(message);
+				}
+			}
+		}
+		return false;
+	}
+
+	public boolean onSave(Object entity, Serializable id, Object[] state,
+			String[] propertyNames, Type[] types) throws CallbackException {
+		System.out.println("onSave");
+		for (HibernateEventBean heb: m_events) {
+			if (heb.getEvent().equals(SAVE_EVENT)) {
+				if (entity.getClass().getName().equals(heb.getClassname())) {
+					Message message = createMessage(entity);
+					deliverMessage(message);
+				}
+			}
+		}
+		return false;
+	}
+
+	public void postFlush(Iterator arg0) throws CallbackException {
+		m_logger.debug("postFlush");
+	}
+
+	public void preFlush(Iterator arg0) throws CallbackException {
+		m_logger.debug("preFlush");
+	}	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,453 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.gateway;
-
-import java.net.InetAddress;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.net.UnknownHostException;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.management.MBeanServer;
-
-import org.apache.log4j.Logger;
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.remoting.ServerInvocationHandler;
-import org.jboss.remoting.ServerInvoker;
-import org.jboss.remoting.callback.InvokerCallbackHandler;
-import org.jboss.remoting.transport.Connector;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.message.AbstractMessageComposer;
-import org.jboss.soa.esb.listeners.message.MessageDeliverException;
-import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
-
-/**
- * JBoss Remoting listener implementation for receiving ESB unaware messages
- * over a JBoss Remoting channel.
- * <p/>
- * This class implements the JBoss Remoting interface {@link org.jboss.remoting.ServerInvocationHandler}.
- * Messages are pushed in through the {@link #invoke(org.jboss.remoting.InvocationRequest)} method,
- * which is an implementation of the {@link org.jboss.remoting.ServerInvocationHandler#invoke(org.jboss.remoting.InvocationRequest)}
- * method.
- * <p/>
- * The JBoss Remoting {@link org.jboss.remoting.transport.Connector}
- * configuration is populated by the {@link #initaliseJBRConnectorConfiguration(java.util.Map)}
- * method.  The remoting server locator URI is constructed by the
- * {@link #getJbrServerLocatorURI()} method.
- * <p/>
- * The default {@link org.jboss.soa.esb.listeners.message.MessageComposer} used by this listener is the
- * {@link org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.JBossRemotingMessageComposer}.  All
- * message composer implementation supplied to this class will be supplied an instance of
- * {@link org.jboss.remoting.InvocationRequest}, from which they must compose an ESB aware
- * {@link Message} instance.
- * <p/>
- * See the <a href="http://labs.jboss.com/portal/jbossremoting">JBoss Remoting</a> docs
- * for details on configuring specific remoting server protocols.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class JBossRemotingGatewayListener extends AbstractManagedLifecycle implements ServerInvocationHandler {
-
-    private static final long serialVersionUID = 1L;
-    /**
-     * JBoss Remoting connector config attribute name prefix.
-     */
-    public static final String JBR_PREFIX = "jbr-";
-    /**
-     * Server Protocol config attribute name.
-     */
-    public static final String JBR_SERVER_PROTOCOL = JBR_PREFIX + "serverProtocol";
-    /**
-     * Server Host config attribute name.
-     */
-    public static final String JBR_SERVER_HOST = JBR_PREFIX + ServerInvoker.SERVER_BIND_ADDRESS_KEY;
-    /**
-     * Server port config attribute name.
-     */
-    public static final String JBR_SERVER_PORT = JBR_PREFIX + ServerInvoker.SERVER_BIND_PORT_KEY;
-
-    /**
-     * Class Logger instance.
-     */
-    private static Logger logger = Logger.getLogger(JBossRemotingGatewayListener.class);
-    /**
-     * JBoss Remoting connector.
-     */
-    private Connector connector;
-    /**
-     * Connector configuration.
-     */
-    private Map<String, String> connectorConfig = new HashMap<String, String>();
-    /**
-     * Server URI.
-     */
-    private String jbrServerLocatorURI;
-    /**
-     * Delivery adapter.
-     */
-    private UncomposedMessageDeliveryAdapter messageDeliveryAdapter;
-    /**
-     * Simple flag marking the listener instance as being initialised or un-initialised.
-     */
-    private boolean initialised;
-    /**
-     * Service category to which this listener is associated.
-     */
-    private String serviceCategory;
-    /**
-     * Service name to which this listener is associated.
-     */
-    private String serviceName;
-    /**
-     * Listener endpoint EPR.
-     */
-    private EPR endpointReference;
-    /**
-     * Is the listener synchronous.
-     */
-    private boolean synchronous = true;
-
-    /**
-     * Construct the threaded managed lifecycle.
-     *
-     * @param config The configuration associated with this instance.
-     * @throws org.jboss.soa.esb.ConfigurationException
-     *          for configuration errors during initialisation.
-     */
-    public JBossRemotingGatewayListener(ConfigTree config) throws ConfigurationException {
-        super(config);
-        serviceCategory = config.getAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG);
-        serviceName = config.getAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG);
-        synchronous = !config.getAttribute("synchronous", "true").equalsIgnoreCase("false");
-    }
-
-    /**
-     * Is this listener instance initialised.
-     *
-     * @return True if this listener is initialised, otherwise false.
-     */
-    public boolean isInitialised() {
-        return initialised;
-    }
-
-    /**
-     * Is this listener instance started.
-     * <p/>
-     * Basically, Is this listener's JBoss Remoting Connector connected?
-     *
-     * @return True if this listener is started, otherwise false.
-     */
-    public boolean isStarted() {
-        return (connector != null);
-    }
-
-    /*
-     * ***************************************************************************
-     *
-     * AbstractManagedLifecycle methods...
-     * 
-     * ****************************************************************************
-     */
-
-    protected void doInitialise() throws ManagedLifecycleException {
-        if (isInitialised()) {
-            throw new ManagedLifecycleException("Unexpected request to initialise JBoss Remoting Gateway listener '" + getConfig().getName() + "'.  Gateway already initialised.");
-        }
-
-        try {
-            endpointReference = new EPR(getJbrServerLocatorURI());
-            messageDeliveryAdapter = createDeliveryAdapter();
-            initaliseJBRConnectorConfiguration(connectorConfig);
-        } catch (ConfigurationException e) {
-            throw new ManagedLifecycleException("Remoting Listener configuration failed.", e);
-        }
-
-        initialised = true;
-    }
-
-    protected void doStart() throws ManagedLifecycleException {
-        if (!isInitialised()) {
-            throw new ManagedLifecycleException("Unexpected request to start JBoss Remoting Gateway listener '" + getConfig().getName() + "'.  Gateway not initialised.");
-        }
-        if (isStarted()) {
-            throw new ManagedLifecycleException("Unexpected request to start JBoss Remoting Gateway listener '" + getConfig().getName() + "'.  Gateway already started.");
-        }
-
-        // Start the JBR Server...
-        startJBRServer();
-
-        // Regsiter the JBR Endpoint...
-        try {
-            registerEndpoint();
-        } catch (Throwable t) {
-            logger.error("Unable to register service endpoint '" + endpointReference.getAddr().getAddress()
-                    + "' for service '" + serviceCategory + ":" + serviceName + "'.  Stopping JBossRemoting Server...", t);
-            stopJBRServer();
-        }
-    }
-
-    protected void doStop() throws ManagedLifecycleException {
-        if (!isStarted()) {
-            throw new ManagedLifecycleException("Unexpected request to stop JBoss Remoting Gateway listener '" + getConfig().getName() + "'.  Gateway not running.");
-        }
-
-        unregisterEndpoint();
-        stopJBRServer();
-    }
-
-    private void startJBRServer() throws ManagedLifecycleException {
-        try {
-            InvokerLocator locator = new InvokerLocator(jbrServerLocatorURI);
-
-            connector = new Connector(locator, connectorConfig);
-            connector.create();
-            connector.addInvocationHandler(getConfig().getAttribute("name", this.toString()), this);
-            connector.start();
-
-            logger.info("JBoss Remoting Gateway listener '" + getConfig().getName() + "' started.");
-        } catch (Throwable throwable) {
-            connector = null;
-            throw new ManagedLifecycleException("Unable to start Remoting Listener instsance " + getClass().getName(), throwable);
-        }
-    }
-
-    private void stopJBRServer() throws ManagedLifecycleException {
-        try {
-            connector.stop();
-            logger.info("JBoss Remoting Gateway listener '" + getConfig().getName() + "' stopped.");
-        } catch (Throwable throwable) {
-            throw new ManagedLifecycleException("Unable to stop Remoting Listener instsance " + getClass().getName(), throwable);
-        } finally {
-            connector = null;
-        }
-    }
-
-    private void registerEndpoint() throws ConfigurationException, RegistryException {
-        String serviceDescription = getConfig().getAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG);
-        RegistryFactory.getRegistry().registerEPR(serviceCategory, serviceName, serviceDescription,
-                endpointReference, endpointReference.getAddr().getAddress());
-    }
-
-    private void unregisterEndpoint() {
-        try {
-            RegistryFactory.getRegistry().unRegisterEPR(serviceCategory, serviceName, endpointReference);
-        } catch (Throwable t) {
-            logger.error("Unable to unregister service endpoint '" + endpointReference.getAddr().getAddress()
-                    + "' for service '" + serviceCategory + ":" + serviceName + "'.", t);
-        }
-    }
-
-    protected void doDestroy() throws ManagedLifecycleException {
-    }
-
-    /*
-     * ***************************************************************************
-     *
-     * JBoss Remoting ServerInvocationHandler methods...
-     *
-     * ****************************************************************************
-     */
-
-    /**
-     * Process a remoting invocation message.
-     * <p/>
-     * This method uses an {@link org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter}
-     * to carry out the delivery.  This delivery adpter is constructed with a
-     * {@link org.jboss.soa.esb.listeners.message.MessageComposer} instance supplied through
-     * configuration, otherwise it uses the
-     * {@link org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.JBossRemotingMessageComposer}.
-     * <p/>
-     * The message composer is responsible for mapping the remoting {@link org.jboss.remoting.InvocationRequest}
-     * into an ESB aware {@link org.jboss.soa.esb.message.Message}, while the
-     * {@link org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter} is responsible for its
-     * delivery to the target service.
-     *
-     * @param invocationRequest JBoss Remoting request.
-     * @return Message delivery acknowledgment response.
-     * @throws Throwable Message processing failure.
-     */
-    public Object invoke(InvocationRequest invocationRequest) throws Throwable {
-        try {
-            if (synchronous) {
-                Object response = messageDeliveryAdapter.deliverSync(invocationRequest, 20000); // TODO Fix magic number
-                if(logger.isDebugEnabled()) {
-                    logger.debug("Returning response [" + response + "].");
-                }
-                return response;
-            } else {
-                messageDeliveryAdapter.deliverAsync(invocationRequest);
-            }
-        } catch (Throwable t) {
-            logger.error("JBoss Remoting Gateway failed to " + (synchronous ? "synchronously" : "asynchronously") + " deliver message to target service [" +
-                    messageDeliveryAdapter.getDeliveryAdapter().getServiceCategory() + ":" +
-                    messageDeliveryAdapter.getDeliveryAdapter().getServiceName() + "].", t);
-
-            throw t;
-        }
-
-        return "<ack/>";
-    }
-
-    public void setMBeanServer(MBeanServer mBeanServer) {
-    }
-
-    public void setInvoker(ServerInvoker serverInvoker) {
-    }
-
-    public void addListener(InvokerCallbackHandler invokerCallbackHandler) {
-    }
-
-    public void removeListener(InvokerCallbackHandler invokerCallbackHandler) {
-    }
-
-    /**
-     * Initialise the JBossRemoting connector configuration.
-     * <p/>
-     * Constructs the JBR {@link org.jboss.remoting.InvokerLocator} URI
-     * through a call to {@link #getJbrServerLocatorURI()}. Also
-     * populates the server connector properties.
-     * <p/>
-     * Default behavior for population of the connector configuration is to load
-     * all listener configuration properties whose name is prefixed with "jbr-",
-     * stripping off the "jbr-" prefix from the name before adding.
-     * So, to set the Server "timeout" configuration property
-     * on the connector, you set the property name to "jbr-timeout".
-     *
-     * @param connectorConfig The configuration map instance to be populated.
-     * @throws ConfigurationException Problem populating the configuration.
-     */
-    protected void initaliseJBRConnectorConfiguration(Map<String, String> connectorConfig) throws ConfigurationException {
-        // Initialse the JBR connector URI...
-        jbrServerLocatorURI = getJbrServerLocatorURI().toString();
-
-        // Populate the connector config...
-        List<KeyValuePair> attributes = getConfig().attributesAsList();
-        for (KeyValuePair attribute : attributes) {
-            String attributeName = attribute.getKey();
-
-            if (attributeName.startsWith(JBR_PREFIX)) {
-                connectorConfig.put(attributeName.substring(JBR_PREFIX.length()), attribute.getValue());
-            }
-        }
-    }
-
-    /**
-     * Get the Service Locator URI for this remotng based listener.
-     * <p/>
-     * Uses the listener config to extract the {@link #JBR_SERVER_PROTOCOL protcol},
-     * {@link #JBR_SERVER_HOST host} and {@link #JBR_SERVER_PORT port}
-     * parameters for the server.  The host address defaults to
-     * the value returned by {@link java.net.InetAddress#getLocalHost()}.
-     *
-     * @return The Server Locator URI.
-     * @throws ConfigurationException One or more of the locator properties
-     *                                are missing from the listener config.
-     */
-    protected URI getJbrServerLocatorURI() throws ConfigurationException {
-        String protocol = getConfig().getAttribute(JBR_SERVER_PROTOCOL);
-        String host = getConfig().getAttribute(JBR_SERVER_HOST);
-        String port = getConfig().getAttribute(JBR_SERVER_PORT);
-
-        if (protocol == null || protocol.trim().equals("")) {
-            throw new ConfigurationException("Invalid JBoss Remoting Gateway configuration [" + getConfig().getName() + "]. 'protocol' configuration attribute not specified.");
-        }
-        if (host == null || host.trim().equals("")) {
-            try {
-                host = InetAddress.getLocalHost().getHostName();
-            } catch (UnknownHostException e) {
-                throw new ConfigurationException("Invalid JBoss Remoting Gateway configuration [" + getConfig().getName() + "]. 'host' configuration attribute not specified and unablee to determine local hostname.", e);
-            }
-        }
-        if (port == null || port.trim().equals("")) {
-            throw new ConfigurationException("Invalid JBoss Remoting Gateway configuration [" + getConfig().getName() + "]. 'port' configuration attribute not specified.");
-        }
-
-        String uriString = protocol + "://" + host + ":" + port;
-        try {
-            return new URI(uriString);
-        } catch (URISyntaxException e) {
-            throw new ConfigurationException("Invalid JBoss Remoting Gateway configuration [" + getConfig().getName() + "]. Invalid server locator URI '" + uriString + "'.");
-        }
-    }
-
-    /**
-     * Factory method for adapter creation.
-     *
-     * @return The adapter instance.
-     * @throws ConfigurationException Configuration error.
-     */
-    protected UncomposedMessageDeliveryAdapter createDeliveryAdapter() throws ConfigurationException {
-        return UncomposedMessageDeliveryAdapter.getGatewayDeliveryAdapter(getConfig(), new JBossRemotingMessageComposer());
-    }
-
-    /**
-     * Message composer for a JBoss Remoting {@link org.jboss.remoting.InvocationRequest}
-     * instance.
-     */
-    public static class JBossRemotingMessageComposer extends AbstractMessageComposer {
-
-        public void setConfiguration(ConfigTree config) {
-        }
-
-        @SuppressWarnings("unchecked")
-        protected void populateMessage(Message message, Object invocationRequestObj) throws MessageDeliverException {
-            InvocationRequest invocationRequest = (InvocationRequest) invocationRequestObj;
-
-            //
-            // There really needs to be an optoin on the body to set it's contents
-            // as an unnamed Object, in the same way you can set it's contents as a byte[].
-            // I think this is a major'ish usability issue.
-            //
-            // My suggestion would be...
-            //      public void setContents(Object object);
-            //      public Object getContents();
-            //      public byte[] toByteArray(); // (was "byte[] getContents()")
-            //
-            // Not totally sure of the real value of toByteArray??
-            // Continue to allow setting of named attachments. 
-            ActionUtils.setTaskObject(message, invocationRequest.getParameter());
-
-            // Copy the request properties onto the message...
-            Map properties = invocationRequest.getRequestPayload();
-            if (properties != null) {
-                Set<Map.Entry> propertyEntrySet = properties.entrySet();
-                for (Map.Entry entry : propertyEntrySet) {
-                    if (entry.getValue() != null) {
-                        message.getProperties().setProperty(entry.toString(), entry.getValue());
-                    }
-                }
-            }
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,453 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import java.net.InetAddress;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.net.UnknownHostException;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.management.MBeanServer;
+
+import org.apache.log4j.Logger;
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.remoting.ServerInvocationHandler;
+import org.jboss.remoting.ServerInvoker;
+import org.jboss.remoting.callback.InvokerCallbackHandler;
+import org.jboss.remoting.transport.Connector;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.message.AbstractMessageComposer;
+import org.jboss.soa.esb.listeners.message.MessageDeliverException;
+import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.RegistryFactory;
+
+/**
+ * JBoss Remoting listener implementation for receiving ESB unaware messages
+ * over a JBoss Remoting channel.
+ * <p/>
+ * This class implements the JBoss Remoting interface {@link org.jboss.remoting.ServerInvocationHandler}.
+ * Messages are pushed in through the {@link #invoke(org.jboss.remoting.InvocationRequest)} method,
+ * which is an implementation of the {@link org.jboss.remoting.ServerInvocationHandler#invoke(org.jboss.remoting.InvocationRequest)}
+ * method.
+ * <p/>
+ * The JBoss Remoting {@link org.jboss.remoting.transport.Connector}
+ * configuration is populated by the {@link #initaliseJBRConnectorConfiguration(java.util.Map)}
+ * method.  The remoting server locator URI is constructed by the
+ * {@link #getJbrServerLocatorURI()} method.
+ * <p/>
+ * The default {@link org.jboss.soa.esb.listeners.message.MessageComposer} used by this listener is the
+ * {@link org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.JBossRemotingMessageComposer}.  All
+ * message composer implementation supplied to this class will be supplied an instance of
+ * {@link org.jboss.remoting.InvocationRequest}, from which they must compose an ESB aware
+ * {@link Message} instance.
+ * <p/>
+ * See the <a href="http://labs.jboss.com/portal/jbossremoting">JBoss Remoting</a> docs
+ * for details on configuring specific remoting server protocols.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class JBossRemotingGatewayListener extends AbstractManagedLifecycle implements ServerInvocationHandler {
+
+    private static final long serialVersionUID = 1L;
+    /**
+     * JBoss Remoting connector config attribute name prefix.
+     */
+    public static final String JBR_PREFIX = "jbr-";
+    /**
+     * Server Protocol config attribute name.
+     */
+    public static final String JBR_SERVER_PROTOCOL = JBR_PREFIX + "serverProtocol";
+    /**
+     * Server Host config attribute name.
+     */
+    public static final String JBR_SERVER_HOST = JBR_PREFIX + ServerInvoker.SERVER_BIND_ADDRESS_KEY;
+    /**
+     * Server port config attribute name.
+     */
+    public static final String JBR_SERVER_PORT = JBR_PREFIX + ServerInvoker.SERVER_BIND_PORT_KEY;
+
+    /**
+     * Class Logger instance.
+     */
+    private static Logger logger = Logger.getLogger(JBossRemotingGatewayListener.class);
+    /**
+     * JBoss Remoting connector.
+     */
+    private Connector connector;
+    /**
+     * Connector configuration.
+     */
+    private Map<String, String> connectorConfig = new HashMap<String, String>();
+    /**
+     * Server URI.
+     */
+    private String jbrServerLocatorURI;
+    /**
+     * Delivery adapter.
+     */
+    private UncomposedMessageDeliveryAdapter messageDeliveryAdapter;
+    /**
+     * Simple flag marking the listener instance as being initialised or un-initialised.
+     */
+    private boolean initialised;
+    /**
+     * Service category to which this listener is associated.
+     */
+    private String serviceCategory;
+    /**
+     * Service name to which this listener is associated.
+     */
+    private String serviceName;
+    /**
+     * Listener endpoint EPR.
+     */
+    private EPR endpointReference;
+    /**
+     * Is the listener synchronous.
+     */
+    private boolean synchronous = true;
+
+    /**
+     * Construct the threaded managed lifecycle.
+     *
+     * @param config The configuration associated with this instance.
+     * @throws org.jboss.soa.esb.ConfigurationException
+     *          for configuration errors during initialisation.
+     */
+    public JBossRemotingGatewayListener(ConfigTree config) throws ConfigurationException {
+        super(config);
+        serviceCategory = config.getAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG);
+        serviceName = config.getAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG);
+        synchronous = !config.getAttribute("synchronous", "true").equalsIgnoreCase("false");
+    }
+
+    /**
+     * Is this listener instance initialised.
+     *
+     * @return True if this listener is initialised, otherwise false.
+     */
+    public boolean isInitialised() {
+        return initialised;
+    }
+
+    /**
+     * Is this listener instance started.
+     * <p/>
+     * Basically, Is this listener's JBoss Remoting Connector connected?
+     *
+     * @return True if this listener is started, otherwise false.
+     */
+    public boolean isStarted() {
+        return (connector != null);
+    }
+
+    /*
+     * ***************************************************************************
+     *
+     * AbstractManagedLifecycle methods...
+     * 
+     * ****************************************************************************
+     */
+
+    protected void doInitialise() throws ManagedLifecycleException {
+        if (isInitialised()) {
+            throw new ManagedLifecycleException("Unexpected request to initialise JBoss Remoting Gateway listener '" + getConfig().getName() + "'.  Gateway already initialised.");
+        }
+
+        try {
+            endpointReference = new EPR(getJbrServerLocatorURI());
+            messageDeliveryAdapter = createDeliveryAdapter();
+            initaliseJBRConnectorConfiguration(connectorConfig);
+        } catch (ConfigurationException e) {
+            throw new ManagedLifecycleException("Remoting Listener configuration failed.", e);
+        }
+
+        initialised = true;
+    }
+
+    protected void doStart() throws ManagedLifecycleException {
+        if (!isInitialised()) {
+            throw new ManagedLifecycleException("Unexpected request to start JBoss Remoting Gateway listener '" + getConfig().getName() + "'.  Gateway not initialised.");
+        }
+        if (isStarted()) {
+            throw new ManagedLifecycleException("Unexpected request to start JBoss Remoting Gateway listener '" + getConfig().getName() + "'.  Gateway already started.");
+        }
+
+        // Start the JBR Server...
+        startJBRServer();
+
+        // Regsiter the JBR Endpoint...
+        try {
+            registerEndpoint();
+        } catch (Throwable t) {
+            logger.error("Unable to register service endpoint '" + endpointReference.getAddr().getAddress()
+                    + "' for service '" + serviceCategory + ":" + serviceName + "'.  Stopping JBossRemoting Server...", t);
+            stopJBRServer();
+        }
+    }
+
+    protected void doStop() throws ManagedLifecycleException {
+        if (!isStarted()) {
+            throw new ManagedLifecycleException("Unexpected request to stop JBoss Remoting Gateway listener '" + getConfig().getName() + "'.  Gateway not running.");
+        }
+
+        unregisterEndpoint();
+        stopJBRServer();
+    }
+
+    private void startJBRServer() throws ManagedLifecycleException {
+        try {
+            InvokerLocator locator = new InvokerLocator(jbrServerLocatorURI);
+
+            connector = new Connector(locator, connectorConfig);
+            connector.create();
+            connector.addInvocationHandler(getConfig().getAttribute("name", this.toString()), this);
+            connector.start();
+
+            logger.info("JBoss Remoting Gateway listener '" + getConfig().getName() + "' started.");
+        } catch (Throwable throwable) {
+            connector = null;
+            throw new ManagedLifecycleException("Unable to start Remoting Listener instsance " + getClass().getName(), throwable);
+        }
+    }
+
+    private void stopJBRServer() throws ManagedLifecycleException {
+        try {
+            connector.stop();
+            logger.info("JBoss Remoting Gateway listener '" + getConfig().getName() + "' stopped.");
+        } catch (Throwable throwable) {
+            throw new ManagedLifecycleException("Unable to stop Remoting Listener instsance " + getClass().getName(), throwable);
+        } finally {
+            connector = null;
+        }
+    }
+
+    private void registerEndpoint() throws ConfigurationException, RegistryException {
+        String serviceDescription = getConfig().getAttribute(ListenerTagNames.SERVICE_DESCRIPTION_TAG);
+        RegistryFactory.getRegistry().registerEPR(serviceCategory, serviceName, serviceDescription,
+                endpointReference, endpointReference.getAddr().getAddress());
+    }
+
+    private void unregisterEndpoint() {
+        try {
+            RegistryFactory.getRegistry().unRegisterEPR(serviceCategory, serviceName, endpointReference);
+        } catch (Throwable t) {
+            logger.error("Unable to unregister service endpoint '" + endpointReference.getAddr().getAddress()
+                    + "' for service '" + serviceCategory + ":" + serviceName + "'.", t);
+        }
+    }
+
+    protected void doDestroy() throws ManagedLifecycleException {
+    }
+
+    /*
+     * ***************************************************************************
+     *
+     * JBoss Remoting ServerInvocationHandler methods...
+     *
+     * ****************************************************************************
+     */
+
+    /**
+     * Process a remoting invocation message.
+     * <p/>
+     * This method uses an {@link org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter}
+     * to carry out the delivery.  This delivery adpter is constructed with a
+     * {@link org.jboss.soa.esb.listeners.message.MessageComposer} instance supplied through
+     * configuration, otherwise it uses the
+     * {@link org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener.JBossRemotingMessageComposer}.
+     * <p/>
+     * The message composer is responsible for mapping the remoting {@link org.jboss.remoting.InvocationRequest}
+     * into an ESB aware {@link org.jboss.soa.esb.message.Message}, while the
+     * {@link org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter} is responsible for its
+     * delivery to the target service.
+     *
+     * @param invocationRequest JBoss Remoting request.
+     * @return Message delivery acknowledgment response.
+     * @throws Throwable Message processing failure.
+     */
+    public Object invoke(InvocationRequest invocationRequest) throws Throwable {
+        try {
+            if (synchronous) {
+                Object response = messageDeliveryAdapter.deliverSync(invocationRequest, 20000); // TODO Fix magic number
+                if(logger.isDebugEnabled()) {
+                    logger.debug("Returning response [" + response + "].");
+                }
+                return response;
+            } else {
+                messageDeliveryAdapter.deliverAsync(invocationRequest);
+            }
+        } catch (Throwable t) {
+            logger.error("JBoss Remoting Gateway failed to " + (synchronous ? "synchronously" : "asynchronously") + " deliver message to target service [" +
+                    messageDeliveryAdapter.getDeliveryAdapter().getServiceCategory() + ":" +
+                    messageDeliveryAdapter.getDeliveryAdapter().getServiceName() + "].", t);
+
+            throw t;
+        }
+
+        return "<ack/>";
+    }
+
+    public void setMBeanServer(MBeanServer mBeanServer) {
+    }
+
+    public void setInvoker(ServerInvoker serverInvoker) {
+    }
+
+    public void addListener(InvokerCallbackHandler invokerCallbackHandler) {
+    }
+
+    public void removeListener(InvokerCallbackHandler invokerCallbackHandler) {
+    }
+
+    /**
+     * Initialise the JBossRemoting connector configuration.
+     * <p/>
+     * Constructs the JBR {@link org.jboss.remoting.InvokerLocator} URI
+     * through a call to {@link #getJbrServerLocatorURI()}. Also
+     * populates the server connector properties.
+     * <p/>
+     * Default behavior for population of the connector configuration is to load
+     * all listener configuration properties whose name is prefixed with "jbr-",
+     * stripping off the "jbr-" prefix from the name before adding.
+     * So, to set the Server "timeout" configuration property
+     * on the connector, you set the property name to "jbr-timeout".
+     *
+     * @param connectorConfig The configuration map instance to be populated.
+     * @throws ConfigurationException Problem populating the configuration.
+     */
+    protected void initaliseJBRConnectorConfiguration(Map<String, String> connectorConfig) throws ConfigurationException {
+        // Initialse the JBR connector URI...
+        jbrServerLocatorURI = getJbrServerLocatorURI().toString();
+
+        // Populate the connector config...
+        List<KeyValuePair> attributes = getConfig().attributesAsList();
+        for (KeyValuePair attribute : attributes) {
+            String attributeName = attribute.getKey();
+
+            if (attributeName.startsWith(JBR_PREFIX)) {
+                connectorConfig.put(attributeName.substring(JBR_PREFIX.length()), attribute.getValue());
+            }
+        }
+    }
+
+    /**
+     * Get the Service Locator URI for this remotng based listener.
+     * <p/>
+     * Uses the listener config to extract the {@link #JBR_SERVER_PROTOCOL protcol},
+     * {@link #JBR_SERVER_HOST host} and {@link #JBR_SERVER_PORT port}
+     * parameters for the server.  The host address defaults to
+     * the value returned by {@link java.net.InetAddress#getLocalHost()}.
+     *
+     * @return The Server Locator URI.
+     * @throws ConfigurationException One or more of the locator properties
+     *                                are missing from the listener config.
+     */
+    protected URI getJbrServerLocatorURI() throws ConfigurationException {
+        String protocol = getConfig().getAttribute(JBR_SERVER_PROTOCOL);
+        String host = getConfig().getAttribute(JBR_SERVER_HOST);
+        String port = getConfig().getAttribute(JBR_SERVER_PORT);
+
+        if (protocol == null || protocol.trim().equals("")) {
+            throw new ConfigurationException("Invalid JBoss Remoting Gateway configuration [" + getConfig().getName() + "]. 'protocol' configuration attribute not specified.");
+        }
+        if (host == null || host.trim().equals("")) {
+            try {
+                host = InetAddress.getLocalHost().getHostName();
+            } catch (UnknownHostException e) {
+                throw new ConfigurationException("Invalid JBoss Remoting Gateway configuration [" + getConfig().getName() + "]. 'host' configuration attribute not specified and unablee to determine local hostname.", e);
+            }
+        }
+        if (port == null || port.trim().equals("")) {
+            throw new ConfigurationException("Invalid JBoss Remoting Gateway configuration [" + getConfig().getName() + "]. 'port' configuration attribute not specified.");
+        }
+
+        String uriString = protocol + "://" + host + ":" + port;
+        try {
+            return new URI(uriString);
+        } catch (URISyntaxException e) {
+            throw new ConfigurationException("Invalid JBoss Remoting Gateway configuration [" + getConfig().getName() + "]. Invalid server locator URI '" + uriString + "'.");
+        }
+    }
+
+    /**
+     * Factory method for adapter creation.
+     *
+     * @return The adapter instance.
+     * @throws ConfigurationException Configuration error.
+     */
+    protected UncomposedMessageDeliveryAdapter createDeliveryAdapter() throws ConfigurationException {
+        return UncomposedMessageDeliveryAdapter.getGatewayDeliveryAdapter(getConfig(), new JBossRemotingMessageComposer());
+    }
+
+    /**
+     * Message composer for a JBoss Remoting {@link org.jboss.remoting.InvocationRequest}
+     * instance.
+     */
+    public static class JBossRemotingMessageComposer extends AbstractMessageComposer {
+
+        public void setConfiguration(ConfigTree config) {
+        }
+
+        @SuppressWarnings("unchecked")
+        protected void populateMessage(Message message, Object invocationRequestObj) throws MessageDeliverException {
+            InvocationRequest invocationRequest = (InvocationRequest) invocationRequestObj;
+
+            //
+            // There really needs to be an optoin on the body to set it's contents
+            // as an unnamed Object, in the same way you can set it's contents as a byte[].
+            // I think this is a major'ish usability issue.
+            //
+            // My suggestion would be...
+            //      public void setContents(Object object);
+            //      public Object getContents();
+            //      public byte[] toByteArray(); // (was "byte[] getContents()")
+            //
+            // Not totally sure of the real value of toByteArray??
+            // Continue to allow setting of named attachments. 
+            ActionUtils.setTaskObject(message, invocationRequest.getParameter());
+
+            // Copy the request properties onto the message...
+            Map properties = invocationRequest.getRequestPayload();
+            if (properties != null) {
+                Set<Map.Entry> propertyEntrySet = properties.entrySet();
+                for (Map.Entry entry : propertyEntrySet) {
+                    if (entry.getValue() != null) {
+                        message.getProperties().setProperty(entry.toString(), entry.getValue());
+                    }
+                }
+            }
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,446 +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.gateway;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.Collection;
-import java.util.Properties;
-import java.util.Set;
-
-import javax.jms.JMSException;
-import javax.jms.MessageConsumer;
-import javax.jms.Queue;
-import javax.jms.QueueSession;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-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.ListenerUtil;
-import org.jboss.soa.esb.listeners.RegistryUtil;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.util.ClassUtil;
-
-public class JmsGatewayListener extends AbstractThreadedManagedLifecycle
-{
-        /**
-         * serial version uid for this class
-         */
-        private static final long serialVersionUID = 5070422864110923930L;
-
-        public JmsGatewayListener (ConfigTree listenerConfig) throws ConfigurationException
-	{
-            super(listenerConfig) ;
-            _config = listenerConfig;
-            checkMyParms();
-	} // __________________________________
-
-
-        /**
-         * Handle the initialisation of the managed instance.
-         *
-         * @throws ManagedLifecycleException for errors while initialisation.
-         */
-        protected void doInitialise()
-            throws ManagedLifecycleException
-        {
-            try
-            {
-                _targetEprs = RegistryUtil.getEprs(_targetServiceCategory,_targetServiceName);
-                if (null == _targetEprs || _targetEprs.size() < 1)
-                    throw new ManagedLifecycleException("EPR <" + _targetServiceName + "> not found in registry") ;
-            }
-            catch (final RegistryException re)
-            {
-                throw new ManagedLifecycleException("Unexpected registry exception", re) ;
-            }
-
-            try
-            {
-                prepareMessageReceiver();
-            }
-            catch (final ConnectionException ce)
-            {
-               throw new ManagedLifecycleException("Unexpected connection exception from prepareMessageReceiver", ce);
-            }
-            catch (final JMSException jmse)
-            {
-                throw new ManagedLifecycleException("Unexpected JMS error from prepareMessageReceiver", jmse);
-            }
-            catch (final ConfigurationException ce)
-            {
-                throw new ManagedLifecycleException("Unexpected configuration exception from prepareMessageReceiver", ce);
-            }
-
-            if (_serviceName != null)
-            {
-                try
-                {
-                    RegistryUtil.register(_config, _myEpr);
-                }
-                catch (final RegistryException re)
-                {
-                    throw new ManagedLifecycleException("Unexpected error during registration for epr " + _myEpr, re);
-                }
-            }
-        }
-
-        /**
-         * Execute on the thread.
-         */
-        protected void doRun()
-        {
-                if (_logger.isDebugEnabled())
-                {
-                    _logger.debug("run() method of " + this.getClass().getSimpleName() +
-                        " started on thread " + Thread.currentThread().getName());
-                }
-
-		while (isRunning())
-		{
-			javax.jms.Message msgIn = receiveOne();
-			if (null != msgIn) {
-                try {
-                    Object obj = _processMethod.invoke(_composer,
-                            new Object[]{msgIn});
-                    if (null == obj) {
-                        _logger.warn("Action class method <" + _processMethod
-                                .getName() + "> returned a null object");
-                        continue;
-                    }
-                    // try to deliverAsync the composed message, using the
-                    // appropriate courier
-                    // to the target service
-                    try {
-                        boolean bSent = false;
-                        for (EPR current : _targetEprs) {
-                            _courier = CourierFactory.getCourier(current);
-                            try {
-                                if (_courier
-                                        .deliver((Message) obj)) {
-                                    bSent = true;
-                                    break;
-                                }
-                            }
-                            finally {
-                                CourierUtil.cleanCourier(_courier);
-                            }
-                        }
-                        if (!bSent) {
-                            String text = "Target service <" + _targetServiceCategory + "," + _targetServiceName + "> is not registered";
-                            throw new Exception(text);
-                        }
-                    }
-                    catch (ClassCastException e) {
-                        _logger.error("Action class method <" + _processMethod
-                                .getName() + "> returned a non Message object",
-                                e);
-                        continue;
-                    }
-                    catch (CourierException e) {
-                        String text = (null != _courier) ? "Courier <" + _courier
-                                .getClass().getName() + ".deliverAsync(Message) FAILED" : "NULL courier can't deliverAsync Message";
-                        _logger.error(text, e);
-                        continue;
-                    }
-                    continue;
-                }
-                catch (InvocationTargetException e) {
-                    _logger.error("Problems invoking method <" + _processMethod
-                            .getName() + ">", e);
-                }
-                catch (IllegalAccessException e) {
-                    _logger.error("Problems invoking method <" + _processMethod
-                            .getName() + ">", e);
-                }
-                catch (Exception e) {
-                    _logger.error("Unexpected problem", e);
-                }
-            }
-        }
-
-		_logger
-				.debug("run() method of " + this.getClass().getSimpleName() + " finished on thread " + Thread
-						.currentThread().getName());
-	} // ________________________________
-
-        /**
-         * Handle the destroy of the managed instance.
-         *
-         * @throws ManagedLifecycleException for errors while destroying.
-         */
-        protected void doDestroy()
-            throws ManagedLifecycleException
-        {
-            if (_serviceName != null)
-            {
-                RegistryUtil.unregister(_serviceCategory, _serviceName, _myEpr) ;
-            }
-
-            if (_messageReceiver != null)
-            {
-                try
-                {
-                    _messageReceiver.close();
-                }
-                catch (final JMSException jmse) {} // ignore
-            }
-
-            if (_queueSession != null)
-            {
-                    _pool.closeSession(_queueSession);
-            }
-        }
-
-	/**
-	 * Check for mandatory and optional attributes in parameter tree
-	 *
-	 * @throws ConfigurationException -
-	 *             if mandatory atts are not right or actionClass not in
-	 *             classpath
-	 */
-	protected void checkMyParms () throws ConfigurationException
-	{
-		// Third arg is null - Exception will be thrown if attribute is not
-		// found
-		_targetServiceCategory = ListenerUtil.obtainAtt(_config,
-				ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
-		_targetServiceName = ListenerUtil.obtainAtt(_config,
-				ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
-
-		_queueName = ListenerUtil.obtainAtt(_config,
-				JMSEpr.DESTINATION_NAME_TAG, null);
-
-		resolveComposerClass();
-
-		// No problem if selector is null - everything in queue will be returned
-		_messageSelector = _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");
-	} // ________________________________
-
-	protected void resolveComposerClass () throws ConfigurationException
-	{
-		try
-		{
-            String sProcessMethod = null;
-            _composerName = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG);
-            if (null != _composerName)
-            { // class attribute
-                _composerClass = ClassUtil.forName(_composerName, getClass());
-                Constructor oConst = _composerClass.getConstructor(new Class[]
-                { ConfigTree.class });
-                _composer = oConst.newInstance(_config);
-                sProcessMethod = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_METHOD_TAG, "process");
-            }
-			else
-			{
-				_composerName = PackageJmsMessageContents.class.getName();
-				_composerClass = PackageJmsMessageContents.class;
-				_composer = new PackageJmsMessageContents();
-				sProcessMethod = "process";
-				_logger
-						.debug("No <" + ListenerTagNames.ACTION_ELEMENT_TAG + "> element found in configuration" + " -  Using default composer class : " + _composerName);
-			}
-
-			_processMethod = _composerClass.getMethod(sProcessMethod,
-					new Class[] { Object.class });
-		}
-		catch (Exception ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-	} // ________________________________
-
-	private void prepareMessageReceiver () throws ConfigurationException, JMSException, ConnectionException
-	{
-		_queueSession = null;
-		_queue = null;
-
-        Properties environment = new Properties();
-
-        String sJndiURL = _config.getAttribute(JMSEpr.JNDI_URL_TAG);
-        String sJndiContextFactory = _config.getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG);
-        String sJndiPkgPrefix = _config.getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG);
-        if (sJndiURL!=null) environment.setProperty(Context.PROVIDER_URL, sJndiURL);
-        if (sJndiContextFactory!=null) environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, sJndiContextFactory);
-        if (sJndiPkgPrefix!=null) environment.setProperty(Context.URL_PKG_PREFIXES, sJndiPkgPrefix);
-        Set<String> names=_config.getAttributeNames();
-        for (String name : names) {
-            if (name.startsWith("java.naming.")) {
-                environment.setProperty(name, _config.getAttribute(name));
-            }
-        }
-        Context oJndiCtx = NamingContext.getServerContext(environment);
-
-        if (null == oJndiCtx)
-            throw new ConfigurationException(
-                    "Unable fo obtain jndi context <" + sJndiURL + "," + sJndiContextFactory + "," + sJndiPkgPrefix + ">");
-
-         String sFactClass = ListenerUtil.obtainAtt(_config,
-                 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: '" + sFactClass + "'");
-         _serviceCategory = _config
-                 .getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
-         _serviceName = _config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
-         _myEpr = (null == _serviceName) ? null : new JMSEpr(JMSEpr.QUEUE_TYPE,
-                 _queueName, sFactClass, environment, _messageSelector);
-
-         _pool = JmsConnectionPoolContainer.getPool(environment, sFactClass, JMSEpr.QUEUE_TYPE);
-
-         try {
-             _queueSession = _pool.getQueueSession();
-         } catch (NamingException ne) {
-             throw new ConfigurationException("Failed to obtain queue session from pool", ne) ;
-         }
-
-         try {
-             _queue = (Queue) oJndiCtx.lookup(_queueName);
-         } catch (NamingException nex) {
-             try {
-                 oJndiCtx = NamingContext.getServerContext(environment);
-                 _queue = (Queue) oJndiCtx.lookup(_queueName);
-             } catch (NamingException ne) {
-                 _queue = _queueSession.createQueue(_queueName);
-             }
-         }
-
-		_messageReceiver = _queueSession.createReceiver(_queue,
-				_messageSelector);
-	} // ________________________________
-
-	/**
-	 * Receive one message and retry if connection
-	 *
-	 * @return javax.jms.Message - One input message, or null
-	 */
-	protected javax.jms.Message receiveOne ()
-	{
-		while (isRunning())
-			try
-			{
-				javax.jms.Message ret = _messageReceiver.receive(200);
-				if (null != ret) return ret;
-			}
-			catch (JMSException oJ)
-			{
-                                if (_logger.isDebugEnabled())
-                                {
-                                    _logger.debug("JMS error on receive.  Attempting JMS Destination reconnect.",oJ);
-                                }
-				try
-				{
-					prepareMessageReceiver();
-                                        errorDelay = 0 ;
-				}
-				// try to reconnect to the queue
-				catch (Exception e)
-				{
-                                        if (_logger.isDebugEnabled())
-                                        {
-                                            _logger.debug("Reconnecting to Queue", e);
-                                        }
-                                        if (errorDelay == 0)
-                                        {
-                                            errorDelay = MIN_ERROR_DELAY ;
-                                        }
-                                        else if (errorDelay < MAX_ERROR_DELAY)
-                                        {
-                                            errorDelay <<= 1 ;
-                                        }
-                                        _logger.warn("Error reconnecting to Queue, backing off for " + errorDelay + " milliseconds") ;
-                                        waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, errorDelay) ;
-				}
-			}
-		return null;
-	} // ________________________________
-
-   protected final static Logger _logger = Logger
-			.getLogger(JmsGatewayListener.class);
-
-	protected String _queueName;
-
-	protected QueueSession _queueSession;
-
-	protected Queue _queue;
-
-	protected MessageConsumer _messageReceiver;
-
-	protected String _messageSelector;
-
-	protected ConfigTree _config;
-
-	protected String _serviceCategory, _serviceName;
-
-	protected String _targetServiceCategory, _targetServiceName;
-
-	protected EPR _myEpr;
-
-	protected Collection<EPR> _targetEprs;
-
-	protected String _composerName;
-
-	protected Class _composerClass;
-
-	protected Object _composer;
-
-	protected Method _processMethod;
-
-	protected Courier _courier;
-    
-    protected JmsConnectionPool _pool;
-    /**
-     * The minimum error delay.
-     */
-    private static final long MIN_ERROR_DELAY = 1000 ;
-    /**
-     * The maximum error delay.
-     */
-    private static final long MAX_ERROR_DELAY = (MIN_ERROR_DELAY << 5) ;
-    
-    /**
-     * The error delay.
-     */
-    private long errorDelay ;
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/JmsGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,446 @@
+/*
+ * 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.gateway;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.Collection;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.jms.JMSException;
+import javax.jms.MessageConsumer;
+import javax.jms.Queue;
+import javax.jms.QueueSession;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+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.ListenerUtil;
+import org.jboss.soa.esb.listeners.RegistryUtil;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.ClassUtil;
+
+public class JmsGatewayListener extends AbstractThreadedManagedLifecycle
+{
+        /**
+         * serial version uid for this class
+         */
+        private static final long serialVersionUID = 5070422864110923930L;
+
+        public JmsGatewayListener (ConfigTree listenerConfig) throws ConfigurationException
+	{
+            super(listenerConfig) ;
+            _config = listenerConfig;
+            checkMyParms();
+	} // __________________________________
+
+
+        /**
+         * Handle the initialisation of the managed instance.
+         *
+         * @throws ManagedLifecycleException for errors while initialisation.
+         */
+        protected void doInitialise()
+            throws ManagedLifecycleException
+        {
+            try
+            {
+                _targetEprs = RegistryUtil.getEprs(_targetServiceCategory,_targetServiceName);
+                if (null == _targetEprs || _targetEprs.size() < 1)
+                    throw new ManagedLifecycleException("EPR <" + _targetServiceName + "> not found in registry") ;
+            }
+            catch (final RegistryException re)
+            {
+                throw new ManagedLifecycleException("Unexpected registry exception", re) ;
+            }
+
+            try
+            {
+                prepareMessageReceiver();
+            }
+            catch (final ConnectionException ce)
+            {
+               throw new ManagedLifecycleException("Unexpected connection exception from prepareMessageReceiver", ce);
+            }
+            catch (final JMSException jmse)
+            {
+                throw new ManagedLifecycleException("Unexpected JMS error from prepareMessageReceiver", jmse);
+            }
+            catch (final ConfigurationException ce)
+            {
+                throw new ManagedLifecycleException("Unexpected configuration exception from prepareMessageReceiver", ce);
+            }
+
+            if (_serviceName != null)
+            {
+                try
+                {
+                    RegistryUtil.register(_config, _myEpr);
+                }
+                catch (final RegistryException re)
+                {
+                    throw new ManagedLifecycleException("Unexpected error during registration for epr " + _myEpr, re);
+                }
+            }
+        }
+
+        /**
+         * Execute on the thread.
+         */
+        protected void doRun()
+        {
+                if (_logger.isDebugEnabled())
+                {
+                    _logger.debug("run() method of " + this.getClass().getSimpleName() +
+                        " started on thread " + Thread.currentThread().getName());
+                }
+
+		while (isRunning())
+		{
+			javax.jms.Message msgIn = receiveOne();
+			if (null != msgIn) {
+                try {
+                    Object obj = _processMethod.invoke(_composer,
+                            new Object[]{msgIn});
+                    if (null == obj) {
+                        _logger.warn("Action class method <" + _processMethod
+                                .getName() + "> returned a null object");
+                        continue;
+                    }
+                    // try to deliverAsync the composed message, using the
+                    // appropriate courier
+                    // to the target service
+                    try {
+                        boolean bSent = false;
+                        for (EPR current : _targetEprs) {
+                            _courier = CourierFactory.getCourier(current);
+                            try {
+                                if (_courier
+                                        .deliver((Message) obj)) {
+                                    bSent = true;
+                                    break;
+                                }
+                            }
+                            finally {
+                                CourierUtil.cleanCourier(_courier);
+                            }
+                        }
+                        if (!bSent) {
+                            String text = "Target service <" + _targetServiceCategory + "," + _targetServiceName + "> is not registered";
+                            throw new Exception(text);
+                        }
+                    }
+                    catch (ClassCastException e) {
+                        _logger.error("Action class method <" + _processMethod
+                                .getName() + "> returned a non Message object",
+                                e);
+                        continue;
+                    }
+                    catch (CourierException e) {
+                        String text = (null != _courier) ? "Courier <" + _courier
+                                .getClass().getName() + ".deliverAsync(Message) FAILED" : "NULL courier can't deliverAsync Message";
+                        _logger.error(text, e);
+                        continue;
+                    }
+                    continue;
+                }
+                catch (InvocationTargetException e) {
+                    _logger.error("Problems invoking method <" + _processMethod
+                            .getName() + ">", e);
+                }
+                catch (IllegalAccessException e) {
+                    _logger.error("Problems invoking method <" + _processMethod
+                            .getName() + ">", e);
+                }
+                catch (Exception e) {
+                    _logger.error("Unexpected problem", e);
+                }
+            }
+        }
+
+		_logger
+				.debug("run() method of " + this.getClass().getSimpleName() + " finished on thread " + Thread
+						.currentThread().getName());
+	} // ________________________________
+
+        /**
+         * Handle the destroy of the managed instance.
+         *
+         * @throws ManagedLifecycleException for errors while destroying.
+         */
+        protected void doDestroy()
+            throws ManagedLifecycleException
+        {
+            if (_serviceName != null)
+            {
+                RegistryUtil.unregister(_serviceCategory, _serviceName, _myEpr) ;
+            }
+
+            if (_messageReceiver != null)
+            {
+                try
+                {
+                    _messageReceiver.close();
+                }
+                catch (final JMSException jmse) {} // ignore
+            }
+
+            if (_queueSession != null)
+            {
+                    _pool.closeSession(_queueSession);
+            }
+        }
+
+	/**
+	 * Check for mandatory and optional attributes in parameter tree
+	 *
+	 * @throws ConfigurationException -
+	 *             if mandatory atts are not right or actionClass not in
+	 *             classpath
+	 */
+	protected void checkMyParms () throws ConfigurationException
+	{
+		// Third arg is null - Exception will be thrown if attribute is not
+		// found
+		_targetServiceCategory = ListenerUtil.obtainAtt(_config,
+				ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
+		_targetServiceName = ListenerUtil.obtainAtt(_config,
+				ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
+
+		_queueName = ListenerUtil.obtainAtt(_config,
+				JMSEpr.DESTINATION_NAME_TAG, null);
+
+		resolveComposerClass();
+
+		// No problem if selector is null - everything in queue will be returned
+		_messageSelector = _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");
+	} // ________________________________
+
+	protected void resolveComposerClass () throws ConfigurationException
+	{
+		try
+		{
+            String sProcessMethod = null;
+            _composerName = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG);
+            if (null != _composerName)
+            { // class attribute
+                _composerClass = ClassUtil.forName(_composerName, getClass());
+                Constructor oConst = _composerClass.getConstructor(new Class[]
+                { ConfigTree.class });
+                _composer = oConst.newInstance(_config);
+                sProcessMethod = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_METHOD_TAG, "process");
+            }
+			else
+			{
+				_composerName = PackageJmsMessageContents.class.getName();
+				_composerClass = PackageJmsMessageContents.class;
+				_composer = new PackageJmsMessageContents();
+				sProcessMethod = "process";
+				_logger
+						.debug("No <" + ListenerTagNames.ACTION_ELEMENT_TAG + "> element found in configuration" + " -  Using default composer class : " + _composerName);
+			}
+
+			_processMethod = _composerClass.getMethod(sProcessMethod,
+					new Class[] { Object.class });
+		}
+		catch (Exception ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+	} // ________________________________
+
+	private void prepareMessageReceiver () throws ConfigurationException, JMSException, ConnectionException
+	{
+		_queueSession = null;
+		_queue = null;
+
+        Properties environment = new Properties();
+
+        String sJndiURL = _config.getAttribute(JMSEpr.JNDI_URL_TAG);
+        String sJndiContextFactory = _config.getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG);
+        String sJndiPkgPrefix = _config.getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG);
+        if (sJndiURL!=null) environment.setProperty(Context.PROVIDER_URL, sJndiURL);
+        if (sJndiContextFactory!=null) environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, sJndiContextFactory);
+        if (sJndiPkgPrefix!=null) environment.setProperty(Context.URL_PKG_PREFIXES, sJndiPkgPrefix);
+        Set<String> names=_config.getAttributeNames();
+        for (String name : names) {
+            if (name.startsWith("java.naming.")) {
+                environment.setProperty(name, _config.getAttribute(name));
+            }
+        }
+        Context oJndiCtx = NamingContext.getServerContext(environment);
+
+        if (null == oJndiCtx)
+            throw new ConfigurationException(
+                    "Unable fo obtain jndi context <" + sJndiURL + "," + sJndiContextFactory + "," + sJndiPkgPrefix + ">");
+
+         String sFactClass = ListenerUtil.obtainAtt(_config,
+                 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: '" + sFactClass + "'");
+         _serviceCategory = _config
+                 .getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
+         _serviceName = _config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
+         _myEpr = (null == _serviceName) ? null : new JMSEpr(JMSEpr.QUEUE_TYPE,
+                 _queueName, sFactClass, environment, _messageSelector);
+
+         _pool = JmsConnectionPoolContainer.getPool(environment, sFactClass, JMSEpr.QUEUE_TYPE);
+
+         try {
+             _queueSession = _pool.getQueueSession();
+         } catch (NamingException ne) {
+             throw new ConfigurationException("Failed to obtain queue session from pool", ne) ;
+         }
+
+         try {
+             _queue = (Queue) oJndiCtx.lookup(_queueName);
+         } catch (NamingException nex) {
+             try {
+                 oJndiCtx = NamingContext.getServerContext(environment);
+                 _queue = (Queue) oJndiCtx.lookup(_queueName);
+             } catch (NamingException ne) {
+                 _queue = _queueSession.createQueue(_queueName);
+             }
+         }
+
+		_messageReceiver = _queueSession.createReceiver(_queue,
+				_messageSelector);
+	} // ________________________________
+
+	/**
+	 * Receive one message and retry if connection
+	 *
+	 * @return javax.jms.Message - One input message, or null
+	 */
+	protected javax.jms.Message receiveOne ()
+	{
+		while (isRunning())
+			try
+			{
+				javax.jms.Message ret = _messageReceiver.receive(200);
+				if (null != ret) return ret;
+			}
+			catch (JMSException oJ)
+			{
+                                if (_logger.isDebugEnabled())
+                                {
+                                    _logger.debug("JMS error on receive.  Attempting JMS Destination reconnect.",oJ);
+                                }
+				try
+				{
+					prepareMessageReceiver();
+                                        errorDelay = 0 ;
+				}
+				// try to reconnect to the queue
+				catch (Exception e)
+				{
+                                        if (_logger.isDebugEnabled())
+                                        {
+                                            _logger.debug("Reconnecting to Queue", e);
+                                        }
+                                        if (errorDelay == 0)
+                                        {
+                                            errorDelay = MIN_ERROR_DELAY ;
+                                        }
+                                        else if (errorDelay < MAX_ERROR_DELAY)
+                                        {
+                                            errorDelay <<= 1 ;
+                                        }
+                                        _logger.warn("Error reconnecting to Queue, backing off for " + errorDelay + " milliseconds") ;
+                                        waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, errorDelay) ;
+				}
+			}
+		return null;
+	} // ________________________________
+
+   protected final static Logger _logger = Logger
+			.getLogger(JmsGatewayListener.class);
+
+	protected String _queueName;
+
+	protected QueueSession _queueSession;
+
+	protected Queue _queue;
+
+	protected MessageConsumer _messageReceiver;
+
+	protected String _messageSelector;
+
+	protected ConfigTree _config;
+
+	protected String _serviceCategory, _serviceName;
+
+	protected String _targetServiceCategory, _targetServiceName;
+
+	protected EPR _myEpr;
+
+	protected Collection<EPR> _targetEprs;
+
+	protected String _composerName;
+
+	protected Class _composerClass;
+
+	protected Object _composer;
+
+	protected Method _processMethod;
+
+	protected Courier _courier;
+    
+    protected JmsConnectionPool _pool;
+    /**
+     * The minimum error delay.
+     */
+    private static final long MIN_ERROR_DELAY = 1000 ;
+    /**
+     * The maximum error delay.
+     */
+    private static final long MAX_ERROR_DELAY = (MIN_ERROR_DELAY << 5) ;
+    
+    /**
+     * The error delay.
+     */
+    private long errorDelay ;
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,50 +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.gateway;
-
-import java.io.Serializable;
-
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-/**
-* Default packaging for Hibernate Entity messages. <p/>It will just drop the
-* Hibernate entity into a message.
-*
-* @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
-* @since Version 4.2
-*
-*/
-public class PackageHibernateMessageContents {
-	public Message process (Object obj) {
-		if (!(obj instanceof Serializable))
-			throw new IllegalArgumentException("Object must be serializable");
-
-		Message message = MessageFactory.getInstance().getMessage();
-		
-		message.getBody().add(ListenerTagNames.HIBERNATE_OBJECT_DATA_TAG, obj);
-
-		return message;
-	}
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageHibernateMessageContents.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,50 @@
+/*
+* 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.gateway;
+
+import java.io.Serializable;
+
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+/**
+* Default packaging for Hibernate Entity messages. <p/>It will just drop the
+* Hibernate entity into a message.
+*
+* @author <a href="mailto:tcunning at redhat.com">tcunning at redhat.com</a>
+* @since Version 4.2
+*
+*/
+public class PackageHibernateMessageContents {
+	public Message process (Object obj) {
+		if (!(obj instanceof Serializable))
+			throw new IllegalArgumentException("Object must be serializable");
+
+		Message message = MessageFactory.getInstance().getMessage();
+		
+		message.getBody().add(ListenerTagNames.HIBERNATE_OBJECT_DATA_TAG, obj);
+
+		return message;
+	}
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,103 +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.gateway;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.util.Enumeration;
-
-import javax.jms.BytesMessage;
-import javax.jms.JMSException;
-import javax.jms.ObjectMessage;
-import javax.jms.TextMessage;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-/**
-	 * Default gateway action for plain jms messages <p/>It will just drop the
-* jms message contents into a esb Message
-*
-* @author <a
-*         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
-* @since Version 4.0
-*
-*/
-public class PackageJmsMessageContents
-{
-  @SuppressWarnings("unchecked")
-  public Message process (Object obj) throws JMSException, IOException
-  {
-     if (!(obj instanceof javax.jms.Message))
-        throw new IllegalArgumentException(
-              "Object must be instance of javax.jms.Message");
-     byte[] bytes = getMessageContent((javax.jms.Message) obj);
-     if (null == bytes) return null;
-
-     javax.jms.Message jmsMsg = (javax.jms.Message) obj;
-     Message message = MessageFactory.getInstance().getMessage();
-     message.getBody().setByteArray(getMessageContent(jmsMsg));
-     
-     if (jmsMsg instanceof ObjectMessage) {
-         ObjectMessage msg = (ObjectMessage) jmsMsg;
-         message.getBody().add(msg.getObject());
-     }
-     
-     Enumeration<String> EE = jmsMsg.getPropertyNames();
-     if (null != EE)
-     {
-        while (EE.hasMoreElements())
-        {
-           String name = EE.nextElement();
-           Object value = jmsMsg.getObjectProperty(name);
-           if (null != value)
-              message.getProperties().setProperty(name, value);
-        }
-     }
-     return message;
-  }
-
-  private byte[] getMessageContent (javax.jms.Message jMess) throws JMSException, IOException
-  {
-     if (jMess instanceof TextMessage)
-        return ((TextMessage) jMess).getText().getBytes();
-
-     if (jMess instanceof BytesMessage)
-     {
-        BytesMessage jBytes = (BytesMessage) jMess;
-        ByteArrayOutputStream out = new ByteArrayOutputStream();
-        byte[] ba = new byte[1000];
-        int iQread;
-        while (-1 != (iQread = jBytes.readBytes(ba)))
-           if (iQread > 0) out.write(ba, 0, iQread);
-        out.close();
-        return out.toByteArray();
-     }
-
-     if (jMess instanceof ObjectMessage)
-        return ((ObjectMessage) jMess).getObject().toString()
-              .getBytes();
-     JmsGatewayListener._logger
-             .warn("Message type " + jMess.getClass().getSimpleName() + " not supported - Message is ignored");
-     return null;
-  }
-} // ____________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/PackageJmsMessageContents.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,105 @@
+/*
+* 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.gateway;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.util.Enumeration;
+
+import javax.jms.BytesMessage;
+import javax.jms.JMSException;
+import javax.jms.ObjectMessage;
+import javax.jms.TextMessage;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+/**
+	 * Default gateway action for plain jms messages <p/>It will just drop the
+* jms message contents into a esb Message
+*
+* @author <a
+*         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+* @since Version 4.0
+*
+*/
+public class PackageJmsMessageContents
+{
+  @SuppressWarnings("unchecked")
+  public Message process (Object obj) throws JMSException, IOException
+  {
+     if (!(obj instanceof javax.jms.Message))
+        throw new IllegalArgumentException(
+              "Object must be instance of javax.jms.Message");
+     byte[] bytes = getMessageContent((javax.jms.Message) obj);
+     if (null == bytes) return null;
+
+     javax.jms.Message jmsMsg = (javax.jms.Message) obj;
+     Message message = MessageFactory.getInstance().getMessage();
+     message.getBody().setByteArray(getMessageContent(jmsMsg));
+     
+     if (jmsMsg instanceof ObjectMessage) {
+         ObjectMessage msg = (ObjectMessage) jmsMsg;
+         message.getBody().add(msg.getObject());
+     }
+     if (jmsMsg.getJMSMessageID()!=null) {
+         message.getBody().add("MessageId", jmsMsg.getJMSMessageID());
+     }
+     Enumeration<String> EE = jmsMsg.getPropertyNames();
+     if (null != EE)
+     {
+        while (EE.hasMoreElements())
+        {
+           String name = EE.nextElement();
+           Object value = jmsMsg.getObjectProperty(name);
+           if (null != value)
+              message.getProperties().setProperty(name, value);
+        }
+     }
+     return message;
+  }
+
+  private byte[] getMessageContent (javax.jms.Message jMess) throws JMSException, IOException
+  {
+     if (jMess instanceof TextMessage)
+        return ((TextMessage) jMess).getText().getBytes();
+
+     if (jMess instanceof BytesMessage)
+     {
+        BytesMessage jBytes = (BytesMessage) jMess;
+        ByteArrayOutputStream out = new ByteArrayOutputStream();
+        byte[] ba = new byte[1000];
+        int iQread;
+        while (-1 != (iQread = jBytes.readBytes(ba)))
+           if (iQread > 0) out.write(ba, 0, iQread);
+        out.close();
+        return out.toByteArray();
+     }
+
+     if (jMess instanceof ObjectMessage)
+        return ((ObjectMessage) jMess).getObject().toString()
+              .getBytes();
+     JmsGatewayListener._logger
+             .warn("Message type " + jMess.getClass().getSimpleName() + " not supported - Message is ignored");
+     return null;
+  }
+} // ____________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,231 +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.gateway;
-
-import java.io.File;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.gateway.remotestrategies.ReadOnlyRemoteFileSystemStrategy;
-import org.jboss.soa.esb.listeners.gateway.remotestrategies.RemoteFileSystemStrategy;
-import org.jboss.soa.esb.listeners.gateway.remotestrategies.RemoteFileSystemStrategyException;
-import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.DeleteOnEvictTreeCacheListener;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * This class extends {@link RemoteGatewayListener} and is intended to be used
- * when the remote file system does not support write operations.
- * <p>
- * 
- * <pre>
- * Sample Listener Configuration:
- * &lt;ftp-listener name="FtpGateway"
- *  busidref="helloFTPChannel"
- *   maxThreads="1"
- *    is-gateway="true"&gt;
- *     &lt;property name="pollLatencySeconds" value="5"/&gt; &lt;!-- Interval to poll the remote file system --&gt;
- *     &lt;property name="remoteFileSystemStrategy-configFile" value="/ftpfile-cache-config.xml"/&gt; &lt;!-- Optional--&gt;
- *     &lt;property name="remoteFileSystemStrategy-cacheListener" value=""org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.DeleteOnEvictTreeCacheListener"/&gt; &lt;!-- Optional--&gt;
- *     &lt;property name="remoteFileSystemStrategy-class" value="org.my.MyRemoteGatewayStrategy"/&gt; &lt;!-- Optional--&gt;
- *&lt;/ftp-listener&gt;
- * </pre>
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- *
- */
-public class ReadOnlyRemoteGatewayListener extends RemoteGatewayListener
-{
-	/**
-	 * Property to specify the {@link RemoteFileSystemStrategy} implementation
-	 */
-	public static final String REMOTE_FILE_SYSTEM_STRATEGY_CLASS = "remoteFileSystemStrategy-class";
-	/**
-	 * Property to specify a configuration file for {@link #REMOTE_FILE_SYSTEM_STRATEGY_CLASS} 
-	 */
-	public static final String REMOTE_FILE_SYSTEM_STRATEGY_CONFIG_FILE = "remoteFileSystemStrategy-configFile";
-	/**
-	 * Property to specify if a the TreeCacheListener should be used. See {@link DeleteOnEvictTreeCacheListener} 
-	 */
-	public static final String REMOTE_FILE_SYSTEM_STRATEGY_CACHE_LISTENER = "remoteFileSystemStrategy-cacheListener";
-	/**
-	 * A strategy for handling call related to write operations.
-	 */
-	private RemoteFileSystemStrategy remotefileSystemStrategy;
-    /**
-     * serial version uid for this class
-     */
-    private static final long serialVersionUID = 8505559166811233906L;
-    
-    public ReadOnlyRemoteGatewayListener(ConfigTree config) throws ConfigurationException, RegistryException, GatewayException {
-		super(config);
-		createRemoteFileSystemStrategy();
-	}
-
-	/**
-	 * Delegates to {@link RemoteFileSystemStrategy#deleteFile(File)}
-	 */
-	@Override
-	public boolean deleteFile( File file ) throws GatewayException
-	{
-		try
-		{
-			return remotefileSystemStrategy.deleteFile( file );
-		} 
-		catch (RemoteFileSystemStrategyException e)
-		{
-			throw new GatewayException( e );
-		}
-	}
-
-	/**
-	 * Delegates to {@link RemoteFileSystemStrategy#filterFileList(File[])}
-	 */
-	@Override
-	File[] getFileList() throws GatewayException
-	{
-		try
-		{
-			return remotefileSystemStrategy.filterFileList( super.getFileList() );
-		} 
-		catch (RemoteFileSystemStrategyException e)
-		{
-			throw new GatewayException( e );
-		}
-	}
-
-	/**
-	 * Delegates to {@link RemoteFileSystemStrategy#renameFile(File, File)}
-	 */
-	@Override
-	boolean renameFile(File from, File to) throws GatewayException
-	{
-		try
-		{
-			return remotefileSystemStrategy.renameFile( from, to );
-		} 
-		catch (RemoteFileSystemStrategyException e)
-		{
-			throw new GatewayException( e );
-		}
-	}
-	
-	/**
-	 * Delegates to {@link RemoteFileSystemStrategy#getWorkFileName(File, String)}
-	 */
-	@Override
-	protected File getWorkFileName(File file, String suffix )
-	{
-		return remotefileSystemStrategy.getWorkFileName( file, suffix );
-	}
-	
-	/**
-	 * Set the {@link RemoteFileSystemStrategy } to be used
-	 * @param remotefileSystemStrategy
-	 */
-	public void setRemotefileSystemStrategy( RemoteFileSystemStrategy remotefileSystemStrategy )
-	{
-		this.remotefileSystemStrategy = remotefileSystemStrategy;
-	}
-	
-	protected <T> T getNewInstanceOf( String className ) throws ConfigurationException
-	{
-		if ( className == null )
-			throw new IllegalArgumentException ( "className argument must not be null.");
-		
-		T instance = null;
-		try
-		{
-			@SuppressWarnings ("unchecked")
-            Class<T> type = ClassUtil.forName( className , getClass());
-            instance = (T) type.newInstance();
-		}
-		catch (Exception ex)
-		{
-			_logger.error(ex);
-			throw new ConfigurationException(ex);
-		}
-		return instance;
-	}
-
-	/**
-	 * Stop the service and also after that stop the 
-	 * remotefileSystemStrategy in use
-	 */
-	protected void doStop() throws ManagedLifecycleException
-	{
-		remotefileSystemStrategy.stop();
-		super.doStop();
-	}
-	
-	/**
-	 * Destroys the service and also after that stop the 
-	 * remotefileSystemStrategy in use
-	 */
-    protected void doDestroy() throws ManagedLifecycleException
-    {
-		remotefileSystemStrategy.destroy();
-		super.doDestroy();
-    }
-	
-	private void createRemoteFileSystemStrategy() throws ConfigurationException
-	{
-		String strategyClassName = _config.getAttribute( REMOTE_FILE_SYSTEM_STRATEGY_CLASS );
-		RemoteFileSystemStrategy strategy = null;
-		
-		if ( strategyClassName != null )
-			strategy = getNewInstanceOf( strategyClassName );
-		
-		remotefileSystemStrategy = strategy != null ? strategy : new ReadOnlyRemoteFileSystemStrategy();
-
-		String configFile = _config.getAttribute( REMOTE_FILE_SYSTEM_STRATEGY_CONFIG_FILE );
-		try
-		{
-			remotefileSystemStrategy.init( configFile );
-				
-			if ( remotefileSystemStrategy instanceof ReadOnlyRemoteFileSystemStrategy )
-			{
-				ReadOnlyRemoteFileSystemStrategy rm = (ReadOnlyRemoteFileSystemStrategy) remotefileSystemStrategy;
-				String cacheListener = _config.getAttribute( REMOTE_FILE_SYSTEM_STRATEGY_CACHE_LISTENER );
-				
-				if ( cacheListener != null )
-				{
-		           Class cacheListenerClass = ClassUtil.forName( cacheListener , getClass() );
-		           rm.setCacheListener( cacheListenerClass );
-				}
-			}
-		}
-		catch( RemoteFileSystemStrategyException e )
-		{
-			_logger.error( "Could not configure the remoteFileSystemStrategy.", e );
-			throw new ConfigurationException(e);
-		} 
-		catch (ClassNotFoundException e)
-		{
-			_logger.error( "ClassNotFound while trying to create the the remoteFileSystemStrategy.", e );
-			throw new ConfigurationException(e);
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,231 @@
+/*
+ * 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.gateway;
+
+import java.io.File;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.gateway.remotestrategies.ReadOnlyRemoteFileSystemStrategy;
+import org.jboss.soa.esb.listeners.gateway.remotestrategies.RemoteFileSystemStrategy;
+import org.jboss.soa.esb.listeners.gateway.remotestrategies.RemoteFileSystemStrategyException;
+import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.DeleteOnEvictTreeCacheListener;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * This class extends {@link RemoteGatewayListener} and is intended to be used
+ * when the remote file system does not support write operations.
+ * <p>
+ * 
+ * <pre>
+ * Sample Listener Configuration:
+ * &lt;ftp-listener name="FtpGateway"
+ *  busidref="helloFTPChannel"
+ *   maxThreads="1"
+ *    is-gateway="true"&gt;
+ *     &lt;property name="pollLatencySeconds" value="5"/&gt; &lt;!-- Interval to poll the remote file system --&gt;
+ *     &lt;property name="remoteFileSystemStrategy-configFile" value="/ftpfile-cache-config.xml"/&gt; &lt;!-- Optional--&gt;
+ *     &lt;property name="remoteFileSystemStrategy-cacheListener" value=""org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.DeleteOnEvictTreeCacheListener"/&gt; &lt;!-- Optional--&gt;
+ *     &lt;property name="remoteFileSystemStrategy-class" value="org.my.MyRemoteGatewayStrategy"/&gt; &lt;!-- Optional--&gt;
+ *&lt;/ftp-listener&gt;
+ * </pre>
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ *
+ */
+public class ReadOnlyRemoteGatewayListener extends RemoteGatewayListener
+{
+	/**
+	 * Property to specify the {@link RemoteFileSystemStrategy} implementation
+	 */
+	public static final String REMOTE_FILE_SYSTEM_STRATEGY_CLASS = "remoteFileSystemStrategy-class";
+	/**
+	 * Property to specify a configuration file for {@link #REMOTE_FILE_SYSTEM_STRATEGY_CLASS} 
+	 */
+	public static final String REMOTE_FILE_SYSTEM_STRATEGY_CONFIG_FILE = "remoteFileSystemStrategy-configFile";
+	/**
+	 * Property to specify if a the TreeCacheListener should be used. See {@link DeleteOnEvictTreeCacheListener} 
+	 */
+	public static final String REMOTE_FILE_SYSTEM_STRATEGY_CACHE_LISTENER = "remoteFileSystemStrategy-cacheListener";
+	/**
+	 * A strategy for handling call related to write operations.
+	 */
+	private RemoteFileSystemStrategy remotefileSystemStrategy;
+    /**
+     * serial version uid for this class
+     */
+    private static final long serialVersionUID = 8505559166811233906L;
+    
+    public ReadOnlyRemoteGatewayListener(ConfigTree config) throws ConfigurationException, RegistryException, GatewayException {
+		super(config);
+		createRemoteFileSystemStrategy();
+	}
+
+	/**
+	 * Delegates to {@link RemoteFileSystemStrategy#deleteFile(File)}
+	 */
+	@Override
+	public boolean deleteFile( File file ) throws GatewayException
+	{
+		try
+		{
+			return remotefileSystemStrategy.deleteFile( file );
+		} 
+		catch (RemoteFileSystemStrategyException e)
+		{
+			throw new GatewayException( e );
+		}
+	}
+
+	/**
+	 * Delegates to {@link RemoteFileSystemStrategy#filterFileList(File[])}
+	 */
+	@Override
+	File[] getFileList() throws GatewayException
+	{
+		try
+		{
+			return remotefileSystemStrategy.filterFileList( super.getFileList() );
+		} 
+		catch (RemoteFileSystemStrategyException e)
+		{
+			throw new GatewayException( e );
+		}
+	}
+
+	/**
+	 * Delegates to {@link RemoteFileSystemStrategy#renameFile(File, File)}
+	 */
+	@Override
+	boolean renameFile(File from, File to) throws GatewayException
+	{
+		try
+		{
+			return remotefileSystemStrategy.renameFile( from, to );
+		} 
+		catch (RemoteFileSystemStrategyException e)
+		{
+			throw new GatewayException( e );
+		}
+	}
+	
+	/**
+	 * Delegates to {@link RemoteFileSystemStrategy#getWorkFileName(File, String)}
+	 */
+	@Override
+	protected File getWorkFileName(File file, String suffix )
+	{
+		return remotefileSystemStrategy.getWorkFileName( file, suffix );
+	}
+	
+	/**
+	 * Set the {@link RemoteFileSystemStrategy } to be used
+	 * @param remotefileSystemStrategy
+	 */
+	public void setRemotefileSystemStrategy( RemoteFileSystemStrategy remotefileSystemStrategy )
+	{
+		this.remotefileSystemStrategy = remotefileSystemStrategy;
+	}
+	
+	protected <T> T getNewInstanceOf( String className ) throws ConfigurationException
+	{
+		if ( className == null )
+			throw new IllegalArgumentException ( "className argument must not be null.");
+		
+		T instance = null;
+		try
+		{
+			@SuppressWarnings ("unchecked")
+            Class<T> type = ClassUtil.forName( className , getClass());
+            instance = (T) type.newInstance();
+		}
+		catch (Exception ex)
+		{
+			_logger.error(ex);
+			throw new ConfigurationException(ex);
+		}
+		return instance;
+	}
+
+	/**
+	 * Stop the service and also after that stop the 
+	 * remotefileSystemStrategy in use
+	 */
+	protected void doStop() throws ManagedLifecycleException
+	{
+		remotefileSystemStrategy.stop();
+		super.doStop();
+	}
+	
+	/**
+	 * Destroys the service and also after that stop the 
+	 * remotefileSystemStrategy in use
+	 */
+    protected void doDestroy() throws ManagedLifecycleException
+    {
+		remotefileSystemStrategy.destroy();
+		super.doDestroy();
+    }
+	
+	private void createRemoteFileSystemStrategy() throws ConfigurationException
+	{
+		String strategyClassName = _config.getAttribute( REMOTE_FILE_SYSTEM_STRATEGY_CLASS );
+		RemoteFileSystemStrategy strategy = null;
+		
+		if ( strategyClassName != null )
+			strategy = getNewInstanceOf( strategyClassName );
+		
+		remotefileSystemStrategy = strategy != null ? strategy : new ReadOnlyRemoteFileSystemStrategy();
+
+		String configFile = _config.getAttribute( REMOTE_FILE_SYSTEM_STRATEGY_CONFIG_FILE );
+		try
+		{
+			remotefileSystemStrategy.init( configFile );
+				
+			if ( remotefileSystemStrategy instanceof ReadOnlyRemoteFileSystemStrategy )
+			{
+				ReadOnlyRemoteFileSystemStrategy rm = (ReadOnlyRemoteFileSystemStrategy) remotefileSystemStrategy;
+				String cacheListener = _config.getAttribute( REMOTE_FILE_SYSTEM_STRATEGY_CACHE_LISTENER );
+				
+				if ( cacheListener != null )
+				{
+		           Class cacheListenerClass = ClassUtil.forName( cacheListener , getClass() );
+		           rm.setCacheListener( cacheListenerClass );
+				}
+			}
+		}
+		catch( RemoteFileSystemStrategyException e )
+		{
+			_logger.error( "Could not configure the remoteFileSystemStrategy.", e );
+			throw new ConfigurationException(e);
+		} 
+		catch (ClassNotFoundException e)
+		{
+			_logger.error( "ClassNotFound while trying to create the the remoteFileSystemStrategy.", e );
+			throw new ConfigurationException(e);
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,254 +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.gateway;
-
-import java.io.File;
-import java.io.IOException;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.ListenerUtil;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.util.FtpClientUtil;
-import org.jboss.soa.esb.util.RemoteFileSystem;
-import org.jboss.soa.esb.util.RemoteFileSystemException;
-import org.jboss.soa.esb.util.RemoteFileSystemFactory;
-
-/**
- * Sample Listener Configuration:
- * <pre>
- * &lt;ftp-listener name="FtpGateway"
- *  busidref="helloFTPChannel"
- *   maxThreads="1"
- *    is-gateway="true"&gt;
- *     &lt;property name="pollLatencySeconds" value="5"/&gt; &lt;!-- Interval to poll the remote file system --&gt;
- *&lt;/ftp-listener&gt;
- * </pre>
- * 
- * @author John Doe				
- * @author Daniel Bevenius				
- *
- */
-public class RemoteGatewayListener extends FileGatewayListener
-{
-    /**
-     * serial version uid for this class
-     */
-    private static final long serialVersionUID = 8505559166811233906L;
-    
-    public RemoteGatewayListener(ConfigTree config) throws ConfigurationException, RegistryException, GatewayException {
-		super(config);
-        checkMyParms() ;
-	}
-
-	protected void checkMyParms() throws ConfigurationException, RegistryException, GatewayException
-	{
-		try
-		{
-			File temp = File.createTempFile("FTPdown", ".tmp");
-			temp.delete();
-			String localDir = temp.getParent();
-			if (null==localDir)
-				localDir=new File("").getAbsolutePath();
-			_config.setAttribute(RemoteFileSystem.PARMS_LOCAL_DIR, localDir);
-			final String remoteDir = _config.getAttribute(ListenerTagNames.FILE_INPUT_DIR_TAG) ;
-			_config.setAttribute(RemoteFileSystem.PARMS_REMOTE_DIR, remoteDir);
-			EPR epr = ListenerUtil.assembleEpr(_config);
-			if (epr instanceof FTPEpr)  {
-				FTPEpr ftpEpr = (FTPEpr) epr;
-				RemoteFileSystem rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
-				rfs.quit();
-			} else {
-				throw new GatewayException("This Gateway only accepts FTP and SFTP.");
-			}
-		}
-		catch (IOException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-		catch (RemoteFileSystemException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-		
-	}
-
-	@Override
-	protected void seeIfOkToWorkOnDir(File p_oDir) throws GatewayException
-	{
-		// TODO: Implement. Very expensive though.
-		// It is possible to check for existence and permission by connecting,
-		// cd to target, put dummy file, ls to see list it, rm to clean it
-		// p_oDir exists 
-		// p_oDir writable 
-		// p_oDir readable 
-	}
-
-	@Override
-	public boolean deleteFile(File file) throws GatewayException
-	{
-		RemoteFileSystem rfs = null;
-		try
-		{
-			EPR epr = ListenerUtil.assembleEpr(_config);
-			if (epr instanceof FTPEpr)  {
-				FTPEpr ftpEpr = (FTPEpr) epr;
-				rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
-				rfs.setRemoteDir(FtpClientUtil.fileToFtpString(_inputDirectory));
-				rfs.deleteRemoteFile(file.toString());
-				return true;
-			} else {
-				throw new GatewayException("This Gateway only accepts FTP and SFTP.");
-			}
-			
-		} catch (Exception e)
-		{
-			throw new GatewayException(e);
-		} finally
-		{
-			if (null != rfs)
-				rfs.quit();
-		}
-	}
-
-	@Override
-	byte[] getFileContents(File file) throws GatewayException
-	{
-		RemoteFileSystem rfs = null;
-		try
-		{
-			File temp = File.createTempFile("FTPdown", ".tmp");
-			EPR epr = ListenerUtil.assembleEpr(_config);
-			if (epr instanceof FTPEpr)  {
-				FTPEpr ftpEpr = (FTPEpr) epr;
-				rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
-				rfs.setRemoteDir(FtpClientUtil.fileToFtpString(_inputDirectory));
-				rfs.downloadFile(file.toString(), temp.getAbsolutePath());
-				final byte[] contents = super.getFileContents(temp);
-				temp.delete() ;
-				return contents ;
-			} else {
-				throw new GatewayException("This Gateway only accepts FTP and SFTP.");
-			}
-			
-		} catch (Exception e)
-		{
-			throw new GatewayException(e);
-		} finally
-		{
-			if (null != rfs)
-				rfs.quit();
-		}
-	}
-
-	@Override
-	File[] getFileList() throws GatewayException
-	{
-		RemoteFileSystem rfs = null;
-		File[] oaRet = null;
-		try
-		{
-			EPR epr = ListenerUtil.assembleEpr(_config);
-			if (epr instanceof FTPEpr)  {
-				FTPEpr ftpEpr = (FTPEpr) epr;
-				rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
-				rfs.setRemoteDir(FtpClientUtil.fileToFtpString(_inputDirectory));
-				String[] sa = rfs.getFileListFromRemoteDir(_inputSuffix);
-				oaRet = new File[(null == sa) ? 0 : sa.length];
-				int i1 = 0;
-				if (null != sa)
-					for (String sCurr : sa)
-						oaRet[i1++] = new File(sCurr);
-			} else {
-				throw new GatewayException("This Gateway only accepts FTP and SFTP.");
-			}
-		} catch (Exception e){
-			throw new GatewayException(e);
-		} finally {
-			if (null != rfs)
-				rfs.quit();
-		}
-		return oaRet;
-	}
-
-	@Override
-	boolean renameFile(File from, File to) throws GatewayException
-	{
-		RemoteFileSystem rfs = null;
-		try
-		{
-			EPR epr = ListenerUtil.assembleEpr(_config);
-			if (epr instanceof FTPEpr)  {
-				FTPEpr ftpEpr = (FTPEpr) epr;
-				rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
-				rfs.setRemoteDir(FtpClientUtil.fileToFtpString(_inputDirectory));
-				rfs.remoteRename( from, to );
-				return true;
-			} else {
-				throw new GatewayException("This Gateway only accepts FTP and SFTP.");
-			}
-		} catch (Exception e) {
-			throw new GatewayException(e);
-		} finally {
-			if (null != rfs)
-				rfs.quit();
-		}
-	}
-	
-	@Override
-	protected File getWorkFileName(File file, String suffix )
-	{
-		return new File( file.toString() + suffix);
-	}
-	
-	@Override
-	void bytesToFile(byte[] bytes, File file) throws GatewayException 
-	{
-		RemoteFileSystem rfs = null;
-		try
-		{
-			EPR epr = ListenerUtil.assembleEpr(_config);
-			if (!(epr instanceof FTPEpr))  
-				throw new Exception("This Gateway only accepts FTP and SFTP.");
-
-			FTPEpr ftpEpr = (FTPEpr) epr;
-			rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
-			rfs.setRemoteDir(FtpClientUtil.fileToFtpString(_inputDirectory));
-
-			File tmpFile = File.createTempFile("RemoteGW", ".forUpload");
-			super.bytesToFile(bytes, tmpFile);
-			rfs.uploadFile(tmpFile, file.getName());
-			tmpFile.delete();
-
-		} catch (Exception e) {
-			throw new GatewayException(e);
-		} finally {
-			if (null != rfs)
-				rfs.quit();
-		}
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,254 @@
+/*
+ * 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.gateway;
+
+import java.io.File;
+import java.io.IOException;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.FtpClientUtil;
+import org.jboss.soa.esb.util.RemoteFileSystem;
+import org.jboss.soa.esb.util.RemoteFileSystemException;
+import org.jboss.soa.esb.util.RemoteFileSystemFactory;
+
+/**
+ * Sample Listener Configuration:
+ * <pre>
+ * &lt;ftp-listener name="FtpGateway"
+ *  busidref="helloFTPChannel"
+ *   maxThreads="1"
+ *    is-gateway="true"&gt;
+ *     &lt;property name="pollLatencySeconds" value="5"/&gt; &lt;!-- Interval to poll the remote file system --&gt;
+ *&lt;/ftp-listener&gt;
+ * </pre>
+ * 
+ * @author John Doe				
+ * @author Daniel Bevenius				
+ *
+ */
+public class RemoteGatewayListener extends FileGatewayListener
+{
+    /**
+     * serial version uid for this class
+     */
+    private static final long serialVersionUID = 8505559166811233906L;
+    
+    public RemoteGatewayListener(ConfigTree config) throws ConfigurationException, RegistryException, GatewayException {
+		super(config);
+        checkMyParms() ;
+	}
+
+	protected void checkMyParms() throws ConfigurationException, RegistryException, GatewayException
+	{
+		try
+		{
+			File temp = File.createTempFile("FTPdown", ".tmp");
+			temp.delete();
+			String localDir = temp.getParent();
+			if (null==localDir)
+				localDir=new File("").getAbsolutePath();
+			_config.setAttribute(RemoteFileSystem.PARMS_LOCAL_DIR, localDir);
+			final String remoteDir = _config.getAttribute(ListenerTagNames.FILE_INPUT_DIR_TAG) ;
+			_config.setAttribute(RemoteFileSystem.PARMS_REMOTE_DIR, remoteDir);
+			EPR epr = ListenerUtil.assembleEpr(_config);
+			if (epr instanceof FTPEpr)  {
+				FTPEpr ftpEpr = (FTPEpr) epr;
+				RemoteFileSystem rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
+				rfs.quit();
+			} else {
+				throw new GatewayException("This Gateway only accepts FTP and SFTP.");
+			}
+		}
+		catch (IOException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+		catch (RemoteFileSystemException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+		
+	}
+
+	@Override
+	protected void seeIfOkToWorkOnDir(File p_oDir) throws GatewayException
+	{
+		// TODO: Implement. Very expensive though.
+		// It is possible to check for existence and permission by connecting,
+		// cd to target, put dummy file, ls to see list it, rm to clean it
+		// p_oDir exists 
+		// p_oDir writable 
+		// p_oDir readable 
+	}
+
+	@Override
+	public boolean deleteFile(File file) throws GatewayException
+	{
+		RemoteFileSystem rfs = null;
+		try
+		{
+			EPR epr = ListenerUtil.assembleEpr(_config);
+			if (epr instanceof FTPEpr)  {
+				FTPEpr ftpEpr = (FTPEpr) epr;
+				rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
+				rfs.setRemoteDir(FtpClientUtil.fileToFtpString(_inputDirectory));
+				rfs.deleteRemoteFile(file.toString());
+				return true;
+			} else {
+				throw new GatewayException("This Gateway only accepts FTP and SFTP.");
+			}
+			
+		} catch (Exception e)
+		{
+			throw new GatewayException(e);
+		} finally
+		{
+			if (null != rfs)
+				rfs.quit();
+		}
+	}
+
+	@Override
+	byte[] getFileContents(File file) throws GatewayException
+	{
+		RemoteFileSystem rfs = null;
+		try
+		{
+			File temp = File.createTempFile("FTPdown", ".tmp");
+			EPR epr = ListenerUtil.assembleEpr(_config);
+			if (epr instanceof FTPEpr)  {
+				FTPEpr ftpEpr = (FTPEpr) epr;
+				rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
+				rfs.setRemoteDir(FtpClientUtil.fileToFtpString(_inputDirectory));
+				rfs.downloadFile(file.toString(), temp.getAbsolutePath());
+				final byte[] contents = super.getFileContents(temp);
+				temp.delete() ;
+				return contents ;
+			} else {
+				throw new GatewayException("This Gateway only accepts FTP and SFTP.");
+			}
+			
+		} catch (Exception e)
+		{
+			throw new GatewayException(e);
+		} finally
+		{
+			if (null != rfs)
+				rfs.quit();
+		}
+	}
+
+	@Override
+	File[] getFileList() throws GatewayException
+	{
+		RemoteFileSystem rfs = null;
+		File[] oaRet = null;
+		try
+		{
+			EPR epr = ListenerUtil.assembleEpr(_config);
+			if (epr instanceof FTPEpr)  {
+				FTPEpr ftpEpr = (FTPEpr) epr;
+				rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
+				rfs.setRemoteDir(FtpClientUtil.fileToFtpString(_inputDirectory));
+				String[] sa = rfs.getFileListFromRemoteDir(_inputSuffix);
+				oaRet = new File[(null == sa) ? 0 : sa.length];
+				int i1 = 0;
+				if (null != sa)
+					for (String sCurr : sa)
+						oaRet[i1++] = new File(sCurr);
+			} else {
+				throw new GatewayException("This Gateway only accepts FTP and SFTP.");
+			}
+		} catch (Exception e){
+			throw new GatewayException(e);
+		} finally {
+			if (null != rfs)
+				rfs.quit();
+		}
+		return oaRet;
+	}
+
+	@Override
+	boolean renameFile(File from, File to) throws GatewayException
+	{
+		RemoteFileSystem rfs = null;
+		try
+		{
+			EPR epr = ListenerUtil.assembleEpr(_config);
+			if (epr instanceof FTPEpr)  {
+				FTPEpr ftpEpr = (FTPEpr) epr;
+				rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
+				rfs.setRemoteDir(FtpClientUtil.fileToFtpString(_inputDirectory));
+				rfs.remoteRename( from, to );
+				return true;
+			} else {
+				throw new GatewayException("This Gateway only accepts FTP and SFTP.");
+			}
+		} catch (Exception e) {
+			throw new GatewayException(e);
+		} finally {
+			if (null != rfs)
+				rfs.quit();
+		}
+	}
+	
+	@Override
+	protected File getWorkFileName(File file, String suffix )
+	{
+		return new File( file.toString() + suffix);
+	}
+	
+	@Override
+	void bytesToFile(byte[] bytes, File file) throws GatewayException 
+	{
+		RemoteFileSystem rfs = null;
+		try
+		{
+			EPR epr = ListenerUtil.assembleEpr(_config);
+			if (!(epr instanceof FTPEpr))  
+				throw new Exception("This Gateway only accepts FTP and SFTP.");
+
+			FTPEpr ftpEpr = (FTPEpr) epr;
+			rfs = RemoteFileSystemFactory.getRemoteFileSystem(ftpEpr, true);
+			rfs.setRemoteDir(FtpClientUtil.fileToFtpString(_inputDirectory));
+
+			File tmpFile = File.createTempFile("RemoteGW", ".forUpload");
+			super.bytesToFile(bytes, tmpFile);
+			rfs.uploadFile(tmpFile, file.getName());
+			tmpFile.delete();
+
+		} catch (Exception e) {
+			throw new GatewayException(e);
+		} finally {
+			if (null != rfs)
+				rfs.quit();
+		}
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,827 +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.gateway;
-
-import java.io.Serializable;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-import java.sql.ResultSetMetaData;
-import java.sql.SQLException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
-import javax.sql.DataSource;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
-import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.ListenerUtil;
-import org.jboss.soa.esb.listeners.RegistryUtil;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.util.ClassUtil;
-import org.jboss.soa.esb.util.Util;
-
-/**
- * 
- * Polls an SQL table for rows that satisfy conditions defined in the xml
- * runtime configuration
- * 
- * <p/>When a row that matches conditions is retrieved, it's contents are packed
- * into an ESB Message and
- * 
- * <p/> The following fields are mandatory (see checkMyParms()): <br/> <br/>SQL
- * table name <br/>list of fields to retrieve <br/>list of key fields to use in
- * the update statement <br/>a field that will be used to mark a row as
- * 'pending(p)', 'in process(w)', 'done(d)' or 'in error(e)'
- * 
- * @author <a
- *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- * 
- */
-public class SqlTableGatewayListener extends AbstractThreadedManagedLifecycle
-{
-
-        /**
-         * serial version uid for this class
-         */
-        private static final long serialVersionUID = -4394272471377134121L;
-    
-        public SqlTableGatewayListener(ConfigTree config)
-            throws ConfigurationException
-	{
-            super(config) ;
-            _config = config;
-            _sleepBetweenPolls = 10000; // milliseconds TODO magic number
-            checkMyParms();
-	} // __________________________________
-        
-        /**
-         * Handle the initialisation of the managed instance.
-         * 
-         * @throws ManagedLifecycleException for errors while initialisation.
-         */
-        protected void doInitialise()
-            throws ManagedLifecycleException
-        {
-            try
-            {
-                _targetEprs = RegistryUtil.getEprs(_targetServiceCategory,_targetServiceName);
-                if (null == _targetEprs || _targetEprs.size() < 1)
-                    throw new ManagedLifecycleException("EPR <" + _targetServiceName + "> not found in registry") ;
-            }
-            catch (final RegistryException re)
-            {
-                throw new ManagedLifecycleException("Unexpected registry exception", re) ;
-            }
-            
-            boolean failure = true ;
-            try
-            {
-                prepareStatements();
-                failure = false ;
-            }
-            catch (final SQLException sqle)
-            {
-                throw new ManagedLifecycleException("Unexpected error initialising statements", sqle);
-            }
-            finally
-            {
-                if (failure)
-                {
-                    if (_dbConn != null)
-                    {
-                        _dbConn.release();
-                        _dbConn = null ;
-                    }
-                }
-            }
-        }
-
-        /**
-         * Execute on the thread.
-         */
-        protected void doRun()
-        {
-                if (_logger.isDebugEnabled())
-                {
-                    _logger.debug("doRun() method of " + this.getClass().getSimpleName() +
-                            " started on thread " + Thread.currentThread().getName());
-                }
-
-                do
-		{
-			for (Map<String, Object> row : pollForCandidates())
-			{
-				_currentRow = row;
-				// Try to mark as 'in process' - if unsuccessful, somebody else
-				// got it first
-				if (!changeStatusToWorking()) continue;
-
-				Throwable thrown = null;
-				String text = null;
-				try
-				{
-					Object obj = _processMethod.invoke(_composer,
-							new Object[] { _currentRow });
-					if (null == obj)
-					{
-						_logger.warn("Action class method <" + _processMethod
-								.getName() + "> returned a null object");
-						continue;
-					}
-					Message message = (Message) obj;
-
-					// if(_composerClass.equals(PackageRowContents.class))
-					// {
-					// Properties props = message.getProperties();
-					// props.setProperty(JDBCEpr.DRIVER_TAG ,_driver);
-					// props.setProperty(JDBCEpr.URL_TAG ,_url);
-					// props.setProperty(JDBCEpr.USERNAME_TAG ,_user);
-					// props.setProperty(JDBCEpr.PASSWORD_TAG , _password);
-					//	        			
-					// }
-					boolean bSent = false;
-					for (EPR current : _targetEprs)
-					{
-						_courier = CourierFactory.getCourier(current);
-                                                try
-                                                {
-                                                    if (_courier.deliver(message))
-                                                    {
-                                                    	bSent = true;
-                                                    	break;
-                                                    }
-                                                }
-                                                finally
-                                                {
-                                                    CourierUtil.cleanCourier(_courier) ;
-                                                }
-					}
-					if (!bSent)
-					{
-						text = "Target service <" + _targetServiceCategory + "," + _targetServiceName + "> is not registered";
-						thrown = new Exception(text);
-					}
-				}
-				catch (InvocationTargetException e)
-				{
-					thrown = e;
-					text = "Problems invoking method <" + _processMethod
-							.getName() + ">";
-				}
-				catch (IllegalAccessException e)
-				{
-					thrown = e;
-					text = "Problems invoking method <" + _processMethod
-							.getName() + ">";
-				}
-				catch (ClassCastException e)
-				{
-					thrown = e;
-					text = "Action class method <" + _processMethod.getName() + "> returned a non Message object";
-				}
-				catch (CourierException e)
-				{
-					thrown = e;
-					text = "Courier <" + _courier.getClass().getName() + ".deliverAsync(Message) FAILED";
-				}
-				catch (MalformedEPRException ex)
-				{
-					thrown = ex;
-					text = "Courier <" + _courier.getClass().getName() + ".deliverAsync(Message) FAILED with malformed EPR.";
-				}
-
-				if (null == thrown)
-				{
-					if (_deleteAfterOK) deleteCurrentRow();
-					else
-						changeStatusToDone();
-				}
-				else
-				{
-                                        _logger.error(text);
-					_logger.debug(text, thrown);
-					changeStatusToError();
-				}
-			}
-		}
-                while (!waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, _sleepBetweenPolls)) ;
-
-                if (_logger.isDebugEnabled())
-                {
-                    _logger.debug("run() method of " + this.getClass().getSimpleName() +
-                        " finished on thread " + Thread.currentThread().getName());
-                }
-	} // ________________________________
-
-        /**
-         * Handle the destroy of the managed instance.
-         * 
-         * @throws ManagedLifecycleException for errors while destroying.
-         */
-        protected void doDestroy()
-            throws ManagedLifecycleException
-        {
-            if (_dbConn != null)
-            {
-                _dbConn.release();
-            }
-        }
-
-	/**
-	 * Check for mandatory and optional attributes in parameter tree
-	 * 
-	 * @throws ConfigurationException -
-	 *             if mandatory atts are not right or actionClass not in
-	 *             classpath
-	 */
-	private void checkMyParms () throws ConfigurationException
-	{
-		// Third arg is null - Exception will be thrown if attribute is not
-		// found
-		_targetServiceCategory = ListenerUtil.obtainAtt(_config,
-				ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
-		_targetServiceName = ListenerUtil.obtainAtt(_config,
-				ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
-
-		// Polling interval
-		String sAux = _config
-				.getAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG);
-
-		if (!Util.isNullString(sAux))
-		{
-			try
-			{
-				_sleepBetweenPolls = 1000 * Long.parseLong(sAux);
-			}
-			catch (NumberFormatException e)
-			{
-				_logger
-						.warn("Invalid poll latency - keeping default of " + (_sleepBetweenPolls / 1000));
-			}
-		}
-		else
-		{
-			_logger
-					.warn("No value specified for: " + ListenerTagNames.POLL_LATENCY_SECS_TAG + " -  Using default of " + (_sleepBetweenPolls / 1000));
-		}
-
-		resolveComposerClass();
-
-		_driver = ListenerUtil.obtainAtt(_config, JDBCEpr.DRIVER_TAG, null);
-		_url = ListenerUtil.obtainAtt(_config, JDBCEpr.URL_TAG, null);
-		_user = ListenerUtil.obtainAtt(_config, JDBCEpr.USERNAME_TAG, null);
-		_password = ListenerUtil.obtainAtt(_config, JDBCEpr.PASSWORD_TAG, "");
-
-		_tableName = _config.getAttribute(ListenerTagNames.SQL_TABLE_NAME_TAG);
-		if (null == _tableName)
-			_tableName = _config.getRequiredAttribute(JDBCEpr.TABLE_NAME_TAG);
-		if (Util.isNullString(_tableName))
-			throw new ConfigurationException("Empty or invalid table name");
-
-		_selectFields = ListenerUtil.obtainAtt(_config,
-				ListenerTagNames.SQL_SELECT_FIELDS_TAG, "*");
-		if (Util.isNullString(_selectFields))
-			throw new ConfigurationException(
-					"Empty or invalid list of select fields");
-		_keyFields = _config.getAttribute(ListenerTagNames.SQL_KEY_FIELDS_TAG);
-		if (null == _keyFields)
-			_keyFields = _config.getRequiredAttribute(JDBCEpr.MESSAGE_ID_COLUMN_TAG);
-		if (Util.isNullString(_keyFields))
-			throw new ConfigurationException(
-					"Empty or invalid list of key fields");
-		_inProcessField = _config
-				.getAttribute(ListenerTagNames.SQL_IN_PROCESS_FIELD_TAG);
-		if (null == _inProcessField)
-			_inProcessField = _config.getAttribute(JDBCEpr.STATUS_COLUMN_TAG);
-		if (Util.isNullString(_inProcessField))
-			throw new ConfigurationException(
-					"A valid inProcessField attribute must be specified");
-
-		_where = ListenerUtil.obtainAtt(_config,
-				ListenerTagNames.SQL_WHERE_CONDITION_TAG, "");
-		if (_where.trim().length() < 1)
-			_logger
-					.debug("No value specified for: " + ListenerTagNames.SQL_WHERE_CONDITION_TAG);
-		_orderBy = ListenerUtil.obtainAtt(_config,
-				ListenerTagNames.SQL_ORDER_BY_TAG, "");
-		if (_orderBy.trim().length() < 1)
-			_logger
-					.debug("No value specified for: " + ListenerTagNames.SQL_ORDER_BY_TAG);
-		_inProcessVals = ListenerUtil.obtainAtt(_config,
-				ListenerTagNames.SQL_IN_PROCESS_VALUES_TAG,
-				DEFAULT_IN_PROCESS_STATES);
-
-		_deleteAfterOK = Boolean.parseBoolean(ListenerUtil.obtainAtt(_config,
-				ListenerTagNames.SQL_POST_DEL_TAG, "false"));
-		if (null == _config.getAttribute(ListenerTagNames.SQL_POST_DEL_TAG))
-			_logger
-					.debug("No value specified for: " + ListenerTagNames.SQL_POST_DEL_TAG + " - trigger row will not be deleted - 'in process field' will be used to show processing status");
-
-		if (_inProcessVals.length() < 4)
-			throw new ConfigurationException(
-					"Parameter <" + ListenerTagNames.SQL_IN_PROCESS_VALUES_TAG + "> must be at least 4 characters long (PWED)");
-
-		_columns = _selectFields.split(",");
-		if (_columns.length < 1)
-			throw new ConfigurationException("Empty list of select fields");
-
-		_keys = _keyFields.split(",");
-		if (!"*".equals(_selectFields))
-		{
-			Set<String> colSet = new HashSet<String>(Arrays.asList(_columns));
-			if (_keys.length < 1)
-				throw new ConfigurationException("Empty list of keyFields");
-			for (String currKey : _keys)
-			{
-				if (colSet.contains(currKey)) continue;
-				else
-				{
-					StringBuilder sb = new StringBuilder().append(
-							"All key field names in the <").append(
-							ListenerTagNames.SQL_KEY_FIELDS_TAG).append(
-							"> attribute must be in the ").append(
-							ListenerTagNames.SQL_SELECT_FIELDS_TAG).append(
-							"list - '").append(currKey)
-							.append("' is not there");
-					throw new ConfigurationException(sb.toString());
-				}
-			}
-		}
-	} // ________________________________
-
-	protected void prepareStatements () throws SQLException
-	{
-		_PSscan = getDbConn().prepareStatement(scanStatement());
-		_PSupdate = getDbConn().prepareStatement(updateStatement());
-		_PSdeleteRow = getDbConn().prepareStatement(deleteStatement());
-	} // ________________________________
-
-	/*
-	 * Throw ConfigurationException for anything to do with setup. Ultimately
-	 * could do with finer grained error handling. Probably need different types
-	 * of setup exceptions.
-	 */
-	
-	protected void resolveComposerClass () throws ConfigurationException
-	{
-		try
-		{
-            String sProcessMethod = null;
-            _composerName = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG);
-            if (null != _composerName)
-            { // class attribute
-                _composerClass = ClassUtil.forName(_composerName, getClass());
-                Constructor oConst = _composerClass.getConstructor(new Class[]
-                { ConfigTree.class });
-                _composer = oConst.newInstance(_config);
-                sProcessMethod = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_METHOD_TAG, "process");
-            }
-			else
-			{
-				_composerName = PackageRowContents.class.getName();
-				_composerClass = PackageRowContents.class;
-				_composer = new PackageRowContents();
-				sProcessMethod = "process";
-				_logger
-						.debug("No <" + ListenerTagNames.ACTION_ELEMENT_TAG + "> element found in configuration" + " -  Using default composer class : " + _composerName);
-			}
-	
-			_processMethod = _composerClass.getMethod(sProcessMethod,
-					new Class[] { Object.class });
-		}
-		catch (InvocationTargetException ex)
-		{
-			_logger.debug(ex);
-			
-			throw new ConfigurationException(ex);
-		}
-		catch (IllegalAccessException ex)
-		{
-			_logger.debug(ex);
-			
-			throw new ConfigurationException(ex);
-		}
-		catch (InstantiationException ex)
-		{
-			_logger.debug(ex);
-			
-			throw new ConfigurationException(ex);
-		}
-		catch (ClassNotFoundException ex)
-		{
-			_logger.debug(ex);
-			
-			throw new ConfigurationException(ex);
-		}
-		catch (NoSuchMethodException ex)
-		{
-			_logger.debug(ex);
-			
-			throw new ConfigurationException(ex);
-		}
-	} // ________________________________
-
-	protected List<Map<String, Object>> pollForCandidates ()
-	{
-		List<Map<String, Object>> oResults = new ArrayList<Map<String, Object>>();
-                final JdbcCleanConn oConn = getDbConn();
-		try
-		{
-			ResultSet RS = oConn.execQueryWait(_PSscan, 1);
-			ResultSetMetaData meta = RS.getMetaData();
-			while (RS.next())
-			{
-				Map<String, Object> row = new HashMap<String, Object>();
-				for (int iCurr = 1; iCurr <= meta.getColumnCount(); iCurr++)
-				{
-					String sCol = meta.getColumnName(iCurr);
-					if (!_inProcessField.equals(sCol))
-						row.put(sCol, RS.getObject(iCurr));
-				}
-
-				oResults.add(row);
-			}
-		}
-		catch (Exception e)
-		{
-                    _logger.debug("Some triggers might not have been returned", e);
-		}
-                finally
-                {
-                    try
-                    {
-                        oConn.rollback() ;
-                    }
-                    catch (final SQLException sqle) {}
-                }
-                if (_logger.isDebugEnabled())
-                {
-                    _logger.debug("Returning " + oResults.size() + " rows.\n");
-                }
-		return oResults;
-	} // ________________________________
-
-	/**
-	 * Obtain a new database connection with parameter info
-	 * 
-	 * @return A new connection
-	 * @throws ConfigurationException -
-	 *             if problems are encountered
-	 */
-	protected JdbcCleanConn getDbConn()
-	{
-		if (null == _dbConn)
-		{
-			DataSource oDS = new SimpleDataSource(_driver, _url, _user,
-					_password);
-			_dbConn = new JdbcCleanConn(oDS);
-		}
-		return _dbConn;
-	} // ________________________________
-
-	/**
-	 * Assemble the SQL statement to scan (poll) the table
-	 * 
-	 * @return - The resulting SQL statement
-	 */
-	protected String scanStatement ()
-	{
-		StringBuilder sb = new StringBuilder().append("select ").append(
-				_selectFields).append(" from ").append(_tableName);
-
-		boolean bWhere = !Util.isNullString(_where);
-		if (bWhere) sb.append(" where ").append(_where);
-		sb.append((bWhere) ? " and " : " where ");
-
-		String sLike = _inProcessVals.substring(0, 1).toUpperCase();
-		sb.append(" upper(").append(_inProcessField).append(") like '").append(
-				sLike).append("%'");
-
-		if (!Util.isNullString(_orderBy))
-			sb.append(" order by ").append(_orderBy);
-		return sb.toString();
-	} // ________________________________
-
-	/**
-	 * Assemble the SQL statement to update the field in the "inProcessField"
-	 * parameter
-	 * 
-	 * in the table row uniquely identified by the list of fields in the
-	 * "keyFields" parameter
-	 * 
-	 * @return - The resulting SQL statement
-	 */
-	protected String updateStatement ()
-	{
-		StringBuilder sb = new StringBuilder().append("update ").append(
-				_tableName).append(" set ").append(_inProcessField).append(
-				" = ? where ").append(_inProcessField).append(" = ?");
-		for (String sCurr : _keys)
-		{
-			sb.append(" and ").append(sCurr).append(" = ?");
-		}
-		return sb.toString();
-	} // ________________________________
-
-	/**
-	 * Assemble the SQL "select for update" statement for the "inProcessField"
-	 * parameter
-	 * 
-	 * in the table row uniquely identified by the list of fields in the
-	 * "keyFields" parameter
-	 * 
-	 * @return - The resulting SQL statement
-	 */
-	protected String selectForUpdStatement ()
-	{
-		StringBuilder sb = new StringBuilder().append("select ").append(
-				_inProcessField).append(" from ").append(_tableName).append(
-				" where ");
-		int iCurr = 0;
-		for (String sCurr : _keys)
-		{
-			if (iCurr++ > 0) sb.append(" and ");
-			sb.append(sCurr).append(" = ?");
-		}
-		
-		/*
-		 * HS QL does not support FOR UPDATE! All tables appear to
-		 * be inherently updatable!
-		 */
-		
-		if (_driver.contains("hsqldb"))
-			return sb.toString();
-		else
-			return sb.append(" for update").toString();
-	} // ________________________________
-
-	/**
-	 * Assemble the SQL statement to delete the current row in the table row
-	 * uniquely identified by the list of fields in the "keyFields" parameter
-	 * 
-	 * @return - The resulting SQL statement
-	 */
-	protected String deleteStatement ()
-	{
-		StringBuilder sb = new StringBuilder().append("delete from ").append(
-				_tableName).append(" where ");
-		int iCurr = 0;
-		for (String sCurr : _keys)
-		{
-			if (iCurr++ > 0) sb.append(" and ");
-			sb.append(sCurr).append(" = ?");
-		}
-		return sb.toString();
-	} // ________________________________
-
-	/**
-	 * Try to delete 'current row' from polled table
-	 * 
-	 * @return true if row deletion was successful - false otherwise
-	 */
-	protected boolean deleteCurrentRow ()
-	{
-		try
-		{
-			int iParm = 1;
-			for (String sColName : _keys)
-                        {
-                                final String val = String.valueOf(_currentRow.get(sColName));
-				_PSdeleteRow.setString(iParm++, val);
-                        }
-
-			try
-			{
-				getDbConn().execUpdWait(_PSdeleteRow, 5);
-				getDbConn().commit();
-				return true;
-			}
-			catch (Exception e)
-			{
-				_logger.debug("Delete row has failed.  Rolling back!!", e);
-			}
-
-			try
-			{
-				getDbConn().rollback();
-			}
-			catch (Exception e)
-			{
-				_logger.debug("Unable to rollback delete row", e);
-			}
-		}
-		catch (Exception e)
-		{
-			_logger.debug("Unexpected exception.", e);
-		}
-		return false;
-	} // ________________________________
-
-	protected String getStatus (ROW_STATE p_oState)
-	{
-		int iPos = p_oState.ordinal();
-		return _inProcessVals.substring(iPos, ++iPos);
-	} // ________________________________
-
-	protected boolean changeStatusToWorking ()
-	{
-		return changeStatus(ROW_STATE.Pending, ROW_STATE.Working);
-	} // ________________________________
-
-	protected boolean changeStatusToDone ()
-	{
-		return changeStatus(ROW_STATE.Working, ROW_STATE.Done);
-	} // ________________________________
-
-	protected boolean changeStatusToError ()
-	{
-		return changeStatus(ROW_STATE.Working, ROW_STATE.Error);
-	} // ________________________________
-
-	protected boolean changeStatus (ROW_STATE fromState, ROW_STATE toState)
-	{
-		try
-		{
-			getDbConn();
-		}
-		catch (Exception e)
-		{
-			_logger.debug("Unable to get DB connection.", e);
-			throw new IllegalStateException("Unable to get DB connection.", e);
-		}
-
-		try
-		{
-			int iParm = 3;
-			for (String sColName : _keys)
-			{
-				Object oVal = String.valueOf(_currentRow.get(sColName));
-				_PSupdate.setObject(iParm++, oVal);
-			}
-
-			try
-			{
-                            _PSupdate.setString(1, getStatus(toState));
-                            _PSupdate.setString(2, getStatus(fromState));
-                            final int count = getDbConn().execUpdWait(_PSupdate, 5);
-                            if (count == 1)
-                            {
-                                getDbConn().commit();
-
-				if (_logger.isDebugEnabled())
-					_logger.debug("Successfully changed row state from " + fromState + " to " + toState + ".");
-
-				return true;
-                            }
-                            else
-                            {
-                                    _logger.warn("Cannot change row state from " + fromState + " to " + toState + ".  Number of rows in state " + fromState + " = " + count);
-                                    return false;
-                            }
-			}
-			catch (Exception e)
-			{
-                            final String message = "Row status change to " + toState + " has failed.  Rolling back!!" ;
-                            _logger.error(message);
-                            _logger.debug(message, e);
-			}
-
-			try
-			{
-				getDbConn().rollback();
-			}
-			catch (Exception e)
-			{
-                            final String message = "Unable to rollback row status change to " + fromState ;
-                            _logger.error(message) ;
-                            _logger.debug(message, e) ;
-			}
-		}
-		catch (Exception e)
-		{
-                    final String message = "Unexpected exception." ;
-                    _logger.error(message) ;
-                    _logger.debug(message, e) ;
-		}
-
-		return false;
-	} // ________________________________
-
-	/**
-	 * Default gateway action for SQL table rows <p/>It will just drop the
-	 * result set contents into a Message
-	 * 
-	 * @author <a
-	 *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
-	 * @since Version 4.0
-	 * 
-	 */
-	public static class PackageRowContents
-	{
-		public Message process (Object obj)
-		{
-			if (!(obj instanceof Serializable))
-				throw new IllegalArgumentException("Object must be instance of Map");
-
-			Message message = MessageFactory.getInstance().getMessage();
-			org.jboss.soa.esb.message.Properties props = message
-					.getProperties();
-
-			props.setProperty(ListenerTagNames.SQL_ROW_DATA_TAG, obj);
-
-			return message;
-		}
-	} // ____________________________________________________
-
-	protected final static Logger _logger = Logger
-			.getLogger(SqlTableGatewayListener.class);
-
-	protected ConfigTree _config;
-
-	protected long _sleepBetweenPolls; // milliseconds
-
-	protected String _targetServiceCategory, _targetServiceName;
-
-	protected Collection<EPR> _targetEprs;
-
-	protected String _composerName;
-
-	protected Class _composerClass;
-
-	protected Object _composer;
-
-	protected Method _processMethod;
-
-	protected Courier _courier;
-
-	protected String _driver, _url, _user, _password;
-
-	protected String _tableName, _selectFields, _keyFields;
-
-	protected String _where, _orderBy;
-
-	protected String _inProcessField, _inProcessVals;
-
-	protected boolean _deleteAfterOK;
-
-	protected String[] _columns, _keys;
-
-	protected PreparedStatement _PSscan, _PSupdate, _PSdeleteRow;
-
-	protected JdbcCleanConn _dbConn;
-
-	protected Map<String, Object> _currentRow;
-
-	public static enum ROW_STATE
-	{
-		Pending, Working, Error, Done
-	}
-
-	public static final String DEFAULT_IN_PROCESS_STATES = "PWED";
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,827 @@
+/*
+ * 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.gateway;
+
+import java.io.Serializable;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+import java.sql.ResultSetMetaData;
+import java.sql.SQLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+
+import javax.sql.DataSource;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
+import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.listeners.RegistryUtil;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.ClassUtil;
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * 
+ * Polls an SQL table for rows that satisfy conditions defined in the xml
+ * runtime configuration
+ * 
+ * <p/>When a row that matches conditions is retrieved, it's contents are packed
+ * into an ESB Message and
+ * 
+ * <p/> The following fields are mandatory (see checkMyParms()): <br/> <br/>SQL
+ * table name <br/>list of fields to retrieve <br/>list of key fields to use in
+ * the update statement <br/>a field that will be used to mark a row as
+ * 'pending(p)', 'in process(w)', 'done(d)' or 'in error(e)'
+ * 
+ * @author <a
+ *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ * 
+ */
+public class SqlTableGatewayListener extends AbstractThreadedManagedLifecycle
+{
+
+        /**
+         * serial version uid for this class
+         */
+        private static final long serialVersionUID = -4394272471377134121L;
+    
+        public SqlTableGatewayListener(ConfigTree config)
+            throws ConfigurationException
+	{
+            super(config) ;
+            _config = config;
+            _sleepBetweenPolls = 10000; // milliseconds TODO magic number
+            checkMyParms();
+	} // __________________________________
+        
+        /**
+         * Handle the initialisation of the managed instance.
+         * 
+         * @throws ManagedLifecycleException for errors while initialisation.
+         */
+        protected void doInitialise()
+            throws ManagedLifecycleException
+        {
+            try
+            {
+                _targetEprs = RegistryUtil.getEprs(_targetServiceCategory,_targetServiceName);
+                if (null == _targetEprs || _targetEprs.size() < 1)
+                    throw new ManagedLifecycleException("EPR <" + _targetServiceName + "> not found in registry") ;
+            }
+            catch (final RegistryException re)
+            {
+                throw new ManagedLifecycleException("Unexpected registry exception", re) ;
+            }
+            
+            boolean failure = true ;
+            try
+            {
+                prepareStatements();
+                failure = false ;
+            }
+            catch (final SQLException sqle)
+            {
+                throw new ManagedLifecycleException("Unexpected error initialising statements", sqle);
+            }
+            finally
+            {
+                if (failure)
+                {
+                    if (_dbConn != null)
+                    {
+                        _dbConn.release();
+                        _dbConn = null ;
+                    }
+                }
+            }
+        }
+
+        /**
+         * Execute on the thread.
+         */
+        protected void doRun()
+        {
+                if (_logger.isDebugEnabled())
+                {
+                    _logger.debug("doRun() method of " + this.getClass().getSimpleName() +
+                            " started on thread " + Thread.currentThread().getName());
+                }
+
+                do
+		{
+			for (Map<String, Object> row : pollForCandidates())
+			{
+				_currentRow = row;
+				// Try to mark as 'in process' - if unsuccessful, somebody else
+				// got it first
+				if (!changeStatusToWorking()) continue;
+
+				Throwable thrown = null;
+				String text = null;
+				try
+				{
+					Object obj = _processMethod.invoke(_composer,
+							new Object[] { _currentRow });
+					if (null == obj)
+					{
+						_logger.warn("Action class method <" + _processMethod
+								.getName() + "> returned a null object");
+						continue;
+					}
+					Message message = (Message) obj;
+
+					// if(_composerClass.equals(PackageRowContents.class))
+					// {
+					// Properties props = message.getProperties();
+					// props.setProperty(JDBCEpr.DRIVER_TAG ,_driver);
+					// props.setProperty(JDBCEpr.URL_TAG ,_url);
+					// props.setProperty(JDBCEpr.USERNAME_TAG ,_user);
+					// props.setProperty(JDBCEpr.PASSWORD_TAG , _password);
+					//	        			
+					// }
+					boolean bSent = false;
+					for (EPR current : _targetEprs)
+					{
+						_courier = CourierFactory.getCourier(current);
+                                                try
+                                                {
+                                                    if (_courier.deliver(message))
+                                                    {
+                                                    	bSent = true;
+                                                    	break;
+                                                    }
+                                                }
+                                                finally
+                                                {
+                                                    CourierUtil.cleanCourier(_courier) ;
+                                                }
+					}
+					if (!bSent)
+					{
+						text = "Target service <" + _targetServiceCategory + "," + _targetServiceName + "> is not registered";
+						thrown = new Exception(text);
+					}
+				}
+				catch (InvocationTargetException e)
+				{
+					thrown = e;
+					text = "Problems invoking method <" + _processMethod
+							.getName() + ">";
+				}
+				catch (IllegalAccessException e)
+				{
+					thrown = e;
+					text = "Problems invoking method <" + _processMethod
+							.getName() + ">";
+				}
+				catch (ClassCastException e)
+				{
+					thrown = e;
+					text = "Action class method <" + _processMethod.getName() + "> returned a non Message object";
+				}
+				catch (CourierException e)
+				{
+					thrown = e;
+					text = "Courier <" + _courier.getClass().getName() + ".deliverAsync(Message) FAILED";
+				}
+				catch (MalformedEPRException ex)
+				{
+					thrown = ex;
+					text = "Courier <" + _courier.getClass().getName() + ".deliverAsync(Message) FAILED with malformed EPR.";
+				}
+
+				if (null == thrown)
+				{
+					if (_deleteAfterOK) deleteCurrentRow();
+					else
+						changeStatusToDone();
+				}
+				else
+				{
+                                        _logger.error(text);
+					_logger.debug(text, thrown);
+					changeStatusToError();
+				}
+			}
+		}
+                while (!waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, _sleepBetweenPolls)) ;
+
+                if (_logger.isDebugEnabled())
+                {
+                    _logger.debug("run() method of " + this.getClass().getSimpleName() +
+                        " finished on thread " + Thread.currentThread().getName());
+                }
+	} // ________________________________
+
+        /**
+         * Handle the destroy of the managed instance.
+         * 
+         * @throws ManagedLifecycleException for errors while destroying.
+         */
+        protected void doDestroy()
+            throws ManagedLifecycleException
+        {
+            if (_dbConn != null)
+            {
+                _dbConn.release();
+            }
+        }
+
+	/**
+	 * Check for mandatory and optional attributes in parameter tree
+	 * 
+	 * @throws ConfigurationException -
+	 *             if mandatory atts are not right or actionClass not in
+	 *             classpath
+	 */
+	private void checkMyParms () throws ConfigurationException
+	{
+		// Third arg is null - Exception will be thrown if attribute is not
+		// found
+		_targetServiceCategory = ListenerUtil.obtainAtt(_config,
+				ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
+		_targetServiceName = ListenerUtil.obtainAtt(_config,
+				ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
+
+		// Polling interval
+		String sAux = _config
+				.getAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG);
+
+		if (!Util.isNullString(sAux))
+		{
+			try
+			{
+				_sleepBetweenPolls = 1000 * Long.parseLong(sAux);
+			}
+			catch (NumberFormatException e)
+			{
+				_logger
+						.warn("Invalid poll latency - keeping default of " + (_sleepBetweenPolls / 1000));
+			}
+		}
+		else
+		{
+			_logger
+					.warn("No value specified for: " + ListenerTagNames.POLL_LATENCY_SECS_TAG + " -  Using default of " + (_sleepBetweenPolls / 1000));
+		}
+
+		resolveComposerClass();
+
+		_driver = ListenerUtil.obtainAtt(_config, JDBCEpr.DRIVER_TAG, null);
+		_url = ListenerUtil.obtainAtt(_config, JDBCEpr.URL_TAG, null);
+		_user = ListenerUtil.obtainAtt(_config, JDBCEpr.USERNAME_TAG, null);
+		_password = ListenerUtil.obtainAtt(_config, JDBCEpr.PASSWORD_TAG, "");
+
+		_tableName = _config.getAttribute(ListenerTagNames.SQL_TABLE_NAME_TAG);
+		if (null == _tableName)
+			_tableName = _config.getRequiredAttribute(JDBCEpr.TABLE_NAME_TAG);
+		if (Util.isNullString(_tableName))
+			throw new ConfigurationException("Empty or invalid table name");
+
+		_selectFields = ListenerUtil.obtainAtt(_config,
+				ListenerTagNames.SQL_SELECT_FIELDS_TAG, "*");
+		if (Util.isNullString(_selectFields))
+			throw new ConfigurationException(
+					"Empty or invalid list of select fields");
+		_keyFields = _config.getAttribute(ListenerTagNames.SQL_KEY_FIELDS_TAG);
+		if (null == _keyFields)
+			_keyFields = _config.getRequiredAttribute(JDBCEpr.MESSAGE_ID_COLUMN_TAG);
+		if (Util.isNullString(_keyFields))
+			throw new ConfigurationException(
+					"Empty or invalid list of key fields");
+		_inProcessField = _config
+				.getAttribute(ListenerTagNames.SQL_IN_PROCESS_FIELD_TAG);
+		if (null == _inProcessField)
+			_inProcessField = _config.getAttribute(JDBCEpr.STATUS_COLUMN_TAG);
+		if (Util.isNullString(_inProcessField))
+			throw new ConfigurationException(
+					"A valid inProcessField attribute must be specified");
+
+		_where = ListenerUtil.obtainAtt(_config,
+				ListenerTagNames.SQL_WHERE_CONDITION_TAG, "");
+		if (_where.trim().length() < 1)
+			_logger
+					.debug("No value specified for: " + ListenerTagNames.SQL_WHERE_CONDITION_TAG);
+		_orderBy = ListenerUtil.obtainAtt(_config,
+				ListenerTagNames.SQL_ORDER_BY_TAG, "");
+		if (_orderBy.trim().length() < 1)
+			_logger
+					.debug("No value specified for: " + ListenerTagNames.SQL_ORDER_BY_TAG);
+		_inProcessVals = ListenerUtil.obtainAtt(_config,
+				ListenerTagNames.SQL_IN_PROCESS_VALUES_TAG,
+				DEFAULT_IN_PROCESS_STATES);
+
+		_deleteAfterOK = Boolean.parseBoolean(ListenerUtil.obtainAtt(_config,
+				ListenerTagNames.SQL_POST_DEL_TAG, "false"));
+		if (null == _config.getAttribute(ListenerTagNames.SQL_POST_DEL_TAG))
+			_logger
+					.debug("No value specified for: " + ListenerTagNames.SQL_POST_DEL_TAG + " - trigger row will not be deleted - 'in process field' will be used to show processing status");
+
+		if (_inProcessVals.length() < 4)
+			throw new ConfigurationException(
+					"Parameter <" + ListenerTagNames.SQL_IN_PROCESS_VALUES_TAG + "> must be at least 4 characters long (PWED)");
+
+		_columns = _selectFields.split(",");
+		if (_columns.length < 1)
+			throw new ConfigurationException("Empty list of select fields");
+
+		_keys = _keyFields.split(",");
+		if (!"*".equals(_selectFields))
+		{
+			Set<String> colSet = new HashSet<String>(Arrays.asList(_columns));
+			if (_keys.length < 1)
+				throw new ConfigurationException("Empty list of keyFields");
+			for (String currKey : _keys)
+			{
+				if (colSet.contains(currKey)) continue;
+				else
+				{
+					StringBuilder sb = new StringBuilder().append(
+							"All key field names in the <").append(
+							ListenerTagNames.SQL_KEY_FIELDS_TAG).append(
+							"> attribute must be in the ").append(
+							ListenerTagNames.SQL_SELECT_FIELDS_TAG).append(
+							"list - '").append(currKey)
+							.append("' is not there");
+					throw new ConfigurationException(sb.toString());
+				}
+			}
+		}
+	} // ________________________________
+
+	protected void prepareStatements () throws SQLException
+	{
+		_PSscan = getDbConn().prepareStatement(scanStatement());
+		_PSupdate = getDbConn().prepareStatement(updateStatement());
+		_PSdeleteRow = getDbConn().prepareStatement(deleteStatement());
+	} // ________________________________
+
+	/*
+	 * Throw ConfigurationException for anything to do with setup. Ultimately
+	 * could do with finer grained error handling. Probably need different types
+	 * of setup exceptions.
+	 */
+	
+	protected void resolveComposerClass () throws ConfigurationException
+	{
+		try
+		{
+            String sProcessMethod = null;
+            _composerName = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG);
+            if (null != _composerName)
+            { // class attribute
+                _composerClass = ClassUtil.forName(_composerName, getClass());
+                Constructor oConst = _composerClass.getConstructor(new Class[]
+                { ConfigTree.class });
+                _composer = oConst.newInstance(_config);
+                sProcessMethod = _config.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_METHOD_TAG, "process");
+            }
+			else
+			{
+				_composerName = PackageRowContents.class.getName();
+				_composerClass = PackageRowContents.class;
+				_composer = new PackageRowContents();
+				sProcessMethod = "process";
+				_logger
+						.debug("No <" + ListenerTagNames.ACTION_ELEMENT_TAG + "> element found in configuration" + " -  Using default composer class : " + _composerName);
+			}
+	
+			_processMethod = _composerClass.getMethod(sProcessMethod,
+					new Class[] { Object.class });
+		}
+		catch (InvocationTargetException ex)
+		{
+			_logger.debug(ex);
+			
+			throw new ConfigurationException(ex);
+		}
+		catch (IllegalAccessException ex)
+		{
+			_logger.debug(ex);
+			
+			throw new ConfigurationException(ex);
+		}
+		catch (InstantiationException ex)
+		{
+			_logger.debug(ex);
+			
+			throw new ConfigurationException(ex);
+		}
+		catch (ClassNotFoundException ex)
+		{
+			_logger.debug(ex);
+			
+			throw new ConfigurationException(ex);
+		}
+		catch (NoSuchMethodException ex)
+		{
+			_logger.debug(ex);
+			
+			throw new ConfigurationException(ex);
+		}
+	} // ________________________________
+
+	protected List<Map<String, Object>> pollForCandidates ()
+	{
+		List<Map<String, Object>> oResults = new ArrayList<Map<String, Object>>();
+                final JdbcCleanConn oConn = getDbConn();
+		try
+		{
+			ResultSet RS = oConn.execQueryWait(_PSscan, 1);
+			ResultSetMetaData meta = RS.getMetaData();
+			while (RS.next())
+			{
+				Map<String, Object> row = new HashMap<String, Object>();
+				for (int iCurr = 1; iCurr <= meta.getColumnCount(); iCurr++)
+				{
+					String sCol = meta.getColumnName(iCurr);
+					if (!_inProcessField.equals(sCol))
+						row.put(sCol, RS.getObject(iCurr));
+				}
+
+				oResults.add(row);
+			}
+		}
+		catch (Exception e)
+		{
+                    _logger.debug("Some triggers might not have been returned", e);
+		}
+                finally
+                {
+                    try
+                    {
+                        oConn.rollback() ;
+                    }
+                    catch (final SQLException sqle) {}
+                }
+                if (_logger.isDebugEnabled())
+                {
+                    _logger.debug("Returning " + oResults.size() + " rows.\n");
+                }
+		return oResults;
+	} // ________________________________
+
+	/**
+	 * Obtain a new database connection with parameter info
+	 * 
+	 * @return A new connection
+	 * @throws ConfigurationException -
+	 *             if problems are encountered
+	 */
+	protected JdbcCleanConn getDbConn()
+	{
+		if (null == _dbConn)
+		{
+			DataSource oDS = new SimpleDataSource(_driver, _url, _user,
+					_password);
+			_dbConn = new JdbcCleanConn(oDS);
+		}
+		return _dbConn;
+	} // ________________________________
+
+	/**
+	 * Assemble the SQL statement to scan (poll) the table
+	 * 
+	 * @return - The resulting SQL statement
+	 */
+	protected String scanStatement ()
+	{
+		StringBuilder sb = new StringBuilder().append("select ").append(
+				_selectFields).append(" from ").append(_tableName);
+
+		boolean bWhere = !Util.isNullString(_where);
+		if (bWhere) sb.append(" where ").append(_where);
+		sb.append((bWhere) ? " and " : " where ");
+
+		String sLike = _inProcessVals.substring(0, 1).toUpperCase();
+		sb.append(" upper(").append(_inProcessField).append(") like '").append(
+				sLike).append("%'");
+
+		if (!Util.isNullString(_orderBy))
+			sb.append(" order by ").append(_orderBy);
+		return sb.toString();
+	} // ________________________________
+
+	/**
+	 * Assemble the SQL statement to update the field in the "inProcessField"
+	 * parameter
+	 * 
+	 * in the table row uniquely identified by the list of fields in the
+	 * "keyFields" parameter
+	 * 
+	 * @return - The resulting SQL statement
+	 */
+	protected String updateStatement ()
+	{
+		StringBuilder sb = new StringBuilder().append("update ").append(
+				_tableName).append(" set ").append(_inProcessField).append(
+				" = ? where ").append(_inProcessField).append(" = ?");
+		for (String sCurr : _keys)
+		{
+			sb.append(" and ").append(sCurr).append(" = ?");
+		}
+		return sb.toString();
+	} // ________________________________
+
+	/**
+	 * Assemble the SQL "select for update" statement for the "inProcessField"
+	 * parameter
+	 * 
+	 * in the table row uniquely identified by the list of fields in the
+	 * "keyFields" parameter
+	 * 
+	 * @return - The resulting SQL statement
+	 */
+	protected String selectForUpdStatement ()
+	{
+		StringBuilder sb = new StringBuilder().append("select ").append(
+				_inProcessField).append(" from ").append(_tableName).append(
+				" where ");
+		int iCurr = 0;
+		for (String sCurr : _keys)
+		{
+			if (iCurr++ > 0) sb.append(" and ");
+			sb.append(sCurr).append(" = ?");
+		}
+		
+		/*
+		 * HS QL does not support FOR UPDATE! All tables appear to
+		 * be inherently updatable!
+		 */
+		
+		if (_driver.contains("hsqldb"))
+			return sb.toString();
+		else
+			return sb.append(" for update").toString();
+	} // ________________________________
+
+	/**
+	 * Assemble the SQL statement to delete the current row in the table row
+	 * uniquely identified by the list of fields in the "keyFields" parameter
+	 * 
+	 * @return - The resulting SQL statement
+	 */
+	protected String deleteStatement ()
+	{
+		StringBuilder sb = new StringBuilder().append("delete from ").append(
+				_tableName).append(" where ");
+		int iCurr = 0;
+		for (String sCurr : _keys)
+		{
+			if (iCurr++ > 0) sb.append(" and ");
+			sb.append(sCurr).append(" = ?");
+		}
+		return sb.toString();
+	} // ________________________________
+
+	/**
+	 * Try to delete 'current row' from polled table
+	 * 
+	 * @return true if row deletion was successful - false otherwise
+	 */
+	protected boolean deleteCurrentRow ()
+	{
+		try
+		{
+			int iParm = 1;
+			for (String sColName : _keys)
+                        {
+                                final String val = String.valueOf(_currentRow.get(sColName));
+				_PSdeleteRow.setString(iParm++, val);
+                        }
+
+			try
+			{
+				getDbConn().execUpdWait(_PSdeleteRow, 5);
+				getDbConn().commit();
+				return true;
+			}
+			catch (Exception e)
+			{
+				_logger.debug("Delete row has failed.  Rolling back!!", e);
+			}
+
+			try
+			{
+				getDbConn().rollback();
+			}
+			catch (Exception e)
+			{
+				_logger.debug("Unable to rollback delete row", e);
+			}
+		}
+		catch (Exception e)
+		{
+			_logger.debug("Unexpected exception.", e);
+		}
+		return false;
+	} // ________________________________
+
+	protected String getStatus (ROW_STATE p_oState)
+	{
+		int iPos = p_oState.ordinal();
+		return _inProcessVals.substring(iPos, ++iPos);
+	} // ________________________________
+
+	protected boolean changeStatusToWorking ()
+	{
+		return changeStatus(ROW_STATE.Pending, ROW_STATE.Working);
+	} // ________________________________
+
+	protected boolean changeStatusToDone ()
+	{
+		return changeStatus(ROW_STATE.Working, ROW_STATE.Done);
+	} // ________________________________
+
+	protected boolean changeStatusToError ()
+	{
+		return changeStatus(ROW_STATE.Working, ROW_STATE.Error);
+	} // ________________________________
+
+	protected boolean changeStatus (ROW_STATE fromState, ROW_STATE toState)
+	{
+		try
+		{
+			getDbConn();
+		}
+		catch (Exception e)
+		{
+			_logger.debug("Unable to get DB connection.", e);
+			throw new IllegalStateException("Unable to get DB connection.", e);
+		}
+
+		try
+		{
+			int iParm = 3;
+			for (String sColName : _keys)
+			{
+				Object oVal = String.valueOf(_currentRow.get(sColName));
+				_PSupdate.setObject(iParm++, oVal);
+			}
+
+			try
+			{
+                            _PSupdate.setString(1, getStatus(toState));
+                            _PSupdate.setString(2, getStatus(fromState));
+                            final int count = getDbConn().execUpdWait(_PSupdate, 5);
+                            if (count == 1)
+                            {
+                                getDbConn().commit();
+
+				if (_logger.isDebugEnabled())
+					_logger.debug("Successfully changed row state from " + fromState + " to " + toState + ".");
+
+				return true;
+                            }
+                            else
+                            {
+                                    _logger.warn("Cannot change row state from " + fromState + " to " + toState + ".  Number of rows in state " + fromState + " = " + count);
+                                    return false;
+                            }
+			}
+			catch (Exception e)
+			{
+                            final String message = "Row status change to " + toState + " has failed.  Rolling back!!" ;
+                            _logger.error(message);
+                            _logger.debug(message, e);
+			}
+
+			try
+			{
+				getDbConn().rollback();
+			}
+			catch (Exception e)
+			{
+                            final String message = "Unable to rollback row status change to " + fromState ;
+                            _logger.error(message) ;
+                            _logger.debug(message, e) ;
+			}
+		}
+		catch (Exception e)
+		{
+                    final String message = "Unexpected exception." ;
+                    _logger.error(message) ;
+                    _logger.debug(message, e) ;
+		}
+
+		return false;
+	} // ________________________________
+
+	/**
+	 * Default gateway action for SQL table rows <p/>It will just drop the
+	 * result set contents into a Message
+	 * 
+	 * @author <a
+	 *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+	 * @since Version 4.0
+	 * 
+	 */
+	public static class PackageRowContents
+	{
+		public Message process (Object obj)
+		{
+			if (!(obj instanceof Serializable))
+				throw new IllegalArgumentException("Object must be instance of Map");
+
+			Message message = MessageFactory.getInstance().getMessage();
+			org.jboss.soa.esb.message.Properties props = message
+					.getProperties();
+
+			props.setProperty(ListenerTagNames.SQL_ROW_DATA_TAG, obj);
+
+			return message;
+		}
+	} // ____________________________________________________
+
+	protected final static Logger _logger = Logger
+			.getLogger(SqlTableGatewayListener.class);
+
+	protected ConfigTree _config;
+
+	protected long _sleepBetweenPolls; // milliseconds
+
+	protected String _targetServiceCategory, _targetServiceName;
+
+	protected Collection<EPR> _targetEprs;
+
+	protected String _composerName;
+
+	protected Class _composerClass;
+
+	protected Object _composer;
+
+	protected Method _processMethod;
+
+	protected Courier _courier;
+
+	protected String _driver, _url, _user, _password;
+
+	protected String _tableName, _selectFields, _keyFields;
+
+	protected String _where, _orderBy;
+
+	protected String _inProcessField, _inProcessVals;
+
+	protected boolean _deleteAfterOK;
+
+	protected String[] _columns, _keys;
+
+	protected PreparedStatement _PSscan, _PSupdate, _PSdeleteRow;
+
+	protected JdbcCleanConn _dbConn;
+
+	protected Map<String, Object> _currentRow;
+
+	public static enum ROW_STATE
+	{
+		Pending, Working, Error, Done
+	}
+
+	public static final String DEFAULT_IN_PROCESS_STATES = "PWED";
+} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategy.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategy.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,170 +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.gateway.remotestrategies;
-
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.jboss.cache.CacheException;
-import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.FtpFileCache;
-import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.FtpFileCacheException;
-
-/**
- * Read-only implementation of {@link RemoteFileSystemStrategy}.
- * <p> 
- * An instance of this class can be used when a remote file system does
- * not support write operations.
- * </p>
- *  
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- *
- */
-public class ReadOnlyRemoteFileSystemStrategy implements RemoteFileSystemStrategy
-{
-	private Logger log = Logger .getLogger( ReadOnlyRemoteFileSystemStrategy.class );
-	
-	private FtpFileCache ftpFileCache;
-	
-	/**
-	 * Configures and starts the underlying FtpFileCache
-	 */
-	public void init( String configFile ) throws RemoteFileSystemStrategyException
-	{
-		try
-		{
-			ftpFileCache = new FtpFileCache( configFile );
-		
-			ftpFileCache.start();
-		}
-		catch ( FtpFileCacheException e )
-		{
-			throw new RemoteFileSystemStrategyException ( e );
-		}
-	}
-
-	/**
-	 * Do nothing
-	 * 
-	 * @param file		the file to delete. Ignored
-	 * @return true	always returns true without deleting the filee
-	 */
-	public boolean deleteFile( final File file ) throws RemoteFileSystemStrategyException
-	{
-		return true;
-	}
-
-	/**
-	 * Do nothing
-	 * 
-	 * @param from		the file to be renamed. Ignored
-	 * @param to		the new file. Ignored
-	 * @return true	always returns true without deleting the filee
-	 */
-	public boolean renameFile( final File from, final File to ) throws RemoteFileSystemStrategyException
-	{
-		return true;
-	}
-
-	/**
-	 * This method simply returns the file without a worksuffix. 
-	 * This is useful when the remote system does not allow one to rename the file.
-	 * 
-	 * @param file		the file to work with
-	 * @param suffix	the suffix. This will be ignored
-	 * @return File	the file untouched
-	 */
-	public File getWorkFileName( final File file, final String suffix )
-	{
-		return file;
-	}
-
-	/**
-	 * Returns a File[] that only contains files that have not previously 
-	 * been through this method.
-	 */
-	public File[] filterFileList( File[] files ) throws RemoteFileSystemStrategyException
-	{
-		if ( files == null )
-			return files;
-		
-		List<File> newFileList = new ArrayList<File>();
-		for ( File file : files )
-		{
-			String fileName = file.getName();
-			if ( !ftpFileCache.containsFile( fileName ) )
-			{
-				try
-				{
-					ftpFileCache.putFileName( fileName );
-					newFileList.add( file );
-				} 
-				catch (CacheException e)
-				{
-					log.error( "Exception while trying to put file : " + fileName + " into the cache", e);
-				}
-			}
-		}
-		
-		return newFileList.toArray( new File[]{} );
-	}
-	
-	public void removeAllData() throws CacheException
-	{
-		ftpFileCache.removeAll();
-	}
-
-	public void stop()
-	{
-		ftpFileCache.stop();
-	}
-	
-	public void destroy()
-	{
-		ftpFileCache.destroy();
-	}
-
-	public void setDeleteOnEviction()
-	{
-		ftpFileCache.setDeleteOnEviction();
-	}
-	
-	public Map getCacheListeners()
-	{
-		return ftpFileCache.getCacheListeners();
-	}
-
-	public void setCacheListener( Class cacheListenerClass ) throws RemoteFileSystemStrategyException 
-	{
-		try
-		{
-			ftpFileCache.setCacheListener( cacheListenerClass );
-		} 
-		catch (FtpFileCacheException e)
-		{
-			throw new RemoteFileSystemStrategyException( e );
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategy.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategy.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategy.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,170 @@
+/*
+ * 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.gateway.remotestrategies;
+
+import java.io.File;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.jboss.cache.CacheException;
+import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.FtpFileCache;
+import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.FtpFileCacheException;
+
+/**
+ * Read-only implementation of {@link RemoteFileSystemStrategy}.
+ * <p> 
+ * An instance of this class can be used when a remote file system does
+ * not support write operations.
+ * </p>
+ *  
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ *
+ */
+public class ReadOnlyRemoteFileSystemStrategy implements RemoteFileSystemStrategy
+{
+	private Logger log = Logger .getLogger( ReadOnlyRemoteFileSystemStrategy.class );
+	
+	private FtpFileCache ftpFileCache;
+	
+	/**
+	 * Configures and starts the underlying FtpFileCache
+	 */
+	public void init( String configFile ) throws RemoteFileSystemStrategyException
+	{
+		try
+		{
+			ftpFileCache = new FtpFileCache( configFile );
+		
+			ftpFileCache.start();
+		}
+		catch ( FtpFileCacheException e )
+		{
+			throw new RemoteFileSystemStrategyException ( e );
+		}
+	}
+
+	/**
+	 * Do nothing
+	 * 
+	 * @param file		the file to delete. Ignored
+	 * @return true	always returns true without deleting the filee
+	 */
+	public boolean deleteFile( final File file ) throws RemoteFileSystemStrategyException
+	{
+		return true;
+	}
+
+	/**
+	 * Do nothing
+	 * 
+	 * @param from		the file to be renamed. Ignored
+	 * @param to		the new file. Ignored
+	 * @return true	always returns true without deleting the filee
+	 */
+	public boolean renameFile( final File from, final File to ) throws RemoteFileSystemStrategyException
+	{
+		return true;
+	}
+
+	/**
+	 * This method simply returns the file without a worksuffix. 
+	 * This is useful when the remote system does not allow one to rename the file.
+	 * 
+	 * @param file		the file to work with
+	 * @param suffix	the suffix. This will be ignored
+	 * @return File	the file untouched
+	 */
+	public File getWorkFileName( final File file, final String suffix )
+	{
+		return file;
+	}
+
+	/**
+	 * Returns a File[] that only contains files that have not previously 
+	 * been through this method.
+	 */
+	public File[] filterFileList( File[] files ) throws RemoteFileSystemStrategyException
+	{
+		if ( files == null )
+			return files;
+		
+		List<File> newFileList = new ArrayList<File>();
+		for ( File file : files )
+		{
+			String fileName = file.getName();
+			if ( !ftpFileCache.containsFile( fileName ) )
+			{
+				try
+				{
+					ftpFileCache.putFileName( fileName );
+					newFileList.add( file );
+				} 
+				catch (CacheException e)
+				{
+					log.error( "Exception while trying to put file : " + fileName + " into the cache", e);
+				}
+			}
+		}
+		
+		return newFileList.toArray( new File[]{} );
+	}
+	
+	public void removeAllData() throws CacheException
+	{
+		ftpFileCache.removeAll();
+	}
+
+	public void stop()
+	{
+		ftpFileCache.stop();
+	}
+	
+	public void destroy()
+	{
+		ftpFileCache.destroy();
+	}
+
+	public void setDeleteOnEviction()
+	{
+		ftpFileCache.setDeleteOnEviction();
+	}
+	
+	public Map getCacheListeners()
+	{
+		return ftpFileCache.getCacheListeners();
+	}
+
+	public void setCacheListener( Class cacheListenerClass ) throws RemoteFileSystemStrategyException 
+	{
+		try
+		{
+			ftpFileCache.setCacheListener( cacheListenerClass );
+		} 
+		catch (FtpFileCacheException e)
+		{
+			throw new RemoteFileSystemStrategyException( e );
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategy.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategy.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,68 +0,0 @@
-package org.jboss.soa.esb.listeners.gateway.remotestrategies;
-
-import java.io.File;
-import org.jboss.soa.esb.listeners.gateway.GatewayException;
-
-/**
- * A strategy for handling remote write operations.
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- *
- */
-public interface RemoteFileSystemStrategy
-{
-	/**
-	 * Initialize this RemoteFileSystemStrategy
-	 * 
-	 * @param configFile
-	 * @throws Exception
-	 */
-	void init( String configFile ) throws RemoteFileSystemStrategyException;
-	
-	/**
-	 * filters the file array passed in. 
-	 * 
-	 * @return	File[]	list of files that should worked on
-	 * @throws GatewayException
-	 */
-	File[] filterFileList( File[] files ) throws RemoteFileSystemStrategyException;
-	
-	/**
-	 * 
-	 * @param file		the file to delete
-	 * @return true	if the file was sucessfully deleted
-	 * @throws GatewayException
-	 */
-	boolean deleteFile( File file ) throws RemoteFileSystemStrategyException;
-	
-	/**
-	 * 
-	 * @param from		the file to rename
-	 * @param to		the target file
-	 * @return true	if the file was sucessfully renamed
-	 * @throws GatewayException
-	 */
-	boolean renameFile( File from, File to ) throws RemoteFileSystemStrategyException;
-	
-	/**
-	 * 
-	 * @param file		the current file the system is working on
-	 * @param suffix	a suffix to append to the file.
-	 * @return	File	either the file with the appended suffix or 
-	 * 					without.This depends on the implementation.
-	 */
-	File getWorkFileName( File file, String suffix );
-	
-	/**
-	 * Stop of clean upp anything that needs to be perforemed 
-	 * upon shutdown.
-	 */
-	void stop();
-
-	/**
-	 * Clean upp anything that needs to be perforemed 
-	 * upon destruction.
-	 */
-	void destroy();
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategy.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategy.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategy.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,68 @@
+package org.jboss.soa.esb.listeners.gateway.remotestrategies;
+
+import java.io.File;
+import org.jboss.soa.esb.listeners.gateway.GatewayException;
+
+/**
+ * A strategy for handling remote write operations.
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ *
+ */
+public interface RemoteFileSystemStrategy
+{
+	/**
+	 * Initialize this RemoteFileSystemStrategy
+	 * 
+	 * @param configFile
+	 * @throws Exception
+	 */
+	void init( String configFile ) throws RemoteFileSystemStrategyException;
+	
+	/**
+	 * filters the file array passed in. 
+	 * 
+	 * @return	File[]	list of files that should worked on
+	 * @throws GatewayException
+	 */
+	File[] filterFileList( File[] files ) throws RemoteFileSystemStrategyException;
+	
+	/**
+	 * 
+	 * @param file		the file to delete
+	 * @return true	if the file was sucessfully deleted
+	 * @throws GatewayException
+	 */
+	boolean deleteFile( File file ) throws RemoteFileSystemStrategyException;
+	
+	/**
+	 * 
+	 * @param from		the file to rename
+	 * @param to		the target file
+	 * @return true	if the file was sucessfully renamed
+	 * @throws GatewayException
+	 */
+	boolean renameFile( File from, File to ) throws RemoteFileSystemStrategyException;
+	
+	/**
+	 * 
+	 * @param file		the current file the system is working on
+	 * @param suffix	a suffix to append to the file.
+	 * @return	File	either the file with the appended suffix or 
+	 * 					without.This depends on the implementation.
+	 */
+	File getWorkFileName( File file, String suffix );
+	
+	/**
+	 * Stop of clean upp anything that needs to be perforemed 
+	 * upon shutdown.
+	 */
+	void stop();
+
+	/**
+	 * Clean upp anything that needs to be perforemed 
+	 * upon destruction.
+	 */
+	void destroy();
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategyException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategyException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategyException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,57 +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.gateway.remotestrategies;
-
-/**
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- *
- */
-public class RemoteFileSystemStrategyException extends Exception
-{
-
-	public RemoteFileSystemStrategyException()
-	{
-		super();
-	}
-
-	public RemoteFileSystemStrategyException(String message, Throwable cause)
-	{
-		super( message, cause );
-	}
-
-	public RemoteFileSystemStrategyException(String message)
-	{
-		super( message );
-	}
-
-	public RemoteFileSystemStrategyException(Throwable cause)
-	{
-		super( cause );
-	}
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategyException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategyException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategyException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/RemoteFileSystemStrategyException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,57 @@
+/*
+ * 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.gateway.remotestrategies;
+
+/**
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ *
+ */
+public class RemoteFileSystemStrategyException extends Exception
+{
+
+	public RemoteFileSystemStrategyException()
+	{
+		super();
+	}
+
+	public RemoteFileSystemStrategyException(String message, Throwable cause)
+	{
+		super( message, cause );
+	}
+
+	public RemoteFileSystemStrategyException(String message)
+	{
+		super( message );
+	}
+
+	public RemoteFileSystemStrategyException(Throwable cause)
+	{
+		super( cause );
+	}
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
- * individual contributors as indicated by the @authors tag. See the
- * copyright.txt in the distribution for a full listing of individual
- * contributors.
- * 
- * This is free software; you can redistribute it and/or modify it under the
- * terms of the GNU Lesser General Public License as published by the Free
- * Software Foundation; either version 2.1 of the License, or (at your option)
- * any later version.
- * 
- * This software is distributed in the hope that it will be useful, but WITHOUT
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
- * details.
- * 
- * You should have received a copy of the GNU Lesser General Public License
- * along with this software; if not, write to the Free Software Foundation,
- * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
- * site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.listeners.gateway.remotestrategies.cache;
-
-import org.apache.log4j.Logger;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.TreeCache;
-import org.jboss.cache.TreeCacheListener;
-import org.jgroups.View;
-
-/**
- * This listener will upon node eviction events delete the 
- * node from the cache. 
- * <p> 
- * This listener should be used in combination with a cache loader <br>
- * so that it is possible to set an eviction policy and when nodes <br>
- * are evicted they are also deleted from the cache loaders store
- * </p>
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- *
- */
-public class DeleteOnEvictTreeCacheListener implements TreeCacheListener
-{
-	private Logger log = Logger .getLogger( DeleteOnEvictTreeCacheListener.class );
-	
-	private TreeCache treeCache;
-	
-	public DeleteOnEvictTreeCacheListener( final TreeCache treeCache ) 
-	{
-		if ( treeCache == null )
-			throw new IllegalArgumentException( "treeCache must not be null" );
-		
-		this.treeCache = treeCache;
-	}
-
-
-	/**
-	 * Will remove from the passed in fqn upon being
-	 * evicted from the cache.
-	 */
-	public void nodeEvicted( Fqn fqn ) 
-	{
-		try
-		{
-			treeCache.remove( fqn );
-			log.debug( "removed fqn : " + fqn );
-		} 
-		catch (CacheException e)
-		{
-			log.error( "Exception while trying to remove data for fqn : " + fqn , e );
-		}
-	}
-	
-	public void cacheStarted(TreeCache arg0) {}
-	public void cacheStopped(TreeCache arg0) {}
-	public void nodeCreated(Fqn arg0) {}
-	public void nodeLoaded(Fqn arg0) {}
-	public void nodeModified(Fqn arg0) {}
-	public void nodeRemoved(Fqn arg0) {}
-	public void nodeVisited(Fqn arg0) {}
-	public void viewChange(View arg0) {}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,84 @@
+/*
+ * 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.gateway.remotestrategies.cache;
+
+import org.apache.log4j.Logger;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.TreeCache;
+import org.jboss.cache.TreeCacheListener;
+import org.jgroups.View;
+
+/**
+ * This listener will upon node eviction events delete the 
+ * node from the cache. 
+ * <p> 
+ * This listener should be used in combination with a cache loader <br>
+ * so that it is possible to set an eviction policy and when nodes <br>
+ * are evicted they are also deleted from the cache loaders store
+ * </p>
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ *
+ */
+public class DeleteOnEvictTreeCacheListener implements TreeCacheListener
+{
+	private Logger log = Logger .getLogger( DeleteOnEvictTreeCacheListener.class );
+	
+	private TreeCache treeCache;
+	
+	public DeleteOnEvictTreeCacheListener( final TreeCache treeCache ) 
+	{
+		if ( treeCache == null )
+			throw new IllegalArgumentException( "treeCache must not be null" );
+		
+		this.treeCache = treeCache;
+	}
+
+
+	/**
+	 * Will remove from the passed in fqn upon being
+	 * evicted from the cache.
+	 */
+	public void nodeEvicted( Fqn fqn ) 
+	{
+		try
+		{
+			treeCache.remove( fqn );
+			log.debug( "removed fqn : " + fqn );
+		} 
+		catch (CacheException e)
+		{
+			log.error( "Exception while trying to remove data for fqn : " + fqn , e );
+		}
+	}
+	
+	public void cacheStarted(TreeCache arg0) {}
+	public void cacheStopped(TreeCache arg0) {}
+	public void nodeCreated(Fqn arg0) {}
+	public void nodeLoaded(Fqn arg0) {}
+	public void nodeModified(Fqn arg0) {}
+	public void nodeRemoved(Fqn arg0) {}
+	public void nodeVisited(Fqn arg0) {}
+	public void viewChange(View arg0) {}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCache.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCache.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCache.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,311 +0,0 @@
-package org.jboss.soa.esb.listeners.gateway.remotestrategies.cache;
-
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.IOException;
-import java.io.InputStream;
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.util.Map;
-
-import org.apache.log4j.Logger;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.PropertyConfigurator;
-import org.jboss.cache.TreeCache;
-import org.jboss.cache.TreeCacheListener;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * Implements a cache of file names which can be replicated in a cluster. 
- * 
- * See the <a href="http://labs.jboss.com/jbosscache">JBoss Cache</a> docs
- * for details on configuring the cache.
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- *
- */
-public class FtpFileCache
-{
-	@SuppressWarnings("unused")
-	private Logger log = Logger.getLogger( FtpFileCache.class );
-	
-	/**
-	 * Default configuration file for jboss cache. 
-	 * Used if no config is specified upon calling the constructor.
-	 * Note that this file must then exist on the classpath
-	 */
-	private static final String DEFAULT_CONFIG_FILE = "/ftpfile-cache-config.xml";
-	/**
-	 * The fqn to use.
-	 */
-	private String fqn = "/ftp/cache/";
-	/**
-	 * The configuration file used to configure the tree cache
-	 */
-	private String config;
-	/**
-	 * The JBoss TreeCache instance
-	 */
-	private TreeCache treeCache;
-	
-	/**
-	 * 
-	 * @param config	either an absolute path of a relative path
-	 * @throws Exception
-	 */
-	public FtpFileCache ( String config ) throws FtpFileCacheException
-	{
-		if ( config == null )
-			config = DEFAULT_CONFIG_FILE;
-		
-		this.config = config;
-		
-		InputStream in = null;
-		try
-		{
-			treeCache = new TreeCache();
-			in = getConfigInputStream( this.config );
-			PropertyConfigurator configurator = new PropertyConfigurator();
-			configurator.configure( treeCache, in );
-		}
-		catch ( Exception e )
-		{
-			log.error( e );
-			throw new FtpFileCacheException ( e );
-		}
-		finally
-		{
-			close( in );
-		}
-			
-		
-	}
-	
-	/**
-	 * Gets an input stream from the specified path.
-	 * 
-	 * If the path denotes a file on the filesystem, that file
-	 * will be used. 
-	 * If a file is not found in the filesystem, this method will look 
-	 * for the file on the classpath.
-	 * 
-	 * @param path			the path to the JBossCache configuration file
-	 * @return InputStream	the inputstream for the passed-in path	
-	 */
-	protected InputStream getConfigInputStream( final String path ) 
-	{
-		InputStream in = null;
-		File configFile = new File( path );
-		if ( configFile.exists() )
-		{
-			log.debug("Reading jboss cache configuration from : " + path );
-			
-			try 
-			{
-				in =  new FileInputStream ( path );
-			} 
-			catch (FileNotFoundException e) 
-			{
-				log.error( e );
-			}
-		}
-		else
-		{
-			log.debug("Reading jgroups configuration classpath : " + path );
-			in = ClassUtil.getResourceAsStream( path, getClass() );
-		}
-		return in;
-	}
-
-	/**
-	 * Start the cache
-	 * @throws Exception
-	 */
-	public void start() throws FtpFileCacheException
-	{
-		try
-		{
-			treeCache.startService();
-		} 
-		catch (Exception e)
-		{
-			log.error( e );
-			throw new FtpFileCacheException( e );
-		}
-	}
-	
-	/**
-	 * Stops the cache
-	 *
-	 */
-	public void stop()
-	{
-		treeCache.stopService();
-	}
-
-	/**
-	 * Will add the filename to the cache.
-	 * 
-	 * @param fileName
-	 * @throws CacheException 
-	 */
-	public void putFileName( final String fileName) throws CacheException
-	{
-		treeCache.put ( fqn, fileName, fileName );
-	}
-
-	/**
-	 * Will get the filename if it exists in the cache.
-	 * 
-	 * @param fileName
-	 * @throws CacheException
-	 */
-	public Object getFileName( final String fileName) throws CacheException
-	{
-		return treeCache.get ( fqn, fileName );
-	}
-	
-	/**
-	 * Removed the fileName from the cache if it exist there
-	 * 
-	 * @param fileName
-	 * @return Object			the value of the removed object
-	 * @throws CacheException
-	 */
-	public Object deleteFile( final String fileName ) throws CacheException
-	{
-		return treeCache.remove( fqn, fileName );
-	}
-	
-	/**
-	 * Checks to see if the filename exists in the cache
-	 * 
-	 * @param fileName	the filename to look for
-	 * @return true	if the file exists in the cache
-	 */
-	public boolean containsFile( final String fileName )
-	{
-		return treeCache.exists(  fqn, fileName );
-	}
-	
-	/**
-	 * Gets the a string of all files in the cache
-	 * @return String
-	 */
-	public String getCache()
-	{
-		return treeCache.print( fqn );
-	}
-
-	public String getFqn()
-	{
-		return fqn;
-	}
-
-	public void setFqn(String fqn)
-	{
-		this.fqn = fqn;
-	}
-
-	public String getConfigFile( )
-	{
-		return config;
-	}
-
-	/**
-	 * Removes all data under the fqn, but not the fqn 
-	 * itself
-	 * 
-	 * @throws CacheException
-	 */
-	public void removeAll() throws CacheException
-	{
-		treeCache.removeData( fqn );
-	}
-	
-	public void setDeleteOnEviction()
-	{
-		treeCache.addTreeCacheListener( new DeleteOnEvictTreeCacheListener( treeCache) );
-	}
-	
-	public void addCacheListener( final TreeCacheListener listener )
-	{
-		if ( listener != null )
-			treeCache.addTreeCacheListener( listener );
-	}
-	
-	public Map getCacheListeners()
-	{
-		return treeCache.getTreeCacheListeners();
-	}
-	
-	public void setCacheListener( final Class cacheListenerClass ) throws FtpFileCacheException
-	{
-		if ( cacheListenerClass == null )
-			return;
-		try
-		{
-			Constructor constructor = cacheListenerClass.getConstructor( TreeCache.class );
-			Object object = constructor.newInstance( treeCache );
-			if ( object instanceof TreeCacheListener )
-			{
-				TreeCacheListener listener = ( TreeCacheListener ) object;
-				treeCache.addTreeCacheListener( listener );
-			}
-		} 
-		catch (SecurityException e)
-		{
-			throw createFtpFileCacheException( "SecurityException while trying set the CacheListener:",  e );
-		} 
-		catch (NoSuchMethodException e)
-		{
-			throw createFtpFileCacheException( "NoSuchMethodException while trying set the CacheListener:",  e );
-		} 
-		catch (IllegalArgumentException e)
-		{
-			throw createFtpFileCacheException( "IllegalArgumentException while trying set the CacheListener:",  e );
-		} 
-		catch (InstantiationException e)
-		{
-			throw createFtpFileCacheException( "InstantiationException while trying set the CacheListener:",  e );
-		} 
-		catch (IllegalAccessException e)
-		{
-			throw createFtpFileCacheException( "IllegalAccessException while trying set the CacheListener:",  e );
-		} 
-		catch (InvocationTargetException e)
-		{
-			throw createFtpFileCacheException( "InvocationTargetException while trying set the CacheListener:",  e );
-		}
-	}
-	
-	private FtpFileCacheException createFtpFileCacheException( final String msg,  Exception e )
-	{
-		log.error( msg, e );
-		return new FtpFileCacheException( e );
-	}
-	
-	private void close( Closeable c )
-	{
-		if ( c == null )
-			return;
-		
-		try
-		{
-			c.close();
-		}
-		catch ( IOException e )
-		{
-			log.warn( "Error while trying to close Closable", e);
-		}
-	}
-
-	public void destroy()
-	{
-		log.info( "destroy method of FtpFileCache called" );
-		treeCache.destroy();
-	}
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCache.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCache.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCache.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCache.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,311 @@
+package org.jboss.soa.esb.listeners.gateway.remotestrategies.cache;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.InputStream;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.PropertyConfigurator;
+import org.jboss.cache.TreeCache;
+import org.jboss.cache.TreeCacheListener;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Implements a cache of file names which can be replicated in a cluster. 
+ * 
+ * See the <a href="http://labs.jboss.com/jbosscache">JBoss Cache</a> docs
+ * for details on configuring the cache.
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ *
+ */
+public class FtpFileCache
+{
+	@SuppressWarnings("unused")
+	private Logger log = Logger.getLogger( FtpFileCache.class );
+	
+	/**
+	 * Default configuration file for jboss cache. 
+	 * Used if no config is specified upon calling the constructor.
+	 * Note that this file must then exist on the classpath
+	 */
+	private static final String DEFAULT_CONFIG_FILE = "/ftpfile-cache-config.xml";
+	/**
+	 * The fqn to use.
+	 */
+	private String fqn = "/ftp/cache/";
+	/**
+	 * The configuration file used to configure the tree cache
+	 */
+	private String config;
+	/**
+	 * The JBoss TreeCache instance
+	 */
+	private TreeCache treeCache;
+	
+	/**
+	 * 
+	 * @param config	either an absolute path of a relative path
+	 * @throws Exception
+	 */
+	public FtpFileCache ( String config ) throws FtpFileCacheException
+	{
+		if ( config == null )
+			config = DEFAULT_CONFIG_FILE;
+		
+		this.config = config;
+		
+		InputStream in = null;
+		try
+		{
+			treeCache = new TreeCache();
+			in = getConfigInputStream( this.config );
+			PropertyConfigurator configurator = new PropertyConfigurator();
+			configurator.configure( treeCache, in );
+		}
+		catch ( Exception e )
+		{
+			log.error( e );
+			throw new FtpFileCacheException ( e );
+		}
+		finally
+		{
+			close( in );
+		}
+			
+		
+	}
+	
+	/**
+	 * Gets an input stream from the specified path.
+	 * 
+	 * If the path denotes a file on the filesystem, that file
+	 * will be used. 
+	 * If a file is not found in the filesystem, this method will look 
+	 * for the file on the classpath.
+	 * 
+	 * @param path			the path to the JBossCache configuration file
+	 * @return InputStream	the inputstream for the passed-in path	
+	 */
+	protected InputStream getConfigInputStream( final String path ) 
+	{
+		InputStream in = null;
+		File configFile = new File( path );
+		if ( configFile.exists() )
+		{
+			log.debug("Reading jboss cache configuration from : " + path );
+			
+			try 
+			{
+				in =  new FileInputStream ( path );
+			} 
+			catch (FileNotFoundException e) 
+			{
+				log.error( e );
+			}
+		}
+		else
+		{
+			log.debug("Reading jgroups configuration classpath : " + path );
+			in = ClassUtil.getResourceAsStream( path, getClass() );
+		}
+		return in;
+	}
+
+	/**
+	 * Start the cache
+	 * @throws Exception
+	 */
+	public void start() throws FtpFileCacheException
+	{
+		try
+		{
+			treeCache.startService();
+		} 
+		catch (Exception e)
+		{
+			log.error( e );
+			throw new FtpFileCacheException( e );
+		}
+	}
+	
+	/**
+	 * Stops the cache
+	 *
+	 */
+	public void stop()
+	{
+		treeCache.stopService();
+	}
+
+	/**
+	 * Will add the filename to the cache.
+	 * 
+	 * @param fileName
+	 * @throws CacheException 
+	 */
+	public void putFileName( final String fileName) throws CacheException
+	{
+		treeCache.put ( fqn, fileName, fileName );
+	}
+
+	/**
+	 * Will get the filename if it exists in the cache.
+	 * 
+	 * @param fileName
+	 * @throws CacheException
+	 */
+	public Object getFileName( final String fileName) throws CacheException
+	{
+		return treeCache.get ( fqn, fileName );
+	}
+	
+	/**
+	 * Removed the fileName from the cache if it exist there
+	 * 
+	 * @param fileName
+	 * @return Object			the value of the removed object
+	 * @throws CacheException
+	 */
+	public Object deleteFile( final String fileName ) throws CacheException
+	{
+		return treeCache.remove( fqn, fileName );
+	}
+	
+	/**
+	 * Checks to see if the filename exists in the cache
+	 * 
+	 * @param fileName	the filename to look for
+	 * @return true	if the file exists in the cache
+	 */
+	public boolean containsFile( final String fileName )
+	{
+		return treeCache.exists(  fqn, fileName );
+	}
+	
+	/**
+	 * Gets the a string of all files in the cache
+	 * @return String
+	 */
+	public String getCache()
+	{
+		return treeCache.print( fqn );
+	}
+
+	public String getFqn()
+	{
+		return fqn;
+	}
+
+	public void setFqn(String fqn)
+	{
+		this.fqn = fqn;
+	}
+
+	public String getConfigFile( )
+	{
+		return config;
+	}
+
+	/**
+	 * Removes all data under the fqn, but not the fqn 
+	 * itself
+	 * 
+	 * @throws CacheException
+	 */
+	public void removeAll() throws CacheException
+	{
+		treeCache.removeData( fqn );
+	}
+	
+	public void setDeleteOnEviction()
+	{
+		treeCache.addTreeCacheListener( new DeleteOnEvictTreeCacheListener( treeCache) );
+	}
+	
+	public void addCacheListener( final TreeCacheListener listener )
+	{
+		if ( listener != null )
+			treeCache.addTreeCacheListener( listener );
+	}
+	
+	public Map getCacheListeners()
+	{
+		return treeCache.getTreeCacheListeners();
+	}
+	
+	public void setCacheListener( final Class cacheListenerClass ) throws FtpFileCacheException
+	{
+		if ( cacheListenerClass == null )
+			return;
+		try
+		{
+			Constructor constructor = cacheListenerClass.getConstructor( TreeCache.class );
+			Object object = constructor.newInstance( treeCache );
+			if ( object instanceof TreeCacheListener )
+			{
+				TreeCacheListener listener = ( TreeCacheListener ) object;
+				treeCache.addTreeCacheListener( listener );
+			}
+		} 
+		catch (SecurityException e)
+		{
+			throw createFtpFileCacheException( "SecurityException while trying set the CacheListener:",  e );
+		} 
+		catch (NoSuchMethodException e)
+		{
+			throw createFtpFileCacheException( "NoSuchMethodException while trying set the CacheListener:",  e );
+		} 
+		catch (IllegalArgumentException e)
+		{
+			throw createFtpFileCacheException( "IllegalArgumentException while trying set the CacheListener:",  e );
+		} 
+		catch (InstantiationException e)
+		{
+			throw createFtpFileCacheException( "InstantiationException while trying set the CacheListener:",  e );
+		} 
+		catch (IllegalAccessException e)
+		{
+			throw createFtpFileCacheException( "IllegalAccessException while trying set the CacheListener:",  e );
+		} 
+		catch (InvocationTargetException e)
+		{
+			throw createFtpFileCacheException( "InvocationTargetException while trying set the CacheListener:",  e );
+		}
+	}
+	
+	private FtpFileCacheException createFtpFileCacheException( final String msg,  Exception e )
+	{
+		log.error( msg, e );
+		return new FtpFileCacheException( e );
+	}
+	
+	private void close( Closeable c )
+	{
+		if ( c == null )
+			return;
+		
+		try
+		{
+			c.close();
+		}
+		catch ( IOException e )
+		{
+			log.warn( "Error while trying to close Closable", e);
+		}
+	}
+
+	public void destroy()
+	{
+		log.info( "destroy method of FtpFileCache called" );
+		treeCache.destroy();
+	}
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,57 +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.gateway.remotestrategies.cache;
-
-/**
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- *
- */
-public class FtpFileCacheException extends Exception
-{
-
-	public FtpFileCacheException()
-	{
-		super();
-	}
-
-	public FtpFileCacheException(String message, Throwable cause)
-	{
-		super( message, cause );
-	}
-
-	public FtpFileCacheException(String message)
-	{
-		super( message );
-	}
-
-	public FtpFileCacheException(Throwable cause)
-	{
-		super( cause );
-	}
-
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,57 @@
+/*
+ * 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.gateway.remotestrategies.cache;
+
+/**
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ *
+ */
+public class FtpFileCacheException extends Exception
+{
+
+	public FtpFileCacheException()
+	{
+		super();
+	}
+
+	public FtpFileCacheException(String message, Throwable cause)
+	{
+		super( message, cause );
+	}
+
+	public FtpFileCacheException(String message)
+	{
+		super( message );
+	}
+
+	public FtpFileCacheException(Throwable cause)
+	{
+		super( cause );
+	}
+
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts/MessageInjectionConsole.groovy
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts/MessageInjectionConsole.groovy	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts/MessageInjectionConsole.groovy	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,70 +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, JBoss Inc.
- */
-import groovy.swing.SwingBuilder
-import java.awt.*
-
-/**
- * Simple Groovy Gateway script that starts a Swing form through which you can
- * inject messages into the target service.  Useful for testing and prototyping.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-
-def targetService = "Target Service: " + deliveryAdapter.getDeliveryAdapter().getServiceCategory() + ":" + deliveryAdapter.getDeliveryAdapter().getServiceName()
-def numRows = 7
-def numCols = 50
-
-swing = new SwingBuilder()
-sendMessage = swing.action(name:'SendMessage', closure:this.&sendMessageToTarget, mnemonic:'R')
-
-frame = swing.frame(title:'Message Injection Console', size:[600,400], location:[200,200]) {
-    panel(layout:new BorderLayout()) {
-        panel(layout:new BorderLayout(), constraints: BorderLayout.NORTH) {
-            label(text: targetService, constraints: BorderLayout.NORTH)
-            label(text: 'Message In:', constraints: BorderLayout.WEST)
-            textArea(id:'messageInTB', columns: numCols, rows: numRows, constraints: BorderLayout.EAST)
-        }
-        panel(layout:new FlowLayout()) {
-            button(text: 'Send Message', action:sendMessage)
-	    comboBox(id: 'synchasync', items:["Asynchronous", "Synchronous"], selectedIndex:0);
-        }
-        panel(layout:new BorderLayout(), constraints: BorderLayout.SOUTH) {
-            label(text: 'Message Out:', constraints: BorderLayout.WEST)
-            textArea(id: 'messageOutTB', columns: numCols, rows: numRows, constraints: BorderLayout.EAST)
-        }
-    }
-}
-frame.pack()
-frame.show()
-
-def sendMessageToTarget(event) {
-    swing.messageOutTB.text = ""
-    if(swing.synchasync.selectedIndex == 0) {
-	    deliveryAdapter.deliverAsync(swing.messageInTB.text)
-    } else {
-	    swing.messageOutTB.text = deliveryAdapter.deliverSync(swing.messageInTB.text, 20000)
-    }
-}
-
-// Wait until the gateway is told to shutdown....
-while(!gateway.waitUntilStopping(500)) {
-}
-
-frame.dispose()
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts/MessageInjectionConsole.groovy (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts/MessageInjectionConsole.groovy)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts/MessageInjectionConsole.groovy	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/gateway/scripts/MessageInjectionConsole.groovy	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,70 @@
+/*
+ * 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, JBoss Inc.
+ */
+import groovy.swing.SwingBuilder
+import java.awt.*
+
+/**
+ * Simple Groovy Gateway script that starts a Swing form through which you can
+ * inject messages into the target service.  Useful for testing and prototyping.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+
+def targetService = "Target Service: " + deliveryAdapter.getDeliveryAdapter().getServiceCategory() + ":" + deliveryAdapter.getDeliveryAdapter().getServiceName()
+def numRows = 7
+def numCols = 50
+
+swing = new SwingBuilder()
+sendMessage = swing.action(name:'SendMessage', closure:this.&sendMessageToTarget, mnemonic:'R')
+
+frame = swing.frame(title:'Message Injection Console', size:[600,400], location:[200,200]) {
+    panel(layout:new BorderLayout()) {
+        panel(layout:new BorderLayout(), constraints: BorderLayout.NORTH) {
+            label(text: targetService, constraints: BorderLayout.NORTH)
+            label(text: 'Message In:', constraints: BorderLayout.WEST)
+            textArea(id:'messageInTB', columns: numCols, rows: numRows, constraints: BorderLayout.EAST)
+        }
+        panel(layout:new FlowLayout()) {
+            button(text: 'Send Message', action:sendMessage)
+	    comboBox(id: 'synchasync', items:["Asynchronous", "Synchronous"], selectedIndex:0);
+        }
+        panel(layout:new BorderLayout(), constraints: BorderLayout.SOUTH) {
+            label(text: 'Message Out:', constraints: BorderLayout.WEST)
+            textArea(id: 'messageOutTB', columns: numCols, rows: numRows, constraints: BorderLayout.EAST)
+        }
+    }
+}
+frame.pack()
+frame.show()
+
+def sendMessageToTarget(event) {
+    swing.messageOutTB.text = ""
+    if(swing.synchasync.selectedIndex == 0) {
+	    deliveryAdapter.deliverAsync(swing.messageInTB.text)
+    } else {
+	    swing.messageOutTB.text = deliveryAdapter.deliverSync(swing.messageInTB.text, 20000)
+    }
+}
+
+// Wait until the gateway is told to shutdown....
+while(!gateway.waitUntilStopping(500)) {
+}
+
+frame.dispose()
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,47 +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.jca;
-
-import java.util.Map;
-
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-
-/**
- * Bridges different vendor JCA implementations to activate an endpoint
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public interface ActivationBridge
-{
-   void setAdapter(String adapter);
-
-   void setMessagingTypeClass(Class messagingTypeClass);
-
-   void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory);
-
-   void setActivationProperties(Map<String, String> activationProperties);
-
-   void activate();
-
-   void deactivate();
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/ActivationBridge.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,47 @@
+/*
+* 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.jca;
+
+import java.util.Map;
+
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+
+/**
+ * Bridges different vendor JCA implementations to activate an endpoint
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface ActivationBridge
+{
+   void setAdapter(String adapter);
+
+   void setMessagingTypeClass(Class messagingTypeClass);
+
+   void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory);
+
+   void setActivationProperties(Map<String, String> activationProperties);
+
+   void activate();
+
+   void deactivate();
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.jca;
-
-import java.lang.reflect.Method;
-
-/**
- * Contract between JCA and endpoint.  Instances of this object are used by the message endpoint factory and endopint proxy
- * to obtain whether delivery is transacted and to invoke on the actual endpoint bean
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public interface EndpointContainer
-{
-   /**
-    * description used for logging and tracing
-    */
-   public String getDescription();
-
-   public Object invoke(Method method, Object[] args) throws Throwable;
-
-   public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException;
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointContainer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,44 @@
+/*
+* 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.jca;
+
+import java.lang.reflect.Method;
+
+/**
+ * Contract between JCA and endpoint.  Instances of this object are used by the message endpoint factory and endopint proxy
+ * to obtain whether delivery is transacted and to invoke on the actual endpoint bean
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface EndpointContainer
+{
+   /**
+    * description used for logging and tracing
+    */
+   public String getDescription();
+
+   public Object invoke(Method method, Object[] args) throws Throwable;
+
+   public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException;
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,108 +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.jca;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-
-import javax.resource.spi.UnavailableException;
-import javax.resource.spi.endpoint.MessageEndpoint;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.transaction.xa.XAResource;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class EndpointFactory implements MessageEndpointFactory
-{
-   private EndpointContainer container;
-   private Class messagingType;
-   private ClassLoader loader;
-
-   private Constructor proxyConstructor;
-
-
-   public EndpointContainer getContainer()
-   {
-      return container;
-   }
-
-   public void setContainer(EndpointContainer container)
-   {
-      this.container = container;
-   }
-
-
-   public void setMessagingType(Class messagingType)
-   {
-      this.messagingType = messagingType;
-   }
-
-   public void setLoader(ClassLoader loader)
-   {
-      this.loader = loader;
-   }
-
-   public void start()
-   {
-      Class[] interfaces = {messagingType, MessageEndpoint.class};
-      Class proxyClass = Proxy.getProxyClass(loader, interfaces);
-      final Class[] constructorParams = {InvocationHandler.class};
-      try
-      {
-         proxyConstructor = proxyClass.getConstructor(constructorParams);
-      }
-      catch (NoSuchMethodException e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-
-   public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException
-   {
-      EndpointProxy proxy = new EndpointProxy();
-      proxy.setXaResource(xaResource);
-      proxy.setMessageEndpointFactory(this);
-      proxy.setContainer(container);
-      proxy.setLoader(loader);
-      Object[] args = {proxy};
-      try
-      {
-         return (MessageEndpoint) proxyConstructor.newInstance(args);
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-         return null;
-      }
-   }
-
-   public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException
-   {
-      return container.isDeliveryTransacted(method);
-   }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,108 @@
+/*
+* 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.jca;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+
+import javax.resource.spi.UnavailableException;
+import javax.resource.spi.endpoint.MessageEndpoint;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.transaction.xa.XAResource;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class EndpointFactory implements MessageEndpointFactory
+{
+   private EndpointContainer container;
+   private Class messagingType;
+   private ClassLoader loader;
+
+   private Constructor proxyConstructor;
+
+
+   public EndpointContainer getContainer()
+   {
+      return container;
+   }
+
+   public void setContainer(EndpointContainer container)
+   {
+      this.container = container;
+   }
+
+
+   public void setMessagingType(Class messagingType)
+   {
+      this.messagingType = messagingType;
+   }
+
+   public void setLoader(ClassLoader loader)
+   {
+      this.loader = loader;
+   }
+
+   public void start()
+   {
+      Class[] interfaces = {messagingType, MessageEndpoint.class};
+      Class proxyClass = Proxy.getProxyClass(loader, interfaces);
+      final Class[] constructorParams = {InvocationHandler.class};
+      try
+      {
+         proxyConstructor = proxyClass.getConstructor(constructorParams);
+      }
+      catch (NoSuchMethodException e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+
+   public MessageEndpoint createEndpoint(XAResource xaResource) throws UnavailableException
+   {
+      EndpointProxy proxy = new EndpointProxy();
+      proxy.setXaResource(xaResource);
+      proxy.setMessageEndpointFactory(this);
+      proxy.setContainer(container);
+      proxy.setLoader(loader);
+      Object[] args = {proxy};
+      try
+      {
+         return (MessageEndpoint) proxyConstructor.newInstance(args);
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+         return null;
+      }
+   }
+
+   public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException
+   {
+      return container.isDeliveryTransacted(method);
+   }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,440 +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.jca;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-
-import javax.resource.ResourceException;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-import javax.transaction.Status;
-import javax.transaction.Transaction;
-import javax.transaction.TransactionManager;
-import javax.transaction.xa.XAResource;
-
-import org.jboss.logging.Logger;
-import org.jboss.tm.TransactionManagerLocator;
-
-import EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class EndpointProxy implements InvocationHandler
-{
-   private static final Logger log = Logger.getLogger(EndpointProxy.class);
-
-   /**
-    * Whether trace is enabled
-    */
-   private boolean trace = log.isTraceEnabled();
-
-   /**
-    * Whether this proxy has been released
-    */
-   protected SynchronizedBoolean released = new SynchronizedBoolean(false);
-
-   /**
-    * Whether we have delivered a message
-    */
-   protected boolean delivered = false;
-
-   /**
-    * The in use thread
-    */
-   protected Thread inUseThread = null;
-
-   /**
-    * The old classloader of the thread
-    */
-   protected ClassLoader oldClassLoader = null;
-
-   /**
-    * Any transaction we started
-    */
-   protected Transaction transaction = null;
-
-   /**
-    * Any suspended transaction
-    */
-   protected Transaction suspended = null;
-
-   protected ClassLoader loader;
-
-   private XAResource resource;
-   private MessageEndpointFactory messageEndpointFactory;
-   private EndpointContainer container;
-
-
-   public void setContainer(EndpointContainer container)
-   {
-      this.container = container;
-   }
-
-   public void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory)
-   {
-      this.messageEndpointFactory = messageEndpointFactory;
-   }
-
-   public void setXaResource(XAResource resource)
-   {
-      this.resource = resource;
-   }
-
-
-   public void setLoader(ClassLoader loader)
-   {
-      this.loader = loader;
-   }
-
-   public Object invoke(Object proxy, Method method, Object[] args)
-           throws Throwable
-   {
-      // Are we still useable?
-      if (released.get())
-         throw new IllegalStateException("This message endpoint + " + getProxyString(proxy) + " has been released");
-
-      // Concurrent invocation?
-      Thread currentThread = Thread.currentThread();
-      if (inUseThread != null && inUseThread.equals(currentThread) == false)
-         throw new IllegalStateException("This message endpoint + " + getProxyString(proxy) + " is already in use by another thread " + inUseThread);
-      inUseThread = currentThread;
-
-      if (trace)
-         log.trace("MessageEndpoint " + getProxyString(proxy) + " in use by " + method + " " + inUseThread);
-
-      // Which operation?
-      if (method.getName().equals("release"))
-      {
-         release(proxy);
-         return null;
-      }
-      else if (method.getName().equals("beforeDelivery"))
-      {
-         before(proxy, method, args);
-         return null;
-      }
-      else if (method.getName().equals("afterDelivery"))
-      {
-         after(proxy);
-         return null;
-      }
-      else
-         return delivery(proxy, method, args);
-   }
-
-   // -----------------------------------------------------------
-
-   protected void release(Object proxy) throws Throwable
-   {
-      // We are now released
-      released.set(true);
-
-      if (trace)
-         log.trace("MessageEndpoint " + getProxyString(proxy) + " released");
-
-      // Tidyup any outstanding delivery
-      if (oldClassLoader != null)
-      {
-         try
-         {
-            finish("release", proxy, false);
-         }
-         catch (Throwable t)
-         {
-            log.warn("Error in release ", t);
-         }
-      }
-   }
-
-   protected void before(Object proxy, Method method, Object[] args) throws Throwable
-   {
-      // Called out of sequence
-      if (oldClassLoader != null)
-         throw new IllegalStateException("Missing afterDelivery from the previous beforeDelivery for message endpoint " + getProxyString(proxy));
-
-      if (trace)
-         log.trace("MessageEndpoint " + getProxyString(proxy) + " released");
-
-      // Set the classloader
-      oldClassLoader = inUseThread.getContextClassLoader();
-      inUseThread.setContextClassLoader(loader);
-      if (trace)
-         log.trace("MessageEndpoint " + getProxyString(proxy) + " set context classloader to " + loader);
-
-      // start any transaction
-      try
-      {
-         // Is the delivery transacted?
-         Method beforeMethod = (Method) args[0];
-         boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(beforeMethod);
-
-         startTransaction("beforeDelivery", proxy, method, args, isTransacted);
-      }
-      catch (Throwable t)
-      {
-         resetContextClassLoader(proxy);
-         throw new ResourceException(t);
-      }
-   }
-
-   protected void after(Object proxy) throws Throwable
-   {
-      // Called out of sequence
-      if (oldClassLoader == null)
-         throw new IllegalStateException("afterDelivery without a previous beforeDelivery for message endpoint " + getProxyString(proxy));
-
-      // Finish this delivery committing if we can
-      try
-      {
-         finish("afterDelivery", proxy, true);
-      }
-      catch (Throwable t)
-      {
-         throw new ResourceException(t);
-      }
-   }
-
-   protected Object delivery(Object proxy, Method method, Object[] args) throws Throwable
-   {
-      // Have we already delivered a message?
-      if (delivered)
-         throw new IllegalStateException("Multiple message delivery between before and after delivery is not allowed for message endpoint " + getProxyString(proxy));
-
-      if (trace)
-         log.trace("MessageEndpoint " + getProxyString(proxy) + " delivering");
-
-      // Mark delivery if beforeDelivery was invoked
-      if (oldClassLoader != null)
-         delivered = true;
-
-      boolean commit = true;
-      try
-      {
-         // Check for starting a transaction
-         if (oldClassLoader == null)
-         {
-            boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(method);
-            startTransaction("delivery", proxy, method, args, isTransacted);
-         }
-         return container.invoke(method, args);
-      }
-      catch (Throwable t)
-      {
-         if (trace)
-            log.trace("MessageEndpoint " + getProxyString(proxy) + " delivery error", t);
-         if (t instanceof Error || t instanceof RuntimeException)
-         {
-            if (transaction != null)
-               transaction.setRollbackOnly();
-            commit = false;
-         }
-         throw t;
-      }
-      finally
-      {
-         // No before/after delivery, end any transaction and release the lock
-         if (oldClassLoader == null)
-         {
-            try
-            {
-               // Finish any transaction we started
-               endTransaction(proxy, commit);
-            }
-            finally
-            {
-               releaseThreadLock(proxy);
-            }
-         }
-      }
-   }
-
-   protected void finish(String context, Object proxy, boolean commit) throws Throwable
-   {
-      try
-      {
-         endTransaction(proxy, commit);
-      }
-      finally
-      {
-         // Reset delivered flag
-         delivered = false;
-         // Change back to the original context classloader
-         resetContextClassLoader(proxy);
-         // We no longer hold the lock
-         releaseThreadLock(proxy);
-      }
-   }
-
-   protected void startTransaction(String context, Object proxy, Method m, Object[] args, boolean isTransacted) throws Throwable
-   {
-      Method method;
-
-      // Normal delivery
-      if ("delivery".equals(context))
-         method = m;
-         // Before delivery
-      else
-         method = (Method) args[0];
-
-      if (trace)
-         log.trace("MessageEndpoint " + getProxyString(proxy) + " " + context + " method=" + method + " xaResource=" + resource + " transacted=" + isTransacted);
-
-      // Get the transaction status
-      TransactionManager tm = TransactionManagerLocator.getInstance().locate();
-      suspended = tm.suspend();
-
-      if (trace)
-         log.trace("MessageEndpoint " + getProxyString(proxy) + " " + context + " currentTx=" + suspended);
-
-      // Delivery is transacted
-      if (isTransacted)
-      {
-         // No transaction means we start a new transaction and enlist the resource
-         if (suspended == null)
-         {
-            tm.begin();
-            transaction = tm.getTransaction();
-            if (trace)
-               log.trace("MessageEndpoint " + getProxyString(proxy) + " started transaction=" + transaction);
-
-            // Enlist the XAResource in the transaction
-            if (resource != null)
-            {
-               transaction.enlistResource(resource);
-               if (trace)
-                  log.trace("MessageEndpoint " + getProxyString(proxy) + " enlisted=" + resource);
-            }
-         }
-         else
-         {
-            // If there is already a transaction we ignore the XAResource (by spec 12.5.9)
-            try
-            {
-               tm.resume(suspended);
-            }
-            finally
-            {
-               suspended = null;
-               if (trace)
-                  log.trace("MessageEndpoint " + getProxyString(proxy) + " transaction=" + suspended + " already active, IGNORED=" + resource);
-            }
-         }
-      }
-   }
-
-   protected void endTransaction(Object proxy, boolean commit) throws Throwable
-   {
-      TransactionManager tm = null;
-      Transaction currentTx = null;
-      try
-      {
-         // If we started the transaction, commit it
-         if (transaction != null)
-         {
-            tm = TransactionManagerLocator.getInstance().locate();
-            currentTx = tm.getTransaction();
-
-            // Suspend any bad transaction - there is bug somewhere, but we will try to tidy things up
-            if (currentTx != null && currentTx.equals(transaction) == false)
-            {
-               log.warn("Current transaction " + currentTx + " is not the expected transaction.");
-               tm.suspend();
-               tm.resume(transaction);
-            }
-            else
-            {
-               // We have the correct transaction
-               currentTx = null;
-            }
-
-            // Commit or rollback depending on the status
-            if (commit == false || transaction.getStatus() == Status.STATUS_MARKED_ROLLBACK)
-            {
-               if (trace)
-                  log.trace("MessageEndpoint " + getProxyString(proxy) + " rollback");
-               tm.rollback();
-            }
-            else
-            {
-               if (trace)
-                  log.trace("MessageEndpoint " + getProxyString(proxy) + " commit");
-               tm.commit();
-            }
-         }
-
-         // If we suspended the incoming transaction, resume it
-         if (suspended != null)
-         {
-            try
-            {
-               tm = TransactionManagerLocator.getInstance().locate();
-               tm.resume(suspended);
-            }
-            finally
-            {
-               suspended = null;
-            }
-         }
-      }
-      finally
-      {
-         // Resume any suspended transaction
-         if (currentTx != null)
-         {
-            try
-            {
-               tm.resume(currentTx);
-            }
-            catch (Throwable t)
-            {
-               log.warn("MessageEndpoint " + getProxyString(proxy) + " failed to resume old transaction " + currentTx);
-
-            }
-         }
-      }
-   }
-
-   protected void resetContextClassLoader(Object proxy)
-   {
-      if (trace)
-         log.trace("MessageEndpoint " + getProxyString(proxy) + " reset classloader " + oldClassLoader);
-      inUseThread.setContextClassLoader(oldClassLoader);
-      oldClassLoader = null;
-   }
-
-   protected void releaseThreadLock(Object proxy)
-   {
-      if (trace)
-         log.trace("MessageEndpoint " + getProxyString(proxy) + " no longer in use by " + inUseThread);
-      inUseThread = null;
-   }
-
-   protected String getProxyString(Object proxy)
-   {
-      return container.getDescription();
-   }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/EndpointProxy.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,440 @@
+/*
+* 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.jca;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+
+import javax.resource.ResourceException;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+import javax.transaction.Status;
+import javax.transaction.Transaction;
+import javax.transaction.TransactionManager;
+import javax.transaction.xa.XAResource;
+
+import org.jboss.logging.Logger;
+import org.jboss.tm.TransactionManagerLocator;
+
+import EDU.oswego.cs.dl.util.concurrent.SynchronizedBoolean;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class EndpointProxy implements InvocationHandler
+{
+   private static final Logger log = Logger.getLogger(EndpointProxy.class);
+
+   /**
+    * Whether trace is enabled
+    */
+   private boolean trace = log.isTraceEnabled();
+
+   /**
+    * Whether this proxy has been released
+    */
+   protected SynchronizedBoolean released = new SynchronizedBoolean(false);
+
+   /**
+    * Whether we have delivered a message
+    */
+   protected boolean delivered = false;
+
+   /**
+    * The in use thread
+    */
+   protected Thread inUseThread = null;
+
+   /**
+    * The old classloader of the thread
+    */
+   protected ClassLoader oldClassLoader = null;
+
+   /**
+    * Any transaction we started
+    */
+   protected Transaction transaction = null;
+
+   /**
+    * Any suspended transaction
+    */
+   protected Transaction suspended = null;
+
+   protected ClassLoader loader;
+
+   private XAResource resource;
+   private MessageEndpointFactory messageEndpointFactory;
+   private EndpointContainer container;
+
+
+   public void setContainer(EndpointContainer container)
+   {
+      this.container = container;
+   }
+
+   public void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory)
+   {
+      this.messageEndpointFactory = messageEndpointFactory;
+   }
+
+   public void setXaResource(XAResource resource)
+   {
+      this.resource = resource;
+   }
+
+
+   public void setLoader(ClassLoader loader)
+   {
+      this.loader = loader;
+   }
+
+   public Object invoke(Object proxy, Method method, Object[] args)
+           throws Throwable
+   {
+      // Are we still useable?
+      if (released.get())
+         throw new IllegalStateException("This message endpoint + " + getProxyString(proxy) + " has been released");
+
+      // Concurrent invocation?
+      Thread currentThread = Thread.currentThread();
+      if (inUseThread != null && inUseThread.equals(currentThread) == false)
+         throw new IllegalStateException("This message endpoint + " + getProxyString(proxy) + " is already in use by another thread " + inUseThread);
+      inUseThread = currentThread;
+
+      if (trace)
+         log.trace("MessageEndpoint " + getProxyString(proxy) + " in use by " + method + " " + inUseThread);
+
+      // Which operation?
+      if (method.getName().equals("release"))
+      {
+         release(proxy);
+         return null;
+      }
+      else if (method.getName().equals("beforeDelivery"))
+      {
+         before(proxy, method, args);
+         return null;
+      }
+      else if (method.getName().equals("afterDelivery"))
+      {
+         after(proxy);
+         return null;
+      }
+      else
+         return delivery(proxy, method, args);
+   }
+
+   // -----------------------------------------------------------
+
+   protected void release(Object proxy) throws Throwable
+   {
+      // We are now released
+      released.set(true);
+
+      if (trace)
+         log.trace("MessageEndpoint " + getProxyString(proxy) + " released");
+
+      // Tidyup any outstanding delivery
+      if (oldClassLoader != null)
+      {
+         try
+         {
+            finish("release", proxy, false);
+         }
+         catch (Throwable t)
+         {
+            log.warn("Error in release ", t);
+         }
+      }
+   }
+
+   protected void before(Object proxy, Method method, Object[] args) throws Throwable
+   {
+      // Called out of sequence
+      if (oldClassLoader != null)
+         throw new IllegalStateException("Missing afterDelivery from the previous beforeDelivery for message endpoint " + getProxyString(proxy));
+
+      if (trace)
+         log.trace("MessageEndpoint " + getProxyString(proxy) + " released");
+
+      // Set the classloader
+      oldClassLoader = inUseThread.getContextClassLoader();
+      inUseThread.setContextClassLoader(loader);
+      if (trace)
+         log.trace("MessageEndpoint " + getProxyString(proxy) + " set context classloader to " + loader);
+
+      // start any transaction
+      try
+      {
+         // Is the delivery transacted?
+         Method beforeMethod = (Method) args[0];
+         boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(beforeMethod);
+
+         startTransaction("beforeDelivery", proxy, method, args, isTransacted);
+      }
+      catch (Throwable t)
+      {
+         resetContextClassLoader(proxy);
+         throw new ResourceException(t);
+      }
+   }
+
+   protected void after(Object proxy) throws Throwable
+   {
+      // Called out of sequence
+      if (oldClassLoader == null)
+         throw new IllegalStateException("afterDelivery without a previous beforeDelivery for message endpoint " + getProxyString(proxy));
+
+      // Finish this delivery committing if we can
+      try
+      {
+         finish("afterDelivery", proxy, true);
+      }
+      catch (Throwable t)
+      {
+         throw new ResourceException(t);
+      }
+   }
+
+   protected Object delivery(Object proxy, Method method, Object[] args) throws Throwable
+   {
+      // Have we already delivered a message?
+      if (delivered)
+         throw new IllegalStateException("Multiple message delivery between before and after delivery is not allowed for message endpoint " + getProxyString(proxy));
+
+      if (trace)
+         log.trace("MessageEndpoint " + getProxyString(proxy) + " delivering");
+
+      // Mark delivery if beforeDelivery was invoked
+      if (oldClassLoader != null)
+         delivered = true;
+
+      boolean commit = true;
+      try
+      {
+         // Check for starting a transaction
+         if (oldClassLoader == null)
+         {
+            boolean isTransacted = messageEndpointFactory.isDeliveryTransacted(method);
+            startTransaction("delivery", proxy, method, args, isTransacted);
+         }
+         return container.invoke(method, args);
+      }
+      catch (Throwable t)
+      {
+         if (trace)
+            log.trace("MessageEndpoint " + getProxyString(proxy) + " delivery error", t);
+         if (t instanceof Error || t instanceof RuntimeException)
+         {
+            if (transaction != null)
+               transaction.setRollbackOnly();
+            commit = false;
+         }
+         throw t;
+      }
+      finally
+      {
+         // No before/after delivery, end any transaction and release the lock
+         if (oldClassLoader == null)
+         {
+            try
+            {
+               // Finish any transaction we started
+               endTransaction(proxy, commit);
+            }
+            finally
+            {
+               releaseThreadLock(proxy);
+            }
+         }
+      }
+   }
+
+   protected void finish(String context, Object proxy, boolean commit) throws Throwable
+   {
+      try
+      {
+         endTransaction(proxy, commit);
+      }
+      finally
+      {
+         // Reset delivered flag
+         delivered = false;
+         // Change back to the original context classloader
+         resetContextClassLoader(proxy);
+         // We no longer hold the lock
+         releaseThreadLock(proxy);
+      }
+   }
+
+   protected void startTransaction(String context, Object proxy, Method m, Object[] args, boolean isTransacted) throws Throwable
+   {
+      Method method;
+
+      // Normal delivery
+      if ("delivery".equals(context))
+         method = m;
+         // Before delivery
+      else
+         method = (Method) args[0];
+
+      if (trace)
+         log.trace("MessageEndpoint " + getProxyString(proxy) + " " + context + " method=" + method + " xaResource=" + resource + " transacted=" + isTransacted);
+
+      // Get the transaction status
+      TransactionManager tm = TransactionManagerLocator.getInstance().locate();
+      suspended = tm.suspend();
+
+      if (trace)
+         log.trace("MessageEndpoint " + getProxyString(proxy) + " " + context + " currentTx=" + suspended);
+
+      // Delivery is transacted
+      if (isTransacted)
+      {
+         // No transaction means we start a new transaction and enlist the resource
+         if (suspended == null)
+         {
+            tm.begin();
+            transaction = tm.getTransaction();
+            if (trace)
+               log.trace("MessageEndpoint " + getProxyString(proxy) + " started transaction=" + transaction);
+
+            // Enlist the XAResource in the transaction
+            if (resource != null)
+            {
+               transaction.enlistResource(resource);
+               if (trace)
+                  log.trace("MessageEndpoint " + getProxyString(proxy) + " enlisted=" + resource);
+            }
+         }
+         else
+         {
+            // If there is already a transaction we ignore the XAResource (by spec 12.5.9)
+            try
+            {
+               tm.resume(suspended);
+            }
+            finally
+            {
+               suspended = null;
+               if (trace)
+                  log.trace("MessageEndpoint " + getProxyString(proxy) + " transaction=" + suspended + " already active, IGNORED=" + resource);
+            }
+         }
+      }
+   }
+
+   protected void endTransaction(Object proxy, boolean commit) throws Throwable
+   {
+      TransactionManager tm = null;
+      Transaction currentTx = null;
+      try
+      {
+         // If we started the transaction, commit it
+         if (transaction != null)
+         {
+            tm = TransactionManagerLocator.getInstance().locate();
+            currentTx = tm.getTransaction();
+
+            // Suspend any bad transaction - there is bug somewhere, but we will try to tidy things up
+            if (currentTx != null && currentTx.equals(transaction) == false)
+            {
+               log.warn("Current transaction " + currentTx + " is not the expected transaction.");
+               tm.suspend();
+               tm.resume(transaction);
+            }
+            else
+            {
+               // We have the correct transaction
+               currentTx = null;
+            }
+
+            // Commit or rollback depending on the status
+            if (commit == false || transaction.getStatus() == Status.STATUS_MARKED_ROLLBACK)
+            {
+               if (trace)
+                  log.trace("MessageEndpoint " + getProxyString(proxy) + " rollback");
+               tm.rollback();
+            }
+            else
+            {
+               if (trace)
+                  log.trace("MessageEndpoint " + getProxyString(proxy) + " commit");
+               tm.commit();
+            }
+         }
+
+         // If we suspended the incoming transaction, resume it
+         if (suspended != null)
+         {
+            try
+            {
+               tm = TransactionManagerLocator.getInstance().locate();
+               tm.resume(suspended);
+            }
+            finally
+            {
+               suspended = null;
+            }
+         }
+      }
+      finally
+      {
+         // Resume any suspended transaction
+         if (currentTx != null)
+         {
+            try
+            {
+               tm.resume(currentTx);
+            }
+            catch (Throwable t)
+            {
+               log.warn("MessageEndpoint " + getProxyString(proxy) + " failed to resume old transaction " + currentTx);
+
+            }
+         }
+      }
+   }
+
+   protected void resetContextClassLoader(Object proxy)
+   {
+      if (trace)
+         log.trace("MessageEndpoint " + getProxyString(proxy) + " reset classloader " + oldClassLoader);
+      inUseThread.setContextClassLoader(oldClassLoader);
+      oldClassLoader = null;
+   }
+
+   protected void releaseThreadLock(Object proxy)
+   {
+      if (trace)
+         log.trace("MessageEndpoint " + getProxyString(proxy) + " no longer in use by " + inUseThread);
+      inUseThread = null;
+   }
+
+   protected String getProxyString(Object proxy)
+   {
+      return container.getDescription();
+   }
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,38 +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.jca;
-
-import org.jboss.soa.esb.listeners.ServiceInvoker;
-
-/**
- * Required interface for JCA ESB Gateways
- * <p/>
- * The injected ServiceInvoker should be used by the user object to invoke on target ESB service after, of course,
- * it transforms the incoming gateway message into a generic ESB message
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public interface InflowGateway
-{
-   public void setServiceInvoker(ServiceInvoker invoker);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/InflowGateway.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,38 @@
+/*
+* 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.jca;
+
+import org.jboss.soa.esb.listeners.ServiceInvoker;
+
+/**
+ * Required interface for JCA ESB Gateways
+ * <p/>
+ * The injected ServiceInvoker should be used by the user object to invoke on target ESB service after, of course,
+ * it transforms the incoming gateway message into a generic ESB message
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public interface InflowGateway
+{
+   public void setServiceInvoker(ServiceInvoker invoker);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,166 +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.jca;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Map;
-
-import javax.management.MBeanServer;
-import javax.management.MalformedObjectNameException;
-import javax.management.ObjectName;
-import javax.resource.spi.ActivationSpec;
-import javax.resource.spi.endpoint.MessageEndpointFactory;
-
-import org.apache.log4j.Logger;
-import org.jboss.metadata.ActivationConfigPropertyMetaData;
-import org.jboss.mx.util.JMXExceptionDecoder;
-import org.jboss.mx.util.MBeanServerLocator;
-
-/**
- * interfaces with JCA to activate an endpoint
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class JBoss42ActivationBridge implements ActivationBridge
-{
-   private static Logger logger = Logger.getLogger(JBoss42ActivationBridge.class);
-
-   /**
-    * The signature for createActivationSpec
-    */
-   protected static final String[] createActivationSpecSig = new String[]
-           {
-                   Class.class.getName(),
-                   Collection.class.getName()
-           };
-
-   /**
-    * The signature for activate/deactivateEndpint
-    */
-   protected static final String[] activationSig = new String[]
-           {
-                   MessageEndpointFactory.class.getName(),
-                   ActivationSpec.class.getName()
-           };
-
-   private String adapter;
-   private Class messagingTypeClass;
-   private MessageEndpointFactory messageEndpointFactory;
-   private Map<String, String> activationProperties;
-
-
-   private ActivationSpec activationSpec;
-   private MBeanServer mbeanServer;
-   private ObjectName resourceAdapterObjectName;
-
-
-   public void setAdapter(String adapter)
-   {
-      this.adapter = adapter;
-   }
-
-   public void setMessagingTypeClass(Class messagingTypeClass)
-   {
-      this.messagingTypeClass = messagingTypeClass;
-   }
-
-   public void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory)
-   {
-      this.messageEndpointFactory = messageEndpointFactory;
-   }
-
-   public void setActivationProperties(Map<String, String> activationProperties)
-   {
-      this.activationProperties = activationProperties;
-   }
-
-   public void activate()
-   {
-      mbeanServer = MBeanServerLocator.locateJBoss();
-      try
-      {
-         resourceAdapterObjectName = new ObjectName("jboss.jca:service=RARDeployment,name='" + adapter + "'");
-      }
-      catch (MalformedObjectNameException e)
-      {
-         throw new RuntimeException("Unable to create JMX ObjectName to register adapter: " + adapter, e);
-      }
-
-      ArrayList<ActivationConfigPropertyMetaData> metaData = new ArrayList<ActivationConfigPropertyMetaData>();
-      for (String key : activationProperties.keySet())
-      {
-         String value = activationProperties.get(key);
-         metaData.add(new ActivationConfigPropertyMetaData(key, value));
-      }
-
-      Object[] params = new Object[]
-              {
-                      messagingTypeClass,
-                      metaData
-              };
-      try
-      {
-         activationSpec = (ActivationSpec) mbeanServer.invoke(resourceAdapterObjectName, "createActivationSpec", params, createActivationSpecSig);
-      }
-      catch (Throwable t)
-      {
-         t = JMXExceptionDecoder.decode(t);
-         throw new RuntimeException("Endpoint activation failed ra=" + resourceAdapterObjectName +
-                 " activationSpec=" + activationSpec, t);
-      }
-
-      params = new Object[]{messageEndpointFactory, activationSpec};
-      try
-      {
-         mbeanServer.invoke(resourceAdapterObjectName, "endpointActivation", params, activationSig);
-      }
-      catch (Throwable t)
-      {
-         t = JMXExceptionDecoder.decode(t);
-         throw new RuntimeException("Endpoint activation failed ra=" + resourceAdapterObjectName +
-                 " activationSpec=" + activationSpec, t);
-      }
-
-
-   }
-
-   /**
-    * Deactivate
-    */
-   public void deactivate()
-   {
-      Object[] params = new Object[]{messageEndpointFactory, activationSpec};
-      try
-      {
-         mbeanServer.invoke(resourceAdapterObjectName, "endpointDeactivation", params, activationSig);
-      }
-      catch (Throwable t)
-      {
-         t = JMXExceptionDecoder.decode(t);
-         logger.warn("Endpoint activation failed ra=" + resourceAdapterObjectName +
-                 " activationSpec=" + activationSpec, t);
-      }
-   }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JBoss42ActivationBridge.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,166 @@
+/*
+* 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.jca;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Map;
+
+import javax.management.MBeanServer;
+import javax.management.MalformedObjectNameException;
+import javax.management.ObjectName;
+import javax.resource.spi.ActivationSpec;
+import javax.resource.spi.endpoint.MessageEndpointFactory;
+
+import org.apache.log4j.Logger;
+import org.jboss.metadata.ActivationConfigPropertyMetaData;
+import org.jboss.mx.util.JMXExceptionDecoder;
+import org.jboss.mx.util.MBeanServerLocator;
+
+/**
+ * interfaces with JCA to activate an endpoint
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JBoss42ActivationBridge implements ActivationBridge
+{
+   private static Logger logger = Logger.getLogger(JBoss42ActivationBridge.class);
+
+   /**
+    * The signature for createActivationSpec
+    */
+   protected static final String[] createActivationSpecSig = new String[]
+           {
+                   Class.class.getName(),
+                   Collection.class.getName()
+           };
+
+   /**
+    * The signature for activate/deactivateEndpint
+    */
+   protected static final String[] activationSig = new String[]
+           {
+                   MessageEndpointFactory.class.getName(),
+                   ActivationSpec.class.getName()
+           };
+
+   private String adapter;
+   private Class messagingTypeClass;
+   private MessageEndpointFactory messageEndpointFactory;
+   private Map<String, String> activationProperties;
+
+
+   private ActivationSpec activationSpec;
+   private MBeanServer mbeanServer;
+   private ObjectName resourceAdapterObjectName;
+
+
+   public void setAdapter(String adapter)
+   {
+      this.adapter = adapter;
+   }
+
+   public void setMessagingTypeClass(Class messagingTypeClass)
+   {
+      this.messagingTypeClass = messagingTypeClass;
+   }
+
+   public void setMessageEndpointFactory(MessageEndpointFactory messageEndpointFactory)
+   {
+      this.messageEndpointFactory = messageEndpointFactory;
+   }
+
+   public void setActivationProperties(Map<String, String> activationProperties)
+   {
+      this.activationProperties = activationProperties;
+   }
+
+   public void activate()
+   {
+      mbeanServer = MBeanServerLocator.locateJBoss();
+      try
+      {
+         resourceAdapterObjectName = new ObjectName("jboss.jca:service=RARDeployment,name='" + adapter + "'");
+      }
+      catch (MalformedObjectNameException e)
+      {
+         throw new RuntimeException("Unable to create JMX ObjectName to register adapter: " + adapter, e);
+      }
+
+      ArrayList<ActivationConfigPropertyMetaData> metaData = new ArrayList<ActivationConfigPropertyMetaData>();
+      for (String key : activationProperties.keySet())
+      {
+         String value = activationProperties.get(key);
+         metaData.add(new ActivationConfigPropertyMetaData(key, value));
+      }
+
+      Object[] params = new Object[]
+              {
+                      messagingTypeClass,
+                      metaData
+              };
+      try
+      {
+         activationSpec = (ActivationSpec) mbeanServer.invoke(resourceAdapterObjectName, "createActivationSpec", params, createActivationSpecSig);
+      }
+      catch (Throwable t)
+      {
+         t = JMXExceptionDecoder.decode(t);
+         throw new RuntimeException("Endpoint activation failed ra=" + resourceAdapterObjectName +
+                 " activationSpec=" + activationSpec, t);
+      }
+
+      params = new Object[]{messageEndpointFactory, activationSpec};
+      try
+      {
+         mbeanServer.invoke(resourceAdapterObjectName, "endpointActivation", params, activationSig);
+      }
+      catch (Throwable t)
+      {
+         t = JMXExceptionDecoder.decode(t);
+         throw new RuntimeException("Endpoint activation failed ra=" + resourceAdapterObjectName +
+                 " activationSpec=" + activationSpec, t);
+      }
+
+
+   }
+
+   /**
+    * Deactivate
+    */
+   public void deactivate()
+   {
+      Object[] params = new Object[]{messageEndpointFactory, activationSpec};
+      try
+      {
+         mbeanServer.invoke(resourceAdapterObjectName, "endpointDeactivation", params, activationSig);
+      }
+      catch (Throwable t)
+      {
+         t = JMXExceptionDecoder.decode(t);
+         logger.warn("Endpoint activation failed ra=" + resourceAdapterObjectName +
+                 " activationSpec=" + activationSpec, t);
+      }
+   }
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,239 +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.jca;
-
-import java.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.ListenerUtil;
-import org.jboss.soa.esb.listeners.ServiceInvoker;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-
-/**
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class JcaInflowGateway extends AbstractThreadedManagedLifecycle
-{
-   private static final long serialVersionUID = 1L;
-   private HashMap<String, String> activationSpec = new HashMap<String, String>();
-   private ClassLoader classLoader;
-   private Class beanClass;
-   private Class messagingType;
-   private ActivationBridge bridge;
-   private String adapter;
-   private String serviceName;
-   private String serviceCategory;
-   private boolean isTransacted = true;
-   private InflowGateway bean;
-
-   public JcaInflowGateway(ConfigTree config) throws ConfigurationException
-   {
-      super(config);
-      //System.out.println("CONFIG: " + config);
-
-      serviceCategory = ListenerUtil.obtainAtt(config,
-            ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
-      serviceName = ListenerUtil.obtainAtt(config,
-            ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
-
-      ConfigTree spec = config.getFirstChild("activation-config");
-      for (ConfigTree configProperty : spec.getChildren("property"))
-      {
-         String name = configProperty.getAttribute("name");
-         String value = configProperty.getAttribute("value");
-         activationSpec.put(name, value);
-      }
-
-      this.classLoader = Thread.currentThread().getContextClassLoader();
-      adapter = config.getAttribute("adapter");
-
-      String bc = config.getAttribute("endpointClass");
-      if (bc == null) throw new ConfigurationException("endpointClass attribute is required for Jca Gateway");
-      try
-      {
-         beanClass = classLoader.loadClass(bc);
-      }
-      catch (ClassNotFoundException e)
-      {
-         throw new ConfigurationException("Unable to load Jca Gateway endpointClass: " + bc, e);
-      }
-      if (!InflowGateway.class.isAssignableFrom(beanClass))
-         throw new ConfigurationException("endpointClass must implement InflowGateway interface");
-      String mt = config.getAttribute("messagingType");
-      if (mt != null)
-      {
-         try
-         {
-            messagingType = classLoader.loadClass(mt);
-         }
-         catch (ClassNotFoundException e)
-         {
-            throw new ConfigurationException("Unable to load Jca Gateway messagingType: " + mt, e);
-         }
-      }
-      else
-      {
-         messagingType = findMessagingType(beanClass);
-      }
-
-      String brdg = config.getAttribute("jcaBridge");
-      if (brdg != null)
-      {
-         try
-         {
-            bridge = (ActivationBridge) classLoader.loadClass(mt).newInstance();
-         }
-         catch (Exception e)
-         {
-            throw new ConfigurationException("Unable to load jcaBridge: " + brdg, e);
-         }
-      }
-      else
-      {
-         bridge = new JBoss42ActivationBridge();
-      }
-      String transacted = config.getAttribute("transacted");
-      if (transacted != null) isTransacted = Boolean.parseBoolean(transacted.trim());
-
-   }
-
-   public static Class findMessagingType(Class clazz)
-           throws ConfigurationException
-   {
-      if (clazz.equals(Object.class)) return null;
-
-      Class[] interfaces = clazz.getInterfaces();
-      Class type = null;
-      for (Class intf : interfaces)
-      {
-         if (intf.equals(InflowGateway.class)) continue;
-         if (type != null)
-         {
-            throw new ConfigurationException("Unable to guess messagingType interface from endpointClass as the base class implements too many interfaces, specify this explicity");
-         }
-         type = intf;
-      }
-      if (type == null) return findMessagingType(clazz.getSuperclass());
-      return type;
-   }
-
-
-   protected void doInitialise() throws ManagedLifecycleException
-   {
-      try
-      {
-         Constructor beanClassConstructor = beanClass.getConstructor(ConfigTree.class);
-         try
-         {
-            bean = (InflowGateway)beanClassConstructor.newInstance(getConfig());
-         }
-         catch (InstantiationException e)
-         {
-            throw new RuntimeException("Unable to create endpoint bean", e);
-         }
-         catch (IllegalAccessException e)
-         {
-            throw new RuntimeException("Unable to create endpoint bean", e);
-         }
-         catch (InvocationTargetException e)
-         {
-            throw new RuntimeException("Unable to create endpoint bean", e.getTargetException());
-         }
-      }
-      catch (NoSuchMethodException e)
-      {
-         try
-         {
-            bean = (InflowGateway)beanClass.newInstance();
-         }
-         catch (Exception e1)
-         {
-            throw new RuntimeException("Unable to create endpoint bean", e1);
-         }
-      }
-      final Object theBean = bean;
-      EndpointContainer container = new EndpointContainer()
-      {
-
-         public String getDescription()
-         {
-            return "category: " + serviceCategory + " service: " + serviceName + " jca adapter: " + adapter;
-         }
-
-         public Object invoke(Method method, Object[] args) throws Throwable
-         {
-            try
-            {
-               return method.invoke(theBean, args);
-            }
-            catch (IllegalAccessException e)
-            {
-               throw new RuntimeException(e);
-            }
-            catch (InvocationTargetException e)
-            {
-               throw e.getTargetException();
-            }
-         }
-
-         public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException
-         {
-            return isTransacted;
-         }
-      };
-
-
-      EndpointFactory mef = new EndpointFactory();
-      mef.setContainer(container);
-      mef.setLoader(classLoader);
-      mef.setMessagingType(messagingType);
-      mef.start();
-      bridge.setActivationProperties(activationSpec);
-      bridge.setAdapter(adapter);
-      bridge.setMessageEndpointFactory(mef);
-      bridge.setMessagingTypeClass(messagingType);
-   }
-
-   protected void doRun()
-   {
-      ServiceInvoker invoker = new ServiceInvoker();
-      invoker.setCategory(this.serviceCategory);
-      invoker.setName(this.serviceName);
-      invoker.start();
-      bean.setServiceInvoker(invoker);
-      bridge.activate();
-
-   }
-
-
-   protected void doStop() throws ManagedLifecycleException
-   {
-      bridge.deactivate();
-   }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JcaInflowGateway.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,239 @@
+/*
+* 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.jca;
+
+import java.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.listeners.ServiceInvoker;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+
+/**
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JcaInflowGateway extends AbstractThreadedManagedLifecycle
+{
+   private static final long serialVersionUID = 1L;
+   private HashMap<String, String> activationSpec = new HashMap<String, String>();
+   private ClassLoader classLoader;
+   private Class beanClass;
+   private Class messagingType;
+   private ActivationBridge bridge;
+   private String adapter;
+   private String serviceName;
+   private String serviceCategory;
+   private boolean isTransacted = true;
+   private InflowGateway bean;
+
+   public JcaInflowGateway(ConfigTree config) throws ConfigurationException
+   {
+      super(config);
+      //System.out.println("CONFIG: " + config);
+
+      serviceCategory = ListenerUtil.obtainAtt(config,
+            ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, null);
+      serviceName = ListenerUtil.obtainAtt(config,
+            ListenerTagNames.TARGET_SERVICE_NAME_TAG, null);
+
+      ConfigTree spec = config.getFirstChild("activation-config");
+      for (ConfigTree configProperty : spec.getChildren("property"))
+      {
+         String name = configProperty.getAttribute("name");
+         String value = configProperty.getAttribute("value");
+         activationSpec.put(name, value);
+      }
+
+      this.classLoader = Thread.currentThread().getContextClassLoader();
+      adapter = config.getAttribute("adapter");
+
+      String bc = config.getAttribute("endpointClass");
+      if (bc == null) throw new ConfigurationException("endpointClass attribute is required for Jca Gateway");
+      try
+      {
+         beanClass = classLoader.loadClass(bc);
+      }
+      catch (ClassNotFoundException e)
+      {
+         throw new ConfigurationException("Unable to load Jca Gateway endpointClass: " + bc, e);
+      }
+      if (!InflowGateway.class.isAssignableFrom(beanClass))
+         throw new ConfigurationException("endpointClass must implement InflowGateway interface");
+      String mt = config.getAttribute("messagingType");
+      if (mt != null)
+      {
+         try
+         {
+            messagingType = classLoader.loadClass(mt);
+         }
+         catch (ClassNotFoundException e)
+         {
+            throw new ConfigurationException("Unable to load Jca Gateway messagingType: " + mt, e);
+         }
+      }
+      else
+      {
+         messagingType = findMessagingType(beanClass);
+      }
+
+      String brdg = config.getAttribute("jcaBridge");
+      if (brdg != null)
+      {
+         try
+         {
+            bridge = (ActivationBridge) classLoader.loadClass(mt).newInstance();
+         }
+         catch (Exception e)
+         {
+            throw new ConfigurationException("Unable to load jcaBridge: " + brdg, e);
+         }
+      }
+      else
+      {
+         bridge = new JBoss42ActivationBridge();
+      }
+      String transacted = config.getAttribute("transacted");
+      if (transacted != null) isTransacted = Boolean.parseBoolean(transacted.trim());
+
+   }
+
+   public static Class findMessagingType(Class clazz)
+           throws ConfigurationException
+   {
+      if (clazz.equals(Object.class)) return null;
+
+      Class[] interfaces = clazz.getInterfaces();
+      Class type = null;
+      for (Class intf : interfaces)
+      {
+         if (intf.equals(InflowGateway.class)) continue;
+         if (type != null)
+         {
+            throw new ConfigurationException("Unable to guess messagingType interface from endpointClass as the base class implements too many interfaces, specify this explicity");
+         }
+         type = intf;
+      }
+      if (type == null) return findMessagingType(clazz.getSuperclass());
+      return type;
+   }
+
+
+   protected void doInitialise() throws ManagedLifecycleException
+   {
+      try
+      {
+         Constructor beanClassConstructor = beanClass.getConstructor(ConfigTree.class);
+         try
+         {
+            bean = (InflowGateway)beanClassConstructor.newInstance(getConfig());
+         }
+         catch (InstantiationException e)
+         {
+            throw new RuntimeException("Unable to create endpoint bean", e);
+         }
+         catch (IllegalAccessException e)
+         {
+            throw new RuntimeException("Unable to create endpoint bean", e);
+         }
+         catch (InvocationTargetException e)
+         {
+            throw new RuntimeException("Unable to create endpoint bean", e.getTargetException());
+         }
+      }
+      catch (NoSuchMethodException e)
+      {
+         try
+         {
+            bean = (InflowGateway)beanClass.newInstance();
+         }
+         catch (Exception e1)
+         {
+            throw new RuntimeException("Unable to create endpoint bean", e1);
+         }
+      }
+      final Object theBean = bean;
+      EndpointContainer container = new EndpointContainer()
+      {
+
+         public String getDescription()
+         {
+            return "category: " + serviceCategory + " service: " + serviceName + " jca adapter: " + adapter;
+         }
+
+         public Object invoke(Method method, Object[] args) throws Throwable
+         {
+            try
+            {
+               return method.invoke(theBean, args);
+            }
+            catch (IllegalAccessException e)
+            {
+               throw new RuntimeException(e);
+            }
+            catch (InvocationTargetException e)
+            {
+               throw e.getTargetException();
+            }
+         }
+
+         public boolean isDeliveryTransacted(Method method) throws NoSuchMethodException
+         {
+            return isTransacted;
+         }
+      };
+
+
+      EndpointFactory mef = new EndpointFactory();
+      mef.setContainer(container);
+      mef.setLoader(classLoader);
+      mef.setMessagingType(messagingType);
+      mef.start();
+      bridge.setActivationProperties(activationSpec);
+      bridge.setAdapter(adapter);
+      bridge.setMessageEndpointFactory(mef);
+      bridge.setMessagingTypeClass(messagingType);
+   }
+
+   protected void doRun()
+   {
+      ServiceInvoker invoker = new ServiceInvoker();
+      invoker.setCategory(this.serviceCategory);
+      invoker.setName(this.serviceName);
+      invoker.start();
+      bean.setServiceInvoker(invoker);
+      bridge.activate();
+
+   }
+
+
+   protected void doStop() throws ManagedLifecycleException
+   {
+      bridge.deactivate();
+   }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JmsEndpoint.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JmsEndpoint.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JmsEndpoint.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,58 +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.jca;
-
-import javax.jms.Message;
-import javax.jms.MessageListener;
-
-import org.jboss.soa.esb.listeners.ServiceInvoker;
-import org.jboss.soa.esb.listeners.gateway.PackageJmsMessageContents;
-
-/**
- * comment
- *
- * @author <a href="bill at jboss.com">Bill Burke</a>
- * @version $Revision: 1.1 $
- */
-public class JmsEndpoint implements InflowGateway, MessageListener
-{
-   private ServiceInvoker service;
-   private PackageJmsMessageContents transformer = new PackageJmsMessageContents();
-
-   public void setServiceInvoker(ServiceInvoker invoker)
-   {
-      this.service = invoker;
-   }
-
-   public void onMessage(Message message)
-   {
-      try
-      {
-         org.jboss.soa.esb.message.Message esbMessage = transformer.process(message);
-         service.postMessage(esbMessage);
-      }
-      catch (Exception e)
-      {
-         throw new RuntimeException(e);
-      }
-   }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JmsEndpoint.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JmsEndpoint.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JmsEndpoint.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/jca/JmsEndpoint.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,58 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.soa.esb.listeners.jca;
+
+import javax.jms.Message;
+import javax.jms.MessageListener;
+
+import org.jboss.soa.esb.listeners.ServiceInvoker;
+import org.jboss.soa.esb.listeners.gateway.PackageJmsMessageContents;
+
+/**
+ * comment
+ *
+ * @author <a href="bill at jboss.com">Bill Burke</a>
+ * @version $Revision: 1.1 $
+ */
+public class JmsEndpoint implements InflowGateway, MessageListener
+{
+   private ServiceInvoker service;
+   private PackageJmsMessageContents transformer = new PackageJmsMessageContents();
+
+   public void setServiceInvoker(ServiceInvoker invoker)
+   {
+      this.service = invoker;
+   }
+
+   public void onMessage(Message message)
+   {
+      try
+      {
+         org.jboss.soa.esb.message.Message esbMessage = transformer.process(message);
+         service.postMessage(esbMessage);
+      }
+      catch (Exception e)
+      {
+         throw new RuntimeException(e);
+      }
+   }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractManagedLifecycle.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractManagedLifecycle.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractManagedLifecycle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,463 +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.lifecycle;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.io.Serializable;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-/**
- * This class represents the lifecycle for a managed instance.
- * 
- * @author kevin
- */
-public abstract class AbstractManagedLifecycle implements ManagedLifecycle, Serializable
-{
-    /**
-     * The logger for this class.
-     */
-    private static final Logger logger = Logger.getLogger(AbstractManagedLifecycle.class) ;
-    
-    /**
-     * The name of the attribute specifying the termination period.
-     */
-    public static final String PARAM_TERMINATION_PERIOD = "terminationPeriod" ;
-    
-    /**
-     * The lock used for state operations.
-     */
-    private final Lock stateLock = new ReentrantLock() ;
-    /**
-     * The condition used for state changes.
-     */
-    private final Condition stateChanged = stateLock.newCondition() ;
-    
-    /**
-     * The state of the managed instance.
-     */
-    private transient ManagedLifecycleState state = ManagedLifecycleState.CONSTRUCTED ;
-    /**
-     * The maximum amount of time to wait for termination.
-     */
-    private long terminationPeriod = 60000 ;
-    /**
-     * The list of listeners associated with this managed instance.
-     */
-    private Set<ManagedLifecycleEventListener> listeners = new CopyOnWriteArraySet<ManagedLifecycleEventListener>() ;
-    /**
-     * Instance configuration.  Supplied through constructor.
-     */
-    private ConfigTree config;
-
-    /**
-     * Construct the managed lifecycle.
-     * @param config The configuration associated with this instance.
-     * @throws ConfigurationException for configuration errors during initialisation.
-     */
-    protected AbstractManagedLifecycle(final ConfigTree config)
-        throws ConfigurationException
-    {
-        final String terminationPeriodVal = config.getAttribute(PARAM_TERMINATION_PERIOD) ;
-        if (terminationPeriodVal != null)
-        {
-            try
-            {
-                this.terminationPeriod = (Long.parseLong(terminationPeriodVal) * 1000) ;
-            }
-            catch (final NumberFormatException nfe)
-            {
-                throw new ConfigurationException("Failed to parse " +
-                    PARAM_TERMINATION_PERIOD + " value of " + terminationPeriodVal) ;
-            }
-        }
-        
-        if (logger.isDebugEnabled())
-        {
-            logger.debug(PARAM_TERMINATION_PERIOD + " value " + terminationPeriod) ;
-        }
-
-        this.config = config;
-    }
-    
-    /**
-     * Initialise the managed instance.
-     * <p/>
-     * This method is called after the managed instance has been instantiated so that
-     * configuration options can be validated.
-     * 
-     * @throws ManagedLifecycleException for errors during initialisation.
-     */
-    public final void initialise()
-    	throws ManagedLifecycleException
-    {
-	changeState(ManagedLifecycleState.INITIALISING) ;
-	try
-	{
-            doInitialise() ;
-            changeState(ManagedLifecycleState.INITIALISED) ;
-        }
-        catch (final ManagedLifecycleException mle)
-        {
-            changeState(ManagedLifecycleState.DESTROYED) ;
-            throw mle ;
-        }
-        catch (final Exception ex)
-        {
-            logger.warn("Unexpected exception caught while initialisation", ex) ;
-            changeState(ManagedLifecycleState.DESTROYED) ;
-            throw new ManagedLifecycleException(ex) ;
-        }
-    }
-    
-    /**
-     * Handle the initialisation of the managed instance.
-     * 
-     * @throws ManagedLifecycleException for errors while initialisation.
-     */
-    protected abstract void doInitialise()
-    	throws ManagedLifecycleException ;
-
-    /**
-     * Start the managed instance.
-     * <p/>
-     * This method is called to inform the managed instance that it can initialise
-     * resources prior to enabling the service.
-     */
-    public final void start()
-    	throws ManagedLifecycleException
-    {
-	changeState(ManagedLifecycleState.STARTING) ;
-        try
-        {
-            doStart() ;
-            changeState(ManagedLifecycleState.STARTED) ;
-        }
-        catch (final ManagedLifecycleException mle)
-        {
-            changeState(ManagedLifecycleState.STOPPED) ;
-            throw mle ;
-        }
-        catch (final Exception ex)
-        {
-            logger.warn("Unexpected exception caught while starting", ex) ;
-            changeState(ManagedLifecycleState.STOPPED) ;
-            throw new ManagedLifecycleException(ex) ;
-        }
-    }
-    
-    /**
-     * Handle the start of the managed instance.
-     * 
-     * @throws ManagedLifecycleException for errors while starting.
-     */
-    protected abstract void doStart()
-    	throws ManagedLifecycleException ;
-
-    /**
-     * Stop the managed instance.
-     * <p/>
-     * This method is called to inform the managed instance that it must disable
-     * resources associated with the running service.  The service may choose to
-     * disable the resources asynchronously provided that any subsequent call to
-     * {@link #start()} or {@link #destroy()} blocks until these resources have been
-     * disabled. 
-     */
-    public final void stop()
-    	throws ManagedLifecycleException
-    {
-	changeState(ManagedLifecycleState.STOPPING) ;
-        try
-        {
-            doStop() ;
-        }
-        catch (final ManagedLifecycleException mle)
-        {
-            throw mle ;
-        }
-        catch (final Exception ex)
-        {
-            logger.warn("Unexpected exception caught while stopping", ex) ;
-            throw new ManagedLifecycleException(ex) ;
-        }
-        finally
-        {
-            changeState(ManagedLifecycleState.STOPPED) ;
-        }
-    }
-
-    /**
-     * Handle the stop of the managed instance.
-     * 
-     * @throws ManagedLifecycleException for errors while stopping.
-     */
-    protected abstract void doStop()
-    	throws ManagedLifecycleException ;
-
-    /**
-     * Destroy the managed instance.
-     * <p/>
-     * This method is called prior to the release of the managed instance.  All
-     * resources associated with this managed instance should be released as the
-     * instance will no longer be used.
-     */
-    public final void destroy()
-    	throws ManagedLifecycleException
-    {
-	changeState(ManagedLifecycleState.DESTROYING) ;
-        try
-        {
-            doDestroy() ;
-        }
-        catch (final ManagedLifecycleException mle)
-        {
-            throw mle ;
-        }
-        catch (final Exception ex)
-        {
-            logger.warn("Unexpected exception caught while destroying", ex) ;
-            throw new ManagedLifecycleException(ex) ;
-        }
-        finally
-        {
-            changeState(ManagedLifecycleState.DESTROYED) ;
-        }
-    }
-
-    /**
-     * Handle the destroy of the managed instance.
-     * 
-     * @throws ManagedLifecycleException for errors while destroying.
-     */
-    protected abstract void doDestroy()
-    	throws ManagedLifecycleException ;
-    
-    /**
-     * Get the state of the managed instance.
-     * @return The managed instance state.
-     */
-    public ManagedLifecycleState getState()
-    {
-        stateLock.lock() ;
-        try
-        {
-            return state ;
-        }
-        finally
-        {
-            stateLock.unlock() ;
-        }
-    }
-    
-    /**
-     * Change the state of the managed instance.
-     * @param newState The new state of the managed instance.
-     * @throws ManagedLifecycleException 
-     */
-    protected void changeState(final ManagedLifecycleState newState)
-    	throws ManagedLifecycleException
-    {
-        final ManagedLifecycleState origState ;
-        stateLock.lock() ;
-        try
-        {
-            if (!state.canTransition(newState))
-            {
-                throw new ManagedLifecycleException("Invalid state change from " + state + " to " + newState) ;
-            }
-            origState = state ;
-            state = newState ;
-            stateChanged.signalAll() ;
-        }
-        finally
-        {
-            stateLock.unlock() ;
-        }
-        fireStateChangedEvent(origState, newState) ;
-    }
-    
-    /**
-     * Get the termination period for this service.
-     * @return The termination period.
-     */
-    protected long getTerminationPeriod()
-    {
-        return terminationPeriod ;
-    }
-    
-    /**
-     * Wait until the managed instance has transitioned into the DESTROYED state.
-     * @return true if the transition occurs within the expected period, false otherwise.
-     */
-    public boolean waitUntilDestroyed()
-    {
-        return waitUntilDestroyed(getTerminationPeriod()) ;
-    }
-    
-    /**
-     * Wait until the managed instance has transitioned into the DESTROYED state.
-     * @param transitionPeriod The maximum delay expected for the transition, specified in milliseconds.
-     * @return true if the transition occurs within the expected period, false otherwise.
-     */
-    public boolean waitUntilDestroyed(final long transitionPeriod)
-    {
-        return waitUntilState(ManagedLifecycleState.DESTROYED, transitionPeriod) ;
-    }
-    
-    
-    /**
-     * Wait until the managed instance has transitioned into the specified state.
-     * @param state The expected state.
-     * @param transitionPeriod The maximum delay expected for the transition, specified in milliseconds.
-     * @return true if the transition occurs within the expected period, false otherwise.
-     */
-    protected boolean waitUntilState(final ManagedLifecycleState state, final long transitionPeriod)
-    {
-        return waitForStateChange(state, transitionPeriod, true) ;
-    }
-    
-    /**
-     * Wait until the managed instance is not in the specified state.
-     * @param state The original state.
-     * @param transitionPeriod The maximum delay expected for the transition, specified in milliseconds.
-     * @return true if the transition occurs within the expected period, false otherwise.
-     */
-    protected boolean waitUntilNotState(final ManagedLifecycleState state, final long transitionPeriod)
-    {
-        return waitForStateChange(state, transitionPeriod, false) ;
-    }
-    
-    
-    /**
-     * Wait until the managed instance has transitioned.
-     * @param state The specified state.
-     * @param transitionPeriod The maximum delay expected for the transition, specified in milliseconds.
-     * @param equality True if the state should be equal to the specified state, false otherwise.
-     * @return true if the transition occurs within the expected period, false otherwise.
-     */
-    private boolean waitForStateChange(final ManagedLifecycleState state, final long transitionPeriod, final boolean equality)
-    {
-        try
-        {
-            stateLock.lock() ;
-            try
-            {
-                if (equality ^ (this.state == state))
-                {
-                    final long end = System.currentTimeMillis() + transitionPeriod ;
-                    while(equality ^ (this.state == state))
-                    {
-                        final long delay = end - System.currentTimeMillis() ;
-                        if (delay <= 0)
-                        {
-                            break ;
-                        }
-                        stateChanged.await(delay, TimeUnit.MILLISECONDS) ;
-                    }
-                }
-                return !(equality ^ (this.state == state)) ;
-            }
-            finally
-            {
-                stateLock.unlock() ;
-            }
-        }
-        catch (final InterruptedException ie)
-        {
-            if (logger.isInfoEnabled())
-            {
-                logger.info("Interrupted while waiting for state change") ;
-            }
-            
-            stateLock.lock() ;
-            try
-            {
-                return (this.state == state) ;
-            }
-            finally
-            {
-                stateLock.unlock() ;
-            }
-        }
-    }
-    
-    /**
-     * Add a managed lifecycle event listener.
-     * @param listener The listener.
-     */
-    public void addManagedLifecycleEventListener(final ManagedLifecycleEventListener listener)
-    {
-        listeners.add(listener) ;
-    }
-    
-    /**
-     * Remove a managed lifecycle event listener.
-     * @param listener The listener.
-     */
-    public void removeManagedLifecycleEventListener(final ManagedLifecycleEventListener listener)
-    {
-        listeners.remove(listener) ;
-    }
-    
-    /**
-     * Fire the state changed event.
-     * @param origState The original state, prior to transition
-     * @param newState The new state after transition
-     */
-    private void fireStateChangedEvent(final ManagedLifecycleState origState, final ManagedLifecycleState newState)
-    {
-        if (listeners.size() > 0)
-        {
-            final ManagedLifecycleStateEvent event = new ManagedLifecycleStateEvent(this, origState, newState) ;
-            for(ManagedLifecycleEventListener listener: listeners)
-            {
-                listener.stateChanged(event) ;
-            }
-        }
-    }
-    
-    /**
-     * Deserialise this managed lifecycle.
-     * @param in The input stream.
-     * @throws IOException for errors generated by the input stream.
-     * @throws ClassNotFoundException For classpath errors.
-     */
-    private void readObject(final ObjectInputStream in)
-        throws IOException, ClassNotFoundException
-    {
-        in.defaultReadObject() ;
-        state = ManagedLifecycleState.CONSTRUCTED ;
-    }
-
-    public ConfigTree getConfig() {
-        return config;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractManagedLifecycle.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractManagedLifecycle.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractManagedLifecycle.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractManagedLifecycle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,463 @@
+/*
+ * 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.lifecycle;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.io.Serializable;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+/**
+ * This class represents the lifecycle for a managed instance.
+ * 
+ * @author kevin
+ */
+public abstract class AbstractManagedLifecycle implements ManagedLifecycle, Serializable
+{
+    /**
+     * The logger for this class.
+     */
+    private static final Logger logger = Logger.getLogger(AbstractManagedLifecycle.class) ;
+    
+    /**
+     * The name of the attribute specifying the termination period.
+     */
+    public static final String PARAM_TERMINATION_PERIOD = "terminationPeriod" ;
+    
+    /**
+     * The lock used for state operations.
+     */
+    private final Lock stateLock = new ReentrantLock() ;
+    /**
+     * The condition used for state changes.
+     */
+    private final Condition stateChanged = stateLock.newCondition() ;
+    
+    /**
+     * The state of the managed instance.
+     */
+    private transient ManagedLifecycleState state = ManagedLifecycleState.CONSTRUCTED ;
+    /**
+     * The maximum amount of time to wait for termination.
+     */
+    private long terminationPeriod = 60000 ;
+    /**
+     * The list of listeners associated with this managed instance.
+     */
+    private Set<ManagedLifecycleEventListener> listeners = new CopyOnWriteArraySet<ManagedLifecycleEventListener>() ;
+    /**
+     * Instance configuration.  Supplied through constructor.
+     */
+    private ConfigTree config;
+
+    /**
+     * Construct the managed lifecycle.
+     * @param config The configuration associated with this instance.
+     * @throws ConfigurationException for configuration errors during initialisation.
+     */
+    protected AbstractManagedLifecycle(final ConfigTree config)
+        throws ConfigurationException
+    {
+        final String terminationPeriodVal = config.getAttribute(PARAM_TERMINATION_PERIOD) ;
+        if (terminationPeriodVal != null)
+        {
+            try
+            {
+                this.terminationPeriod = (Long.parseLong(terminationPeriodVal) * 1000) ;
+            }
+            catch (final NumberFormatException nfe)
+            {
+                throw new ConfigurationException("Failed to parse " +
+                    PARAM_TERMINATION_PERIOD + " value of " + terminationPeriodVal) ;
+            }
+        }
+        
+        if (logger.isDebugEnabled())
+        {
+            logger.debug(PARAM_TERMINATION_PERIOD + " value " + terminationPeriod) ;
+        }
+
+        this.config = config;
+    }
+    
+    /**
+     * Initialise the managed instance.
+     * <p/>
+     * This method is called after the managed instance has been instantiated so that
+     * configuration options can be validated.
+     * 
+     * @throws ManagedLifecycleException for errors during initialisation.
+     */
+    public final void initialise()
+    	throws ManagedLifecycleException
+    {
+	changeState(ManagedLifecycleState.INITIALISING) ;
+	try
+	{
+            doInitialise() ;
+            changeState(ManagedLifecycleState.INITIALISED) ;
+        }
+        catch (final ManagedLifecycleException mle)
+        {
+            changeState(ManagedLifecycleState.DESTROYED) ;
+            throw mle ;
+        }
+        catch (final Exception ex)
+        {
+            logger.warn("Unexpected exception caught while initialisation", ex) ;
+            changeState(ManagedLifecycleState.DESTROYED) ;
+            throw new ManagedLifecycleException(ex) ;
+        }
+    }
+    
+    /**
+     * Handle the initialisation of the managed instance.
+     * 
+     * @throws ManagedLifecycleException for errors while initialisation.
+     */
+    protected abstract void doInitialise()
+    	throws ManagedLifecycleException ;
+
+    /**
+     * Start the managed instance.
+     * <p/>
+     * This method is called to inform the managed instance that it can initialise
+     * resources prior to enabling the service.
+     */
+    public final void start()
+    	throws ManagedLifecycleException
+    {
+	changeState(ManagedLifecycleState.STARTING) ;
+        try
+        {
+            doStart() ;
+            changeState(ManagedLifecycleState.STARTED) ;
+        }
+        catch (final ManagedLifecycleException mle)
+        {
+            changeState(ManagedLifecycleState.STOPPED) ;
+            throw mle ;
+        }
+        catch (final Exception ex)
+        {
+            logger.warn("Unexpected exception caught while starting", ex) ;
+            changeState(ManagedLifecycleState.STOPPED) ;
+            throw new ManagedLifecycleException(ex) ;
+        }
+    }
+    
+    /**
+     * Handle the start of the managed instance.
+     * 
+     * @throws ManagedLifecycleException for errors while starting.
+     */
+    protected abstract void doStart()
+    	throws ManagedLifecycleException ;
+
+    /**
+     * Stop the managed instance.
+     * <p/>
+     * This method is called to inform the managed instance that it must disable
+     * resources associated with the running service.  The service may choose to
+     * disable the resources asynchronously provided that any subsequent call to
+     * {@link #start()} or {@link #destroy()} blocks until these resources have been
+     * disabled. 
+     */
+    public final void stop()
+    	throws ManagedLifecycleException
+    {
+	changeState(ManagedLifecycleState.STOPPING) ;
+        try
+        {
+            doStop() ;
+        }
+        catch (final ManagedLifecycleException mle)
+        {
+            throw mle ;
+        }
+        catch (final Exception ex)
+        {
+            logger.warn("Unexpected exception caught while stopping", ex) ;
+            throw new ManagedLifecycleException(ex) ;
+        }
+        finally
+        {
+            changeState(ManagedLifecycleState.STOPPED) ;
+        }
+    }
+
+    /**
+     * Handle the stop of the managed instance.
+     * 
+     * @throws ManagedLifecycleException for errors while stopping.
+     */
+    protected abstract void doStop()
+    	throws ManagedLifecycleException ;
+
+    /**
+     * Destroy the managed instance.
+     * <p/>
+     * This method is called prior to the release of the managed instance.  All
+     * resources associated with this managed instance should be released as the
+     * instance will no longer be used.
+     */
+    public final void destroy()
+    	throws ManagedLifecycleException
+    {
+	changeState(ManagedLifecycleState.DESTROYING) ;
+        try
+        {
+            doDestroy() ;
+        }
+        catch (final ManagedLifecycleException mle)
+        {
+            throw mle ;
+        }
+        catch (final Exception ex)
+        {
+            logger.warn("Unexpected exception caught while destroying", ex) ;
+            throw new ManagedLifecycleException(ex) ;
+        }
+        finally
+        {
+            changeState(ManagedLifecycleState.DESTROYED) ;
+        }
+    }
+
+    /**
+     * Handle the destroy of the managed instance.
+     * 
+     * @throws ManagedLifecycleException for errors while destroying.
+     */
+    protected abstract void doDestroy()
+    	throws ManagedLifecycleException ;
+    
+    /**
+     * Get the state of the managed instance.
+     * @return The managed instance state.
+     */
+    public ManagedLifecycleState getState()
+    {
+        stateLock.lock() ;
+        try
+        {
+            return state ;
+        }
+        finally
+        {
+            stateLock.unlock() ;
+        }
+    }
+    
+    /**
+     * Change the state of the managed instance.
+     * @param newState The new state of the managed instance.
+     * @throws ManagedLifecycleException 
+     */
+    protected void changeState(final ManagedLifecycleState newState)
+    	throws ManagedLifecycleException
+    {
+        final ManagedLifecycleState origState ;
+        stateLock.lock() ;
+        try
+        {
+            if (!state.canTransition(newState))
+            {
+                throw new ManagedLifecycleException("Invalid state change from " + state + " to " + newState) ;
+            }
+            origState = state ;
+            state = newState ;
+            stateChanged.signalAll() ;
+        }
+        finally
+        {
+            stateLock.unlock() ;
+        }
+        fireStateChangedEvent(origState, newState) ;
+    }
+    
+    /**
+     * Get the termination period for this service.
+     * @return The termination period.
+     */
+    protected long getTerminationPeriod()
+    {
+        return terminationPeriod ;
+    }
+    
+    /**
+     * Wait until the managed instance has transitioned into the DESTROYED state.
+     * @return true if the transition occurs within the expected period, false otherwise.
+     */
+    public boolean waitUntilDestroyed()
+    {
+        return waitUntilDestroyed(getTerminationPeriod()) ;
+    }
+    
+    /**
+     * Wait until the managed instance has transitioned into the DESTROYED state.
+     * @param transitionPeriod The maximum delay expected for the transition, specified in milliseconds.
+     * @return true if the transition occurs within the expected period, false otherwise.
+     */
+    public boolean waitUntilDestroyed(final long transitionPeriod)
+    {
+        return waitUntilState(ManagedLifecycleState.DESTROYED, transitionPeriod) ;
+    }
+    
+    
+    /**
+     * Wait until the managed instance has transitioned into the specified state.
+     * @param state The expected state.
+     * @param transitionPeriod The maximum delay expected for the transition, specified in milliseconds.
+     * @return true if the transition occurs within the expected period, false otherwise.
+     */
+    protected boolean waitUntilState(final ManagedLifecycleState state, final long transitionPeriod)
+    {
+        return waitForStateChange(state, transitionPeriod, true) ;
+    }
+    
+    /**
+     * Wait until the managed instance is not in the specified state.
+     * @param state The original state.
+     * @param transitionPeriod The maximum delay expected for the transition, specified in milliseconds.
+     * @return true if the transition occurs within the expected period, false otherwise.
+     */
+    protected boolean waitUntilNotState(final ManagedLifecycleState state, final long transitionPeriod)
+    {
+        return waitForStateChange(state, transitionPeriod, false) ;
+    }
+    
+    
+    /**
+     * Wait until the managed instance has transitioned.
+     * @param state The specified state.
+     * @param transitionPeriod The maximum delay expected for the transition, specified in milliseconds.
+     * @param equality True if the state should be equal to the specified state, false otherwise.
+     * @return true if the transition occurs within the expected period, false otherwise.
+     */
+    private boolean waitForStateChange(final ManagedLifecycleState state, final long transitionPeriod, final boolean equality)
+    {
+        try
+        {
+            stateLock.lock() ;
+            try
+            {
+                if (equality ^ (this.state == state))
+                {
+                    final long end = System.currentTimeMillis() + transitionPeriod ;
+                    while(equality ^ (this.state == state))
+                    {
+                        final long delay = end - System.currentTimeMillis() ;
+                        if (delay <= 0)
+                        {
+                            break ;
+                        }
+                        stateChanged.await(delay, TimeUnit.MILLISECONDS) ;
+                    }
+                }
+                return !(equality ^ (this.state == state)) ;
+            }
+            finally
+            {
+                stateLock.unlock() ;
+            }
+        }
+        catch (final InterruptedException ie)
+        {
+            if (logger.isInfoEnabled())
+            {
+                logger.info("Interrupted while waiting for state change") ;
+            }
+            
+            stateLock.lock() ;
+            try
+            {
+                return (this.state == state) ;
+            }
+            finally
+            {
+                stateLock.unlock() ;
+            }
+        }
+    }
+    
+    /**
+     * Add a managed lifecycle event listener.
+     * @param listener The listener.
+     */
+    public void addManagedLifecycleEventListener(final ManagedLifecycleEventListener listener)
+    {
+        listeners.add(listener) ;
+    }
+    
+    /**
+     * Remove a managed lifecycle event listener.
+     * @param listener The listener.
+     */
+    public void removeManagedLifecycleEventListener(final ManagedLifecycleEventListener listener)
+    {
+        listeners.remove(listener) ;
+    }
+    
+    /**
+     * Fire the state changed event.
+     * @param origState The original state, prior to transition
+     * @param newState The new state after transition
+     */
+    private void fireStateChangedEvent(final ManagedLifecycleState origState, final ManagedLifecycleState newState)
+    {
+        if (listeners.size() > 0)
+        {
+            final ManagedLifecycleStateEvent event = new ManagedLifecycleStateEvent(this, origState, newState) ;
+            for(ManagedLifecycleEventListener listener: listeners)
+            {
+                listener.stateChanged(event) ;
+            }
+        }
+    }
+    
+    /**
+     * Deserialise this managed lifecycle.
+     * @param in The input stream.
+     * @throws IOException for errors generated by the input stream.
+     * @throws ClassNotFoundException For classpath errors.
+     */
+    private void readObject(final ObjectInputStream in)
+        throws IOException, ClassNotFoundException
+    {
+        in.defaultReadObject() ;
+        state = ManagedLifecycleState.CONSTRUCTED ;
+    }
+
+    public ConfigTree getConfig() {
+        return config;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractThreadedManagedLifecycle.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractThreadedManagedLifecycle.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractThreadedManagedLifecycle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,367 +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.lifecycle;
-
-import java.io.IOException;
-import java.io.ObjectInputStream;
-import java.util.Set;
-import java.util.concurrent.CopyOnWriteArraySet;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-
-/**
- * This class provides threaded support for a managed instance.
- * 
- * @author kevin
- */
-public abstract class AbstractThreadedManagedLifecycle extends AbstractManagedLifecycle implements Runnable
-{
-    /**
-     * The logger for this class.
-     */
-    private static final Logger logger = Logger.getLogger(AbstractThreadedManagedLifecycle.class) ;
-    
-    /**
-     * The lock used for managing the running state.
-     */
-    private final Lock runningLock = new ReentrantLock() ;
-    /**
-     * The condition used for running state changes.
-     */
-    private final Condition runningChanged = runningLock.newCondition() ;
-    
-    /**
-     * The running state.
-     */
-    private transient ManagedLifecycleThreadState state = ManagedLifecycleThreadState.STOPPED ;
-    
-    /**
-     * The list of listeners associated with this managed instance.
-     */
-    private Set<ManagedLifecycleThreadEventListener> listeners = new CopyOnWriteArraySet<ManagedLifecycleThreadEventListener>() ;
-    
-
-    /**
-     * Construct the threaded managed lifecycle.
-     * @param config The configuration associated with this instance.
-     * @throws ConfigurationException for configuration errors during initialisation.
-     */
-    protected AbstractThreadedManagedLifecycle(final ConfigTree config)
-        throws ConfigurationException
-    {
-        super(config) ;
-    }
-    
-    /**
-     * Handle the start of the managed instance.
-     * 
-     * @throws ManagedLifecycleException for errors while starting.
-     */
-    protected void doStart()
-        throws ManagedLifecycleException
-    {
-        runningLock.lock() ;
-        try
-        {
-            if (!waitUntilStopped())
-            {
-                throw new ManagedLifecycleException("Thread still active from previous start") ;
-            }
-            setRunning(ManagedLifecycleThreadState.RUNNING) ;
-        }
-        finally
-        {
-            runningLock.unlock() ;
-        }
-        final Thread thread = new Thread(this) ;
-        thread.start() ;
-    }
-    
-    /**
-     * The thread execution method.
-     */
-    public final void run()
-    {
-        waitUntilNotState(ManagedLifecycleState.STARTING, getTerminationPeriod()) ;
-        try
-        {
-            changeState(ManagedLifecycleState.RUNNING) ;
-            doRun() ;
-        }
-        catch (final ManagedLifecycleException mle)
-        {
-            // State change was not allowed, we are already stopping.
-        }
-        catch (final Throwable th)
-        {
-            logger.warn("Unexpected error from doRun()", th) ;
-        }
-        finally
-        {
-            setRunning(ManagedLifecycleThreadState.STOPPED) ;
-        }
-    }
-    
-    /**
-     * Execute on the thread.
-     */
-    protected abstract void doRun() ;
-    
-    /**
-     * Handle the stop of the managed instance.
-     * 
-     * @throws ManagedLifecycleException for errors while stopping.
-     */
-    protected void doStop()
-        throws ManagedLifecycleException
-    {
-        runningLock.lock() ;
-        try
-        {
-            if (!isRunning())
-            {
-                throw new ManagedLifecycleException("Thread is not running") ;
-            }
-            setRunning(ManagedLifecycleThreadState.STOPPING) ;
-        }
-        finally
-        {
-            runningLock.unlock() ;
-        }
-    }
-
-    /**
-     * Handle the destroy of the managed instance.
-     * 
-     * @throws ManagedLifecycleException for errors while destroying.
-     */
-    protected void doDestroy()
-        throws ManagedLifecycleException
-    {
-        if (!waitUntilStopped())
-        {
-            throw new ManagedLifecycleException("Thread still active") ;
-        }
-    }
-    
-    /**
-     * Is the associated thread still running?
-     * @return true if the thread is still running, false otherwise.
-     */
-    public boolean isRunning()
-    {
-        return checkState(ManagedLifecycleThreadState.RUNNING) ;
-    }
-    
-    /**
-     * Is the associated thread stopped?
-     * @return true if the thread is stopped, false otherwise.
-     */
-    public boolean isStopped()
-    {
-        return checkState(ManagedLifecycleThreadState.STOPPED) ;
-    }
-    
-    /**
-     * Is the associated thread stopping?
-     * @return true if the thread is stopped, false otherwise.
-     */
-    public boolean isStopping()
-    {
-        return checkState(ManagedLifecycleThreadState.STOPPING) ;
-    }
-    
-    /**
-     * Check the state against the specified value.
-     * @param state The expected state.
-     * @return True if the thread is in the expected state, false otherwise.
-     */
-    private boolean checkState(final ManagedLifecycleThreadState state)
-    {
-        runningLock.lock() ;
-        try
-        {
-            return (this.state == state) ;
-        }
-        finally
-        {
-            runningLock.unlock() ;
-        }
-    }
-    
-    /**
-     * Set the running state.
-     * @param newState The new running state.
-     */
-    protected void setRunning(final ManagedLifecycleThreadState newState)
-    {
-        final ManagedLifecycleThreadState origState ;
-        runningLock.lock() ;
-        try
-        {
-            origState = state ;
-            state = newState ;
-            runningChanged.signalAll() ;
-        }
-        finally
-        {
-            runningLock.unlock() ;
-        }
-        fireStateChangedEvent(origState, newState) ;
-    }
-
-    /**
-     * Wait until the associated thread has changed to a state of "STOPPING".
-     * @param terminationPeriod The maximum delay expected for the termination, specified in milliseconds.
-     * @return true if the thread changes state to "STOPPING" within the expected period, false otherwise.
-     */
-    public boolean waitUntilStopping(final long terminationPeriod)
-    {
-        return waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, terminationPeriod) ;
-    }
-
-    /**
-     * Wait until the associated thread has stopped.
-     * @return true if the thread stops within the expected period, false otherwise.
-     */
-    public boolean waitUntilStopped()
-    {
-        return waitUntilStopped(getTerminationPeriod()) ;
-    }
-    
-    /**
-     * Wait until the associated thread has stopped.
-     * @param terminationPeriod The maximum delay expected for the termination, specified in milliseconds.
-     * @return true if the thread stops within the expected period, false otherwise.
-     */
-    public boolean waitUntilStopped(final long terminationPeriod)
-    {
-        return waitForRunningStateChange(ManagedLifecycleThreadState.STOPPED, terminationPeriod) ;
-    }
-    
-    /**
-     * Wait until the running state has the specified value.
-     * @param state The expected running state value.
-     * @param terminationPeriod The maximum delay expected for the termination, specified in milliseconds.
-     * @return true if the state has the specified value within the expected period, false otherwise.
-     */
-    protected boolean waitForRunningStateChange(final ManagedLifecycleThreadState state, final long terminationPeriod)
-    {
-        try
-        {
-            runningLock.lock() ;
-            try
-            {
-                if (this.state != state)
-                {
-                    final long end = System.currentTimeMillis() + terminationPeriod ;
-                    while(this.state != state)
-                    {
-                        final long delay = end - System.currentTimeMillis() ;
-                        if (delay <= 0)
-                        {
-                            break ;
-                        }
-                        runningChanged.await(delay, TimeUnit.MILLISECONDS) ;
-                    }
-                }
-                return (this.state == state) ;
-            }
-            finally
-            {
-                runningLock.unlock() ;
-            }
-        }
-        catch (final InterruptedException ie)
-        {
-            if (logger.isInfoEnabled())
-            {
-                logger.info("Interrupted while waiting for running state change") ;
-            }
-            
-            runningLock.lock() ;
-            try
-            {
-                return (this.state == state) ;
-            }
-            finally
-            {
-                runningLock.unlock() ;
-            }
-        }
-    }
-    
-    /**
-     * Add a managed lifecycle thread event listener.
-     * @param listener The listener.
-     */
-    public void addManagedLifecycleThreadEventListener(final ManagedLifecycleThreadEventListener listener)
-    {
-        listeners.add(listener) ;
-    }
-    
-    /**
-     * Remove a managed lifecycle thread event listener.
-     * @param listener The listener.
-     */
-    public void removeManagedLifecycleThreadEventListener(final ManagedLifecycleThreadEventListener listener)
-    {
-        listeners.remove(listener) ;
-    }
-    
-    /**
-     * Fire the state changed event.
-     * @param origState The original state, prior to transition
-     * @param newState The new state after transition
-     */
-    private void fireStateChangedEvent(final ManagedLifecycleThreadState origState, final ManagedLifecycleThreadState newState)
-    {
-        if (listeners.size() > 0)
-        {
-            final ManagedLifecycleThreadStateEvent event = new ManagedLifecycleThreadStateEvent(this, origState, newState) ;
-            for(ManagedLifecycleThreadEventListener listener: listeners)
-            {
-                listener.stateChanged(event) ;
-            }
-        }
-    }
-    
-    /**
-     * Deserialise this managed lifecycle.
-     * @param in The input stream.
-     * @throws IOException for errors generated by the input stream.
-     * @throws ClassNotFoundException For classpath errors.
-     */
-    private void readObject(final ObjectInputStream in)
-        throws IOException, ClassNotFoundException
-    {
-        in.defaultReadObject() ;
-        state = ManagedLifecycleThreadState.STOPPED ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractThreadedManagedLifecycle.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractThreadedManagedLifecycle.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractThreadedManagedLifecycle.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/AbstractThreadedManagedLifecycle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,367 @@
+/*
+ * 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.lifecycle;
+
+import java.io.IOException;
+import java.io.ObjectInputStream;
+import java.util.Set;
+import java.util.concurrent.CopyOnWriteArraySet;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+
+/**
+ * This class provides threaded support for a managed instance.
+ * 
+ * @author kevin
+ */
+public abstract class AbstractThreadedManagedLifecycle extends AbstractManagedLifecycle implements Runnable
+{
+    /**
+     * The logger for this class.
+     */
+    private static final Logger logger = Logger.getLogger(AbstractThreadedManagedLifecycle.class) ;
+    
+    /**
+     * The lock used for managing the running state.
+     */
+    private final Lock runningLock = new ReentrantLock() ;
+    /**
+     * The condition used for running state changes.
+     */
+    private final Condition runningChanged = runningLock.newCondition() ;
+    
+    /**
+     * The running state.
+     */
+    private transient ManagedLifecycleThreadState state = ManagedLifecycleThreadState.STOPPED ;
+    
+    /**
+     * The list of listeners associated with this managed instance.
+     */
+    private Set<ManagedLifecycleThreadEventListener> listeners = new CopyOnWriteArraySet<ManagedLifecycleThreadEventListener>() ;
+    
+
+    /**
+     * Construct the threaded managed lifecycle.
+     * @param config The configuration associated with this instance.
+     * @throws ConfigurationException for configuration errors during initialisation.
+     */
+    protected AbstractThreadedManagedLifecycle(final ConfigTree config)
+        throws ConfigurationException
+    {
+        super(config) ;
+    }
+    
+    /**
+     * Handle the start of the managed instance.
+     * 
+     * @throws ManagedLifecycleException for errors while starting.
+     */
+    protected void doStart()
+        throws ManagedLifecycleException
+    {
+        runningLock.lock() ;
+        try
+        {
+            if (!waitUntilStopped())
+            {
+                throw new ManagedLifecycleException("Thread still active from previous start") ;
+            }
+            setRunning(ManagedLifecycleThreadState.RUNNING) ;
+        }
+        finally
+        {
+            runningLock.unlock() ;
+        }
+        final Thread thread = new Thread(this) ;
+        thread.start() ;
+    }
+    
+    /**
+     * The thread execution method.
+     */
+    public final void run()
+    {
+        waitUntilNotState(ManagedLifecycleState.STARTING, getTerminationPeriod()) ;
+        try
+        {
+            changeState(ManagedLifecycleState.RUNNING) ;
+            doRun() ;
+        }
+        catch (final ManagedLifecycleException mle)
+        {
+            // State change was not allowed, we are already stopping.
+        }
+        catch (final Throwable th)
+        {
+            logger.warn("Unexpected error from doRun()", th) ;
+        }
+        finally
+        {
+            setRunning(ManagedLifecycleThreadState.STOPPED) ;
+        }
+    }
+    
+    /**
+     * Execute on the thread.
+     */
+    protected abstract void doRun() ;
+    
+    /**
+     * Handle the stop of the managed instance.
+     * 
+     * @throws ManagedLifecycleException for errors while stopping.
+     */
+    protected void doStop()
+        throws ManagedLifecycleException
+    {
+        runningLock.lock() ;
+        try
+        {
+            if (!isRunning())
+            {
+                throw new ManagedLifecycleException("Thread is not running") ;
+            }
+            setRunning(ManagedLifecycleThreadState.STOPPING) ;
+        }
+        finally
+        {
+            runningLock.unlock() ;
+        }
+    }
+
+    /**
+     * Handle the destroy of the managed instance.
+     * 
+     * @throws ManagedLifecycleException for errors while destroying.
+     */
+    protected void doDestroy()
+        throws ManagedLifecycleException
+    {
+        if (!waitUntilStopped())
+        {
+            throw new ManagedLifecycleException("Thread still active") ;
+        }
+    }
+    
+    /**
+     * Is the associated thread still running?
+     * @return true if the thread is still running, false otherwise.
+     */
+    public boolean isRunning()
+    {
+        return checkState(ManagedLifecycleThreadState.RUNNING) ;
+    }
+    
+    /**
+     * Is the associated thread stopped?
+     * @return true if the thread is stopped, false otherwise.
+     */
+    public boolean isStopped()
+    {
+        return checkState(ManagedLifecycleThreadState.STOPPED) ;
+    }
+    
+    /**
+     * Is the associated thread stopping?
+     * @return true if the thread is stopped, false otherwise.
+     */
+    public boolean isStopping()
+    {
+        return checkState(ManagedLifecycleThreadState.STOPPING) ;
+    }
+    
+    /**
+     * Check the state against the specified value.
+     * @param state The expected state.
+     * @return True if the thread is in the expected state, false otherwise.
+     */
+    private boolean checkState(final ManagedLifecycleThreadState state)
+    {
+        runningLock.lock() ;
+        try
+        {
+            return (this.state == state) ;
+        }
+        finally
+        {
+            runningLock.unlock() ;
+        }
+    }
+    
+    /**
+     * Set the running state.
+     * @param newState The new running state.
+     */
+    protected void setRunning(final ManagedLifecycleThreadState newState)
+    {
+        final ManagedLifecycleThreadState origState ;
+        runningLock.lock() ;
+        try
+        {
+            origState = state ;
+            state = newState ;
+            runningChanged.signalAll() ;
+        }
+        finally
+        {
+            runningLock.unlock() ;
+        }
+        fireStateChangedEvent(origState, newState) ;
+    }
+
+    /**
+     * Wait until the associated thread has changed to a state of "STOPPING".
+     * @param terminationPeriod The maximum delay expected for the termination, specified in milliseconds.
+     * @return true if the thread changes state to "STOPPING" within the expected period, false otherwise.
+     */
+    public boolean waitUntilStopping(final long terminationPeriod)
+    {
+        return waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, terminationPeriod) ;
+    }
+
+    /**
+     * Wait until the associated thread has stopped.
+     * @return true if the thread stops within the expected period, false otherwise.
+     */
+    public boolean waitUntilStopped()
+    {
+        return waitUntilStopped(getTerminationPeriod()) ;
+    }
+    
+    /**
+     * Wait until the associated thread has stopped.
+     * @param terminationPeriod The maximum delay expected for the termination, specified in milliseconds.
+     * @return true if the thread stops within the expected period, false otherwise.
+     */
+    public boolean waitUntilStopped(final long terminationPeriod)
+    {
+        return waitForRunningStateChange(ManagedLifecycleThreadState.STOPPED, terminationPeriod) ;
+    }
+    
+    /**
+     * Wait until the running state has the specified value.
+     * @param state The expected running state value.
+     * @param terminationPeriod The maximum delay expected for the termination, specified in milliseconds.
+     * @return true if the state has the specified value within the expected period, false otherwise.
+     */
+    protected boolean waitForRunningStateChange(final ManagedLifecycleThreadState state, final long terminationPeriod)
+    {
+        try
+        {
+            runningLock.lock() ;
+            try
+            {
+                if (this.state != state)
+                {
+                    final long end = System.currentTimeMillis() + terminationPeriod ;
+                    while(this.state != state)
+                    {
+                        final long delay = end - System.currentTimeMillis() ;
+                        if (delay <= 0)
+                        {
+                            break ;
+                        }
+                        runningChanged.await(delay, TimeUnit.MILLISECONDS) ;
+                    }
+                }
+                return (this.state == state) ;
+            }
+            finally
+            {
+                runningLock.unlock() ;
+            }
+        }
+        catch (final InterruptedException ie)
+        {
+            if (logger.isInfoEnabled())
+            {
+                logger.info("Interrupted while waiting for running state change") ;
+            }
+            
+            runningLock.lock() ;
+            try
+            {
+                return (this.state == state) ;
+            }
+            finally
+            {
+                runningLock.unlock() ;
+            }
+        }
+    }
+    
+    /**
+     * Add a managed lifecycle thread event listener.
+     * @param listener The listener.
+     */
+    public void addManagedLifecycleThreadEventListener(final ManagedLifecycleThreadEventListener listener)
+    {
+        listeners.add(listener) ;
+    }
+    
+    /**
+     * Remove a managed lifecycle thread event listener.
+     * @param listener The listener.
+     */
+    public void removeManagedLifecycleThreadEventListener(final ManagedLifecycleThreadEventListener listener)
+    {
+        listeners.remove(listener) ;
+    }
+    
+    /**
+     * Fire the state changed event.
+     * @param origState The original state, prior to transition
+     * @param newState The new state after transition
+     */
+    private void fireStateChangedEvent(final ManagedLifecycleThreadState origState, final ManagedLifecycleThreadState newState)
+    {
+        if (listeners.size() > 0)
+        {
+            final ManagedLifecycleThreadStateEvent event = new ManagedLifecycleThreadStateEvent(this, origState, newState) ;
+            for(ManagedLifecycleThreadEventListener listener: listeners)
+            {
+                listener.stateChanged(event) ;
+            }
+        }
+    }
+    
+    /**
+     * Deserialise this managed lifecycle.
+     * @param in The input stream.
+     * @throws IOException for errors generated by the input stream.
+     * @throws ClassNotFoundException For classpath errors.
+     */
+    private void readObject(final ObjectInputStream in)
+        throws IOException, ClassNotFoundException
+    {
+        in.defaultReadObject() ;
+        state = ManagedLifecycleThreadState.STOPPED ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycle.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycle.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,99 +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.lifecycle;
-
-public interface ManagedLifecycle
-{
-
-    /**
-     * Initialise the managed instance.
-     * <p/>
-     * This method is called after the managed instance has been instantiated so that
-     * configuration options can be validated.
-     * 
-     * @throws ManagedLifecycleException for errors during initialisation.
-     */
-    public void initialise()
-        throws ManagedLifecycleException ;
-
-    /**
-     * Start the managed instance.
-     * <p/>
-     * This method is called to inform the managed instance that it can initialise
-     * resources prior to enabling the service.
-     */
-    public void start()
-        throws ManagedLifecycleException ;
-
-    /**
-     * Stop the managed instance.
-     * <p/>
-     * This method is called to inform the managed instance that it must disable
-     * resources associated with the running service.  The service may choose to
-     * disable the resources asynchronously provided that any subsequent call to
-     * {@link #start()} or {@link #destroy()} blocks until these resources have been
-     * disabled. 
-     */
-    public void stop()
-        throws ManagedLifecycleException ;
-
-    /**
-     * Destroy the managed instance.
-     * <p/>
-     * This method is called prior to the release of the managed instance.  All
-     * resources associated with this managed instance should be released as the
-     * instance will no longer be used.
-     */
-    public void destroy()
-        throws ManagedLifecycleException ;
-
-    /**
-     * Get the state of the managed instance.
-     * @return The managed instance state.
-     */
-    public ManagedLifecycleState getState() ;
-
-    /**
-     * Wait until the managed instance has transitioned into the DESTROYED state.
-     * @return true if the transition occurs within the expected period, false otherwise.
-     */
-    public boolean waitUntilDestroyed() ;
-
-    /**
-     * Wait until the managed instance has transitioned into the DESTROYED state.
-     * @param transitionPeriod The maximum delay expected for the transition, specified in milliseconds.
-     * @return true if the transition occurs within the expected period, false otherwise.
-     */
-    public boolean waitUntilDestroyed(final long transitionPeriod) ;
-
-    /**
-     * Add a managed lifecycle event listener.
-     * @param listener The listener.
-     */
-    public void addManagedLifecycleEventListener(final ManagedLifecycleEventListener listener) ;
-
-    /**
-     * Remove a managed lifecycle event listener.
-     * @param listener The listener.
-     */
-    public void removeManagedLifecycleEventListener(final ManagedLifecycleEventListener listener) ;
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycle.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycle.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycle.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,99 @@
+/*
+ * 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.lifecycle;
+
+public interface ManagedLifecycle
+{
+
+    /**
+     * Initialise the managed instance.
+     * <p/>
+     * This method is called after the managed instance has been instantiated so that
+     * configuration options can be validated.
+     * 
+     * @throws ManagedLifecycleException for errors during initialisation.
+     */
+    public void initialise()
+        throws ManagedLifecycleException ;
+
+    /**
+     * Start the managed instance.
+     * <p/>
+     * This method is called to inform the managed instance that it can initialise
+     * resources prior to enabling the service.
+     */
+    public void start()
+        throws ManagedLifecycleException ;
+
+    /**
+     * Stop the managed instance.
+     * <p/>
+     * This method is called to inform the managed instance that it must disable
+     * resources associated with the running service.  The service may choose to
+     * disable the resources asynchronously provided that any subsequent call to
+     * {@link #start()} or {@link #destroy()} blocks until these resources have been
+     * disabled. 
+     */
+    public void stop()
+        throws ManagedLifecycleException ;
+
+    /**
+     * Destroy the managed instance.
+     * <p/>
+     * This method is called prior to the release of the managed instance.  All
+     * resources associated with this managed instance should be released as the
+     * instance will no longer be used.
+     */
+    public void destroy()
+        throws ManagedLifecycleException ;
+
+    /**
+     * Get the state of the managed instance.
+     * @return The managed instance state.
+     */
+    public ManagedLifecycleState getState() ;
+
+    /**
+     * Wait until the managed instance has transitioned into the DESTROYED state.
+     * @return true if the transition occurs within the expected period, false otherwise.
+     */
+    public boolean waitUntilDestroyed() ;
+
+    /**
+     * Wait until the managed instance has transitioned into the DESTROYED state.
+     * @param transitionPeriod The maximum delay expected for the transition, specified in milliseconds.
+     * @return true if the transition occurs within the expected period, false otherwise.
+     */
+    public boolean waitUntilDestroyed(final long transitionPeriod) ;
+
+    /**
+     * Add a managed lifecycle event listener.
+     * @param listener The listener.
+     */
+    public void addManagedLifecycleEventListener(final ManagedLifecycleEventListener listener) ;
+
+    /**
+     * Remove a managed lifecycle event listener.
+     * @param listener The listener.
+     */
+    public void removeManagedLifecycleEventListener(final ManagedLifecycleEventListener listener) ;
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,303 +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.lifecycle;
-
-import java.util.Collection;
-
-import javax.jms.JMSException;
-
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.helpers.NamingContext;
-import org.jboss.soa.esb.lifecycle.LifecycleIdentity;
-
-/**
- * Controller class to manage the lifecycles of a set of managed instances.
- *
- * @author kevin
- */
-public class ManagedLifecycleController
-{
-
-   /**
-    * The managed lifecycle instances.
-    */
-   private final ManagedLifecycle[] instances;
-   /**
-    * The lifecycle identity.
-    */
-   private final String lifecycleIdentity ;
-
-    /**
-    * Construct the controller to manage the specified managed lifecycle instances.
-    *
-    * @param lifecycles The managed lifecycle instances.
-    */
-   public ManagedLifecycleController(final Collection<ManagedLifecycle> lifecycles)
-   {
-      if(lifecycles == null) {
-          instances = new ManagedLifecycle[0];
-      } else {
-          instances = lifecycles.toArray(new ManagedLifecycle[lifecycles.size()]);
-      }
-      lifecycleIdentity = LifecycleIdentity.getSingleton().getNextLifecycleIdentity() ;
-      CourierFactory.initialiseLifecycleIdentityMap(lifecycleIdentity) ;
-   }
-
-   /**
-    * Start the lifecyles for the managed instances.
-    * <p/>
-    * The managed instances will be left in the destroyed state if an error occurs.
-    *
-    * @throws ManagedLifecycleException For errors during the lifecycle start.
-    */
-   public void start()
-           throws ManagedLifecycleException
-   {
-      final LifecycleIdentity lifecycleIdentitySingleton = LifecycleIdentity.getSingleton() ;
-      final String currentIdentity = lifecycleIdentitySingleton.getThreadLifecycleIdentity() ;
-
-      try
-      {
-         lifecycleIdentitySingleton.setThreadLifecycleIdentity(lifecycleIdentity) ;
-         initialiseInstances();
-         startInstances();
-      }
-      finally
-      {
-         lifecycleIdentitySingleton.setThreadLifecycleIdentity(currentIdentity) ;
-      }
-   }
-
-    /**
-    * Restart the lifecyles for the managed instances.
-    * <p/>
-    * The managed instances will be left in the destroyed state if an error occurs.
-    *
-    * @throws ManagedLifecycleException For errors during the lifecycle restart.
-    */
-   public void restart()
-           throws ManagedLifecycleException
-   {
-      final LifecycleIdentity lifecycleIdentitySingleton = LifecycleIdentity.getSingleton() ;
-      final String currentIdentity = lifecycleIdentitySingleton.getThreadLifecycleIdentity() ;
-      try
-      {
-         lifecycleIdentitySingleton.setThreadLifecycleIdentity(lifecycleIdentity) ;
-         stopInstances();
-         startInstances();
-      }
-      finally
-      {
-         lifecycleIdentitySingleton.setThreadLifecycleIdentity(currentIdentity) ;
-      }
-   }
-
-   /**
-    * Stop the lifecyles for the managed instances.
-    * <p/>
-    * The managed instances will be left in the destroyed state if an error occurs.
-    *
-    * @throws ManagedLifecycleException For errors during the lifecycle stop.
-    */
-   public void stop()
-           throws ManagedLifecycleException
-   {
-      final LifecycleIdentity lifecycleIdentitySingleton = LifecycleIdentity.getSingleton() ;
-      final String currentIdentity = lifecycleIdentitySingleton.getThreadLifecycleIdentity() ;
-      try
-      {
-         lifecycleIdentitySingleton.setThreadLifecycleIdentity(lifecycleIdentity) ;
-         stopInstances();
-         destroyInstances();
-
-         // Cleanup resources.
-         CourierFactory.releaseCouriers() ;
-         CourierFactory.destroyLifecycleIdentityMap(lifecycleIdentity) ;
-         try
-         {
-            JmsConnectionPoolContainer.removeAllPools() ;
-         }
-         catch (final JMSException jmse)
-         {
-            throw new ManagedLifecycleException("Unexpected exception clearing JMS pools", jmse) ;
-         }
-         NamingContext.closeAllContexts();
-      }
-      finally
-      {
-         lifecycleIdentitySingleton.setThreadLifecycleIdentity(currentIdentity) ;
-      }
-   }
-
-   /**
-    * Initialise the managed instances.
-    *
-    * @throws ManagedLifecycleException For errors during initialisation.
-    */
-   private void initialiseInstances()
-           throws ManagedLifecycleException
-   {
-      final int numInstances = instances.length;
-      for (int count = 0; count < numInstances; count++)
-      {
-         final ManagedLifecycle instance = instances[count];
-         try
-         {
-            instance.initialise();
-         }
-         catch (final ManagedLifecycleException mle)
-         {
-            if (count > 0)
-            {
-               destroyInstances(count - 1);
-            }
-            throw mle;
-         }
-      }
-   }
-
-   /**
-    * Start the managed instances.
-    *
-    * @throws ManagedLifecycleException For errors during starting.
-    */
-   private void startInstances()
-           throws ManagedLifecycleException
-   {
-      final int numInstances = instances.length;
-      for (int count = 0; count < numInstances; count++)
-      {
-         final ManagedLifecycle instance = instances[count];
-         try
-         {
-            instance.start();
-         }
-         catch (final ManagedLifecycleException mle)
-         {
-            if (count > 0)
-            {
-               stopInstances(count - 1);
-               destroyInstances(numInstances - 1);
-            }
-            throw mle;
-         }
-      }
-   }
-
-   /**
-    * Stop the managed instances.
-    *
-    * @throws ManagedLifecycleException For errors during stopping.
-    */
-   private void stopInstances()
-           throws ManagedLifecycleException
-   {
-      final int numInstances = instances.length;
-      for (int count = numInstances - 1; count >= 0; count--)
-      {
-         final ManagedLifecycle instance = instances[count];
-         try
-         {
-            instance.stop();
-         }
-         catch (final ManagedLifecycleException mle)
-         {
-            if (count > 0)
-            {
-               stopInstances(count - 1);
-               destroyInstances(numInstances - 1);
-            }
-            throw mle;
-         }
-      }
-   }
-
-   /**
-    * Destroy the managed instances.
-    *
-    * @throws ManagedLifecycleException For errors during destruction.
-    */
-   private void destroyInstances()
-           throws ManagedLifecycleException
-   {
-      final int numInstances = instances.length;
-      for (int count = numInstances - 1; count >= 0; count--)
-      {
-         final ManagedLifecycle instance = instances[count];
-         try
-         {
-            instance.destroy();
-         }
-         catch (final ManagedLifecycleException mle)
-         {
-            if (count > 0)
-            {
-               destroyInstances(count - 1);
-            }
-            throw mle;
-         }
-      }
-   }
-
-   /**
-    * Silently stop a partial set of the managed instances.
-    *
-    * @param firstInstance The index of the first instance to stop
-    */
-   private void stopInstances(final int firstInstance)
-           throws ManagedLifecycleException
-   {
-      for (int count = firstInstance; count >= 0; count--)
-      {
-         final ManagedLifecycle instance = instances[count];
-         try
-         {
-            instance.stop();
-         }
-         catch (final ManagedLifecycleException mle)
-         {
-         } // Ignore exception
-      }
-   }
-
-   /**
-    * Silently destroy a partial set of the managed instances.
-    *
-    * @param firstInstance The index of the first instance to stop
-    */
-   private void destroyInstances(final int firstInstance)
-           throws ManagedLifecycleException
-   {
-      for (int count = firstInstance; count >= 0; count--)
-      {
-         final ManagedLifecycle instance = instances[count];
-         try
-         {
-            instance.destroy();
-         }
-         catch (final ManagedLifecycleException mle)
-         {
-         } // Ignore exception
-      }
-   }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleController.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,303 @@
+/*
+ * 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.lifecycle;
+
+import java.util.Collection;
+
+import javax.jms.JMSException;
+
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.helpers.NamingContext;
+import org.jboss.soa.esb.lifecycle.LifecycleIdentity;
+
+/**
+ * Controller class to manage the lifecycles of a set of managed instances.
+ *
+ * @author kevin
+ */
+public class ManagedLifecycleController
+{
+
+   /**
+    * The managed lifecycle instances.
+    */
+   private final ManagedLifecycle[] instances;
+   /**
+    * The lifecycle identity.
+    */
+   private final String lifecycleIdentity ;
+
+    /**
+    * Construct the controller to manage the specified managed lifecycle instances.
+    *
+    * @param lifecycles The managed lifecycle instances.
+    */
+   public ManagedLifecycleController(final Collection<ManagedLifecycle> lifecycles)
+   {
+      if(lifecycles == null) {
+          instances = new ManagedLifecycle[0];
+      } else {
+          instances = lifecycles.toArray(new ManagedLifecycle[lifecycles.size()]);
+      }
+      lifecycleIdentity = LifecycleIdentity.getSingleton().getNextLifecycleIdentity() ;
+      CourierFactory.initialiseLifecycleIdentityMap(lifecycleIdentity) ;
+   }
+
+   /**
+    * Start the lifecyles for the managed instances.
+    * <p/>
+    * The managed instances will be left in the destroyed state if an error occurs.
+    *
+    * @throws ManagedLifecycleException For errors during the lifecycle start.
+    */
+   public void start()
+           throws ManagedLifecycleException
+   {
+      final LifecycleIdentity lifecycleIdentitySingleton = LifecycleIdentity.getSingleton() ;
+      final String currentIdentity = lifecycleIdentitySingleton.getThreadLifecycleIdentity() ;
+
+      try
+      {
+         lifecycleIdentitySingleton.setThreadLifecycleIdentity(lifecycleIdentity) ;
+         initialiseInstances();
+         startInstances();
+      }
+      finally
+      {
+         lifecycleIdentitySingleton.setThreadLifecycleIdentity(currentIdentity) ;
+      }
+   }
+
+    /**
+    * Restart the lifecyles for the managed instances.
+    * <p/>
+    * The managed instances will be left in the destroyed state if an error occurs.
+    *
+    * @throws ManagedLifecycleException For errors during the lifecycle restart.
+    */
+   public void restart()
+           throws ManagedLifecycleException
+   {
+      final LifecycleIdentity lifecycleIdentitySingleton = LifecycleIdentity.getSingleton() ;
+      final String currentIdentity = lifecycleIdentitySingleton.getThreadLifecycleIdentity() ;
+      try
+      {
+         lifecycleIdentitySingleton.setThreadLifecycleIdentity(lifecycleIdentity) ;
+         stopInstances();
+         startInstances();
+      }
+      finally
+      {
+         lifecycleIdentitySingleton.setThreadLifecycleIdentity(currentIdentity) ;
+      }
+   }
+
+   /**
+    * Stop the lifecyles for the managed instances.
+    * <p/>
+    * The managed instances will be left in the destroyed state if an error occurs.
+    *
+    * @throws ManagedLifecycleException For errors during the lifecycle stop.
+    */
+   public void stop()
+           throws ManagedLifecycleException
+   {
+      final LifecycleIdentity lifecycleIdentitySingleton = LifecycleIdentity.getSingleton() ;
+      final String currentIdentity = lifecycleIdentitySingleton.getThreadLifecycleIdentity() ;
+      try
+      {
+         lifecycleIdentitySingleton.setThreadLifecycleIdentity(lifecycleIdentity) ;
+         stopInstances();
+         destroyInstances();
+
+         // Cleanup resources.
+         CourierFactory.releaseCouriers() ;
+         CourierFactory.destroyLifecycleIdentityMap(lifecycleIdentity) ;
+         try
+         {
+            JmsConnectionPoolContainer.removeAllPools() ;
+         }
+         catch (final JMSException jmse)
+         {
+            throw new ManagedLifecycleException("Unexpected exception clearing JMS pools", jmse) ;
+         }
+         NamingContext.closeAllContexts();
+      }
+      finally
+      {
+         lifecycleIdentitySingleton.setThreadLifecycleIdentity(currentIdentity) ;
+      }
+   }
+
+   /**
+    * Initialise the managed instances.
+    *
+    * @throws ManagedLifecycleException For errors during initialisation.
+    */
+   private void initialiseInstances()
+           throws ManagedLifecycleException
+   {
+      final int numInstances = instances.length;
+      for (int count = 0; count < numInstances; count++)
+      {
+         final ManagedLifecycle instance = instances[count];
+         try
+         {
+            instance.initialise();
+         }
+         catch (final ManagedLifecycleException mle)
+         {
+            if (count > 0)
+            {
+               destroyInstances(count - 1);
+            }
+            throw mle;
+         }
+      }
+   }
+
+   /**
+    * Start the managed instances.
+    *
+    * @throws ManagedLifecycleException For errors during starting.
+    */
+   private void startInstances()
+           throws ManagedLifecycleException
+   {
+      final int numInstances = instances.length;
+      for (int count = 0; count < numInstances; count++)
+      {
+         final ManagedLifecycle instance = instances[count];
+         try
+         {
+            instance.start();
+         }
+         catch (final ManagedLifecycleException mle)
+         {
+            if (count > 0)
+            {
+               stopInstances(count - 1);
+               destroyInstances(numInstances - 1);
+            }
+            throw mle;
+         }
+      }
+   }
+
+   /**
+    * Stop the managed instances.
+    *
+    * @throws ManagedLifecycleException For errors during stopping.
+    */
+   private void stopInstances()
+           throws ManagedLifecycleException
+   {
+      final int numInstances = instances.length;
+      for (int count = numInstances - 1; count >= 0; count--)
+      {
+         final ManagedLifecycle instance = instances[count];
+         try
+         {
+            instance.stop();
+         }
+         catch (final ManagedLifecycleException mle)
+         {
+            if (count > 0)
+            {
+               stopInstances(count - 1);
+               destroyInstances(numInstances - 1);
+            }
+            throw mle;
+         }
+      }
+   }
+
+   /**
+    * Destroy the managed instances.
+    *
+    * @throws ManagedLifecycleException For errors during destruction.
+    */
+   private void destroyInstances()
+           throws ManagedLifecycleException
+   {
+      final int numInstances = instances.length;
+      for (int count = numInstances - 1; count >= 0; count--)
+      {
+         final ManagedLifecycle instance = instances[count];
+         try
+         {
+            instance.destroy();
+         }
+         catch (final ManagedLifecycleException mle)
+         {
+            if (count > 0)
+            {
+               destroyInstances(count - 1);
+            }
+            throw mle;
+         }
+      }
+   }
+
+   /**
+    * Silently stop a partial set of the managed instances.
+    *
+    * @param firstInstance The index of the first instance to stop
+    */
+   private void stopInstances(final int firstInstance)
+           throws ManagedLifecycleException
+   {
+      for (int count = firstInstance; count >= 0; count--)
+      {
+         final ManagedLifecycle instance = instances[count];
+         try
+         {
+            instance.stop();
+         }
+         catch (final ManagedLifecycleException mle)
+         {
+         } // Ignore exception
+      }
+   }
+
+   /**
+    * Silently destroy a partial set of the managed instances.
+    *
+    * @param firstInstance The index of the first instance to stop
+    */
+   private void destroyInstances(final int firstInstance)
+           throws ManagedLifecycleException
+   {
+      for (int count = firstInstance; count >= 0; count--)
+      {
+         final ManagedLifecycle instance = instances[count];
+         try
+         {
+            instance.destroy();
+         }
+         catch (final ManagedLifecycleException mle)
+         {
+         } // Ignore exception
+      }
+   }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleEventListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleEventListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleEventListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,38 +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.lifecycle;
-
-import java.util.EventListener;
-
-/**
- * This interface represents the lifecycle events generated by a managed instance.
- * 
- * @author kevin
- */
-public interface ManagedLifecycleEventListener extends EventListener
-{
-    /**
-     * The state of the managed instance has changed.
-     * @param event The managed lifecycle state event.
-     */
-    public void stateChanged(final ManagedLifecycleStateEvent event) ;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleEventListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleEventListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleEventListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleEventListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,38 @@
+/*
+ * 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.lifecycle;
+
+import java.util.EventListener;
+
+/**
+ * This interface represents the lifecycle events generated by a managed instance.
+ * 
+ * @author kevin
+ */
+public interface ManagedLifecycleEventListener extends EventListener
+{
+    /**
+     * The state of the managed instance has changed.
+     * @param event The managed lifecycle state event.
+     */
+    public void stateChanged(final ManagedLifecycleStateEvent event) ;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,69 +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.lifecycle;
-
-/**
- * Exception representing errors in a managed lifecycle.
- * @author kevin
- */
-public class ManagedLifecycleException extends Exception
-{
-    /**
-     * serial version UID of this exception.
-     */
-    private static final long serialVersionUID = -2461030864678547990L;
-
-    /**
-     * Construct a default managed lifecycle exception.
-     */
-    public ManagedLifecycleException()
-    {
-    }
-
-    /**
-     * Construct a managed lifecycle exception with the specified message.
-     * @param message The exception message.
-     */
-    public ManagedLifecycleException(final String message) 
-    {
-	super(message);
-    }
-
-    /**
-     * Construct a managed lifecycle exception with the associated cause.
-     * @param cause The associated cause.
-     */
-    public ManagedLifecycleException(final Throwable cause)
-    {
-	super(cause);
-    }
-
-    /**
-     * Construct a managed lifecycle exception with the specified message and associated cause.
-     * @param message The exception message.
-     * @param cause The associated cause.
-     */
-    public ManagedLifecycleException(String message, Throwable cause)
-    {
-	super(message, cause);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,69 @@
+/*
+ * 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.lifecycle;
+
+/**
+ * Exception representing errors in a managed lifecycle.
+ * @author kevin
+ */
+public class ManagedLifecycleException extends Exception
+{
+    /**
+     * serial version UID of this exception.
+     */
+    private static final long serialVersionUID = -2461030864678547990L;
+
+    /**
+     * Construct a default managed lifecycle exception.
+     */
+    public ManagedLifecycleException()
+    {
+    }
+
+    /**
+     * Construct a managed lifecycle exception with the specified message.
+     * @param message The exception message.
+     */
+    public ManagedLifecycleException(final String message) 
+    {
+	super(message);
+    }
+
+    /**
+     * Construct a managed lifecycle exception with the associated cause.
+     * @param cause The associated cause.
+     */
+    public ManagedLifecycleException(final Throwable cause)
+    {
+	super(cause);
+    }
+
+    /**
+     * Construct a managed lifecycle exception with the specified message and associated cause.
+     * @param message The exception message.
+     * @param cause The associated cause.
+     */
+    public ManagedLifecycleException(String message, Throwable cause)
+    {
+	super(message, cause);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,61 +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.lifecycle;
-
-/**
- * This enumeration represents the lifecycle state of a managed instance.
- * <p/>
- * Allowable transitions are as follows
- * <table border="1">
- * <thead>
- * <tr><th>Originating state</th><th>New states</th></tr>
- * </thead>
- * <tbody>
- * <tr><td>CONSTRUCTED</td><td>INITIALISING</td></tr>
- * <tr><td>INITIALISING</td><td>INITIALISED, DESTROYED</td></tr>
- * <tr><td>INITIALISED</td><td>STARTING, DESTROYED</td></tr>
- * <tr><td>STARTING</td><td>STARTED, STOPPED</td></tr>
- * <tr><td>STARTED</td><td>RUNNING, STOPPING</td></tr>
- * <tr><td>RUNNING</td><td>STOPPING</td></tr>
- * <tr><td>STOPPING</td><td>STOPPED</td></tr>
- * <tr><td>STOPPED</td><td>STARTING, DESTROYING</td></tr>
- * <tr><td>DESTROYING</td><td>DESTROYED</td></tr>
- * </tbody>
- * </table>
- * 
- * @author kevin
- */
-public enum ManagedLifecycleState
-{
-    CONSTRUCTED { public boolean canTransition(final ManagedLifecycleState newState) { return (newState == INITIALISING) ;}} ,
-    INITIALISING { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == INITIALISED) || (newState == DESTROYED)) ;}} ,
-    INITIALISED { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == STARTING) || (newState == DESTROYED)) ;}} ,
-    STARTING { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == STARTED) || (newState == STOPPED)) ;}} ,
-    STARTED { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == RUNNING) || (newState == STOPPING)) ;}} ,
-    RUNNING { public boolean canTransition(final ManagedLifecycleState newState) { return (newState == STOPPING) ;}} ,
-    STOPPING { public boolean canTransition(final ManagedLifecycleState newState) { return (newState == STOPPED) ;}} ,
-    STOPPED { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == STARTING) || (newState == DESTROYING)) ;}} ,
-    DESTROYING { public boolean canTransition(final ManagedLifecycleState newState) { return (newState == DESTROYED) ;}} ,
-    DESTROYED  { public boolean canTransition(final ManagedLifecycleState newState) { return false ;}} ;
-    
-    public abstract boolean canTransition(final ManagedLifecycleState newState) ;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleState.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,61 @@
+/*
+ * 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.lifecycle;
+
+/**
+ * This enumeration represents the lifecycle state of a managed instance.
+ * <p/>
+ * Allowable transitions are as follows
+ * <table border="1">
+ * <thead>
+ * <tr><th>Originating state</th><th>New states</th></tr>
+ * </thead>
+ * <tbody>
+ * <tr><td>CONSTRUCTED</td><td>INITIALISING</td></tr>
+ * <tr><td>INITIALISING</td><td>INITIALISED, DESTROYED</td></tr>
+ * <tr><td>INITIALISED</td><td>STARTING, DESTROYED</td></tr>
+ * <tr><td>STARTING</td><td>STARTED, STOPPED</td></tr>
+ * <tr><td>STARTED</td><td>RUNNING, STOPPING</td></tr>
+ * <tr><td>RUNNING</td><td>STOPPING</td></tr>
+ * <tr><td>STOPPING</td><td>STOPPED</td></tr>
+ * <tr><td>STOPPED</td><td>STARTING, DESTROYING</td></tr>
+ * <tr><td>DESTROYING</td><td>DESTROYED</td></tr>
+ * </tbody>
+ * </table>
+ * 
+ * @author kevin
+ */
+public enum ManagedLifecycleState
+{
+    CONSTRUCTED { public boolean canTransition(final ManagedLifecycleState newState) { return (newState == INITIALISING) ;}} ,
+    INITIALISING { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == INITIALISED) || (newState == DESTROYED)) ;}} ,
+    INITIALISED { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == STARTING) || (newState == DESTROYED)) ;}} ,
+    STARTING { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == STARTED) || (newState == STOPPED)) ;}} ,
+    STARTED { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == RUNNING) || (newState == STOPPING)) ;}} ,
+    RUNNING { public boolean canTransition(final ManagedLifecycleState newState) { return (newState == STOPPING) ;}} ,
+    STOPPING { public boolean canTransition(final ManagedLifecycleState newState) { return (newState == STOPPED) ;}} ,
+    STOPPED { public boolean canTransition(final ManagedLifecycleState newState) { return ((newState == STARTING) || (newState == DESTROYING)) ;}} ,
+    DESTROYING { public boolean canTransition(final ManagedLifecycleState newState) { return (newState == DESTROYED) ;}} ,
+    DESTROYED  { public boolean canTransition(final ManagedLifecycleState newState) { return false ;}} ;
+    
+    public abstract boolean canTransition(final ManagedLifecycleState newState) ;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleStateEvent.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleStateEvent.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleStateEvent.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.listeners.lifecycle;
-
-import java.util.EventObject;
-
-public class ManagedLifecycleStateEvent extends EventObject
-{
-    /**
-     * The serial version uid for this event.
-     */
-    private static final long serialVersionUID = 194745476487653243L;
-    
-    /**
-     * The original state, prior to transition.
-     */
-    private final ManagedLifecycleState origState ;
-    /**
-     * The new state, after transition.
-     */
-    private final ManagedLifecycleState newState ;
-    
-    /**
-     * Construct the managed lifecycle state event.
-     * @param instance The managed instance 
-     * @param origState The original state, prior to transition
-     * @param newState The new state after transition
-     */
-    public ManagedLifecycleStateEvent(final ManagedLifecycle instance, final ManagedLifecycleState origState, final ManagedLifecycleState newState)
-    {
-        super(instance) ;
-        this.origState = origState ;
-        this.newState = newState ;
-    }
-
-    /**
-     * Get the managed lifecycle instance.
-     * @return The managed lifecycle instance.
-     */
-    public ManagedLifecycle getManagedInstance()
-    {
-        return (ManagedLifecycle)getSource() ;
-    }
-
-    /**
-     * Get the original state, prior to transition.
-     * @return The original state.
-     */
-    public ManagedLifecycleState getOriginalState()
-    {
-        return origState ;
-    }
-
-    /**
-     * Get the new state after transition.
-     * @return The new state.
-     */
-    public ManagedLifecycleState getNewState()
-    {
-        return newState ;
-    }
-    
-    /**
-     * Return a String representation of this event.
-     * @return  The string representation of this event.
-     */
-    public String toString()
-    {
-        return getClass().getName() + "[instance=" + getManagedInstance() + ", original state " + origState + ", new state " + newState + "]" ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleStateEvent.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleStateEvent.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleStateEvent.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleStateEvent.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,90 @@
+/*
+ * 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.lifecycle;
+
+import java.util.EventObject;
+
+public class ManagedLifecycleStateEvent extends EventObject
+{
+    /**
+     * The serial version uid for this event.
+     */
+    private static final long serialVersionUID = 194745476487653243L;
+    
+    /**
+     * The original state, prior to transition.
+     */
+    private final ManagedLifecycleState origState ;
+    /**
+     * The new state, after transition.
+     */
+    private final ManagedLifecycleState newState ;
+    
+    /**
+     * Construct the managed lifecycle state event.
+     * @param instance The managed instance 
+     * @param origState The original state, prior to transition
+     * @param newState The new state after transition
+     */
+    public ManagedLifecycleStateEvent(final ManagedLifecycle instance, final ManagedLifecycleState origState, final ManagedLifecycleState newState)
+    {
+        super(instance) ;
+        this.origState = origState ;
+        this.newState = newState ;
+    }
+
+    /**
+     * Get the managed lifecycle instance.
+     * @return The managed lifecycle instance.
+     */
+    public ManagedLifecycle getManagedInstance()
+    {
+        return (ManagedLifecycle)getSource() ;
+    }
+
+    /**
+     * Get the original state, prior to transition.
+     * @return The original state.
+     */
+    public ManagedLifecycleState getOriginalState()
+    {
+        return origState ;
+    }
+
+    /**
+     * Get the new state after transition.
+     * @return The new state.
+     */
+    public ManagedLifecycleState getNewState()
+    {
+        return newState ;
+    }
+    
+    /**
+     * Return a String representation of this event.
+     * @return  The string representation of this event.
+     */
+    public String toString()
+    {
+        return getClass().getName() + "[instance=" + getManagedInstance() + ", original state " + origState + ", new state " + newState + "]" ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadEventListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadEventListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadEventListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,38 +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.lifecycle;
-
-import java.util.EventListener;
-
-/**
- * This interface represents the lifecycle events generated by a threaded managed instance.
- * 
- * @author kevin
- */
-public interface ManagedLifecycleThreadEventListener extends EventListener
-{
-    /**
-     * The state of the managed instance thread has changed.
-     * @param event The managed lifecycle state event.
-     */
-    public void stateChanged(final ManagedLifecycleThreadStateEvent event) ;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadEventListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadEventListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadEventListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadEventListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,38 @@
+/*
+ * 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.lifecycle;
+
+import java.util.EventListener;
+
+/**
+ * This interface represents the lifecycle events generated by a threaded managed instance.
+ * 
+ * @author kevin
+ */
+public interface ManagedLifecycleThreadEventListener extends EventListener
+{
+    /**
+     * The state of the managed instance thread has changed.
+     * @param event The managed lifecycle state event.
+     */
+    public void stateChanged(final ManagedLifecycleThreadStateEvent event) ;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadState.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadState.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadState.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,31 +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.lifecycle;
-
-/**
- * This enumeration represents the lifecycle state of a thread in an managed instance.
- * @author kevin
- */
-public enum ManagedLifecycleThreadState
-{
-    STOPPED, RUNNING, STOPPING
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadState.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadState.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadState.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadState.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,31 @@
+/*
+ * 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.lifecycle;
+
+/**
+ * This enumeration represents the lifecycle state of a thread in an managed instance.
+ * @author kevin
+ */
+public enum ManagedLifecycleThreadState
+{
+    STOPPED, RUNNING, STOPPING
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadStateEvent.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadStateEvent.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadStateEvent.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.lifecycle;
-
-import java.util.EventObject;
-
-public class ManagedLifecycleThreadStateEvent extends EventObject
-{
-    /**
-     * The serial version uid for this event.
-     */
-    private static final long serialVersionUID = 7417604654035419987L;
-    
-    /**
-     * The original state, prior to transition.
-     */
-    private final ManagedLifecycleThreadState origState ;
-    /**
-     * The new state, after transition.
-     */
-    private final ManagedLifecycleThreadState newState ;
-    
-    /**
-     * Construct the managed lifecycle state event.
-     * @param instance The managed instance 
-     * @param origState The original state, prior to transition
-     * @param newState The new state after transition
-     */
-    public ManagedLifecycleThreadStateEvent(final AbstractThreadedManagedLifecycle instance,
-        final ManagedLifecycleThreadState origState, final ManagedLifecycleThreadState newState)
-    {
-        super(instance) ;
-        this.origState = origState ;
-        this.newState = newState ;
-    }
-
-    /**
-     * Get the managed lifecycle instance.
-     * @return The managed lifecycle instance.
-     */
-    public ManagedLifecycle getManagedInstance()
-    {
-        return (ManagedLifecycle)getSource() ;
-    }
-
-    /**
-     * Get the original state, prior to transition.
-     * @return The original state.
-     */
-    public ManagedLifecycleThreadState getOriginalState()
-    {
-        return origState ;
-    }
-
-    /**
-     * Get the new state after transition.
-     * @return The new state.
-     */
-    public ManagedLifecycleThreadState getNewState()
-    {
-        return newState ;
-    }
-    
-    /**
-     * Return a String representation of this event.
-     * @return  The string representation of this event.
-     */
-    public String toString()
-    {
-        return getClass().getName() + "[instance=" + getManagedInstance() + ", original state " + origState + ", new state " + newState + "]" ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadStateEvent.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadStateEvent.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadStateEvent.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/lifecycle/ManagedLifecycleThreadStateEvent.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,91 @@
+/*
+ * 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.lifecycle;
+
+import java.util.EventObject;
+
+public class ManagedLifecycleThreadStateEvent extends EventObject
+{
+    /**
+     * The serial version uid for this event.
+     */
+    private static final long serialVersionUID = 7417604654035419987L;
+    
+    /**
+     * The original state, prior to transition.
+     */
+    private final ManagedLifecycleThreadState origState ;
+    /**
+     * The new state, after transition.
+     */
+    private final ManagedLifecycleThreadState newState ;
+    
+    /**
+     * Construct the managed lifecycle state event.
+     * @param instance The managed instance 
+     * @param origState The original state, prior to transition
+     * @param newState The new state after transition
+     */
+    public ManagedLifecycleThreadStateEvent(final AbstractThreadedManagedLifecycle instance,
+        final ManagedLifecycleThreadState origState, final ManagedLifecycleThreadState newState)
+    {
+        super(instance) ;
+        this.origState = origState ;
+        this.newState = newState ;
+    }
+
+    /**
+     * Get the managed lifecycle instance.
+     * @return The managed lifecycle instance.
+     */
+    public ManagedLifecycle getManagedInstance()
+    {
+        return (ManagedLifecycle)getSource() ;
+    }
+
+    /**
+     * Get the original state, prior to transition.
+     * @return The original state.
+     */
+    public ManagedLifecycleThreadState getOriginalState()
+    {
+        return origState ;
+    }
+
+    /**
+     * Get the new state after transition.
+     * @return The new state.
+     */
+    public ManagedLifecycleThreadState getNewState()
+    {
+        return newState ;
+    }
+    
+    /**
+     * Return a String representation of this event.
+     * @return  The string representation of this event.
+     */
+    public String toString()
+    {
+        return getClass().getName() + "[instance=" + getManagedInstance() + ", original state " + origState + ", new state " + newState + "]" ;
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/AbstractMessageComposer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/AbstractMessageComposer.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/AbstractMessageComposer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,79 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.message;
-
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-/**
- * An abstract {@link MessageComposer} implementation, containing a useful
- * default implementation.
- * <p/>
- * Implementations should be threadsafe (stateless) and must contain
- * a public default constructor.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class AbstractMessageComposer implements MessageComposer {
-
-    /**
-     * Compose the message.
-     * <p/>
-     * Override to implement alternative {@link Message} construction strategy.
-     *
-     * @param messagePayload Message payload to be packaged, or a channel specific
-     *                       container class for the message payload (e.g. a JMS message).
-     * @return ESB aware message instance.
-     * @throws MessageDeliverException Failed to compose message payload for delivery.
-     */
-    public Message compose(Object messagePayload) throws MessageDeliverException {
-        Message message = MessageFactory.getInstance().getMessage();
-
-        populateMessage(message, messagePayload);
-
-        return message;
-    }
-
-    /**
-     * Decompose the message.
-     * <p/>
-     * This implementation simple calls {@link ActionUtils#getTaskObject(org.jboss.soa.esb.message.Message)}.
-     * Override to implement an alternative {@link Message} decomposition strategy.
-     *
-     * @param message The message to be decomposed.
-     * @return The message "task object".
-     * @throws MessageDeliverException
-     */
-    public Object decompose(Message message) throws MessageDeliverException {
-        // Hopefully we can fix the Message object such that there's no need for this
-        // i.e. the message will have setContents(Object) and getContents() methods.
-        return ActionUtils.getTaskObject(message);
-    }
-
-    /**
-     * Populate
-     *
-     * @param message The message instance to be populated.
-     * @param messagePayload The message payload to to be populated into the message.
-     * @throws MessageDeliverException Unable to populate message with payload.
-     */
-    protected abstract void populateMessage(Message message, Object messagePayload) throws MessageDeliverException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/AbstractMessageComposer.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/AbstractMessageComposer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/AbstractMessageComposer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/AbstractMessageComposer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,79 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.message;
+
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+/**
+ * An abstract {@link MessageComposer} implementation, containing a useful
+ * default implementation.
+ * <p/>
+ * Implementations should be threadsafe (stateless) and must contain
+ * a public default constructor.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public abstract class AbstractMessageComposer implements MessageComposer {
+
+    /**
+     * Compose the message.
+     * <p/>
+     * Override to implement alternative {@link Message} construction strategy.
+     *
+     * @param messagePayload Message payload to be packaged, or a channel specific
+     *                       container class for the message payload (e.g. a JMS message).
+     * @return ESB aware message instance.
+     * @throws MessageDeliverException Failed to compose message payload for delivery.
+     */
+    public Message compose(Object messagePayload) throws MessageDeliverException {
+        Message message = MessageFactory.getInstance().getMessage();
+
+        populateMessage(message, messagePayload);
+
+        return message;
+    }
+
+    /**
+     * Decompose the message.
+     * <p/>
+     * This implementation simple calls {@link ActionUtils#getTaskObject(org.jboss.soa.esb.message.Message)}.
+     * Override to implement an alternative {@link Message} decomposition strategy.
+     *
+     * @param message The message to be decomposed.
+     * @return The message "task object".
+     * @throws MessageDeliverException
+     */
+    public Object decompose(Message message) throws MessageDeliverException {
+        // Hopefully we can fix the Message object such that there's no need for this
+        // i.e. the message will have setContents(Object) and getContents() methods.
+        return ActionUtils.getTaskObject(message);
+    }
+
+    /**
+     * Populate
+     *
+     * @param message The message instance to be populated.
+     * @param messagePayload The message payload to to be populated into the message.
+     * @throws MessageDeliverException Unable to populate message with payload.
+     */
+    protected abstract void populateMessage(Message message, Object messagePayload) throws MessageDeliverException;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionBeanConfigurator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionBeanConfigurator.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionBeanConfigurator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.util.Arrays;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.util.BeanConfigurator;
-
-/**
- * ActionBeanConfigurator was created because ActionMapper flattens the
- * ConfigTree by promoting child "property" elements to attributes on the parent
- * element.
- * 
- * @author <a href="mailto:rex.sheridan at sapience360.com">Rex Sheridan</a>
- * 
- */
-public class ActionBeanConfigurator extends BeanConfigurator {
-
-	/**
-	 * A list of key-value pairs to ignore because they don't actually
-	 * correspond to bean properties.
-	 */
-	private static final List<String> ignored = Arrays.asList("action",
-			ListenerTagNames.ACTION_ELEMENT_TAG,
-			ListenerTagNames.ACTION_CLASS_TAG,
-			ListenerTagNames.PROCESS_METHOD_TAG);
-
-	/**
-	 * @param config
-	 * @param bean
-	 */
-	ActionBeanConfigurator(ConfigTree config, Object bean) {
-		setBean(bean);
-		List<KeyValuePair> pairs = config.attributesAsList();
-		Map<String, String> properties = new HashMap<String, String>();
-		for (KeyValuePair kvp : pairs) {
-			if (!ignored.contains(kvp.getKey())) {
-				properties.put(kvp.getKey(), kvp.getValue());
-			}
-		}
-		ConfigTree[] children = config.getAllChildren();
-		for (ConfigTree child : children) {
-			properties.put(child.getName(), child.toXml());
-		}
-		setProperties(properties);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionBeanConfigurator.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionBeanConfigurator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionBeanConfigurator.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionBeanConfigurator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,72 @@
+/*
+ * 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.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.util.BeanConfigurator;
+
+/**
+ * ActionBeanConfigurator was created because ActionMapper flattens the
+ * ConfigTree by promoting child "property" elements to attributes on the parent
+ * element.
+ * 
+ * @author <a href="mailto:rex.sheridan at sapience360.com">Rex Sheridan</a>
+ * 
+ */
+public class ActionBeanConfigurator extends BeanConfigurator {
+
+	/**
+	 * A list of key-value pairs to ignore because they don't actually
+	 * correspond to bean properties.
+	 */
+	private static final List<String> ignored = Arrays.asList("action",
+			ListenerTagNames.ACTION_ELEMENT_TAG,
+			ListenerTagNames.ACTION_CLASS_TAG,
+			ListenerTagNames.PROCESS_METHOD_TAG);
+
+	/**
+	 * @param config
+	 * @param bean
+	 */
+	ActionBeanConfigurator(ConfigTree config, Object bean) {
+		setBean(bean);
+		List<KeyValuePair> pairs = config.attributesAsList();
+		Map<String, String> properties = new HashMap<String, String>();
+		for (KeyValuePair kvp : pairs) {
+			if (!ignored.contains(kvp.getKey())) {
+				properties.put(kvp.getKey(), kvp.getValue());
+			}
+		}
+		ConfigTree[] children = config.getAllChildren();
+		for (ConfigTree child : children) {
+			properties.put(child.getName(), child.toXml());
+		}
+		setProperties(properties);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,564 +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.ArrayList;
-import java.util.concurrent.atomic.AtomicBoolean;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionLifecycle;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingFaultException;
-import org.jboss.soa.esb.actions.BeanConfiguredAction;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.message.errors.Factory;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * Action Processing Pipeline. <p/> Runs a list of action classes on a message
- * 
- * @author <a
- *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @author kevin
- * @since Version 4.0
- */
-public class ActionProcessingPipeline
-{
-	/**
-	 * The logger instance.
-	 */
-	private final static Logger LOGGER = Logger
-			.getLogger(ActionProcessingPipeline.class);
-
-	/**
-	 * The processors.
-	 */
-	private final ActionPipelineProcessor[] processors;
-
-	/**
-	 * The active flag.
-	 */
-	private final AtomicBoolean active = new AtomicBoolean(false);
-
-	/**
-	 * public constructor
-	 * 
-	 * @param config
-	 *            The pipeline configuration.
-	 */
-	public ActionProcessingPipeline(final ConfigTree config)
-			throws ConfigurationException
-	{
-		if (config == null)
-		{
-			throw new IllegalArgumentException(
-					"Configuration needed for action classes");
-		}
-
-		final ConfigTree[] actionList = config
-				.getChildren(ListenerTagNames.ACTION_ELEMENT_TAG);
-
-		if ((actionList == null) || (actionList.length == 0))
-		{
-			throw new ConfigurationException("No actions in list");
-		}
-
-		final ArrayList<ActionPipelineProcessor> processorList = new ArrayList<ActionPipelineProcessor>();
-
-		for (final ConfigTree actionConfig : actionList)
-		{
-			final String actionClassTag = actionConfig
-					.getAttribute(ListenerTagNames.ACTION_CLASS_TAG);
-			if (LOGGER.isDebugEnabled())
-			{
-				LOGGER.debug("Registering action class " + actionClassTag);
-			}
-			final Class actionClass;
-			try
-			{
-				actionClass = ClassUtil.forName(actionClassTag, getClass());
-			}
-			catch (final ClassNotFoundException cnfe)
-			{
-				throw new ConfigurationException("Could not load action class "
-						+ actionClassTag);
-			}
-
-			final ActionPipelineProcessor processor;
-			if (BeanConfiguredAction.class.isAssignableFrom(actionClass))
-			{
-				if (LOGGER.isDebugEnabled())
-				{
-					LOGGER.debug("Using bean configured action processor for "
-							+ actionClassTag);
-				}
-				processor = new BeanConfigActionProcessor(actionConfig,
-						actionClass);
-			}
-			else if (ActionPipelineProcessor.class
-					.isAssignableFrom(actionClass))
-			{
-				final ActionPipelineProcessor currentProcessor = (ActionPipelineProcessor) ActionProcessorMethodInfo
-						.getActionClassInstance(actionConfig, actionClass);
-				if (ActionProcessorMethodInfo.checkOverridden(actionConfig))
-				{
-					if (LOGGER.isDebugEnabled())
-					{
-						LOGGER
-								.debug("Using overridden action pipeline processor for "
-										+ actionClassTag);
-					}
-					processor = new OverriddenActionPipelineProcessor(
-							actionConfig, currentProcessor);
-				}
-				else
-				{
-					if (LOGGER.isDebugEnabled())
-					{
-						LOGGER
-								.debug("Using normal action pipeline processor for "
-										+ actionClassTag);
-					}
-					processor = currentProcessor;
-				}
-			}
-			else if (ActionLifecycle.class.isAssignableFrom(actionClass))
-			{
-				if (LOGGER.isDebugEnabled())
-				{
-					LOGGER
-							.debug("Using overridden action lifecycle processor for "
-									+ actionClassTag);
-				}
-				final ActionLifecycle currentLifecycle = (ActionLifecycle) ActionProcessorMethodInfo
-						.getActionClassInstance(actionConfig, actionClass);
-				processor = new OverriddenActionLifecycleProcessor(
-						actionConfig, currentLifecycle);
-			}
-			else
-			{
-				LOGGER.warn("Action class " + actionClassTag
-						+ " does not implement the ActionLifecycle interface");
-				if (LOGGER.isDebugEnabled())
-				{
-					LOGGER.debug("Using overridden actions processor for "
-							+ actionClassTag);
-				}
-				processor = new OverriddenActionProcessor(actionConfig,
-						actionClass);
-			}
-			processorList.add(processor);
-		}
-		processors = processorList
-				.toArray(new ActionPipelineProcessor[processorList.size()]);
-	}
-
-	/**
-	 * Handle the initialisation of the pipeline
-	 * 
-	 * @throws ConfigurationException
-	 *             For errors during initialisation.
-	 */
-	public void initialise() throws ConfigurationException
-	{
-		final int numLifecycles = processors.length;
-		for (int count = 0; count < numLifecycles; count++)
-		{
-			final ActionLifecycle lifecycle = processors[count];
-			try
-			{
-				lifecycle.initialise();
-			}
-			catch (final Exception ex)
-			{
-				handleDestroy(count - 1);
-				throw new ConfigurationException(
-						"Unexpected exception during lifecycle initialisation",
-						ex);
-			}
-		}
-		active.set(true);
-	}
-
-	/**
-	 * Handle the destruction of the pipeline
-	 */
-	public void destroy()
-	{
-		active.set(false);
-		handleDestroy(processors.length - 1);
-	}
-
-	/**
-	 * Process the specified message.
-	 * 
-	 * @param message
-	 *            The current message.
-	 * @return true if the processing was successful, false otherwise.
-	 */
-	public boolean process(final Message message)
-	{
-		final EPR faultToAddress = getFaultToAddress(message);
-
-		if (active.get())
-		{
-			if (LOGGER.isDebugEnabled())
-			{
-				LOGGER.debug("pipeline process for message");
-			}
-
-			final int numProcessors = processors.length;
-			final Message[] messages = new Message[numProcessors];
-			final EPR replyToAddress = getReplyToAddress(message);
-
-			Message currentMessage = message;
-
-			for (int count = 0; count < numProcessors; count++)
-			{
-				final ActionPipelineProcessor processor = processors[count];
-				messages[count] = currentMessage;
-
-				try
-				{
-					LOGGER.debug("executing processor " + count);
-					currentMessage = processor.process(currentMessage);
-
-					if (currentMessage == null)
-					{
-						break;
-					}
-				}
-				catch (final Exception ex)
-				{
-					LOGGER
-							.warn(
-									"Unexpected exception caught while processing the action pipeline",
-									ex);
-
-					notifyException(count, ex, messages);
-
-					/*
-					 * Is this an application specific error? If so, try to return
-					 * the error message to the identified recipient.
-					 */
-					
-					if (ex instanceof ActionProcessingFaultException)
-					{
-						ActionProcessingFaultException fault = (ActionProcessingFaultException) ex;
-
-						if (fault.getFaultMessage() == null)
-						{
-							faultTo(faultToAddress, Factory.createErrorMessage(Factory.PROCESSING_ERROR, message, ex));
-						}
-						else
-							faultTo(faultToAddress, fault.getFaultMessage());
-					}
-					else
-					{
-						faultTo(faultToAddress, Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, ex));
-					}
-
-					return false;
-				}
-			}
-
-			// Reply...
-			if ((currentMessage != null) && (replyToAddress != null))
-			{
-				replyTo(replyToAddress, currentMessage);
-			}
-
-			notifySuccess(messages);
-			
-			return true;
-		}
-		else
-		{
-			LOGGER.debug("pipeline process disabled for message");
-
-			faultTo(faultToAddress, Factory.createErrorMessage(Factory.NOT_ENABLED, message, null));
-
-			return false;
-		}
-	}
-
-	/**
-	 * Get the ReplyTo EPR on this address. If it is not set, then try to return
-	 * the From EPR. If that is not set, then return null.
-	 * 
-	 * @param message
-	 *            the message to work on.
-	 * @return the ReplyTo EPR, or the From EPR, or null, in that order.
-	 */
-
-	private EPR getReplyToAddress(Message message)
-	{
-		if (message == null)
-			return null;
-
-		try
-		{
-			if (message.getHeader().getCall().getReplyTo() != null)
-				return message.getHeader().getCall().getReplyTo();
-			else
-				return message.getHeader().getCall().getFrom();
-		}
-		catch (final NullPointerException e)
-		{
-			// OK, it's not set... return null...
-		}
-
-		return null;
-	}
-
-	/**
-	 * Send the reply.
-	 * 
-	 * @param replyToAddress
-	 *            the EPR to target if one is not defined in the message.
-	 * @param message
-	 *            the message.
-	 */
-
-	private void replyTo(EPR replyToAddress, Message message)
-	{
-		Courier courier = null;
-		EPR replyToEPR = getReplyToAddress(message);
-
-		if (replyToEPR != null)
-			replyToAddress = replyToEPR;
-
-		if (replyToAddress == null)
-		{
-			LOGGER.warn("No reply to address defined for reply message!");
-		}
-		else
-		{
-			try
-			{
-				courier = CourierFactory.getCourier(replyToAddress);
-				courier.deliver(message);
-			}
-			catch (final CourierException e)
-			{
-				LOGGER.error("Failed to reply to address " + replyToAddress + ".",
-						e);
-			}
-			catch (final MalformedEPRException e)
-			{
-				LOGGER.error("Failed to reply to address " + replyToAddress + ".",
-						e);
-			}
-			catch (final Throwable e)
-			{
-				LOGGER.error("Failed to reply to address " + replyToAddress + ".",
-						e);
-			}
-			finally
-			{
-				if (courier != null)
-				{
-					CourierUtil.cleanCourier(courier);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Get the FaultTo EPR on this address. If it is not set, then try to return
-	 * the From EPR. If that is not set, then return null.
-	 * 
-	 * @param message
-	 *            the message to work on.
-	 * @return the FaultTo EPR, or ReplyTo, or the From EPR, or null, in that order.
-	 */
-
-	private EPR getFaultToAddress(Message message)
-	{
-		if (message == null)
-			return null;
-
-		try
-		{
-			if (message.getHeader().getCall().getFaultTo() != null)
-				return message.getHeader().getCall().getFaultTo();
-			else
-				if (message.getHeader().getCall().getReplyTo() != null)
-					return message.getHeader().getCall().getReplyTo();
-				else
-					return message.getHeader().getCall().getFrom();
-		}
-		catch (final NullPointerException e)
-		{
-			// OK, it's not set... return null...
-		}
-
-		return null;
-	}
-
-	/**
-	 * Send the fault message to the EPR.
-	 * 
-	 * @param faultToAddress
-	 *            the EPR to target if one is not set in the message.
-	 * @param message
-	 *            the message.
-	 */
-
-	private void faultTo(EPR faultToAddress, Message message)
-	{
-		Courier courier = null;
-		EPR faultToEPR = getFaultToAddress(message);
-
-		if (faultToEPR != null)
-			faultToAddress = faultToEPR;
-
-		if (faultToAddress == null)
-		{
-			LOGGER.warn("No fault address defined for fault message!");
-		}
-		else
-		{
-			try
-			{
-				courier = CourierFactory.getCourier(faultToAddress);
-				courier.deliver(message);
-			}
-			catch (final CourierException e)
-			{
-				LOGGER.error("Failed to send error to address " + faultToAddress
-						+ ".", e);
-			}
-			catch (final MalformedEPRException e)
-			{
-				LOGGER.error("Failed to send error to address " + faultToAddress
-						+ ".", e);
-			}
-			catch (final Throwable e)
-			{
-				LOGGER.error("Failed to send error to address " + faultToAddress
-						+ ".", e);
-			}
-			finally
-			{
-				if (courier != null)
-				{
-					CourierUtil.cleanCourier(courier);
-				}
-			}
-		}
-	}
-
-	/**
-	 * Handle the destruction of the pipeline from the specified position.
-	 * 
-	 * @param initialPosition
-	 *            The initial position to begin destruction.
-	 */
-	private void handleDestroy(final int initialPosition)
-	{
-		for (int count = initialPosition; count >= 0; count--)
-		{
-			final ActionLifecycle lifecycle = processors[count];
-			try
-			{
-				lifecycle.destroy();
-			}
-			catch (final Exception ex)
-			{
-				LOGGER
-						.warn(
-								"Unexpected exception during lifecycle destruction",
-								ex);
-			}
-		}
-	}
-
-	/**
-	 * Notify the processors of an error during processing.
-	 * 
-	 * @param initialPosition
-	 *            The position of the first processor to notify.
-	 * @param ex
-	 *            The exception which caused the failure.
-	 * @param messages
-	 *            The messages associated with successful processors.
-	 */
-	private void notifyException(final int initialPosition, final Exception ex,
-			final Message[] messages)
-	{
-		for (int count = initialPosition; count >= 0; count--)
-		{
-			final ActionPipelineProcessor processor = processors[count];
-			try
-			{
-				processor.processException(messages[count], ex);
-			}
-			catch (final Exception ex2)
-			{
-				LOGGER
-						.warn(
-								"Unexpected exception notifying processor of pipeline failure",
-								ex2);
-			}
-		}
-	}
-
-	/**
-	 * Notify the processors of a successful pipeline process.
-	 * 
-	 * @param messages
-	 *            The messages associated with the processors.
-	 */
-	private void notifySuccess(final Message[] messages)
-	{
-		for (int count = messages.length - 1; count >= 0; count--)
-		{
-			final Message message = messages[count];
-			if (message != null)
-			{
-				final ActionPipelineProcessor processor = processors[count];
-				try
-				{
-					processor.processSuccess(messages[count]);
-				}
-				catch (final Exception ex)
-				{
-					LOGGER
-							.warn(
-									"Unexpected exception notifying processor of pipeline success",
-									ex);
-				}
-			}
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipeline.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,564 @@
+/*
+ * 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.ArrayList;
+import java.util.concurrent.atomic.AtomicBoolean;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionLifecycle;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingFaultException;
+import org.jboss.soa.esb.actions.BeanConfiguredAction;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.message.errors.Factory;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Action Processing Pipeline. <p/> Runs a list of action classes on a message
+ * 
+ * @author <a
+ *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @author kevin
+ * @since Version 4.0
+ */
+public class ActionProcessingPipeline
+{
+	/**
+	 * The logger instance.
+	 */
+	private final static Logger LOGGER = Logger
+			.getLogger(ActionProcessingPipeline.class);
+
+	/**
+	 * The processors.
+	 */
+	private final ActionPipelineProcessor[] processors;
+
+	/**
+	 * The active flag.
+	 */
+	private final AtomicBoolean active = new AtomicBoolean(false);
+
+	/**
+	 * public constructor
+	 * 
+	 * @param config
+	 *            The pipeline configuration.
+	 */
+	public ActionProcessingPipeline(final ConfigTree config)
+			throws ConfigurationException
+	{
+		if (config == null)
+		{
+			throw new IllegalArgumentException(
+					"Configuration needed for action classes");
+		}
+
+		final ConfigTree[] actionList = config
+				.getChildren(ListenerTagNames.ACTION_ELEMENT_TAG);
+
+		if ((actionList == null) || (actionList.length == 0))
+		{
+			throw new ConfigurationException("No actions in list");
+		}
+
+		final ArrayList<ActionPipelineProcessor> processorList = new ArrayList<ActionPipelineProcessor>();
+
+		for (final ConfigTree actionConfig : actionList)
+		{
+			final String actionClassTag = actionConfig
+					.getAttribute(ListenerTagNames.ACTION_CLASS_TAG);
+			if (LOGGER.isDebugEnabled())
+			{
+				LOGGER.debug("Registering action class " + actionClassTag);
+			}
+			final Class actionClass;
+			try
+			{
+				actionClass = ClassUtil.forName(actionClassTag, getClass());
+			}
+			catch (final ClassNotFoundException cnfe)
+			{
+				throw new ConfigurationException("Could not load action class "
+						+ actionClassTag);
+			}
+
+			final ActionPipelineProcessor processor;
+			if (BeanConfiguredAction.class.isAssignableFrom(actionClass))
+			{
+				if (LOGGER.isDebugEnabled())
+				{
+					LOGGER.debug("Using bean configured action processor for "
+							+ actionClassTag);
+				}
+				processor = new BeanConfigActionProcessor(actionConfig,
+						actionClass);
+			}
+			else if (ActionPipelineProcessor.class
+					.isAssignableFrom(actionClass))
+			{
+				final ActionPipelineProcessor currentProcessor = (ActionPipelineProcessor) ActionProcessorMethodInfo
+						.getActionClassInstance(actionConfig, actionClass);
+				if (ActionProcessorMethodInfo.checkOverridden(actionConfig))
+				{
+					if (LOGGER.isDebugEnabled())
+					{
+						LOGGER
+								.debug("Using overridden action pipeline processor for "
+										+ actionClassTag);
+					}
+					processor = new OverriddenActionPipelineProcessor(
+							actionConfig, currentProcessor);
+				}
+				else
+				{
+					if (LOGGER.isDebugEnabled())
+					{
+						LOGGER
+								.debug("Using normal action pipeline processor for "
+										+ actionClassTag);
+					}
+					processor = currentProcessor;
+				}
+			}
+			else if (ActionLifecycle.class.isAssignableFrom(actionClass))
+			{
+				if (LOGGER.isDebugEnabled())
+				{
+					LOGGER
+							.debug("Using overridden action lifecycle processor for "
+									+ actionClassTag);
+				}
+				final ActionLifecycle currentLifecycle = (ActionLifecycle) ActionProcessorMethodInfo
+						.getActionClassInstance(actionConfig, actionClass);
+				processor = new OverriddenActionLifecycleProcessor(
+						actionConfig, currentLifecycle);
+			}
+			else
+			{
+				LOGGER.warn("Action class " + actionClassTag
+						+ " does not implement the ActionLifecycle interface");
+				if (LOGGER.isDebugEnabled())
+				{
+					LOGGER.debug("Using overridden actions processor for "
+							+ actionClassTag);
+				}
+				processor = new OverriddenActionProcessor(actionConfig,
+						actionClass);
+			}
+			processorList.add(processor);
+		}
+		processors = processorList
+				.toArray(new ActionPipelineProcessor[processorList.size()]);
+	}
+
+	/**
+	 * Handle the initialisation of the pipeline
+	 * 
+	 * @throws ConfigurationException
+	 *             For errors during initialisation.
+	 */
+	public void initialise() throws ConfigurationException
+	{
+		final int numLifecycles = processors.length;
+		for (int count = 0; count < numLifecycles; count++)
+		{
+			final ActionLifecycle lifecycle = processors[count];
+			try
+			{
+				lifecycle.initialise();
+			}
+			catch (final Exception ex)
+			{
+				handleDestroy(count - 1);
+				throw new ConfigurationException(
+						"Unexpected exception during lifecycle initialisation",
+						ex);
+			}
+		}
+		active.set(true);
+	}
+
+	/**
+	 * Handle the destruction of the pipeline
+	 */
+	public void destroy()
+	{
+		active.set(false);
+		handleDestroy(processors.length - 1);
+	}
+
+	/**
+	 * Process the specified message.
+	 * 
+	 * @param message
+	 *            The current message.
+	 * @return true if the processing was successful, false otherwise.
+	 */
+	public boolean process(final Message message)
+	{
+		final EPR faultToAddress = getFaultToAddress(message);
+
+		if (active.get())
+		{
+			if (LOGGER.isDebugEnabled())
+			{
+				LOGGER.debug("pipeline process for message");
+			}
+
+			final int numProcessors = processors.length;
+			final Message[] messages = new Message[numProcessors];
+			final EPR replyToAddress = getReplyToAddress(message);
+
+			Message currentMessage = message;
+
+			for (int count = 0; count < numProcessors; count++)
+			{
+				final ActionPipelineProcessor processor = processors[count];
+				messages[count] = currentMessage;
+
+				try
+				{
+					LOGGER.debug("executing processor " + count);
+					currentMessage = processor.process(currentMessage);
+
+					if (currentMessage == null)
+					{
+						break;
+					}
+				}
+				catch (final Exception ex)
+				{
+					LOGGER
+							.warn(
+									"Unexpected exception caught while processing the action pipeline",
+									ex);
+
+					notifyException(count, ex, messages);
+
+					/*
+					 * Is this an application specific error? If so, try to return
+					 * the error message to the identified recipient.
+					 */
+					
+					if (ex instanceof ActionProcessingFaultException)
+					{
+						ActionProcessingFaultException fault = (ActionProcessingFaultException) ex;
+
+						if (fault.getFaultMessage() == null)
+						{
+							faultTo(faultToAddress, Factory.createErrorMessage(Factory.PROCESSING_ERROR, message, ex));
+						}
+						else
+							faultTo(faultToAddress, fault.getFaultMessage());
+					}
+					else
+					{
+						faultTo(faultToAddress, Factory.createErrorMessage(Factory.UNEXPECTED_ERROR, message, ex));
+					}
+
+					return false;
+				}
+			}
+
+			// Reply...
+			if ((currentMessage != null) && (replyToAddress != null))
+			{
+				replyTo(replyToAddress, currentMessage);
+			}
+
+			notifySuccess(messages);
+			
+			return true;
+		}
+		else
+		{
+			LOGGER.debug("pipeline process disabled for message");
+
+			faultTo(faultToAddress, Factory.createErrorMessage(Factory.NOT_ENABLED, message, null));
+
+			return false;
+		}
+	}
+
+	/**
+	 * Get the ReplyTo EPR on this address. If it is not set, then try to return
+	 * the From EPR. If that is not set, then return null.
+	 * 
+	 * @param message
+	 *            the message to work on.
+	 * @return the ReplyTo EPR, or the From EPR, or null, in that order.
+	 */
+
+	private EPR getReplyToAddress(Message message)
+	{
+		if (message == null)
+			return null;
+
+		try
+		{
+			if (message.getHeader().getCall().getReplyTo() != null)
+				return message.getHeader().getCall().getReplyTo();
+			else
+				return message.getHeader().getCall().getFrom();
+		}
+		catch (final NullPointerException e)
+		{
+			// OK, it's not set... return null...
+		}
+
+		return null;
+	}
+
+	/**
+	 * Send the reply.
+	 * 
+	 * @param replyToAddress
+	 *            the EPR to target if one is not defined in the message.
+	 * @param message
+	 *            the message.
+	 */
+
+	private void replyTo(EPR replyToAddress, Message message)
+	{
+		Courier courier = null;
+		EPR replyToEPR = getReplyToAddress(message);
+
+		if (replyToEPR != null)
+			replyToAddress = replyToEPR;
+
+		if (replyToAddress == null)
+		{
+			LOGGER.warn("No reply to address defined for reply message!");
+		}
+		else
+		{
+			try
+			{
+				courier = CourierFactory.getCourier(replyToAddress);
+				courier.deliver(message);
+			}
+			catch (final CourierException e)
+			{
+				LOGGER.error("Failed to reply to address " + replyToAddress + ".",
+						e);
+			}
+			catch (final MalformedEPRException e)
+			{
+				LOGGER.error("Failed to reply to address " + replyToAddress + ".",
+						e);
+			}
+			catch (final Throwable e)
+			{
+				LOGGER.error("Failed to reply to address " + replyToAddress + ".",
+						e);
+			}
+			finally
+			{
+				if (courier != null)
+				{
+					CourierUtil.cleanCourier(courier);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Get the FaultTo EPR on this address. If it is not set, then try to return
+	 * the From EPR. If that is not set, then return null.
+	 * 
+	 * @param message
+	 *            the message to work on.
+	 * @return the FaultTo EPR, or ReplyTo, or the From EPR, or null, in that order.
+	 */
+
+	private EPR getFaultToAddress(Message message)
+	{
+		if (message == null)
+			return null;
+
+		try
+		{
+			if (message.getHeader().getCall().getFaultTo() != null)
+				return message.getHeader().getCall().getFaultTo();
+			else
+				if (message.getHeader().getCall().getReplyTo() != null)
+					return message.getHeader().getCall().getReplyTo();
+				else
+					return message.getHeader().getCall().getFrom();
+		}
+		catch (final NullPointerException e)
+		{
+			// OK, it's not set... return null...
+		}
+
+		return null;
+	}
+
+	/**
+	 * Send the fault message to the EPR.
+	 * 
+	 * @param faultToAddress
+	 *            the EPR to target if one is not set in the message.
+	 * @param message
+	 *            the message.
+	 */
+
+	private void faultTo(EPR faultToAddress, Message message)
+	{
+		Courier courier = null;
+		EPR faultToEPR = getFaultToAddress(message);
+
+		if (faultToEPR != null)
+			faultToAddress = faultToEPR;
+
+		if (faultToAddress == null)
+		{
+			LOGGER.warn("No fault address defined for fault message!");
+		}
+		else
+		{
+			try
+			{
+				courier = CourierFactory.getCourier(faultToAddress);
+				courier.deliver(message);
+			}
+			catch (final CourierException e)
+			{
+				LOGGER.error("Failed to send error to address " + faultToAddress
+						+ ".", e);
+			}
+			catch (final MalformedEPRException e)
+			{
+				LOGGER.error("Failed to send error to address " + faultToAddress
+						+ ".", e);
+			}
+			catch (final Throwable e)
+			{
+				LOGGER.error("Failed to send error to address " + faultToAddress
+						+ ".", e);
+			}
+			finally
+			{
+				if (courier != null)
+				{
+					CourierUtil.cleanCourier(courier);
+				}
+			}
+		}
+	}
+
+	/**
+	 * Handle the destruction of the pipeline from the specified position.
+	 * 
+	 * @param initialPosition
+	 *            The initial position to begin destruction.
+	 */
+	private void handleDestroy(final int initialPosition)
+	{
+		for (int count = initialPosition; count >= 0; count--)
+		{
+			final ActionLifecycle lifecycle = processors[count];
+			try
+			{
+				lifecycle.destroy();
+			}
+			catch (final Exception ex)
+			{
+				LOGGER
+						.warn(
+								"Unexpected exception during lifecycle destruction",
+								ex);
+			}
+		}
+	}
+
+	/**
+	 * Notify the processors of an error during processing.
+	 * 
+	 * @param initialPosition
+	 *            The position of the first processor to notify.
+	 * @param ex
+	 *            The exception which caused the failure.
+	 * @param messages
+	 *            The messages associated with successful processors.
+	 */
+	private void notifyException(final int initialPosition, final Exception ex,
+			final Message[] messages)
+	{
+		for (int count = initialPosition; count >= 0; count--)
+		{
+			final ActionPipelineProcessor processor = processors[count];
+			try
+			{
+				processor.processException(messages[count], ex);
+			}
+			catch (final Exception ex2)
+			{
+				LOGGER
+						.warn(
+								"Unexpected exception notifying processor of pipeline failure",
+								ex2);
+			}
+		}
+	}
+
+	/**
+	 * Notify the processors of a successful pipeline process.
+	 * 
+	 * @param messages
+	 *            The messages associated with the processors.
+	 */
+	private void notifySuccess(final Message[] messages)
+	{
+		for (int count = messages.length - 1; count >= 0; count--)
+		{
+			final Message message = messages[count];
+			if (message != null)
+			{
+				final ActionPipelineProcessor processor = processors[count];
+				try
+				{
+					processor.processSuccess(messages[count]);
+				}
+				catch (final Exception ex)
+				{
+					LOGGER
+							.warn(
+									"Unexpected exception notifying processor of pipeline success",
+									ex);
+				}
+			}
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,351 +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.lang.reflect.Constructor;
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Class providing information for dynamic manipulation of the action processors. 
- * @author kevin
- */
-class ActionProcessorMethodInfo
-{
-    /**
-     * The logger for this class.
-     */
-    private static final Logger LOGGER = Logger.getLogger(ActionProcessorMethodInfo.class) ;
-    
-    /**
-     * The process methods.
-     */
-    private final Method[] processMethods;
-    /**
-     * The process success method.
-     */
-    private final Method processSuccess;
-    /**
-     * The process exception method.
-     */
-    private final Method processException ;
-    
-    /**
-     * Construct the action processor method info.
-     * @param processMethods The process methods or null if not configured.
-     * @param processSuccess The process success method or null if not configured.
-     * @param processException The process exception method or null if not configured.
-     */
-    private ActionProcessorMethodInfo(final Method[] processMethods, final Method processSuccess,
-        final Method processException)
-    {
-        this.processMethods = processMethods ;
-        this.processSuccess = processSuccess ;
-        this.processException = processException ;
-    }
-
-    /**
-     * Do we have process method overrides?
-     * @return true if there are overrides, false otherwise.
-     */
-    boolean hasProcessMethods()
-    {
-        return (processMethods != null) ;
-    }
-    
-    /**
-     * Process the methods.
-     * @param instance The action processor instance.
-     * @param message The initial message.
-     * @return The last message.
-     * @throws ActionProcessingException for errors during processing.
-     */
-    Message processMethods(final Object instance, final Message message)
-        throws ActionProcessingException
-    {
-        Message currentMessage = message ;
-        if (hasProcessMethods())
-        {
-            final int numProcessMethods = processMethods.length ;
-            for(int count = 0 ; count < numProcessMethods ; count++)
-            {
-                final Method processMethod = processMethods[count] ;
-                try
-                {
-                    final Object response = processMethod.invoke(instance, currentMessage) ;
-                    if (response instanceof Message)
-                    {
-                        currentMessage = (Message)response ;
-                    }
-                    else if (response == null)
-                    {
-                        return null ;
-                    }
-                    else
-                    {
-                        throw new ActionProcessingException("Unexpected response type from processor: " + response) ;
-                    }
-                }
-                catch (final IllegalAccessException iae)
-                {
-                    throw new ActionProcessingException("Illegal access from processor", iae) ;
-                }
-                catch (final InvocationTargetException ite)
-                {
-                    final Throwable th = ite.getTargetException() ;
-                    if (th instanceof ActionProcessingException)
-                    {
-                        throw (ActionProcessingException)th ;
-                    }
-                    throw new ActionProcessingException("Unexpected invocation target exception from processor", th) ;
-                }
-            }
-        }
-        return currentMessage ;
-    }
-
-    /**
-     * Do we have a process success override?
-     * @return true if there is an override, false otherwise.
-     */
-    boolean hasProcessSuccess()
-    {
-        return (processSuccess != null) ;
-    }
-    
-    /**
-     * Process the success method.
-     * @param instance The action processor instance.
-     * @param message The initial message.
-     */
-    void processSuccess(final Object instance, final Message message)
-    {
-        if (hasProcessSuccess())
-        {
-            try
-            {
-                processSuccess.invoke(instance, message) ;
-            }
-            catch (final IllegalAccessException iae)
-            {
-                LOGGER.warn("Illegal access from processor", iae) ;
-            }
-            catch (final InvocationTargetException ite)
-            {
-                final Throwable th = ite.getTargetException() ;
-                LOGGER.warn("Unexpected invocation target exception from processor", th) ;
-            }
-        }
-    }
-
-
-    /**
-     * Do we have a process exception override?
-     * @return true if there is an override, false otherwise.
-     */
-    boolean hasProcessException()
-    {
-        return (processException != null) ;
-    }
-    
-    /**
-     * Process the exception method.
-     * @param instance The action processor instance.
-     * @param message The initial message.
-     * @param ex The exception.
-     */
-    void processException(final Object instance, final Message message, final Throwable th)
-    {
-        if (hasProcessException())
-        {
-            try
-            {
-                processException.invoke(instance, message, th) ;
-            }
-            catch (final IllegalAccessException iae)
-            {
-                LOGGER.warn("Illegal access from processor", iae) ;
-            }
-            catch (final InvocationTargetException ite)
-            {
-                LOGGER.warn("Unexpected invocation target exception from processor", ite.getTargetException()) ;
-            }
-        }
-    }
-
-    /**
-     * Check to see if any of the default configurations have been overridden.
-     * @param actionConfig The action config.
-     * @return true if there is an override, false otherwise.
-     */
-    static boolean checkOverridden(final ConfigTree actionConfig)
-    {
-        final String processMethod = actionConfig.getAttribute(ListenerTagNames.PROCESS_METHOD_TAG) ;
-        if (processMethod == null || ActionPipelineProcessor.PROCESS_METHOD.equals(processMethod))
-        {
-            final String successMethod = actionConfig.getAttribute(ListenerTagNames.NORMAL_COMPLETION_METHOD_TAG) ;
-            if (successMethod == null || ActionPipelineProcessor.PROCESS_SUCCESS_METHOD.equals(successMethod))
-            {
-                final String exceptionMethod = actionConfig.getAttribute(ListenerTagNames.EXCEPTION_METHOD_TAG) ;
-                if (exceptionMethod == null || ActionPipelineProcessor.PROCESS_EXCEPTION_METHOD.equals(exceptionMethod))
-                {
-                    return false ;
-                }
-            }
-        }
-        return true ;
-    }
-
-    /**
-     * Get the method info for method overrides.
-     * @param actionConfig The action config.
-     * @param actionClass The action class.
-     * @return The action processor method info.
-     * @throws ConfigurationException for configuration errors
-     */
-    static ActionProcessorMethodInfo getMethodInfo(final ConfigTree actionConfig, final Class actionClass)
-        throws ConfigurationException
-    {
-        try
-        {
-            final String processMethodName = actionConfig.getAttribute(ListenerTagNames.PROCESS_METHOD_TAG, ActionPipelineProcessor.PROCESS_METHOD) ;
-            final Method[] processMethods = getMethods(actionClass, processMethodName, Message.class);
-            
-            final String processSuccessName = actionConfig.getAttribute(ListenerTagNames.NORMAL_COMPLETION_METHOD_TAG) ;
-            final Method processSuccess = getMethod(actionClass, processSuccessName, Message.class);
-            
-            final String processExceptionName = actionConfig.getAttribute(ListenerTagNames.EXCEPTION_METHOD_TAG) ;
-            final Method processException = getMethod(actionClass, processExceptionName, Message.class, Throwable.class) ;
-            
-            return new ActionProcessorMethodInfo(processMethods, processSuccess, processException) ;
-        }
-        catch (final NoSuchMethodException nsme)
-        {
-            throw new ConfigurationException("Invalid processor method in configuration", nsme) ;
-        }
-    }
-    
-    /**
-     * Get the methods specified by the list.
-     * @param actionClass The action class
-     * @param methodNameList The list of method names
-     * @param classes The method signature classes.
-     * @return The methods.
-     * @throws NoSuchMethodException If a method cannot be located.
-     */
-    private static Method[] getMethods(final Class actionClass, final String methodNameList, Class ...classes)
-        throws NoSuchMethodException
-    {
-        final String[] methodNames = methodNameList.split(",") ;
-        final int numMethodNames = (methodNames == null ? 0 : methodNames.length) ;
-        
-        final Method[] methods = new Method[numMethodNames] ;
-        
-        for(int count = 0 ; count < numMethodNames ; count++)
-        {
-            final String methodName = methodNames[count].trim() ;
-            methods[count] = getMethod(actionClass, methodName, classes) ;
-        }
-        return methods ;
-    }
-    
-    /**
-     * Get the specified method.
-     * @param actionClass The action class
-     * @param methodName The method name
-     * @param classes The method signature classes.
-     * @return The method.
-     * @throws NoSuchMethodException If the method cannot be located.
-     */
-    private static Method getMethod(final Class actionClass, final String methodName, Class ...classes)
-        throws NoSuchMethodException
-    {
-        if (methodName != null)
-        {
-            return actionClass.getMethod(methodName, classes) ;
-        }
-        else
-        {
-            return null ;
-        }
-    }
-
-    /**
-     * Get an constructor for the action class.
-     * @param actionClass The action class.
-     * @return The constructor of the action class.
-     * @throws ConfigurationException For errors during instantiation.
-     */
-    static Constructor getActionClassConstructor(final Class actionClass)
-        throws ConfigurationException
-    {
-        try
-        {
-            return actionClass.getConstructor(new Class[] {ConfigTree.class}) ;
-        }
-        catch (final NoSuchMethodException nsme)
-        {
-            throw new ConfigurationException("Action " + actionClass.getName() + " does not have correct constructor") ;
-        }
-    }
-
-    /**
-     * Get an instance of the action class.
-     * @param actionConfig The action class configuration.
-     * @param actionClass The action class.
-     * @return The instance of the action class.
-     * @throws ConfigurationException For errors during instantiation.
-     */
-    static Object getActionClassInstance(final ConfigTree actionConfig, final Class actionClass)
-        throws ConfigurationException
-    {
-        return getActionClassInstance(actionConfig, getActionClassConstructor(actionClass)) ;
-    }
-
-    /**
-     * Get an instance of the action class.
-     * @param actionConfig The action class configuration.
-     * @param actionConstructor The action class constructor.
-     * @return The instance of the action class.
-     * @throws ConfigurationException For errors during instantiation.
-     */
-    static Object getActionClassInstance(final ConfigTree actionConfig, final Constructor actionConstructor)
-        throws ConfigurationException
-    {
-        try
-        {
-            return actionConstructor.newInstance(actionConfig) ;
-        }
-        catch (final Exception ex)
-        {
-            throw new ConfigurationException("Unexpected exception while instantiating action instance", ex) ;
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/ActionProcessorMethodInfo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,351 @@
+/*
+ * 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.lang.reflect.Constructor;
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Class providing information for dynamic manipulation of the action processors. 
+ * @author kevin
+ */
+class ActionProcessorMethodInfo
+{
+    /**
+     * The logger for this class.
+     */
+    private static final Logger LOGGER = Logger.getLogger(ActionProcessorMethodInfo.class) ;
+    
+    /**
+     * The process methods.
+     */
+    private final Method[] processMethods;
+    /**
+     * The process success method.
+     */
+    private final Method processSuccess;
+    /**
+     * The process exception method.
+     */
+    private final Method processException ;
+    
+    /**
+     * Construct the action processor method info.
+     * @param processMethods The process methods or null if not configured.
+     * @param processSuccess The process success method or null if not configured.
+     * @param processException The process exception method or null if not configured.
+     */
+    private ActionProcessorMethodInfo(final Method[] processMethods, final Method processSuccess,
+        final Method processException)
+    {
+        this.processMethods = processMethods ;
+        this.processSuccess = processSuccess ;
+        this.processException = processException ;
+    }
+
+    /**
+     * Do we have process method overrides?
+     * @return true if there are overrides, false otherwise.
+     */
+    boolean hasProcessMethods()
+    {
+        return (processMethods != null) ;
+    }
+    
+    /**
+     * Process the methods.
+     * @param instance The action processor instance.
+     * @param message The initial message.
+     * @return The last message.
+     * @throws ActionProcessingException for errors during processing.
+     */
+    Message processMethods(final Object instance, final Message message)
+        throws ActionProcessingException
+    {
+        Message currentMessage = message ;
+        if (hasProcessMethods())
+        {
+            final int numProcessMethods = processMethods.length ;
+            for(int count = 0 ; count < numProcessMethods ; count++)
+            {
+                final Method processMethod = processMethods[count] ;
+                try
+                {
+                    final Object response = processMethod.invoke(instance, currentMessage) ;
+                    if (response instanceof Message)
+                    {
+                        currentMessage = (Message)response ;
+                    }
+                    else if (response == null)
+                    {
+                        return null ;
+                    }
+                    else
+                    {
+                        throw new ActionProcessingException("Unexpected response type from processor: " + response) ;
+                    }
+                }
+                catch (final IllegalAccessException iae)
+                {
+                    throw new ActionProcessingException("Illegal access from processor", iae) ;
+                }
+                catch (final InvocationTargetException ite)
+                {
+                    final Throwable th = ite.getTargetException() ;
+                    if (th instanceof ActionProcessingException)
+                    {
+                        throw (ActionProcessingException)th ;
+                    }
+                    throw new ActionProcessingException("Unexpected invocation target exception from processor", th) ;
+                }
+            }
+        }
+        return currentMessage ;
+    }
+
+    /**
+     * Do we have a process success override?
+     * @return true if there is an override, false otherwise.
+     */
+    boolean hasProcessSuccess()
+    {
+        return (processSuccess != null) ;
+    }
+    
+    /**
+     * Process the success method.
+     * @param instance The action processor instance.
+     * @param message The initial message.
+     */
+    void processSuccess(final Object instance, final Message message)
+    {
+        if (hasProcessSuccess())
+        {
+            try
+            {
+                processSuccess.invoke(instance, message) ;
+            }
+            catch (final IllegalAccessException iae)
+            {
+                LOGGER.warn("Illegal access from processor", iae) ;
+            }
+            catch (final InvocationTargetException ite)
+            {
+                final Throwable th = ite.getTargetException() ;
+                LOGGER.warn("Unexpected invocation target exception from processor", th) ;
+            }
+        }
+    }
+
+
+    /**
+     * Do we have a process exception override?
+     * @return true if there is an override, false otherwise.
+     */
+    boolean hasProcessException()
+    {
+        return (processException != null) ;
+    }
+    
+    /**
+     * Process the exception method.
+     * @param instance The action processor instance.
+     * @param message The initial message.
+     * @param ex The exception.
+     */
+    void processException(final Object instance, final Message message, final Throwable th)
+    {
+        if (hasProcessException())
+        {
+            try
+            {
+                processException.invoke(instance, message, th) ;
+            }
+            catch (final IllegalAccessException iae)
+            {
+                LOGGER.warn("Illegal access from processor", iae) ;
+            }
+            catch (final InvocationTargetException ite)
+            {
+                LOGGER.warn("Unexpected invocation target exception from processor", ite.getTargetException()) ;
+            }
+        }
+    }
+
+    /**
+     * Check to see if any of the default configurations have been overridden.
+     * @param actionConfig The action config.
+     * @return true if there is an override, false otherwise.
+     */
+    static boolean checkOverridden(final ConfigTree actionConfig)
+    {
+        final String processMethod = actionConfig.getAttribute(ListenerTagNames.PROCESS_METHOD_TAG) ;
+        if (processMethod == null || ActionPipelineProcessor.PROCESS_METHOD.equals(processMethod))
+        {
+            final String successMethod = actionConfig.getAttribute(ListenerTagNames.NORMAL_COMPLETION_METHOD_TAG) ;
+            if (successMethod == null || ActionPipelineProcessor.PROCESS_SUCCESS_METHOD.equals(successMethod))
+            {
+                final String exceptionMethod = actionConfig.getAttribute(ListenerTagNames.EXCEPTION_METHOD_TAG) ;
+                if (exceptionMethod == null || ActionPipelineProcessor.PROCESS_EXCEPTION_METHOD.equals(exceptionMethod))
+                {
+                    return false ;
+                }
+            }
+        }
+        return true ;
+    }
+
+    /**
+     * Get the method info for method overrides.
+     * @param actionConfig The action config.
+     * @param actionClass The action class.
+     * @return The action processor method info.
+     * @throws ConfigurationException for configuration errors
+     */
+    static ActionProcessorMethodInfo getMethodInfo(final ConfigTree actionConfig, final Class actionClass)
+        throws ConfigurationException
+    {
+        try
+        {
+            final String processMethodName = actionConfig.getAttribute(ListenerTagNames.PROCESS_METHOD_TAG, ActionPipelineProcessor.PROCESS_METHOD) ;
+            final Method[] processMethods = getMethods(actionClass, processMethodName, Message.class);
+            
+            final String processSuccessName = actionConfig.getAttribute(ListenerTagNames.NORMAL_COMPLETION_METHOD_TAG) ;
+            final Method processSuccess = getMethod(actionClass, processSuccessName, Message.class);
+            
+            final String processExceptionName = actionConfig.getAttribute(ListenerTagNames.EXCEPTION_METHOD_TAG) ;
+            final Method processException = getMethod(actionClass, processExceptionName, Message.class, Throwable.class) ;
+            
+            return new ActionProcessorMethodInfo(processMethods, processSuccess, processException) ;
+        }
+        catch (final NoSuchMethodException nsme)
+        {
+            throw new ConfigurationException("Invalid processor method in configuration", nsme) ;
+        }
+    }
+    
+    /**
+     * Get the methods specified by the list.
+     * @param actionClass The action class
+     * @param methodNameList The list of method names
+     * @param classes The method signature classes.
+     * @return The methods.
+     * @throws NoSuchMethodException If a method cannot be located.
+     */
+    private static Method[] getMethods(final Class actionClass, final String methodNameList, Class ...classes)
+        throws NoSuchMethodException
+    {
+        final String[] methodNames = methodNameList.split(",") ;
+        final int numMethodNames = (methodNames == null ? 0 : methodNames.length) ;
+        
+        final Method[] methods = new Method[numMethodNames] ;
+        
+        for(int count = 0 ; count < numMethodNames ; count++)
+        {
+            final String methodName = methodNames[count].trim() ;
+            methods[count] = getMethod(actionClass, methodName, classes) ;
+        }
+        return methods ;
+    }
+    
+    /**
+     * Get the specified method.
+     * @param actionClass The action class
+     * @param methodName The method name
+     * @param classes The method signature classes.
+     * @return The method.
+     * @throws NoSuchMethodException If the method cannot be located.
+     */
+    private static Method getMethod(final Class actionClass, final String methodName, Class ...classes)
+        throws NoSuchMethodException
+    {
+        if (methodName != null)
+        {
+            return actionClass.getMethod(methodName, classes) ;
+        }
+        else
+        {
+            return null ;
+        }
+    }
+
+    /**
+     * Get an constructor for the action class.
+     * @param actionClass The action class.
+     * @return The constructor of the action class.
+     * @throws ConfigurationException For errors during instantiation.
+     */
+    static Constructor getActionClassConstructor(final Class actionClass)
+        throws ConfigurationException
+    {
+        try
+        {
+            return actionClass.getConstructor(new Class[] {ConfigTree.class}) ;
+        }
+        catch (final NoSuchMethodException nsme)
+        {
+            throw new ConfigurationException("Action " + actionClass.getName() + " does not have correct constructor") ;
+        }
+    }
+
+    /**
+     * Get an instance of the action class.
+     * @param actionConfig The action class configuration.
+     * @param actionClass The action class.
+     * @return The instance of the action class.
+     * @throws ConfigurationException For errors during instantiation.
+     */
+    static Object getActionClassInstance(final ConfigTree actionConfig, final Class actionClass)
+        throws ConfigurationException
+    {
+        return getActionClassInstance(actionConfig, getActionClassConstructor(actionClass)) ;
+    }
+
+    /**
+     * Get an instance of the action class.
+     * @param actionConfig The action class configuration.
+     * @param actionConstructor The action class constructor.
+     * @return The instance of the action class.
+     * @throws ConfigurationException For errors during instantiation.
+     */
+    static Object getActionClassInstance(final ConfigTree actionConfig, final Constructor actionConstructor)
+        throws ConfigurationException
+    {
+        try
+        {
+            return actionConstructor.newInstance(actionConfig) ;
+        }
+        catch (final Exception ex)
+        {
+            throw new ConfigurationException("Unexpected exception while instantiating action instance", ex) ;
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BasicMessageComposer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BasicMessageComposer.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BasicMessageComposer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,40 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.message;
-
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Basic Message Composer.
- * <p/>
- * Sets and gets the ESB unaware payload on the message using {@link ActionUtils}.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class BasicMessageComposer extends AbstractMessageComposer {
-    public void setConfiguration(ConfigTree config) {
-    }
-
-    protected void populateMessage(Message message, Object messagePayload) throws MessageDeliverException {
-        ActionUtils.setTaskObject(message, messagePayload);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BasicMessageComposer.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BasicMessageComposer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BasicMessageComposer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BasicMessageComposer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,40 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.message;
+
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Basic Message Composer.
+ * <p/>
+ * Sets and gets the ESB unaware payload on the message using {@link ActionUtils}.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class BasicMessageComposer extends AbstractMessageComposer {
+    public void setConfiguration(ConfigTree config) {
+    }
+
+    protected void populateMessage(Message message, Object messagePayload) throws MessageDeliverException {
+        ActionUtils.setTaskObject(message, messagePayload);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanConfigActionProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanConfigActionProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanConfigActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,117 +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.lang.reflect.Constructor;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.BeanConfigurator;
-
-public class BeanConfigActionProcessor implements ActionPipelineProcessor {
-
-	/** Config tree for processor */
-	private final ConfigTree config;
-
-	/** No-argument constructor for action class */
-	private final Constructor constructor;
-
-	/** Method info on action class */
-	private final ActionProcessorMethodInfo methodInfo;
-
-	/**
-	 * Construct the overridden action processor.
-	 * 
-	 * @param config The action config.
-	 * @param actionClass The action class.
-	 * @throws ConfigurationException for errors during configuration.
-	 */
-	BeanConfigActionProcessor(final ConfigTree config, final Class actionClass)
-			throws ConfigurationException {
-		this.config = config;
-		try {
-			this.constructor = actionClass.getConstructor();
-		} catch (SecurityException e) {
-			throw new ConfigurationException(e);
-		} catch (NoSuchMethodException e) {
-			throw new ConfigurationException(e);
-		}
-		this.methodInfo = ActionProcessorMethodInfo.getMethodInfo(config, actionClass);
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.ActionPipelineProcessor#process(org.jboss.soa.esb.message.Message)
-	 */
-	public Message process(Message message) throws ActionProcessingException {
-		if (methodInfo.hasProcessMethods()) {
-			try {
-				Object instance = constructor.newInstance();
-				BeanConfigurator configurator = new ActionBeanConfigurator(config, instance);
-				configurator.configure();
-				return methodInfo.processMethods(instance, message);
-			} catch (Exception e) {
-				throw new ActionProcessingException(e);
-			}
-		} else {
-			return message;
-		}
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.ActionPipelineProcessor#processException(org.jboss.soa.esb.message.Message,
-	 * java.lang.Throwable)
-	 */
-	public void processException(Message message, Throwable th) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.ActionPipelineProcessor#processSuccess(org.jboss.soa.esb.message.Message)
-	 */
-	public void processSuccess(Message message) {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.ActionLifecycle#destroy()
-	 */
-	public void destroy() throws ActionLifecycleException {
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.ActionLifecycle#initialise()
-	 */
-	public void initialise() throws ActionLifecycleException {
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanConfigActionProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanConfigActionProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanConfigActionProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/BeanConfigActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,117 @@
+/*
+ * 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.lang.reflect.Constructor;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.BeanConfigurator;
+
+public class BeanConfigActionProcessor implements ActionPipelineProcessor {
+
+	/** Config tree for processor */
+	private final ConfigTree config;
+
+	/** No-argument constructor for action class */
+	private final Constructor constructor;
+
+	/** Method info on action class */
+	private final ActionProcessorMethodInfo methodInfo;
+
+	/**
+	 * Construct the overridden action processor.
+	 * 
+	 * @param config The action config.
+	 * @param actionClass The action class.
+	 * @throws ConfigurationException for errors during configuration.
+	 */
+	BeanConfigActionProcessor(final ConfigTree config, final Class actionClass)
+			throws ConfigurationException {
+		this.config = config;
+		try {
+			this.constructor = actionClass.getConstructor();
+		} catch (SecurityException e) {
+			throw new ConfigurationException(e);
+		} catch (NoSuchMethodException e) {
+			throw new ConfigurationException(e);
+		}
+		this.methodInfo = ActionProcessorMethodInfo.getMethodInfo(config, actionClass);
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.ActionPipelineProcessor#process(org.jboss.soa.esb.message.Message)
+	 */
+	public Message process(Message message) throws ActionProcessingException {
+		if (methodInfo.hasProcessMethods()) {
+			try {
+				Object instance = constructor.newInstance();
+				BeanConfigurator configurator = new ActionBeanConfigurator(config, instance);
+				configurator.configure();
+				return methodInfo.processMethods(instance, message);
+			} catch (Exception e) {
+				throw new ActionProcessingException(e);
+			}
+		} else {
+			return message;
+		}
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.ActionPipelineProcessor#processException(org.jboss.soa.esb.message.Message,
+	 * java.lang.Throwable)
+	 */
+	public void processException(Message message, Throwable th) {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.ActionPipelineProcessor#processSuccess(org.jboss.soa.esb.message.Message)
+	 */
+	public void processSuccess(Message message) {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.ActionLifecycle#destroy()
+	 */
+	public void destroy() throws ActionLifecycleException {
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.ActionLifecycle#initialise()
+	 */
+	public void initialise() throws ActionLifecycleException {
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,191 +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.MalformedURLException;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.Collection;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierTimeoutException;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.listeners.RegistryUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-
-
-/**
- * 
- * Utility class to hide implementation details for sending Command messages and optionally awaiting for a response. 
- * 
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a> 
- *
- */
-
-public class Invoker {
-
-	/**
-	 * 
-	 * @param message Message - the message to deliver
-	 * @param category String - for Registry search
-	 * @param name String - for Registry search
-	 * @throws RegistryException
-	 * @throws MalformedEPRException
-	 * @throws CourierException
-	 */
-	public static void invoke(Message message, String category, String name)
-		throws RegistryException, MalformedEPRException, CourierException
-	{
-		try { invokeAndAwaitResponse(message,category,name,-1); }
-		catch (CourierTimeoutException e)
-		{
-			_logger.fatal("Unexpected CourierTimeoutException caught!");
-		}
-	} //________________________________
-	
-	/**
-	 * Encapsulate command in an ESB Message, deliverAsync it, and wait for a response Message.
-	 * 
-	 * @param message Message - the message to deliver
-	 * @param category String - Service category name for Registry inquiry
-	 * @param name String - Service name for Registry inquiry
-	 * @param maxWaitMillis int - Maximum time to wait for a response
-	 * @return Message
-	 * @throws RegistryException
-	 * @throws MalformedEPRException
-	 * @throws CourierException
-	 * @throws CourierTimeoutException - If response was not received in specified time
-	 */
-	
-	public static Message invokeAndAwaitResponse(Message message, String category, String name
-						,int maxWaitMillis)
-		throws RegistryException, MalformedEPRException, CourierException, CourierTimeoutException
-	{
-		Call call	= message.getHeader().getCall();
-		Collection<EPR> eprs = RegistryUtil.getEprs(category, name);
-		if (null==eprs || eprs.size()<1)
-			throw new RegistryException("No eprs found for <"+category+","+name+">");
-		EPR service = eprs.iterator().next();
-		call.setTo(serviceDestination(service));
-		return invokeAndAwaitResponse(message, maxWaitMillis);
-	}
-	
-	/**
-	 * Deliver an ESB Message and wait for a response Message.
-	 * 
-	 * @param outgoing Message - should contain at least the toEPR
-	 * @param maxWaitMillis int - Maximum time to wait for a response
-	 * @return Message
-	 * @throws CourierException
-	 * @throws MalformedEPRException
-	 * @throws CourierTimeoutException - If response was not received in specified time
-	 */
-	public static Message invokeAndAwaitResponse(Message outgoing ,int maxWaitMillis)
-		throws CourierException, MalformedEPRException, CourierTimeoutException
-	{
-		Call call	= outgoing.getHeader().getCall();
-		if (null==call.getMessageID())
-		{
-			URI	 uri	= null;
-			try  { uri = new URI(UUID.randomUUID().toString()); }
-			catch (URISyntaxException e)
-			{
-				_logger.fatal("Failed to create URI: "+e);				
-				throw new CourierException(e);
-			}
-			call.setMessageID(uri);
-		}
-		
-		Courier sender = CourierFactory.getCourier(call.getTo());
-                PickUpOnlyCourier receiver = null;
-                try
-                {
-                        boolean waitForResponse = (maxWaitMillis > 0);
-                        if (waitForResponse)
-                        {
-                                if (null==call.getReplyTo())
-                                        call.setReplyTo(CourierUtil.getDefaultReplyToEpr(call.getTo()));
-                                receiver        = CourierFactory.getPickupCourier(call.getReplyTo());
-                        }
-                        
-                        sender.deliver(outgoing);
-                        return (waitForResponse ? receiver.pickup(maxWaitMillis) : null) ;
-                }
-                finally
-                {
-                    CourierUtil.cleanCourier(sender) ;
-                    CourierUtil.cleanCourier(receiver) ;
-                }
-	} //________________________________
-	
-	public static EPR serviceDestination(EPR epr) throws MalformedEPRException
-	{
-		// For all file Epr's (local, FTP and sFTP - destination EPR
-		// must be set to where the service expects the input
-		//    dest.setPostSuffix (source.getInputSuffix)
-		try
-		{
-			if (epr instanceof SFTPEpr)
-			{
-				SFTPEpr source = (SFTPEpr)epr;
-				SFTPEpr dest = new SFTPEpr(source.getURL());
-				dest.setPostSuffix		(source.getInputSuffix());
-				dest.setPassive			(source.getPassive());
-				dest.setCertificateURL	(source.getCertificateURL());
-				return dest;
-			}
-			if (epr instanceof FTPEpr)
-			{
-				FTPEpr source = (FTPEpr)epr;
-				FTPEpr dest = new FTPEpr(source.getURL());
-				dest.setPostSuffix		(source.getInputSuffix());
-				dest.setPassive			(source.getPassive());
-				return dest;
-			}
-			if (epr instanceof FileEpr)
-			{
-				FileEpr source = (FileEpr)epr;
-				FileEpr dest = new FileEpr(source.getURL());
-				dest.setPostSuffix		(source.getInputSuffix());
-				return dest;
-			}
-		}
-		catch (URISyntaxException e) 	{throw new MalformedEPRException(e); }
-		catch (MalformedURLException e)	{throw new MalformedEPRException(e); }
-
-		return epr;
-	}
-	
-	private static Logger _logger = Logger.getLogger(Invoker.class);
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/Invoker.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,191 @@
+/*
+ * 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.MalformedURLException;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.Collection;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierTimeoutException;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.listeners.RegistryUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+
+
+/**
+ * 
+ * Utility class to hide implementation details for sending Command messages and optionally awaiting for a response. 
+ * 
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a> 
+ *
+ */
+
+public class Invoker {
+
+	/**
+	 * 
+	 * @param message Message - the message to deliver
+	 * @param category String - for Registry search
+	 * @param name String - for Registry search
+	 * @throws RegistryException
+	 * @throws MalformedEPRException
+	 * @throws CourierException
+	 */
+	public static void invoke(Message message, String category, String name)
+		throws RegistryException, MalformedEPRException, CourierException
+	{
+		try { invokeAndAwaitResponse(message,category,name,-1); }
+		catch (CourierTimeoutException e)
+		{
+			_logger.fatal("Unexpected CourierTimeoutException caught!");
+		}
+	} //________________________________
+	
+	/**
+	 * Encapsulate command in an ESB Message, deliverAsync it, and wait for a response Message.
+	 * 
+	 * @param message Message - the message to deliver
+	 * @param category String - Service category name for Registry inquiry
+	 * @param name String - Service name for Registry inquiry
+	 * @param maxWaitMillis int - Maximum time to wait for a response
+	 * @return Message
+	 * @throws RegistryException
+	 * @throws MalformedEPRException
+	 * @throws CourierException
+	 * @throws CourierTimeoutException - If response was not received in specified time
+	 */
+	
+	public static Message invokeAndAwaitResponse(Message message, String category, String name
+						,int maxWaitMillis)
+		throws RegistryException, MalformedEPRException, CourierException, CourierTimeoutException
+	{
+		Call call	= message.getHeader().getCall();
+		Collection<EPR> eprs = RegistryUtil.getEprs(category, name);
+		if (null==eprs || eprs.size()<1)
+			throw new RegistryException("No eprs found for <"+category+","+name+">");
+		EPR service = eprs.iterator().next();
+		call.setTo(serviceDestination(service));
+		return invokeAndAwaitResponse(message, maxWaitMillis);
+	}
+	
+	/**
+	 * Deliver an ESB Message and wait for a response Message.
+	 * 
+	 * @param outgoing Message - should contain at least the toEPR
+	 * @param maxWaitMillis int - Maximum time to wait for a response
+	 * @return Message
+	 * @throws CourierException
+	 * @throws MalformedEPRException
+	 * @throws CourierTimeoutException - If response was not received in specified time
+	 */
+	public static Message invokeAndAwaitResponse(Message outgoing ,int maxWaitMillis)
+		throws CourierException, MalformedEPRException, CourierTimeoutException
+	{
+		Call call	= outgoing.getHeader().getCall();
+		if (null==call.getMessageID())
+		{
+			URI	 uri	= null;
+			try  { uri = new URI(UUID.randomUUID().toString()); }
+			catch (URISyntaxException e)
+			{
+				_logger.fatal("Failed to create URI: "+e);				
+				throw new CourierException(e);
+			}
+			call.setMessageID(uri);
+		}
+		
+		Courier sender = CourierFactory.getCourier(call.getTo());
+                PickUpOnlyCourier receiver = null;
+                try
+                {
+                        boolean waitForResponse = (maxWaitMillis > 0);
+                        if (waitForResponse)
+                        {
+                                if (null==call.getReplyTo())
+                                        call.setReplyTo(CourierUtil.getDefaultReplyToEpr(call.getTo()));
+                                receiver        = CourierFactory.getPickupCourier(call.getReplyTo());
+                        }
+                        
+                        sender.deliver(outgoing);
+                        return (waitForResponse ? receiver.pickup(maxWaitMillis) : null) ;
+                }
+                finally
+                {
+                    CourierUtil.cleanCourier(sender) ;
+                    CourierUtil.cleanCourier(receiver) ;
+                }
+	} //________________________________
+	
+	public static EPR serviceDestination(EPR epr) throws MalformedEPRException
+	{
+		// For all file Epr's (local, FTP and sFTP - destination EPR
+		// must be set to where the service expects the input
+		//    dest.setPostSuffix (source.getInputSuffix)
+		try
+		{
+			if (epr instanceof SFTPEpr)
+			{
+				SFTPEpr source = (SFTPEpr)epr;
+				SFTPEpr dest = new SFTPEpr(source.getURL());
+				dest.setPostSuffix		(source.getInputSuffix());
+				dest.setPassive			(source.getPassive());
+				dest.setCertificateURL	(source.getCertificateURL());
+				return dest;
+			}
+			if (epr instanceof FTPEpr)
+			{
+				FTPEpr source = (FTPEpr)epr;
+				FTPEpr dest = new FTPEpr(source.getURL());
+				dest.setPostSuffix		(source.getInputSuffix());
+				dest.setPassive			(source.getPassive());
+				return dest;
+			}
+			if (epr instanceof FileEpr)
+			{
+				FileEpr source = (FileEpr)epr;
+				FileEpr dest = new FileEpr(source.getURL());
+				dest.setPostSuffix		(source.getInputSuffix());
+				return dest;
+			}
+		}
+		catch (URISyntaxException e) 	{throw new MalformedEPRException(e); }
+		catch (MalformedURLException e)	{throw new MalformedEPRException(e); }
+
+		return epr;
+	}
+	
+	private static Logger _logger = Logger.getLogger(Invoker.class);
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,421 +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.lang.reflect.Method;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.TimeUnit;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierTimeoutException;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.couriers.TwoWayCourier;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.ListenerUtil;
-import org.jboss.soa.esb.listeners.RegistryUtil;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.util.Util;
-
-/**
- * Esb Message aware transport independent listener. <p/> Relies on the
- * CourierFactory to obtain an appropriate Courier for the EPR this listener
- * will be listening on <br/>Keeps a thread pool to instantiate
- * ActionProcessingPipelines whenever a Message is received
- * 
- * @author <a
- *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- */
-
-public class MessageAwareListener  extends AbstractThreadedManagedLifecycle
-{
-        /**
-         * serial version uid for this class
-         */
-        private static final long serialVersionUID = -9198018611828254359L;
-        
-        /**
-         * The minimum error delay.
-         */
-        private static final long MIN_ERROR_DELAY = 1000 ;
-        /**
-         * The maximum error delay.
-         */
-        private static final long MAX_ERROR_DELAY = (MIN_ERROR_DELAY << 5) ;
-        
-        /**
-         * The action pipeline.
-         */
-        private ActionProcessingPipeline pipeline ;
-    
-        /**
-         * The error delay.
-         */
-        private long errorDelay ;
-        
-        /**
-	 * public constructor
-	 * 
-	 * @param config
-	 *            ConfigTree - Containing 'static' configuration for this
-	 *            instance
-	 * @throws ConfigurationException
-	 */
-	public MessageAwareListener(final ConfigTree config)
-			throws ConfigurationException
-	{
-            super(config);
-            _config = config ;
-            checkMyParms() ;
-	}
-
-	/**
-	 * Check for mandatory and optional attributes in parameter tree
-	 * 
-	 * @throws ConfigurationException -
-	 *             if mandatory atts are not right or actionClass not in
-	 *             classpath
-	 */
-	protected void checkMyParms () throws ConfigurationException
-	{
-                _eprCategoryName = _config.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
-                _eprName = _config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
-
-                final String maxThreadVal = _config.getAttribute(ListenerTagNames.MAX_THREADS_TAG) ;
-                
-                if (!Util.isNullString(maxThreadVal))
-                {
-                    try
-                    {
-                        _maxThreads = Integer.parseInt(maxThreadVal) ;
-                    }
-                    catch (NumberFormatException nfe)
-                    {
-                        _maxThreads = _defaultMaxThreads ;
-                        _logger.warn("Invalid " + ListenerTagNames.MAX_THREADS_TAG + " attribute, defaulting to <" + _maxThreads + ">") ;
-                    }
-                }
-
-		if (Util.isNullString(_eprCategoryName))
-			throw new ConfigurationException(
-					"Missing or invalid " + ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
-		if (Util.isNullString(_eprName))
-			throw new ConfigurationException(
-					"Missing or invalid " + ListenerTagNames.SERVICE_NAME_TAG);
-
-		ConfigTree eprElement = _config.getFirstChild(ListenerTagNames.EPR_TAG);
-		if (null == eprElement)
-			throw new ConfigurationException(
-					"Missing or invalid " + ListenerTagNames.EPR_TAG + " element");
-		_epr = ListenerUtil.assembleEpr(eprElement);
-                
-                String latency = _config.getAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG);
-                long lSeconds = 10;
-                if (null != latency)
-                {
-                    try
-                    {
-                        lSeconds = Integer.parseInt(latency);
-                    }
-                    catch (NumberFormatException e)
-                    {
-                        _logger.warn("Invalid number format <" + latency + "> using default value (" + lSeconds + ")");
-                    }
-                }
-                _latencySecs = lSeconds ;                
-	}
-        
-        /**
-         * Handle the initialisation of the managed instance.
-         * 
-         * @throws ManagedLifecycleException for errors while initialisation.
-         */
-        protected void doInitialise()
-            throws ManagedLifecycleException
-        {
-            final ActionProcessingPipeline pipeline ;
-            try
-            {
-                pipeline = new ActionProcessingPipeline(_config) ;
-                pipeline.initialise() ;
-            }
-            catch (final ConfigurationException ce)
-            {
-                throw new ManagedLifecycleException("Error configuring action processing pipeline", ce) ;
-            }
-            this.pipeline = pipeline ;
-            final TwoWayCourier pickUpCourier ;
-            try
-            {
-                pickUpCourier = CourierFactory.getPickupCourier(_epr) ;
-                try
-                {
-                    final Method setPollLatency = pickUpCourier.getClass().getMethod(
-                        "setPollLatency", new Class[] { Long.class });
-                    setPollLatency.invoke(pickUpCourier, new Long(1000 * _latencySecs));
-                }
-                catch (final NoSuchMethodException nsme)
-                {
-                        // OK, just leave it null
-                }
-                catch (final Exception ex)
-                {
-                    CourierUtil.cleanCourier(pickUpCourier);
-                    throw new ManagedLifecycleException("Problems invoking setPollLatency(long)", ex) ;
-                }
-            }
-            catch (final MalformedEPRException mepre)
-            {
-                throw new ManagedLifecycleException("Malformed EPR: " + _epr) ;
-            }
-            catch (final CourierException ce)
-            {
-                throw new ManagedLifecycleException("No appropriate courier can be obtained for " + _epr, ce);
-            }
-            
-            _pickUpCourier = pickUpCourier ;
-         
-            try
-            {
-                RegistryUtil.register(_config, _epr);
-            }
-            catch (final RegistryException re)
-            {
-                CourierUtil.cleanCourier(_pickUpCourier);
-                throw new ManagedLifecycleException("Unexpected error during registration for epr " + _epr, re);
-            }
-        }
-        
-        /**
-         * Handle the start of the managed instance.
-         * 
-         * @throws ManagedLifecycleException for errors while starting.
-         */
-        protected void doStart()
-            throws ManagedLifecycleException
-        {
-            checkExecutorTermination() ;
-            
-            _execService = Executors.newFixedThreadPool(_maxThreads) ;
-            
-            super.doStart() ;
-        }
-        
-        /**
-         * Execute on the thread.
-         */
-        protected void doRun()
-        {
-            if (_logger.isDebugEnabled())
-            {
-                _logger.debug("doRun() method of " + this.getClass().getSimpleName()
-                            + " started on thread " + Thread.currentThread().getName());
-            }
-            
-            while (isRunning())
-            {
-                // Only pickup a message when a thread is available
-                if (waitForThread(_pauseLapseInMillis))
-                {
-                    waitForEventAndProcess(100) ;
-                }
-            }
-
-            if (_logger.isDebugEnabled())
-            {
-                _logger.debug("run() method of " + this.getClass().getSimpleName()
-                            + " finished on thread " + Thread.currentThread().getName());
-            }
-        }
-        
-	public void waitForEventAndProcess (long maxWaitMillis)
-	{
-		final Message message ;
-		try
-		{
-			message = (maxWaitMillis > 0) ? _pickUpCourier
-					.pickup(maxWaitMillis) : null;
-                        errorDelay = 0 ;
-		}
-		catch (CourierTimeoutException e)
-		{
-			return;
-		}
-		catch (CourierException e)
-		{
-                        _logger.debug("Courier Exception", e);
-                        if (errorDelay == 0)
-                        {
-                            errorDelay = MIN_ERROR_DELAY ;
-                        }
-                        else if (errorDelay < MAX_ERROR_DELAY)
-                        {
-                            errorDelay <<= 1 ;
-                        }
-                        _logger.warn("Error processing courier, backing off for " + errorDelay + " milliseconds") ;
-                        waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, errorDelay) ;
-			return;
-		}
-
-		if (null != message)
-		{
-                    final Runnable pipelineRunner = new Runnable() {
-                        public void run() {
-                            try {
-                                pipeline.process(message) ;
-                            } finally {
-                                updateThreadCount(-1) ;
-                            }
-                        }
-                    } ;
-                    updateThreadCount(+1);
-                    _execService.execute(pipelineRunner);
-		}
-
-	} // ________________________________
-        
-        /**
-         * Handle the destroy of the managed instance.
-         * 
-         * @throws ManagedLifecycleException for errors while destroying.
-         */
-        protected void doDestroy()
-            throws ManagedLifecycleException
-        {
-            if (!waitForRunningStateChange(ManagedLifecycleThreadState.STOPPED, getTerminationPeriod()))
-            {
-                throw new ManagedLifecycleException("Failed to reach STOPPED state within specified termination period") ;
-            }
-            
-            if (_execService != null)
-            {
-                _execService.shutdown() ;
-                checkExecutorTermination() ;
-            }
-            
-            pipeline.destroy() ;
-            pipeline = null ;
-            
-            CourierUtil.cleanCourier(_pickUpCourier);
-            
-            RegistryUtil.unregister(_eprCategoryName, _eprName, _epr) ;
-        }
-        
-        /**
-         * Check that the existing executor has been closed down.
-         * @throws ManagedLifecycleException If executor tasks are still active.
-         */
-        private void checkExecutorTermination()
-            throws ManagedLifecycleException
-        {
-            if (_execService != null)
-            {
-                try
-                {
-                    try
-                    {
-                        if (!_execService.awaitTermination(getTerminationPeriod(), TimeUnit.MILLISECONDS))
-                        {
-                            throw new ManagedLifecycleException("Tasks remain active in executor") ;
-                        }
-                    }
-                    catch (final InterruptedException ie)
-                    {
-                        throw new ManagedLifecycleException("Interrupted waiting for active tasks to terminate") ;
-                    }
-                }
-                finally
-                {
-                    _execService = null ;
-                }
-            }
-        }
-
-        private boolean waitForThread(final long delay)
-        {
-            boolean result = true ;
-            synchronized(_synchThreads)
-            {
-                if (_qRunningThreads >= _maxThreads)
-                {
-                    try
-                    {
-                        _synchThreads.wait(delay) ;
-                    }
-                    catch (final InterruptedException ie) {}
-                    result = _qRunningThreads < _maxThreads ;
-                }
-            }
-            return result ;
-        }
-
-        private void updateThreadCount(Integer i)
-        {
-            synchronized (_synchThreads)
-            {
-                _qRunningThreads += i.intValue();
-                if (_qRunningThreads < _maxThreads)
-                {
-                    _synchThreads.notifyAll() ;
-                }
-            }
-        }
-
-        private ConfigTree _config;
-
-        private String _eprCategoryName;
-
-        private String _eprName;
-
-        private EPR _epr;
-
-        private int _maxThreads;
-
-        private int _defaultMaxThreads = 1;
-        
-        private long _latencySecs;
-        
-        private long _pauseLapseInMillis = 50 ;
-
-        private ExecutorService _execService;
-
-        private Object _synchThreads = new Short((short) -1);
-        
-        private int _qRunningThreads;
-
-        private Logger _logger = Logger.getLogger(MessageAwareListener.class);
-        
-        private PickUpOnlyCourier _pickUpCourier;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageAwareListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,421 @@
+/*
+ * 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.lang.reflect.Method;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierTimeoutException;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.couriers.TwoWayCourier;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.ListenerUtil;
+import org.jboss.soa.esb.listeners.RegistryUtil;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * Esb Message aware transport independent listener. <p/> Relies on the
+ * CourierFactory to obtain an appropriate Courier for the EPR this listener
+ * will be listening on <br/>Keeps a thread pool to instantiate
+ * ActionProcessingPipelines whenever a Message is received
+ * 
+ * @author <a
+ *         href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ */
+
+public class MessageAwareListener  extends AbstractThreadedManagedLifecycle
+{
+        /**
+         * serial version uid for this class
+         */
+        private static final long serialVersionUID = -9198018611828254359L;
+        
+        /**
+         * The minimum error delay.
+         */
+        private static final long MIN_ERROR_DELAY = 1000 ;
+        /**
+         * The maximum error delay.
+         */
+        private static final long MAX_ERROR_DELAY = (MIN_ERROR_DELAY << 5) ;
+        
+        /**
+         * The action pipeline.
+         */
+        private ActionProcessingPipeline pipeline ;
+    
+        /**
+         * The error delay.
+         */
+        private long errorDelay ;
+        
+        /**
+	 * public constructor
+	 * 
+	 * @param config
+	 *            ConfigTree - Containing 'static' configuration for this
+	 *            instance
+	 * @throws ConfigurationException
+	 */
+	public MessageAwareListener(final ConfigTree config)
+			throws ConfigurationException
+	{
+            super(config);
+            _config = config ;
+            checkMyParms() ;
+	}
+
+	/**
+	 * Check for mandatory and optional attributes in parameter tree
+	 * 
+	 * @throws ConfigurationException -
+	 *             if mandatory atts are not right or actionClass not in
+	 *             classpath
+	 */
+	protected void checkMyParms () throws ConfigurationException
+	{
+                _eprCategoryName = _config.getAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
+                _eprName = _config.getAttribute(ListenerTagNames.SERVICE_NAME_TAG);
+
+                final String maxThreadVal = _config.getAttribute(ListenerTagNames.MAX_THREADS_TAG) ;
+                
+                if (!Util.isNullString(maxThreadVal))
+                {
+                    try
+                    {
+                        _maxThreads = Integer.parseInt(maxThreadVal) ;
+                    }
+                    catch (NumberFormatException nfe)
+                    {
+                        _maxThreads = _defaultMaxThreads ;
+                        _logger.warn("Invalid " + ListenerTagNames.MAX_THREADS_TAG + " attribute, defaulting to <" + _maxThreads + ">") ;
+                    }
+                }
+
+		if (Util.isNullString(_eprCategoryName))
+			throw new ConfigurationException(
+					"Missing or invalid " + ListenerTagNames.SERVICE_CATEGORY_NAME_TAG);
+		if (Util.isNullString(_eprName))
+			throw new ConfigurationException(
+					"Missing or invalid " + ListenerTagNames.SERVICE_NAME_TAG);
+
+		ConfigTree eprElement = _config.getFirstChild(ListenerTagNames.EPR_TAG);
+		if (null == eprElement)
+			throw new ConfigurationException(
+					"Missing or invalid " + ListenerTagNames.EPR_TAG + " element");
+		_epr = ListenerUtil.assembleEpr(eprElement);
+                
+                String latency = _config.getAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG);
+                long lSeconds = 10;
+                if (null != latency)
+                {
+                    try
+                    {
+                        lSeconds = Integer.parseInt(latency);
+                    }
+                    catch (NumberFormatException e)
+                    {
+                        _logger.warn("Invalid number format <" + latency + "> using default value (" + lSeconds + ")");
+                    }
+                }
+                _latencySecs = lSeconds ;                
+	}
+        
+        /**
+         * Handle the initialisation of the managed instance.
+         * 
+         * @throws ManagedLifecycleException for errors while initialisation.
+         */
+        protected void doInitialise()
+            throws ManagedLifecycleException
+        {
+            final ActionProcessingPipeline pipeline ;
+            try
+            {
+                pipeline = new ActionProcessingPipeline(_config) ;
+                pipeline.initialise() ;
+            }
+            catch (final ConfigurationException ce)
+            {
+                throw new ManagedLifecycleException("Error configuring action processing pipeline", ce) ;
+            }
+            this.pipeline = pipeline ;
+            final TwoWayCourier pickUpCourier ;
+            try
+            {
+                pickUpCourier = CourierFactory.getPickupCourier(_epr) ;
+                try
+                {
+                    final Method setPollLatency = pickUpCourier.getClass().getMethod(
+                        "setPollLatency", new Class[] { Long.class });
+                    setPollLatency.invoke(pickUpCourier, new Long(1000 * _latencySecs));
+                }
+                catch (final NoSuchMethodException nsme)
+                {
+                        // OK, just leave it null
+                }
+                catch (final Exception ex)
+                {
+                    CourierUtil.cleanCourier(pickUpCourier);
+                    throw new ManagedLifecycleException("Problems invoking setPollLatency(long)", ex) ;
+                }
+            }
+            catch (final MalformedEPRException mepre)
+            {
+                throw new ManagedLifecycleException("Malformed EPR: " + _epr) ;
+            }
+            catch (final CourierException ce)
+            {
+                throw new ManagedLifecycleException("No appropriate courier can be obtained for " + _epr, ce);
+            }
+            
+            _pickUpCourier = pickUpCourier ;
+         
+            try
+            {
+                RegistryUtil.register(_config, _epr);
+            }
+            catch (final RegistryException re)
+            {
+                CourierUtil.cleanCourier(_pickUpCourier);
+                throw new ManagedLifecycleException("Unexpected error during registration for epr " + _epr, re);
+            }
+        }
+        
+        /**
+         * Handle the start of the managed instance.
+         * 
+         * @throws ManagedLifecycleException for errors while starting.
+         */
+        protected void doStart()
+            throws ManagedLifecycleException
+        {
+            checkExecutorTermination() ;
+            
+            _execService = Executors.newFixedThreadPool(_maxThreads) ;
+            
+            super.doStart() ;
+        }
+        
+        /**
+         * Execute on the thread.
+         */
+        protected void doRun()
+        {
+            if (_logger.isDebugEnabled())
+            {
+                _logger.debug("doRun() method of " + this.getClass().getSimpleName()
+                            + " started on thread " + Thread.currentThread().getName());
+            }
+            
+            while (isRunning())
+            {
+                // Only pickup a message when a thread is available
+                if (waitForThread(_pauseLapseInMillis))
+                {
+                    waitForEventAndProcess(100) ;
+                }
+            }
+
+            if (_logger.isDebugEnabled())
+            {
+                _logger.debug("run() method of " + this.getClass().getSimpleName()
+                            + " finished on thread " + Thread.currentThread().getName());
+            }
+        }
+        
+	public void waitForEventAndProcess (long maxWaitMillis)
+	{
+		final Message message ;
+		try
+		{
+			message = (maxWaitMillis > 0) ? _pickUpCourier
+					.pickup(maxWaitMillis) : null;
+                        errorDelay = 0 ;
+		}
+		catch (CourierTimeoutException e)
+		{
+			return;
+		}
+		catch (CourierException e)
+		{
+                        _logger.debug("Courier Exception", e);
+                        if (errorDelay == 0)
+                        {
+                            errorDelay = MIN_ERROR_DELAY ;
+                        }
+                        else if (errorDelay < MAX_ERROR_DELAY)
+                        {
+                            errorDelay <<= 1 ;
+                        }
+                        _logger.warn("Error processing courier, backing off for " + errorDelay + " milliseconds") ;
+                        waitForRunningStateChange(ManagedLifecycleThreadState.STOPPING, errorDelay) ;
+			return;
+		}
+
+		if (null != message)
+		{
+                    final Runnable pipelineRunner = new Runnable() {
+                        public void run() {
+                            try {
+                                pipeline.process(message) ;
+                            } finally {
+                                updateThreadCount(-1) ;
+                            }
+                        }
+                    } ;
+                    updateThreadCount(+1);
+                    _execService.execute(pipelineRunner);
+		}
+
+	} // ________________________________
+        
+        /**
+         * Handle the destroy of the managed instance.
+         * 
+         * @throws ManagedLifecycleException for errors while destroying.
+         */
+        protected void doDestroy()
+            throws ManagedLifecycleException
+        {
+            if (!waitForRunningStateChange(ManagedLifecycleThreadState.STOPPED, getTerminationPeriod()))
+            {
+                throw new ManagedLifecycleException("Failed to reach STOPPED state within specified termination period") ;
+            }
+            
+            if (_execService != null)
+            {
+                _execService.shutdown() ;
+                checkExecutorTermination() ;
+            }
+            
+            pipeline.destroy() ;
+            pipeline = null ;
+            
+            CourierUtil.cleanCourier(_pickUpCourier);
+            
+            RegistryUtil.unregister(_eprCategoryName, _eprName, _epr) ;
+        }
+        
+        /**
+         * Check that the existing executor has been closed down.
+         * @throws ManagedLifecycleException If executor tasks are still active.
+         */
+        private void checkExecutorTermination()
+            throws ManagedLifecycleException
+        {
+            if (_execService != null)
+            {
+                try
+                {
+                    try
+                    {
+                        if (!_execService.awaitTermination(getTerminationPeriod(), TimeUnit.MILLISECONDS))
+                        {
+                            throw new ManagedLifecycleException("Tasks remain active in executor") ;
+                        }
+                    }
+                    catch (final InterruptedException ie)
+                    {
+                        throw new ManagedLifecycleException("Interrupted waiting for active tasks to terminate") ;
+                    }
+                }
+                finally
+                {
+                    _execService = null ;
+                }
+            }
+        }
+
+        private boolean waitForThread(final long delay)
+        {
+            boolean result = true ;
+            synchronized(_synchThreads)
+            {
+                if (_qRunningThreads >= _maxThreads)
+                {
+                    try
+                    {
+                        _synchThreads.wait(delay) ;
+                    }
+                    catch (final InterruptedException ie) {}
+                    result = _qRunningThreads < _maxThreads ;
+                }
+            }
+            return result ;
+        }
+
+        private void updateThreadCount(Integer i)
+        {
+            synchronized (_synchThreads)
+            {
+                _qRunningThreads += i.intValue();
+                if (_qRunningThreads < _maxThreads)
+                {
+                    _synchThreads.notifyAll() ;
+                }
+            }
+        }
+
+        private ConfigTree _config;
+
+        private String _eprCategoryName;
+
+        private String _eprName;
+
+        private EPR _epr;
+
+        private int _maxThreads;
+
+        private int _defaultMaxThreads = 1;
+        
+        private long _latencySecs;
+        
+        private long _pauseLapseInMillis = 50 ;
+
+        private ExecutorService _execService;
+
+        private Object _synchThreads = new Short((short) -1);
+        
+        private int _qRunningThreads;
+
+        private Logger _logger = Logger.getLogger(MessageAwareListener.class);
+        
+        private PickUpOnlyCourier _pickUpCourier;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageComposer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageComposer.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageComposer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,98 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.message;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * Message composer.
- * <p/>
- * A "Composer" is basically a "Builder" ala the GoF patterns.
- * <p/>
- * Implementations should be threadsafe (stateless) and must contain
- * a public default constructor.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public interface MessageComposer {
-
-    /**
-     * Set the conposer's configuration.
-     *
-     * @param config Composer configuration.
-     */
-    public void setConfiguration(ConfigTree config);
-
-    /**
-     * Compose an ESB "aware" message from the supplied message payload.
-     * <p/>
-     * Implementations need to construct and populate an ESB Message from the
-     * messagePayload instance.
-     *
-     * @param messagePayload Message payload to be packaged, or a channel specific
-     *                       container class for the message payload (e.g. a JMS message).
-     * @return ESB aware message instance.
-     * @throws MessageDeliverException Failed to compose message payload for delivery.
-     */
-    public Message compose(Object messagePayload) throws MessageDeliverException;
-
-    /**
-     * Decompose an ESB "aware" message, extracting and returning the message payload.
-     *
-     * @param message ESB aware message instance to be decomposed.
-     * @return ESB unaware message instance - a message payload.
-     * @throws MessageDeliverException Failed to decompose message payload.
-     */
-    public Object decompose(Message message) throws MessageDeliverException;
-
-    /**
-     * Uitility factory class for reflective {@link MessageComposer} construction.
-     */
-    public static class Factory {
-
-        /**
-         * Factory method.
-         *
-         * @param className Class name.
-         * @param config    The composer configuration.
-         * @return Composer instance.
-         * @throws MessageDeliverException Unable to construct composer.
-         */
-        public static MessageComposer getInstance(String className, ConfigTree config) throws MessageDeliverException {
-            AssertArgument.isNotNullAndNotEmpty(className, "className");
-            AssertArgument.isNotNull(config, "config");
-
-            try {
-                MessageComposer instance = (MessageComposer) ClassUtil.forName(className, Factory.class).newInstance();
-                instance.setConfiguration(config);
-                return instance;
-            } catch (ClassNotFoundException e) {
-                throw new MessageDeliverException("Composer class [" + className + "] not found in classpath.", e);
-            } catch (InstantiationException e) {
-                throw new MessageDeliverException("Failed to instantiate composer class [" + className + "].", e);
-            } catch (IllegalAccessException e) {
-                throw new MessageDeliverException("Failed to instantiate composer class [" + className + "].", e);
-            }
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageComposer.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageComposer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageComposer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageComposer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,98 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.message;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Message composer.
+ * <p/>
+ * A "Composer" is basically a "Builder" ala the GoF patterns.
+ * <p/>
+ * Implementations should be threadsafe (stateless) and must contain
+ * a public default constructor.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public interface MessageComposer {
+
+    /**
+     * Set the conposer's configuration.
+     *
+     * @param config Composer configuration.
+     */
+    public void setConfiguration(ConfigTree config);
+
+    /**
+     * Compose an ESB "aware" message from the supplied message payload.
+     * <p/>
+     * Implementations need to construct and populate an ESB Message from the
+     * messagePayload instance.
+     *
+     * @param messagePayload Message payload to be packaged, or a channel specific
+     *                       container class for the message payload (e.g. a JMS message).
+     * @return ESB aware message instance.
+     * @throws MessageDeliverException Failed to compose message payload for delivery.
+     */
+    public Message compose(Object messagePayload) throws MessageDeliverException;
+
+    /**
+     * Decompose an ESB "aware" message, extracting and returning the message payload.
+     *
+     * @param message ESB aware message instance to be decomposed.
+     * @return ESB unaware message instance - a message payload.
+     * @throws MessageDeliverException Failed to decompose message payload.
+     */
+    public Object decompose(Message message) throws MessageDeliverException;
+
+    /**
+     * Uitility factory class for reflective {@link MessageComposer} construction.
+     */
+    public static class Factory {
+
+        /**
+         * Factory method.
+         *
+         * @param className Class name.
+         * @param config    The composer configuration.
+         * @return Composer instance.
+         * @throws MessageDeliverException Unable to construct composer.
+         */
+        public static MessageComposer getInstance(String className, ConfigTree config) throws MessageDeliverException {
+            AssertArgument.isNotNullAndNotEmpty(className, "className");
+            AssertArgument.isNotNull(config, "config");
+
+            try {
+                MessageComposer instance = (MessageComposer) ClassUtil.forName(className, Factory.class).newInstance();
+                instance.setConfiguration(config);
+                return instance;
+            } catch (ClassNotFoundException e) {
+                throw new MessageDeliverException("Composer class [" + className + "] not found in classpath.", e);
+            } catch (InstantiationException e) {
+                throw new MessageDeliverException("Failed to instantiate composer class [" + className + "].", e);
+            } catch (IllegalAccessException e) {
+                throw new MessageDeliverException("Failed to instantiate composer class [" + className + "].", e);
+            }
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliverException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliverException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliverException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,39 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.message;
-
-import org.jboss.soa.esb.BaseException;
-
-/**
- * Message delivery failure.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MessageDeliverException extends BaseException {
-
-    private static final long serialVersionUID = 1L;
-
-    public MessageDeliverException(String message) {
-        super(message);
-    }
-
-    public MessageDeliverException(String message, Throwable cause) {
-        super(message, cause);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliverException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliverException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliverException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliverException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,39 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.message;
+
+import org.jboss.soa.esb.BaseException;
+
+/**
+ * Message delivery failure.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MessageDeliverException extends BaseException {
+
+    private static final long serialVersionUID = 1L;
+
+    public MessageDeliverException(String message) {
+        super(message);
+    }
+
+    public MessageDeliverException(String message, Throwable cause) {
+        super(message, cause);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,277 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.message;
-
-import java.util.Collection;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.couriers.TwoWayCourier;
-import org.jboss.soa.esb.listeners.RegistryUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-
-/**
- * Adapter class for managing {@link Message} delivery to a specified Service.
- * <p/>
- * Manages loading of {@link EPR EPRs}, {@link Courier} selection and
- * message delivery. Provides a unified/simplified interface for message
- * delivery.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MessageDeliveryAdapter {
-
-    /**
-     * Class logger.
-     */
-    private static Logger logger = Logger.getLogger(MessageDeliveryAdapter.class);
-
-    /**
-     * The <b>category name</b> of the Service to which this instance will
-     * deliver messages.
-     */
-    private String serviceCategory;
-    /**
-     * The <b>name</b> of the Service to which this instance will
-     * deliver messages.
-     */
-    private String serviceName;
-    /**
-     * The list of installed EPRs for the target Service.
-     */
-    private Collection<EPR> serviceEprs;
-
-    /**
-     * A cached instance of the last EPR that "worked" on this instance.  Just saves iterating over
-     * all the EPRs again.  If it fails, we iterate as normal.
-     */
-    private EPR lastSuccessfulEPR;
-
-    /**
-     * Synchronous courier "pickup" deliver timeout.
-     */
-    private ThreadLocal<Long> syncPickupDeliveryTimeout = new ThreadLocal<Long>();
-
-    /**
-     * Public constructor.
-     *
-     * @param serviceCategory The <b>category name</b> of the Service to which this instance will
-     *                        deliver messages.
-     * @param serviceName     The <b>name</b> of the Service to which this instance will
-     *                        deliver messages.
-     * @throws RegistryException Failed to lookup EPRs for the specified Service.
-     */
-    public MessageDeliveryAdapter(String serviceCategory, String serviceName) throws RegistryException {
-        AssertArgument.isNotNullAndNotEmpty(serviceCategory, "serviceCategory");
-        AssertArgument.isNotNullAndNotEmpty(serviceName, "serviceName");
-
-        this.serviceCategory = serviceCategory;
-        this.serviceName = serviceName;
-        serviceEprs = RegistryUtil.getEprs(serviceCategory, serviceName);
-    }
-
-    /**
-     * Synchronously deliver the supplied message to the target service associated with this adapter instance.
-     *
-     * @param message       The message to be delivered.
-     * @param timeoutMillis Number of milliseconds before synchronous reply pickup should timeout.
-     * @return Returns the reply message if the message was delivered
-     *         without error, otherwise an exception is thrown.
-     * @throws MessageDeliverException Failed to deliver message, after trying all available EPRs.
-     */
-    public Message deliverSync(Message message, long timeoutMillis) throws MessageDeliverException {
-        syncPickupDeliveryTimeout.set(timeoutMillis);
-        return deliver(message, true);
-    }
-
-    /**
-     * Asynchronously deliver the supplied message to the target service associated with this adapter instance.
-     *
-     * @param message The message to be delivered.
-     * @throws MessageDeliverException Failed to deliver message, after trying all available EPRs.
-     */
-    public void deliverAsync(Message message) throws MessageDeliverException {
-        // Not interested in a reply
-        deliver(message, false);
-    }
-
-    /**
-     * Deliver the supplied message to the target service associated with this adapter instance.
-     *
-     * @param message     The message to be delivered.
-     * @param synchronous Is the message to be delivered synchronously or not (asynchronously).
-     * @return Returns the message (or a reply message if synchronous) if the message was delivered
-     *         without error, otherwise an exception is thrown.
-     * @throws MessageDeliverException Failed to deliver message, after trying all available EPRs.
-     */
-    private Message deliver(Message message, boolean synchronous) throws MessageDeliverException {
-        Message replyMessage = null;
-
-        // If we have a cached version of an EPR that previously worked, try it first...
-        if (lastSuccessfulEPR != null) {
-            replyMessage = attemptDelivery(message, lastSuccessfulEPR, synchronous);
-            if (replyMessage != null) {
-                // We've successully delivered the message using the same EPR as worked the
-                // the last time.  We're done!...
-                return replyMessage;
-            }
-        }
-
-        // Iterate over all the EPRs in the list...
-        for (EPR epr : serviceEprs) {
-            replyMessage = attemptDelivery(message, epr, synchronous);
-            if (replyMessage != null) {
-                // We've delivered it, we're done!
-                lastSuccessfulEPR = epr;
-                return replyMessage;
-            }
-        }
-
-        // Throw exception if delivery failed...
-        throw new MessageDeliverException("Failed to deliver message to Service [" + serviceCategory + ":" + serviceName + "].  Check for errors.");
-    }
-
-    /**
-     * Get the Service category name for the Service for which this instance is delivering messages.
-     *
-     * @return Service Category.
-     */
-    public String getServiceCategory() {
-        return serviceCategory;
-    }
-
-    /**
-     * Get the Service name for the Service for which this instance is delivering messages.
-     *
-     * @return Service name.
-     */
-    public String getServiceName() {
-        return serviceName;
-    }
-
-    /**
-     * Attempt to deliver the supplied message using the supplied EPR.
-     *
-     * @param message     The message to be delivered.
-     * @param epr         The EPR to be used in the delivery attempt.
-     * @param synchronous Is the message to be delivered synchronously or not (asynchronously).
-     * @return Returns the message (or a reply message if synchronous) if the message was delivered
-     *         without error, otherwise null.
-     */
-    private Message attemptDelivery(Message message, EPR epr, boolean synchronous) {
-        TwoWayCourier courier = null;
-
-        // Get a courier for the EPR...
-        try {
-            courier = getCourier(epr);
-        } catch (CourierException e) {
-            logger.warn("Courier lookup failed for EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "].", e);
-        } catch (MalformedEPRException e) {
-            logger.warn("Badly formed EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "]. " + e.getMessage());
-        } catch (Throwable t) {
-            logger.warn("Unexpected exception during Courier lookup for EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "].", t);
-        }
-
-        // Try delivering the message using the courier we just looked up....
-        if (courier != null) {
-            try {
-                EPR replyToEPR = null;
-
-                if (synchronous) {
-                    replyToEPR = getReplyToAddress(epr);
-                    if(replyToEPR == null) {
-                        logger.debug("Not using epr [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "]. No reply-to address available for synchronous response.");
-                        return null;
-                    }
-                    message.getHeader().getCall().setReplyTo(replyToEPR);
-                }
-                if (courier.deliver(message)) {
-                    if (replyToEPR != null) {
-                        courier.setReplyToEpr(replyToEPR);
-                        return courier.pickup(syncPickupDeliveryTimeout.get());
-                    } else {
-                        return message;
-                    }
-                }
-            } catch (CourierException e) {
-                logger.warn("Badly formed EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "]. " + e.getMessage());
-            } catch (MalformedEPRException e) {
-                // Hmmmm???... Can this really happen?  The Courier has already been created.  Haven't we already validated the EPR during the Courier lookup (above)??
-                logger.warn("Unexpected error.  Badly formed EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "]. But the EPR has already been validated!!");
-            } catch (Throwable t) {
-                logger.warn("Unexpected exception during attempted message delivery over Courier for EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "].", t);
-            } finally {
-                // TODO: So does this mean that Couriers are stateful?  If so, do we need to synchronize on using them??
-                CourierUtil.cleanCourier(courier);
-            }
-        }
-
-        return null;
-    }
-
-    /**
-     * Get the last EPR that "worked" on this instance.
-     *
-     * @return Last successfully used EPR, or null if there was none.
-     */
-    protected EPR getLastSuccessfulEPR() {
-        return lastSuccessfulEPR;
-    }
-
-    /**
-     * Get the reply to address for synchronous delivery.
-     *
-     * @param toEpr The to address.
-     * @return The replyTo address.
-     * @throws ConfigurationException
-     */
-    protected EPR getReplyToAddress(EPR toEpr) throws ConfigurationException {
-        // This method just allows us to override Courier lookup during unit testing.
-        try {
-            return CourierUtil.getDefaultReplyToEpr(toEpr);
-        } catch (CourierException e) {
-            throw new ConfigurationException("Bad configuration. Unable to support synchronous reply on 'to' address " + toEpr, e);
-        } catch (MalformedEPRException e) {
-            throw new ConfigurationException("Bad configuration. Unable to support synchronous reply on 'to' address " + toEpr, e);
-        }
-    }
-
-    /**
-     * Get a {@link org.jboss.soa.esb.couriers.Courier} for the supplied EPR.
-     *
-     * @param epr The EPR for which a {@link org.jboss.soa.esb.couriers.Courier}
-     *            is being sought.
-     * @return The courier for the EPR.
-     * @throws CourierException      A courier implementation cannot be created.
-     * @throws MalformedEPRException Bad EPR.
-     */
-    protected TwoWayCourier getCourier(EPR epr) throws CourierException, MalformedEPRException {
-        // This method just allows us to override Courier lookup during unit testing.
-        return CourierFactory.getInstance().getMessageCourier(epr);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,277 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.message;
+
+import java.util.Collection;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.couriers.TwoWayCourier;
+import org.jboss.soa.esb.listeners.RegistryUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+
+/**
+ * Adapter class for managing {@link Message} delivery to a specified Service.
+ * <p/>
+ * Manages loading of {@link EPR EPRs}, {@link Courier} selection and
+ * message delivery. Provides a unified/simplified interface for message
+ * delivery.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MessageDeliveryAdapter {
+
+    /**
+     * Class logger.
+     */
+    private static Logger logger = Logger.getLogger(MessageDeliveryAdapter.class);
+
+    /**
+     * The <b>category name</b> of the Service to which this instance will
+     * deliver messages.
+     */
+    private String serviceCategory;
+    /**
+     * The <b>name</b> of the Service to which this instance will
+     * deliver messages.
+     */
+    private String serviceName;
+    /**
+     * The list of installed EPRs for the target Service.
+     */
+    private Collection<EPR> serviceEprs;
+
+    /**
+     * A cached instance of the last EPR that "worked" on this instance.  Just saves iterating over
+     * all the EPRs again.  If it fails, we iterate as normal.
+     */
+    private EPR lastSuccessfulEPR;
+
+    /**
+     * Synchronous courier "pickup" deliver timeout.
+     */
+    private ThreadLocal<Long> syncPickupDeliveryTimeout = new ThreadLocal<Long>();
+
+    /**
+     * Public constructor.
+     *
+     * @param serviceCategory The <b>category name</b> of the Service to which this instance will
+     *                        deliver messages.
+     * @param serviceName     The <b>name</b> of the Service to which this instance will
+     *                        deliver messages.
+     * @throws RegistryException Failed to lookup EPRs for the specified Service.
+     */
+    public MessageDeliveryAdapter(String serviceCategory, String serviceName) throws RegistryException {
+        AssertArgument.isNotNullAndNotEmpty(serviceCategory, "serviceCategory");
+        AssertArgument.isNotNullAndNotEmpty(serviceName, "serviceName");
+
+        this.serviceCategory = serviceCategory;
+        this.serviceName = serviceName;
+        serviceEprs = RegistryUtil.getEprs(serviceCategory, serviceName);
+    }
+
+    /**
+     * Synchronously deliver the supplied message to the target service associated with this adapter instance.
+     *
+     * @param message       The message to be delivered.
+     * @param timeoutMillis Number of milliseconds before synchronous reply pickup should timeout.
+     * @return Returns the reply message if the message was delivered
+     *         without error, otherwise an exception is thrown.
+     * @throws MessageDeliverException Failed to deliver message, after trying all available EPRs.
+     */
+    public Message deliverSync(Message message, long timeoutMillis) throws MessageDeliverException {
+        syncPickupDeliveryTimeout.set(timeoutMillis);
+        return deliver(message, true);
+    }
+
+    /**
+     * Asynchronously deliver the supplied message to the target service associated with this adapter instance.
+     *
+     * @param message The message to be delivered.
+     * @throws MessageDeliverException Failed to deliver message, after trying all available EPRs.
+     */
+    public void deliverAsync(Message message) throws MessageDeliverException {
+        // Not interested in a reply
+        deliver(message, false);
+    }
+
+    /**
+     * Deliver the supplied message to the target service associated with this adapter instance.
+     *
+     * @param message     The message to be delivered.
+     * @param synchronous Is the message to be delivered synchronously or not (asynchronously).
+     * @return Returns the message (or a reply message if synchronous) if the message was delivered
+     *         without error, otherwise an exception is thrown.
+     * @throws MessageDeliverException Failed to deliver message, after trying all available EPRs.
+     */
+    private Message deliver(Message message, boolean synchronous) throws MessageDeliverException {
+        Message replyMessage = null;
+
+        // If we have a cached version of an EPR that previously worked, try it first...
+        if (lastSuccessfulEPR != null) {
+            replyMessage = attemptDelivery(message, lastSuccessfulEPR, synchronous);
+            if (replyMessage != null) {
+                // We've successully delivered the message using the same EPR as worked the
+                // the last time.  We're done!...
+                return replyMessage;
+            }
+        }
+
+        // Iterate over all the EPRs in the list...
+        for (EPR epr : serviceEprs) {
+            replyMessage = attemptDelivery(message, epr, synchronous);
+            if (replyMessage != null) {
+                // We've delivered it, we're done!
+                lastSuccessfulEPR = epr;
+                return replyMessage;
+            }
+        }
+
+        // Throw exception if delivery failed...
+        throw new MessageDeliverException("Failed to deliver message to Service [" + serviceCategory + ":" + serviceName + "].  Check for errors.");
+    }
+
+    /**
+     * Get the Service category name for the Service for which this instance is delivering messages.
+     *
+     * @return Service Category.
+     */
+    public String getServiceCategory() {
+        return serviceCategory;
+    }
+
+    /**
+     * Get the Service name for the Service for which this instance is delivering messages.
+     *
+     * @return Service name.
+     */
+    public String getServiceName() {
+        return serviceName;
+    }
+
+    /**
+     * Attempt to deliver the supplied message using the supplied EPR.
+     *
+     * @param message     The message to be delivered.
+     * @param epr         The EPR to be used in the delivery attempt.
+     * @param synchronous Is the message to be delivered synchronously or not (asynchronously).
+     * @return Returns the message (or a reply message if synchronous) if the message was delivered
+     *         without error, otherwise null.
+     */
+    private Message attemptDelivery(Message message, EPR epr, boolean synchronous) {
+        TwoWayCourier courier = null;
+
+        // Get a courier for the EPR...
+        try {
+            courier = getCourier(epr);
+        } catch (CourierException e) {
+            logger.warn("Courier lookup failed for EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "].", e);
+        } catch (MalformedEPRException e) {
+            logger.warn("Badly formed EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "]. " + e.getMessage());
+        } catch (Throwable t) {
+            logger.warn("Unexpected exception during Courier lookup for EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "].", t);
+        }
+
+        // Try delivering the message using the courier we just looked up....
+        if (courier != null) {
+            try {
+                EPR replyToEPR = null;
+
+                if (synchronous) {
+                    replyToEPR = getReplyToAddress(epr);
+                    if(replyToEPR == null) {
+                        logger.debug("Not using epr [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "]. No reply-to address available for synchronous response.");
+                        return null;
+                    }
+                    message.getHeader().getCall().setReplyTo(replyToEPR);
+                }
+                if (courier.deliver(message)) {
+                    if (replyToEPR != null) {
+                        courier.setReplyToEpr(replyToEPR);
+                        return courier.pickup(syncPickupDeliveryTimeout.get());
+                    } else {
+                        return message;
+                    }
+                }
+            } catch (CourierException e) {
+                logger.warn("Badly formed EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "]. " + e.getMessage());
+            } catch (MalformedEPRException e) {
+                // Hmmmm???... Can this really happen?  The Courier has already been created.  Haven't we already validated the EPR during the Courier lookup (above)??
+                logger.warn("Unexpected error.  Badly formed EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "]. But the EPR has already been validated!!");
+            } catch (Throwable t) {
+                logger.warn("Unexpected exception during attempted message delivery over Courier for EPR [" + epr + "] for Service [" + serviceCategory + ":" + serviceName + "].", t);
+            } finally {
+                // TODO: So does this mean that Couriers are stateful?  If so, do we need to synchronize on using them??
+                CourierUtil.cleanCourier(courier);
+            }
+        }
+
+        return null;
+    }
+
+    /**
+     * Get the last EPR that "worked" on this instance.
+     *
+     * @return Last successfully used EPR, or null if there was none.
+     */
+    protected EPR getLastSuccessfulEPR() {
+        return lastSuccessfulEPR;
+    }
+
+    /**
+     * Get the reply to address for synchronous delivery.
+     *
+     * @param toEpr The to address.
+     * @return The replyTo address.
+     * @throws ConfigurationException
+     */
+    protected EPR getReplyToAddress(EPR toEpr) throws ConfigurationException {
+        // This method just allows us to override Courier lookup during unit testing.
+        try {
+            return CourierUtil.getDefaultReplyToEpr(toEpr);
+        } catch (CourierException e) {
+            throw new ConfigurationException("Bad configuration. Unable to support synchronous reply on 'to' address " + toEpr, e);
+        } catch (MalformedEPRException e) {
+            throw new ConfigurationException("Bad configuration. Unable to support synchronous reply on 'to' address " + toEpr, e);
+        }
+    }
+
+    /**
+     * Get a {@link org.jboss.soa.esb.couriers.Courier} for the supplied EPR.
+     *
+     * @param epr The EPR for which a {@link org.jboss.soa.esb.couriers.Courier}
+     *            is being sought.
+     * @return The courier for the EPR.
+     * @throws CourierException      A courier implementation cannot be created.
+     * @throws MalformedEPRException Bad EPR.
+     */
+    protected TwoWayCourier getCourier(EPR epr) throws CourierException, MalformedEPRException {
+        // This method just allows us to override Courier lookup during unit testing.
+        return CourierFactory.getInstance().getMessageCourier(epr);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionLifecycleProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionLifecycleProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionLifecycleProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,138 +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.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionLifecycle;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Instance of ActionPipelineProcessor to allow dynamic specification of the methods
- * on a single instance of the action processor.
- * @author kevin
- */
-final class OverriddenActionLifecycleProcessor implements ActionPipelineProcessor
-{
-    /**
-     * The method info.
-     */
-    private final ActionProcessorMethodInfo methodInfo ;
-    /**
-     * The lifecycle.
-     */
-    private final ActionLifecycle lifecycle ;
-    
-    /**
-     * Construct the overridden action lifecycle processor.
-     * @param config The action config.
-     * @param lifecycle The lifecycle.
-     * @throws ConfigurationException for errors during configuration.
-     */
-    OverriddenActionLifecycleProcessor(final ConfigTree config, final ActionLifecycle lifecycle)
-        throws ConfigurationException
-    {
-        this.lifecycle = lifecycle ;
-        methodInfo = ActionProcessorMethodInfo.getMethodInfo(config, lifecycle.getClass()) ;
-    }
-    
-    /**
-     * Perform the action processing on the specified message.
-     * This method is invoked for each message passing throught the pipeline.
-     * 
-     * @param message The current message being processed.
-     * @return The message to be passed to the next stage of the pipeline.
-     * @throws ActionProcessingException for errors during processing.
-     */
-    public Message process(final Message message)
-        throws ActionProcessingException
-    {
-        if (methodInfo.hasProcessMethods())
-        {
-            return methodInfo.processMethods(lifecycle, message) ;
-        }
-        else
-        {
-            return message ;
-        }
-    }
-    
-    /**
-     * Process an exception generated by the pipeline processing.
-     * Invoked when the processing of a subsequent stage of the
-     * pipeline generates an exception.
-     * 
-     * @param message The original message.
-     * @param th The throwable raised by the pipeline processing
-     */
-    public void processException(final Message message, final Throwable th)
-    {
-        if (methodInfo.hasProcessException())
-        {
-            methodInfo.processException(lifecycle, message, th) ;
-        }
-    }
-    
-    /**
-     * Process a successful pipeline process. 
-     * Invoked when the pipeline processing completes successfully.
-     * 
-     * @param message The original message.
-     */
-    public void processSuccess(final Message message)
-    {
-        if (methodInfo.hasProcessSuccess())
-        {
-            methodInfo.processSuccess(lifecycle, message) ;
-        }
-    }
-    
-    /**
-     * Initialise the action instance.
-     * <p/>
-     * This method is called after the action instance has been instantiated so that
-     * configuration options can be validated.
-     * 
-     * @throws ActionLifecycleException for errors during initialisation.
-     */
-    public void initialise()
-        throws ActionLifecycleException
-    {
-        lifecycle.initialise() ;
-    }
-
-    /**
-     * Destroy the action instance.
-     * <p/>
-     * This method is called prior to the release of the action instance.  All
-     * resources associated with this action instance should be released as the
-     * instance will no longer be used.
-     */
-    public void destroy()
-        throws ActionLifecycleException
-    {
-        lifecycle.destroy() ;
-    }
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionLifecycleProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionLifecycleProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionLifecycleProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionLifecycleProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,138 @@
+/*
+ * 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.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionLifecycle;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Instance of ActionPipelineProcessor to allow dynamic specification of the methods
+ * on a single instance of the action processor.
+ * @author kevin
+ */
+final class OverriddenActionLifecycleProcessor implements ActionPipelineProcessor
+{
+    /**
+     * The method info.
+     */
+    private final ActionProcessorMethodInfo methodInfo ;
+    /**
+     * The lifecycle.
+     */
+    private final ActionLifecycle lifecycle ;
+    
+    /**
+     * Construct the overridden action lifecycle processor.
+     * @param config The action config.
+     * @param lifecycle The lifecycle.
+     * @throws ConfigurationException for errors during configuration.
+     */
+    OverriddenActionLifecycleProcessor(final ConfigTree config, final ActionLifecycle lifecycle)
+        throws ConfigurationException
+    {
+        this.lifecycle = lifecycle ;
+        methodInfo = ActionProcessorMethodInfo.getMethodInfo(config, lifecycle.getClass()) ;
+    }
+    
+    /**
+     * Perform the action processing on the specified message.
+     * This method is invoked for each message passing throught the pipeline.
+     * 
+     * @param message The current message being processed.
+     * @return The message to be passed to the next stage of the pipeline.
+     * @throws ActionProcessingException for errors during processing.
+     */
+    public Message process(final Message message)
+        throws ActionProcessingException
+    {
+        if (methodInfo.hasProcessMethods())
+        {
+            return methodInfo.processMethods(lifecycle, message) ;
+        }
+        else
+        {
+            return message ;
+        }
+    }
+    
+    /**
+     * Process an exception generated by the pipeline processing.
+     * Invoked when the processing of a subsequent stage of the
+     * pipeline generates an exception.
+     * 
+     * @param message The original message.
+     * @param th The throwable raised by the pipeline processing
+     */
+    public void processException(final Message message, final Throwable th)
+    {
+        if (methodInfo.hasProcessException())
+        {
+            methodInfo.processException(lifecycle, message, th) ;
+        }
+    }
+    
+    /**
+     * Process a successful pipeline process. 
+     * Invoked when the pipeline processing completes successfully.
+     * 
+     * @param message The original message.
+     */
+    public void processSuccess(final Message message)
+    {
+        if (methodInfo.hasProcessSuccess())
+        {
+            methodInfo.processSuccess(lifecycle, message) ;
+        }
+    }
+    
+    /**
+     * Initialise the action instance.
+     * <p/>
+     * This method is called after the action instance has been instantiated so that
+     * configuration options can be validated.
+     * 
+     * @throws ActionLifecycleException for errors during initialisation.
+     */
+    public void initialise()
+        throws ActionLifecycleException
+    {
+        lifecycle.initialise() ;
+    }
+
+    /**
+     * Destroy the action instance.
+     * <p/>
+     * This method is called prior to the release of the action instance.  All
+     * resources associated with this action instance should be released as the
+     * instance will no longer be used.
+     */
+    public void destroy()
+        throws ActionLifecycleException
+    {
+        lifecycle.destroy() ;
+    }
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionPipelineProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionPipelineProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionPipelineProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,145 +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.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Instance of ActionPipelineProcessor to allow selective overriding of the methods
- * on a single instance of the action processor.
- * @author kevin
- */
-final class OverriddenActionPipelineProcessor implements ActionPipelineProcessor
-{
-    /**
-     * The method info.
-     */
-    private final ActionProcessorMethodInfo methodInfo ;
-    /**
-     * The processor.
-     */
-    private final ActionPipelineProcessor processor ;
-    
-    /**
-     * Construct the overridden action pipeline processor.
-     * @param config The action config.
-     * @param processor The processor.
-     * @throws ConfigurationException for errors during configuration.
-     */
-    OverriddenActionPipelineProcessor(final ConfigTree config, final ActionPipelineProcessor processor)
-        throws ConfigurationException
-    {
-        this.processor = processor ;
-        methodInfo = ActionProcessorMethodInfo.getMethodInfo(config, processor.getClass()) ;
-    }
-    
-    /**
-     * Perform the action processing on the specified message.
-     * This method is invoked for each message passing throught the pipeline.
-     * 
-     * @param message The current message being processed.
-     * @return The message to be passed to the next stage of the pipeline.
-     * @throws ActionProcessingException for errors during processing.
-     */
-    public Message process(final Message message)
-        throws ActionProcessingException
-    {
-        if (methodInfo.hasProcessMethods())
-        {
-            return methodInfo.processMethods(processor, message) ;
-        }
-        else
-        {
-            return processor.process(message) ;
-        }
-    }
-    
-    /**
-     * Process an exception generated by the pipeline processing.
-     * Invoked when the processing of a subsequent stage of the
-     * pipeline generates an exception.
-     * 
-     * @param message The original message.
-     * @param th The throwable raised by the pipeline processing
-     */
-    public void processException(final Message message, final Throwable th)
-    {
-        if (methodInfo.hasProcessException())
-        {
-            methodInfo.processException(processor, message, th) ;
-        }
-        else
-        {
-            processor.processException(message, th) ;
-        }
-    }
-    
-    /**
-     * Process a successful pipeline process. 
-     * Invoked when the pipeline processing completes successfully.
-     * 
-     * @param message The original message.
-     */
-    public void processSuccess(final Message message)
-    {
-        if (methodInfo.hasProcessSuccess())
-        {
-            methodInfo.processSuccess(processor, message) ;
-        }
-        else
-        {
-            processor.processSuccess(message) ;
-        }
-    }
-    
-    /**
-     * Initialise the action instance.
-     * <p/>
-     * This method is called after the action instance has been instantiated so that
-     * configuration options can be validated.
-     * 
-     * @throws ActionLifecycleException for errors during initialisation.
-     */
-    public void initialise()
-        throws ActionLifecycleException
-    {
-        processor.initialise() ;
-    }
-
-    /**
-     * Destroy the action instance.
-     * <p/>
-     * This method is called prior to the release of the action instance.  All
-     * resources associated with this action instance should be released as the
-     * instance will no longer be used.
-     */
-    public void destroy()
-        throws ActionLifecycleException
-    {
-        processor.destroy() ;
-    }
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionPipelineProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionPipelineProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionPipelineProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionPipelineProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,145 @@
+/*
+ * 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.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Instance of ActionPipelineProcessor to allow selective overriding of the methods
+ * on a single instance of the action processor.
+ * @author kevin
+ */
+final class OverriddenActionPipelineProcessor implements ActionPipelineProcessor
+{
+    /**
+     * The method info.
+     */
+    private final ActionProcessorMethodInfo methodInfo ;
+    /**
+     * The processor.
+     */
+    private final ActionPipelineProcessor processor ;
+    
+    /**
+     * Construct the overridden action pipeline processor.
+     * @param config The action config.
+     * @param processor The processor.
+     * @throws ConfigurationException for errors during configuration.
+     */
+    OverriddenActionPipelineProcessor(final ConfigTree config, final ActionPipelineProcessor processor)
+        throws ConfigurationException
+    {
+        this.processor = processor ;
+        methodInfo = ActionProcessorMethodInfo.getMethodInfo(config, processor.getClass()) ;
+    }
+    
+    /**
+     * Perform the action processing on the specified message.
+     * This method is invoked for each message passing throught the pipeline.
+     * 
+     * @param message The current message being processed.
+     * @return The message to be passed to the next stage of the pipeline.
+     * @throws ActionProcessingException for errors during processing.
+     */
+    public Message process(final Message message)
+        throws ActionProcessingException
+    {
+        if (methodInfo.hasProcessMethods())
+        {
+            return methodInfo.processMethods(processor, message) ;
+        }
+        else
+        {
+            return processor.process(message) ;
+        }
+    }
+    
+    /**
+     * Process an exception generated by the pipeline processing.
+     * Invoked when the processing of a subsequent stage of the
+     * pipeline generates an exception.
+     * 
+     * @param message The original message.
+     * @param th The throwable raised by the pipeline processing
+     */
+    public void processException(final Message message, final Throwable th)
+    {
+        if (methodInfo.hasProcessException())
+        {
+            methodInfo.processException(processor, message, th) ;
+        }
+        else
+        {
+            processor.processException(message, th) ;
+        }
+    }
+    
+    /**
+     * Process a successful pipeline process. 
+     * Invoked when the pipeline processing completes successfully.
+     * 
+     * @param message The original message.
+     */
+    public void processSuccess(final Message message)
+    {
+        if (methodInfo.hasProcessSuccess())
+        {
+            methodInfo.processSuccess(processor, message) ;
+        }
+        else
+        {
+            processor.processSuccess(message) ;
+        }
+    }
+    
+    /**
+     * Initialise the action instance.
+     * <p/>
+     * This method is called after the action instance has been instantiated so that
+     * configuration options can be validated.
+     * 
+     * @throws ActionLifecycleException for errors during initialisation.
+     */
+    public void initialise()
+        throws ActionLifecycleException
+    {
+        processor.initialise() ;
+    }
+
+    /**
+     * Destroy the action instance.
+     * <p/>
+     * This method is called prior to the release of the action instance.  All
+     * resources associated with this action instance should be released as the
+     * instance will no longer be used.
+     */
+    public void destroy()
+        throws ActionLifecycleException
+    {
+        processor.destroy() ;
+    }
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,165 +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.lang.reflect.Constructor;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.Map;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Instance of ActionPipelineProcessor to allow dynamic specification of the methods
- * on the action processor.
- * @author kevin
- */
-final class OverriddenActionProcessor implements ActionPipelineProcessor
-{
-    /**
-     * The method info.
-     */
-    private final ActionProcessorMethodInfo methodInfo ;
-    /**
-     * The action constructor.
-     */
-    private final Constructor constructor ;
-    /**
-     * The action config.
-     */
-    private final ConfigTree config ;
-    
-    /**
-     * The map of messages to associated instances.
-     */
-    private Map<Message, Object> messageInstanceMap = Collections.synchronizedMap(new HashMap<Message, Object>()) ;
-
-    /**
-     * Construct the overridden action processor.
-     * @param config The action config.
-     * @param actionClass The action class.
-     * @throws ConfigurationException for errors during configuration.
-     */
-    OverriddenActionProcessor(final ConfigTree config, final Class actionClass)
-        throws ConfigurationException
-    {
-        this.config = config ;
-        constructor = ActionProcessorMethodInfo.getActionClassConstructor(actionClass) ;
-        methodInfo = ActionProcessorMethodInfo.getMethodInfo(config, actionClass) ;
-    }
-    
-    /**
-     * Perform the action processing on the specified message.
-     * This method is invoked for each message passing throught the pipeline.
-     * 
-     * @param message The current message being processed.
-     * @return The message to be passed to the next stage of the pipeline.
-     * @throws ActionProcessingException for errors during processing.
-     */
-    public Message process(final Message message)
-        throws ActionProcessingException
-    {
-        if (methodInfo.hasProcessMethods())
-        {
-            final Object instance ;
-            try
-            {
-                instance = ActionProcessorMethodInfo.getActionClassInstance(config, constructor) ;
-            }
-            catch (final ConfigurationException ce)
-            {
-                throw new ActionProcessingException("Unexpected exception creating action class instance") ;
-            }
-            
-            messageInstanceMap.put(message, instance) ;
-            return methodInfo.processMethods(instance, message) ;
-        }
-        else
-        {
-            return message ;
-        }
-    }
-    
-    /**
-     * Process an exception generated by the pipeline processing.
-     * Invoked when the processing of a subsequent stage of the
-     * pipeline generates an exception.
-     * 
-     * @param message The original message.
-     * @param th The throwable raised by the pipeline processing
-     */
-    public void processException(final Message message, final Throwable th)
-    {
-        final Object instance = messageInstanceMap.remove(message) ;
-        if (instance != null)
-        {
-            methodInfo.processException(instance, message, th) ;
-        }
-    }
-    
-    /**
-     * Process a successful pipeline process. 
-     * Invoked when the pipeline processing completes successfully.
-     * 
-     * @param message The original message.
-     */
-    public void processSuccess(final Message message)
-    {
-        final Object instance = messageInstanceMap.remove(message) ;
-        if (instance != null)
-        {
-            methodInfo.processSuccess(instance, message) ;
-        }
-    }
-    
-    /**
-     * Initialise the action instance.
-     * <p/>
-     * This method is called after the action instance has been instantiated so that
-     * configuration options can be validated.
-     * 
-     * @throws ActionLifecycleException for errors during initialisation.
-     */
-    public void initialise()
-        throws ActionLifecycleException
-    {
-        messageInstanceMap.clear() ;
-    }
-
-    /**
-     * Destroy the action instance.
-     * <p/>
-     * This method is called prior to the release of the action instance.  All
-     * resources associated with this action instance should be released as the
-     * instance will no longer be used.
-     */
-    public void destroy()
-        throws ActionLifecycleException
-    {
-        messageInstanceMap.clear() ;
-    }
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/OverriddenActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,165 @@
+/*
+ * 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.lang.reflect.Constructor;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.Map;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Instance of ActionPipelineProcessor to allow dynamic specification of the methods
+ * on the action processor.
+ * @author kevin
+ */
+final class OverriddenActionProcessor implements ActionPipelineProcessor
+{
+    /**
+     * The method info.
+     */
+    private final ActionProcessorMethodInfo methodInfo ;
+    /**
+     * The action constructor.
+     */
+    private final Constructor constructor ;
+    /**
+     * The action config.
+     */
+    private final ConfigTree config ;
+    
+    /**
+     * The map of messages to associated instances.
+     */
+    private Map<Message, Object> messageInstanceMap = Collections.synchronizedMap(new HashMap<Message, Object>()) ;
+
+    /**
+     * Construct the overridden action processor.
+     * @param config The action config.
+     * @param actionClass The action class.
+     * @throws ConfigurationException for errors during configuration.
+     */
+    OverriddenActionProcessor(final ConfigTree config, final Class actionClass)
+        throws ConfigurationException
+    {
+        this.config = config ;
+        constructor = ActionProcessorMethodInfo.getActionClassConstructor(actionClass) ;
+        methodInfo = ActionProcessorMethodInfo.getMethodInfo(config, actionClass) ;
+    }
+    
+    /**
+     * Perform the action processing on the specified message.
+     * This method is invoked for each message passing throught the pipeline.
+     * 
+     * @param message The current message being processed.
+     * @return The message to be passed to the next stage of the pipeline.
+     * @throws ActionProcessingException for errors during processing.
+     */
+    public Message process(final Message message)
+        throws ActionProcessingException
+    {
+        if (methodInfo.hasProcessMethods())
+        {
+            final Object instance ;
+            try
+            {
+                instance = ActionProcessorMethodInfo.getActionClassInstance(config, constructor) ;
+            }
+            catch (final ConfigurationException ce)
+            {
+                throw new ActionProcessingException("Unexpected exception creating action class instance") ;
+            }
+            
+            messageInstanceMap.put(message, instance) ;
+            return methodInfo.processMethods(instance, message) ;
+        }
+        else
+        {
+            return message ;
+        }
+    }
+    
+    /**
+     * Process an exception generated by the pipeline processing.
+     * Invoked when the processing of a subsequent stage of the
+     * pipeline generates an exception.
+     * 
+     * @param message The original message.
+     * @param th The throwable raised by the pipeline processing
+     */
+    public void processException(final Message message, final Throwable th)
+    {
+        final Object instance = messageInstanceMap.remove(message) ;
+        if (instance != null)
+        {
+            methodInfo.processException(instance, message, th) ;
+        }
+    }
+    
+    /**
+     * Process a successful pipeline process. 
+     * Invoked when the pipeline processing completes successfully.
+     * 
+     * @param message The original message.
+     */
+    public void processSuccess(final Message message)
+    {
+        final Object instance = messageInstanceMap.remove(message) ;
+        if (instance != null)
+        {
+            methodInfo.processSuccess(instance, message) ;
+        }
+    }
+    
+    /**
+     * Initialise the action instance.
+     * <p/>
+     * This method is called after the action instance has been instantiated so that
+     * configuration options can be validated.
+     * 
+     * @throws ActionLifecycleException for errors during initialisation.
+     */
+    public void initialise()
+        throws ActionLifecycleException
+    {
+        messageInstanceMap.clear() ;
+    }
+
+    /**
+     * Destroy the action instance.
+     * <p/>
+     * This method is called prior to the release of the action instance.  All
+     * resources associated with this action instance should be released as the
+     * instance will no longer be used.
+     */
+    public void destroy()
+        throws ActionLifecycleException
+    {
+        messageInstanceMap.clear() ;
+    }
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/UncomposedMessageDeliveryAdapter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/UncomposedMessageDeliveryAdapter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/UncomposedMessageDeliveryAdapter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,168 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.message;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-
-/**
- * Adapter class for delivering uncomposed (ESB unaware) message payloads to a target service.
- * <p/>
- * Basically wires a {@link MessageDeliveryAdapter} instance with a {@link MessageComposer}
- * instance.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @see org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter
- */
-public class UncomposedMessageDeliveryAdapter {
-
-    /**
-     * Composed message delivery adapter.  Performs the delivery after this class
-     * composes the message.
-     */
-    private MessageDeliveryAdapter messageDeliveryAdapter;
-    /**
-     * Message composer.
-     */
-    private MessageComposer composer;
-
-    /**
-     * Public constructor.
-     *
-     * @param serviceCategory The <b>category name</b> of the Service to which this instance will
-     *                        deliver messages.
-     * @param serviceName     The <b>name</b> of the Service to which this instance will
-     *                        deliver messages.
-     * @param composer        The the message composer class for this delivery instance.
-     * @throws org.jboss.soa.esb.services.registry.RegistryException
-     *          Failed to lookup EPRs for the specified Service.
-     */
-    public UncomposedMessageDeliveryAdapter(String serviceCategory, String serviceName, MessageComposer composer) throws RegistryException {
-        AssertArgument.isNotNull(serviceCategory, "serviceCategory");
-        AssertArgument.isNotNull(serviceName, "serviceName");
-        AssertArgument.isNotNull(composer, "composer");
-        messageDeliveryAdapter = new MessageDeliveryAdapter(serviceCategory, serviceName);
-        this.composer = composer;
-    }
-
-    /**
-     * Synchronously deliver the supplied message to the target service associated with this adapter instance,
-     * {@link MessageComposer#decompose(org.jboss.soa.esb.message.Message) decomposing} the reply message payload.
-     * <p/>
-     * To deliver synchronusly <u>without</u> decomposing the reply, see
-     * {@link #deliverSyncWithoutDecomposing(Object,long)}.
-     *
-     * @param messagePayload Message payload to be packaged, or a channel specific
-     *                       container class for the message payload (e.g. a JMS message).
-     * @param timeoutMillis  Number of milliseconds before synchronous reply pickup should timeout.
-     * @return The reply message payload
-     *         ({@link MessageComposer#decompose(org.jboss.soa.esb.message.Message) decomposed}).
-     * @throws MessageDeliverException Failed to deliverAsync message, after trying all available EPRs.
-     */
-    public Object deliverSync(Object messagePayload, long timeoutMillis) throws MessageDeliverException {
-        // Deliver the message...
-        Message message = deliverSyncWithoutDecomposing(messagePayload, timeoutMillis);
-
-        // Decompose the reply message...
-        return composer.decompose(message);
-    }
-
-    /**
-     * Synchronously deliver the supplied message to the target service associated with this adapter instance,
-     * without decompsing the synchronous reply message.
-     *
-     * @param messagePayload Message payload to be packaged, or a channel specific
-     *                       container class for the message payload (e.g. a JMS message).
-     * @param timeoutMillis  Number of milliseconds before synchronous reply pickup should timeout.
-     * @return The reply {@link Message}.  The caller must decompose the message.
-     * @throws MessageDeliverException Failed to deliverAsync message, after trying all available EPRs.
-     */
-    public Message deliverSyncWithoutDecomposing(Object messagePayload, long timeoutMillis) throws MessageDeliverException {
-        AssertArgument.isNotNull(messagePayload, "messagePayload");
-        Message message = composer.compose(messagePayload);
-
-        // Deliver the message...
-        return messageDeliveryAdapter.deliverSync(message, timeoutMillis);
-    }
-
-    /**
-     * Asynchronously deliverAsync the supplied message to the target service associated with this adapter instance.
-     *
-     * @param messagePayload Message payload to be packaged, or a channel specific
-     *                       container class for the message payload (e.g. a JMS message).
-     * @throws MessageDeliverException Failed to deliverAsync message, after trying all available EPRs.
-     */
-    public void deliverAsync(Object messagePayload) throws MessageDeliverException {
-        AssertArgument.isNotNull(messagePayload, "messagePayload");
-        Message message = composer.compose(messagePayload);
-
-        messageDeliveryAdapter.deliverAsync(message);
-    }
-
-    /**
-     * Get the "composed" message delivery adapter instance through which this adpter
-     * is delivering message, after composing them.
-     *
-     * @return Message Delivery Adapter.
-     */
-    public MessageDeliveryAdapter getDeliveryAdapter() {
-        return messageDeliveryAdapter;
-    }
-
-    /**
-     * Utility factory method for creation of an uncomposed message delivery adapter from a gateway configuration.
-     * @param gatewayConfig The gateway configuration.
-     * @param defaultComposer The default message composer, used when the configuration doesn't specify a composer.
-     * @return The adapter instance.
-     * @throws ConfigurationException Invalid gateway configuration.
-     */
-    public static UncomposedMessageDeliveryAdapter getGatewayDeliveryAdapter(ConfigTree gatewayConfig, MessageComposer defaultComposer) throws ConfigurationException {
-        String targetServiceCategory = gatewayConfig.getAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG);
-        String targetServiceName = gatewayConfig.getAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG);
-        String composerClass = gatewayConfig.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG);
-
-        if (targetServiceCategory == null || targetServiceCategory.trim().equals("")) {
-            throw new ConfigurationException("Invalid gateway configuration.  '" + ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG + "' not specified.");
-        }
-        if (targetServiceName == null || targetServiceName.trim().equals("")) {
-            throw new ConfigurationException("Invalid gateway configuration.  '" + ListenerTagNames.TARGET_SERVICE_NAME_TAG + "' not specified.");
-        }
-
-        try {
-            MessageComposer composer;
-
-            if (composerClass != null) {
-                composer = MessageComposer.Factory.getInstance(composerClass, gatewayConfig);
-            } else {
-                composer = defaultComposer;
-            }
-
-            return new UncomposedMessageDeliveryAdapter(targetServiceCategory, targetServiceName, composer);
-        } catch (RegistryException e) {
-            throw new ConfigurationException("Remoting Listener configuration failed.", e);
-        } catch (MessageDeliverException e) {
-            throw new ConfigurationException("Remoting Listener configuration failed.", e);
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/UncomposedMessageDeliveryAdapter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/UncomposedMessageDeliveryAdapter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/UncomposedMessageDeliveryAdapter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/UncomposedMessageDeliveryAdapter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,168 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.message;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+
+/**
+ * Adapter class for delivering uncomposed (ESB unaware) message payloads to a target service.
+ * <p/>
+ * Basically wires a {@link MessageDeliveryAdapter} instance with a {@link MessageComposer}
+ * instance.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @see org.jboss.soa.esb.listeners.message.MessageDeliveryAdapter
+ */
+public class UncomposedMessageDeliveryAdapter {
+
+    /**
+     * Composed message delivery adapter.  Performs the delivery after this class
+     * composes the message.
+     */
+    private MessageDeliveryAdapter messageDeliveryAdapter;
+    /**
+     * Message composer.
+     */
+    private MessageComposer composer;
+
+    /**
+     * Public constructor.
+     *
+     * @param serviceCategory The <b>category name</b> of the Service to which this instance will
+     *                        deliver messages.
+     * @param serviceName     The <b>name</b> of the Service to which this instance will
+     *                        deliver messages.
+     * @param composer        The the message composer class for this delivery instance.
+     * @throws org.jboss.soa.esb.services.registry.RegistryException
+     *          Failed to lookup EPRs for the specified Service.
+     */
+    public UncomposedMessageDeliveryAdapter(String serviceCategory, String serviceName, MessageComposer composer) throws RegistryException {
+        AssertArgument.isNotNull(serviceCategory, "serviceCategory");
+        AssertArgument.isNotNull(serviceName, "serviceName");
+        AssertArgument.isNotNull(composer, "composer");
+        messageDeliveryAdapter = new MessageDeliveryAdapter(serviceCategory, serviceName);
+        this.composer = composer;
+    }
+
+    /**
+     * Synchronously deliver the supplied message to the target service associated with this adapter instance,
+     * {@link MessageComposer#decompose(org.jboss.soa.esb.message.Message) decomposing} the reply message payload.
+     * <p/>
+     * To deliver synchronusly <u>without</u> decomposing the reply, see
+     * {@link #deliverSyncWithoutDecomposing(Object,long)}.
+     *
+     * @param messagePayload Message payload to be packaged, or a channel specific
+     *                       container class for the message payload (e.g. a JMS message).
+     * @param timeoutMillis  Number of milliseconds before synchronous reply pickup should timeout.
+     * @return The reply message payload
+     *         ({@link MessageComposer#decompose(org.jboss.soa.esb.message.Message) decomposed}).
+     * @throws MessageDeliverException Failed to deliverAsync message, after trying all available EPRs.
+     */
+    public Object deliverSync(Object messagePayload, long timeoutMillis) throws MessageDeliverException {
+        // Deliver the message...
+        Message message = deliverSyncWithoutDecomposing(messagePayload, timeoutMillis);
+
+        // Decompose the reply message...
+        return composer.decompose(message);
+    }
+
+    /**
+     * Synchronously deliver the supplied message to the target service associated with this adapter instance,
+     * without decompsing the synchronous reply message.
+     *
+     * @param messagePayload Message payload to be packaged, or a channel specific
+     *                       container class for the message payload (e.g. a JMS message).
+     * @param timeoutMillis  Number of milliseconds before synchronous reply pickup should timeout.
+     * @return The reply {@link Message}.  The caller must decompose the message.
+     * @throws MessageDeliverException Failed to deliverAsync message, after trying all available EPRs.
+     */
+    public Message deliverSyncWithoutDecomposing(Object messagePayload, long timeoutMillis) throws MessageDeliverException {
+        AssertArgument.isNotNull(messagePayload, "messagePayload");
+        Message message = composer.compose(messagePayload);
+
+        // Deliver the message...
+        return messageDeliveryAdapter.deliverSync(message, timeoutMillis);
+    }
+
+    /**
+     * Asynchronously deliverAsync the supplied message to the target service associated with this adapter instance.
+     *
+     * @param messagePayload Message payload to be packaged, or a channel specific
+     *                       container class for the message payload (e.g. a JMS message).
+     * @throws MessageDeliverException Failed to deliverAsync message, after trying all available EPRs.
+     */
+    public void deliverAsync(Object messagePayload) throws MessageDeliverException {
+        AssertArgument.isNotNull(messagePayload, "messagePayload");
+        Message message = composer.compose(messagePayload);
+
+        messageDeliveryAdapter.deliverAsync(message);
+    }
+
+    /**
+     * Get the "composed" message delivery adapter instance through which this adpter
+     * is delivering message, after composing them.
+     *
+     * @return Message Delivery Adapter.
+     */
+    public MessageDeliveryAdapter getDeliveryAdapter() {
+        return messageDeliveryAdapter;
+    }
+
+    /**
+     * Utility factory method for creation of an uncomposed message delivery adapter from a gateway configuration.
+     * @param gatewayConfig The gateway configuration.
+     * @param defaultComposer The default message composer, used when the configuration doesn't specify a composer.
+     * @return The adapter instance.
+     * @throws ConfigurationException Invalid gateway configuration.
+     */
+    public static UncomposedMessageDeliveryAdapter getGatewayDeliveryAdapter(ConfigTree gatewayConfig, MessageComposer defaultComposer) throws ConfigurationException {
+        String targetServiceCategory = gatewayConfig.getAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG);
+        String targetServiceName = gatewayConfig.getAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG);
+        String composerClass = gatewayConfig.getAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG);
+
+        if (targetServiceCategory == null || targetServiceCategory.trim().equals("")) {
+            throw new ConfigurationException("Invalid gateway configuration.  '" + ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG + "' not specified.");
+        }
+        if (targetServiceName == null || targetServiceName.trim().equals("")) {
+            throw new ConfigurationException("Invalid gateway configuration.  '" + ListenerTagNames.TARGET_SERVICE_NAME_TAG + "' not specified.");
+        }
+
+        try {
+            MessageComposer composer;
+
+            if (composerClass != null) {
+                composer = MessageComposer.Factory.getInstance(composerClass, gatewayConfig);
+            } else {
+                composer = defaultComposer;
+            }
+
+            return new UncomposedMessageDeliveryAdapter(targetServiceCategory, targetServiceName, composer);
+        } catch (RegistryException e) {
+            throw new ConfigurationException("Remoting Listener configuration failed.", e);
+        } catch (MessageDeliverException e) {
+            throw new ConfigurationException("Remoting Listener configuration failed.", e);
+        }
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors/Factory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors/Factory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors/Factory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,103 +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, JBoss Inc.
- */
-
-package org.jboss.soa.esb.listeners.message.errors;
-
-import java.net.URI;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-public class Factory
-{
-	public static final String ERROR_ATTRIBUTE = "org.jboss.soa.esb.listeners.message.errors";
-	
-	public static final String PROCESSING_ERROR = "urn:action/error/actionprocessingerror";
-	public static final String UNEXPECTED_ERROR = "urn:action/error/unexpectederror";
-	public static final String NOT_ENABLED = "urn:action/error/disabled";
-	
-	public static Message createErrorMessage (String type, Message input, Throwable problem)
-	{
-		if (input == null)
-			throw new IllegalArgumentException();
-		
-		Message errorMessage = MessageFactory.getInstance().getMessage(input.getType());
-		
-		if (errorMessage == null)
-			throw new IllegalArgumentException("Could not create error message from "+input.getType());
-		
-		if (modifyMessage(input, errorMessage))
-		{			
-			try
-			{
-				errorMessage.getFault().setCode(new URI(type));
-				
-				/*
-				 * Is there an exception? If so, add the string as the reason.
-				 */
-				
-				if (problem != null)
-					errorMessage.getFault().setReason(problem.toString());
-			}
-			catch (final Exception ex)
-			{
-				_logger.debug("Caught exception "+ex+" during message creation!");
-				
-				return null;
-			}
-				
-			return errorMessage;
-		}
-		else
-			return null;
-	}
-	
-	/**
-	 * Where should the error message go? Check the header of the original
-	 * input message.
-	 */
-	
-	private final static boolean modifyMessage (Message input, Message errorMessage)
-	{
-		EPR destination = input.getHeader().getCall().getFaultTo();
-		
-		if ((destination == null) && (input.getHeader().getCall().getReplyTo() != null))
-			destination = input.getHeader().getCall().getReplyTo();
-		
-		if ((destination == null) && (input.getHeader().getCall().getFrom() != null))
-			destination = input.getHeader().getCall().getFrom();
-		
-		if (destination != null)
-		{
-			errorMessage.getHeader().getCall().setTo(destination);
-			
-			if (input.getHeader().getCall().getMessageID() != null)
-				errorMessage.getHeader().getCall().setRelatesTo(input.getHeader().getCall().getMessageID());
-			
-			return true;
-		}
-		else
-			return false;
-	}
-	
-	private final static Logger _logger = Logger.getLogger(Factory.class);
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors/Factory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors/Factory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors/Factory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/listeners/message/errors/Factory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,103 @@
+/*
+ * 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, JBoss Inc.
+ */
+
+package org.jboss.soa.esb.listeners.message.errors;
+
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+public class Factory
+{
+	public static final String ERROR_ATTRIBUTE = "org.jboss.soa.esb.listeners.message.errors";
+	
+	public static final String PROCESSING_ERROR = "urn:action/error/actionprocessingerror";
+	public static final String UNEXPECTED_ERROR = "urn:action/error/unexpectederror";
+	public static final String NOT_ENABLED = "urn:action/error/disabled";
+	
+	public static Message createErrorMessage (String type, Message input, Throwable problem)
+	{
+		if (input == null)
+			throw new IllegalArgumentException();
+		
+		Message errorMessage = MessageFactory.getInstance().getMessage(input.getType());
+		
+		if (errorMessage == null)
+			throw new IllegalArgumentException("Could not create error message from "+input.getType());
+		
+		if (modifyMessage(input, errorMessage))
+		{			
+			try
+			{
+				errorMessage.getFault().setCode(new URI(type));
+				
+				/*
+				 * Is there an exception? If so, add the string as the reason.
+				 */
+				
+				if (problem != null)
+					errorMessage.getFault().setReason(problem.toString());
+			}
+			catch (final Exception ex)
+			{
+				_logger.debug("Caught exception "+ex+" during message creation!");
+				
+				return null;
+			}
+				
+			return errorMessage;
+		}
+		else
+			return null;
+	}
+	
+	/**
+	 * Where should the error message go? Check the header of the original
+	 * input message.
+	 */
+	
+	private final static boolean modifyMessage (Message input, Message errorMessage)
+	{
+		EPR destination = input.getHeader().getCall().getFaultTo();
+		
+		if ((destination == null) && (input.getHeader().getCall().getReplyTo() != null))
+			destination = input.getHeader().getCall().getReplyTo();
+		
+		if ((destination == null) && (input.getHeader().getCall().getFrom() != null))
+			destination = input.getHeader().getCall().getFrom();
+		
+		if (destination != null)
+		{
+			errorMessage.getHeader().getCall().setTo(destination);
+			
+			if (input.getHeader().getCall().getMessageID() != null)
+				errorMessage.getHeader().getCall().setRelatesTo(input.getHeader().getCall().getMessageID());
+			
+			return true;
+		}
+		else
+			return false;
+	}
+	
+	private final static Logger _logger = Logger.getLogger(Factory.class);
+}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Attachment.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Attachment.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Attachment.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,113 +0,0 @@
-package org.jboss.soa.esb.message;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Messages may contain attachments that do not appear in the main payload body.
- * For example, binary document formats, zip files etc.
- * <br/>Handles both 'named' attachment and a list of 'unnamed' attachments
- * 
- * Eventually attachments will be allowed to have difference encoding properties
- * as they can in the SOAP/Attachments standard.
- * 
- * @author Mark Little
- */
-
-public interface Attachment
-{
-	/**
-	 * Returns the attachment to which this object maps the specified key. 
-	 * Returns null if the there's no value mapped for this key.
-	 * @param name String - The name of the attachment to get
-	 * @return Object - the value mapped to arg0 or &lt;null&gt; if none
-	 */
-	Object get(String name);
-	/**
-	 * Associates the specified value with the specified name
-	 * If there was already a mapping for this name, the old value is replaced by 
-	 * arg1
-	 * @param name String - the name for the object to be stored
-	 * @param value Object - the object to be associated with the name (arg0)
-	 * @return Object - previous value associated with specified name,
-	 * or null  if there was none
-	 */
-	Object put(String name, Object value);
-	/**
-	 * Removes the mapping for this name if it was present
-	 * @param name String - the name of the object to be removed
-	 * @return the value previously associated the name, or null if there was none
-	 */
-	Object remove(String name);
-	/**
-	 * @return String[] - the list of names of the named Objects
-	 */
-	String[] getNames();
-
-	/**
-     * get the item at the specified position in the list of unnamed objects
-     * @param index int - index of element to return
-     * @return Object the element at the specified position in the list of unnamed objects
-     * @throws IndexOutOfBoundsException - if the index is out of range
-     */
-	Object itemAt 		(int index) throws IndexOutOfBoundsException;
-	/**
-	 * Removes the element at the specified position in the list of unnamed objects
-	 * Shifts any subsequent elements to the left 
-	 * @param index int - index of element to remove
-	 * @return Object - the element that was removed from the list
-	 * @throws IndexOutOfBoundsException - if the index is out of range
-	 */
-	Object removeItemAt	(int index) throws IndexOutOfBoundsException;
-	/**
-	 * Replaces the element at the specified position in the list of unnamed objects 
-	 * with the value supplied
-	 * @param index int - index of element to be replaced
-	 * @param  value Object - the object to replace the one previously stored at that index
-	 * @return Object - previous value at that index
-	 * @throws IndexOutOfBoundsException - if the index is out of range
-	 */
-	Object replaceItemAt(int index, Object value) throws IndexOutOfBoundsException;
-	/**
-	 * Appends the specified element to the end of the list of unnamed objects
-	 * <br/>null values are allowed 
-	 * @param value Object - the object to be appended
-	 */
-	void addItem		(Object value);
-	/**
-	 * Replaces the element at the specified position in the list of unnamed objects
-	 * <br/> allows null values
-	 * @param index int - index where to insert the value - Shifts any subsequent elements to the right
-	 * @param value Object - value to be stored at the specified position
-	 * @throws IndexOutOfBoundsException
-	 */
-	void addItemAt	(int index, Object value) throws IndexOutOfBoundsException;
-	/**
-	 * getUnnamedCount()
-	 * @return the count of unnamed objects
-	 */
-	int	getUnnamedCount();
-	/**
-	 * getNamedCount()
-	 * @return the count of named objects
-	 */
-	public int getNamedCount(); 
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Attachment.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Attachment.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Attachment.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Attachment.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,113 @@
+package org.jboss.soa.esb.message;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Messages may contain attachments that do not appear in the main payload body.
+ * For example, binary document formats, zip files etc.
+ * <br/>Handles both 'named' attachment and a list of 'unnamed' attachments
+ * 
+ * Eventually attachments will be allowed to have difference encoding properties
+ * as they can in the SOAP/Attachments standard.
+ * 
+ * @author Mark Little
+ */
+
+public interface Attachment
+{
+	/**
+	 * Returns the attachment to which this object maps the specified key. 
+	 * Returns null if the there's no value mapped for this key.
+	 * @param name String - The name of the attachment to get
+	 * @return Object - the value mapped to arg0 or &lt;null&gt; if none
+	 */
+	Object get(String name);
+	/**
+	 * Associates the specified value with the specified name
+	 * If there was already a mapping for this name, the old value is replaced by 
+	 * arg1
+	 * @param name String - the name for the object to be stored
+	 * @param value Object - the object to be associated with the name (arg0)
+	 * @return Object - previous value associated with specified name,
+	 * or null  if there was none
+	 */
+	Object put(String name, Object value);
+	/**
+	 * Removes the mapping for this name if it was present
+	 * @param name String - the name of the object to be removed
+	 * @return the value previously associated the name, or null if there was none
+	 */
+	Object remove(String name);
+	/**
+	 * @return String[] - the list of names of the named Objects
+	 */
+	String[] getNames();
+
+	/**
+     * get the item at the specified position in the list of unnamed objects
+     * @param index int - index of element to return
+     * @return Object the element at the specified position in the list of unnamed objects
+     * @throws IndexOutOfBoundsException - if the index is out of range
+     */
+	Object itemAt 		(int index) throws IndexOutOfBoundsException;
+	/**
+	 * Removes the element at the specified position in the list of unnamed objects
+	 * Shifts any subsequent elements to the left 
+	 * @param index int - index of element to remove
+	 * @return Object - the element that was removed from the list
+	 * @throws IndexOutOfBoundsException - if the index is out of range
+	 */
+	Object removeItemAt	(int index) throws IndexOutOfBoundsException;
+	/**
+	 * Replaces the element at the specified position in the list of unnamed objects 
+	 * with the value supplied
+	 * @param index int - index of element to be replaced
+	 * @param  value Object - the object to replace the one previously stored at that index
+	 * @return Object - previous value at that index
+	 * @throws IndexOutOfBoundsException - if the index is out of range
+	 */
+	Object replaceItemAt(int index, Object value) throws IndexOutOfBoundsException;
+	/**
+	 * Appends the specified element to the end of the list of unnamed objects
+	 * <br/>null values are allowed 
+	 * @param value Object - the object to be appended
+	 */
+	void addItem		(Object value);
+	/**
+	 * Replaces the element at the specified position in the list of unnamed objects
+	 * <br/> allows null values
+	 * @param index int - index where to insert the value - Shifts any subsequent elements to the right
+	 * @param value Object - value to be stored at the specified position
+	 * @throws IndexOutOfBoundsException
+	 */
+	void addItemAt	(int index, Object value) throws IndexOutOfBoundsException;
+	/**
+	 * getUnnamedCount()
+	 * @return the count of unnamed objects
+	 */
+	int	getUnnamedCount();
+	/**
+	 * getNamedCount()
+	 * @return the count of named objects
+	 */
+	public int getNamedCount(); 
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,187 +0,0 @@
-package org.jboss.soa.esb.message;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * The message body holds arbitrary information which represents the payload as
- * far as clients and services are concerned. A body may contain:
- * 
- * (i) a byte array for arbitrary data. How that array is interpreted by the
- * service is implementation specific and outside the scope of the ESB to
- * enforce.
- * 
- * (ii) a list of Objects of arbitrary types. How these objects are serialized
- * to/from the message body when it is transmitted is up to the specific Object
- * type. The plan is to add support for various TYPES of Object and the message
- * implementation will use external adapters to externalize/internalize the
- * Objects. Currently we only support Serializable objects.
- * 
- * Given that there are attachments, properties, byte arrays and named objects,
- * you may be wondering where should you put your payload? The answer is fairly
- * straightforward: 
- * 
- * As a service developer, you define the contract that clients
- * use in order to interact with your service. As part of that contract, you
- * will specific both functional and non-functional aspects of the service,
- * e.g., that it is an airline reservation service (functional) and that it is
- * transactional (non-functional). You'll also define the operations (messages)
- * that the service can understand. As part of the message definition, you
- * stipulate the format (e.g., Java Serialized message versus XML) and the
- * content (e.g., transaction context, seat number, customer name etc.) When
- * defining the content, you can specify where in the Message your service will
- * expect to find the payload. That can be in the form of attachments, specific
- * named objects (even the default named object if you so wish), or the byte
- * array. It is entirely up to the service developer to determine. The only
- * restrictions are that objects and attachments must be globally uniquely
- * named, or one service (or Action) may inadvertently pick up a partial payload
- * meant for another if the same Message Body is forwarded across multiple hops.
- * 
- * As a service users, you obtain the contract definition about the service
- * (e.g., through UDDI or out-of-band communication) and this will define where
- * in the message the payload must go. Information placed in other locations
- * will likely be ignored and result in incorrect operation of the service.
- */
-
-public interface Body
-{
-	public static final String DEFAULT_LOCATION = "defaultEntry";
-
-	/**
-	 * Add the specified Object at the default location within the message. If
-	 * the default location is already used then the contents will be
-	 * overwritten.
-	 * 
-	 * @param value
-	 */
-
-	public void add(Object value);
-
-	/**
-	 * Add the specified Object to the body.
-	 * 
-	 * @param name
-	 *            The name of the object. MUST be unique within this body. If null
-	 *            then an exception will be thrown. This is to make sure that some
-	 *            computational errors don't arbitrarily resolve to data within the message body that could
-	 *            then be misinterpreted. If someone wants to go with the default name
-	 *            then they can either use add(value) or explicitly use the default name.
-	 * @param value
-	 *            The Object to add.
-	 */
-
-	public void add(String name, Object value);
-
-	/**
-	 * Get the Object at the default location in the message, or
-	 * <code>null</code> otherwise.
-	 * 
-	 * @return the object.
-	 */
-
-	public Object get();
-
-	/**
-	 * Get the specified Object, or <code>null</code> if not present.
-	 * 
-	 * @param name
-	 *            the name of the Object to retrieve.  If null
-	 *            then an exception will be thrown. This is to make sure that some
-	 *            computational errors don't arbitrarily resolve to data within the message body that could
-	 *            then be misinterpreted. If someone wants to go with the default name
-	 *            then they can either use add(value) or explicitly use the default name.
-	 * @return the Object.
-	 */
-
-	public Object get(String name);
-
-	/**
-	 * Remove the specified Object and return it, or <code>null</code> if not
-	 * present.
-	 * 
-	 * @param name
-	 *            the name of the Object to remove.
-	 * @return the Object removed.
-	 */
-
-	public Object remove(String name);
-
-	/**
-	 * Set the byte content of the body. This does not affect any of the named
-	 * objects or attachments.
-	 * 
-	 * @param content
-	 *            the message bytes
-	 * @deprecated As of 4.2 this has been replaced by setByteArray
-	 */
-
-	public void setContents(byte[] content);
-
-	/**
-	 * @return the byte content of the body.
-	 * @deprecated As of 4.2 this has been replaced by getByteArray
-	 */
-
-	public byte[] getContents();
-
-	/**
-	 * Set the byte content of the body. This does not affect any of the named
-	 * objects or attachments.
-	 * 
-	 * @param content
-	 *            the message bytes
-	 */
-
-	public void setByteArray(byte[] content);
-
-	/**
-	 * @return the byte content of the body.
-	 */
-
-	public byte[] getByteArray();
-
-	/**
-	 * Replace this body instance with the one given.
-	 * 
-	 * @param b
-	 *            the body to be replaced with.
-	 */
-
-	public void replace(Body b);
-
-	/**
-	 * Merge two bodies.
-	 * 
-	 * @param b
-	 *            the body to be merged with.
-	 */
-
-	public void merge(Body b);
-
-	/**
-	 * @return get the list of names in this instance.
-	 */
-
-	public String[] getNames();
-
-	// TODO replace an entry in the body
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Body.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,187 @@
+package org.jboss.soa.esb.message;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * The message body holds arbitrary information which represents the payload as
+ * far as clients and services are concerned. A body may contain:
+ * 
+ * (i) a byte array for arbitrary data. How that array is interpreted by the
+ * service is implementation specific and outside the scope of the ESB to
+ * enforce.
+ * 
+ * (ii) a list of Objects of arbitrary types. How these objects are serialized
+ * to/from the message body when it is transmitted is up to the specific Object
+ * type. The plan is to add support for various TYPES of Object and the message
+ * implementation will use external adapters to externalize/internalize the
+ * Objects. Currently we only support Serializable objects.
+ * 
+ * Given that there are attachments, properties, byte arrays and named objects,
+ * you may be wondering where should you put your payload? The answer is fairly
+ * straightforward: 
+ * 
+ * As a service developer, you define the contract that clients
+ * use in order to interact with your service. As part of that contract, you
+ * will specific both functional and non-functional aspects of the service,
+ * e.g., that it is an airline reservation service (functional) and that it is
+ * transactional (non-functional). You'll also define the operations (messages)
+ * that the service can understand. As part of the message definition, you
+ * stipulate the format (e.g., Java Serialized message versus XML) and the
+ * content (e.g., transaction context, seat number, customer name etc.) When
+ * defining the content, you can specify where in the Message your service will
+ * expect to find the payload. That can be in the form of attachments, specific
+ * named objects (even the default named object if you so wish), or the byte
+ * array. It is entirely up to the service developer to determine. The only
+ * restrictions are that objects and attachments must be globally uniquely
+ * named, or one service (or Action) may inadvertently pick up a partial payload
+ * meant for another if the same Message Body is forwarded across multiple hops.
+ * 
+ * As a service users, you obtain the contract definition about the service
+ * (e.g., through UDDI or out-of-band communication) and this will define where
+ * in the message the payload must go. Information placed in other locations
+ * will likely be ignored and result in incorrect operation of the service.
+ */
+
+public interface Body
+{
+	public static final String DEFAULT_LOCATION = "defaultEntry";
+
+	/**
+	 * Add the specified Object at the default location within the message. If
+	 * the default location is already used then the contents will be
+	 * overwritten.
+	 * 
+	 * @param value
+	 */
+
+	public void add(Object value);
+
+	/**
+	 * Add the specified Object to the body.
+	 * 
+	 * @param name
+	 *            The name of the object. MUST be unique within this body. If null
+	 *            then an exception will be thrown. This is to make sure that some
+	 *            computational errors don't arbitrarily resolve to data within the message body that could
+	 *            then be misinterpreted. If someone wants to go with the default name
+	 *            then they can either use add(value) or explicitly use the default name.
+	 * @param value
+	 *            The Object to add.
+	 */
+
+	public void add(String name, Object value);
+
+	/**
+	 * Get the Object at the default location in the message, or
+	 * <code>null</code> otherwise.
+	 * 
+	 * @return the object.
+	 */
+
+	public Object get();
+
+	/**
+	 * Get the specified Object, or <code>null</code> if not present.
+	 * 
+	 * @param name
+	 *            the name of the Object to retrieve.  If null
+	 *            then an exception will be thrown. This is to make sure that some
+	 *            computational errors don't arbitrarily resolve to data within the message body that could
+	 *            then be misinterpreted. If someone wants to go with the default name
+	 *            then they can either use add(value) or explicitly use the default name.
+	 * @return the Object.
+	 */
+
+	public Object get(String name);
+
+	/**
+	 * Remove the specified Object and return it, or <code>null</code> if not
+	 * present.
+	 * 
+	 * @param name
+	 *            the name of the Object to remove.
+	 * @return the Object removed.
+	 */
+
+	public Object remove(String name);
+
+	/**
+	 * Set the byte content of the body. This does not affect any of the named
+	 * objects or attachments.
+	 * 
+	 * @param content
+	 *            the message bytes
+	 * @deprecated As of 4.2 this has been replaced by setByteArray
+	 */
+
+	public void setContents(byte[] content);
+
+	/**
+	 * @return the byte content of the body.
+	 * @deprecated As of 4.2 this has been replaced by getByteArray
+	 */
+
+	public byte[] getContents();
+
+	/**
+	 * Set the byte content of the body. This does not affect any of the named
+	 * objects or attachments.
+	 * 
+	 * @param content
+	 *            the message bytes
+	 */
+
+	public void setByteArray(byte[] content);
+
+	/**
+	 * @return the byte content of the body.
+	 */
+
+	public byte[] getByteArray();
+
+	/**
+	 * Replace this body instance with the one given.
+	 * 
+	 * @param b
+	 *            the body to be replaced with.
+	 */
+
+	public void replace(Body b);
+
+	/**
+	 * Merge two bodies.
+	 * 
+	 * @param b
+	 *            the body to be merged with.
+	 */
+
+	public void merge(Body b);
+
+	/**
+	 * @return get the list of names in this instance.
+	 */
+
+	public String[] getNames();
+
+	// TODO replace an entry in the body
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Context.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Context.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Context.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,33 +0,0 @@
-package org.jboss.soa.esb.message;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * The context is the section of the message containing information such as session
- * management, transaction information, security data etc. Entries in the context
- * may be ordered.
- */
-
-public interface Context
-{
-	// TODO add some methods!
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Context.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Context.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Context.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Context.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,33 @@
+package org.jboss.soa.esb.message;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * The context is the section of the message containing information such as session
+ * management, transaction information, security data etc. Entries in the context
+ * may be ordered.
+ */
+
+public interface Context
+{
+	// TODO add some methods!
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Fault.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Fault.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Fault.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,61 +0,0 @@
-package org.jboss.soa.esb.message;
-
-import java.net.URI;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Faults may be returned from a service in response to receiving and acting upon messages.
- * A fault consists of a unique code (MANDATORY) and a reason string (OPTIONAL).
- */
-
-public interface Fault
-{
-	/**
-	 * @return the unique code representing this fault.
-	 */
-	
-	public URI getCode ();
-	
-	/**
-	 * Set the unique code for this fault.
-	 * 
-	 * @param code the code.
-	 */
-	
-	public void setCode (URI code);
-	
-	/**
-	 * @return a String representing the reason for the fault. Typically used for
-	 * logging purposes.
-	 */
-	
-	public String getReason ();
-	
-	/**
-	 * Set the optional reason for this fault.
-	 * 
-	 * @param reason the reason for the fault.
-	 */
-	
-	public void setReason (String reason);
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Fault.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Fault.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Fault.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Fault.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,61 @@
+package org.jboss.soa.esb.message;
+
+import java.net.URI;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Faults may be returned from a service in response to receiving and acting upon messages.
+ * A fault consists of a unique code (MANDATORY) and a reason string (OPTIONAL).
+ */
+
+public interface Fault
+{
+	/**
+	 * @return the unique code representing this fault.
+	 */
+	
+	public URI getCode ();
+	
+	/**
+	 * Set the unique code for this fault.
+	 * 
+	 * @param code the code.
+	 */
+	
+	public void setCode (URI code);
+	
+	/**
+	 * @return a String representing the reason for the fault. Typically used for
+	 * logging purposes.
+	 */
+	
+	public String getReason ();
+	
+	/**
+	 * Set the optional reason for this fault.
+	 * 
+	 * @param reason the reason for the fault.
+	 */
+	
+	public void setReason (String reason);
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Header.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Header.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Header.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,45 +0,0 @@
-package org.jboss.soa.esb.message;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-import org.jboss.soa.esb.addressing.Call;
-
-/**
- * The message header. Contains such things as routing information.
- */
-
-public interface Header
-{
-	/**
-	 * @return get the Call information for this message.
-	 */
-	
-	public Call getCall ();
-	
-	/**
-	 * Set the call information for this message.
-	 * 
-	 * @param call the information.
-	 */
-	
-	public void setCall (Call call);
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Header.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Header.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Header.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Header.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,45 @@
+package org.jboss.soa.esb.message;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+import org.jboss.soa.esb.addressing.Call;
+
+/**
+ * The message header. Contains such things as routing information.
+ */
+
+public interface Header
+{
+	/**
+	 * @return get the Call information for this message.
+	 */
+	
+	public Call getCall ();
+	
+	/**
+	 * Set the call information for this message.
+	 * 
+	 * @param call the information.
+	 */
+	
+	public void setCall (Call call);
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Message.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Message.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Message.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,93 +0,0 @@
-package org.jboss.soa.esb.message;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-import java.io.Serializable;
-import java.net.URI;
-
-/**
- * This is the basic internal core message abstraction. A message consists of the following
- * components:
- * 
- * Header: the header information contains information such as the destination EPR, the
- * sender EPR, where the reply goes etc, i.e., general message-level functional information.
- * Context: additional information to contextualise the message; for example, transaction or
- * security data, the identity of the ultimate receiver, or HTTP-cookie like information.
- * Body: the actual payload of the message.
- * Fault: any fault information associated with the message.
- * Attachment: any attachments associated with the message.
- * Properties: any message specific properties.
- * 
- * Each message, once created, has a corresponding element for these 5 components. That element
- * may be empty (<b>NOT NULL</b>). The object representing the element can then be used to act
- * on the corresponding data item in the message.
- * 
- * @author Mark Little
- *
- */
-
-public interface Message extends Serializable
-{
-	/**
-	 * @return get the header component of the message.
-	 */
-	
-	public Header getHeader ();
-
-	/**
-	 * @return get the context component of the message.
-	 */
-	
-	public Context getContext ();
-	
-	/**
-	 * @return get the body component of the message.
-	 */
-	
-	public Body getBody ();
-
-	/**
-	 * @return get any faults associated with the message. These should not
-	 * be application level faults, but comms level.
-	 */
-	
-	public Fault getFault ();
-	
-	/**
-	 * @return get any message attachments.
-	 */
-	
-	public Attachment getAttachment ();
-	
-	/**
-	 * @return the type of this message.
-	 */
-	
-	public URI getType ();
-	
-	/**
-	 * @return Properties - any message properties.
-	 */
-	
-	public Properties getProperties ();
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Message.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Message.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Message.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Message.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,93 @@
+package org.jboss.soa.esb.message;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+import java.io.Serializable;
+import java.net.URI;
+
+/**
+ * This is the basic internal core message abstraction. A message consists of the following
+ * components:
+ * 
+ * Header: the header information contains information such as the destination EPR, the
+ * sender EPR, where the reply goes etc, i.e., general message-level functional information.
+ * Context: additional information to contextualise the message; for example, transaction or
+ * security data, the identity of the ultimate receiver, or HTTP-cookie like information.
+ * Body: the actual payload of the message.
+ * Fault: any fault information associated with the message.
+ * Attachment: any attachments associated with the message.
+ * Properties: any message specific properties.
+ * 
+ * Each message, once created, has a corresponding element for these 5 components. That element
+ * may be empty (<b>NOT NULL</b>). The object representing the element can then be used to act
+ * on the corresponding data item in the message.
+ * 
+ * @author Mark Little
+ *
+ */
+
+public interface Message extends Serializable
+{
+	/**
+	 * @return get the header component of the message.
+	 */
+	
+	public Header getHeader ();
+
+	/**
+	 * @return get the context component of the message.
+	 */
+	
+	public Context getContext ();
+	
+	/**
+	 * @return get the body component of the message.
+	 */
+	
+	public Body getBody ();
+
+	/**
+	 * @return get any faults associated with the message. These should not
+	 * be application level faults, but comms level.
+	 */
+	
+	public Fault getFault ();
+	
+	/**
+	 * @return get any message attachments.
+	 */
+	
+	public Attachment getAttachment ();
+	
+	/**
+	 * @return the type of this message.
+	 */
+	
+	public URI getType ();
+	
+	/**
+	 * @return Properties - any message properties.
+	 */
+	
+	public Properties getProperties ();
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Properties.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Properties.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Properties.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,88 +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 schifest at heuristica.com.ar
- */
-
-package org.jboss.soa.esb.message;
-
-/**
- * The message properties hold arbitrary information in the form of
- * &lt;String,Object&gt; pairs
- * 
- */
-
-public interface Properties
-{
-	/**
-	 * getProperty(name)
-	 * 
-	 * @param name
-	 *            String - name of property
-	 * @return Object - the value stored under the specified name
-	 */
-	public Object getProperty(String name);
-
-	/**
-	 * getProperty(name,defaultVal)
-	 * 
-	 * @param name
-	 *            String - name of property
-	 * @param defaultVal
-	 *            Object - value to return if no value found
-	 * @return Object - the value stored under the specified name
-	 */
-	public Object getProperty(String name, Object defaultVal);
-
-	/**
-	 * setProperty(name,value)
-	 * 
-	 * @param name
-	 *            String - name of property to store
-	 * @param value
-	 *            Object - value of property to store under specified name
-	 * @return Object - the previous value of the specified name, or null if it
-	 *         did not have one
-	 */
-	public Object setProperty(String name, Object value);
-
-	/**
-	 * remove(name)
-	 * 
-	 * @param name
-	 *            String - name of property to remove
-	 * @return Object - the previous value of the specified name, or null if it
-	 *         did not have one
-	 */
-	public Object remove(String name);
-
-	/**
-	 * size()
-	 * 
-	 * @return int - Returns the number of properties in this object
-	 */
-	public int size();
-
-	/**
-	 * getNames()
-	 * 
-	 * @return String[] - containing the names of all properties
-	 */
-	public String[] getNames();
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Properties.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/Properties.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Properties.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/Properties.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,88 @@
+/*
+ * 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 schifest at heuristica.com.ar
+ */
+
+package org.jboss.soa.esb.message;
+
+/**
+ * The message properties hold arbitrary information in the form of
+ * &lt;String,Object&gt; pairs
+ * 
+ */
+
+public interface Properties
+{
+	/**
+	 * getProperty(name)
+	 * 
+	 * @param name
+	 *            String - name of property
+	 * @return Object - the value stored under the specified name
+	 */
+	public Object getProperty(String name);
+
+	/**
+	 * getProperty(name,defaultVal)
+	 * 
+	 * @param name
+	 *            String - name of property
+	 * @param defaultVal
+	 *            Object - value to return if no value found
+	 * @return Object - the value stored under the specified name
+	 */
+	public Object getProperty(String name, Object defaultVal);
+
+	/**
+	 * setProperty(name,value)
+	 * 
+	 * @param name
+	 *            String - name of property to store
+	 * @param value
+	 *            Object - value of property to store under specified name
+	 * @return Object - the previous value of the specified name, or null if it
+	 *         did not have one
+	 */
+	public Object setProperty(String name, Object value);
+
+	/**
+	 * remove(name)
+	 * 
+	 * @param name
+	 *            String - name of property to remove
+	 * @return Object - the previous value of the specified name, or null if it
+	 *         did not have one
+	 */
+	public Object remove(String name);
+
+	/**
+	 * size()
+	 * 
+	 * @return int - Returns the number of properties in this object
+	 */
+	public int size();
+
+	/**
+	 * getNames()
+	 * 
+	 * @return String[] - containing the names of all properties
+	 */
+	public String[] getNames();
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/format)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,76 +0,0 @@
-package org.jboss.soa.esb.message.format;
-
-import java.net.URI;
-
-import org.jboss.internal.soa.esb.message.format.MessageFactoryImpl;
-import org.jboss.soa.esb.message.Message;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * You get a message of a specific type when you need it. Obviously that type may not be
- * suitable for the service (hopefully you've got that contractual information a priori, but
- * maybe not) and in which case some translation/transformation may be necessary.
- * 
- * @author Mark Little
- *
- */
-
-public abstract class MessageFactory
-{
-	/**
-	 * @return some default implementation.
-	 */
-	
-	public abstract Message getMessage ();
-	
-	/**
-	 * @param type the unique identifier representing the type of this message.
-	 * @return the message, or <code>null</code> if no suitable plugin is available.
-	 */
-	
-	public abstract Message getMessage (URI type);
-	
-	/**
-	 * @param msg the message to convert.
-	 * @param type the type of the message we want to convert to.
-	 * @return a translated message, or <code>null</code> if no suitable plugin is available.
-	 */
-	
-	public abstract Message getMessage (Message msg, URI type);
-	
-	/**
-	 * Reload the plugins.
-	 */
-	
-	public abstract void reset ();
-	
-	// TODO setters/getters for the plugin programmatically too.
-	
-	public static MessageFactory getInstance ()
-	{
-		return theFactory;
-	}
-	
-	private static final MessageFactory theFactory = new MessageFactoryImpl();
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,76 @@
+package org.jboss.soa.esb.message.format;
+
+import java.net.URI;
+
+import org.jboss.internal.soa.esb.message.format.MessageFactoryImpl;
+import org.jboss.soa.esb.message.Message;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * You get a message of a specific type when you need it. Obviously that type may not be
+ * suitable for the service (hopefully you've got that contractual information a priori, but
+ * maybe not) and in which case some translation/transformation may be necessary.
+ * 
+ * @author Mark Little
+ *
+ */
+
+public abstract class MessageFactory
+{
+	/**
+	 * @return some default implementation.
+	 */
+	
+	public abstract Message getMessage ();
+	
+	/**
+	 * @param type the unique identifier representing the type of this message.
+	 * @return the message, or <code>null</code> if no suitable plugin is available.
+	 */
+	
+	public abstract Message getMessage (URI type);
+	
+	/**
+	 * @param msg the message to convert.
+	 * @param type the type of the message we want to convert to.
+	 * @return a translated message, or <code>null</code> if no suitable plugin is available.
+	 */
+	
+	public abstract Message getMessage (Message msg, URI type);
+	
+	/**
+	 * Reload the plugins.
+	 */
+	
+	public abstract void reset ();
+	
+	// TODO setters/getters for the plugin programmatically too.
+	
+	public static MessageFactory getInstance ()
+	{
+		return theFactory;
+	}
+	
+	private static final MessageFactory theFactory = new MessageFactoryImpl();
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessagePlugin.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessagePlugin.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessagePlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,52 +0,0 @@
-package org.jboss.soa.esb.message.format;
-
-import java.net.URI;
-
-import org.jboss.soa.esb.message.Message;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Used to plug in new message formats dynamically. Each plugin is responsible for
- * returning a message implementation that knows how to serialize its state in a
- * specific manner, e.g., XML or ASN.1.
- *  
- * @author Mark Little
- *
- */
-
-public interface MessagePlugin
-{
-	public static final String MESSAGE_PLUGIN = "org.jboss.soa.esb.message.format.plugin";
-	
-	/**
-	 * @return the message instance.
-	 */
-	
-	public Message getMessage ();
-	
-	/**
-	 * @return the unique identifier for this message plugin.
-	 */
-	
-	public URI getType ();
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessagePlugin.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessagePlugin.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessagePlugin.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessagePlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,52 @@
+package org.jboss.soa.esb.message.format;
+
+import java.net.URI;
+
+import org.jboss.soa.esb.message.Message;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Used to plug in new message formats dynamically. Each plugin is responsible for
+ * returning a message implementation that knows how to serialize its state in a
+ * specific manner, e.g., XML or ASN.1.
+ *  
+ * @author Mark Little
+ *
+ */
+
+public interface MessagePlugin
+{
+	public static final String MESSAGE_PLUGIN = "org.jboss.soa.esb.message.format.plugin";
+	
+	/**
+	 * @return the message instance.
+	 */
+	
+	public Message getMessage ();
+	
+	/**
+	 * @return the unique identifier for this message plugin.
+	 */
+	
+	public URI getType ();
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageType.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageType.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageType.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,62 +0,0 @@
-package org.jboss.soa.esb.message.format;
-
-import java.net.URI;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * You get a message of a specific type when you need it. Obviously that type may not be
- * suitable for the service (hopefully you've got that contractual information a priori, but
- * maybe not) and in which case some translation/transformation may be necessary.
- * 
- * @author Mark Little
- *
- */
-
-public abstract class MessageType
-{
-	/*
-	 * DO NOT reorder this list. New types may be added as required.
-	 */
-	
-	public static URI JBOSS_XML = null;
-	public static URI JAVA_SERIALIZED = null;
-
-	public static URI DEFAULT_TYPE = null;
-	
-	static
-	{
-		try
-		{
-			JBOSS_XML = new URI("urn:jboss/esb/message/type/JBOSS_XML");
-			JAVA_SERIALIZED = new URI("urn:jboss/esb/message/type/JAVA_SERIALIZED");
-			
-			DEFAULT_TYPE = JBOSS_XML;
-		}
-		catch (Exception ex)
-		{
-			throw new ExceptionInInitializerError(ex.toString());
-		}
-
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageType.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageType.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageType.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/format/MessageType.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,62 @@
+package org.jboss.soa.esb.message.format;
+
+import java.net.URI;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * You get a message of a specific type when you need it. Obviously that type may not be
+ * suitable for the service (hopefully you've got that contractual information a priori, but
+ * maybe not) and in which case some translation/transformation may be necessary.
+ * 
+ * @author Mark Little
+ *
+ */
+
+public abstract class MessageType
+{
+	/*
+	 * DO NOT reorder this list. New types may be added as required.
+	 */
+	
+	public static URI JBOSS_XML = null;
+	public static URI JAVA_SERIALIZED = null;
+
+	public static URI DEFAULT_TYPE = null;
+	
+	static
+	{
+		try
+		{
+			JBOSS_XML = new URI("urn:jboss/esb/message/type/JBOSS_XML");
+			JAVA_SERIALIZED = new URI("urn:jboss/esb/message/type/JAVA_SERIALIZED");
+			
+			DEFAULT_TYPE = JBOSS_XML;
+		}
+		catch (Exception ex)
+		{
+			throw new ExceptionInInitializerError(ex.toString());
+		}
+
+	}
+	
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,172 +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-2007
- */
-package org.jboss.soa.esb.message.mapping;
-
-import java.lang.reflect.InvocationTargetException;
-import java.lang.reflect.Method;
-import java.util.ArrayList;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Extracts objects from an ESB message and puts them into a Map, which can be used for later processsing.
- * 
- * @author kurt.stam at jboss.com
- *
- */
-public class ObjectMapper 
-{
-    /** Name to get the byte[] content */
-    public static String BODY_CONTENT = "BODY_CONTENT";
-    private Logger logger = Logger.getLogger(this.getClass());
-    /**
-     * 
-     * body.myObject will add 'myObject', while
-     * body.myObject.mySubObject will create an entry of 'mySubObject'. 
-     * 
-     * in the returned List.
-     * 
-     * @param message - the message 
-     * @param messageObjectPathList - the key represents the query to get the object from
-     *                      from the message.
-     *                      
-     * @return List of Objects.
-     */
-    public List<Object> createObjectList (Message message,List<String> messageObjectPathList)
-    {
-        List<Object> objectList = new ArrayList<Object>();
-        if (messageObjectPathList!=null) {
-            for (String messageObjectPath: messageObjectPathList)
-            {   
-                Object value = getObjectFromMessage(message, messageObjectPath);
-                if (value==null) {
-                    logger.warn("The value of " + messageObjectPath + " is null");
-                } else {
-                    objectList.add(value);
-                }
-            }
-        }
-        return objectList;
-    }     
-    /**
-     * Extracts objects from the message, using a ESB Message Object Path. The
-     * path should follow the syntax:
-     * 
-     * location.objectname.<bean>...
-     * 
-     * location  : one of [body, property, attachment]
-     * objectname: name of the object name, attachments can be named or numbered, so for
-     *             attachments this can be a number too.
-     * <bean>    : optionally you traverse a bean graph by specifying bean names;
-     * 
-     *  examples : 
-     *  property.Order, gets the property object named "Order"
-     *  attachment.1, gets the first attachment Object
-     *  attachment.FirstAttachment, gets the attachment named 'FirstAttachment'
-     *  attachment.1.Order, calls getOrder() on the attached Object.
-     *  body.BODY_CONTENT, gets the byte[] of the body.
-     *  body.Order1.lineitem, obtains the object named "Order1"
-     *  from the body of the message. Next it will call getLineitem() on this object.
-     *  
-     *  More <bean> elements can be added to the query to traverse the bean graph.
-     * 
-     * @param message - an ESB Message.
-     * @param esbMessageObjectPath - path to the object.
-     * @return Object obtained from the message.
-     */    
-    public Object getObjectFromMessage(Message message, String esbMessageObjectPath) 
-    {
-        Object object=null;
-        String[] path = esbMessageObjectPath.split("\\.");
-        if (path.length<2) {
-            logger.error(esbMessageObjectPath + " should be of type 'location.name'");
-            return null;
-        } else {
-            String location = path[0];
-            String name     = path[1];
-            if ("body".equalsIgnoreCase(location)) {
-                Body body   = message.getBody();
-                object =
-                    BODY_CONTENT.equals(name)
-                    ? body.getByteArray()
-                    : body.get(name);
-            } else if ("property".equalsIgnoreCase(location)) {
-                object = message.getProperties().getProperty(name);
-            } else if ("attachment".equalsIgnoreCase(location)) {
-                if (isNumeric(name)) {
-                    int index = Integer.valueOf(name);
-                    object = message.getAttachment().itemAt(index);
-                } else {
-                    object = message.getAttachment().get(name);
-                }
-            } else {
-                logger.error(esbMessageObjectPath + " should start with either 'body', 'property', or 'attachment'");
-                return null;
-            }
-        }
-        //If needed traverse the bean graph.
-        if (path.length>2) object = getBean(path, object);
-        return object;
-    }
-    /**
-     * Checks to see if the name is number.
-     * 
-     * @param name
-     * @return
-     */
-    private boolean isNumeric(String name) {
-        for (int i=0; i<name.length(); i++) {
-            if (!Character.isDigit(name.charAt(i))) return false;
-        }
-        return true;
-    }
-    /**
-     * Constructs the getter - get<Beanname>, and invokes the method on the Object
-     * to traverse the bean path.
-     * 
-     * @param objectPath - path to the bean.
-     * @param bean - bean which graph is traversed.
-     * @return - the sought-after bean.
-     */
-    private Object getBean(String[] objectPath, Object bean) 
-    {
-        for (int i=2; i<objectPath.length-1;i++) {
-            String getter = "get" + objectPath[i].substring(0, 1).toUpperCase() 
-                                  + objectPath[i].substring(1,objectPath[i].length());
-            try {
-                Method method = bean.getClass().getMethod(getter, (Class[]) null);
-                bean = method.invoke(bean, (Object[]) null);
-            } catch (NoSuchMethodException nsm) {
-                logger.error(nsm.getMessage() + " " + getter + " on " + bean);
-                return bean;
-            } catch (InvocationTargetException ite) {
-                logger.error(ite.getMessage() + " while invoking " + getter + " on " + bean);
-                return bean;
-            } catch (IllegalAccessException iae) {
-                logger.error(iae.getMessage() + " while invoking " + getter + " on " + bean);
-                return bean;
-            }
-        }
-        return bean;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/mapping/ObjectMapper.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,172 @@
+/*
+ * 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-2007
+ */
+package org.jboss.soa.esb.message.mapping;
+
+import java.lang.reflect.InvocationTargetException;
+import java.lang.reflect.Method;
+import java.util.ArrayList;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Extracts objects from an ESB message and puts them into a Map, which can be used for later processsing.
+ * 
+ * @author kurt.stam at jboss.com
+ *
+ */
+public class ObjectMapper 
+{
+    /** Name to get the byte[] content */
+    public static String BODY_CONTENT = "BODY_CONTENT";
+    private Logger logger = Logger.getLogger(this.getClass());
+    /**
+     * 
+     * body.myObject will add 'myObject', while
+     * body.myObject.mySubObject will create an entry of 'mySubObject'. 
+     * 
+     * in the returned List.
+     * 
+     * @param message - the message 
+     * @param messageObjectPathList - the key represents the query to get the object from
+     *                      from the message.
+     *                      
+     * @return List of Objects.
+     */
+    public List<Object> createObjectList (Message message,List<String> messageObjectPathList)
+    {
+        List<Object> objectList = new ArrayList<Object>();
+        if (messageObjectPathList!=null) {
+            for (String messageObjectPath: messageObjectPathList)
+            {   
+                Object value = getObjectFromMessage(message, messageObjectPath);
+                if (value==null) {
+                    logger.warn("The value of " + messageObjectPath + " is null");
+                } else {
+                    objectList.add(value);
+                }
+            }
+        }
+        return objectList;
+    }     
+    /**
+     * Extracts objects from the message, using a ESB Message Object Path. The
+     * path should follow the syntax:
+     * 
+     * location.objectname.<bean>...
+     * 
+     * location  : one of [body, property, attachment]
+     * objectname: name of the object name, attachments can be named or numbered, so for
+     *             attachments this can be a number too.
+     * <bean>    : optionally you traverse a bean graph by specifying bean names;
+     * 
+     *  examples : 
+     *  property.Order, gets the property object named "Order"
+     *  attachment.1, gets the first attachment Object
+     *  attachment.FirstAttachment, gets the attachment named 'FirstAttachment'
+     *  attachment.1.Order, calls getOrder() on the attached Object.
+     *  body.BODY_CONTENT, gets the byte[] of the body.
+     *  body.Order1.lineitem, obtains the object named "Order1"
+     *  from the body of the message. Next it will call getLineitem() on this object.
+     *  
+     *  More <bean> elements can be added to the query to traverse the bean graph.
+     * 
+     * @param message - an ESB Message.
+     * @param esbMessageObjectPath - path to the object.
+     * @return Object obtained from the message.
+     */    
+    public Object getObjectFromMessage(Message message, String esbMessageObjectPath) 
+    {
+        Object object=null;
+        String[] path = esbMessageObjectPath.split("\\.");
+        if (path.length<2) {
+            logger.error(esbMessageObjectPath + " should be of type 'location.name'");
+            return null;
+        } else {
+            String location = path[0];
+            String name     = path[1];
+            if ("body".equalsIgnoreCase(location)) {
+                Body body   = message.getBody();
+                object =
+                    BODY_CONTENT.equals(name)
+                    ? body.getByteArray()
+                    : body.get(name);
+            } else if ("property".equalsIgnoreCase(location)) {
+                object = message.getProperties().getProperty(name);
+            } else if ("attachment".equalsIgnoreCase(location)) {
+                if (isNumeric(name)) {
+                    int index = Integer.valueOf(name);
+                    object = message.getAttachment().itemAt(index);
+                } else {
+                    object = message.getAttachment().get(name);
+                }
+            } else {
+                logger.error(esbMessageObjectPath + " should start with either 'body', 'property', or 'attachment'");
+                return null;
+            }
+        }
+        //If needed traverse the bean graph.
+        if (path.length>2) object = getBean(path, object);
+        return object;
+    }
+    /**
+     * Checks to see if the name is number.
+     * 
+     * @param name
+     * @return
+     */
+    private boolean isNumeric(String name) {
+        for (int i=0; i<name.length(); i++) {
+            if (!Character.isDigit(name.charAt(i))) return false;
+        }
+        return true;
+    }
+    /**
+     * Constructs the getter - get<Beanname>, and invokes the method on the Object
+     * to traverse the bean path.
+     * 
+     * @param objectPath - path to the bean.
+     * @param bean - bean which graph is traversed.
+     * @return - the sought-after bean.
+     */
+    private Object getBean(String[] objectPath, Object bean) 
+    {
+        for (int i=2; i<objectPath.length-1;i++) {
+            String getter = "get" + objectPath[i].substring(0, 1).toUpperCase() 
+                                  + objectPath[i].substring(1,objectPath[i].length());
+            try {
+                Method method = bean.getClass().getMethod(getter, (Class[]) null);
+                bean = method.invoke(bean, (Object[]) null);
+            } catch (NoSuchMethodException nsm) {
+                logger.error(nsm.getMessage() + " " + getter + " on " + bean);
+                return bean;
+            } catch (InvocationTargetException ite) {
+                logger.error(ite.getMessage() + " while invoking " + getter + " on " + bean);
+                return bean;
+            } catch (IllegalAccessException iae) {
+                logger.error(iae.getMessage() + " while invoking " + getter + " on " + bean);
+                return bean;
+            }
+        }
+        return bean;
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties/MessagePropertyFacade.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties/MessagePropertyFacade.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties/MessagePropertyFacade.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,130 +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 derek.adams at sapience360.com
- */
-
-package org.jboss.soa.esb.message.properties;
-
-import java.util.Calendar;
-
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Allows for manipulation of message properties using well-known names.
- * 
- * @author Derek Adams
- */
-public class MessagePropertyFacade {
-
-	/** Wrapped message instance */
-	protected Message message;
-
-	/** Constant for message id property name */
-	public static final String MESSAGE_ID = "jbossesb.message.id";
-
-	/** Constant for message category property name */
-	public static final String MESSAGE_CATEGORY = "jbossesb.message.category";
-
-	/** Constant for message category property name */
-	public static final String MESSAGE_CREATED_DATE = "jbossesb.message.created.date";
-
-	/** Constant for message delivered property name */
-	public static final String MESSAGE_DELIVERED = "jbossesb.message.delivered";
-
-	/**
-	 * Create a facade that wraps the given message.
-	 * 
-	 * @param message
-	 */
-	public MessagePropertyFacade(Message message) {
-		this.message = message;
-	}
-
-	/**
-	 * Get the message id.
-	 * 
-	 * @return String
-	 */
-	public String getMessageId() {
-		return (String) message.getProperties().getProperty(MESSAGE_ID);
-	}
-
-	/**
-	 * Set the message id.
-	 * 
-	 * @param messageId
-	 */
-	public void setMessageId(String messageId) {
-		message.getProperties().setProperty(MESSAGE_ID, messageId);
-	}
-
-	/**
-	 * Get the message category.
-	 * 
-	 * @return String
-	 */
-	public String getMessageCategory() {
-		return (String) message.getProperties().getProperty(MESSAGE_CATEGORY);
-	}
-
-	/**
-	 * Set the message category.
-	 * 
-	 * @param category
-	 */
-	public void setMessageCategory(String category) {
-		message.getProperties().setProperty(MESSAGE_CATEGORY, category);
-	}
-
-	/**
-	 * Get the message created date.
-	 * 
-	 * @return Calendar
-	 */
-	public Calendar getCreatedDate() {
-		return (Calendar) message.getProperties().getProperty(MESSAGE_CREATED_DATE);
-	}
-
-	/**
-	 * Set the message created date.
-	 * 
-	 * @param createdDate
-	 */
-	public void setCreatedDate(Calendar createdDate) {
-		message.getProperties().setProperty(MESSAGE_CREATED_DATE, createdDate);
-	}
-
-	/**
-	 * Indicates whether the message was delivered.
-	 * 
-	 * @return Boolean
-	 */
-	public Boolean wasDelivered() {
-		return (Boolean) message.getProperties().getProperty(MESSAGE_DELIVERED);
-	}
-
-	/**
-	 * Set the indicator for whether the message was delivered.
-	 * 
-	 * @param delivered
-	 */
-	public void setDelivered(Boolean delivered) {
-		message.getProperties().setProperty(MESSAGE_DELIVERED, delivered);
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties/MessagePropertyFacade.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties/MessagePropertyFacade.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties/MessagePropertyFacade.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/properties/MessagePropertyFacade.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,130 @@
+/*
+ * 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 derek.adams at sapience360.com
+ */
+
+package org.jboss.soa.esb.message.properties;
+
+import java.util.Calendar;
+
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Allows for manipulation of message properties using well-known names.
+ * 
+ * @author Derek Adams
+ */
+public class MessagePropertyFacade {
+
+	/** Wrapped message instance */
+	protected Message message;
+
+	/** Constant for message id property name */
+	public static final String MESSAGE_ID = "jbossesb.message.id";
+
+	/** Constant for message category property name */
+	public static final String MESSAGE_CATEGORY = "jbossesb.message.category";
+
+	/** Constant for message category property name */
+	public static final String MESSAGE_CREATED_DATE = "jbossesb.message.created.date";
+
+	/** Constant for message delivered property name */
+	public static final String MESSAGE_DELIVERED = "jbossesb.message.delivered";
+
+	/**
+	 * Create a facade that wraps the given message.
+	 * 
+	 * @param message
+	 */
+	public MessagePropertyFacade(Message message) {
+		this.message = message;
+	}
+
+	/**
+	 * Get the message id.
+	 * 
+	 * @return String
+	 */
+	public String getMessageId() {
+		return (String) message.getProperties().getProperty(MESSAGE_ID);
+	}
+
+	/**
+	 * Set the message id.
+	 * 
+	 * @param messageId
+	 */
+	public void setMessageId(String messageId) {
+		message.getProperties().setProperty(MESSAGE_ID, messageId);
+	}
+
+	/**
+	 * Get the message category.
+	 * 
+	 * @return String
+	 */
+	public String getMessageCategory() {
+		return (String) message.getProperties().getProperty(MESSAGE_CATEGORY);
+	}
+
+	/**
+	 * Set the message category.
+	 * 
+	 * @param category
+	 */
+	public void setMessageCategory(String category) {
+		message.getProperties().setProperty(MESSAGE_CATEGORY, category);
+	}
+
+	/**
+	 * Get the message created date.
+	 * 
+	 * @return Calendar
+	 */
+	public Calendar getCreatedDate() {
+		return (Calendar) message.getProperties().getProperty(MESSAGE_CREATED_DATE);
+	}
+
+	/**
+	 * Set the message created date.
+	 * 
+	 * @param createdDate
+	 */
+	public void setCreatedDate(Calendar createdDate) {
+		message.getProperties().setProperty(MESSAGE_CREATED_DATE, createdDate);
+	}
+
+	/**
+	 * Indicates whether the message was delivered.
+	 * 
+	 * @return Boolean
+	 */
+	public Boolean wasDelivered() {
+		return (Boolean) message.getProperties().getProperty(MESSAGE_DELIVERED);
+	}
+
+	/**
+	 * Set the indicator for whether the message was delivered.
+	 * 
+	 * @param delivered
+	 */
+	public void setDelivered(Boolean delivered) {
+		message.getProperties().setProperty(MESSAGE_DELIVERED, delivered);
+	}
+}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/MessageURIGenerator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/MessageURIGenerator.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/MessageURIGenerator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,42 +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 derek.adams at sapience360.com
- */
-
-package org.jboss.soa.esb.message.urigen;
-
-import java.net.URI;
-
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Interface for classes that generate URIs for messages.
- * 
- * @author Derek Adams
- */
-public interface MessageURIGenerator {
-
-	/**
-	 * Generate a unique URI for a message.
-	 * 
-	 * @param message
-	 * @return URI
-	 */
-	public URI generateMessageURI(Message message) throws URIGenerationException;
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/MessageURIGenerator.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/MessageURIGenerator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/MessageURIGenerator.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/MessageURIGenerator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,42 @@
+/*
+ * 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 derek.adams at sapience360.com
+ */
+
+package org.jboss.soa.esb.message.urigen;
+
+import java.net.URI;
+
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Interface for classes that generate URIs for messages.
+ * 
+ * @author Derek Adams
+ */
+public interface MessageURIGenerator {
+
+	/**
+	 * Generate a unique URI for a message.
+	 * 
+	 * @param message
+	 * @return URI
+	 */
+	public URI generateMessageURI(Message message) throws URIGenerationException;
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/URIGenerationException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/URIGenerationException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/URIGenerationException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,48 +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 derek.adams at sapience360.com
- */
-
-package org.jboss.soa.esb.message.urigen;
-
-/**
- * Exception thrown when a URI can not be generated for a message.
- * 
- * @author Derek Adams
- */
-public class URIGenerationException extends Exception {
-
-	private static final long serialVersionUID = 1L;
-
-	public URIGenerationException() {
-		super();
-	}
-
-	public URIGenerationException(String arg0, Throwable arg1) {
-		super(arg0, arg1);
-	}
-
-	public URIGenerationException(String arg0) {
-		super(arg0);
-	}
-
-	public URIGenerationException(Throwable arg0) {
-		super(arg0);
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/URIGenerationException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/URIGenerationException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/URIGenerationException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/message/urigen/URIGenerationException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,48 @@
+/*
+ * 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 derek.adams at sapience360.com
+ */
+
+package org.jboss.soa.esb.message.urigen;
+
+/**
+ * Exception thrown when a URI can not be generated for a message.
+ * 
+ * @author Derek Adams
+ */
+public class URIGenerationException extends Exception {
+
+	private static final long serialVersionUID = 1L;
+
+	public URIGenerationException() {
+		super();
+	}
+
+	public URIGenerationException(String arg0, Throwable arg1) {
+		super(arg0, arg1);
+	}
+
+	public URIGenerationException(String arg0) {
+		super(arg0);
+	}
+
+	public URIGenerationException(Throwable arg0) {
+		super(arg0);
+	}
+}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/mock)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockAction.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockAction.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,40 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.mock;
-
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Mock action implementation.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MockAction extends AbstractActionPipelineProcessor {
-
-    public MockAction(ConfigTree config) {        
-    }
-
-    public Message process(final Message message) throws ActionProcessingException {
-        return message;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockAction.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockAction.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockAction.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,40 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.mock;
+
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Mock action implementation.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MockAction extends AbstractActionPipelineProcessor {
+
+    public MockAction(ConfigTree config) {        
+    }
+
+    public Message process(final Message message) throws ActionProcessingException {
+        return message;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockListener.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockListener.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,54 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.mock;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-
-/**
- * Mock listener implementation.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MockListener extends AbstractManagedLifecycle {
-
-    /**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-
-    public MockListener(ConfigTree config) throws ConfigurationException {
-        super(config);
-    }
-
-    protected void doInitialise() throws ManagedLifecycleException {
-    }
-
-    protected void doStart() throws ManagedLifecycleException {
-    }
-
-    protected void doStop() throws ManagedLifecycleException {
-    }
-
-    protected void doDestroy() throws ManagedLifecycleException {
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockListener.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockListener.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockListener.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/mock/MockListener.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,54 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.mock;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+
+/**
+ * Mock listener implementation.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MockListener extends AbstractManagedLifecycle {
+
+    /**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    public MockListener(ConfigTree config) throws ConfigurationException {
+        super(config);
+    }
+
+    protected void doInitialise() throws ManagedLifecycleException {
+    }
+
+    protected void doStart() throws ManagedLifecycleException {
+    }
+
+    protected void doStop() throws ManagedLifecycleException {
+    }
+
+    protected void doDestroy() throws ManagedLifecycleException {
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,71 +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.notification;
-
-/**
- * Configuration Exception.
- * 
- * @author mark.little at jboss.com
- * @since Version 4.0
- */
-
-public class NotificationException extends Exception
-{
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param message
-	 *            Exception message.
-	 */
-	public NotificationException (String message)
-	{
-		super(message);
-	}
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param message
-	 *            Exception message.
-	 * @param cause
-	 *            Exception cause.
-	 */
-	public NotificationException (String message, Throwable cause)
-	{
-		super(message, cause);
-	}
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param cause
-	 *            Exception cause.
-	 */
-	public NotificationException (Throwable cause)
-	{
-		super(cause);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,71 @@
+/*
+ * 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.notification;
+
+/**
+ * Configuration Exception.
+ * 
+ * @author mark.little at jboss.com
+ * @since Version 4.0
+ */
+
+public class NotificationException extends Exception
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 */
+	public NotificationException (String message)
+	{
+		super(message);
+	}
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 * @param cause
+	 *            Exception cause.
+	 */
+	public NotificationException (String message, Throwable cause)
+	{
+		super(message, cause);
+	}
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param cause
+	 *            Exception cause.
+	 */
+	public NotificationException (Throwable cause)
+	{
+		super(cause);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,175 +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.notification;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Holds lists of NotificationTarget objects so that the NotificationHandler EJB
- * behaviour can be controlled at runtime by client applications
- * <p>
- * Description: Objects of this class will hold a list of objects that extend
- * the NotificationTarget base class. It's main purpose is to allow Rosetta
- * users to configure lists of recipients of specific events, and request the
- * NotificationHandler EJB to take care of triggering the events to each object
- * specified as a child "target" element
- * </p>
- * <p>
- * Author: Heuristica - Buenos Aires - Argentina
- * </p>
- * 
- * @version 1.0
- */
-public class NotificationList extends ConfigTree
-{
-	/**
-	 * 
-	 */
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Mnemonic name for the XML element name for the serialized form of objects
-	 * of this class
-	 */
-	public static final String ELEMENT = "NotificationList";
-
-	public static final String TYPE = "type";
-
-	public static final String CHILD_TGT = "target";
-
-	private String m_sType;
-
-	protected static Logger _logger = Logger.getLogger(NotificationList.class);
-
-	/**
-	 * Instantiate an object according to the contents of &lt;arg 1&gt;
-	 * 
-	 * @param p_oP
-	 *            ConfigTree - Parameter object containing the information
-	 *            needed to instantiate this object, including child elements
-	 *            named "target" that represent each individual
-	 *            NotificationTarget object
-	 */
-	public NotificationList (ConfigTree p_oP)
-	{
-		super(p_oP);
-		m_sType = p_oP.getAttribute(TYPE);
-		if (null != m_sType) m_sType = m_sType.toLowerCase();
-	} // __________________________________
-
-	private NotificationTarget[] getTargets () throws ConfigurationException
-	{
-		ConfigTree[] oaTgts = super.getChildren(CHILD_TGT);
-		NotificationTarget[] oaRet = new NotificationTarget[oaTgts.length];
-
-		for (int i1 = 0; i1 < oaRet.length; i1++)
-		{
-			oaRet[i1] = NotificationTarget.fromParams(oaTgts[i1]);
-		}
-
-		return oaRet;
-	} // __________________________________
-
-	/**
-	 * Invoke the sendNotification() method for all targets in the list. The
-	 * method iterates along it's NotificationTarget child nodes and invokes the
-	 * sendNotification() method with the same object to all of them
-	 * 
-	 * @param message
-	 *            Object - The event to notify to all targets
-	 * @throws NotificationException -
-	 *             use Exception.getMessage() at runtime
-	 */
-	public void sendNotification (Message message) throws NotificationException
-	{
-		try
-		{
-			NotificationTarget[] oaTgt = getTargets();
-	
-			for (int i1 = 0; i1 < oaTgt.length; i1++)
-			{
-				oaTgt[i1].sendNotification(message);
-			}
-		}
-		catch (ConfigurationException ex)
-		{
-			throw new NotificationException(ex);
-		}
-	} // __________________________________
-
-	/**
-	 * Is this an OK (success) NotificationList ?
-	 * 
-	 * @return boolean - Yes, Attribute "type" of constructor parameters starts
-	 *         with "ok", OR there was no "type" attribute in the constructor
-	 *         <li>A NotificationList can be both OK and Error if no "type"
-	 *         attribute was specified at constructor time in the ConfigTree
-	 *         argument</li>
-	 * @see ConfigTree#getAttribute(String)
-	 */
-	public boolean isOK ()
-	{
-		return (null == m_sType) ? true : m_sType.startsWith("ok");
-	}
-
-	/**
-	 * Is this an Error (failure) NotificationList ?
-	 * 
-	 * @return boolean - Yes, Attribute "type" of constructor parameters starts
-	 *         with "err", OR there was no "type" attribute in the constructor
-	 *         <li>A NotificationList can be both OK and Error if no "type"
-	 *         attribute was specified at constructor time in the ConfigTree
-	 *         argument</li>
-	 * @see ConfigTree#getAttribute(String)
-	 */
-	public boolean isErr ()
-	{
-		return (null == m_sType) ? true : m_sType.startsWith("err");
-	}
-
-	public static void notifyAll (ConfigTree[] list, Message message)
-	{
-		for (ConfigTree tree : list)
-		{
-			ConfigTree[] targets = tree.getChildren(NotificationList.CHILD_TGT);
-			for (ConfigTree curr : targets)
-			{
-				try
-				{
-					NotificationTarget target = NotificationTarget
-							.fromParams(curr);
-					target.sendNotification(message);
-				}
-				catch (Exception e)
-				{
-					_logger.error(
-							"Can't instantiate target " + curr.toString(), e);
-				}
-			}
-		}
-	} // ________________________________
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationList.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,175 @@
+/*
+ * 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.notification;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Holds lists of NotificationTarget objects so that the NotificationHandler EJB
+ * behaviour can be controlled at runtime by client applications
+ * <p>
+ * Description: Objects of this class will hold a list of objects that extend
+ * the NotificationTarget base class. It's main purpose is to allow Rosetta
+ * users to configure lists of recipients of specific events, and request the
+ * NotificationHandler EJB to take care of triggering the events to each object
+ * specified as a child "target" element
+ * </p>
+ * <p>
+ * Author: Heuristica - Buenos Aires - Argentina
+ * </p>
+ * 
+ * @version 1.0
+ */
+public class NotificationList extends ConfigTree
+{
+	/**
+	 * 
+	 */
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Mnemonic name for the XML element name for the serialized form of objects
+	 * of this class
+	 */
+	public static final String ELEMENT = "NotificationList";
+
+	public static final String TYPE = "type";
+
+	public static final String CHILD_TGT = "target";
+
+	private String m_sType;
+
+	protected static Logger _logger = Logger.getLogger(NotificationList.class);
+
+	/**
+	 * Instantiate an object according to the contents of &lt;arg 1&gt;
+	 * 
+	 * @param p_oP
+	 *            ConfigTree - Parameter object containing the information
+	 *            needed to instantiate this object, including child elements
+	 *            named "target" that represent each individual
+	 *            NotificationTarget object
+	 */
+	public NotificationList (ConfigTree p_oP)
+	{
+		super(p_oP);
+		m_sType = p_oP.getAttribute(TYPE);
+		if (null != m_sType) m_sType = m_sType.toLowerCase();
+	} // __________________________________
+
+	private NotificationTarget[] getTargets () throws ConfigurationException
+	{
+		ConfigTree[] oaTgts = super.getChildren(CHILD_TGT);
+		NotificationTarget[] oaRet = new NotificationTarget[oaTgts.length];
+
+		for (int i1 = 0; i1 < oaRet.length; i1++)
+		{
+			oaRet[i1] = NotificationTarget.fromParams(oaTgts[i1]);
+		}
+
+		return oaRet;
+	} // __________________________________
+
+	/**
+	 * Invoke the sendNotification() method for all targets in the list. The
+	 * method iterates along it's NotificationTarget child nodes and invokes the
+	 * sendNotification() method with the same object to all of them
+	 * 
+	 * @param message
+	 *            Object - The event to notify to all targets
+	 * @throws NotificationException -
+	 *             use Exception.getMessage() at runtime
+	 */
+	public void sendNotification (Message message) throws NotificationException
+	{
+		try
+		{
+			NotificationTarget[] oaTgt = getTargets();
+	
+			for (int i1 = 0; i1 < oaTgt.length; i1++)
+			{
+				oaTgt[i1].sendNotification(message);
+			}
+		}
+		catch (ConfigurationException ex)
+		{
+			throw new NotificationException(ex);
+		}
+	} // __________________________________
+
+	/**
+	 * Is this an OK (success) NotificationList ?
+	 * 
+	 * @return boolean - Yes, Attribute "type" of constructor parameters starts
+	 *         with "ok", OR there was no "type" attribute in the constructor
+	 *         <li>A NotificationList can be both OK and Error if no "type"
+	 *         attribute was specified at constructor time in the ConfigTree
+	 *         argument</li>
+	 * @see ConfigTree#getAttribute(String)
+	 */
+	public boolean isOK ()
+	{
+		return (null == m_sType) ? true : m_sType.startsWith("ok");
+	}
+
+	/**
+	 * Is this an Error (failure) NotificationList ?
+	 * 
+	 * @return boolean - Yes, Attribute "type" of constructor parameters starts
+	 *         with "err", OR there was no "type" attribute in the constructor
+	 *         <li>A NotificationList can be both OK and Error if no "type"
+	 *         attribute was specified at constructor time in the ConfigTree
+	 *         argument</li>
+	 * @see ConfigTree#getAttribute(String)
+	 */
+	public boolean isErr ()
+	{
+		return (null == m_sType) ? true : m_sType.startsWith("err");
+	}
+
+	public static void notifyAll (ConfigTree[] list, Message message)
+	{
+		for (ConfigTree tree : list)
+		{
+			ConfigTree[] targets = tree.getChildren(NotificationList.CHILD_TGT);
+			for (ConfigTree curr : targets)
+			{
+				try
+				{
+					NotificationTarget target = NotificationTarget
+							.fromParams(curr);
+					target.sendNotification(message);
+				}
+				catch (Exception e)
+				{
+					_logger.error(
+							"Can't instantiate target " + curr.toString(), e);
+				}
+			}
+		}
+	} // ________________________________
+
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,155 +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.notification;
-
-import java.lang.reflect.Constructor;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * Abstract class to define expected behaviour of all NotificationTargets and
- * provide some common functionality to all of them
- * <p>
- * Description:
- * </p>
- * <p>
- * Heuristica - Buenos Aires - Argentina
- * </p>
- * 
- * @version 1.0
- */
-public abstract class NotificationTarget
-{
-	/**
-	 * Derived classes must implement this method to do what has to be done to
-	 * trigger that specific type of notification event
-	 * 
-	 * @param message
-	 *            Object - The toString() method of this object will be the
-	 *            actual notification content
-	 * @throws NotificationException -
-	 *             invoke Exception.getMessage() at runtime for this object
-	 * @see ConfigTree
-	 */
-	public abstract void sendNotification (Message message)
-			throws NotificationException;
-
-	private static final String NOTIF_PFX = NotificationTarget.class
-			.getPackage().getName();
-
-	public static final String PRM_NOTIF_CLASS = "class";
-
-	/**
-	 * Common object to hold details of object's information - Each derived
-	 * class will hold it's own needs
-	 */
-	protected ConfigTree m_oParms;
-
-	/**
-	 * Instantiate an empty NotificationTarget object
-	 */
-	protected NotificationTarget ()
-	{
-	}
-
-	/**
-	 * Instantiate a NotificationTarget object with the information contained in
-	 * &lt;arg 1&gt;
-	 * 
-	 * @param p_oP
-	 *            ConfigTree - Holds details to instantiate this object
-	 */
-	protected NotificationTarget (ConfigTree p_oP)
-	{
-		m_oParms = p_oP;
-	} // __________________________________
-
-	/**
-	 * A typical Factory.getInstance() method
-	 * 
-	 * @param p_oP
-	 *            ConfigTree - Contents of this argument will determine the type
-	 *            (derived class) of NotificationTarget returned
-	 * @throws ConfigurationException -
-	 *             Arg 1 does not contain a valid structure for currently
-	 *             implemented NotificationTarget subclasses - invoke
-	 *             Exception.getMessage() at runtime for details
-	 * @return NotificationTarget - An object that instantiates the
-	 *         NotificationTarget abstract class
-	 */
-	public static NotificationTarget fromParams (ConfigTree p_oP)
-			throws ConfigurationException
-	{
-		String sClass = p_oP.getAttribute(PRM_NOTIF_CLASS);
-		if (null == sClass)
-			throw new IllegalArgumentException(
-					"Missing '" + PRM_NOTIF_CLASS + "' attribute in parameters");
-		Class oCls = null;
-		try
-		{
-			oCls = ClassUtil.forName(NOTIF_PFX + "." + sClass, NotificationTarget.class);
-		}
-		catch (Exception e)
-		{
-			try
-			{
-				oCls = ClassUtil.forName(sClass, NotificationTarget.class);
-			}
-			catch (Exception e1)
-			{/* oCls will be null */
-			}
-		}
-		if (null == oCls)
-			throw new ConfigurationException(
-					"Invalid class <" + sClass + ">, or missing library");
-
-		Constructor oCons = null;
-		try
-		{
-			oCons = oCls.getConstructor(new Class[] { ConfigTree.class });
-		}
-		catch (Exception e)
-		{
-		}
-		if (null == oCons)
-			throw new ConfigurationException(
-					"No valid constructor " + sClass + "(ConfigTree)");
-
-		Object oRet = null;
-		try
-		{
-			oRet = oCons.newInstance(new Object[] { p_oP });
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace();
-		}
-		if (null == oRet || (!(oRet instanceof NotificationTarget)))
-			throw new ConfigurationException(sClass + "  does not extend NotificationTarget");
-
-		return (NotificationTarget) oRet;
-	} // __________________________________
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotificationTarget.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,155 @@
+/*
+ * 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.notification;
+
+import java.lang.reflect.Constructor;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Abstract class to define expected behaviour of all NotificationTargets and
+ * provide some common functionality to all of them
+ * <p>
+ * Description:
+ * </p>
+ * <p>
+ * Heuristica - Buenos Aires - Argentina
+ * </p>
+ * 
+ * @version 1.0
+ */
+public abstract class NotificationTarget
+{
+	/**
+	 * Derived classes must implement this method to do what has to be done to
+	 * trigger that specific type of notification event
+	 * 
+	 * @param message
+	 *            Object - The toString() method of this object will be the
+	 *            actual notification content
+	 * @throws NotificationException -
+	 *             invoke Exception.getMessage() at runtime for this object
+	 * @see ConfigTree
+	 */
+	public abstract void sendNotification (Message message)
+			throws NotificationException;
+
+	private static final String NOTIF_PFX = NotificationTarget.class
+			.getPackage().getName();
+
+	public static final String PRM_NOTIF_CLASS = "class";
+
+	/**
+	 * Common object to hold details of object's information - Each derived
+	 * class will hold it's own needs
+	 */
+	protected ConfigTree m_oParms;
+
+	/**
+	 * Instantiate an empty NotificationTarget object
+	 */
+	protected NotificationTarget ()
+	{
+	}
+
+	/**
+	 * Instantiate a NotificationTarget object with the information contained in
+	 * &lt;arg 1&gt;
+	 * 
+	 * @param p_oP
+	 *            ConfigTree - Holds details to instantiate this object
+	 */
+	protected NotificationTarget (ConfigTree p_oP)
+	{
+		m_oParms = p_oP;
+	} // __________________________________
+
+	/**
+	 * A typical Factory.getInstance() method
+	 * 
+	 * @param p_oP
+	 *            ConfigTree - Contents of this argument will determine the type
+	 *            (derived class) of NotificationTarget returned
+	 * @throws ConfigurationException -
+	 *             Arg 1 does not contain a valid structure for currently
+	 *             implemented NotificationTarget subclasses - invoke
+	 *             Exception.getMessage() at runtime for details
+	 * @return NotificationTarget - An object that instantiates the
+	 *         NotificationTarget abstract class
+	 */
+	public static NotificationTarget fromParams (ConfigTree p_oP)
+			throws ConfigurationException
+	{
+		String sClass = p_oP.getAttribute(PRM_NOTIF_CLASS);
+		if (null == sClass)
+			throw new IllegalArgumentException(
+					"Missing '" + PRM_NOTIF_CLASS + "' attribute in parameters");
+		Class oCls = null;
+		try
+		{
+			oCls = ClassUtil.forName(NOTIF_PFX + "." + sClass, NotificationTarget.class);
+		}
+		catch (Exception e)
+		{
+			try
+			{
+				oCls = ClassUtil.forName(sClass, NotificationTarget.class);
+			}
+			catch (Exception e1)
+			{/* oCls will be null */
+			}
+		}
+		if (null == oCls)
+			throw new ConfigurationException(
+					"Invalid class <" + sClass + ">, or missing library");
+
+		Constructor oCons = null;
+		try
+		{
+			oCons = oCls.getConstructor(new Class[] { ConfigTree.class });
+		}
+		catch (Exception e)
+		{
+		}
+		if (null == oCons)
+			throw new ConfigurationException(
+					"No valid constructor " + sClass + "(ConfigTree)");
+
+		Object oRet = null;
+		try
+		{
+			oRet = oCons.newInstance(new Object[] { p_oP });
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace();
+		}
+		if (null == oRet || (!(oRet instanceof NotificationTarget)))
+			throw new ConfigurationException(sClass + "  does not extend NotificationTarget");
+
+		return (NotificationTarget) oRet;
+	} // __________________________________
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,48 +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.notification;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.Util;
-
-public class NotifyConsole extends NotificationTarget 
-{
-
-	public NotifyConsole(ConfigTree tree)
-	{
-		super(tree);
-	}
-	
-	@Override
-	public void sendNotification(Message message) throws NotificationException 
-	{
-        String content=null;  
-        if (message.getBody().getByteArray()!=null) {
-            content = new String(message.getBody().getByteArray());
-        }
-		System.out.println
-			("ConsoleNotifier "+Util.getStamp()+"<"+content+">");
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyConsole.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,48 @@
+/*
+ * 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.notification;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.Util;
+
+public class NotifyConsole extends NotificationTarget 
+{
+
+	public NotifyConsole(ConfigTree tree)
+	{
+		super(tree);
+	}
+	
+	@Override
+	public void sendNotification(Message message) throws NotificationException 
+	{
+        String content=null;  
+        if (message.getBody().getByteArray()!=null) {
+            content = new String(message.getBody().getByteArray());
+        }
+		System.out.println
+			("ConsoleNotifier "+Util.getStamp()+"<"+content+">");
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,139 +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.notification;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.InternetAddress;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.Email;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.Util;
-
-/**
- * This class will send an e-mail using the Email class
- * <p>
- * Description:
- * </p>
- * <p>
- * Author: Heuristica - Buenos Aires - Argentina
- * </p>
- * 
- * @version 1.0
- */
-public class NotifyEmail extends NotificationTarget
-{
-	/**
-	 * Instantiate a NotifyEmail object using the information contained in
-	 * &lt;arg 1&gt;
-	 * 
-	 * @param p_oP
-	 *            ConfigTree - See attributes and structure needed for the
-	 *            Email() constructor - The MESSAGE attribute will be filled in
-	 *            at sendNotification(Serializable) time
-	 * @throws ConfigurationException
-	 * @see NotifyEmail#sendNotification(Message)
-	 */
-	public NotifyEmail (ConfigTree p_oP) throws ConfigurationException
-	{
-		super(p_oP);
-
-		try
-		{
-			String sAtt = (String) m_oParms.getAttribute(Email.FROM);
-			
-			if (null != sAtt) 
-				InternetAddress.parse(sAtt);
-	
-			InternetAddress.parse(m_oParms.getAttribute(Email.SENDTO));
-	
-			sAtt = (String) m_oParms.getAttribute(Email.COPYTO);
-			if (null != sAtt) 
-				InternetAddress.parse(sAtt);
-		}
-		catch (AddressException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-	} // __________________________________
-
-	/**
-	 * Send an Email using Email() using p_o.toString() to fill in the message
-	 * text
-	 * 
-	 * @param message
-	 *            Object - This object's toString() method will supply contents
-	 *            of mail message
-	 */
-	public void sendNotification (Message message) throws NotificationException
-	{
-		try
-		{
-            String content=null;
-            if (message.getBody().getByteArray()!=null) {
-                content = new String(message.getBody().getByteArray());
-            }
-			ConfigTree oP = m_oParms.cloneObj();
-			String sMsg = oP.getAttribute(Email.MESSAGE);
-			sMsg = ((null == sMsg) ? content : sMsg + "\n") + content;
-			oP.setAttribute(Email.MESSAGE, sMsg);
-			sendEmailNotification(oP);
-		}
-		catch (AddressException e)
-		{
-			Util.getDefaultLogger(this.getClass()).error("Send Mail Failed", e);
-			
-			throw new NotificationException(e);
-		}
-		catch (MessagingException ex)
-		{
-			throw new NotificationException(ex);
-		}
-	} // __________________________________
-
-	/**
-	 * Send an email notification based on the supplied parameters. <p/> This
-	 * method allows overriding for test purposes.
-	 * 
-	 * @param messageParams
-	 *            Message parameters.
-	 */
-	protected void sendEmailNotification (ConfigTree messageParams)
-			throws AddressException, MessagingException
-	{
-
-		Email esbMail = new Email();
-		esbMail.setSendTo(messageParams.getAttribute(Email.SENDTO));
-		esbMail.setFrom(messageParams.getAttribute(Email.FROM));
-		esbMail.setCopyTo(messageParams.getAttribute(Email.COPYTO));
-		esbMail.setSubject(messageParams.getAttribute(Email.SUBJECT));
-
-		esbMail.setAttachments(messageParams.getTextChildren(Email.ATTACH));
-		esbMail.setMessage(messageParams.getAttribute(Email.MESSAGE));
-
-		esbMail.sendMessage();
-	}
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyEmail.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,139 @@
+/*
+ * 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.notification;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.InternetAddress;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.Email;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.Util;
+
+/**
+ * This class will send an e-mail using the Email class
+ * <p>
+ * Description:
+ * </p>
+ * <p>
+ * Author: Heuristica - Buenos Aires - Argentina
+ * </p>
+ * 
+ * @version 1.0
+ */
+public class NotifyEmail extends NotificationTarget
+{
+	/**
+	 * Instantiate a NotifyEmail object using the information contained in
+	 * &lt;arg 1&gt;
+	 * 
+	 * @param p_oP
+	 *            ConfigTree - See attributes and structure needed for the
+	 *            Email() constructor - The MESSAGE attribute will be filled in
+	 *            at sendNotification(Serializable) time
+	 * @throws ConfigurationException
+	 * @see NotifyEmail#sendNotification(Message)
+	 */
+	public NotifyEmail (ConfigTree p_oP) throws ConfigurationException
+	{
+		super(p_oP);
+
+		try
+		{
+			String sAtt = (String) m_oParms.getAttribute(Email.FROM);
+			
+			if (null != sAtt) 
+				InternetAddress.parse(sAtt);
+	
+			InternetAddress.parse(m_oParms.getAttribute(Email.SENDTO));
+	
+			sAtt = (String) m_oParms.getAttribute(Email.COPYTO);
+			if (null != sAtt) 
+				InternetAddress.parse(sAtt);
+		}
+		catch (AddressException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+	} // __________________________________
+
+	/**
+	 * Send an Email using Email() using p_o.toString() to fill in the message
+	 * text
+	 * 
+	 * @param message
+	 *            Object - This object's toString() method will supply contents
+	 *            of mail message
+	 */
+	public void sendNotification (Message message) throws NotificationException
+	{
+		try
+		{
+            String content=null;
+            if (message.getBody().getByteArray()!=null) {
+                content = new String(message.getBody().getByteArray());
+            }
+			ConfigTree oP = m_oParms.cloneObj();
+			String sMsg = oP.getAttribute(Email.MESSAGE);
+			sMsg = ((null == sMsg) ? content : sMsg + "\n") + content;
+			oP.setAttribute(Email.MESSAGE, sMsg);
+			sendEmailNotification(oP);
+		}
+		catch (AddressException e)
+		{
+			Util.getDefaultLogger(this.getClass()).error("Send Mail Failed", e);
+			
+			throw new NotificationException(e);
+		}
+		catch (MessagingException ex)
+		{
+			throw new NotificationException(ex);
+		}
+	} // __________________________________
+
+	/**
+	 * Send an email notification based on the supplied parameters. <p/> This
+	 * method allows overriding for test purposes.
+	 * 
+	 * @param messageParams
+	 *            Message parameters.
+	 */
+	protected void sendEmailNotification (ConfigTree messageParams)
+			throws AddressException, MessagingException
+	{
+
+		Email esbMail = new Email();
+		esbMail.setSendTo(messageParams.getAttribute(Email.SENDTO));
+		esbMail.setFrom(messageParams.getAttribute(Email.FROM));
+		esbMail.setCopyTo(messageParams.getAttribute(Email.COPYTO));
+		esbMail.setSubject(messageParams.getAttribute(Email.SUBJECT));
+
+		esbMail.setAttachments(messageParams.getTextChildren(Email.ATTACH));
+		esbMail.setMessage(messageParams.getAttribute(Email.MESSAGE));
+
+		esbMail.sendMessage();
+	}
+
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,206 +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.notification;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.net.URISyntaxException;
-
-import org.apache.commons.io.IOUtils;
-import org.apache.commons.lang.StringUtils;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.util.RemoteFileSystem;
-import org.jboss.soa.esb.util.RemoteFileSystemException;
-import org.jboss.soa.esb.util.RemoteFileSystemFactory;
-
-/**
- * Sends a message to an outgoing FTP server. The outgoing filename can have
- * values of message properties injected into it to make it unique. The
- * notification-details property looks something like:
- * 
- * <code>
- *		<NotificationList type="OK" xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
- *			<target class="NotifyFTP">
- *				<ftp URL="ftp://username:pwd@server.com/remote/dir" filename="{jbossesb.message.id}.txt"/>
- *			</target>
- *		</NotificationList>
- * </code>
- * 
- * @author <a href="mailto:rex.sheridan at sapience360.com">Rex Sheridan</a>
- */
-public class NotifyFTP extends NotificationTarget {
-
-	/** Configuration entries */
-	private ConfigTree config;
-
-	/** Used to get access to remote filesystem */
-	private FTPEpr epr;
-
-	/** Filename created on server */
-	private String fileName;
-
-	/** FTP child tag name */
-	public static final String CHILD_FTP = "ftp";
-
-	/** Filename attribute */
-	public static final String ATTR_FILENAME = "filename";
-
-	/** Base filename for temp file */
-	public static final String TEMP_FILE_BASE = "jbossesb-NotifyFTP";
-
-	/**
-	 * Create an outgoing FTP notification based on the given configuration.
-	 * 
-	 * @param config
-	 */
-	public NotifyFTP(ConfigTree config) {
-		this.config = config;
-	}
-
-	/**
-	 * Get the ConfigTree for the 'ftp' element.
-	 * 
-	 * @return ConfigTree
-	 */
-	protected ConfigTree getFtpConfig() throws NotificationException {
-		ConfigTree[] ftps = config.getChildren(CHILD_FTP);
-		if (ftps.length != 1) {
-			throw new NotificationException("NotifyFTP requires exactly one 'ftp' element.");
-		}
-		return ftps[0];
-	}
-
-	/**
-	 * Lazy loads filename from config tree.
-	 * 
-	 * @return String
-	 */
-	protected String getFileName(Message message) throws NotificationException {
-		if (fileName == null) {
-			ConfigTree ftpConfig = getFtpConfig();
-			fileName = ftpConfig.getAttribute(ATTR_FILENAME);
-			if (StringUtils.isEmpty(fileName)) {
-				throw new NotificationException("NotifyFTP: Filename attribute is required.");
-			}
-			fileName = replaceArguments(fileName, message);
-		}
-		return fileName;
-	}
-
-	/**
-	 * Replaces any arguments in the form '{prop.name}' with corresponding
-	 * message property values.
-	 * 
-	 * @param value
-	 * @param message
-	 * @return String
-	 */
-	protected String replaceArguments(String value, Message message) {
-		String current = value;
-		String replaced = replaceArgument(value, message);
-		while (!current.equals(replaced)) {
-			current = replaced;
-			replaced = replaceArgument(current, message);
-		}
-		return replaced;
-	}
-
-	/**
-	 * Look for arguments in the form '{prop.name}' and replace them with
-	 * corresponding message properties.
-	 * 
-	 * @param value
-	 * @param message
-	 * @return String
-	 */
-	protected String replaceArgument(String value, Message message) {
-		int startIndex = value.indexOf('{');
-		if (startIndex == -1) {
-			return value;
-		}
-		int endIndex = value.indexOf('}');
-		if (endIndex == -1) {
-			return value;
-		}
-		String propName = value.substring(startIndex + 1, endIndex);
-		Object propValue = message.getProperties().getProperty(propName);
-		if (propValue == null) {
-			return value;
-		}
-		return value.substring(0, startIndex) + propValue + value.substring(endIndex + 1);
-	}
-
-	/**
-	 * Builds an FTP EPR from the configutation data.
-	 * 
-	 * @return FTPEpr
-	 */
-	protected FTPEpr getFtpEpr() throws NotificationException {
-		if (epr == null) {
-			ConfigTree ftpConfig = getFtpConfig();
-			String url = ftpConfig.getAttribute(FTPEpr.URL_TAG);
-			try {
-				epr = new FTPEpr(url);
-			} catch (URISyntaxException e) {
-				throw new NotificationException(e);
-			}
-		}
-		return epr;
-	}
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.notification.NotificationTarget#sendNotification(org.jboss.soa.esb.message.Message)
-	 */
-	public void sendNotification(Message message) throws NotificationException {
-		FileOutputStream stream = null;
-		File tmpFile = null;
-		RemoteFileSystem rfs = null;
-		try {
-			tmpFile = File.createTempFile(TEMP_FILE_BASE, null);
-			stream = new FileOutputStream(tmpFile);
-			IOUtils.write(message.getBody().getByteArray(), stream);
-			stream.close();
-			rfs = RemoteFileSystemFactory.getRemoteFileSystem(getFtpEpr(), true);
-			rfs.uploadFile(tmpFile, getFileName(message));
-		} catch (RemoteFileSystemException e) {
-			throw new NotificationException("Could not complete FTP notification", e);
-		} catch (IOException e) {
-			throw new NotificationException("Could not complete FTP notification", e);
-		} finally {
-			if (stream != null) {
-				IOUtils.closeQuietly(stream);
-			}
-			if (tmpFile != null) {
-				tmpFile.delete();
-			}
-			if (rfs != null) {
-				rfs.quit();
-			}
-		}
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFTP.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,206 @@
+/*
+ * 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.notification;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.net.URISyntaxException;
+
+import org.apache.commons.io.IOUtils;
+import org.apache.commons.lang.StringUtils;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.util.RemoteFileSystem;
+import org.jboss.soa.esb.util.RemoteFileSystemException;
+import org.jboss.soa.esb.util.RemoteFileSystemFactory;
+
+/**
+ * Sends a message to an outgoing FTP server. The outgoing filename can have
+ * values of message properties injected into it to make it unique. The
+ * notification-details property looks something like:
+ * 
+ * <code>
+ *		<NotificationList type="OK" xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+ *			<target class="NotifyFTP">
+ *				<ftp URL="ftp://username:pwd@server.com/remote/dir" filename="{jbossesb.message.id}.txt"/>
+ *			</target>
+ *		</NotificationList>
+ * </code>
+ * 
+ * @author <a href="mailto:rex.sheridan at sapience360.com">Rex Sheridan</a>
+ */
+public class NotifyFTP extends NotificationTarget {
+
+	/** Configuration entries */
+	private ConfigTree config;
+
+	/** Used to get access to remote filesystem */
+	private FTPEpr epr;
+
+	/** Filename created on server */
+	private String fileName;
+
+	/** FTP child tag name */
+	public static final String CHILD_FTP = "ftp";
+
+	/** Filename attribute */
+	public static final String ATTR_FILENAME = "filename";
+
+	/** Base filename for temp file */
+	public static final String TEMP_FILE_BASE = "jbossesb-NotifyFTP";
+
+	/**
+	 * Create an outgoing FTP notification based on the given configuration.
+	 * 
+	 * @param config
+	 */
+	public NotifyFTP(ConfigTree config) {
+		this.config = config;
+	}
+
+	/**
+	 * Get the ConfigTree for the 'ftp' element.
+	 * 
+	 * @return ConfigTree
+	 */
+	protected ConfigTree getFtpConfig() throws NotificationException {
+		ConfigTree[] ftps = config.getChildren(CHILD_FTP);
+		if (ftps.length != 1) {
+			throw new NotificationException("NotifyFTP requires exactly one 'ftp' element.");
+		}
+		return ftps[0];
+	}
+
+	/**
+	 * Lazy loads filename from config tree.
+	 * 
+	 * @return String
+	 */
+	protected String getFileName(Message message) throws NotificationException {
+		if (fileName == null) {
+			ConfigTree ftpConfig = getFtpConfig();
+			fileName = ftpConfig.getAttribute(ATTR_FILENAME);
+			if (StringUtils.isEmpty(fileName)) {
+				throw new NotificationException("NotifyFTP: Filename attribute is required.");
+			}
+			fileName = replaceArguments(fileName, message);
+		}
+		return fileName;
+	}
+
+	/**
+	 * Replaces any arguments in the form '{prop.name}' with corresponding
+	 * message property values.
+	 * 
+	 * @param value
+	 * @param message
+	 * @return String
+	 */
+	protected String replaceArguments(String value, Message message) {
+		String current = value;
+		String replaced = replaceArgument(value, message);
+		while (!current.equals(replaced)) {
+			current = replaced;
+			replaced = replaceArgument(current, message);
+		}
+		return replaced;
+	}
+
+	/**
+	 * Look for arguments in the form '{prop.name}' and replace them with
+	 * corresponding message properties.
+	 * 
+	 * @param value
+	 * @param message
+	 * @return String
+	 */
+	protected String replaceArgument(String value, Message message) {
+		int startIndex = value.indexOf('{');
+		if (startIndex == -1) {
+			return value;
+		}
+		int endIndex = value.indexOf('}');
+		if (endIndex == -1) {
+			return value;
+		}
+		String propName = value.substring(startIndex + 1, endIndex);
+		Object propValue = message.getProperties().getProperty(propName);
+		if (propValue == null) {
+			return value;
+		}
+		return value.substring(0, startIndex) + propValue + value.substring(endIndex + 1);
+	}
+
+	/**
+	 * Builds an FTP EPR from the configutation data.
+	 * 
+	 * @return FTPEpr
+	 */
+	protected FTPEpr getFtpEpr() throws NotificationException {
+		if (epr == null) {
+			ConfigTree ftpConfig = getFtpConfig();
+			String url = ftpConfig.getAttribute(FTPEpr.URL_TAG);
+			try {
+				epr = new FTPEpr(url);
+			} catch (URISyntaxException e) {
+				throw new NotificationException(e);
+			}
+		}
+		return epr;
+	}
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.notification.NotificationTarget#sendNotification(org.jboss.soa.esb.message.Message)
+	 */
+	public void sendNotification(Message message) throws NotificationException {
+		FileOutputStream stream = null;
+		File tmpFile = null;
+		RemoteFileSystem rfs = null;
+		try {
+			tmpFile = File.createTempFile(TEMP_FILE_BASE, null);
+			stream = new FileOutputStream(tmpFile);
+			IOUtils.write(message.getBody().getByteArray(), stream);
+			stream.close();
+			rfs = RemoteFileSystemFactory.getRemoteFileSystem(getFtpEpr(), true);
+			rfs.uploadFile(tmpFile, getFileName(message));
+		} catch (RemoteFileSystemException e) {
+			throw new NotificationException("Could not complete FTP notification", e);
+		} catch (IOException e) {
+			throw new NotificationException("Could not complete FTP notification", e);
+		} finally {
+			if (stream != null) {
+				IOUtils.closeQuietly(stream);
+			}
+			if (tmpFile != null) {
+				tmpFile.delete();
+			}
+			if (rfs != null) {
+				rfs.quit();
+			}
+		}
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,242 +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.notification;
-
-import java.io.File;
-import java.io.FileOutputStream;
-import java.io.ObjectOutputStream;
-import java.net.URI;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageType;
-
-/**
- * Write the notification contents into a list of files specified in the
- * constructor time parameters.
- * <p>
- * Description: The constructor searches for all child elements of the
- * ConfigTree argument having "file" as element name, that will be used to store
- * (or append) the contents of the argument to the sendNotification(Object)
- * method, to each and every one of the files contained in the list
- * </p>
- * <p>
- * Author: Heuristica - Buenos Aires - Argentina
- * </p>
- * 
- * @version 1.0
- */
-public class NotifyFiles extends NotificationTarget
-{
-	/**
-	 * Mnemonic for the child element name that hold the files to write ("file")
-	 */
-	public static final String CHILD_FILE = "file";
-
-	/**
-	 * Attribute name that will be interpreted as the URI of the file to write
-	 * to
-	 */
-	public static final String ATT_URI = "URI";
-
-	/**
-	 * Attribute name of indicator to append to an existing file
-	 * 
-	 * @see Boolean#valueOf(String)
-	 */
-	public static final String ATT_APPEND = "append";
-
-	/**
-	 * The NotificationFile[] that holds the output file list.
-	 */
-	protected NotificationFile[] m_oaOutF;
-
-	/**
-	 * Instantiate a NotifyFiles object according to contents of &lt;arg 1&gt;
-	 * 
-	 * @param p_oP
-	 *            ConfigTree - Should contain a nonempty set of child elements
-	 *            with elementName="file". Each child element must have a "URI"
-	 *            attribute and optionally a "append" element
-	 */
-	public NotifyFiles (ConfigTree p_oP)
-	{
-		super(p_oP);
-		setFiles(p_oP.getChildren(CHILD_FILE));
-
-	} // __________________________________
-
-	/**
-	 * Sets the value of m_oaOutF[] and m_baAppend[] to contents of each element
-	 * of the input argument
-	 * 
-	 * @param p_oaP
-	 *            ConfigTree[] - Each entry must have a "URI" attribute, and can
-	 *            have an optional "append" attribute
-	 * @see ConfigTree#getAttribute(String)
-	 */
-	protected void setFiles (ConfigTree[] p_oaP)
-	{
-		m_oaOutF = new NotificationFile[p_oaP.length];
-
-		for (int i = 0; i < p_oaP.length; i++)
-		{
-			String fileURI = p_oaP[i].getAttribute(ATT_URI);
-			String append = p_oaP[i].getAttribute(ATT_APPEND);
-
-			if (null == fileURI)
-			{
-				throw new IllegalArgumentException(
-						"Bad File Notification Configuration: Missing file URI attribute.");
-			}
-
-			try
-			{
-				m_oaOutF[i] = new NotificationFile(new URI(fileURI), Boolean
-						.valueOf(append));
-			}
-			catch (Exception e)
-			{
-				m_oaOutF[i] = new NotificationFile(fileURI, Boolean
-						.valueOf(append));
-			}
-
-			// Make sure the parent folder exists...
-			File parent = m_oaOutF[i].getAbsoluteFile().getParentFile();
-			if (null == parent || !parent.exists())
-			{
-				throw new IllegalArgumentException(
-						"Bad File Notification Configuration: Parent folder for file [" + m_oaOutF[i]
-								.getAbsolutePath() + "] doesn't exist.");
-			}
-		}
-	} // __________________________________
-
-	/**
-	 * Writes the result of p_o into each one of the File objects contained in
-	 * the m_oaOutF array
-	 * 
-	 * @param message
-	 *            Object - This object's toString() results will be written to
-	 *            (appended to) each one of the files in m_oaOutF
-	 * @see NotifyFiles#setFiles(ConfigTree[])
-	 * @see NotifyFiles#m_oaOutF
-	 */
-	public void sendNotification (Message message) throws NotificationException
-	{
-		FileOutputStream fileOutStream = null;
-        
-		for (NotificationFile notificationFile : m_oaOutF)
-		{
-			try
-			{
-				fileOutStream = new FileOutputStream(notificationFile,
-						notificationFile.append);
-				if (MessageType.JAVA_SERIALIZED.equals(message.getType()))
-				{
-                    objectNotification(fileOutStream, message.getBody().getByteArray());
-				}
-				else
-				{
-                    String content=null;
-                    if (message.getBody().getByteArray()!=null) {
-                        content = new String(message.getBody().getByteArray());
-                    }
-                    stringNotification(fileOutStream, content);
-				}
-			}
-			catch (Exception e)
-			{ /* We do nothing here for the time being */
-			} 
-			finally
-			{
-				try
-				{
-					fileOutStream.close();
-				}
-				catch (Exception eCl)
-				{
-					/*
-					 * Unable to Close - What could we do
-					 */
-				}
-			}
-		}
-	} // __________________________________
-
-	private void stringNotification (FileOutputStream p_oF, String p_s)
-	{
-		try
-		{
-			p_oF.write(p_s.getBytes());
-			
-			if (!p_s.endsWith("\n")) 
-				p_oF.write("\n".getBytes());
-		}
-		catch (Exception e)
-		{ /* We do nothing here for the time being */
-		}
-	} // __________________________________
-
-	private void objectNotification (FileOutputStream p_oF, Object p_o)
-	{
-		try
-		{
-			ObjectOutputStream OS = new ObjectOutputStream(p_oF);
-			OS.writeObject(p_o);
-		}
-		catch (Exception e)
-		{ 
-			/* We do nothing here for the time being */
-		}
-	} // __________________________________
-
-	/**
-	 * Notification File. <p/> Simply adds the "append" property to the file.
-	 * 
-	 * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
-	 */
-	private class NotificationFile extends File
-	{
-
-		private static final long serialVersionUID = 1L;
-
-		private boolean append = false;
-
-		private NotificationFile (URI fileURI, boolean append)
-		{
-			super(fileURI);
-			this.append = append;
-		}
-
-		/**
-		 * @param file
-		 * @param append2
-		 */
-		public NotificationFile (String file, boolean append)
-		{
-			super(file);
-			this.append = append;
-		}
-	}
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyFiles.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,242 @@
+/*
+ * 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.notification;
+
+import java.io.File;
+import java.io.FileOutputStream;
+import java.io.ObjectOutputStream;
+import java.net.URI;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageType;
+
+/**
+ * Write the notification contents into a list of files specified in the
+ * constructor time parameters.
+ * <p>
+ * Description: The constructor searches for all child elements of the
+ * ConfigTree argument having "file" as element name, that will be used to store
+ * (or append) the contents of the argument to the sendNotification(Object)
+ * method, to each and every one of the files contained in the list
+ * </p>
+ * <p>
+ * Author: Heuristica - Buenos Aires - Argentina
+ * </p>
+ * 
+ * @version 1.0
+ */
+public class NotifyFiles extends NotificationTarget
+{
+	/**
+	 * Mnemonic for the child element name that hold the files to write ("file")
+	 */
+	public static final String CHILD_FILE = "file";
+
+	/**
+	 * Attribute name that will be interpreted as the URI of the file to write
+	 * to
+	 */
+	public static final String ATT_URI = "URI";
+
+	/**
+	 * Attribute name of indicator to append to an existing file
+	 * 
+	 * @see Boolean#valueOf(String)
+	 */
+	public static final String ATT_APPEND = "append";
+
+	/**
+	 * The NotificationFile[] that holds the output file list.
+	 */
+	protected NotificationFile[] m_oaOutF;
+
+	/**
+	 * Instantiate a NotifyFiles object according to contents of &lt;arg 1&gt;
+	 * 
+	 * @param p_oP
+	 *            ConfigTree - Should contain a nonempty set of child elements
+	 *            with elementName="file". Each child element must have a "URI"
+	 *            attribute and optionally a "append" element
+	 */
+	public NotifyFiles (ConfigTree p_oP)
+	{
+		super(p_oP);
+		setFiles(p_oP.getChildren(CHILD_FILE));
+
+	} // __________________________________
+
+	/**
+	 * Sets the value of m_oaOutF[] and m_baAppend[] to contents of each element
+	 * of the input argument
+	 * 
+	 * @param p_oaP
+	 *            ConfigTree[] - Each entry must have a "URI" attribute, and can
+	 *            have an optional "append" attribute
+	 * @see ConfigTree#getAttribute(String)
+	 */
+	protected void setFiles (ConfigTree[] p_oaP)
+	{
+		m_oaOutF = new NotificationFile[p_oaP.length];
+
+		for (int i = 0; i < p_oaP.length; i++)
+		{
+			String fileURI = p_oaP[i].getAttribute(ATT_URI);
+			String append = p_oaP[i].getAttribute(ATT_APPEND);
+
+			if (null == fileURI)
+			{
+				throw new IllegalArgumentException(
+						"Bad File Notification Configuration: Missing file URI attribute.");
+			}
+
+			try
+			{
+				m_oaOutF[i] = new NotificationFile(new URI(fileURI), Boolean
+						.valueOf(append));
+			}
+			catch (Exception e)
+			{
+				m_oaOutF[i] = new NotificationFile(fileURI, Boolean
+						.valueOf(append));
+			}
+
+			// Make sure the parent folder exists...
+			File parent = m_oaOutF[i].getAbsoluteFile().getParentFile();
+			if (null == parent || !parent.exists())
+			{
+				throw new IllegalArgumentException(
+						"Bad File Notification Configuration: Parent folder for file [" + m_oaOutF[i]
+								.getAbsolutePath() + "] doesn't exist.");
+			}
+		}
+	} // __________________________________
+
+	/**
+	 * Writes the result of p_o into each one of the File objects contained in
+	 * the m_oaOutF array
+	 * 
+	 * @param message
+	 *            Object - This object's toString() results will be written to
+	 *            (appended to) each one of the files in m_oaOutF
+	 * @see NotifyFiles#setFiles(ConfigTree[])
+	 * @see NotifyFiles#m_oaOutF
+	 */
+	public void sendNotification (Message message) throws NotificationException
+	{
+		FileOutputStream fileOutStream = null;
+        
+		for (NotificationFile notificationFile : m_oaOutF)
+		{
+			try
+			{
+				fileOutStream = new FileOutputStream(notificationFile,
+						notificationFile.append);
+				if (MessageType.JAVA_SERIALIZED.equals(message.getType()))
+				{
+                    objectNotification(fileOutStream, message.getBody().getByteArray());
+				}
+				else
+				{
+                    String content=null;
+                    if (message.getBody().getByteArray()!=null) {
+                        content = new String(message.getBody().getByteArray());
+                    }
+                    stringNotification(fileOutStream, content);
+				}
+			}
+			catch (Exception e)
+			{ /* We do nothing here for the time being */
+			} 
+			finally
+			{
+				try
+				{
+					fileOutStream.close();
+				}
+				catch (Exception eCl)
+				{
+					/*
+					 * Unable to Close - What could we do
+					 */
+				}
+			}
+		}
+	} // __________________________________
+
+	private void stringNotification (FileOutputStream p_oF, String p_s)
+	{
+		try
+		{
+			p_oF.write(p_s.getBytes());
+			
+			if (!p_s.endsWith("\n")) 
+				p_oF.write("\n".getBytes());
+		}
+		catch (Exception e)
+		{ /* We do nothing here for the time being */
+		}
+	} // __________________________________
+
+	private void objectNotification (FileOutputStream p_oF, Object p_o)
+	{
+		try
+		{
+			ObjectOutputStream OS = new ObjectOutputStream(p_oF);
+			OS.writeObject(p_o);
+		}
+		catch (Exception e)
+		{ 
+			/* We do nothing here for the time being */
+		}
+	} // __________________________________
+
+	/**
+	 * Notification File. <p/> Simply adds the "append" property to the file.
+	 * 
+	 * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+	 */
+	private class NotificationFile extends File
+	{
+
+		private static final long serialVersionUID = 1L;
+
+		private boolean append = false;
+
+		private NotificationFile (URI fileURI, boolean append)
+		{
+			super(fileURI);
+			this.append = append;
+		}
+
+		/**
+		 * @param file
+		 * @param append2
+		 */
+		public NotificationFile (String file, boolean append)
+		{
+			super(file);
+			this.append = append;
+		}
+	}
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,208 +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.notification;
-
-import java.util.Iterator;
-import java.util.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.format.MessageType;
-
-/**
- * Abstract class that defines the behaviour of NotifyQueues and NotifyTopics
- * (and in fact any other javax.jms.Destination object), and provides common
- * methods to derived classes
- * <p>
- * Description:
- * </p>
- * <p>
- * Author: Heuristica - Buenos Aires - Argentina
- * </p>
- * 
- * @version 1.0
- */
-public abstract class NotifyJMS extends NotificationTarget
-{
-    protected Logger log = Logger.getLogger(this.getClass());
-	/**
-	 * Abstract method - All classes that extend NotifyJMS must implement it
-	 * according to their own javax.jms.Destination needs (Queue/Topic)
-	 * 
-	 * @param p_oMsg
-	 *            Message
-	 */
-	protected abstract void sendToAll (Message p_oMsg);
-
-	/**
-	 * Element name mnemonic to search for child elements in the ConfigTree at
-	 * constructor time, that will hold a "name" "value" pair to be included in
-	 * the JMS message header
-	 */
-	public static final String CHILD_MSG_PROP = "messageProp";
-
-	/**
-	 * Attribute name mnemonic for the name of the message property to fill with
-	 * contents of the "value" aattribute
-	 */
-	public static final String ATT_PROP_NAME = "name";
-
-	/**
-	 * Attribute name mnemonic for the value to assign to the corresponding
-	 * message property
-	 */
-	public static final String ATT_PROP_VALUE = "value";
-
-	/**
-	 * Attribute name mnemonic for the att that will hold the JNDI name of the
-	 * destination javax.jms.Destination object
-	 */
-	public static final String ATT_DEST_NAME = "jndiName";
-
-	/**
-	 * This object holds the JNDI naming context that will be used to obtain a
-	 * JMS destination (javax.jms.Destination) to send/publish the notification
-	 * at sendNotification() time
-	 */
-	protected Context[] m_oCtx;
-
-	private Properties m_oProps = new Properties();
-
-	/**
-	 * The javax.jms.Connection instance used to talk to JMS
-	 */
-	protected JmsConnectionPool[] mPool;
-
-	/**
-	 * The javax.jms.Session instance used to talk to JMS
-	 */
-	protected Session[] m_oSess;
-
-	/**
-	 * Array with an instance of javax.jms.MessageProducer on each entry that
-	 * will be used to send the notification at sendNotification() time
-	 */
-	protected MessageProducer[] m_oaMssProd;
-
-	/**
-	 * Constructor that will be called by child classes to perform
-	 * initialization tasks that are common to all derived classes
-	 * 
-	 * @param p_oP
-	 *            ConfigTree
-	 *            <p>
-	 *            Will contain a variable number of "messageProp" child elements
-	 *            that will be added to messages sent to
-	 *            </p>
-	 * @throws ConfigurationException
-	 */
-	protected NotifyJMS (ConfigTree p_oP) throws ConfigurationException
-	{
-		super(p_oP);
-
-		ConfigTree[] oaMsgP = p_oP.getChildren(CHILD_MSG_PROP);
-		for (int i1 = 0; i1 < oaMsgP.length; i1++)
-		{
-			String sKey = oaMsgP[i1].getAttribute(ATT_PROP_NAME);
-			if (null == sKey) continue;
-			String sVal = oaMsgP[i1].getAttribute(ATT_PROP_VALUE);
-			if (null == sVal) continue;
-
-			m_oProps.setProperty(sKey.trim(), sVal);
-		}
-	} // __________________________________
-
-	/**
-	 * Performs an orderly release of all JMS resources utilized - Well behaved
-	 * developers should always call this method before unreferencing this
-	 * object
-	 */
-	public void release ()
-	{
-        for (int i=0; i<mPool.length; i++) {
-        	mPool[i].closeSession(m_oSess[i]);
-            if (m_oCtx[i]!=null) {
-                try {
-                    m_oCtx[i].close();
-                } catch (NamingException ne) {
-                    log.error(ne.getMessage(), ne);
-                }
-            }
-        }
-	}
-
-	/**
-	 * Send a JMS message using p_o to fill in the message content and the list
-	 * of message properties that will be added to the JMS message header fields
-	 * 
-	 * @param message
-	 *            Object - This object or thie object's toString() method will
-	 *            supply contents of JMS message
-	 * @see NotifyJMS#CHILD_MSG_PROP
-	 */
-	public void sendNotification (org.jboss.soa.esb.message.Message message) throws NotificationException
-	{
-		try
-		{
-			Message oMsg = null;
-	
-			if (MessageType.JAVA_SERIALIZED.equals(message.getType()))
-			{
-				oMsg = m_oSess[0].createObjectMessage(message.getBody().getByteArray());
-			}
-			else
-			{
-                String content=null;
-                if (message.getBody().getByteArray()!=null) {
-                    content = new String(message.getBody().getByteArray());
-                }
-				oMsg = m_oSess[0].createTextMessage(content);
-			}
-            if (message.getBody().get("MessageId")!=null) {
-                oMsg.setJMSCorrelationID((String)message.getBody().get("MessageId"));
-            }
-	
-			for (Iterator II = m_oProps.keySet().iterator(); II.hasNext();)
-			{
-				String sKey = (String) II.next();
-				String sVal = m_oProps.getProperty(sKey);
-				oMsg.setStringProperty(sKey, sVal);
-			}
-			sendToAll(oMsg);
-		}
-		catch (JMSException ex)
-		{
-			throw new NotificationException(ex);
-		}
-	} // __________________________________
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyJMS.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,208 @@
+/*
+ * 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.notification;
+
+import java.util.Iterator;
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.format.MessageType;
+
+/**
+ * Abstract class that defines the behaviour of NotifyQueues and NotifyTopics
+ * (and in fact any other javax.jms.Destination object), and provides common
+ * methods to derived classes
+ * <p>
+ * Description:
+ * </p>
+ * <p>
+ * Author: Heuristica - Buenos Aires - Argentina
+ * </p>
+ * 
+ * @version 1.0
+ */
+public abstract class NotifyJMS extends NotificationTarget
+{
+    protected Logger log = Logger.getLogger(this.getClass());
+	/**
+	 * Abstract method - All classes that extend NotifyJMS must implement it
+	 * according to their own javax.jms.Destination needs (Queue/Topic)
+	 * 
+	 * @param p_oMsg
+	 *            Message
+	 */
+	protected abstract void sendToAll (Message p_oMsg);
+
+	/**
+	 * Element name mnemonic to search for child elements in the ConfigTree at
+	 * constructor time, that will hold a "name" "value" pair to be included in
+	 * the JMS message header
+	 */
+	public static final String CHILD_MSG_PROP = "messageProp";
+
+	/**
+	 * Attribute name mnemonic for the name of the message property to fill with
+	 * contents of the "value" aattribute
+	 */
+	public static final String ATT_PROP_NAME = "name";
+
+	/**
+	 * Attribute name mnemonic for the value to assign to the corresponding
+	 * message property
+	 */
+	public static final String ATT_PROP_VALUE = "value";
+
+	/**
+	 * Attribute name mnemonic for the att that will hold the JNDI name of the
+	 * destination javax.jms.Destination object
+	 */
+	public static final String ATT_DEST_NAME = "jndiName";
+
+	/**
+	 * This object holds the JNDI naming context that will be used to obtain a
+	 * JMS destination (javax.jms.Destination) to send/publish the notification
+	 * at sendNotification() time
+	 */
+	protected Context[] m_oCtx;
+
+	private Properties m_oProps = new Properties();
+
+	/**
+	 * The javax.jms.Connection instance used to talk to JMS
+	 */
+	protected JmsConnectionPool[] mPool;
+
+	/**
+	 * The javax.jms.Session instance used to talk to JMS
+	 */
+	protected Session[] m_oSess;
+
+	/**
+	 * Array with an instance of javax.jms.MessageProducer on each entry that
+	 * will be used to send the notification at sendNotification() time
+	 */
+	protected MessageProducer[] m_oaMssProd;
+
+	/**
+	 * Constructor that will be called by child classes to perform
+	 * initialization tasks that are common to all derived classes
+	 * 
+	 * @param p_oP
+	 *            ConfigTree
+	 *            <p>
+	 *            Will contain a variable number of "messageProp" child elements
+	 *            that will be added to messages sent to
+	 *            </p>
+	 * @throws ConfigurationException
+	 */
+	protected NotifyJMS (ConfigTree p_oP) throws ConfigurationException
+	{
+		super(p_oP);
+
+		ConfigTree[] oaMsgP = p_oP.getChildren(CHILD_MSG_PROP);
+		for (int i1 = 0; i1 < oaMsgP.length; i1++)
+		{
+			String sKey = oaMsgP[i1].getAttribute(ATT_PROP_NAME);
+			if (null == sKey) continue;
+			String sVal = oaMsgP[i1].getAttribute(ATT_PROP_VALUE);
+			if (null == sVal) continue;
+
+			m_oProps.setProperty(sKey.trim(), sVal);
+		}
+	} // __________________________________
+
+	/**
+	 * Performs an orderly release of all JMS resources utilized - Well behaved
+	 * developers should always call this method before unreferencing this
+	 * object
+	 */
+	public void release ()
+	{
+        for (int i=0; i<mPool.length; i++) {
+        	mPool[i].closeSession(m_oSess[i]);
+            if (m_oCtx[i]!=null) {
+                try {
+                    m_oCtx[i].close();
+                } catch (NamingException ne) {
+                    log.error(ne.getMessage(), ne);
+                }
+            }
+        }
+	}
+
+	/**
+	 * Send a JMS message using p_o to fill in the message content and the list
+	 * of message properties that will be added to the JMS message header fields
+	 * 
+	 * @param message
+	 *            Object - This object or thie object's toString() method will
+	 *            supply contents of JMS message
+	 * @see NotifyJMS#CHILD_MSG_PROP
+	 */
+	public void sendNotification (org.jboss.soa.esb.message.Message message) throws NotificationException
+	{
+		try
+		{
+			Message oMsg = null;
+	
+			if (MessageType.JAVA_SERIALIZED.equals(message.getType()))
+			{
+				oMsg = m_oSess[0].createObjectMessage(message.getBody().getByteArray());
+			}
+			else
+			{
+                String content=null;
+                if (message.getBody().getByteArray()!=null) {
+                    content = new String(message.getBody().getByteArray());
+                }
+				oMsg = m_oSess[0].createTextMessage(content);
+			}
+            if (message.getBody().get("MessageId")!=null) {
+                oMsg.setJMSCorrelationID((String)message.getBody().get("MessageId"));
+            }
+	
+			for (Iterator II = m_oProps.keySet().iterator(); II.hasNext();)
+			{
+				String sKey = (String) II.next();
+				String sVal = m_oProps.getProperty(sKey);
+				oMsg.setStringProperty(sKey, sVal);
+			}
+			sendToAll(oMsg);
+		}
+		catch (JMSException ex)
+		{
+			throw new NotificationException(ex);
+		}
+	} // __________________________________
+
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyQueues.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyQueues.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyQueues.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,162 +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.notification;
-
-import java.util.List;
-import java.util.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.Queue;
-import javax.jms.QueueSender;
-import javax.jms.QueueSession;
-import javax.jms.Session;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
-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.KeyValuePair;
-import org.jboss.soa.esb.helpers.NamingContext;
-
-;
-
-/**
- * This class that implements abstract methods defined in it's superclass
- * <p>
- * Description:
- * </p>
- * <p>
- * Author: Heuristica - Buenos Aires - Argentina
- * </p>
- * KS: It is silly we open and close the jms connection with eash request.
- * 
- * @version 1.0
- */
-public class NotifyQueues extends NotifyJMS
-{
-	/**
-	 * Connection Factory JNDI name.
-	 */
-	public static final String CONNECTION_FACTORY = "ConnectionFactory";
-
-	/**
-	 * Element name mnemonic to search for child elements in the ConfigTree at
-	 * constructor time, that will hold a "jndiName" attribute specifying the
-	 * value to look up in the JNDI context in order to obtain a queue
-	 * 
-	 * @see NotifyJMS#ATT_DEST_NAME
-	 */
-	public static final String CHILD_QUEUE = "queue";
-
-	public NotifyQueues (ConfigTree p_oP) throws ConfigurationException, JMSException, ConnectionException
-	{
-		super(p_oP);
-		setQueues(p_oP.getChildren(CHILD_QUEUE));
-	} // __________________________________
-
-	protected void setQueues (ConfigTree[] p_oaP) throws ConfigurationException, JMSException, ConnectionException
-	{
-		try
-		{
-            
-			m_oaMssProd = new MessageProducer[p_oaP.length];
-            mPool = new JmsConnectionPool[p_oaP.length];
-            m_oCtx = new Context[p_oaP.length];
-            m_oSess = new Session[p_oaP.length];
-            
-			for (int i = 0; i < p_oaP.length; i++)
-			{
-				String sAtt = p_oaP[i].getAttribute(ATT_DEST_NAME);
-				if (null == sAtt) 
-					throw new ConfigurationException("Missing queue jndiName");
-                
-                Properties environment = new Properties();
-                
-                String jndiURL = p_oaP[i].getAttribute(JMSEpr.JNDI_URL_TAG);
-                if (jndiURL!=null) environment.setProperty(Context.PROVIDER_URL, jndiURL);
-                String contextFactory = p_oaP[i].getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG);
-                if (contextFactory!=null) environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
-                String prefix = p_oaP[i].getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG);
-                if (prefix!=null) environment.setProperty(Context.URL_PKG_PREFIXES, prefix);
-                List<KeyValuePair> properties=p_oaP[i].childPropertyList();
-                for (KeyValuePair property : properties) {
-                    if (property.getKey().startsWith("java.naming.")) {
-                        environment.setProperty(property.getKey(), property.getValue());  
-                    }
-                }
-                
-                String connectionFactory = p_oaP[i].getAttribute(JMSEpr.CONNECTION_FACTORY_TAG);
-                if (connectionFactory==null) {
-                    connectionFactory = CONNECTION_FACTORY;
-                }
-                mPool[i] = JmsConnectionPoolContainer.getPool(environment, connectionFactory, JMSEpr.QUEUE_TYPE);
-                m_oCtx[i] = NamingContext.getServerContext(environment);
-                Queue oQ=null;
-                QueueSession queueSession = mPool[i].getQueueSession();
-                try {
-				    oQ = (Queue) m_oCtx[i].lookup(sAtt);
-                } catch (NamingException ne) {
-                    try {
-                        m_oCtx[i] = NamingContext.getFreshServerContext(environment);
-                        oQ = (Queue) m_oCtx[i].lookup(sAtt);
-                    } catch (NamingException nex) {
-                        //ActiveMQ
-                        oQ = queueSession.createQueue(sAtt);
-                    }
-                }
-				m_oaMssProd[i] = queueSession.createSender(oQ);
-                m_oSess[i] = queueSession;
-			}
-		}
-		catch (NamingException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-	}
-	/**
-	 * Send a message to all the configured queues.
-	 */
-	protected void sendToAll (Message p_oMsg)
-	{
-		for (int i1 = 0; i1 < m_oaMssProd.length; i1++)
-		{
-			QueueSender oCurr = (QueueSender) m_oaMssProd[i1];
-			try
-			{
-				oCurr.send(p_oMsg);
-			}
-			catch (Exception e)
-			{
-				log.error("Could not send message " + p_oMsg, e);
-			}
-		}
-		release();
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyQueues.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyQueues.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyQueues.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyQueues.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,162 @@
+/*
+ * 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.notification;
+
+import java.util.List;
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+import javax.jms.Queue;
+import javax.jms.QueueSender;
+import javax.jms.QueueSession;
+import javax.jms.Session;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
+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.KeyValuePair;
+import org.jboss.soa.esb.helpers.NamingContext;
+
+;
+
+/**
+ * This class that implements abstract methods defined in it's superclass
+ * <p>
+ * Description:
+ * </p>
+ * <p>
+ * Author: Heuristica - Buenos Aires - Argentina
+ * </p>
+ * KS: It is silly we open and close the jms connection with eash request.
+ * 
+ * @version 1.0
+ */
+public class NotifyQueues extends NotifyJMS
+{
+	/**
+	 * Connection Factory JNDI name.
+	 */
+	public static final String CONNECTION_FACTORY = "ConnectionFactory";
+
+	/**
+	 * Element name mnemonic to search for child elements in the ConfigTree at
+	 * constructor time, that will hold a "jndiName" attribute specifying the
+	 * value to look up in the JNDI context in order to obtain a queue
+	 * 
+	 * @see NotifyJMS#ATT_DEST_NAME
+	 */
+	public static final String CHILD_QUEUE = "queue";
+
+	public NotifyQueues (ConfigTree p_oP) throws ConfigurationException, JMSException, ConnectionException
+	{
+		super(p_oP);
+		setQueues(p_oP.getChildren(CHILD_QUEUE));
+	} // __________________________________
+
+	protected void setQueues (ConfigTree[] p_oaP) throws ConfigurationException, JMSException, ConnectionException
+	{
+		try
+		{
+            
+			m_oaMssProd = new MessageProducer[p_oaP.length];
+            mPool = new JmsConnectionPool[p_oaP.length];
+            m_oCtx = new Context[p_oaP.length];
+            m_oSess = new Session[p_oaP.length];
+            
+			for (int i = 0; i < p_oaP.length; i++)
+			{
+				String sAtt = p_oaP[i].getAttribute(ATT_DEST_NAME);
+				if (null == sAtt) 
+					throw new ConfigurationException("Missing queue jndiName");
+                
+                Properties environment = new Properties();
+                
+                String jndiURL = p_oaP[i].getAttribute(JMSEpr.JNDI_URL_TAG);
+                if (jndiURL!=null) environment.setProperty(Context.PROVIDER_URL, jndiURL);
+                String contextFactory = p_oaP[i].getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG);
+                if (contextFactory!=null) environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
+                String prefix = p_oaP[i].getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG);
+                if (prefix!=null) environment.setProperty(Context.URL_PKG_PREFIXES, prefix);
+                List<KeyValuePair> properties=p_oaP[i].childPropertyList();
+                for (KeyValuePair property : properties) {
+                    if (property.getKey().startsWith("java.naming.")) {
+                        environment.setProperty(property.getKey(), property.getValue());  
+                    }
+                }
+                
+                String connectionFactory = p_oaP[i].getAttribute(JMSEpr.CONNECTION_FACTORY_TAG);
+                if (connectionFactory==null) {
+                    connectionFactory = CONNECTION_FACTORY;
+                }
+                mPool[i] = JmsConnectionPoolContainer.getPool(environment, connectionFactory, JMSEpr.QUEUE_TYPE);
+                m_oCtx[i] = NamingContext.getServerContext(environment);
+                Queue oQ=null;
+                QueueSession queueSession = mPool[i].getQueueSession();
+                try {
+				    oQ = (Queue) m_oCtx[i].lookup(sAtt);
+                } catch (NamingException ne) {
+                    try {
+                        m_oCtx[i] = NamingContext.getFreshServerContext(environment);
+                        oQ = (Queue) m_oCtx[i].lookup(sAtt);
+                    } catch (NamingException nex) {
+                        //ActiveMQ
+                        oQ = queueSession.createQueue(sAtt);
+                    }
+                }
+				m_oaMssProd[i] = queueSession.createSender(oQ);
+                m_oSess[i] = queueSession;
+			}
+		}
+		catch (NamingException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+	}
+	/**
+	 * Send a message to all the configured queues.
+	 */
+	protected void sendToAll (Message p_oMsg)
+	{
+		for (int i1 = 0; i1 < m_oaMssProd.length; i1++)
+		{
+			QueueSender oCurr = (QueueSender) m_oaMssProd[i1];
+			try
+			{
+				oCurr.send(p_oMsg);
+			}
+			catch (Exception e)
+			{
+				log.error("Could not send message " + p_oMsg, e);
+			}
+		}
+		release();
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,152 +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.notification;
-
-import java.sql.PreparedStatement;
-import java.util.Properties;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
-import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
-import org.jboss.soa.esb.message.Message;
-
-public class NotifySqlTable extends NotificationTarget
-{
-	public static final String CHILD_COLUMN = "column";
-
-	public static final String ATT_TABLE = "table";
-
-	public static final String ATT_DATA = "dataColumn";
-
-	public static final String ATT_NAME = "name";
-
-	public static final String ATT_VALUE = "value";
-
-	protected String m_sDriver, m_sURL, m_sUser, m_sPwd, m_sTable, m_sDataCol;
-
-	protected Properties m_oCols;
-
-	public NotifySqlTable (ConfigTree p_oP) throws ConfigurationException
-	{
-		super(p_oP);
-		m_sDriver = getAttr(SimpleDataSource.DRIVER);
-		m_sURL = getAttr(SimpleDataSource.URL);
-		m_sUser = getAttr(SimpleDataSource.USER);
-		m_sPwd = getAttr(SimpleDataSource.PASSWORD);
-		m_sTable = getAttr(ATT_TABLE);
-		m_sDataCol = getAttr(ATT_DATA);
-
-		m_oCols = new Properties();
-		ConfigTree[] oaP = p_oP.getChildren(CHILD_COLUMN);
-		for (int i1 = 0; i1 < oaP.length; i1++)
-		{
-			ConfigTree oCurr = oaP[i1];
-			String sCol = oCurr.getAttribute(ATT_NAME);
-			if (null == sCol)
-			{
-				continue;
-			}
-			sCol = sCol.trim();
-			if (sCol.length() < 1)
-			{
-				continue;
-			}
-			String sVal = oCurr.getAttribute(ATT_VALUE);
-			if (null == sVal)
-			{
-				sVal = "";
-			}
-			m_oCols.setProperty(sCol, sVal);
-		}
-	} // __________________________________
-
-	private String getAttr (String p_sAtt) throws ConfigurationException
-	{
-		String sRet = m_oParms.getAttribute(p_sAtt);
-		if (null == sRet)
-		{
-			throw new ConfigurationException("Missing " + p_sAtt + " attribute");
-		}
-		sRet = sRet.trim();
-		if (p_sAtt.equals(SimpleDataSource.PASSWORD))
-		{
-			return sRet;
-		}
-		if (sRet.length() < 1)
-		{
-			throw new ConfigurationException("Empty " + p_sAtt + " attribute");
-		}
-		return sRet;
-	} // __________________________________
-
-	public String getInsertStmt ()
-	{
-		String[] saCols = new String[m_oCols.size()];
-		m_oCols.keySet().toArray(saCols);
-
-		StringBuffer sbCol = new StringBuffer("insert into ").append(m_sTable)
-				.append(" ");
-		StringBuffer sbPrm = new StringBuffer(" values ");
-		for (int i1 = 0; i1 < saCols.length; i1++)
-		{
-			String sIn = (i1 == 0) ? "(" : ",";
-			String sCurrCol = saCols[i1];
-			sbCol.append(sIn).append("\"").append(sCurrCol).append("\"");
-			sbPrm.append(sIn).append("'").append(m_oCols.getProperty(sCurrCol))
-					.append("'");
-			// REVIEW: Does the value being inserted not need to be escaped e.g.
-			// what if it has a quote in its value??
-		}
-		return sbCol.append(")").append(sbPrm).append(")").toString();
-	} // __________________________________
-
-	public void sendNotification (Message message) throws NotificationException
-	{
-        String content=null;
-        if (message.getBody().getByteArray()!=null) {
-            content = new String(message.getBody().getByteArray());
-        }
-		m_oCols.setProperty(m_sDataCol, content);
-		JdbcCleanConn oConn = null;
-		try
-		{
-			oConn = new JdbcCleanConn(new SimpleDataSource(m_sDriver, m_sURL,
-					m_sUser, m_sPwd));
-			PreparedStatement PS = oConn.prepareStatement(getInsertStmt());
-			oConn.execUpdWait(PS, 3);
-			oConn.commit();
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace(System.err);
-		} finally
-		{
-			if (null != oConn)
-			{
-				oConn.release();
-			}
-		}
-	} // __________________________________
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifySqlTable.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,152 @@
+/*
+ * 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.notification;
+
+import java.sql.PreparedStatement;
+import java.util.Properties;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
+import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
+import org.jboss.soa.esb.message.Message;
+
+public class NotifySqlTable extends NotificationTarget
+{
+	public static final String CHILD_COLUMN = "column";
+
+	public static final String ATT_TABLE = "table";
+
+	public static final String ATT_DATA = "dataColumn";
+
+	public static final String ATT_NAME = "name";
+
+	public static final String ATT_VALUE = "value";
+
+	protected String m_sDriver, m_sURL, m_sUser, m_sPwd, m_sTable, m_sDataCol;
+
+	protected Properties m_oCols;
+
+	public NotifySqlTable (ConfigTree p_oP) throws ConfigurationException
+	{
+		super(p_oP);
+		m_sDriver = getAttr(SimpleDataSource.DRIVER);
+		m_sURL = getAttr(SimpleDataSource.URL);
+		m_sUser = getAttr(SimpleDataSource.USER);
+		m_sPwd = getAttr(SimpleDataSource.PASSWORD);
+		m_sTable = getAttr(ATT_TABLE);
+		m_sDataCol = getAttr(ATT_DATA);
+
+		m_oCols = new Properties();
+		ConfigTree[] oaP = p_oP.getChildren(CHILD_COLUMN);
+		for (int i1 = 0; i1 < oaP.length; i1++)
+		{
+			ConfigTree oCurr = oaP[i1];
+			String sCol = oCurr.getAttribute(ATT_NAME);
+			if (null == sCol)
+			{
+				continue;
+			}
+			sCol = sCol.trim();
+			if (sCol.length() < 1)
+			{
+				continue;
+			}
+			String sVal = oCurr.getAttribute(ATT_VALUE);
+			if (null == sVal)
+			{
+				sVal = "";
+			}
+			m_oCols.setProperty(sCol, sVal);
+		}
+	} // __________________________________
+
+	private String getAttr (String p_sAtt) throws ConfigurationException
+	{
+		String sRet = m_oParms.getAttribute(p_sAtt);
+		if (null == sRet)
+		{
+			throw new ConfigurationException("Missing " + p_sAtt + " attribute");
+		}
+		sRet = sRet.trim();
+		if (p_sAtt.equals(SimpleDataSource.PASSWORD))
+		{
+			return sRet;
+		}
+		if (sRet.length() < 1)
+		{
+			throw new ConfigurationException("Empty " + p_sAtt + " attribute");
+		}
+		return sRet;
+	} // __________________________________
+
+	public String getInsertStmt ()
+	{
+		String[] saCols = new String[m_oCols.size()];
+		m_oCols.keySet().toArray(saCols);
+
+		StringBuffer sbCol = new StringBuffer("insert into ").append(m_sTable)
+				.append(" ");
+		StringBuffer sbPrm = new StringBuffer(" values ");
+		for (int i1 = 0; i1 < saCols.length; i1++)
+		{
+			String sIn = (i1 == 0) ? "(" : ",";
+			String sCurrCol = saCols[i1];
+			sbCol.append(sIn).append("\"").append(sCurrCol).append("\"");
+			sbPrm.append(sIn).append("'").append(m_oCols.getProperty(sCurrCol))
+					.append("'");
+			// REVIEW: Does the value being inserted not need to be escaped e.g.
+			// what if it has a quote in its value??
+		}
+		return sbCol.append(")").append(sbPrm).append(")").toString();
+	} // __________________________________
+
+	public void sendNotification (Message message) throws NotificationException
+	{
+        String content=null;
+        if (message.getBody().getByteArray()!=null) {
+            content = new String(message.getBody().getByteArray());
+        }
+		m_oCols.setProperty(m_sDataCol, content);
+		JdbcCleanConn oConn = null;
+		try
+		{
+			oConn = new JdbcCleanConn(new SimpleDataSource(m_sDriver, m_sURL,
+					m_sUser, m_sPwd));
+			PreparedStatement PS = oConn.prepareStatement(getInsertStmt());
+			oConn.execUpdWait(PS, 3);
+			oConn.commit();
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace(System.err);
+		} finally
+		{
+			if (null != oConn)
+			{
+				oConn.release();
+			}
+		}
+	} // __________________________________
+
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyTopics.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyTopics.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyTopics.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,140 +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.notification;
-
-import java.util.List;
-import java.util.Properties;
-
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.MessageProducer;
-import javax.jms.Session;
-import javax.jms.Topic;
-import javax.jms.TopicPublisher;
-import javax.jms.TopicSession;
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
-import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
-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.KeyValuePair;
-import org.jboss.soa.esb.helpers.NamingContext;
-/**
- * 
- * KS: It is silly we open and close the jms connection with eash request.
- *
- */
-public class NotifyTopics extends NotifyJMS
-{
-	public static final String CONNECTION_FACTORY = "ConnectionFactory";
-
-	public static final String CHILD_TOPIC = "topic";
-
-	public NotifyTopics (ConfigTree p_oP) throws ConfigurationException, JMSException, ConnectionException
-	{
-		super(p_oP);
-
-		setTopics(p_oP.getChildren(CHILD_TOPIC));
-	} // __________________________________
-
-	protected void setTopics (ConfigTree[] p_oaP) throws ConfigurationException, JMSException, ConnectionException
-	{
-		// REVIEW: The connection factory name is hardcoded and is the same as
-		// that of the queue connection factory.
-		m_oaMssProd = new MessageProducer[p_oaP.length];
-        mPool = new JmsConnectionPool[p_oaP.length];
-        m_oCtx = new Context[p_oaP.length];
-        m_oSess = new Session[p_oaP.length];
-        
-		try
-		{
-			for (int i = 0; i < p_oaP.length; i++)
-			{
-                Properties environment = new Properties();
-				String sAtt = p_oaP[i].getAttribute(ATT_DEST_NAME);
-				if (null == sAtt) throw new ConfigurationException("Missing topic jndiName");
-                String jndiURL = p_oaP[i].getAttribute(JMSEpr.JNDI_URL_TAG);
-                if (jndiURL!=null) environment.setProperty(Context.PROVIDER_URL, jndiURL);
-                String contextFactory = p_oaP[i].getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG);
-                if (contextFactory!=null) environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
-                String prefix = p_oaP[i].getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG);
-                if (prefix!=null) environment.setProperty(Context.URL_PKG_PREFIXES, prefix);
-                List<KeyValuePair> properties=p_oaP[i].childPropertyList();
-                for (KeyValuePair property : properties) {
-                    if (property.getKey().startsWith("java.naming.")) {
-                        environment.setProperty(property.getKey(), property.getValue());  
-                    }
-                }
-                
-                String connectionFactory = p_oaP[i].getAttribute(JMSEpr.CONNECTION_FACTORY_TAG);
-                if (connectionFactory==null) {
-                    connectionFactory = CONNECTION_FACTORY;
-                }
-                mPool[i] = JmsConnectionPoolContainer.getPool(environment, connectionFactory, JMSEpr.TOPIC_TYPE);
-                TopicSession topicSession = mPool[i].getTopicSession();
-                m_oCtx[i] = NamingContext.getServerContext(environment);
-                Topic oT=null;
-                try {
-                    oT = (Topic) m_oCtx[i].lookup(sAtt);
-                } catch (NamingException ne) {
-                    m_oCtx[i] = NamingContext.getFreshServerContext(environment);
-                    try {
-                        oT = (Topic) m_oCtx[i].lookup(sAtt);
-                    } catch (NamingException nex) {
-                        //ActiveMQ
-                        topicSession.createTopic(sAtt);
-                    }
-                }
-				m_oaMssProd[i] = topicSession.createPublisher(oT);
-                m_oSess[i] = topicSession;
-			}
-		}
-		catch (NamingException ex)
-		{
-			throw new ConfigurationException(ex);
-		}
-	}
-
-	protected void sendToAll (Message p_oMsg)
-	{
-		for (int i1 = 0; i1 < m_oaMssProd.length; i1++)
-		{
-			TopicPublisher oCurr = (TopicPublisher) m_oaMssProd[i1];
-			
-			try
-			{
-				oCurr.publish(p_oMsg);
-			}
-			catch (Exception e)
-			{
-                log.error(e.getMessage(), e);
-			}
-		}
-		release();
-	} // __________________________________
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyTopics.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyTopics.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyTopics.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyTopics.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,140 @@
+/*
+ * 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.notification;
+
+import java.util.List;
+import java.util.Properties;
+
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.MessageProducer;
+import javax.jms.Session;
+import javax.jms.Topic;
+import javax.jms.TopicPublisher;
+import javax.jms.TopicSession;
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import org.jboss.internal.soa.esb.rosetta.pooling.ConnectionException;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPool;
+import org.jboss.internal.soa.esb.rosetta.pooling.JmsConnectionPoolContainer;
+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.KeyValuePair;
+import org.jboss.soa.esb.helpers.NamingContext;
+/**
+ * 
+ * KS: It is silly we open and close the jms connection with eash request.
+ *
+ */
+public class NotifyTopics extends NotifyJMS
+{
+	public static final String CONNECTION_FACTORY = "ConnectionFactory";
+
+	public static final String CHILD_TOPIC = "topic";
+
+	public NotifyTopics (ConfigTree p_oP) throws ConfigurationException, JMSException, ConnectionException
+	{
+		super(p_oP);
+
+		setTopics(p_oP.getChildren(CHILD_TOPIC));
+	} // __________________________________
+
+	protected void setTopics (ConfigTree[] p_oaP) throws ConfigurationException, JMSException, ConnectionException
+	{
+		// REVIEW: The connection factory name is hardcoded and is the same as
+		// that of the queue connection factory.
+		m_oaMssProd = new MessageProducer[p_oaP.length];
+        mPool = new JmsConnectionPool[p_oaP.length];
+        m_oCtx = new Context[p_oaP.length];
+        m_oSess = new Session[p_oaP.length];
+        
+		try
+		{
+			for (int i = 0; i < p_oaP.length; i++)
+			{
+                Properties environment = new Properties();
+				String sAtt = p_oaP[i].getAttribute(ATT_DEST_NAME);
+				if (null == sAtt) throw new ConfigurationException("Missing topic jndiName");
+                String jndiURL = p_oaP[i].getAttribute(JMSEpr.JNDI_URL_TAG);
+                if (jndiURL!=null) environment.setProperty(Context.PROVIDER_URL, jndiURL);
+                String contextFactory = p_oaP[i].getAttribute(JMSEpr.JNDI_CONTEXT_FACTORY_TAG);
+                if (contextFactory!=null) environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, contextFactory);
+                String prefix = p_oaP[i].getAttribute(JMSEpr.JNDI_PKG_PREFIX_TAG);
+                if (prefix!=null) environment.setProperty(Context.URL_PKG_PREFIXES, prefix);
+                List<KeyValuePair> properties=p_oaP[i].childPropertyList();
+                for (KeyValuePair property : properties) {
+                    if (property.getKey().startsWith("java.naming.")) {
+                        environment.setProperty(property.getKey(), property.getValue());  
+                    }
+                }
+                
+                String connectionFactory = p_oaP[i].getAttribute(JMSEpr.CONNECTION_FACTORY_TAG);
+                if (connectionFactory==null) {
+                    connectionFactory = CONNECTION_FACTORY;
+                }
+                mPool[i] = JmsConnectionPoolContainer.getPool(environment, connectionFactory, JMSEpr.TOPIC_TYPE);
+                TopicSession topicSession = mPool[i].getTopicSession();
+                m_oCtx[i] = NamingContext.getServerContext(environment);
+                Topic oT=null;
+                try {
+                    oT = (Topic) m_oCtx[i].lookup(sAtt);
+                } catch (NamingException ne) {
+                    m_oCtx[i] = NamingContext.getFreshServerContext(environment);
+                    try {
+                        oT = (Topic) m_oCtx[i].lookup(sAtt);
+                    } catch (NamingException nex) {
+                        //ActiveMQ
+                        topicSession.createTopic(sAtt);
+                    }
+                }
+				m_oaMssProd[i] = topicSession.createPublisher(oT);
+                m_oSess[i] = topicSession;
+			}
+		}
+		catch (NamingException ex)
+		{
+			throw new ConfigurationException(ex);
+		}
+	}
+
+	protected void sendToAll (Message p_oMsg)
+	{
+		for (int i1 = 0; i1 < m_oaMssProd.length; i1++)
+		{
+			TopicPublisher oCurr = (TopicPublisher) m_oaMssProd[i1];
+			
+			try
+			{
+				oCurr.publish(p_oMsg);
+			}
+			catch (Exception e)
+			{
+                log.error(e.getMessage(), e);
+			}
+		}
+		release();
+	} // __________________________________
+
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,102 +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.notification;
-
-import java.io.ByteArrayOutputStream;
-import java.io.PrintStream;
-import java.io.Serializable;
-import java.util.Map;
-
-import org.jboss.internal.soa.esb.notification.MacroExpander;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.services.NotificationManager;
-
-public class NotifyUtil
-{
-
-	public static void notifyOK (NotificationManager p_oNH,
-			ConfigTree p_oParent, Serializable p_o, Map p_oCtx)
-	{
-		try
-		{
-			ConfigTree[] oaP = p_oParent.getChildren(NotificationList.ELEMENT);
-			for (int i1 = 0; i1 < oaP.length; i1++)
-			{
-				NotificationList oCurr = new NotificationList(oaP[i1]);
-				if (!oCurr.isOK()) continue;
-				ConfigTree oCpy = oaP[i1].cloneObj();
-				MacroExpander.replaceMacros(oCpy, p_oCtx);
-				p_oNH.sendNotifications(oCpy, p_o);
-			}
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace(System.out);
-		}
-	} // __________________________________
-
-	public static void notifyError (NotificationManager p_oNH,
-			ConfigTree p_oParent, Object p_o, Map p_oCtx, Exception p_e)
-	{
-		ByteArrayOutputStream oBO = new ByteArrayOutputStream();
-		PrintStream oPS = new PrintStream(oBO);
-		try
-		{
-			oPS.println(p_o.toString());
-			if (null != p_e)
-			{
-				p_e.printStackTrace(oPS);
-			}
-			oPS.close();
-
-			String sMsg = oBO.toString();
-			ConfigTree[] oaP = p_oParent.getChildren(NotificationList.ELEMENT);
-			// if (oaP.length<1) // Uncomment this line to send only to the list
-
-			// REVIEW: What's going on here? What's the difference between
-			// sending an
-			// error notification and sending a regular notification apart from
-			// there being an
-			// error message? What's the difference between how the
-			// InotificationHandler
-			// interface is used on the notifyOK and notifyError methods?
-
-			p_oNH.sendNotifications(sMsg);
-			for (int i1 = 0; i1 < oaP.length; i1++)
-			{
-				NotificationList oCurr = new NotificationList(oaP[i1]);
-				if (!oCurr.isErr())
-				{
-					continue;
-				}
-				MacroExpander.replaceMacros(oaP[i1], p_oCtx);
-				p_oNH.sendNotifications(oaP[i1], sMsg);
-			}
-		}
-		catch (Exception e)
-		{
-			e.printStackTrace(System.out);
-		}
-	} // __________________________________
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/notification/NotifyUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,102 @@
+/*
+ * 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.notification;
+
+import java.io.ByteArrayOutputStream;
+import java.io.PrintStream;
+import java.io.Serializable;
+import java.util.Map;
+
+import org.jboss.internal.soa.esb.notification.MacroExpander;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.services.NotificationManager;
+
+public class NotifyUtil
+{
+
+	public static void notifyOK (NotificationManager p_oNH,
+			ConfigTree p_oParent, Serializable p_o, Map p_oCtx)
+	{
+		try
+		{
+			ConfigTree[] oaP = p_oParent.getChildren(NotificationList.ELEMENT);
+			for (int i1 = 0; i1 < oaP.length; i1++)
+			{
+				NotificationList oCurr = new NotificationList(oaP[i1]);
+				if (!oCurr.isOK()) continue;
+				ConfigTree oCpy = oaP[i1].cloneObj();
+				MacroExpander.replaceMacros(oCpy, p_oCtx);
+				p_oNH.sendNotifications(oCpy, p_o);
+			}
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace(System.out);
+		}
+	} // __________________________________
+
+	public static void notifyError (NotificationManager p_oNH,
+			ConfigTree p_oParent, Object p_o, Map p_oCtx, Exception p_e)
+	{
+		ByteArrayOutputStream oBO = new ByteArrayOutputStream();
+		PrintStream oPS = new PrintStream(oBO);
+		try
+		{
+			oPS.println(p_o.toString());
+			if (null != p_e)
+			{
+				p_e.printStackTrace(oPS);
+			}
+			oPS.close();
+
+			String sMsg = oBO.toString();
+			ConfigTree[] oaP = p_oParent.getChildren(NotificationList.ELEMENT);
+			// if (oaP.length<1) // Uncomment this line to send only to the list
+
+			// REVIEW: What's going on here? What's the difference between
+			// sending an
+			// error notification and sending a regular notification apart from
+			// there being an
+			// error message? What's the difference between how the
+			// InotificationHandler
+			// interface is used on the notifyOK and notifyError methods?
+
+			p_oNH.sendNotifications(sMsg);
+			for (int i1 = 0; i1 < oaP.length; i1++)
+			{
+				NotificationList oCurr = new NotificationList(oaP[i1]);
+				if (!oCurr.isErr())
+				{
+					continue;
+				}
+				MacroExpander.replaceMacros(oaP[i1], p_oCtx);
+				p_oNH.sendNotifications(oaP[i1], sMsg);
+			}
+		}
+		catch (Exception e)
+		{
+			e.printStackTrace(System.out);
+		}
+	} // __________________________________
+
+} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/parameters)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepository.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepository.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepository.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,71 +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.parameters;
-
-
-/**
- * Parameter Repository Definition.
- * <p/>
- * A ParamRepository implementation allows persistence, retrieval and removal of
- * parameter values.
- * <p/>
- * Note that it is assumed that implementations are Thread Safe.
- * 
- * @author <a href="mailto:schifest at gmail.com">Esteban Shifman</a>
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public interface ParamRepository {
-	
-	// byte[] versions of the add and get methods might be needed on this.
-	// In fact, if this is done - rename the existing add and get methods
-	// to addString and getString and add the new byte[] methods as add/get.
-	
-	/**
-	 * Store a parameter value in the repository.
-	 * @param name The parameter name.  Must not be <code>null</code>.
-	 * @param value The parameter value.  Must not be <code>null</code>.
-	 * @throws ParamRepositoryException Failed to store the specified parameter value.
-	 */
-	public void add(String name, String value) throws ParamRepositoryException;
-
-	/**
-	 * Get the value associated with the named parameter.
-	 * @param name The parameter name.  Must not be <code>null</code>.
-	 * @return The parameter value, or null if the parameter is not available in 
-	 * the repository.
-	 * @throws ParamRepositoryException  The parameter exists, but an error has occured
-	 * while readingit. 
-	 */
-	public String get(String name) throws ParamRepositoryException;
-
-	/**
-	 * Remove a parameter, or a hierarchy of parameters.
-	 * <p/>
-	 * Because the repository is hierarchical in nature, parameters can be addressed
-	 * explicitly or as a group using a hierarchical name.
-	 * @param name The parameter name.  Must not be <code>null</code>.
-	 * @throws ParamRepositoryException Failed to remove the parameter, or hierarchy of parameters,
-	 * from the repository..
-	 */
-	public void remove(String name) throws ParamRepositoryException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepository.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepository.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepository.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepository.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,71 @@
+/*
+ * 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.parameters;
+
+
+/**
+ * Parameter Repository Definition.
+ * <p/>
+ * A ParamRepository implementation allows persistence, retrieval and removal of
+ * parameter values.
+ * <p/>
+ * Note that it is assumed that implementations are Thread Safe.
+ * 
+ * @author <a href="mailto:schifest at gmail.com">Esteban Shifman</a>
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public interface ParamRepository {
+	
+	// byte[] versions of the add and get methods might be needed on this.
+	// In fact, if this is done - rename the existing add and get methods
+	// to addString and getString and add the new byte[] methods as add/get.
+	
+	/**
+	 * Store a parameter value in the repository.
+	 * @param name The parameter name.  Must not be <code>null</code>.
+	 * @param value The parameter value.  Must not be <code>null</code>.
+	 * @throws ParamRepositoryException Failed to store the specified parameter value.
+	 */
+	public void add(String name, String value) throws ParamRepositoryException;
+
+	/**
+	 * Get the value associated with the named parameter.
+	 * @param name The parameter name.  Must not be <code>null</code>.
+	 * @return The parameter value, or null if the parameter is not available in 
+	 * the repository.
+	 * @throws ParamRepositoryException  The parameter exists, but an error has occured
+	 * while readingit. 
+	 */
+	public String get(String name) throws ParamRepositoryException;
+
+	/**
+	 * Remove a parameter, or a hierarchy of parameters.
+	 * <p/>
+	 * Because the repository is hierarchical in nature, parameters can be addressed
+	 * explicitly or as a group using a hierarchical name.
+	 * @param name The parameter name.  Must not be <code>null</code>.
+	 * @throws ParamRepositoryException Failed to remove the parameter, or hierarchy of parameters,
+	 * from the repository..
+	 */
+	public void remove(String name) throws ParamRepositoryException;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,51 +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.parameters;
-
-import org.jboss.soa.esb.BaseException;
-
-/**
- * {@link org.jboss.soa.esb.parameters.ParamRepository} access Exception.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class ParamRepositoryException extends BaseException {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Public Constructor.
-	 * @param message Exception message.
-	 */
-	public ParamRepositoryException(String message) {
-		super(message);
-	}
-
-	/**
-	 * Public Constructor.
-	 * @param message Exception message.
-	 * @param cause Exception cause.
-	 */
-	public ParamRepositoryException(String message, Throwable cause) {
-		super(message, cause);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,51 @@
+/*
+ * 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.parameters;
+
+import org.jboss.soa.esb.BaseException;
+
+/**
+ * {@link org.jboss.soa.esb.parameters.ParamRepository} access Exception.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ParamRepositoryException extends BaseException {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Public Constructor.
+	 * @param message Exception message.
+	 */
+	public ParamRepositoryException(String message) {
+		super(message);
+	}
+
+	/**
+	 * Public Constructor.
+	 * @param message Exception message.
+	 * @param cause Exception cause.
+	 */
+	public ParamRepositoryException(String message, Throwable cause) {
+		super(message, cause);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,120 +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.parameters;
-
-import org.jboss.internal.soa.esb.parameters.ParamFileRepository;
-import org.jboss.soa.esb.common.Configuration;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * Factory class for Singleton {@link ParamRepository} creation. <p/> Uses the
- * "org.jboss.soa.esb.paramsRepository.class" system property to determine the
- * {@link ParamRepository} implementation to be created. If not specified, the
- * default implementation is the
- * {@link org.jboss.internal.soa.esb.parameters.ParamFileRepository}.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class ParamRepositoryFactory
-{
-
-	/**
-	 * Singleton instance of the repository.
-	 */
-	private static ParamRepository instance;
-
-	/**
-	 * Factory method for creating the Singleton {@link ParamRepository}
-	 * instance for the system.
-	 * 
-	 * @return The ParamRepository instance for the system.
-	 */
-	public static ParamRepository getInstance()
-	{
-		if (instance == null)
-		{
-			// Hasn't been created yet - lets created it in a synchronized
-			// fashion...
-			instance = synchedGetInstance();
-		}
-
-		return instance;
-	}
-
-	/**
-	 * Synchronizes creation of the Singleton instance.
-	 * 
-	 * @return The Singleton ParamRepository instance.
-	 */
-	private static ParamRepository synchedGetInstance()
-	{
-		synchronized (ParamRepositoryFactory.class)
-		{
-			// The following check ensures that multithreads won't create
-			// multiple instances of the singleton. Threads that are blocked
-			// waiting
-			// at the start of this synch block will simply fall through and
-			// return the
-			// instance created by the thread that got in ahead of them.
-			if (instance == null)
-			{
-				String runtimeClassName = Configuration
-						.getParamRepositoryImplClass();
-
-				if (runtimeClassName == null)
-				{
-					// If there's no repository name configured, return the
-					// default file-based repository...
-					instance = new ParamFileRepository();
-				} else
-				{
-					try
-					{
-						Class<?> runtimeClass = ClassUtil.forName(runtimeClassName, ParamRepositoryFactory.class);
-						instance = (ParamRepository) runtimeClass.newInstance();
-					} catch (Exception e)
-					{
-						new IllegalStateException(
-								"System Configuration Exception: Unable to create system "
-										+ ParamRepository.class.getSimpleName()
-										+ " instance from runtime class name ["
-										+ runtimeClassName + "]", e);
-					}
-				}
-			}
-		}
-
-		return instance;
-	}
-
-	/**
-	 * Resets the factory, allowing creation of a new Singleton instance. <p/>
-	 * Should only need to be used for testing purposes.
-	 */
-	protected static void reset()
-	{
-		synchronized (ParamRepositoryFactory.class)
-		{
-			instance = null;
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/parameters/ParamRepositoryFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,120 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.soa.esb.parameters;
+
+import org.jboss.internal.soa.esb.parameters.ParamFileRepository;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Factory class for Singleton {@link ParamRepository} creation. <p/> Uses the
+ * "org.jboss.soa.esb.paramsRepository.class" system property to determine the
+ * {@link ParamRepository} implementation to be created. If not specified, the
+ * default implementation is the
+ * {@link org.jboss.internal.soa.esb.parameters.ParamFileRepository}.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public abstract class ParamRepositoryFactory
+{
+
+	/**
+	 * Singleton instance of the repository.
+	 */
+	private static ParamRepository instance;
+
+	/**
+	 * Factory method for creating the Singleton {@link ParamRepository}
+	 * instance for the system.
+	 * 
+	 * @return The ParamRepository instance for the system.
+	 */
+	public static ParamRepository getInstance()
+	{
+		if (instance == null)
+		{
+			// Hasn't been created yet - lets created it in a synchronized
+			// fashion...
+			instance = synchedGetInstance();
+		}
+
+		return instance;
+	}
+
+	/**
+	 * Synchronizes creation of the Singleton instance.
+	 * 
+	 * @return The Singleton ParamRepository instance.
+	 */
+	private static ParamRepository synchedGetInstance()
+	{
+		synchronized (ParamRepositoryFactory.class)
+		{
+			// The following check ensures that multithreads won't create
+			// multiple instances of the singleton. Threads that are blocked
+			// waiting
+			// at the start of this synch block will simply fall through and
+			// return the
+			// instance created by the thread that got in ahead of them.
+			if (instance == null)
+			{
+				String runtimeClassName = Configuration
+						.getParamRepositoryImplClass();
+
+				if (runtimeClassName == null)
+				{
+					// If there's no repository name configured, return the
+					// default file-based repository...
+					instance = new ParamFileRepository();
+				} else
+				{
+					try
+					{
+						Class<?> runtimeClass = ClassUtil.forName(runtimeClassName, ParamRepositoryFactory.class);
+						instance = (ParamRepository) runtimeClass.newInstance();
+					} catch (Exception e)
+					{
+						new IllegalStateException(
+								"System Configuration Exception: Unable to create system "
+										+ ParamRepository.class.getSimpleName()
+										+ " instance from runtime class name ["
+										+ runtimeClassName + "]", e);
+					}
+				}
+			}
+		}
+
+		return instance;
+	}
+
+	/**
+	 * Resets the factory, allowing creation of a new Singleton instance. <p/>
+	 * Should only need to be used for testing purposes.
+	 */
+	protected static void reset()
+	{
+		synchronized (ParamRepositoryFactory.class)
+		{
+			instance = null;
+		}
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/persistence)

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,19 +0,0 @@
-package org.jboss.soa.esb.persistence.manager;
-
-public class ConnectionManagerException extends Exception {
-	
-private static final long serialVersionUID = 1L;
-    
-    public ConnectionManagerException(){
-        super();
-    }
-    
-    public ConnectionManagerException (String msg){
-        super(msg);
-    }
-    
-    public ConnectionManagerException (String msg, Throwable cause){
-        super (msg, cause);
-    }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,19 @@
+package org.jboss.soa.esb.persistence.manager;
+
+public class ConnectionManagerException extends Exception {
+	
+private static final long serialVersionUID = 1L;
+    
+    public ConnectionManagerException(){
+        super();
+    }
+    
+    public ConnectionManagerException (String msg){
+        super(msg);
+    }
+    
+    public ConnectionManagerException (String msg, Throwable cause){
+        super (msg, cause);
+    }
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,40 +0,0 @@
-package org.jboss.soa.esb.persistence.manager;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.persistence.manager.ConnectionManager;
-import org.jboss.soa.esb.common.Configuration;
-import org.jboss.soa.esb.util.ClassUtil;
-
-public class ConnectionManagerFactory {
-	
-    private static String DEFAULT = J2eeConnectionManager.class.getName();
-	private static Logger logger = Logger.getLogger(ConnectionManagerFactory.class);
-	
-	public static ConnectionManager getConnectionManager() throws ConnectionManagerException
-    {
-		ConnectionManager manager = null;
-        String className = Configuration.getStoreDBConnectionManager();
-        //If not specified use the default
-        if (className==null) {
-            className = DEFAULT;
-        }
-		logger.log(Level.DEBUG, "Going to load " + className);
-		try{
-			// instruct class loader to load the connection manager
-			Class managerClass = ClassUtil.forName(className, ConnectionManagerFactory.class);
-			ConnectionManager tmp = (ConnectionManager) managerClass.newInstance();
-            manager = tmp.getInstance();
-		}
-		catch (ClassNotFoundException cnfex)
-		{
-			throw new ConnectionManagerException("Connection Manager Implementation=" + className
-					+ " not found", cnfex);
-		} catch (Exception e) {
-			throw new ConnectionManagerException("Invocation exception. "
-					+ e.getLocalizedMessage(), e);
-		}
-		return manager;
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/ConnectionManagerFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,40 @@
+package org.jboss.soa.esb.persistence.manager;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.persistence.manager.ConnectionManager;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.util.ClassUtil;
+
+public class ConnectionManagerFactory {
+	
+    private static String DEFAULT = J2eeConnectionManager.class.getName();
+	private static Logger logger = Logger.getLogger(ConnectionManagerFactory.class);
+	
+	public static ConnectionManager getConnectionManager() throws ConnectionManagerException
+    {
+		ConnectionManager manager = null;
+        String className = Configuration.getStoreDBConnectionManager();
+        //If not specified use the default
+        if (className==null) {
+            className = DEFAULT;
+        }
+		logger.log(Level.DEBUG, "Going to load " + className);
+		try{
+			// instruct class loader to load the connection manager
+			Class managerClass = ClassUtil.forName(className, ConnectionManagerFactory.class);
+			ConnectionManager tmp = (ConnectionManager) managerClass.newInstance();
+            manager = tmp.getInstance();
+		}
+		catch (ClassNotFoundException cnfex)
+		{
+			throw new ConnectionManagerException("Connection Manager Implementation=" + className
+					+ " not found", cnfex);
+		} catch (Exception e) {
+			throw new ConnectionManagerException("Invocation exception. "
+					+ e.getLocalizedMessage(), e);
+		}
+		return manager;
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/J2eeConnectionManager.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/J2eeConnectionManager.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/J2eeConnectionManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,81 +0,0 @@
-package org.jboss.soa.esb.persistence.manager;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.sql.DataSource;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.persistence.manager.ConnectionManager;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.common.Configuration;
-
-/**
- * J2EE datasource based Connection Pooling implementation for use when deploying to a J2EE container 
- *
- */
-public class J2eeConnectionManager implements ConnectionManager {
-    
-    private static J2eeConnectionManager instance = null;
-    @SuppressWarnings("unused")
-    private DataSource datasource = null;
-    private Context oJndiCtx = null;
-    
-    private static Logger _logger = Logger.getLogger(J2eeConnectionManager.class);
-    private static final Object foo = new Integer(0);
-
-    public Connection getConnection() throws SQLException 
-    {
-        return datasource.getConnection();
-    }
-
-    public ConnectionManager getInstance() {
-        if (null != instance)
-        {
-            return instance;
-        }
-        
-        synchronized (foo)
-        {
-            if (null != instance) 
-                return instance;
-            
-            try
-            {
-                instance = new J2eeConnectionManager();
-                instance.init();
-            }
-            catch (Exception e)
-            {
-                _logger.error("Could not initialise instance.", e);
-                
-                return null;
-            }
-
-            return instance;
-        }
-    }
-
-    public void init() throws ConfigurationException {
-        _logger.info("initializing...");
-        
-                             
-        try
-        {
-            oJndiCtx = new InitialContext();
-            if (null == oJndiCtx) {
-                _logger.error("could not get a valid context");
-                throw new ConfigurationException("could not get a valid context - check your settings in the config file");
-            } 
-            String dataSourcename = Configuration.getStoreDBDatasourceName();
-            datasource =  ((DataSource) oJndiCtx.lookup(dataSourcename));
-        }
-        catch (Exception ex)
-        {
-                throw new ConfigurationException(ex);
-        }
-    }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/J2eeConnectionManager.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/J2eeConnectionManager.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/J2eeConnectionManager.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/J2eeConnectionManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,81 @@
+package org.jboss.soa.esb.persistence.manager;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.sql.DataSource;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.persistence.manager.ConnectionManager;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.common.Configuration;
+
+/**
+ * J2EE datasource based Connection Pooling implementation for use when deploying to a J2EE container 
+ *
+ */
+public class J2eeConnectionManager implements ConnectionManager {
+    
+    private static J2eeConnectionManager instance = null;
+    @SuppressWarnings("unused")
+    private DataSource datasource = null;
+    private Context oJndiCtx = null;
+    
+    private static Logger _logger = Logger.getLogger(J2eeConnectionManager.class);
+    private static final Object foo = new Integer(0);
+
+    public Connection getConnection() throws SQLException 
+    {
+        return datasource.getConnection();
+    }
+
+    public ConnectionManager getInstance() {
+        if (null != instance)
+        {
+            return instance;
+        }
+        
+        synchronized (foo)
+        {
+            if (null != instance) 
+                return instance;
+            
+            try
+            {
+                instance = new J2eeConnectionManager();
+                instance.init();
+            }
+            catch (Exception e)
+            {
+                _logger.error("Could not initialise instance.", e);
+                
+                return null;
+            }
+
+            return instance;
+        }
+    }
+
+    public void init() throws ConfigurationException {
+        _logger.info("initializing...");
+        
+                             
+        try
+        {
+            oJndiCtx = new InitialContext();
+            if (null == oJndiCtx) {
+                _logger.error("could not get a valid context");
+                throw new ConfigurationException("could not get a valid context - check your settings in the config file");
+            } 
+            String dataSourcename = Configuration.getStoreDBDatasourceName();
+            datasource =  ((DataSource) oJndiCtx.lookup(dataSourcename));
+        }
+        catch (Exception ex)
+        {
+                throw new ConfigurationException(ex);
+        }
+    }
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/StandaloneConnectionManager.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/StandaloneConnectionManager.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/StandaloneConnectionManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,141 +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 daniel.brum at jboss.com
- */
-
-package org.jboss.soa.esb.persistence.manager;
-
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.persistence.manager.ConnectionManager;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.common.Configuration;
-
-import com.mchange.v2.c3p0.ComboPooledDataSource;
-
-/**
- * C3PO Connection Pooling implementation for stand-alone use, outside of a J2EE container 
- *
- */
-public class StandaloneConnectionManager implements ConnectionManager
-{
-
-    private static StandaloneConnectionManager instance = null;
-
-    protected ComboPooledDataSource pooledDS = null;
-
-    private static final Object foo = new Integer(0);
-
-    private static Logger _logger = Logger.getLogger(StandaloneConnectionManager.class);
-
-    protected StandaloneConnectionManager ()
-    {
-    }
-
-    public ConnectionManager getInstance ()
-    {
-        if (null != instance)
-        {
-            return instance;
-        }
-        
-        synchronized (foo)
-        {
-            if (null != instance) 
-                return instance;
-            
-            try
-            {
-                instance = new StandaloneConnectionManager();
-                instance.init();
-            }
-            catch (Exception e)
-            {
-                _logger.error("Could not initialise instance.", e);
-                
-                return null;
-            }
-
-            return instance;
-        }
-    }
-
-    public void init () throws ConfigurationException
-    {
-        _logger.info("initializing...");
-        pooledDS = new ComboPooledDataSource();
-
-        try
-        {
-            pooledDS.setDriverClass(Configuration.getStoreDriver());
-            pooledDS.setJdbcUrl(Configuration.getStoreUrl());
-            pooledDS.setUser(Configuration.getStoreUser());
-            pooledDS.setPassword(Configuration.getStorePwd());
-            pooledDS.setMinPoolSize(Integer.valueOf(Configuration
-                    .getStorePoolMinSize()));
-            pooledDS.setInitialPoolSize(Integer.valueOf(Configuration
-                    .getStorePoolInitialSize()));
-            pooledDS.setMaxPoolSize(Integer.valueOf(Configuration
-                    .getStorePoolMaxSize()));
-            pooledDS.setAutomaticTestTable(Configuration.getStorePoolTestTable());
-            pooledDS.setCheckoutTimeout(Integer.valueOf(Configuration
-                    .getStorePoolTimeoutMillis()));
-        }
-        catch (Exception ex)
-        {
-            throw new ConfigurationException(ex);
-        }
-    }
-
-    public Connection getConnection () throws SQLException
-    {
-        Connection conn = null;
-
-        // TODO: figure out why this is neccessary - pool should never return
-        // null if DB is up and can connect
-        // testing showed null was being returned from pool in QA test
-        // MessageStoreTest
-        
-        while (true)
-        {
-            if (null != pooledDS)
-            {
-                if (null != (conn = pooledDS.getConnection())) 
-                    break;
-                else
-                    _logger.error("Null pooledDS");
-            }
-            
-            try
-            {
-                // TODO magic number
-                
-                Thread.sleep(1000);
-            }
-            catch (Exception e)
-            {
-            }
-        }
-
-        return conn;
-    }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/StandaloneConnectionManager.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/StandaloneConnectionManager.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/StandaloneConnectionManager.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/persistence/manager/StandaloneConnectionManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,141 @@
+/*
+ * 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 daniel.brum at jboss.com
+ */
+
+package org.jboss.soa.esb.persistence.manager;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.persistence.manager.ConnectionManager;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.common.Configuration;
+
+import com.mchange.v2.c3p0.ComboPooledDataSource;
+
+/**
+ * C3PO Connection Pooling implementation for stand-alone use, outside of a J2EE container 
+ *
+ */
+public class StandaloneConnectionManager implements ConnectionManager
+{
+
+    private static StandaloneConnectionManager instance = null;
+
+    protected ComboPooledDataSource pooledDS = null;
+
+    private static final Object foo = new Integer(0);
+
+    private static Logger _logger = Logger.getLogger(StandaloneConnectionManager.class);
+
+    protected StandaloneConnectionManager ()
+    {
+    }
+
+    public ConnectionManager getInstance ()
+    {
+        if (null != instance)
+        {
+            return instance;
+        }
+        
+        synchronized (foo)
+        {
+            if (null != instance) 
+                return instance;
+            
+            try
+            {
+                instance = new StandaloneConnectionManager();
+                instance.init();
+            }
+            catch (Exception e)
+            {
+                _logger.error("Could not initialise instance.", e);
+                
+                return null;
+            }
+
+            return instance;
+        }
+    }
+
+    public void init () throws ConfigurationException
+    {
+        _logger.info("initializing...");
+        pooledDS = new ComboPooledDataSource();
+
+        try
+        {
+            pooledDS.setDriverClass(Configuration.getStoreDriver());
+            pooledDS.setJdbcUrl(Configuration.getStoreUrl());
+            pooledDS.setUser(Configuration.getStoreUser());
+            pooledDS.setPassword(Configuration.getStorePwd());
+            pooledDS.setMinPoolSize(Integer.valueOf(Configuration
+                    .getStorePoolMinSize()));
+            pooledDS.setInitialPoolSize(Integer.valueOf(Configuration
+                    .getStorePoolInitialSize()));
+            pooledDS.setMaxPoolSize(Integer.valueOf(Configuration
+                    .getStorePoolMaxSize()));
+            pooledDS.setAutomaticTestTable(Configuration.getStorePoolTestTable());
+            pooledDS.setCheckoutTimeout(Integer.valueOf(Configuration
+                    .getStorePoolTimeoutMillis()));
+        }
+        catch (Exception ex)
+        {
+            throw new ConfigurationException(ex);
+        }
+    }
+
+    public Connection getConnection () throws SQLException
+    {
+        Connection conn = null;
+
+        // TODO: figure out why this is neccessary - pool should never return
+        // null if DB is up and can connect
+        // testing showed null was being returned from pool in QA test
+        // MessageStoreTest
+        
+        while (true)
+        {
+            if (null != pooledDS)
+            {
+                if (null != (conn = pooledDS.getConnection())) 
+                    break;
+                else
+                    _logger.error("Null pooledDS");
+            }
+            
+            try
+            {
+                // TODO magic number
+                
+                Thread.sleep(1000);
+            }
+            catch (Exception e)
+            {
+            }
+        }
+
+        return conn;
+    }
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,63 +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.services;
-
-public class DefaultEncryptionFactory
-{
-	public static Encryption getEncrypter()
-	{
-		return new DummyEncrypter();
-
-	} //________________________________
-
-	public static Encryption getEncrypter(Object p_o)
-	{
-		return new DummyEncrypter();
-
-	} //________________________________
-
-	/**
-	 *  This is a dummy class to provide dummy
-	 *  encrypt/decrypt methods for a byte[]
-	 *
-	 */
-	private static class DummyEncrypter implements Encryption
-	{
-//	  private static Cipher s_oCC;
-//	  static
-//	  { try { s_oCC = Cipher.getInstance("DES"); }
-//	    catch (Exception e) { e.printStackTrace(); }
-//	  }
-	  public byte [] encrypt (byte [] p_ba, Object p_oParms)
-	         throws EncryptionFailedException
-	  {
-		  return  p_ba;
-	  } //__________________________________
-
-	  public byte [] decrypt (byte [] p_ba, Object p_oParms)
-	         throws EncryptionFailedException
-	  {
-		  return p_ba;
-	  } //__________________________________
-	} //___________________________________________________
-
-} //____________________________________________________________________________
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/DefaultEncryptionFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,63 @@
+/*
+ * 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.services;
+
+public class DefaultEncryptionFactory
+{
+	public static Encryption getEncrypter()
+	{
+		return new DummyEncrypter();
+
+	} //________________________________
+
+	public static Encryption getEncrypter(Object p_o)
+	{
+		return new DummyEncrypter();
+
+	} //________________________________
+
+	/**
+	 *  This is a dummy class to provide dummy
+	 *  encrypt/decrypt methods for a byte[]
+	 *
+	 */
+	private static class DummyEncrypter implements Encryption
+	{
+//	  private static Cipher s_oCC;
+//	  static
+//	  { try { s_oCC = Cipher.getInstance("DES"); }
+//	    catch (Exception e) { e.printStackTrace(); }
+//	  }
+	  public byte [] encrypt (byte [] p_ba, Object p_oParms)
+	         throws EncryptionFailedException
+	  {
+		  return  p_ba;
+	  } //__________________________________
+
+	  public byte [] decrypt (byte [] p_ba, Object p_oParms)
+	         throws EncryptionFailedException
+	  {
+		  return p_ba;
+	  } //__________________________________
+	} //___________________________________________________
+
+} //____________________________________________________________________________
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/Encryption.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/Encryption.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/Encryption.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,28 +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.services;
-
-public interface Encryption 
-{
-	  public byte [] encrypt (byte [] p_ba, Object p_oParms) throws EncryptionFailedException;
-	  public byte [] decrypt (byte [] p_ba, Object p_oParms) throws EncryptionFailedException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/Encryption.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/Encryption.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/Encryption.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/Encryption.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,28 @@
+/*
+* 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.services;
+
+public interface Encryption 
+{
+	  public byte [] encrypt (byte [] p_ba, Object p_oParms) throws EncryptionFailedException;
+	  public byte [] decrypt (byte [] p_ba, Object p_oParms) throws EncryptionFailedException;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/EncryptionFailedException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/EncryptionFailedException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/EncryptionFailedException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,71 +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.services;
-
-/**
- * Configuration Exception.
- * 
- * @author mark.little at jboss.com
- * @since Version 4.0
- */
-
-public class EncryptionFailedException extends Exception
-{
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param message
-	 *            Exception message.
-	 */
-	public EncryptionFailedException (String message)
-	{
-		super(message);
-	}
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param message
-	 *            Exception message.
-	 * @param cause
-	 *            Exception cause.
-	 */
-	public EncryptionFailedException (String message, Throwable cause)
-	{
-		super(message, cause);
-	}
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param cause
-	 *            Exception cause.
-	 */
-	public EncryptionFailedException (Throwable cause)
-	{
-		super(cause);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/EncryptionFailedException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/EncryptionFailedException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/EncryptionFailedException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/EncryptionFailedException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,71 @@
+/*
+ * 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.services;
+
+/**
+ * Configuration Exception.
+ * 
+ * @author mark.little at jboss.com
+ * @since Version 4.0
+ */
+
+public class EncryptionFailedException extends Exception
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 */
+	public EncryptionFailedException (String message)
+	{
+		super(message);
+	}
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 * @param cause
+	 *            Exception cause.
+	 */
+	public EncryptionFailedException (String message, Throwable cause)
+	{
+		super(message, cause);
+	}
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param cause
+	 *            Exception cause.
+	 */
+	public EncryptionFailedException (Throwable cause)
+	{
+		super(cause);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/NotificationManager.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/NotificationManager.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/NotificationManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,69 +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.services;
-
-import java.io.Serializable;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.notification.NotificationException;
-
-/**
- * Use this interface to group all methods that can be useful to trigger events
- * that can be caught by listeners, within or outside of the Rosetta framework
- * 
- * @author Esteban
- * 
- */
-public interface NotificationManager
-{
-
-	// REVIEW: Add some Javadoc for this interface!!!
-	/**
-	 * public void sendNotifications(ConfigTree p_oP, Serializable p_o)
-	 * 
-	 * @param p_oP
-	 *            ConfigTree - A serialized NotificationList object (as a
-	 *            ConfigTree)
-	 * @param p_o
-	 *            The Serializable object that will be sent to all the
-	 *            NotificationTarget objects contained in the NotificationList
-	 * 
-	 * <p/>Implementations of this interface will be responsible of sending the
-	 * Serializable (arg 1) to destinations determined by each
-	 * NotificationTarget contained in the NotificationList represented by arg
-	 * 0. <p/>Please see org.jboss.soa.esb.notification package for existing
-	 * classes that extend NotificationTarget (Files, Queues, Topics,
-	 * SqlTable...)
-	 * 
-	 * <p/> Invoking processes are responsible to provide dynamic content of
-	 * notification <p/> The NotificationTarget objects can define 'static'
-	 * content for (suc as contents of certain columns in SQL, or message
-	 * properties for JMS notification targets, etc.
-	 */
-	public void sendNotifications (ConfigTree p_oP, Serializable p_o)
-			throws ConfigurationException, NotificationException;
-
-	public void sendNotifications (Serializable p_o)
-			throws NotificationException;
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/NotificationManager.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/NotificationManager.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/NotificationManager.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/NotificationManager.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,69 @@
+/*
+ * 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.services;
+
+import java.io.Serializable;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.notification.NotificationException;
+
+/**
+ * Use this interface to group all methods that can be useful to trigger events
+ * that can be caught by listeners, within or outside of the Rosetta framework
+ * 
+ * @author Esteban
+ * 
+ */
+public interface NotificationManager
+{
+
+	// REVIEW: Add some Javadoc for this interface!!!
+	/**
+	 * public void sendNotifications(ConfigTree p_oP, Serializable p_o)
+	 * 
+	 * @param p_oP
+	 *            ConfigTree - A serialized NotificationList object (as a
+	 *            ConfigTree)
+	 * @param p_o
+	 *            The Serializable object that will be sent to all the
+	 *            NotificationTarget objects contained in the NotificationList
+	 * 
+	 * <p/>Implementations of this interface will be responsible of sending the
+	 * Serializable (arg 1) to destinations determined by each
+	 * NotificationTarget contained in the NotificationList represented by arg
+	 * 0. <p/>Please see org.jboss.soa.esb.notification package for existing
+	 * classes that extend NotificationTarget (Files, Queues, Topics,
+	 * SqlTable...)
+	 * 
+	 * <p/> Invoking processes are responsible to provide dynamic content of
+	 * notification <p/> The NotificationTarget objects can define 'static'
+	 * content for (suc as contents of certain columns in SQL, or message
+	 * properties for JMS notification targets, etc.
+	 */
+	public void sendNotifications (ConfigTree p_oP, Serializable p_o)
+			throws ConfigurationException, NotificationException;
+
+	public void sendNotifications (Serializable p_o)
+			throws NotificationException;
+} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStore.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStore.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStore.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,86 +0,0 @@
-package org.jboss.soa.esb.services.persistence;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-import java.net.URI;
-import java.util.Map;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.urigen.MessageURIGenerator;
-
-public interface MessageStore
-{
-    public final static String DEFAULT = "org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl";
-    public final static String DEFAULT_CLASSIFICATION = "STORE";
-    public final static String DLQ_CLASSIFICATION = "DLQ";
-    public final static String MESSAGE_STORE_URI = "message-store-uri";
-	/**
-	 * Get the implementation-specific message URI generator.
-	 * @return the generator
-	 */
-	public MessageURIGenerator getMessageURIGenerator();
-	
-	/**
-	 * Add a message to the store.
-	 * @param message the message to store
-	 * @return the URI of the generated message
-	 * @throws MessageStoreException
-	 */
-	public URI addMessage (Message message, String classification) throws MessageStoreException;
-
-	/**
-	 * Get a message from the store by URI.
-	 * @param uid the unique message id
-	 * @return the message
-	 * @throws MessageStoreException
-	 */
-	public Message getMessage (URI uid) throws MessageStoreException;
-	
-	/**
-	 * Indicate that a message has not been delivered.
-	 * @param uid
-	 * @throws MessageStoreException
-	 */
-	public void setUndelivered(URI uid) throws MessageStoreException;
-	
-	/**
-	 * Indicate that a message has been delivered.
-	 * @param uid
-	 * @throws MessageStoreException
-	 */
-	public void setDelivered(URI uid) throws MessageStoreException;
-	
-	/**
-	 * Get a map of undelivered messages.
-	 * @return Map<URI, Message>
-	 * @throws MessageStoreException
-	 */
-	public Map<URI, Message> getUndeliveredMessages(String classification) throws MessageStoreException;
-
-    /**
-     * Get a map of all messages for a certain classification.
-     * @return map
-     * @param classification
-     * @throws MessageStoreException
-     */
-    public Map<URI, Message> getAllMessages(String classification) throws MessageStoreException;
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStore.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStore.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStore.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStore.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,86 @@
+package org.jboss.soa.esb.services.persistence;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+import java.net.URI;
+import java.util.Map;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.urigen.MessageURIGenerator;
+
+public interface MessageStore
+{
+    public final static String DEFAULT = "org.jboss.internal.soa.esb.persistence.format.db.DBMessageStoreImpl";
+    public final static String DEFAULT_CLASSIFICATION = "STORE";
+    public final static String DLQ_CLASSIFICATION = "DLQ";
+    public final static String MESSAGE_STORE_URI = "message-store-uri";
+	/**
+	 * Get the implementation-specific message URI generator.
+	 * @return the generator
+	 */
+	public MessageURIGenerator getMessageURIGenerator();
+	
+	/**
+	 * Add a message to the store.
+	 * @param message the message to store
+	 * @return the URI of the generated message
+	 * @throws MessageStoreException
+	 */
+	public URI addMessage (Message message, String classification) throws MessageStoreException;
+
+	/**
+	 * Get a message from the store by URI.
+	 * @param uid the unique message id
+	 * @return the message
+	 * @throws MessageStoreException
+	 */
+	public Message getMessage (URI uid) throws MessageStoreException;
+	
+	/**
+	 * Indicate that a message has not been delivered.
+	 * @param uid
+	 * @throws MessageStoreException
+	 */
+	public void setUndelivered(URI uid) throws MessageStoreException;
+	
+	/**
+	 * Indicate that a message has been delivered.
+	 * @param uid
+	 * @throws MessageStoreException
+	 */
+	public void setDelivered(URI uid) throws MessageStoreException;
+	
+	/**
+	 * Get a map of undelivered messages.
+	 * @return Map<URI, Message>
+	 * @throws MessageStoreException
+	 */
+	public Map<URI, Message> getUndeliveredMessages(String classification) throws MessageStoreException;
+
+    /**
+     * Get a map of all messages for a certain classification.
+     * @return map
+     * @param classification
+     * @throws MessageStoreException
+     */
+    public Map<URI, Message> getAllMessages(String classification) throws MessageStoreException;
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStoreException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStoreException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStoreException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,53 +0,0 @@
-package org.jboss.soa.esb.services.persistence;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Thrown if marshalling a message fails. This could be because
- * conversion to XML encounters problems.
- */
-
-public class MessageStoreException extends Exception
-{
-	private static final long serialVersionUID = 0xE;
-	
-	public MessageStoreException()
-	{
-		super();
-	}
-
-	public MessageStoreException(String s)
-	{
-		super(s);
-	}
-
-	public MessageStoreException (Exception ex)
-	{
-		super(ex);
-	}
-
-	public MessageStoreException (String message, Exception ex)
-	{
-		super(message, ex);
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStoreException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStoreException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStoreException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/persistence/MessageStoreException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,53 @@
+package org.jboss.soa.esb.services.persistence;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Thrown if marshalling a message fails. This could be because
+ * conversion to XML encounters problems.
+ */
+
+public class MessageStoreException extends Exception
+{
+	private static final long serialVersionUID = 0xE;
+	
+	public MessageStoreException()
+	{
+		super();
+	}
+
+	public MessageStoreException(String s)
+	{
+		super(s);
+	}
+
+	public MessageStoreException (Exception ex)
+	{
+		super(ex);
+	}
+
+	public MessageStoreException (String message, Exception ex)
+	{
+		super(message, ex);
+	}
+	
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/Registry.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/Registry.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/Registry.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,96 +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.services.registry;
-
-import java.util.Collection;
-
-import org.jboss.soa.esb.addressing.EPR;
-/**
- * Registry interface for the ESB.
- *
- * @author Kurt Stam
- */
-public interface Registry 
-{
-	/**
-	 * Removes a service from the Registry along with all the ServiceBindings underneath it.
-	 *
-	 * @param category           - name of the service category, for example 'transformation'.
-	 * @param serviceName        - name of the service, for example 'smooks'.
-	 * @throws RegistryException
-	 */
-	public void unRegisterService(String category, String serviceName) throws RegistryException;
-	/**
-	 * Registers an EPR under the specified category and service. If the specified service does
-	 * not exist, it will be created at the same time.
-	 * 
-	 * @param serviceCategoryName - name of the category to which the service belongs.
-	 * @param serviceName         - name of the service to which the EPS belongs.
-	 * @param serviceDescription  - human readable description of the service, 
-	 * 							   only used when it the service does not yet exist.
-	 * @param epr				  - the EndPointReference (EPR) that needs to be registered.
-	 * @param eprDescription	  - human readable description of the EPR
-	 * @throws RegistryException
-	 */
-	public void registerEPR(String serviceCategoryName, String serviceName, String serviceDescription, EPR epr, String eprDescription) 
-	throws RegistryException;
-	/**
-	 * Removes an EPR from the Registry. 
-	 * @param serviceCategoryName - name of the category to which the service belongs.
-	 * @param serviceName         - name of the service to which the EPS belongs.
-	 * @param epr                 - the EndPointReference (EPR) that needs to be unregistered.
-	 * @throws RegistryException
-	 */
-	public void unRegisterEPR(String serviceCategoryName, String serviceName, EPR epr) throws RegistryException;
-	/** 
-	 * Find all Services assigned to the Red Hat/JBossESB organization.
-	 * @return Collection of Strings containing the service names.
-	 * @throws RegistryException
-	 */
-	public Collection<String> findAllServices() throws RegistryException;
-	/**
-	 * Find all services that belong to the supplied category. 
-	 * 
-	 * @param serviceCategoryName - name of the category to which the service belongs.
-	 * @return Collection of Strings containing the service names
-	 * @throws RegistryException
-	 */
-	public Collection<String> findServices(String serviceCategoryName) throws RegistryException;
-	/**
-	 * Finds all the EPRs that belong to a specific category and service combination.
-	 * 
-	 * @param serviceCategoryName - name of the category to which the service belongs.
-	 * @param serviceName         - name of the service to which the EPS belongs.
-	 * @return Collection of EPRs.
-	 * @throws RegistryException
-	 */
-	public Collection<EPR> findEPRs(String serviceCategoryName, String serviceName) throws RegistryException;
-	/**
-	 * Returns the first EPR in the list that belong to a specific category and service combination.
-	 * 
-	 * @param serviceCategoryName - name of the category to which the service belongs.
-	 * @param serviceName         - name of the service to which the EPS belongs.
-	 * @return EPR.
-	 * @throws RegistryException
-	 */
-	public EPR findEPR(String serviceCategoryName, String serviceName) throws RegistryException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/Registry.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/Registry.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/Registry.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/Registry.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,96 @@
+/*
+* 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.services.registry;
+
+import java.util.Collection;
+
+import org.jboss.soa.esb.addressing.EPR;
+/**
+ * Registry interface for the ESB.
+ *
+ * @author Kurt Stam
+ */
+public interface Registry 
+{
+	/**
+	 * Removes a service from the Registry along with all the ServiceBindings underneath it.
+	 *
+	 * @param category           - name of the service category, for example 'transformation'.
+	 * @param serviceName        - name of the service, for example 'smooks'.
+	 * @throws RegistryException
+	 */
+	public void unRegisterService(String category, String serviceName) throws RegistryException;
+	/**
+	 * Registers an EPR under the specified category and service. If the specified service does
+	 * not exist, it will be created at the same time.
+	 * 
+	 * @param serviceCategoryName - name of the category to which the service belongs.
+	 * @param serviceName         - name of the service to which the EPS belongs.
+	 * @param serviceDescription  - human readable description of the service, 
+	 * 							   only used when it the service does not yet exist.
+	 * @param epr				  - the EndPointReference (EPR) that needs to be registered.
+	 * @param eprDescription	  - human readable description of the EPR
+	 * @throws RegistryException
+	 */
+	public void registerEPR(String serviceCategoryName, String serviceName, String serviceDescription, EPR epr, String eprDescription) 
+	throws RegistryException;
+	/**
+	 * Removes an EPR from the Registry. 
+	 * @param serviceCategoryName - name of the category to which the service belongs.
+	 * @param serviceName         - name of the service to which the EPS belongs.
+	 * @param epr                 - the EndPointReference (EPR) that needs to be unregistered.
+	 * @throws RegistryException
+	 */
+	public void unRegisterEPR(String serviceCategoryName, String serviceName, EPR epr) throws RegistryException;
+	/** 
+	 * Find all Services assigned to the Red Hat/JBossESB organization.
+	 * @return Collection of Strings containing the service names.
+	 * @throws RegistryException
+	 */
+	public Collection<String> findAllServices() throws RegistryException;
+	/**
+	 * Find all services that belong to the supplied category. 
+	 * 
+	 * @param serviceCategoryName - name of the category to which the service belongs.
+	 * @return Collection of Strings containing the service names
+	 * @throws RegistryException
+	 */
+	public Collection<String> findServices(String serviceCategoryName) throws RegistryException;
+	/**
+	 * Finds all the EPRs that belong to a specific category and service combination.
+	 * 
+	 * @param serviceCategoryName - name of the category to which the service belongs.
+	 * @param serviceName         - name of the service to which the EPS belongs.
+	 * @return Collection of EPRs.
+	 * @throws RegistryException
+	 */
+	public Collection<EPR> findEPRs(String serviceCategoryName, String serviceName) throws RegistryException;
+	/**
+	 * Returns the first EPR in the list that belong to a specific category and service combination.
+	 * 
+	 * @param serviceCategoryName - name of the category to which the service belongs.
+	 * @param serviceName         - name of the service to which the EPS belongs.
+	 * @return EPR.
+	 * @throws RegistryException
+	 */
+	public EPR findEPR(String serviceCategoryName, String serviceName) throws RegistryException;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,42 +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.services.registry;
-
-/**
- * @author kstam
- * 
- */
-public class RegistryException extends Exception {
-    private static final long serialVersionUID = 1L;
-    
-    public RegistryException(){
-        super();
-    }
-    
-    public RegistryException (String msg){
-        super(msg);
-    }
-    
-    public RegistryException (String msg, Throwable cause){
-        super (msg, cause);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,42 @@
+/*
+ * 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.services.registry;
+
+/**
+ * @author kstam
+ * 
+ */
+public class RegistryException extends Exception {
+    private static final long serialVersionUID = 1L;
+    
+    public RegistryException(){
+        super();
+    }
+    
+    public RegistryException (String msg){
+        super(msg);
+    }
+    
+    public RegistryException (String msg, Throwable cause){
+        super (msg, cause);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,83 +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.services.registry;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.common.Configuration;
-import org.jboss.soa.esb.util.ClassUtil;
-
-/**
- * Returns an Instance of the Registry.
- * 
- * @author kstam
- * 
- */
-public class RegistryFactory
-{
-	private static Logger logger = Logger.getLogger(RegistryFactory.class);
-
-   private static Registry singleton;
-
-   public static synchronized void setRegistry(Registry registry)
-   {
-      singleton = registry;
-   }
-
-
-   public static Registry getRegistry() throws RegistryException
-	{
-      // no synchronized block as there should be a service that initializes this
-      if (singleton != null) return singleton;
-      return createRegistry();
-	}
-
-   public static Registry createRegistry()
-           throws RegistryException
-   {
-      Registry registry = null;
-      String className = Configuration.getRegistryImplementationClass();
-      logger.log(Level.DEBUG, "Going to load " + className);
-
-      try
-		{
-            // instruct class loader to load the Registry Implementation
-         Class registryClass = ClassUtil.forName(className, RegistryFactory.class);
-         // Try to instance the Registry
-         registry = (Registry) registryClass.newInstance();
-      }
-      catch (ClassNotFoundException cnfex)
-      {
-         throw new RegistryException("Registry Implementation=" + className
-               + " not found", cnfex);
-      }
-      catch (Exception e)
-      {
-         e.printStackTrace();
-
-         throw new RegistryException("Invocation exception. "
-               + e.getLocalizedMessage(), e);
-      }
-
-      return registry;
-   }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/registry/RegistryFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,83 @@
+/*
+ * 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.services.registry;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.common.Configuration;
+import org.jboss.soa.esb.util.ClassUtil;
+
+/**
+ * Returns an Instance of the Registry.
+ * 
+ * @author kstam
+ * 
+ */
+public class RegistryFactory
+{
+	private static Logger logger = Logger.getLogger(RegistryFactory.class);
+
+   private static Registry singleton;
+
+   public static synchronized void setRegistry(Registry registry)
+   {
+      singleton = registry;
+   }
+
+
+   public static Registry getRegistry() throws RegistryException
+	{
+      // no synchronized block as there should be a service that initializes this
+      if (singleton != null) return singleton;
+      return createRegistry();
+	}
+
+   public static Registry createRegistry()
+           throws RegistryException
+   {
+      Registry registry = null;
+      String className = Configuration.getRegistryImplementationClass();
+      logger.log(Level.DEBUG, "Going to load " + className);
+
+      try
+		{
+            // instruct class loader to load the Registry Implementation
+         Class registryClass = ClassUtil.forName(className, RegistryFactory.class);
+         // Try to instance the Registry
+         registry = (Registry) registryClass.newInstance();
+      }
+      catch (ClassNotFoundException cnfex)
+      {
+         throw new RegistryException("Registry Implementation=" + className
+               + " not found", cnfex);
+      }
+      catch (Exception e)
+      {
+         e.printStackTrace();
+
+         throw new RegistryException("Invocation exception. "
+               + e.getLocalizedMessage(), e);
+      }
+
+      return registry;
+   }
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,191 +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.services.routing;
-
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.List;
-import java.util.UUID;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
-
-/**
- * Generic Message Router Interface.
- * 
- * @author kurt.stam at redhat.com
- * 
- */
-public abstract class MessageRouter
-{
-	private static Logger logger = Logger.getLogger(MessageRouter.class);
-	public final static String AGGEGRATOR_TAG = "aggregatorTag";
-    public final static String SPLITTER_TIME_STAMP = "splitterTimeStamp";
-    public static final String INTERNAL_SERVICE_CATEGORY = "JBossESB-Internal";
-    public static final String DEAD_LETTER_SERVICE_NAME = "DeadLetterService";
-	
-	/**
-	 * Routes the message to the next destination.
-	 * 
-	 * @param message
-	 * @return List of Strings containing the services to which the message was
-	 *         routed.
-	 */
-	public abstract List<String> route(Message message)
-    throws MessageRouterException;
-
-    /**
-     * Sends the message on to the service with the name(s) we just obtained
-     * from the routing.
-     * 
-     * @param serviceCategory -
-     *            the service category
-     * @param serviceName -
-     *            the service name
-     * @param message -
-     *            the message that needs routing and delivery
-     */
-    @SuppressWarnings("unchecked")
-    public synchronized static void deliverMessage(
-            String serviceCategory, String serviceName, Message message) throws MessageRouterException
-    {
-        boolean isSent = false;
-        Exception lastException = null;
-        try
-        {
-            Registry registry = RegistryFactory.getRegistry();
-            logger.log(Level.DEBUG, "Looking for EPRs for category="
-                    + serviceCategory + " and serviceName=" + serviceName);
-            Collection<EPR> eprs = registry.findEPRs(serviceCategory, serviceName);
-            for (Iterator<EPR> eprIter = eprs.iterator(); eprIter.hasNext();)
-            {
-                EPR epr = eprs.iterator().next();
-                logger.log(Level.DEBUG, "Message=" + message
-                        + " -> Destination=" + serviceCategory + "-" + serviceName);
-                try
-                {
-                    //TODO I think the following if block should be part of
-                    //the FileEpr construction?
-                    if (epr instanceof FileEpr) {
-                        try {
-                            FileEpr fileEpr = (FileEpr) epr;
-                            FileEpr newEpr = new FileEpr(fileEpr.getURL());
-                            newEpr.setPostDelete(false);
-                            newEpr.setPostDirectory(fileEpr.getURL().getFile());
-                            newEpr.setPostSuffix(fileEpr.getInputSuffix());
-                            epr = newEpr;
-                        } catch (URISyntaxException usex) {
-                            logger.log(Level.ERROR, "Malformed epr while setting :"
-                                    + epr, usex);
-                        } catch (MalformedURLException muex) {
-                            logger.log(Level.ERROR, "Malformed epr:"
-                                    + epr, muex);
-                        }
-                    }
-                    // Give the message to the courier
-                    Courier courier = CourierFactory.getCourier(epr);
-                                            try
-                                            {
-                                                courier.deliver(message);
-                                            }
-                                            finally
-                                            {
-                                                CourierUtil.cleanCourier(courier) ;
-                                            }
-                    isSent = true;
-                    break;
-                } catch (MalformedEPRException ex) {
-                    logger.log(Level.ERROR, "Malformed epr:" + epr);
-                    lastException = ex;
-                } catch (CourierException ce) {
-                    logger.log(Level.ERROR, "Could not send using epr:"
-                            + epr, ce);
-                     lastException = ce;
-                    // if there are more eprs in the collection is will try
-                    // the next one.
-                }
-            }
-            if (isSent == false)
-            {
-                logger.log(Level.ERROR, "Could not find any valid EPRs. Message is not routed.", lastException);
-                throw new MessageRouterException("Message Could not be delivered. ", lastException);
-            }
-        } catch (RegistryException re) {
-            logger.log(Level.ERROR, "Could not obtain an EPR from the Registry. Message is not routed. "
-                            + re.getLocalizedMessage(), re);
-            throw new MessageRouterException("Message Could not be delivered due to issues with the Registry. "
-                    + re.getMessage(), re);
-        }
-    }
-	/**
-	 * Sends the message on to the service with the name(s) we just obtained
-	 * from the routing.
-	 * 
-	 * @param destinations -
-	 *            Collection with the name of the destination services.
-	 * @param message -
-	 *            the message that needs routing and delivery
-	 */
-    @SuppressWarnings("unchecked")
-    public synchronized static void deliverMessages(
-			Collection<String[]> destinations, Message message) throws MessageRouterException
-	{
-        String uuId = UUID.randomUUID().toString();
-        int counter=0;
-      
-       
-		for (Iterator<String[]> i = destinations.iterator(); i.hasNext();)
-		{
-            //Only put tags on when routing to more then 1 destination
-            if (destinations.size()>1) {
-                ArrayList<String> aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(AGGEGRATOR_TAG);
-                if (aggregatorTags==null) {
-                    aggregatorTags = new ArrayList<String>();
-                }
-                String tag = uuId + ":" + ++counter + ":" + destinations.size() + ":" + new java.util.Date().getTime();
-                aggregatorTags.add(tag);
-                message.getProperties().setProperty(AGGEGRATOR_TAG, aggregatorTags);
-                if (logger.isDebugEnabled()) {
-                    logger.debug(AGGEGRATOR_TAG+ "=" + tag);
-                }
-            }
-            String[] destination = (String[]) i.next();
-            deliverMessage(destination[0], destination[1], message);
-            
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,191 @@
+/*
+ * 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.services.routing;
+
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.List;
+import java.util.UUID;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.Registry;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.RegistryFactory;
+
+/**
+ * Generic Message Router Interface.
+ * 
+ * @author kurt.stam at redhat.com
+ * 
+ */
+public abstract class MessageRouter
+{
+	private static Logger logger = Logger.getLogger(MessageRouter.class);
+	public final static String AGGEGRATOR_TAG = "aggregatorTag";
+    public final static String SPLITTER_TIME_STAMP = "splitterTimeStamp";
+    public static final String INTERNAL_SERVICE_CATEGORY = "JBossESB-Internal";
+    public static final String DEAD_LETTER_SERVICE_NAME = "DeadLetterService";
+	
+	/**
+	 * Routes the message to the next destination.
+	 * 
+	 * @param message
+	 * @return List of Strings containing the services to which the message was
+	 *         routed.
+	 */
+	public abstract List<String> route(Message message)
+    throws MessageRouterException;
+
+    /**
+     * Sends the message on to the service with the name(s) we just obtained
+     * from the routing.
+     * 
+     * @param serviceCategory -
+     *            the service category
+     * @param serviceName -
+     *            the service name
+     * @param message -
+     *            the message that needs routing and delivery
+     */
+    @SuppressWarnings("unchecked")
+    public synchronized static void deliverMessage(
+            String serviceCategory, String serviceName, Message message) throws MessageRouterException
+    {
+        boolean isSent = false;
+        Exception lastException = null;
+        try
+        {
+            Registry registry = RegistryFactory.getRegistry();
+            logger.log(Level.DEBUG, "Looking for EPRs for category="
+                    + serviceCategory + " and serviceName=" + serviceName);
+            Collection<EPR> eprs = registry.findEPRs(serviceCategory, serviceName);
+            for (Iterator<EPR> eprIter = eprs.iterator(); eprIter.hasNext();)
+            {
+                EPR epr = eprs.iterator().next();
+                logger.log(Level.DEBUG, "Message=" + message
+                        + " -> Destination=" + serviceCategory + "-" + serviceName);
+                try
+                {
+                    //TODO I think the following if block should be part of
+                    //the FileEpr construction?
+                    if (epr instanceof FileEpr) {
+                        try {
+                            FileEpr fileEpr = (FileEpr) epr;
+                            FileEpr newEpr = new FileEpr(fileEpr.getURL());
+                            newEpr.setPostDelete(false);
+                            newEpr.setPostDirectory(fileEpr.getURL().getFile());
+                            newEpr.setPostSuffix(fileEpr.getInputSuffix());
+                            epr = newEpr;
+                        } catch (URISyntaxException usex) {
+                            logger.log(Level.ERROR, "Malformed epr while setting :"
+                                    + epr, usex);
+                        } catch (MalformedURLException muex) {
+                            logger.log(Level.ERROR, "Malformed epr:"
+                                    + epr, muex);
+                        }
+                    }
+                    // Give the message to the courier
+                    Courier courier = CourierFactory.getCourier(epr);
+                                            try
+                                            {
+                                                courier.deliver(message);
+                                            }
+                                            finally
+                                            {
+                                                CourierUtil.cleanCourier(courier) ;
+                                            }
+                    isSent = true;
+                    break;
+                } catch (MalformedEPRException ex) {
+                    logger.log(Level.ERROR, "Malformed epr:" + epr);
+                    lastException = ex;
+                } catch (CourierException ce) {
+                    logger.log(Level.ERROR, "Could not send using epr:"
+                            + epr, ce);
+                     lastException = ce;
+                    // if there are more eprs in the collection is will try
+                    // the next one.
+                }
+            }
+            if (isSent == false)
+            {
+                logger.log(Level.ERROR, "Could not find any valid EPRs. Message is not routed.", lastException);
+                throw new MessageRouterException("Message Could not be delivered. ", lastException);
+            }
+        } catch (RegistryException re) {
+            logger.log(Level.ERROR, "Could not obtain an EPR from the Registry. Message is not routed. "
+                            + re.getLocalizedMessage(), re);
+            throw new MessageRouterException("Message Could not be delivered due to issues with the Registry. "
+                    + re.getMessage(), re);
+        }
+    }
+	/**
+	 * Sends the message on to the service with the name(s) we just obtained
+	 * from the routing.
+	 * 
+	 * @param destinations -
+	 *            Collection with the name of the destination services.
+	 * @param message -
+	 *            the message that needs routing and delivery
+	 */
+    @SuppressWarnings("unchecked")
+    public synchronized static void deliverMessages(
+			Collection<String[]> destinations, Message message) throws MessageRouterException
+	{
+        String uuId = UUID.randomUUID().toString();
+        int counter=0;
+      
+       
+		for (Iterator<String[]> i = destinations.iterator(); i.hasNext();)
+		{
+            //Only put tags on when routing to more then 1 destination
+            if (destinations.size()>1) {
+                ArrayList<String> aggregatorTags = (ArrayList<String>) message.getProperties().getProperty(AGGEGRATOR_TAG);
+                if (aggregatorTags==null) {
+                    aggregatorTags = new ArrayList<String>();
+                }
+                String tag = uuId + ":" + ++counter + ":" + destinations.size() + ":" + new java.util.Date().getTime();
+                aggregatorTags.add(tag);
+                message.getProperties().setProperty(AGGEGRATOR_TAG, aggregatorTags);
+                if (logger.isDebugEnabled()) {
+                    logger.debug(AGGEGRATOR_TAG+ "=" + tag);
+                }
+            }
+            String[] destination = (String[]) i.next();
+            deliverMessage(destination[0], destination[1], message);
+            
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouterException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouterException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouterException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,51 +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.services.routing;
-
-/**
- * @author kstam
- * 
- */
-public class MessageRouterException extends Exception
-{
-	private static final long serialVersionUID = 1L;
-
-	public MessageRouterException()
-	{
-		super();
-	}
-
-	public MessageRouterException(String msg)
-	{
-		super(msg);
-	}
-
-	public MessageRouterException (Throwable cause)
-	{
-		super(cause);
-	}
-	
-	public MessageRouterException(String msg, Throwable cause)
-	{
-		super(msg, cause);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouterException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouterException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouterException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/MessageRouterException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,51 @@
+/*
+ * 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.services.routing;
+
+/**
+ * @author kstam
+ * 
+ */
+public class MessageRouterException extends Exception
+{
+	private static final long serialVersionUID = 1L;
+
+	public MessageRouterException()
+	{
+		super();
+	}
+
+	public MessageRouterException(String msg)
+	{
+		super(msg);
+	}
+
+	public MessageRouterException (Throwable cause)
+	{
+		super(cause);
+	}
+	
+	public MessageRouterException(String msg, Throwable cause)
+	{
+		super(msg, cause);
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/CBRException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/CBRException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/CBRException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,69 +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.services.routing.cbr;
-
-/**
- * Configuration Exception.
- * 
- * @since Version 4.0
- */
-public class CBRException extends Exception
-{
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param message
-	 *            Exception message.
-	 */
-	public CBRException (String message)
-	{
-		super(message);
-	}
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param message
-	 *            Exception message.
-	 * @param cause
-	 *            Exception cause.
-	 */
-	public CBRException (String message, Throwable cause)
-	{
-		super(message, cause);
-	}
-
-	/**
-	 * Construct an exception instance.
-	 * 
-	 * @param cause
-	 *            Exception cause.
-	 */
-	public CBRException (Throwable cause)
-	{
-		super(cause);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/CBRException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/CBRException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/CBRException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/CBRException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,69 @@
+/*
+ * 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.services.routing.cbr;
+
+/**
+ * Configuration Exception.
+ * 
+ * @since Version 4.0
+ */
+public class CBRException extends Exception
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 */
+	public CBRException (String message)
+	{
+		super(message);
+	}
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param message
+	 *            Exception message.
+	 * @param cause
+	 *            Exception cause.
+	 */
+	public CBRException (String message, Throwable cause)
+	{
+		super(message, cause);
+	}
+
+	/**
+	 * Construct an exception instance.
+	 * 
+	 * @param cause
+	 *            Exception cause.
+	 */
+	public CBRException (Throwable cause)
+	{
+		super(cause);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,75 +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.services.routing.cbr;
-
-import java.util.List;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.routing.MessageRouter;
-import org.jboss.soa.esb.services.routing.MessageRouterException;
-
-/**
- * Content Based Router Interface.
- * 
- * @author kurt.stam at redhat.com
- * 
- */
-public abstract class ContentBasedRouter extends MessageRouter
-{
-	/**
-	 * Route a message using a certain ruleSet wich and reference a custom
-	 * Domain Specific Language (DSL).
-	 * 
-	 * @param ruleSet -
-	 *            String reference to a file which contains a ruleSet.
-	 * @param ruleLanguage -
-	 *            String reference to a file which contais a custom rule
-	 *            language definition
-	 * @param ruleReload -
-	 *            if set to true, a ruleSet update should result in reloading
-	 *            the ruleSet.
-	 * @param message -
-	 *            Message that needs routing.
-     * @param objectList - a list with additional objects (typically pulled from the message)
-     * 
-	 * @return List of routing destinations.
-	 */
-	public abstract List<String> route (String ruleSet, String ruleLanguage,
-			boolean ruleReload, Message message, List<Object> objectList) throws MessageRouterException;
-
-	/**
-	 * Route a message using a certain ruleSet.
-	 * 
-	 * @param ruleSet -
-	 *            String reference to a file which contains a ruleSet.
-	 * @param ruleReload -
-	 *            if set to true, a ruleSet update should result in reloading
-	 *            the ruleSet.
-	 * @param message -
-	 *            Message that needs routing.
-     * @param objectList - a list with additional objects (typically pulled from the message)
-     * 
-	 * @return List of routing destinations.
-	 */
-	public abstract List<String> route (String ruleSet, boolean ruleReload,
-			Message message, List<Object> objectList) throws MessageRouterException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,75 @@
+/*
+ * 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.services.routing.cbr;
+
+import java.util.List;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.routing.MessageRouter;
+import org.jboss.soa.esb.services.routing.MessageRouterException;
+
+/**
+ * Content Based Router Interface.
+ * 
+ * @author kurt.stam at redhat.com
+ * 
+ */
+public abstract class ContentBasedRouter extends MessageRouter
+{
+	/**
+	 * Route a message using a certain ruleSet wich and reference a custom
+	 * Domain Specific Language (DSL).
+	 * 
+	 * @param ruleSet -
+	 *            String reference to a file which contains a ruleSet.
+	 * @param ruleLanguage -
+	 *            String reference to a file which contais a custom rule
+	 *            language definition
+	 * @param ruleReload -
+	 *            if set to true, a ruleSet update should result in reloading
+	 *            the ruleSet.
+	 * @param message -
+	 *            Message that needs routing.
+     * @param objectList - a list with additional objects (typically pulled from the message)
+     * 
+	 * @return List of routing destinations.
+	 */
+	public abstract List<String> route (String ruleSet, String ruleLanguage,
+			boolean ruleReload, Message message, List<Object> objectList) throws MessageRouterException;
+
+	/**
+	 * Route a message using a certain ruleSet.
+	 * 
+	 * @param ruleSet -
+	 *            String reference to a file which contains a ruleSet.
+	 * @param ruleReload -
+	 *            if set to true, a ruleSet update should result in reloading
+	 *            the ruleSet.
+	 * @param message -
+	 *            Message that needs routing.
+     * @param objectList - a list with additional objects (typically pulled from the message)
+     * 
+	 * @return List of routing destinations.
+	 */
+	public abstract List<String> route (String ruleSet, boolean ruleReload,
+			Message message, List<Object> objectList) throws MessageRouterException;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,53 +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.services.routing.cbr;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.services.routing.MessageRouterException;
-import org.jboss.soa.esb.util.ClassUtil;
-/**
- * Returns an instance of the Registry.
- *
- * @author kurt.stam at redhat.com
- *
- */
-public class ContentBasedRouterFactory {
-    private static Logger logger = Logger.getLogger(ContentBasedRouterFactory.class);
-
-    public static ContentBasedRouter getRouter(String className) throws MessageRouterException
-    {
-	ContentBasedRouter cbr = null;
-        logger.log(Level.DEBUG, "Going to load " + className);
-    try {
-        // instruct class loader to load the Content Based  Router Implementation
-        Class cbrClass = ClassUtil.forName(className, ContentBasedRouterFactory.class);
-        // Try to get an instance of the CBR
-        cbr = (ContentBasedRouter) cbrClass.newInstance();
-    } catch (ClassNotFoundException cnfex) {
-        throw new MessageRouterException("Content Based Router Implementation=" + className + " not found", cnfex);
-    } catch (Exception e) {
-    	throw new MessageRouterException(className + " invokation problem. " + e.getLocalizedMessage(), e);
-    		}
-    		return cbr;
-    	}
-    }

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/routing/cbr/ContentBasedRouterFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,53 @@
+/*
+* 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.services.routing.cbr;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.services.routing.MessageRouterException;
+import org.jboss.soa.esb.util.ClassUtil;
+/**
+ * Returns an instance of the Registry.
+ *
+ * @author kurt.stam at redhat.com
+ *
+ */
+public class ContentBasedRouterFactory {
+    private static Logger logger = Logger.getLogger(ContentBasedRouterFactory.class);
+
+    public static ContentBasedRouter getRouter(String className) throws MessageRouterException
+    {
+	ContentBasedRouter cbr = null;
+        logger.log(Level.DEBUG, "Going to load " + className);
+    try {
+        // instruct class loader to load the Content Based  Router Implementation
+        Class cbrClass = ClassUtil.forName(className, ContentBasedRouterFactory.class);
+        // Try to get an instance of the CBR
+        cbr = (ContentBasedRouter) cbrClass.newInstance();
+    } catch (ClassNotFoundException cnfex) {
+        throw new MessageRouterException("Content Based Router Implementation=" + className + " not found", cnfex);
+    } catch (Exception e) {
+    	throw new MessageRouterException(className + " invokation problem. " + e.getLocalizedMessage(), e);
+    		}
+    		return cbr;
+    	}
+    }

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,60 +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.services.transform;
-
-import org.jboss.soa.esb.BaseException;
-
-/**
- * Transformation Service Exception.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class TransformationException extends BaseException {
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-	 * Public constructor.
-	 * @param message Exception message.
-	 */
-	public TransformationException(String message) {
-		super(message);
-	}
-
-	/**
-	 * Public constructor.
-	 * @param message Exception message.
-	 * @param cause Exception cause.
-	 */
-	public TransformationException(String message, Throwable cause) {
-		super(message, cause);
-	}
-
-	/**
-	 * Public constructor.
-	 * @param cause Exception cause.
-	 */
-	public TransformationException(Throwable cause) {
-		super(cause);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,60 @@
+/*
+ * 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.services.transform;
+
+import org.jboss.soa.esb.BaseException;
+
+/**
+ * Transformation Service Exception.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class TransformationException extends BaseException {
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+	 * Public constructor.
+	 * @param message Exception message.
+	 */
+	public TransformationException(String message) {
+		super(message);
+	}
+
+	/**
+	 * Public constructor.
+	 * @param message Exception message.
+	 * @param cause Exception cause.
+	 */
+	public TransformationException(String message, Throwable cause) {
+		super(message, cause);
+	}
+
+	/**
+	 * Public constructor.
+	 * @param cause Exception cause.
+	 */
+	public TransformationException(Throwable cause) {
+		super(cause);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationService.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationService.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationService.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,40 +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.services.transform;
-
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Transformation Service interface.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public interface TransformationService {
-	
-	/**
-	 * Transform the supplied message object and return the transformation result.
-	 * @param message The message to be transformed.
-	 * @return The transformed message.
-	 * @throws TransformationException An Exception occured during the transformation process.
-	 */
-	public Message transform(Message message) throws TransformationException;
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationService.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationService.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationService.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/services/transform/TransformationService.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,40 @@
+/*
+ * 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.services.transform;
+
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Transformation Service interface.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public interface TransformationService {
+	
+	/**
+	 * Transform the supplied message object and return the transformation result.
+	 * @param message The message to be transformed.
+	 * @return The transformed message.
+	 * @throws TransformationException An Exception occured during the transformation process.
+	 */
+	public Message transform(Message message) throws TransformationException;
+}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util)

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,139 +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.Serializable;
-import java.net.URI;
-import java.net.URISyntaxException;
-import java.util.HashMap;
-import java.util.Map;
-import java.util.UUID;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-/**
- * Auxiliary class that deals with implementation details of event messages handled by ESB aware applications.
- * <p/>The '_command' enumeration is inteded to contain all accepted command codes, and should be provided 
- * by all classes that extend AbstractCommandMessage
- * <br/>Values that this class is able to render are (arbitrarily) stored in a Map<String,Object>
- * contained in the message body as a named Object with key getCommandValuesTag()
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a> 
- *
- */
-public abstract class AbstractCommandVehicle implements Serializable
-{
-	/**
-	 * Provide a name for the named object to look for in the ESB Message body.
-	 * @return String : intended to be used as the key in Message.getBody().get(arg) 
-	 */
-	public abstract String getCommandValuesTag();
-	
-	/**
-	 * The key for the command operation code in the command values map
-	 * @return String : intended to be used as the key in _values.get(arg) 
-	 */
-	public abstract String getCommandOpcodeKey();
-	
-	/**
-	 * Valid operator for this command vehicle, from String value
-	 * @param value - the String value of the operator
-	 * @return the Enum value that represents arg0
-	 */	
-	public abstract Enum operatorFromString(String value);
-	
-	private Logger _logger = Logger.getLogger(AbstractCommandVehicle.class);
-	
-	protected Map<String,Object>_values = new HashMap<String,Object>();
-
-	protected Enum	_operator;
-	public 	  Enum 	getOperator()				{ return _operator; }
-	protected void 	setOperator(Enum operator)	{ _operator = operator; }
-	
-	protected AbstractCommandVehicle(Enum command)
-	{
-		_operator	= command;
-	}
-	
-	/**
-	 * Populate this event's associated values contained in the ESB message
-	 * <br/>Values that this class is able to render are expected to be in a Map&lt;String,Object&gt;
-	 * contained in the message body as a named Object (key=getCommandValuesTag())
-	 * @param message : Message - the vehicle of this command
-	 */
-	@SuppressWarnings("unchecked")
-	protected AbstractCommandVehicle(Message message)
-	{ 
-		Object obj = message.getBody().get(getCommandValuesTag());
-		if (! (obj instanceof Map))
-			throw new IllegalArgumentException("Message command values must be stored as a Map<String,Object>");
-		_values.putAll((Map)obj);
-		_operator	= operatorFromString((String)_values.get(getCommandOpcodeKey()));
-		_values.remove(getCommandValuesTag());
-	} //________________________________
-	
-	/**
-	 * Instantiate a new message, and put values where they belong
-	 * @return Message - a fresh Message, with the command values in the appropriate spot
-	 */
-	public Message toCommandMessage() 			
-	{
-		Message message = MessageFactory.getInstance().getMessage();
-		URI	 uri	= null;
-		try  { uri = new URI(UUID.randomUUID().toString()); }
-		catch (URISyntaxException e)
-		{
-			_logger.fatal("Problem with UUID.randomUUID() - This should not happen");
-			return null;
-		}
-		message.getHeader().getCall().setMessageID(uri);
-
-		_values.put(getCommandOpcodeKey(), _operator.toString());
-		message.getBody().add(getCommandValuesTag(), _values);
-			
-		return message;
-	} //________________________________
-	
-	/**
-	 * Clean all values from this command object
-	 * <br/>Operator will still remain the same as before
-	 * @return Map<String,Object>  the old contents of _values
-	 */
-	public Map <String,Object>cleanValues()
-	{
-		Map <String,Object> oldVals = _values;
-		_values = new HashMap<String,Object>();
-		return oldVals;
-	} //________________________________
-	
-	protected Object setValue(String key, Object value)
-	{
-		if (null==key)
-			throw new IllegalArgumentException("Key must not be null");
-		Object oldVal	= _values.get(key);
-		if (null==value)
-			_values.remove(key);
-		else
-			oldVal	= _values.put(key, value);
-		return oldVal;
-	} //________________________________
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/AbstractCommandVehicle.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,139 @@
+/*
+ * 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.Serializable;
+import java.net.URI;
+import java.net.URISyntaxException;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.UUID;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+/**
+ * Auxiliary class that deals with implementation details of event messages handled by ESB aware applications.
+ * <p/>The '_command' enumeration is inteded to contain all accepted command codes, and should be provided 
+ * by all classes that extend AbstractCommandMessage
+ * <br/>Values that this class is able to render are (arbitrarily) stored in a Map<String,Object>
+ * contained in the message body as a named Object with key getCommandValuesTag()
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a> 
+ *
+ */
+public abstract class AbstractCommandVehicle implements Serializable
+{
+	/**
+	 * Provide a name for the named object to look for in the ESB Message body.
+	 * @return String : intended to be used as the key in Message.getBody().get(arg) 
+	 */
+	public abstract String getCommandValuesTag();
+	
+	/**
+	 * The key for the command operation code in the command values map
+	 * @return String : intended to be used as the key in _values.get(arg) 
+	 */
+	public abstract String getCommandOpcodeKey();
+	
+	/**
+	 * Valid operator for this command vehicle, from String value
+	 * @param value - the String value of the operator
+	 * @return the Enum value that represents arg0
+	 */	
+	public abstract Enum operatorFromString(String value);
+	
+	private Logger _logger = Logger.getLogger(AbstractCommandVehicle.class);
+	
+	protected Map<String,Object>_values = new HashMap<String,Object>();
+
+	protected Enum	_operator;
+	public 	  Enum 	getOperator()				{ return _operator; }
+	protected void 	setOperator(Enum operator)	{ _operator = operator; }
+	
+	protected AbstractCommandVehicle(Enum command)
+	{
+		_operator	= command;
+	}
+	
+	/**
+	 * Populate this event's associated values contained in the ESB message
+	 * <br/>Values that this class is able to render are expected to be in a Map&lt;String,Object&gt;
+	 * contained in the message body as a named Object (key=getCommandValuesTag())
+	 * @param message : Message - the vehicle of this command
+	 */
+	@SuppressWarnings("unchecked")
+	protected AbstractCommandVehicle(Message message)
+	{ 
+		Object obj = message.getBody().get(getCommandValuesTag());
+		if (! (obj instanceof Map))
+			throw new IllegalArgumentException("Message command values must be stored as a Map<String,Object>");
+		_values.putAll((Map)obj);
+		_operator	= operatorFromString((String)_values.get(getCommandOpcodeKey()));
+		_values.remove(getCommandValuesTag());
+	} //________________________________
+	
+	/**
+	 * Instantiate a new message, and put values where they belong
+	 * @return Message - a fresh Message, with the command values in the appropriate spot
+	 */
+	public Message toCommandMessage() 			
+	{
+		Message message = MessageFactory.getInstance().getMessage();
+		URI	 uri	= null;
+		try  { uri = new URI(UUID.randomUUID().toString()); }
+		catch (URISyntaxException e)
+		{
+			_logger.fatal("Problem with UUID.randomUUID() - This should not happen");
+			return null;
+		}
+		message.getHeader().getCall().setMessageID(uri);
+
+		_values.put(getCommandOpcodeKey(), _operator.toString());
+		message.getBody().add(getCommandValuesTag(), _values);
+			
+		return message;
+	} //________________________________
+	
+	/**
+	 * Clean all values from this command object
+	 * <br/>Operator will still remain the same as before
+	 * @return Map<String,Object>  the old contents of _values
+	 */
+	public Map <String,Object>cleanValues()
+	{
+		Map <String,Object> oldVals = _values;
+		_values = new HashMap<String,Object>();
+		return oldVals;
+	} //________________________________
+	
+	protected Object setValue(String key, Object value)
+	{
+		if (null==key)
+			throw new IllegalArgumentException("Key must not be null");
+		Object oldVal	= _values.get(key);
+		if (null==value)
+			_values.remove(key);
+		else
+			oldVal	= _values.put(key, value);
+		return oldVal;
+	} //________________________________
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/BeanConfigurator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/BeanConfigurator.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/BeanConfigurator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,152 +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.beans.BeanInfo;
-import java.beans.IntrospectionException;
-import java.beans.Introspector;
-import java.beans.PropertyDescriptor;
-import java.beans.PropertyEditor;
-import java.beans.PropertyEditorManager;
-import java.lang.reflect.Method;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-
-/**
- * The BeanConfigurator knows how to map a ConfigTree to JavaBean properties.
- * 
- * @author <a href="mailto:rex.sheridan at sapience360.com">Rex Sheridan</a>
- */
-public class BeanConfigurator {
-
-	private PropertyDescriptor[] descriptors;
-
-	private Object bean;
-
-	private Map<String, String> properties;
-
-	public BeanConfigurator() {
-		super();
-	}
-
-	public BeanConfigurator(ConfigTree config, Object bean) {
-		List<KeyValuePair> pairs = config.childPropertyList();
-		properties = new HashMap<String, String>();
-		for (KeyValuePair kvp : pairs) {
-			properties.put(kvp.getKey(), kvp.getValue());
-		}
-		this.bean = bean;
-	}
-
-	public BeanConfigurator(Map<String, String> properties, Object bean) {
-		this.properties = properties;
-		this.bean = bean;
-	}
-
-	public void configure() throws IntrospectionException {
-		Class<? extends Object> beanClass = bean.getClass();
-		BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
-		descriptors = beanInfo.getPropertyDescriptors();
-
-		for (Entry<String, String> entry : properties.entrySet()) {
-			String key = entry.getKey();
-			key = Introspector.decapitalize(key);
-			PropertyDescriptor descriptor = getPropertyDescriptor(key);
-			if (descriptor == null) {
-				throw new IllegalArgumentException("'" + key
-						+ "' property not found on " + beanClass.getName());
-			}
-			setProperty(descriptor, key, entry.getValue());
-		}
-	}
-
-	protected void setProperty(PropertyDescriptor descriptor, String name,
-			String value) {
-		Method setter = descriptor.getWriteMethod();
-		if (setter == null) {
-			throw new IllegalArgumentException("No setter for property ["
-					+ name + "]");
-		}
-
-		Object arg;
-		Class<?> propertyType = descriptor.getPropertyType();
-		PropertyEditor editor = PropertyEditorManager.findEditor(propertyType);
-		if (editor == null) {
-			throw new IllegalArgumentException(
-					"Unable to find suitable property editor for property="
-							+ name + " type=" + propertyType.getName());
-		}
-		editor.setAsText(value);
-		arg = editor.getValue();
-
-		try {
-			setter.invoke(bean, new Object[] { arg });
-		} catch (Exception ex) {
-			throw new RuntimeException("Unable to set property named '+" + name
-					+ "'", ex);
-		}
-	}
-
-	protected PropertyDescriptor getPropertyDescriptor(String name) {
-		for (int i = 0; i < descriptors.length; i++) {
-			if (name.equals(descriptors[i].getName())) {
-				return descriptors[i];
-			}
-		}
-		return null;
-	}
-
-	/**
-	 * @return the bean
-	 */
-	public Object getBean() {
-		return bean;
-	}
-
-	/**
-	 * @param bean
-	 *            the bean to set
-	 */
-	public void setBean(Object bean) {
-		this.bean = bean;
-	}
-
-	/**
-	 * @return the properties
-	 */
-	public Map<String, String> getProperties() {
-		return properties;
-	}
-
-	/**
-	 * @param properties
-	 *            the properties to set
-	 */
-	public void setProperties(Map<String, String> properties) {
-		this.properties = properties;
-	}
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/BeanConfigurator.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/BeanConfigurator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/BeanConfigurator.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/BeanConfigurator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,152 @@
+/*
+ * 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.beans.BeanInfo;
+import java.beans.IntrospectionException;
+import java.beans.Introspector;
+import java.beans.PropertyDescriptor;
+import java.beans.PropertyEditor;
+import java.beans.PropertyEditorManager;
+import java.lang.reflect.Method;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+
+/**
+ * The BeanConfigurator knows how to map a ConfigTree to JavaBean properties.
+ * 
+ * @author <a href="mailto:rex.sheridan at sapience360.com">Rex Sheridan</a>
+ */
+public class BeanConfigurator {
+
+	private PropertyDescriptor[] descriptors;
+
+	private Object bean;
+
+	private Map<String, String> properties;
+
+	public BeanConfigurator() {
+		super();
+	}
+
+	public BeanConfigurator(ConfigTree config, Object bean) {
+		List<KeyValuePair> pairs = config.childPropertyList();
+		properties = new HashMap<String, String>();
+		for (KeyValuePair kvp : pairs) {
+			properties.put(kvp.getKey(), kvp.getValue());
+		}
+		this.bean = bean;
+	}
+
+	public BeanConfigurator(Map<String, String> properties, Object bean) {
+		this.properties = properties;
+		this.bean = bean;
+	}
+
+	public void configure() throws IntrospectionException {
+		Class<? extends Object> beanClass = bean.getClass();
+		BeanInfo beanInfo = Introspector.getBeanInfo(beanClass);
+		descriptors = beanInfo.getPropertyDescriptors();
+
+		for (Entry<String, String> entry : properties.entrySet()) {
+			String key = entry.getKey();
+			key = Introspector.decapitalize(key);
+			PropertyDescriptor descriptor = getPropertyDescriptor(key);
+			if (descriptor == null) {
+				throw new IllegalArgumentException("'" + key
+						+ "' property not found on " + beanClass.getName());
+			}
+			setProperty(descriptor, key, entry.getValue());
+		}
+	}
+
+	protected void setProperty(PropertyDescriptor descriptor, String name,
+			String value) {
+		Method setter = descriptor.getWriteMethod();
+		if (setter == null) {
+			throw new IllegalArgumentException("No setter for property ["
+					+ name + "]");
+		}
+
+		Object arg;
+		Class<?> propertyType = descriptor.getPropertyType();
+		PropertyEditor editor = PropertyEditorManager.findEditor(propertyType);
+		if (editor == null) {
+			throw new IllegalArgumentException(
+					"Unable to find suitable property editor for property="
+							+ name + " type=" + propertyType.getName());
+		}
+		editor.setAsText(value);
+		arg = editor.getValue();
+
+		try {
+			setter.invoke(bean, new Object[] { arg });
+		} catch (Exception ex) {
+			throw new RuntimeException("Unable to set property named '+" + name
+					+ "'", ex);
+		}
+	}
+
+	protected PropertyDescriptor getPropertyDescriptor(String name) {
+		for (int i = 0; i < descriptors.length; i++) {
+			if (name.equals(descriptors[i].getName())) {
+				return descriptors[i];
+			}
+		}
+		return null;
+	}
+
+	/**
+	 * @return the bean
+	 */
+	public Object getBean() {
+		return bean;
+	}
+
+	/**
+	 * @param bean
+	 *            the bean to set
+	 */
+	public void setBean(Object bean) {
+		this.bean = bean;
+	}
+
+	/**
+	 * @return the properties
+	 */
+	public Map<String, String> getProperties() {
+		return properties;
+	}
+
+	/**
+	 * @param properties
+	 *            the properties to set
+	 */
+	public void setProperties(Map<String, String> properties) {
+		this.properties = properties;
+	}
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,233 +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.IOException;
-import java.io.InputStream;
-import java.net.URISyntaxException;
-import java.net.URL;
-import java.net.URLClassLoader;
-import java.util.ArrayList;
-import java.util.Enumeration;
-import java.util.List;
-import java.util.regex.Matcher;
-import java.util.regex.Pattern;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipFile;
-
-import org.apache.log4j.Logger;
-
-/**
- * Utility methods to aid in class/resource loading.
- * 
- * @author kevin
- */
-public class ClassUtil
-{
-    private static Logger logger = Logger.getLogger(ClassUtil.class);
-
-    /**
-     * Load the specified class.
-     * @param className The name of the class to load.
-     * @param caller The class of the caller.
-     * @return The specified class.
-     * @throws ClassNotFoundException If the class cannot be found.
-     */
-    public static Class forName(final String className, final Class caller)
-        throws ClassNotFoundException
-    {
-        final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
-        if (threadClassLoader != null)
-        {
-            try
-            {
-                return Class.forName(className, true, threadClassLoader) ;
-            }
-            catch (final ClassNotFoundException cnfe) {} // ignore
-        }
-        
-        
-        final ClassLoader classLoader = caller.getClassLoader() ;
-        if (classLoader != null)
-        {
-            try
-            {
-                return Class.forName(className, true, classLoader) ;
-            }
-            catch (final ClassNotFoundException cnfe) {} // ignore
-        }
-        
-        return Class.forName(className, true, ClassLoader.getSystemClassLoader()) ;
-    }
-    
-    /**
-     * Get the specified resource as a stream.
-     * @param resourceName The name of the class to load.
-     * @param caller The class of the caller.
-     * @return The input stream for the resource or null if not found.
-     */
-    public static InputStream getResourceAsStream(final String resourceName, final Class caller)
-    {
-        final String resource ;
-        if (resourceName.startsWith("/"))
-        {
-                resource = resourceName.substring(1) ;
-        }
-        else
-        {
-                final Package callerPackage = caller.getPackage() ;
-                if (callerPackage != null)
-                {
-                        resource = callerPackage.getName().replace('.', '/') + '/' + resourceName ;
-                }
-                else
-                {
-                        resource = resourceName ;
-                }
-        }
-        final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
-        if (threadClassLoader != null)
-        {
-                final InputStream is = threadClassLoader.getResourceAsStream(resource) ;
-                if (is != null)
-                {
-                        return is ;
-                }
-        }
-        
-        final ClassLoader classLoader = caller.getClassLoader() ;
-        if (classLoader != null)
-        {
-                final InputStream is = classLoader.getResourceAsStream(resource) ;
-                if (is != null)
-                {
-                        return is ;
-                }
-        }
-        
-        return ClassLoader.getSystemResourceAsStream(resource) ;
-    }
-
-    /**
-     * Get a package name and convert it to a path value, so it can be used
-     * in calls to methods like {@link #getResourceAsStream}.
-     * <p/>
-     * Adds a '/' prefix and converts all '." characters to '/'.  Doesn't add a
-     * trailing slash.
-     *
-     * @param packageObj The package.
-     * @return The package path.
-     */
-    public static String getPath(Package packageObj) {
-        return "/" + packageObj.getName().replace('.', '/');
-    }
-
-    public static List<String> getResourceList(String regex, Class caller) {
-        ClasspathResourceFilter filter = new ClasspathResourceFilter(regex);
-        ClassLoader classLoader;
-
-        classLoader = Thread.currentThread().getContextClassLoader();
-        if(classLoader instanceof URLClassLoader) {
-            filter.filter((URLClassLoader) classLoader);
-        }
-        classLoader = caller.getClassLoader();
-        if(classLoader instanceof URLClassLoader) {
-            filter.filter((URLClassLoader) classLoader);
-        }
-
-        return filter.getResourceList();
-    }
-
-    private static class ClasspathResourceFilter {
-
-        private List<String> resourceList = new ArrayList<String>();
-        private Pattern pattern;
-
-        private ClasspathResourceFilter(String regex) {
-            pattern = Pattern.compile(regex);
-        }
-
-        private void filter(URLClassLoader classLoader) {
-            URL[] cpUrls = classLoader.getURLs();
-
-            for (int i = 0; i < cpUrls.length; i++) {
-                try {
-                    File file = new File(cpUrls[i].toURI());
-                    if(file.isDirectory()) {
-                        searchClasspathDirTree(file, "");
-                    } else {
-                        searchArchive(file);
-                    }
-                } catch (URISyntaxException e) {
-                    logger.warn("Error searching classpath resource URL '" + cpUrls[i] + "' for resource '" + pattern.pattern() + "': " + e.getMessage());
-                } catch (IOException e) {
-                    logger.warn("Error searching classpath resource URL '" + cpUrls[i] + "' for resource '" + pattern.pattern() + "': " + e.getMessage());
-                }
-            }
-        }
-
-        private void searchClasspathDirTree(File rootDir, String subDir) {
-            File currentDir = new File(rootDir, subDir);
-            File[] contents = currentDir.listFiles();
-
-            for(File file: contents) {
-                if(file.isDirectory()) {
-                    String subSubDir = subDir + "/" + file.getName();
-                    searchClasspathDirTree(rootDir, subSubDir);
-                } else {
-                    String resClasspathPath = file.toURI().toString().substring(rootDir.toURI().toString().length() - 1);
-                    if(isToBeAdded(resClasspathPath)) {
-                        resourceList.add(resClasspathPath);
-                    }
-                }
-            }
-        }
-
-        private void searchArchive(File archiveFile) throws IOException {
-            ZipFile zip = new ZipFile(archiveFile);
-            Enumeration<? extends ZipEntry> entries = zip.entries();
-
-            while (entries.hasMoreElements()) {
-                ZipEntry entry = entries.nextElement();
-                String resClasspathPath = "/" + entry.getName();
-                if(isToBeAdded(resClasspathPath)) {
-                    resourceList.add(resClasspathPath);
-                }
-            }
-        }
-
-        private boolean isToBeAdded(String resClasspathPath) {
-            if(resourceList.contains(resClasspathPath)) {
-                // Already in the list e.g. same resource in different archives...
-                return false;
-            }
-
-            Matcher matcher = pattern.matcher(resClasspathPath);
-            return matcher.matches();
-        }
-
-        private List<String> getResourceList() {
-            return resourceList;
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ClassUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,233 @@
+/*
+ * 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.IOException;
+import java.io.InputStream;
+import java.net.URISyntaxException;
+import java.net.URL;
+import java.net.URLClassLoader;
+import java.util.ArrayList;
+import java.util.Enumeration;
+import java.util.List;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipFile;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Utility methods to aid in class/resource loading.
+ * 
+ * @author kevin
+ */
+public class ClassUtil
+{
+    private static Logger logger = Logger.getLogger(ClassUtil.class);
+
+    /**
+     * Load the specified class.
+     * @param className The name of the class to load.
+     * @param caller The class of the caller.
+     * @return The specified class.
+     * @throws ClassNotFoundException If the class cannot be found.
+     */
+    public static Class forName(final String className, final Class caller)
+        throws ClassNotFoundException
+    {
+        final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
+        if (threadClassLoader != null)
+        {
+            try
+            {
+                return Class.forName(className, true, threadClassLoader) ;
+            }
+            catch (final ClassNotFoundException cnfe) {} // ignore
+        }
+        
+        
+        final ClassLoader classLoader = caller.getClassLoader() ;
+        if (classLoader != null)
+        {
+            try
+            {
+                return Class.forName(className, true, classLoader) ;
+            }
+            catch (final ClassNotFoundException cnfe) {} // ignore
+        }
+        
+        return Class.forName(className, true, ClassLoader.getSystemClassLoader()) ;
+    }
+    
+    /**
+     * Get the specified resource as a stream.
+     * @param resourceName The name of the class to load.
+     * @param caller The class of the caller.
+     * @return The input stream for the resource or null if not found.
+     */
+    public static InputStream getResourceAsStream(final String resourceName, final Class caller)
+    {
+        final String resource ;
+        if (resourceName.startsWith("/"))
+        {
+                resource = resourceName.substring(1) ;
+        }
+        else
+        {
+                final Package callerPackage = caller.getPackage() ;
+                if (callerPackage != null)
+                {
+                        resource = callerPackage.getName().replace('.', '/') + '/' + resourceName ;
+                }
+                else
+                {
+                        resource = resourceName ;
+                }
+        }
+        final ClassLoader threadClassLoader = Thread.currentThread().getContextClassLoader() ;
+        if (threadClassLoader != null)
+        {
+                final InputStream is = threadClassLoader.getResourceAsStream(resource) ;
+                if (is != null)
+                {
+                        return is ;
+                }
+        }
+        
+        final ClassLoader classLoader = caller.getClassLoader() ;
+        if (classLoader != null)
+        {
+                final InputStream is = classLoader.getResourceAsStream(resource) ;
+                if (is != null)
+                {
+                        return is ;
+                }
+        }
+        
+        return ClassLoader.getSystemResourceAsStream(resource) ;
+    }
+
+    /**
+     * Get a package name and convert it to a path value, so it can be used
+     * in calls to methods like {@link #getResourceAsStream}.
+     * <p/>
+     * Adds a '/' prefix and converts all '." characters to '/'.  Doesn't add a
+     * trailing slash.
+     *
+     * @param packageObj The package.
+     * @return The package path.
+     */
+    public static String getPath(Package packageObj) {
+        return "/" + packageObj.getName().replace('.', '/');
+    }
+
+    public static List<String> getResourceList(String regex, Class caller) {
+        ClasspathResourceFilter filter = new ClasspathResourceFilter(regex);
+        ClassLoader classLoader;
+
+        classLoader = Thread.currentThread().getContextClassLoader();
+        if(classLoader instanceof URLClassLoader) {
+            filter.filter((URLClassLoader) classLoader);
+        }
+        classLoader = caller.getClassLoader();
+        if(classLoader instanceof URLClassLoader) {
+            filter.filter((URLClassLoader) classLoader);
+        }
+
+        return filter.getResourceList();
+    }
+
+    private static class ClasspathResourceFilter {
+
+        private List<String> resourceList = new ArrayList<String>();
+        private Pattern pattern;
+
+        private ClasspathResourceFilter(String regex) {
+            pattern = Pattern.compile(regex);
+        }
+
+        private void filter(URLClassLoader classLoader) {
+            URL[] cpUrls = classLoader.getURLs();
+
+            for (int i = 0; i < cpUrls.length; i++) {
+                try {
+                    File file = new File(cpUrls[i].toURI());
+                    if(file.isDirectory()) {
+                        searchClasspathDirTree(file, "");
+                    } else {
+                        searchArchive(file);
+                    }
+                } catch (URISyntaxException e) {
+                    logger.warn("Error searching classpath resource URL '" + cpUrls[i] + "' for resource '" + pattern.pattern() + "': " + e.getMessage());
+                } catch (IOException e) {
+                    logger.warn("Error searching classpath resource URL '" + cpUrls[i] + "' for resource '" + pattern.pattern() + "': " + e.getMessage());
+                }
+            }
+        }
+
+        private void searchClasspathDirTree(File rootDir, String subDir) {
+            File currentDir = new File(rootDir, subDir);
+            File[] contents = currentDir.listFiles();
+
+            for(File file: contents) {
+                if(file.isDirectory()) {
+                    String subSubDir = subDir + "/" + file.getName();
+                    searchClasspathDirTree(rootDir, subSubDir);
+                } else {
+                    String resClasspathPath = file.toURI().toString().substring(rootDir.toURI().toString().length() - 1);
+                    if(isToBeAdded(resClasspathPath)) {
+                        resourceList.add(resClasspathPath);
+                    }
+                }
+            }
+        }
+
+        private void searchArchive(File archiveFile) throws IOException {
+            ZipFile zip = new ZipFile(archiveFile);
+            Enumeration<? extends ZipEntry> entries = zip.entries();
+
+            while (entries.hasMoreElements()) {
+                ZipEntry entry = entries.nextElement();
+                String resClasspathPath = "/" + entry.getName();
+                if(isToBeAdded(resClasspathPath)) {
+                    resourceList.add(resClasspathPath);
+                }
+            }
+        }
+
+        private boolean isToBeAdded(String resClasspathPath) {
+            if(resourceList.contains(resClasspathPath)) {
+                // Already in the list e.g. same resource in different archives...
+                return false;
+            }
+
+            Matcher matcher = pattern.matcher(resClasspathPath);
+            return matcher.matches();
+        }
+
+        private List<String> getResourceList() {
+            return resourceList;
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,152 +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.FileInputStream;
-import java.io.FileOutputStream;
-import java.io.IOException;
-
-import org.apache.log4j.Logger;
-
-/**
- * Common file utility functions.
- * @author kevin
- */
-public class FileUtil
-{
-    /**
-     * The logger for this class.
-     */
-    private final static Logger LOGGER = Logger.getLogger(FileUtil.class) ;
-    
-    /**
-     * Attempt to rename a file 
-     * @param from The original file
-     * @param to The destination file.
-     * @return true if the rename succeeded, false otherwise
-     */
-    public static boolean renameTo(final File from, final File to)
-    {
-        if (!from.renameTo(to))
-        {
-            final File tmpFile ;
-            try
-            {
-                tmpFile = File.createTempFile("copy", ".tmp", to.getParentFile()) ;
-            }
-            catch (final IOException ioe)
-            {
-                LOGGER.debug("Could not create temporary file for writing", ioe) ;
-                return false ;
-            }
-            
-            try
-            {
-                copyFile(from, tmpFile) ;
-                if (!tmpFile.renameTo(to))
-                {
-                    LOGGER.debug("Could not rename temporary file " + tmpFile.getAbsolutePath()) ;
-                    return false ;
-                }
-                from.delete();
-            }
-            finally
-            {
-                tmpFile.delete() ;
-            }
-        }
-        return true;
-    }
-    
-    /**
-     * Attempt to copy the file.
-     * @param from The original file
-     * @param to The destination file.
-     */
-    private static boolean copyFile(final File from, final File to)
-    {
-        final FileInputStream fis;
-        try
-        {
-            fis = new FileInputStream(from);
-        }
-        catch (final IOException ioe)
-        {
-            LOGGER.debug("Could not open input file for reading", ioe) ;
-            return false ;
-        }
-        try
-        {
-            final FileOutputStream fos;
-            try
-            {
-                fos = new FileOutputStream(to);
-            }
-            catch (final IOException ioe)
-            {
-                LOGGER.debug("Could not open output file for writing", ioe);
-                return false ;
-            }
-        
-            try
-            {
-                final long filesize = from.length();
-                final byte[] buffer = (filesize > 256 ? new byte[256]
-                                : new byte[(int) filesize]);
-                while (true)
-                {
-                    final int count = fis.read(buffer);
-                    if (count <= 0)
-                    {
-                        break;
-                    }
-                    fos.write(buffer, 0, count);
-                }
-            }
-            catch (final IOException ioe)
-            {
-                LOGGER.debug("Error copying file", ioe);
-                to.delete() ;
-                return false ;
-            }
-            finally
-            {
-                    try
-                    {
-                            fos.close();
-                    }
-                    catch (final IOException ioe) {} // ignore
-            }
-        }
-        finally
-        {
-            try
-            {
-                    fis.close();
-            }
-            catch (final IOException ioe) {} // ignore
-        }
-        return true ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FileUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,152 @@
+/*
+ * 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.FileInputStream;
+import java.io.FileOutputStream;
+import java.io.IOException;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Common file utility functions.
+ * @author kevin
+ */
+public class FileUtil
+{
+    /**
+     * The logger for this class.
+     */
+    private final static Logger LOGGER = Logger.getLogger(FileUtil.class) ;
+    
+    /**
+     * Attempt to rename a file 
+     * @param from The original file
+     * @param to The destination file.
+     * @return true if the rename succeeded, false otherwise
+     */
+    public static boolean renameTo(final File from, final File to)
+    {
+        if (!from.renameTo(to))
+        {
+            final File tmpFile ;
+            try
+            {
+                tmpFile = File.createTempFile("copy", ".tmp", to.getParentFile()) ;
+            }
+            catch (final IOException ioe)
+            {
+                LOGGER.debug("Could not create temporary file for writing", ioe) ;
+                return false ;
+            }
+            
+            try
+            {
+                copyFile(from, tmpFile) ;
+                if (!tmpFile.renameTo(to))
+                {
+                    LOGGER.debug("Could not rename temporary file " + tmpFile.getAbsolutePath()) ;
+                    return false ;
+                }
+                from.delete();
+            }
+            finally
+            {
+                tmpFile.delete() ;
+            }
+        }
+        return true;
+    }
+    
+    /**
+     * Attempt to copy the file.
+     * @param from The original file
+     * @param to The destination file.
+     */
+    private static boolean copyFile(final File from, final File to)
+    {
+        final FileInputStream fis;
+        try
+        {
+            fis = new FileInputStream(from);
+        }
+        catch (final IOException ioe)
+        {
+            LOGGER.debug("Could not open input file for reading", ioe) ;
+            return false ;
+        }
+        try
+        {
+            final FileOutputStream fos;
+            try
+            {
+                fos = new FileOutputStream(to);
+            }
+            catch (final IOException ioe)
+            {
+                LOGGER.debug("Could not open output file for writing", ioe);
+                return false ;
+            }
+        
+            try
+            {
+                final long filesize = from.length();
+                final byte[] buffer = (filesize > 256 ? new byte[256]
+                                : new byte[(int) filesize]);
+                while (true)
+                {
+                    final int count = fis.read(buffer);
+                    if (count <= 0)
+                    {
+                        break;
+                    }
+                    fos.write(buffer, 0, count);
+                }
+            }
+            catch (final IOException ioe)
+            {
+                LOGGER.debug("Error copying file", ioe);
+                to.delete() ;
+                return false ;
+            }
+            finally
+            {
+                    try
+                    {
+                            fos.close();
+                    }
+                    catch (final IOException ioe) {} // ignore
+            }
+        }
+        finally
+        {
+            try
+            {
+                    fis.close();
+            }
+            catch (final IOException ioe) {} // ignore
+        }
+        return true ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,469 +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.IOException;
-import java.util.List;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-
-import com.enterprisedt.net.ftp.FTPClient;
-import com.enterprisedt.net.ftp.FTPConnectMode;
-import com.enterprisedt.net.ftp.FTPException;
-import com.enterprisedt.net.ftp.FTPTransferType;
-
-/**
- * Simplified FTP transfers
- * <p>
- * Description: Implements a simple set of FTP functionality Parameters to
- * establish the FTP connection are provided at construction time and cannot
- * change during the lifetime of the object <br/>Hides low level details.
- * Current implementation is based on the "Entreprise Distributed Technology
- * edtFTPj" library but this can be changed with no impact to existing code,
- * just by changing this class without modifying the signature of it's public
- * methods
- * </p>
- */
-
-public class FtpClientUtil
-{
-	public static final String PARMS_FTP_SERVER = "ftpServer";
-
-	public static final String PARMS_USER = "ftpUser";
-
-	public static final String PARMS_PASSWD = "ftpPassword";
-
-	public static final String PARMS_PORT = "ftpPort";
-
-	public static final String PARMS_REMOTE_DIR = "ftpRemoteDir";
-
-	public static final String PARMS_LOCAL_DIR = "ftpLocalDir";
-
-	public static final String PARMS_ASCII = "ftpAscii";
-
-	public static final String PARMS_PASSIVE = "ftpPassive";
-
-	private static final String TMP_SUFFIX = ".rosettaPart";
-
-	public enum XFER_TYPE
-	{
-		ascii, binary
-	};
-
-	private ConfigTree m_oParms;
-
-	private String m_sFtpServer, m_sUser, m_sPasswd;
-
-	private String m_sRemoteDir, m_sLocalDir;
-
-	private int m_iPort;
-
-	private boolean m_bPassive;
-
-	public String getRemoteDir ()
-	{
-		return m_sRemoteDir;
-	}
-
-	private FTPClient m_oConn = new FTPClient();
-
-	private FTPTransferType m_oXferType = FTPTransferType.BINARY;
-
-	/**
-	 * Checks validity and completeness of parameters, and keeps the info
-	 * internally for subsequent FTP requests
-	 * 
-	 * @param p_oP
-	 *            ConfigTree
-	 * @throws ConfigurationException :
-	 *             if parameters are invalid or incomplete
-	 *             <li>Parameters: (XML attributes at the root level) </li>
-	 *             <li> ftpServer = name or IP of FTP server </li>
-	 *             <li> ftpUser = login ID for server </li>
-	 *             <li> ftpPassword </li>
-	 *             <li> localDirURI = absolute path in the local filesystem
-	 *             </li>
-	 *             <li> remoteDirURI = remote path is relative to ftp user home
-	 *             in remote computer </li>
-	 * @throws RemoteFileSystemException
-	 */
-
-	public FtpClientUtil (ConfigTree p_oP, boolean p_bConnect) throws RemoteFileSystemException, ConfigurationException
-	{
-		m_oParms = p_oP;
-		initialize(p_bConnect);
-	} // _________________________________
-
-	public FtpClientUtil (List<KeyValuePair> attribs, boolean connect)
-			throws RemoteFileSystemException, ConfigurationException
-	{
-		m_oParms = new ConfigTree("fromProps");
-		for (KeyValuePair oCurr : attribs)
-			m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
-		initialize(connect);
-	} // __________________________________
-
-	private void initialize (boolean bConnect) throws RemoteFileSystemException, ConfigurationException
-	{
-		checkParms();
-		
-		try
-		{
-			if (bConnect)
-			{
-				m_oConn.setRemoteHost(m_sFtpServer);
-				m_oConn.setRemotePort(m_iPort);
-				m_oConn.connect();
-				
-				for (int i1 = 0; i1 < 10 && !m_oConn.connected(); i1++)
-				{
-					try
-					{
-						// TODO magic number
-						Thread.sleep(200);
-					}
-					catch (InterruptedException ex)
-					{
-					}
-				}
-				
-				if (!m_oConn.connected())
-					throw new RemoteFileSystemException("Can't connect to FTP server");
-				m_oConn.user(m_sUser);
-				m_oConn.password(m_sPasswd);
-				m_oConn
-						.setConnectMode((m_bPassive) ? FTPConnectMode.PASV : FTPConnectMode.ACTIVE);
-			}
-		}
-		catch (RemoteFileSystemException ex)
-		{
-			throw ex;
-		}
-		catch (Exception ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // __________________________________
-
-	/**
-	 * Terminates ftp session and frees resources
-	 * <li>Well behaved programs should make sure to call this method </li>
-	 */
-	public void quit ()
-	{
-		if (null != m_oConn) try
-		{
-			m_oConn.quit();
-		}
-		catch (Exception e)
-		{
-		}
-	} // _________________________________
-
-	/**
-	 * Deletes specified file in remote directory
-	 * 
-	 * @param p_sFile
-	 *            String : filename to delete. Method will attempt to delete
-	 *            file with rightmost node of argument within remote directory
-	 *            specified in 'remoteDirURI'
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             deleted in remote directory
-	 */
-	public void deleteRemoteFile (String p_sFile) throws RemoteFileSystemException
-	{
-		try
-		{
-			m_oConn.delete(getRemoteDir() + "/" + new File(p_sFile).getName());
-		}
-		catch (FTPException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // _________________________________
-
-	public void remoteDelete (File p_oFile) throws RemoteFileSystemException
-	{
-		try
-		{
-			m_oConn.delete(fileToFtpString(p_oFile));
-		}
-		catch (FTPException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // _________________________________
-
-	/**
-	 * Gets the list of files in the remote directory that end with arg0
-	 * 
-	 * @param p_sSuffix
-	 *            String : retrieve only files that end with that suffix - all
-	 *            files if null
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or problems
-	 *             encountered
-	 */
-	public String[] getFileListFromRemoteDir (String p_sSuffix)
-			throws RemoteFileSystemException
-	{
-		String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
-		
-		try
-		{
-			return m_oConn.dir(sSuffix);
-		}
-		catch (FTPException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // _________________________________
-
-	/**
-	 * Change remote directory
-	 * 
-	 * @param p_sDir
-	 *            String : directory to set
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or problems
-	 *             encountered
-	 */
-	public void setRemoteDir (String p_sDir) throws RemoteFileSystemException
-	{
-		try
-		{
-			m_oConn.chdir(p_sDir);
-		}
-		catch (FTPException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // _________________________________
-
-	/**
-	 * Renames specified file in remote directory to specified new name
-	 * 
-	 * @param p_sFrom
-	 *            String : filename to rename
-	 * @param p_sTo
-	 *            String : new filename
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             renamed to new name in remote directory
-	 *             <li>Method will attempt to rename file with rightmost node
-	 *             of argument within remote directory specified in
-	 *             'remoteDirURI', to new name inside the SAME remote directory
-	 */
-	public void renameInRemoteDir (String p_sFrom, String p_sTo)
-			throws RemoteFileSystemException
-	{
-		String sRmtFrom = new File(p_sFrom).getName();
-		String sRmtTo = new File(p_sTo).getName();
-
-		try
-		{
-			m_oConn.rename(getRemoteDir() + "/" + sRmtFrom,
-					getRemoteDir() + "/" + sRmtTo);
-		}
-		catch (Exception e)
-		{
-			String sMess = this.getClass().getSimpleName() + " can't rename in remote directory <" + e
-					.getMessage() + ">";
-			throw new RemoteFileSystemException(sMess);
-		}
-	} // _________________________________
-
-	public void remoteRename (File p_oFrom, File p_oTo) throws RemoteFileSystemException
-	{
-		try
-		{
-			m_oConn.rename(fileToFtpString(p_oFrom), fileToFtpString(p_oTo));
-		}
-		catch (Exception e)
-		{
-			String sMess = this.getClass().getSimpleName() + " can't rename in remote directory <" + e
-					.getMessage() + ">";
-			throw new RemoteFileSystemException(sMess);
-		}
-	} // _________________________________
-
-	/**
-	 * Uploads specified file from local directory (localDirURI) to remote
-	 * directory (remoteDirURI)
-	 * 
-	 * @param p_oFile
-	 *            String : filename to upload
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             uploaded
-	 *             <li> local file will be renamed during transfer
-	 *             ('.xferNotReady' appended to name)</li>
-	 *             <li> upon successful completion. the suffix '.xferDone' will
-	 *             be appended to the original filename </li>
-	 */
-	public void uploadFile (File p_oFile, String p_sRemoteName)
-			throws RemoteFileSystemException
-	{
-		String sRemoteOK = getRemoteDir() + "/" + p_sRemoteName;
-		String sRemoteTmp = sRemoteOK + TMP_SUFFIX;
-		
-		try
-		{
-			m_oConn.setType(m_oXferType);
-			m_oConn.put(fileToFtpString(p_oFile), sRemoteTmp);
-			m_oConn.rename(sRemoteTmp, sRemoteOK);
-		}
-		catch (FTPException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // _________________________________
-
-	/**
-	 * Downloads specified file from remote directory (remoteDirURI) to local
-	 * directory (localDirURI)
-	 * 
-	 * @param p_sFile
-	 *            String : filename to download
-	 * @throws RemoteFileSystemException :
-	 *             if ftp connection cannot be established, or file cannot be
-	 *             downloaded
-	 *             <li> local file is assigned a temporary name during transfer
-	 *             </li>
-	 *             <li> upon successful completion, local temporary file will be
-	 *             renamed to name specified in argument, and suffix '.xferDone'
-	 *             will be appended to the original filename in the remote
-	 *             directory </li>
-	 */
-	public void downloadFile (String p_sFile, String p_sFinalName)
-			throws RemoteFileSystemException
-	{
-		try
-		{
-			File oLocalDir = new File(m_sLocalDir);
-			File oLclFile = File.createTempFile("Rosetta_", TMP_SUFFIX, oLocalDir);
-	
-			try
-			{
-				oLclFile.delete();
-			}
-			catch (Exception e)
-			{
-			}
-			
-			m_oConn.setType(m_oXferType);
-			m_oConn.get(fileToFtpString(oLclFile), p_sFile);
-	
-			File oNew = new File(oLocalDir, p_sFinalName);
-			
-			if (oNew.exists()) 
-				oNew.delete();
-			
-			FileUtil.renameTo(oLclFile, oNew);
-		}
-		catch (FTPException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-		catch (IOException ex)
-		{
-			throw new RemoteFileSystemException(ex);
-		}
-	} // _________________________________
-
-	// Beware !!! The logic here seems wrong, but it works
-	// It appears that there's some kind of bug in the edtftpj.jar library
-	// The !XFER_TYPE.ascii.equals(p_oMode) should NOT be negated
-	// But it works when negated (newlines from Unix to DOS)
-	private void setXferType (XFER_TYPE p_oMode)
-	{
-		m_oXferType = !XFER_TYPE.ascii.equals(p_oMode) ? FTPTransferType.ASCII : FTPTransferType.BINARY;
-	} // _________________________________
-
-	private void checkParms () throws ConfigurationException
-	{
-		m_sFtpServer = m_oParms.getAttribute(PARMS_FTP_SERVER);
-		if (null == m_sFtpServer)
-			throw new ConfigurationException("No FTP server specified");
-
-		m_sUser = m_oParms.getAttribute(PARMS_USER);
-		if (null == m_sUser)
-			throw new ConfigurationException("No username specified for FTP");
-
-		m_sPasswd = m_oParms.getAttribute(PARMS_PASSWD);
-		if (null == m_sPasswd)
-			throw new ConfigurationException("No password specified for FTP");
-
-		m_sRemoteDir = m_oParms.getAttribute(PARMS_REMOTE_DIR);
-		if (null == m_sRemoteDir) 
-			m_sRemoteDir = "";
-
-		m_sLocalDir = m_oParms.getAttribute(PARMS_LOCAL_DIR);
-		if (null == m_sLocalDir) 
-			m_sLocalDir = ".";
-
-		String sAux = m_oParms.getAttribute(PARMS_PORT);
-		m_iPort = (null == sAux) ? 21 : Integer.parseInt(sAux);
-
-		boolean bAscii = false;
-		sAux = m_oParms.getAttribute(PARMS_ASCII);
-		
-		if (null != sAux) 
-			bAscii = Boolean.parseBoolean(sAux);
-		
-		setXferType((bAscii) ? XFER_TYPE.ascii : XFER_TYPE.binary);
-
-		m_bPassive = false;
-		sAux = m_oParms.getAttribute(PARMS_PASSIVE);
-		m_bPassive = (null != sAux) && Boolean.parseBoolean(sAux);
-	} // __________________________________
-
-	public static String fileToFtpString (File p_oF)
-	{
-		return (null == p_oF) ? null : p_oF.toString().replace("\\", "/");
-	} // ________________________________
-
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/FtpClientUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,469 @@
+/*
+ * 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.IOException;
+import java.util.List;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+
+import com.enterprisedt.net.ftp.FTPClient;
+import com.enterprisedt.net.ftp.FTPConnectMode;
+import com.enterprisedt.net.ftp.FTPException;
+import com.enterprisedt.net.ftp.FTPTransferType;
+
+/**
+ * Simplified FTP transfers
+ * <p>
+ * Description: Implements a simple set of FTP functionality Parameters to
+ * establish the FTP connection are provided at construction time and cannot
+ * change during the lifetime of the object <br/>Hides low level details.
+ * Current implementation is based on the "Entreprise Distributed Technology
+ * edtFTPj" library but this can be changed with no impact to existing code,
+ * just by changing this class without modifying the signature of it's public
+ * methods
+ * </p>
+ */
+
+public class FtpClientUtil
+{
+	public static final String PARMS_FTP_SERVER = "ftpServer";
+
+	public static final String PARMS_USER = "ftpUser";
+
+	public static final String PARMS_PASSWD = "ftpPassword";
+
+	public static final String PARMS_PORT = "ftpPort";
+
+	public static final String PARMS_REMOTE_DIR = "ftpRemoteDir";
+
+	public static final String PARMS_LOCAL_DIR = "ftpLocalDir";
+
+	public static final String PARMS_ASCII = "ftpAscii";
+
+	public static final String PARMS_PASSIVE = "ftpPassive";
+
+	private static final String TMP_SUFFIX = ".rosettaPart";
+
+	public enum XFER_TYPE
+	{
+		ascii, binary
+	};
+
+	private ConfigTree m_oParms;
+
+	private String m_sFtpServer, m_sUser, m_sPasswd;
+
+	private String m_sRemoteDir, m_sLocalDir;
+
+	private int m_iPort;
+
+	private boolean m_bPassive;
+
+	public String getRemoteDir ()
+	{
+		return m_sRemoteDir;
+	}
+
+	private FTPClient m_oConn = new FTPClient();
+
+	private FTPTransferType m_oXferType = FTPTransferType.BINARY;
+
+	/**
+	 * Checks validity and completeness of parameters, and keeps the info
+	 * internally for subsequent FTP requests
+	 * 
+	 * @param p_oP
+	 *            ConfigTree
+	 * @throws ConfigurationException :
+	 *             if parameters are invalid or incomplete
+	 *             <li>Parameters: (XML attributes at the root level) </li>
+	 *             <li> ftpServer = name or IP of FTP server </li>
+	 *             <li> ftpUser = login ID for server </li>
+	 *             <li> ftpPassword </li>
+	 *             <li> localDirURI = absolute path in the local filesystem
+	 *             </li>
+	 *             <li> remoteDirURI = remote path is relative to ftp user home
+	 *             in remote computer </li>
+	 * @throws RemoteFileSystemException
+	 */
+
+	public FtpClientUtil (ConfigTree p_oP, boolean p_bConnect) throws RemoteFileSystemException, ConfigurationException
+	{
+		m_oParms = p_oP;
+		initialize(p_bConnect);
+	} // _________________________________
+
+	public FtpClientUtil (List<KeyValuePair> attribs, boolean connect)
+			throws RemoteFileSystemException, ConfigurationException
+	{
+		m_oParms = new ConfigTree("fromProps");
+		for (KeyValuePair oCurr : attribs)
+			m_oParms.setAttribute(oCurr.getKey(), oCurr.getValue());
+		initialize(connect);
+	} // __________________________________
+
+	private void initialize (boolean bConnect) throws RemoteFileSystemException, ConfigurationException
+	{
+		checkParms();
+		
+		try
+		{
+			if (bConnect)
+			{
+				m_oConn.setRemoteHost(m_sFtpServer);
+				m_oConn.setRemotePort(m_iPort);
+				m_oConn.connect();
+				
+				for (int i1 = 0; i1 < 10 && !m_oConn.connected(); i1++)
+				{
+					try
+					{
+						// TODO magic number
+						Thread.sleep(200);
+					}
+					catch (InterruptedException ex)
+					{
+					}
+				}
+				
+				if (!m_oConn.connected())
+					throw new RemoteFileSystemException("Can't connect to FTP server");
+				m_oConn.user(m_sUser);
+				m_oConn.password(m_sPasswd);
+				m_oConn
+						.setConnectMode((m_bPassive) ? FTPConnectMode.PASV : FTPConnectMode.ACTIVE);
+			}
+		}
+		catch (RemoteFileSystemException ex)
+		{
+			throw ex;
+		}
+		catch (Exception ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	} // __________________________________
+
+	/**
+	 * Terminates ftp session and frees resources
+	 * <li>Well behaved programs should make sure to call this method </li>
+	 */
+	public void quit ()
+	{
+		if (null != m_oConn) try
+		{
+			m_oConn.quit();
+		}
+		catch (Exception e)
+		{
+		}
+	} // _________________________________
+
+	/**
+	 * Deletes specified file in remote directory
+	 * 
+	 * @param p_sFile
+	 *            String : filename to delete. Method will attempt to delete
+	 *            file with rightmost node of argument within remote directory
+	 *            specified in 'remoteDirURI'
+	 * @throws RemoteFileSystemException :
+	 *             if ftp connection cannot be established, or file cannot be
+	 *             deleted in remote directory
+	 */
+	public void deleteRemoteFile (String p_sFile) throws RemoteFileSystemException
+	{
+		try
+		{
+			m_oConn.delete(getRemoteDir() + "/" + new File(p_sFile).getName());
+		}
+		catch (FTPException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+		catch (IOException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	} // _________________________________
+
+	public void remoteDelete (File p_oFile) throws RemoteFileSystemException
+	{
+		try
+		{
+			m_oConn.delete(fileToFtpString(p_oFile));
+		}
+		catch (FTPException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+		catch (IOException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	} // _________________________________
+
+	/**
+	 * Gets the list of files in the remote directory that end with arg0
+	 * 
+	 * @param p_sSuffix
+	 *            String : retrieve only files that end with that suffix - all
+	 *            files if null
+	 * @throws RemoteFileSystemException :
+	 *             if ftp connection cannot be established, or problems
+	 *             encountered
+	 */
+	public String[] getFileListFromRemoteDir (String p_sSuffix)
+			throws RemoteFileSystemException
+	{
+		String sSuffix = (null == p_sSuffix) ? "*" : "*" + p_sSuffix;
+		
+		try
+		{
+			return m_oConn.dir(sSuffix);
+		}
+		catch (FTPException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+		catch (IOException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	} // _________________________________
+
+	/**
+	 * Change remote directory
+	 * 
+	 * @param p_sDir
+	 *            String : directory to set
+	 * @throws RemoteFileSystemException :
+	 *             if ftp connection cannot be established, or problems
+	 *             encountered
+	 */
+	public void setRemoteDir (String p_sDir) throws RemoteFileSystemException
+	{
+		try
+		{
+			m_oConn.chdir(p_sDir);
+		}
+		catch (FTPException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+		catch (IOException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	} // _________________________________
+
+	/**
+	 * Renames specified file in remote directory to specified new name
+	 * 
+	 * @param p_sFrom
+	 *            String : filename to rename
+	 * @param p_sTo
+	 *            String : new filename
+	 * @throws RemoteFileSystemException :
+	 *             if ftp connection cannot be established, or file cannot be
+	 *             renamed to new name in remote directory
+	 *             <li>Method will attempt to rename file with rightmost node
+	 *             of argument within remote directory specified in
+	 *             'remoteDirURI', to new name inside the SAME remote directory
+	 */
+	public void renameInRemoteDir (String p_sFrom, String p_sTo)
+			throws RemoteFileSystemException
+	{
+		String sRmtFrom = new File(p_sFrom).getName();
+		String sRmtTo = new File(p_sTo).getName();
+
+		try
+		{
+			m_oConn.rename(getRemoteDir() + "/" + sRmtFrom,
+					getRemoteDir() + "/" + sRmtTo);
+		}
+		catch (Exception e)
+		{
+			String sMess = this.getClass().getSimpleName() + " can't rename in remote directory <" + e
+					.getMessage() + ">";
+			throw new RemoteFileSystemException(sMess);
+		}
+	} // _________________________________
+
+	public void remoteRename (File p_oFrom, File p_oTo) throws RemoteFileSystemException
+	{
+		try
+		{
+			m_oConn.rename(fileToFtpString(p_oFrom), fileToFtpString(p_oTo));
+		}
+		catch (Exception e)
+		{
+			String sMess = this.getClass().getSimpleName() + " can't rename in remote directory <" + e
+					.getMessage() + ">";
+			throw new RemoteFileSystemException(sMess);
+		}
+	} // _________________________________
+
+	/**
+	 * Uploads specified file from local directory (localDirURI) to remote
+	 * directory (remoteDirURI)
+	 * 
+	 * @param p_oFile
+	 *            String : filename to upload
+	 * @throws RemoteFileSystemException :
+	 *             if ftp connection cannot be established, or file cannot be
+	 *             uploaded
+	 *             <li> local file will be renamed during transfer
+	 *             ('.xferNotReady' appended to name)</li>
+	 *             <li> upon successful completion. the suffix '.xferDone' will
+	 *             be appended to the original filename </li>
+	 */
+	public void uploadFile (File p_oFile, String p_sRemoteName)
+			throws RemoteFileSystemException
+	{
+		String sRemoteOK = getRemoteDir() + "/" + p_sRemoteName;
+		String sRemoteTmp = sRemoteOK + TMP_SUFFIX;
+		
+		try
+		{
+			m_oConn.setType(m_oXferType);
+			m_oConn.put(fileToFtpString(p_oFile), sRemoteTmp);
+			m_oConn.rename(sRemoteTmp, sRemoteOK);
+		}
+		catch (FTPException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+		catch (IOException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	} // _________________________________
+
+	/**
+	 * Downloads specified file from remote directory (remoteDirURI) to local
+	 * directory (localDirURI)
+	 * 
+	 * @param p_sFile
+	 *            String : filename to download
+	 * @throws RemoteFileSystemException :
+	 *             if ftp connection cannot be established, or file cannot be
+	 *             downloaded
+	 *             <li> local file is assigned a temporary name during transfer
+	 *             </li>
+	 *             <li> upon successful completion, local temporary file will be
+	 *             renamed to name specified in argument, and suffix '.xferDone'
+	 *             will be appended to the original filename in the remote
+	 *             directory </li>
+	 */
+	public void downloadFile (String p_sFile, String p_sFinalName)
+			throws RemoteFileSystemException
+	{
+		try
+		{
+			File oLocalDir = new File(m_sLocalDir);
+			File oLclFile = File.createTempFile("Rosetta_", TMP_SUFFIX, oLocalDir);
+	
+			try
+			{
+				oLclFile.delete();
+			}
+			catch (Exception e)
+			{
+			}
+			
+			m_oConn.setType(m_oXferType);
+			m_oConn.get(fileToFtpString(oLclFile), p_sFile);
+	
+			File oNew = new File(oLocalDir, p_sFinalName);
+			
+			if (oNew.exists()) 
+				oNew.delete();
+			
+			FileUtil.renameTo(oLclFile, oNew);
+		}
+		catch (FTPException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+		catch (IOException ex)
+		{
+			throw new RemoteFileSystemException(ex);
+		}
+	} // _________________________________
+
+	// Beware !!! The logic here seems wrong, but it works
+	// It appears that there's some kind of bug in the edtftpj.jar library
+	// The !XFER_TYPE.ascii.equals(p_oMode) should NOT be negated
+	// But it works when negated (newlines from Unix to DOS)
+	private void setXferType (XFER_TYPE p_oMode)
+	{
+		m_oXferType = !XFER_TYPE.ascii.equals(p_oMode) ? FTPTransferType.ASCII : FTPTransferType.BINARY;
+	} // _________________________________
+
+	private void checkParms () throws ConfigurationException
+	{
+		m_sFtpServer = m_oParms.getAttribute(PARMS_FTP_SERVER);
+		if (null == m_sFtpServer)
+			throw new ConfigurationException("No FTP server specified");
+
+		m_sUser = m_oParms.getAttribute(PARMS_USER);
+		if (null == m_sUser)
+			throw new ConfigurationException("No username specified for FTP");
+
+		m_sPasswd = m_oParms.getAttribute(PARMS_PASSWD);
+		if (null == m_sPasswd)
+			throw new ConfigurationException("No password specified for FTP");
+
+		m_sRemoteDir = m_oParms.getAttribute(PARMS_REMOTE_DIR);
+		if (null == m_sRemoteDir) 
+			m_sRemoteDir = "";
+
+		m_sLocalDir = m_oParms.getAttribute(PARMS_LOCAL_DIR);
+		if (null == m_sLocalDir) 
+			m_sLocalDir = ".";
+
+		String sAux = m_oParms.getAttribute(PARMS_PORT);
+		m_iPort = (null == sAux) ? 21 : Integer.parseInt(sAux);
+
+		boolean bAscii = false;
+		sAux = m_oParms.getAttribute(PARMS_ASCII);
+		
+		if (null != sAux) 
+			bAscii = Boolean.parseBoolean(sAux);
+		
+		setXferType((bAscii) ? XFER_TYPE.ascii : XFER_TYPE.binary);
+
+		m_bPassive = false;
+		sAux = m_oParms.getAttribute(PARMS_PASSIVE);
+		m_bPassive = (null != sAux) && Boolean.parseBoolean(sAux);
+	} // __________________________________
+
+	public static String fileToFtpString (File p_oF)
+	{
+		return (null == p_oF) ? null : p_oF.toString().replace("\\", "/");
+	} // ________________________________
+
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocator.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocator.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,93 +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.Serializable;
-
- at SuppressWarnings("serial")
-public class ObjLocator implements Serializable
-{
-  private long        m_lUid;
-  private Object []   m_oaLocs;
-
-  public  long        getUid() { return m_lUid; }
-  public  String []   getStrings() { return (String []) m_oaLocs; }
-  public int getColumnCount()
-  { return (null == m_oaLocs) ? 0 : m_oaLocs.length;
-  } //__________________________________
-
-  public ObjLocator(long p_lUid, Object [] p_sa)
-  { m_lUid    = p_lUid;
-    m_oaLocs  = (null == p_sa) ? new Object [0] : p_sa;
-    for (int i1=0; i1<m_oaLocs.length;i1++)
-      if (null == m_oaLocs[i1]) m_oaLocs[i1]="";
-  } //__________________________________
-
-  public Object get(int p_iCol)
-  { return (null == m_oaLocs) ? ""
-        :(p_iCol < 0 || p_iCol >= m_oaLocs.length) ? ""
-        : m_oaLocs[p_iCol];
-  } //__________________________________
-
-  public void set(int p_iCol, Object p_o)
-  { if (null == m_oaLocs)                         return;
-    if (p_iCol < 0 || p_iCol >= m_oaLocs.length)  return;
-    m_oaLocs[p_iCol]    = p_o;
-  } //__________________________________
-
-  public boolean    equals(Object p_o)
-  { return (p_o instanceof ObjLocator)
-      ? m_lUid == ((ObjLocator)p_o).getUid()
-      : false;
-  } //__________________________________
-
-  public static ObjLocator find(long p_l, ObjLocator[] p_ola)
-  { ObjLocator oRet;
-    if (null != p_ola)
-      for (int i1=0; i1<p_ola.length;i1++)
-        if (p_l == (oRet = p_ola[i1]).getUid()) return oRet;
-    return null;
-  } //__________________________________
-
-  public String toString()
-  { StringBuffer sb = new StringBuffer(200);
-    sb.append("ObjLocator: ").append(m_lUid).append(" <");
-    for (int i1=0; i1<m_oaLocs.length;i1++)
-    { if (i1 > 0) sb.append(" ");
-      sb.append(m_oaLocs[i1].toString());
-    }
-    sb.append(">");
-    return sb.toString();
-  } //__________________________________
-
-  public static long [] getUids(ObjLocator[] p_ola)
-  { long [] laRet = new long [] {};
-    if (null == p_ola)  return laRet;
-    if (p_ola.length<1) return laRet;
-    laRet = new long[p_ola.length];
-    for (int i1=0; i1<laRet.length; i1++)
-      laRet[i1] = p_ola[i1].getUid();
-
-    return laRet;
-  } //__________________________________
-
-} //____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocator.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocator.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocator.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocator.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,93 @@
+/*
+* 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.Serializable;
+
+ at SuppressWarnings("serial")
+public class ObjLocator implements Serializable
+{
+  private long        m_lUid;
+  private Object []   m_oaLocs;
+
+  public  long        getUid() { return m_lUid; }
+  public  String []   getStrings() { return (String []) m_oaLocs; }
+  public int getColumnCount()
+  { return (null == m_oaLocs) ? 0 : m_oaLocs.length;
+  } //__________________________________
+
+  public ObjLocator(long p_lUid, Object [] p_sa)
+  { m_lUid    = p_lUid;
+    m_oaLocs  = (null == p_sa) ? new Object [0] : p_sa;
+    for (int i1=0; i1<m_oaLocs.length;i1++)
+      if (null == m_oaLocs[i1]) m_oaLocs[i1]="";
+  } //__________________________________
+
+  public Object get(int p_iCol)
+  { return (null == m_oaLocs) ? ""
+        :(p_iCol < 0 || p_iCol >= m_oaLocs.length) ? ""
+        : m_oaLocs[p_iCol];
+  } //__________________________________
+
+  public void set(int p_iCol, Object p_o)
+  { if (null == m_oaLocs)                         return;
+    if (p_iCol < 0 || p_iCol >= m_oaLocs.length)  return;
+    m_oaLocs[p_iCol]    = p_o;
+  } //__________________________________
+
+  public boolean    equals(Object p_o)
+  { return (p_o instanceof ObjLocator)
+      ? m_lUid == ((ObjLocator)p_o).getUid()
+      : false;
+  } //__________________________________
+
+  public static ObjLocator find(long p_l, ObjLocator[] p_ola)
+  { ObjLocator oRet;
+    if (null != p_ola)
+      for (int i1=0; i1<p_ola.length;i1++)
+        if (p_l == (oRet = p_ola[i1]).getUid()) return oRet;
+    return null;
+  } //__________________________________
+
+  public String toString()
+  { StringBuffer sb = new StringBuffer(200);
+    sb.append("ObjLocator: ").append(m_lUid).append(" <");
+    for (int i1=0; i1<m_oaLocs.length;i1++)
+    { if (i1 > 0) sb.append(" ");
+      sb.append(m_oaLocs[i1].toString());
+    }
+    sb.append(">");
+    return sb.toString();
+  } //__________________________________
+
+  public static long [] getUids(ObjLocator[] p_ola)
+  { long [] laRet = new long [] {};
+    if (null == p_ola)  return laRet;
+    if (p_ola.length<1) return laRet;
+    laRet = new long[p_ola.length];
+    for (int i1=0; i1<laRet.length; i1++)
+      laRet[i1] = p_ola[i1].getUid();
+
+    return laRet;
+  } //__________________________________
+
+} //____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocatorSorter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocatorSorter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocatorSorter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,87 +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.util.Arrays;
-import java.util.Comparator;
-
-public class ObjLocatorSorter
-{
-  private java.util.List<ObjLocator> m_olRows;
-  private int m_iQcols;
-  private char[] m_caSrt;
-
-  public ObjLocatorSorter(ObjLocator[] p_oa)
-  { m_iQcols  = (null==p_oa) ? 0
-      : p_oa.length<1 ? 0
-      : p_oa[0].getColumnCount();
-    m_olRows = Arrays.asList(p_oa);
-  } //________________________________
-
-  public ObjLocator[] sort (int p_iCol)
-  { if (null == m_caSrt)
-    { m_caSrt = new char[m_iQcols];
-      for (int i1=0; i1<m_caSrt.length; i1++) m_caSrt[i1]='d';
-    }
-    ObjLocator [] oaLoc = new ObjLocator[m_olRows.size()];
-    m_olRows.toArray(oaLoc);
-    Arrays.sort(oaLoc,new RowCmp(p_iCol,ascOrDesc(oaLoc,p_iCol)));
-    m_olRows  = Arrays.asList(oaLoc);
-    return oaLoc;
-  } //________________________________
-  private static char ascOrDesc(ObjLocator[] p_oa, int p_iCol)
-  {
-    String sMin = "";
-    for (int i1=0; i1<p_oa.length;i1++)
-    { Object oCurr = p_oa[i1].get(p_iCol);
-      if (! (oCurr instanceof String))    continue;
-      if (sMin.compareToIgnoreCase((String)oCurr) > 0)
-          return 'a';
-      sMin  = (String) oCurr;
-    }
-    return 'd';
-  } //________________________________
-
-  // ---------------------------------------------------------
-  //  Comparator for Table Columns
-  // ---------------------------------------------------------
-  private class RowCmp implements Comparator<ObjLocator>
-  {
-    int m_iCol;
-    boolean m_bAsc;
-
-    RowCmp(int p_i, char p_c)
-    {
-      m_iCol = p_i;
-      m_bAsc = 'a'==Character.toLowerCase(p_c);
-    } //______________________________
-
-    public int compare(ObjLocator o1, ObjLocator o2)
-    {
-      String s1 = (String) o1.get(m_iCol);
-      String s2 = (String) o2.get(m_iCol);
-      int iCmp = s1.compareToIgnoreCase(s2);
-      return (m_bAsc) ? iCmp : -iCmp;
-    } //______________________________
-  } //_______________________________________________
-} //______________________________________________________
-

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocatorSorter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocatorSorter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocatorSorter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/ObjLocatorSorter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,87 @@
+/*
+* 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.util.Arrays;
+import java.util.Comparator;
+
+public class ObjLocatorSorter
+{
+  private java.util.List<ObjLocator> m_olRows;
+  private int m_iQcols;
+  private char[] m_caSrt;
+
+  public ObjLocatorSorter(ObjLocator[] p_oa)
+  { m_iQcols  = (null==p_oa) ? 0
+      : p_oa.length<1 ? 0
+      : p_oa[0].getColumnCount();
+    m_olRows = Arrays.asList(p_oa);
+  } //________________________________
+
+  public ObjLocator[] sort (int p_iCol)
+  { if (null == m_caSrt)
+    { m_caSrt = new char[m_iQcols];
+      for (int i1=0; i1<m_caSrt.length; i1++) m_caSrt[i1]='d';
+    }
+    ObjLocator [] oaLoc = new ObjLocator[m_olRows.size()];
+    m_olRows.toArray(oaLoc);
+    Arrays.sort(oaLoc,new RowCmp(p_iCol,ascOrDesc(oaLoc,p_iCol)));
+    m_olRows  = Arrays.asList(oaLoc);
+    return oaLoc;
+  } //________________________________
+  private static char ascOrDesc(ObjLocator[] p_oa, int p_iCol)
+  {
+    String sMin = "";
+    for (int i1=0; i1<p_oa.length;i1++)
+    { Object oCurr = p_oa[i1].get(p_iCol);
+      if (! (oCurr instanceof String))    continue;
+      if (sMin.compareToIgnoreCase((String)oCurr) > 0)
+          return 'a';
+      sMin  = (String) oCurr;
+    }
+    return 'd';
+  } //________________________________
+
+  // ---------------------------------------------------------
+  //  Comparator for Table Columns
+  // ---------------------------------------------------------
+  private class RowCmp implements Comparator<ObjLocator>
+  {
+    int m_iCol;
+    boolean m_bAsc;
+
+    RowCmp(int p_i, char p_c)
+    {
+      m_iCol = p_i;
+      m_bAsc = 'a'==Character.toLowerCase(p_c);
+    } //______________________________
+
+    public int compare(ObjLocator o1, ObjLocator o2)
+    {
+      String s1 = (String) o1.get(m_iCol);
+      String s2 = (String) o2.get(m_iCol);
+      int iCmp = s1.compareToIgnoreCase(s2);
+      return (m_bAsc) ? iCmp : -iCmp;
+    } //______________________________
+  } //_______________________________________________
+} //______________________________________________________
+

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

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

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.util;
-
-import org.jboss.soa.esb.BaseException;
-
-/**
- * Remote File System exception.
- * @author b_georges
- * @since Version 4.0
- */
-public class RemoteFileSystemException extends BaseException 
-{
-
-	private static final long serialVersionUID = 1L;
-
-	/**
-     * Construct an exception instance. 
-     * @param message Exception message.
-     */
-    public RemoteFileSystemException(String message) { super(message); }
-
-    /**
-     * Construct an exception instance. 
-     * @param message Exception message.
-     * @param cause Exception cause.
-     */
-    public RemoteFileSystemException(String message, Throwable cause) { super(message, cause); }
-
-    /**
-     * Construct an exception instance. 
-     * @param cause Exception cause.
-     */
-    public RemoteFileSystemException(Throwable cause) { super(cause); }
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.util;
+
+import org.jboss.soa.esb.BaseException;
+
+/**
+ * Remote File System exception.
+ * @author b_georges
+ * @since Version 4.0
+ */
+public class RemoteFileSystemException extends BaseException 
+{
+
+	private static final long serialVersionUID = 1L;
+
+	/**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     */
+    public RemoteFileSystemException(String message) { super(message); }
+
+    /**
+     * Construct an exception instance. 
+     * @param message Exception message.
+     * @param cause Exception cause.
+     */
+    public RemoteFileSystemException(String message, Throwable cause) { super(message, cause); }
+
+    /**
+     * Construct an exception instance. 
+     * @param cause Exception cause.
+     */
+    public RemoteFileSystemException(Throwable cause) { super(cause); }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,78 +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.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.net.URL;
-
-import org.jboss.internal.soa.esb.util.EdtFtpImpl;
-import org.jboss.internal.soa.esb.util.SecureFtpImpl;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
-
-public class RemoteFileSystemFactory
-{
-
-	// private default constructor
-	private RemoteFileSystemFactory()
-	{
-	}
-
-	/**
-	 * This method returns a RemoteFileSystem Implementation at runtime.
-	 * The implementation depends on which protocol is specified in the 
-	 * URL of the RemoteFileSystem.
-	 * We currently support "ftp" and "sftp" 
-	 * Refactoring related to JIRA Tasks: JBESB-127 and JBESB-197 
-	 * @param p_oEpr
-	 * @param p_bConnect
-	 * @return RemoteFileSystem
-	 * @throws RemoteFileSystemException
-	 */
-	public static RemoteFileSystem getRemoteFileSystem(FTPEpr p_oEpr,
-			boolean p_bConnect) throws RemoteFileSystemException
-	{
-		URL url = null;
-		try
-		{
-			url = p_oEpr.getURL();
-			if (url.getProtocol().equals(RemoteFileSystem.FTP_PROTOCOL))
-				return new EdtFtpImpl((FTPEpr) p_oEpr, p_bConnect);
-			else if (url.getProtocol().equals(RemoteFileSystem.SFTP_PROTOCOL))
-				return new SecureFtpImpl((SFTPEpr) p_oEpr, p_bConnect);
-
-		} catch (MalformedURLException e)
-		{
-			throw new RemoteFileSystemException(e);
-		} catch (URISyntaxException e)
-		{
-			throw new RemoteFileSystemException(e);
-		} catch (Exception e)
-		{
-			throw new RemoteFileSystemException(e);
-		}
-		throw new RemoteFileSystemException("Unknown or unsupported protocol");
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/RemoteFileSystemFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,78 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.util;
+
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.net.URL;
+
+import org.jboss.internal.soa.esb.util.EdtFtpImpl;
+import org.jboss.internal.soa.esb.util.SecureFtpImpl;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
+
+public class RemoteFileSystemFactory
+{
+
+	// private default constructor
+	private RemoteFileSystemFactory()
+	{
+	}
+
+	/**
+	 * This method returns a RemoteFileSystem Implementation at runtime.
+	 * The implementation depends on which protocol is specified in the 
+	 * URL of the RemoteFileSystem.
+	 * We currently support "ftp" and "sftp" 
+	 * Refactoring related to JIRA Tasks: JBESB-127 and JBESB-197 
+	 * @param p_oEpr
+	 * @param p_bConnect
+	 * @return RemoteFileSystem
+	 * @throws RemoteFileSystemException
+	 */
+	public static RemoteFileSystem getRemoteFileSystem(FTPEpr p_oEpr,
+			boolean p_bConnect) throws RemoteFileSystemException
+	{
+		URL url = null;
+		try
+		{
+			url = p_oEpr.getURL();
+			if (url.getProtocol().equals(RemoteFileSystem.FTP_PROTOCOL))
+				return new EdtFtpImpl((FTPEpr) p_oEpr, p_bConnect);
+			else if (url.getProtocol().equals(RemoteFileSystem.SFTP_PROTOCOL))
+				return new SecureFtpImpl((SFTPEpr) p_oEpr, p_bConnect);
+
+		} catch (MalformedURLException e)
+		{
+			throw new RemoteFileSystemException(e);
+		} catch (URISyntaxException e)
+		{
+			throw new RemoteFileSystemException(e);
+		} catch (Exception e)
+		{
+			throw new RemoteFileSystemException(e);
+		}
+		throw new RemoteFileSystemException("Unknown or unsupported protocol");
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,348 +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.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.PrintStream;
-import java.io.Serializable;
-import java.io.StringWriter;
-import java.text.SimpleDateFormat;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.transform.ErrorListener;
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerException;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.stream.StreamResult;
-import javax.xml.transform.stream.StreamSource;
-
-import org.apache.log4j.Appender;
-import org.apache.log4j.ConsoleAppender;
-import org.apache.log4j.Logger;
-import org.apache.log4j.TTCCLayout;
-import org.apache.xml.serialize.OutputFormat;
-import org.apache.xml.serialize.XMLSerializer;
-import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
-
-public class Util
-{
-    private Util()
-    {
-    }
-
-    public static void dumpSysProps (PrintStream p_OS)
-    {
-	String[] sa = new String[ModulePropertyManager.getPropertyManager(
-		ModulePropertyManager.TRANSPORTS_MODULE).getProperties().size()];
-	ModulePropertyManager.getPropertyManager(
-		ModulePropertyManager.TRANSPORTS_MODULE).getProperties()
-		.keySet().toArray(sa);
-	Arrays.sort(sa);
-	for (String sCurr : sa)
-	    p_OS.println(sCurr
-		    + "="
-		    + ModulePropertyManager.getPropertyManager(
-			    ModulePropertyManager.TRANSPORTS_MODULE)
-			    .getProperty(sCurr));
-    } // __________________________________
-
-    public static boolean isNullString (String p_s)
-    {
-	return (null == p_s) ? true : p_s.trim().length() < 1;
-    } // __________________________________
-
-    public static boolean isLong (String p_s)
-    {
-	if (isNullString(p_s))
-	    return false;
-
-	try
-	{
-	    Long.parseLong(p_s);
-	    return true;
-	}
-	catch (Exception e)
-	{
-	    return false;
-	}
-    } // __________________________________
-
-    public static boolean isPositiveLong (String p_s)
-    {
-	if (isNullString(p_s))
-	    return false;
-
-	try
-	{
-	    long lBk = Long.parseLong(p_s);
-	    return lBk > 0;
-	}
-	catch (Exception e)
-	{
-	    return false;
-	}
-    } // __________________________________
-
-    public static int parseInt (String s)
-    {
-	if (s == null)
-	    return 0;
-
-	String sVal = s.trim();
-
-	if (sVal.length() < 1)
-	    return 0;
-	else
-	{
-	    try
-	    {
-		return Integer.parseInt(s);
-	    }
-	    catch (NumberFormatException ex)
-	    {
-		return 0;
-	    }
-	}
-    } // __________________________________
-
-    public static long parseLong (String s)
-    {
-	if (s == null)
-	    return 0;
-
-	String sVal = s.trim();
-
-	if (sVal.length() < 1)
-	    return 0;
-	else
-	{
-	    try
-	    {
-		return Long.parseLong(s);
-	    }
-	    catch (NumberFormatException ex)
-	    {
-		return 0;
-	    }
-	}
-    } // __________________________________
-
-    public static Logger getDefaultLogger (Class p_oCls)
-    {
-	Logger oRet = Logger.getLogger(p_oCls.getName());
-	Appender oApp = new ConsoleAppender(new TTCCLayout("ISO8601"));
-	oRet.addAppender(oApp);
-	return oRet;
-    } // __________________________________
-
-    public static Serializable serialize (Message message)
-	    throws ParserConfigurationException, IOException
-    {
-	if (message.getType().equals(
-		org.jboss.soa.esb.message.format.MessageType.JAVA_SERIALIZED))
-	    return (Serializable) message;
-
-	try
-	{
-	    DocumentBuilderFactory factory = DocumentBuilderFactory
-		    .newInstance();
-
-	    factory.setNamespaceAware(true);
-
-	    Document doc = factory.newDocumentBuilder().newDocument();
-	    ((org.jboss.internal.soa.esb.message.format.xml.MessageImpl) message)
-		    .toXML(doc);
-	    StringWriter sWriter = new StringWriter();
-	    OutputFormat format = new OutputFormat();
-	    format.setIndenting(true);
-	    XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-	    xmlS.asDOMSerializer();
-	    xmlS.serialize(doc);
-	    return sWriter.toString();
-	}
-	catch (MarshalException ex)
-	{
-            final IOException ioe = new IOException("Util.serialize caught MarshalException:") ;
-            ioe.initCause(ex) ;
-            throw ioe ;
-	}
-    }// ________________________________
-
-    public static Message deserialize (Serializable serial)
-	    throws ParserConfigurationException, SAXException, IOException
-    {
-	if (serial instanceof MessageImpl) // MessageType.JAVA_SERIALIZED
-	    return (Message) serial;
-
-	try
-	{
-	    // MessageType.JBOSS_XML
-	    InputStream inStream = new ByteArrayInputStream(((String) serial)
-		    .getBytes());
-	    DocumentBuilderFactory factory = DocumentBuilderFactory
-		    .newInstance();
-	    factory.setNamespaceAware(true);
-
-	    DocumentBuilder builder = factory.newDocumentBuilder();
-	    Document doc = builder.parse(inStream);
-
-	    org.jboss.internal.soa.esb.message.format.xml.MessageImpl message = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
-	    message.fromXML(doc);
-	    return message;
-	}
-	catch (UnmarshalException ex)
-	{
-           final IOException ioe = new IOException("Util.deserialize caught UnmarshalException") ;
-           ioe.initCause(ex) ;
-           throw ioe ;
-	}
-    } // ________________________________
-
-    public static List<KeyValuePair> propertiesFromSelector (String selector)
-    {
-	// No problem if selector is null - everything in queue will be returned
-	List<KeyValuePair> oRet = new ArrayList<KeyValuePair>();
-
-	if (!Util.isNullString(selector))
-	{
-	    for (String sCurr : selector.trim().split(" AND "))
-	    {
-		String[] sa = sCurr.split("=");
-		if (sa.length != 2 || sa[1].charAt(0) != '\''
-			|| sa[1].charAt(-1 + sa[1].length()) != '\'')
-		{
-		    throw new IllegalArgumentException(
-			    "Illegal message selector syntax <"
-				    + selector
-				    + ">.  Must be 2 tokens seperated by an '=' character, and the token after the '=' character must be enclosed in single quotes.");
-		}
-		KeyValuePair oNew = new KeyValuePair(sa[0], sa[1].substring(0,
-			-1 + sa[1].length()).substring(1));
-		oRet.add(oNew);
-	    }
-	}
-
-	return oRet;
-    } // ________________________________
-
-    public static String getStamp ()
-    {
-	return s_oTS.format(new java.util.Date(System.currentTimeMillis()));
-    }
-
-    /**
-         * Attempt to format the output.
-         * 
-         * @param output
-         *                Output to be formatted.
-         * @return Output.
-         */
-
-    public static String format (String output)
-    {
-	/*
-	 * If it's not XML, then don't try to deal with it as if it were.
-	 */
-	
-	if (!output.startsWith("<?xml"))
-	    return output;
-	
-	StreamSource source = new StreamSource(new ByteArrayInputStream(output
-		.getBytes()));
-	ByteArrayOutputStream outStream = new ByteArrayOutputStream();
-
-	try
-	{
-	    Transformer transformer;
-
-	    try
-	    {
-		factory.setAttribute("indent-number", new Integer(4));
-	    }
-	    catch (Exception e)
-	    {
-		// Ignore... Xalan may throw on this!!
-		// We handle Xalan indentation below (yeuckkk) ...
-	    }
-	    transformer = factory.newTransformer();
-	    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-	    // There's a bug in Java 5 re this code (formatting).
-	    // See
-                // http://forum.java.sun.com/thread.jspa?threadID=562510&start=0
-	    // and it explains the
-	    // whys of the following code.
-	    transformer.setOutputProperty(
-		    "{http://xml.apache.org/xalan}indent-amount", "4");
-	    transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,
-		    "yes");
-	    transformer.setErrorListener(new NullErrorListener());
-	    transformer.transform(source, new StreamResult(outStream));
-
-	    return outStream.toString();
-	}
-	catch (Exception e)
-	{
-	    return output;
-	}
-    }
-
-    private static TransformerFactory factory = TransformerFactory
-	    .newInstance();
-
-    private static class NullErrorListener implements ErrorListener
-    {
-	public void warning (TransformerException exception)
-		throws TransformerException
-	{
-	}
-
-	public void error (TransformerException exception)
-		throws TransformerException
-	{
-	}
-
-	public void fatalError (TransformerException exception)
-		throws TransformerException
-	{
-	}
-    }
-
-    private static final SimpleDateFormat s_oTS = new SimpleDateFormat(
-	    "yyyy/MM/dd hh:mm:ss.SSS");
-} // ____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/Util.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,348 @@
+/*
+ * 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.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.PrintStream;
+import java.io.Serializable;
+import java.io.StringWriter;
+import java.text.SimpleDateFormat;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.transform.ErrorListener;
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerException;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.stream.StreamResult;
+import javax.xml.transform.stream.StreamSource;
+
+import org.apache.log4j.Appender;
+import org.apache.log4j.ConsoleAppender;
+import org.apache.log4j.Logger;
+import org.apache.log4j.TTCCLayout;
+import org.apache.xml.serialize.OutputFormat;
+import org.apache.xml.serialize.XMLSerializer;
+import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.message.Message;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+public class Util
+{
+    private Util()
+    {
+    }
+
+    public static void dumpSysProps (PrintStream p_OS)
+    {
+	String[] sa = new String[ModulePropertyManager.getPropertyManager(
+		ModulePropertyManager.TRANSPORTS_MODULE).getProperties().size()];
+	ModulePropertyManager.getPropertyManager(
+		ModulePropertyManager.TRANSPORTS_MODULE).getProperties()
+		.keySet().toArray(sa);
+	Arrays.sort(sa);
+	for (String sCurr : sa)
+	    p_OS.println(sCurr
+		    + "="
+		    + ModulePropertyManager.getPropertyManager(
+			    ModulePropertyManager.TRANSPORTS_MODULE)
+			    .getProperty(sCurr));
+    } // __________________________________
+
+    public static boolean isNullString (String p_s)
+    {
+	return (null == p_s) ? true : p_s.trim().length() < 1;
+    } // __________________________________
+
+    public static boolean isLong (String p_s)
+    {
+	if (isNullString(p_s))
+	    return false;
+
+	try
+	{
+	    Long.parseLong(p_s);
+	    return true;
+	}
+	catch (Exception e)
+	{
+	    return false;
+	}
+    } // __________________________________
+
+    public static boolean isPositiveLong (String p_s)
+    {
+	if (isNullString(p_s))
+	    return false;
+
+	try
+	{
+	    long lBk = Long.parseLong(p_s);
+	    return lBk > 0;
+	}
+	catch (Exception e)
+	{
+	    return false;
+	}
+    } // __________________________________
+
+    public static int parseInt (String s)
+    {
+	if (s == null)
+	    return 0;
+
+	String sVal = s.trim();
+
+	if (sVal.length() < 1)
+	    return 0;
+	else
+	{
+	    try
+	    {
+		return Integer.parseInt(s);
+	    }
+	    catch (NumberFormatException ex)
+	    {
+		return 0;
+	    }
+	}
+    } // __________________________________
+
+    public static long parseLong (String s)
+    {
+	if (s == null)
+	    return 0;
+
+	String sVal = s.trim();
+
+	if (sVal.length() < 1)
+	    return 0;
+	else
+	{
+	    try
+	    {
+		return Long.parseLong(s);
+	    }
+	    catch (NumberFormatException ex)
+	    {
+		return 0;
+	    }
+	}
+    } // __________________________________
+
+    public static Logger getDefaultLogger (Class p_oCls)
+    {
+	Logger oRet = Logger.getLogger(p_oCls.getName());
+	Appender oApp = new ConsoleAppender(new TTCCLayout("ISO8601"));
+	oRet.addAppender(oApp);
+	return oRet;
+    } // __________________________________
+
+    public static Serializable serialize (Message message)
+	    throws ParserConfigurationException, IOException
+    {
+	if (message.getType().equals(
+		org.jboss.soa.esb.message.format.MessageType.JAVA_SERIALIZED))
+	    return (Serializable) message;
+
+	try
+	{
+	    DocumentBuilderFactory factory = DocumentBuilderFactory
+		    .newInstance();
+
+	    factory.setNamespaceAware(true);
+
+	    Document doc = factory.newDocumentBuilder().newDocument();
+	    ((org.jboss.internal.soa.esb.message.format.xml.MessageImpl) message)
+		    .toXML(doc);
+	    StringWriter sWriter = new StringWriter();
+	    OutputFormat format = new OutputFormat();
+	    format.setIndenting(true);
+	    XMLSerializer xmlS = new XMLSerializer(sWriter, format);
+	    xmlS.asDOMSerializer();
+	    xmlS.serialize(doc);
+	    return sWriter.toString();
+	}
+	catch (MarshalException ex)
+	{
+            final IOException ioe = new IOException("Util.serialize caught MarshalException:") ;
+            ioe.initCause(ex) ;
+            throw ioe ;
+	}
+    }// ________________________________
+
+    public static Message deserialize (Serializable serial)
+	    throws ParserConfigurationException, SAXException, IOException
+    {
+	if (serial instanceof MessageImpl) // MessageType.JAVA_SERIALIZED
+	    return (Message) serial;
+
+	try
+	{
+	    // MessageType.JBOSS_XML
+	    InputStream inStream = new ByteArrayInputStream(((String) serial)
+		    .getBytes());
+	    DocumentBuilderFactory factory = DocumentBuilderFactory
+		    .newInstance();
+	    factory.setNamespaceAware(true);
+
+	    DocumentBuilder builder = factory.newDocumentBuilder();
+	    Document doc = builder.parse(inStream);
+
+	    org.jboss.internal.soa.esb.message.format.xml.MessageImpl message = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
+	    message.fromXML(doc);
+	    return message;
+	}
+	catch (UnmarshalException ex)
+	{
+           final IOException ioe = new IOException("Util.deserialize caught UnmarshalException") ;
+           ioe.initCause(ex) ;
+           throw ioe ;
+	}
+    } // ________________________________
+
+    public static List<KeyValuePair> propertiesFromSelector (String selector)
+    {
+	// No problem if selector is null - everything in queue will be returned
+	List<KeyValuePair> oRet = new ArrayList<KeyValuePair>();
+
+	if (!Util.isNullString(selector))
+	{
+	    for (String sCurr : selector.trim().split(" AND "))
+	    {
+		String[] sa = sCurr.split("=");
+		if (sa.length != 2 || sa[1].charAt(0) != '\''
+			|| sa[1].charAt(-1 + sa[1].length()) != '\'')
+		{
+		    throw new IllegalArgumentException(
+			    "Illegal message selector syntax <"
+				    + selector
+				    + ">.  Must be 2 tokens seperated by an '=' character, and the token after the '=' character must be enclosed in single quotes.");
+		}
+		KeyValuePair oNew = new KeyValuePair(sa[0], sa[1].substring(0,
+			-1 + sa[1].length()).substring(1));
+		oRet.add(oNew);
+	    }
+	}
+
+	return oRet;
+    } // ________________________________
+
+    public static String getStamp ()
+    {
+	return s_oTS.format(new java.util.Date(System.currentTimeMillis()));
+    }
+
+    /**
+         * Attempt to format the output.
+         * 
+         * @param output
+         *                Output to be formatted.
+         * @return Output.
+         */
+
+    public static String format (String output)
+    {
+	/*
+	 * If it's not XML, then don't try to deal with it as if it were.
+	 */
+	
+	if (!output.startsWith("<?xml"))
+	    return output;
+	
+	StreamSource source = new StreamSource(new ByteArrayInputStream(output
+		.getBytes()));
+	ByteArrayOutputStream outStream = new ByteArrayOutputStream();
+
+	try
+	{
+	    Transformer transformer;
+
+	    try
+	    {
+		factory.setAttribute("indent-number", new Integer(4));
+	    }
+	    catch (Exception e)
+	    {
+		// Ignore... Xalan may throw on this!!
+		// We handle Xalan indentation below (yeuckkk) ...
+	    }
+	    transformer = factory.newTransformer();
+	    transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+	    // There's a bug in Java 5 re this code (formatting).
+	    // See
+                // http://forum.java.sun.com/thread.jspa?threadID=562510&start=0
+	    // and it explains the
+	    // whys of the following code.
+	    transformer.setOutputProperty(
+		    "{http://xml.apache.org/xalan}indent-amount", "4");
+	    transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION,
+		    "yes");
+	    transformer.setErrorListener(new NullErrorListener());
+	    transformer.transform(source, new StreamResult(outStream));
+
+	    return outStream.toString();
+	}
+	catch (Exception e)
+	{
+	    return output;
+	}
+    }
+
+    private static TransformerFactory factory = TransformerFactory
+	    .newInstance();
+
+    private static class NullErrorListener implements ErrorListener
+    {
+	public void warning (TransformerException exception)
+		throws TransformerException
+	{
+	}
+
+	public void error (TransformerException exception)
+		throws TransformerException
+	{
+	}
+
+	public void fatalError (TransformerException exception)
+		throws TransformerException
+	{
+	}
+    }
+
+    private static final SimpleDateFormat s_oTS = new SimpleDateFormat(
+	    "yyyy/MM/dd hh:mm:ss.SSS");
+} // ____________________________________________________________________________

Deleted: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,155 +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.ByteArrayInputStream;
-import java.io.Closeable;
-import java.io.IOException;
-
-import javax.xml.namespace.QName;
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpression;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-/**
- * Util methods for XPath related operations.
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- * @since 4.2
- *
- */
-public class XPathUtil
-{
-	private static Logger log = Logger.getLogger( XPathUtil.class );
-	
-	/**
-	 * Parses the passed in xml and creates a Dom Document
-	 * 
-	 * @param xml
-	 * @return Document
-	 * @throws SAXException
-	 * @throws IOException
-	 * @throws ParserConfigurationException
-	 */
-	public static org.w3c.dom.Document getDocument( String xml ) throws SAXException, IOException, ParserConfigurationException
-	{
-		if (xml == null) 
-			throw new IllegalArgumentException( "xml must not be null" );
-		
-		ByteArrayInputStream inputStream = null;
-		try
-		{
-			DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
-			DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
-			inputStream = new ByteArrayInputStream( xml.getBytes() );
-			return documentBuilder.parse( inputStream );
-		} 
-		finally
-		{
-			close( inputStream );
-		}
-	}
-	
-	/**
-	 * Will compile the passed in XPath expression and evalutate it
-	 * against the passed in doument.
-	 * 
-	 * @param document			Document that the XPath expression should evaluate upon.
-	 * @param xPathExpression	XPath expression
-	 * @return Element			The Element found
-	 * @throws XPathExpressionException
-	 */
-	public static Element getNodeFromXPathExpression( Document document, String xPathExpression ) throws XPathExpressionException
-	{
-		if (document == null)
-			throw new IllegalArgumentException( "document must not be null" );
-		
-		if ( xPathExpression == null )
-			return document.getDocumentElement();
-		
-		Node rootNode = (Node) getQNameFromXPathExpression( document, xPathExpression, XPathConstants.NODE );
-		
-		return (Element) rootNode;
-	}
-	
-	/**
-	 * @param xml				XML string that will be the target of the XPath evaluation
-	 * @param xPathExpression	XPath expression
-	 * @return Element			The Element found
-	 * 
-	 * @throws XPathExpressionException
-	 * @throws SAXException
-	 * @throws IOException
-	 * @throws ParserConfigurationException
-	 */
-	public static Element getNodeFromXPathExpression( String xml, String xPathExpression ) throws XPathExpressionException, SAXException, IOException, ParserConfigurationException
-	{
-		return getNodeFromXPathExpression( getDocument( xml ), xPathExpression );
-	}
-	
-	/**
-	 * All public methods should be able to delegate the actual XPath evaluation
-	 * to this method.
-	 * 
-	 * @param document			Document that the XPath expression should evaluate upon.
-	 * 							Must not be null. This caller is responsible for checking for null.
-	 * @param xPathExpression	XPath expression
-	 * 							Must not be null. This caller is responsible for checking for null.
-	 * @param type				The XPathConstant type to use. The affects the type returned from the evaluate method.
-	 * 
-	 * @return Object			of type specified in the passed in <code>type</code> argument
-	 * 
-	 * @throws XPathExpressionException
-	 */
-	private static Object getQNameFromXPathExpression( Document document, String xPathExpression, QName type ) throws XPathExpressionException
-	{
-		XPath xpath = XPathFactory.newInstance().newXPath();
-		XPathExpression expression = xpath.compile( xPathExpression );
-		
-		return expression.evaluate( document.getDocumentElement(), type );
-	}
-
-	private static void close (Closeable c )
-	{
-		try
-		{
-			if ( c != null )
-				c.close();
-		} 
-		catch (IOException e)
-		{
-			log.error(  "Error when closing IOStream", e );
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/src/org/jboss/soa/esb/util/XPathUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,155 @@
+/*
+ * 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.ByteArrayInputStream;
+import java.io.Closeable;
+import java.io.IOException;
+
+import javax.xml.namespace.QName;
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpression;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/**
+ * Util methods for XPath related operations.
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ * @since 4.2
+ *
+ */
+public class XPathUtil
+{
+	private static Logger log = Logger.getLogger( XPathUtil.class );
+	
+	/**
+	 * Parses the passed in xml and creates a Dom Document
+	 * 
+	 * @param xml
+	 * @return Document
+	 * @throws SAXException
+	 * @throws IOException
+	 * @throws ParserConfigurationException
+	 */
+	public static org.w3c.dom.Document getDocument( String xml ) throws SAXException, IOException, ParserConfigurationException
+	{
+		if (xml == null) 
+			throw new IllegalArgumentException( "xml must not be null" );
+		
+		ByteArrayInputStream inputStream = null;
+		try
+		{
+			DocumentBuilderFactory documentBuilderFactory = DocumentBuilderFactory.newInstance();
+			DocumentBuilder documentBuilder = documentBuilderFactory.newDocumentBuilder();
+			inputStream = new ByteArrayInputStream( xml.getBytes() );
+			return documentBuilder.parse( inputStream );
+		} 
+		finally
+		{
+			close( inputStream );
+		}
+	}
+	
+	/**
+	 * Will compile the passed in XPath expression and evalutate it
+	 * against the passed in doument.
+	 * 
+	 * @param document			Document that the XPath expression should evaluate upon.
+	 * @param xPathExpression	XPath expression
+	 * @return Element			The Element found
+	 * @throws XPathExpressionException
+	 */
+	public static Element getNodeFromXPathExpression( Document document, String xPathExpression ) throws XPathExpressionException
+	{
+		if (document == null)
+			throw new IllegalArgumentException( "document must not be null" );
+		
+		if ( xPathExpression == null )
+			return document.getDocumentElement();
+		
+		Node rootNode = (Node) getQNameFromXPathExpression( document, xPathExpression, XPathConstants.NODE );
+		
+		return (Element) rootNode;
+	}
+	
+	/**
+	 * @param xml				XML string that will be the target of the XPath evaluation
+	 * @param xPathExpression	XPath expression
+	 * @return Element			The Element found
+	 * 
+	 * @throws XPathExpressionException
+	 * @throws SAXException
+	 * @throws IOException
+	 * @throws ParserConfigurationException
+	 */
+	public static Element getNodeFromXPathExpression( String xml, String xPathExpression ) throws XPathExpressionException, SAXException, IOException, ParserConfigurationException
+	{
+		return getNodeFromXPathExpression( getDocument( xml ), xPathExpression );
+	}
+	
+	/**
+	 * All public methods should be able to delegate the actual XPath evaluation
+	 * to this method.
+	 * 
+	 * @param document			Document that the XPath expression should evaluate upon.
+	 * 							Must not be null. This caller is responsible for checking for null.
+	 * @param xPathExpression	XPath expression
+	 * 							Must not be null. This caller is responsible for checking for null.
+	 * @param type				The XPathConstant type to use. The affects the type returned from the evaluate method.
+	 * 
+	 * @return Object			of type specified in the passed in <code>type</code> argument
+	 * 
+	 * @throws XPathExpressionException
+	 */
+	private static Object getQNameFromXPathExpression( Document document, String xPathExpression, QName type ) throws XPathExpressionException
+	{
+		XPath xpath = XPathFactory.newInstance().newXPath();
+		XPathExpression expression = xpath.compile( xPathExpression );
+		
+		return expression.evaluate( document.getDocumentElement(), type );
+	}
+
+	private static void close (Closeable c )
+	{
+		try
+		{
+			if ( c != null )
+				c.close();
+		} 
+		catch (IOException e)
+		{
+			log.error(  "Error when closing IOStream", e );
+		}
+	}
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests)


Property changes on: labs/jbossesb/trunk/product/rosetta/tests
___________________________________________________________________
Name: svn:ignore
   + TESTS-TestSuites.xml
junit*.properties


Deleted: labs/jbossesb/trunk/product/rosetta/tests/build.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/build.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/build.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,236 +0,0 @@
-<?xml version="1.0"?>
-<project name="build.rosetta.tests" default="org.jboss.esb.rosetta.tests.compile" basedir=".">
-
-	<property name="org.jboss.esb.internal.dest" location="../../../build"/>
-    <property name="org.jboss.esb.module.src.dir" location="../src"/>
-    <property name="org.jboss.esb.module.classes.dir" location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
-    <property name="org.jboss.esb.module.tests.src.dir" location="src"/>
-    <property name="org.jboss.esb.tests.classes.dir" location="${org.jboss.esb.internal.dest}/tests"/>
-    <property name="org.jboss.esb.tests.report.dir" location="${org.jboss.esb.internal.dest}/tests/junit"/>
-    <property name="org.jboss.esb.root.dir" location="../.."/>
-    <property name="org.jboss.esb.module.tests.coverage.dir" location="${org.jboss.esb.internal.dest}/tests/coverage/rosetta"/>
-    <property name="org.jboss.esb.module.classes.instr.dir" location="${org.jboss.esb.module.tests.coverage.dir}/instr" />
-    <property environment="env"/>
-    <property name="org.jboss.esb.ext.lib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
-	<!-- Set deployment properties filename -->
-	<property name="org.jboss.esb.deployment.properties" location="../../install/deployment.properties"/>
-	<!-- Load deployment properties File -->
-	<property file="${org.jboss.esb.deployment.properties}"/>
-	<property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
-
-	
-	<property name="org.jboss.esb.test.ftp.hostname" value="localhost"/>
-	<property name="org.jboss.esb.test.ftp.user" value="ftpuser"/>
-	<property name="org.jboss.esb.test.ftp.pwd" value="ftppassword"/>
-	<property name="org.jboss.esb.test.ftp.dir" value="/tmp"/>
-	<property name="org.jboss.esb.test.persistdb.dir" location="${org.jboss.esb.internal.dest}/testdb"/>
-
-    <condition property="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.jboss.home}/client">
-        <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
-    </condition>
-
-	<property name="org.jboss.esb.ftp.lib.dir" location="${org.jboss.esb.root.dir}/ftp/lib"/>
-
-    <path id="org.jboss.esb.tests.base.classpath">
-        <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
-        <fileset dir="${org.jboss.esb.ftp.lib.dir}" includes="*.jar"/>
-		<pathelement location="${org.jboss.esb.module.classes.root.dir}/rosetta"/>
-		<pathelement location="${gendir}/classes"/>
-        <pathelement location="${org.jboss.esb.module.classes.dir}"/>
-    	<pathelement location="${org.jboss.esb.root.dir}/rosetta/tests/resources/etc"/>
-		<pathelement location="${org.jboss.esb.module.tests.conf.dir}"/>
-        <pathelement location="${org.jboss.esb.root.dir}/etc/schemas/xml"/>
-    </path>
-
-    <target name="org.jboss.esb.tests.init">
-        <tstamp>
-            <format property="TODAY" pattern="dd-MM-yy"/>
-        </tstamp>
-
-        <mkdir dir="${org.jboss.esb.tests.classes.dir}"/>
-        <mkdir dir="${org.jboss.esb.tests.report.dir}"/>
-    </target>
-
-    <target name="clean">
-        <delete dir="${org.jboss.esb.tests.classes.dir}"/>
-        <delete file="TESTS-TestSuites.xml"/>
-    </target>
-
-    <target name="org.jboss.esb.rosetta.tests.compile" if="org.jboss.esb.buildtests" depends="org.jboss.esb.tests.init">
-
-        <javac
-                destdir="${org.jboss.esb.tests.classes.dir}"
-                classpathref="org.jboss.esb.tests.base.classpath"
-                debug="${org.jboss.esb.debug}"
-                optimize="${org.jboss.esb.optimize}"
-                >
-            <src path="${org.jboss.esb.module.tests.src.dir}"/>
-        </javac>
-
-    </target>
-
-	<!-- ====================================================================== -->
-    <!--                             T E S T                                    -->
-    <!-- ====================================================================== -->
-    <target name="org.jboss.esb.rosetta.internal.test">
-		<!-- Instrument the code for code coverage - using emma... -->
-    	<delete dir="${org.jboss.esb.module.tests.coverage.dir}" />
-	    <mkdir dir="${org.jboss.esb.module.classes.instr.dir}" />
-	    <emma>
-			<instr 	instrpath="${org.jboss.esb.module.classes.dir}" 
-					destdir="${org.jboss.esb.module.classes.instr.dir}" 
-					metadatafile="${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
-	    </emma>        
-
-    	<!-- Run the tests -->
-        <antcall target="org.jboss.esb.services.internal.test.exec"/>        
-
-    	<!-- Generate the coverage report -->
-	    <emma>
-			<report sourcepath="${org.jboss.esb.module.src.dir}" sort="+block,+name,+method,+class" metrics="method:70,block:80,line:80,class:100">
-		        <fileset dir="${org.jboss.esb.module.tests.coverage.dir}" >
-					<include name="*.emma" />
-		        </fileset>
-		        <html outfile="${org.jboss.esb.module.tests.coverage.dir}/index.html" depth="method" columns="name,line,class,method,block"/>
-			</report>
-	    </emma>
-    </target>
-
-    <!-- ====================================================================== -->
-    <!--         U N I T   A N D   F U N C T I O N A L   T E S T S              -->
-    <!-- ====================================================================== -->
-    <target name="org.jboss.esb.services.internal.test.exec">
-        <echo message="Running tests '${tests.to.run}' for Rosetta module, excluding integration"/>
-
-        <delete dir="${org.jboss.esb.test.persistdb.dir}" failonerror="false"/>
-        <mkdir dir="${org.jboss.esb.test.persistdb.dir}"/>
-        <copy todir="${org.jboss.esb.test.persistdb.dir}">
-            <fileset dir="resources/etc/" includes="persistUnitTestDB*"/>
-        </copy>
-		<copy file="${org.jboss.esb.root.dir}/etc/schemas/xml/jbossesb-1.0.1.xsd" todir="${org.jboss.esb.tests.classes.dir}"/>
-
-
-        <junit printsummary="yes" haltonerror="yes" haltonfailure="yes" showoutput="no" fork="true">
-            <formatter type="plain" usefile="false"/>
-            <formatter type="xml"/>
-            <batchtest todir="${org.jboss.esb.tests.report.dir}">
-                <fileset dir="${org.jboss.esb.module.tests.src.dir}">
-                    <include name="**/${tests.to.run}UnitTest.java"/>
-                    <include name="**/${tests.to.run}FuncTest.java"/>
-                </fileset>
-            </batchtest>
-            <classpath>
-        		<!-- log4j location  -->
-                <pathelement location="${basedir}/resources/etc"/>
-        		<!-- using instrumented code for code coverage -->
-                <pathelement location="${org.jboss.esb.module.classes.instr.dir}"/>
-                <pathelement location="${org.jboss.esb.tests.classes.dir}"/>
-            	<!-- Need the tests src folder because there may be non-compiled test resources -->
-                <pathelement location="${org.jboss.esb.module.tests.src.dir}"/>
-                <path refid="org.jboss.esb.tests.base.classpath"/>
-            </classpath>
-			<!-- emma jvm args -->
-			<jvmarg value="-Demma.coverage.out.file=${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
-			<jvmarg value="-Demma.coverage.out.merge=true" />
-        	<!--	
-        	<sysproperty key="org.jboss.esb.test.db.driver" value="${org.jboss.esb.test.db.driver}"/>
-        	<sysproperty key="org.jboss.esb.test.db.url" value="${org.jboss.esb.test.db.url}"/>
-        	<sysproperty key="org.jboss.esb.test.db.user" value="${org.jboss.esb.test.db.user}"/>
-        	<sysproperty key="org.jboss.esb.test.db.password" value="${org.jboss.esb.test.db.password}"/>
-			-->
-        	<sysproperty key="org.jboss.esb.test.ftp.hostname" value="${org.jboss.esb.test.ftp.hostname}"/>
-        	<sysproperty key="org.jboss.esb.test.ftp.user" value="${org.jboss.esb.test.ftp.user}"/>
-        	<sysproperty key="org.jboss.esb.test.ftp.pwd" value="${org.jboss.esb.test.ftp.pwd}"/>
-        	<sysproperty key="org.jboss.esb.test.ftp.dir" value="${org.jboss.esb.test.ftp.dir}"/>
-                <sysproperty key="org.jboss.esb.test.persistdb.dir" value="${org.jboss.esb.test.persistdb.dir}"/>
-        	<sysproperty key="log4j.configuration" value="log4j.xml"/>
-        </junit>
-        <junitreport>
-            <fileset dir="${org.jboss.esb.tests.report.dir}">
-                <include name="*.xml"/>
-            </fileset>
-            <report format="frames" todir="${org.jboss.esb.tests.report.dir}"/>
-            <report format="noframes" todir="${org.jboss.esb.tests.report.dir}"/>
-        </junitreport>
-    </target>
-	
-	<!-- ====================================================================== -->
-	    <!--                            INTEGRATION  T E S T                                    -->
-	    <!-- ====================================================================== -->
-	    <target name="org.jboss.esb.rosetta.internal.integration.test">
-			<!-- Instrument the code for code coverage - using emma... -->
-	    	<delete dir="${org.jboss.esb.module.tests.coverage.dir}" />
-		    <mkdir dir="${org.jboss.esb.module.classes.instr.dir}" />
-		    <emma>
-				<instr 	instrpath="${org.jboss.esb.module.classes.dir}" 
-						destdir="${org.jboss.esb.module.classes.instr.dir}" 
-						metadatafile="${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
-		    </emma>        
-
-	    	<!-- Run the tests -->
-	        <antcall target="org.jboss.esb.services.internal.integration.test.exec"/>        
-
-	    	<!-- Generate the coverage report -->
-		    <emma>
-				<report sourcepath="${org.jboss.esb.module.src.dir}" sort="+block,+name,+method,+class" metrics="method:70,block:80,line:80,class:100">
-			        <fileset dir="${org.jboss.esb.module.tests.coverage.dir}" >
-						<include name="*.emma" />
-			        </fileset>
-			        <html outfile="${org.jboss.esb.module.tests.coverage.dir}/index.html" depth="method" columns="name,line,class,method,block"/>
-				</report>
-		    </emma>
-	    </target>
-
-	    <!-- ====================================================================== -->
-	    <!--         INTEGRATION   T E S T S              -->
-	    <!-- ====================================================================== -->
-	    <target name="org.jboss.esb.services.internal.integration.test.exec">
-	        <echo message="Running all tests for module"/>
-                <delete dir="${org.jboss.esb.test.persistdb.dir}" failonerror="false"/>
-                <mkdir dir="${org.jboss.esb.test.persistdb.dir}"/>
-                <copy todir="${org.jboss.esb.test.persistdb.dir}">
-                    <fileset dir="resources/etc/" includes="persistUnitTestDB*"/>
-                </copy>
-
-	        <junit printsummary="yes" haltonerror="yes" haltonfailure="yes" showoutput="no" fork="true">
-	            <formatter type="plain" usefile="false"/>
-	            <formatter type="xml"/>
-	            <batchtest todir="${org.jboss.esb.tests.report.dir}">
-	                <fileset dir="${org.jboss.esb.module.tests.src.dir}">
-	                	<include name="**/**IntegrationTest.java"/>
-	                	<include name="**/**UnitTest.java"/>
-	                	<include name="**/**FuncTest.java"/>
-	                </fileset>
-	            </batchtest>
-	            <classpath>
-	        		<!-- using instrumented code for code coverage -->
-	                <pathelement location="${org.jboss.esb.module.classes.instr.dir}"/>
-	                <pathelement location="${org.jboss.esb.tests.classes.dir}"/>
-	            	<!-- Need the tests src folder because there may be non-compiled test resources -->
-	                <pathelement location="${org.jboss.esb.module.tests.src.dir}"/>
-	                <path refid="org.jboss.esb.tests.base.classpath"/>
-	            </classpath>
-				<!-- emma jvm args -->
-				<jvmarg value="-Demma.coverage.out.file=${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
-				<jvmarg value="-Demma.coverage.out.merge=true" />
-	        	
-	        	<sysproperty key="org.jboss.esb.test.db.driver" value="${org.jboss.esb.test.db.driver}"/>
-	        	<sysproperty key="org.jboss.esb.test.db.url" value="${org.jboss.esb.test.db.url}"/>
-	        	<sysproperty key="org.jboss.esb.test.db.user" value="${org.jboss.esb.test.db.user}"/>
-	        	<sysproperty key="org.jboss.esb.test.db.password" value="${org.jboss.esb.test.db.password}"/>
-	        	<sysproperty key="org.jboss.esb.test.ftp.hostname" value="${org.jboss.esb.test.ftp.hostname}"/>
-	        	<sysproperty key="org.jboss.esb.test.ftp.user" value="${org.jboss.esb.test.ftp.user}"/>
-	        	<sysproperty key="org.jboss.esb.test.ftp.pwd" value="${org.jboss.esb.test.ftp.pwd}"/>
-	        	<sysproperty key="org.jboss.esb.test.ftp.dir" value="${org.jboss.esb.test.ftp.dir}"/>
-                        <sysproperty key="org.jboss.esb.test.persistdb.dir" value="${org.jboss.esb.test.persistdb.dir}"/>
-	        	<sysproperty key="log4j.configuration" value="log4j.xml"/>
-	        </junit>
-	        <junitreport>
-	            <fileset dir="${org.jboss.esb.tests.report.dir}">
-	                <include name="*.xml"/>
-	            </fileset>
-	            <report format="frames" todir="${org.jboss.esb.tests.report.dir}"/>
-	            <report format="noframes" todir="${org.jboss.esb.tests.report.dir}"/>
-	        </junitreport>
-	    </target>
-</project>

Copied: labs/jbossesb/trunk/product/rosetta/tests/build.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/build.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/build.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/build.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,236 @@
+<?xml version="1.0"?>
+<project name="build.rosetta.tests" default="org.jboss.esb.rosetta.tests.compile" basedir=".">
+
+	<property name="org.jboss.esb.internal.dest" location="../../../build"/>
+    <property name="org.jboss.esb.module.src.dir" location="../src"/>
+    <property name="org.jboss.esb.module.classes.dir" location="${org.jboss.esb.internal.dest}/classes/rosetta"/>
+    <property name="org.jboss.esb.module.tests.src.dir" location="src"/>
+    <property name="org.jboss.esb.tests.classes.dir" location="${org.jboss.esb.internal.dest}/tests"/>
+    <property name="org.jboss.esb.tests.report.dir" location="${org.jboss.esb.internal.dest}/tests/junit"/>
+    <property name="org.jboss.esb.root.dir" location="../.."/>
+    <property name="org.jboss.esb.module.tests.coverage.dir" location="${org.jboss.esb.internal.dest}/tests/coverage/rosetta"/>
+    <property name="org.jboss.esb.module.classes.instr.dir" location="${org.jboss.esb.module.tests.coverage.dir}/instr" />
+    <property environment="env"/>
+    <property name="org.jboss.esb.ext.lib.dir" location="${org.jboss.esb.root.dir}/lib/ext"/>
+	<!-- Set deployment properties filename -->
+	<property name="org.jboss.esb.deployment.properties" location="../../install/deployment.properties"/>
+	<!-- Load deployment properties File -->
+	<property file="${org.jboss.esb.deployment.properties}"/>
+	<property name="gendir" location="${org.jboss.esb.internal.dest}/schema-model" />
+
+	
+	<property name="org.jboss.esb.test.ftp.hostname" value="localhost"/>
+	<property name="org.jboss.esb.test.ftp.user" value="ftpuser"/>
+	<property name="org.jboss.esb.test.ftp.pwd" value="ftppassword"/>
+	<property name="org.jboss.esb.test.ftp.dir" value="/tmp"/>
+	<property name="org.jboss.esb.test.persistdb.dir" location="${org.jboss.esb.internal.dest}/testdb"/>
+
+    <condition property="org.jboss.esb.ext.lib.dir" value="${org.jboss.esb.jboss.home}/client">
+        <equals arg1="${org.jboss.esb.frominstall}" arg2="yes"/>
+    </condition>
+
+	<property name="org.jboss.esb.ftp.lib.dir" location="${org.jboss.esb.root.dir}/ftp/lib"/>
+
+    <path id="org.jboss.esb.tests.base.classpath">
+        <fileset dir="${org.jboss.esb.ext.lib.dir}" includes="*.jar"/>
+        <fileset dir="${org.jboss.esb.ftp.lib.dir}" includes="*.jar"/>
+		<pathelement location="${org.jboss.esb.module.classes.root.dir}/rosetta"/>
+		<pathelement location="${gendir}/classes"/>
+        <pathelement location="${org.jboss.esb.module.classes.dir}"/>
+    	<pathelement location="${org.jboss.esb.root.dir}/rosetta/tests/resources/etc"/>
+		<pathelement location="${org.jboss.esb.module.tests.conf.dir}"/>
+        <pathelement location="${org.jboss.esb.root.dir}/etc/schemas/xml"/>
+    </path>
+
+    <target name="org.jboss.esb.tests.init">
+        <tstamp>
+            <format property="TODAY" pattern="dd-MM-yy"/>
+        </tstamp>
+
+        <mkdir dir="${org.jboss.esb.tests.classes.dir}"/>
+        <mkdir dir="${org.jboss.esb.tests.report.dir}"/>
+    </target>
+
+    <target name="clean">
+        <delete dir="${org.jboss.esb.tests.classes.dir}"/>
+        <delete file="TESTS-TestSuites.xml"/>
+    </target>
+
+    <target name="org.jboss.esb.rosetta.tests.compile" if="org.jboss.esb.buildtests" depends="org.jboss.esb.tests.init">
+
+        <javac
+                destdir="${org.jboss.esb.tests.classes.dir}"
+                classpathref="org.jboss.esb.tests.base.classpath"
+                debug="${org.jboss.esb.debug}"
+                optimize="${org.jboss.esb.optimize}"
+                >
+            <src path="${org.jboss.esb.module.tests.src.dir}"/>
+        </javac>
+
+    </target>
+
+	<!-- ====================================================================== -->
+    <!--                             T E S T                                    -->
+    <!-- ====================================================================== -->
+    <target name="org.jboss.esb.rosetta.internal.test">
+		<!-- Instrument the code for code coverage - using emma... -->
+    	<delete dir="${org.jboss.esb.module.tests.coverage.dir}" />
+	    <mkdir dir="${org.jboss.esb.module.classes.instr.dir}" />
+	    <emma>
+			<instr 	instrpath="${org.jboss.esb.module.classes.dir}" 
+					destdir="${org.jboss.esb.module.classes.instr.dir}" 
+					metadatafile="${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
+	    </emma>        
+
+    	<!-- Run the tests -->
+        <antcall target="org.jboss.esb.services.internal.test.exec"/>        
+
+    	<!-- Generate the coverage report -->
+	    <emma>
+			<report sourcepath="${org.jboss.esb.module.src.dir}" sort="+block,+name,+method,+class" metrics="method:70,block:80,line:80,class:100">
+		        <fileset dir="${org.jboss.esb.module.tests.coverage.dir}" >
+					<include name="*.emma" />
+		        </fileset>
+		        <html outfile="${org.jboss.esb.module.tests.coverage.dir}/index.html" depth="method" columns="name,line,class,method,block"/>
+			</report>
+	    </emma>
+    </target>
+
+    <!-- ====================================================================== -->
+    <!--         U N I T   A N D   F U N C T I O N A L   T E S T S              -->
+    <!-- ====================================================================== -->
+    <target name="org.jboss.esb.services.internal.test.exec">
+        <echo message="Running tests '${tests.to.run}' for Rosetta module, excluding integration"/>
+
+        <delete dir="${org.jboss.esb.test.persistdb.dir}" failonerror="false"/>
+        <mkdir dir="${org.jboss.esb.test.persistdb.dir}"/>
+        <copy todir="${org.jboss.esb.test.persistdb.dir}">
+            <fileset dir="resources/etc/" includes="persistUnitTestDB*"/>
+        </copy>
+		<copy file="${org.jboss.esb.root.dir}/etc/schemas/xml/jbossesb-1.0.1.xsd" todir="${org.jboss.esb.tests.classes.dir}"/>
+
+
+        <junit printsummary="yes" haltonerror="yes" haltonfailure="yes" showoutput="no" fork="true">
+            <formatter type="plain" usefile="false"/>
+            <formatter type="xml"/>
+            <batchtest todir="${org.jboss.esb.tests.report.dir}">
+                <fileset dir="${org.jboss.esb.module.tests.src.dir}">
+                    <include name="**/${tests.to.run}UnitTest.java"/>
+                    <include name="**/${tests.to.run}FuncTest.java"/>
+                </fileset>
+            </batchtest>
+            <classpath>
+        		<!-- log4j location  -->
+                <pathelement location="${basedir}/resources/etc"/>
+        		<!-- using instrumented code for code coverage -->
+                <pathelement location="${org.jboss.esb.module.classes.instr.dir}"/>
+                <pathelement location="${org.jboss.esb.tests.classes.dir}"/>
+            	<!-- Need the tests src folder because there may be non-compiled test resources -->
+                <pathelement location="${org.jboss.esb.module.tests.src.dir}"/>
+                <path refid="org.jboss.esb.tests.base.classpath"/>
+            </classpath>
+			<!-- emma jvm args -->
+			<jvmarg value="-Demma.coverage.out.file=${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
+			<jvmarg value="-Demma.coverage.out.merge=true" />
+        	<!--	
+        	<sysproperty key="org.jboss.esb.test.db.driver" value="${org.jboss.esb.test.db.driver}"/>
+        	<sysproperty key="org.jboss.esb.test.db.url" value="${org.jboss.esb.test.db.url}"/>
+        	<sysproperty key="org.jboss.esb.test.db.user" value="${org.jboss.esb.test.db.user}"/>
+        	<sysproperty key="org.jboss.esb.test.db.password" value="${org.jboss.esb.test.db.password}"/>
+			-->
+        	<sysproperty key="org.jboss.esb.test.ftp.hostname" value="${org.jboss.esb.test.ftp.hostname}"/>
+        	<sysproperty key="org.jboss.esb.test.ftp.user" value="${org.jboss.esb.test.ftp.user}"/>
+        	<sysproperty key="org.jboss.esb.test.ftp.pwd" value="${org.jboss.esb.test.ftp.pwd}"/>
+        	<sysproperty key="org.jboss.esb.test.ftp.dir" value="${org.jboss.esb.test.ftp.dir}"/>
+                <sysproperty key="org.jboss.esb.test.persistdb.dir" value="${org.jboss.esb.test.persistdb.dir}"/>
+        	<sysproperty key="log4j.configuration" value="log4j.xml"/>
+        </junit>
+        <junitreport>
+            <fileset dir="${org.jboss.esb.tests.report.dir}">
+                <include name="*.xml"/>
+            </fileset>
+            <report format="frames" todir="${org.jboss.esb.tests.report.dir}"/>
+            <report format="noframes" todir="${org.jboss.esb.tests.report.dir}"/>
+        </junitreport>
+    </target>
+	
+	<!-- ====================================================================== -->
+	    <!--                            INTEGRATION  T E S T                                    -->
+	    <!-- ====================================================================== -->
+	    <target name="org.jboss.esb.rosetta.internal.integration.test">
+			<!-- Instrument the code for code coverage - using emma... -->
+	    	<delete dir="${org.jboss.esb.module.tests.coverage.dir}" />
+		    <mkdir dir="${org.jboss.esb.module.classes.instr.dir}" />
+		    <emma>
+				<instr 	instrpath="${org.jboss.esb.module.classes.dir}" 
+						destdir="${org.jboss.esb.module.classes.instr.dir}" 
+						metadatafile="${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
+		    </emma>        
+
+	    	<!-- Run the tests -->
+	        <antcall target="org.jboss.esb.services.internal.integration.test.exec"/>        
+
+	    	<!-- Generate the coverage report -->
+		    <emma>
+				<report sourcepath="${org.jboss.esb.module.src.dir}" sort="+block,+name,+method,+class" metrics="method:70,block:80,line:80,class:100">
+			        <fileset dir="${org.jboss.esb.module.tests.coverage.dir}" >
+						<include name="*.emma" />
+			        </fileset>
+			        <html outfile="${org.jboss.esb.module.tests.coverage.dir}/index.html" depth="method" columns="name,line,class,method,block"/>
+				</report>
+		    </emma>
+	    </target>
+
+	    <!-- ====================================================================== -->
+	    <!--         INTEGRATION   T E S T S              -->
+	    <!-- ====================================================================== -->
+	    <target name="org.jboss.esb.services.internal.integration.test.exec">
+	        <echo message="Running all tests for module"/>
+                <delete dir="${org.jboss.esb.test.persistdb.dir}" failonerror="false"/>
+                <mkdir dir="${org.jboss.esb.test.persistdb.dir}"/>
+                <copy todir="${org.jboss.esb.test.persistdb.dir}">
+                    <fileset dir="resources/etc/" includes="persistUnitTestDB*"/>
+                </copy>
+
+	        <junit printsummary="yes" haltonerror="yes" haltonfailure="yes" showoutput="no" fork="true">
+	            <formatter type="plain" usefile="false"/>
+	            <formatter type="xml"/>
+	            <batchtest todir="${org.jboss.esb.tests.report.dir}">
+	                <fileset dir="${org.jboss.esb.module.tests.src.dir}">
+	                	<include name="**/**IntegrationTest.java"/>
+	                	<include name="**/**UnitTest.java"/>
+	                	<include name="**/**FuncTest.java"/>
+	                </fileset>
+	            </batchtest>
+	            <classpath>
+	        		<!-- using instrumented code for code coverage -->
+	                <pathelement location="${org.jboss.esb.module.classes.instr.dir}"/>
+	                <pathelement location="${org.jboss.esb.tests.classes.dir}"/>
+	            	<!-- Need the tests src folder because there may be non-compiled test resources -->
+	                <pathelement location="${org.jboss.esb.module.tests.src.dir}"/>
+	                <path refid="org.jboss.esb.tests.base.classpath"/>
+	            </classpath>
+				<!-- emma jvm args -->
+				<jvmarg value="-Demma.coverage.out.file=${org.jboss.esb.module.tests.coverage.dir}/coverage.emma" />
+				<jvmarg value="-Demma.coverage.out.merge=true" />
+	        	
+	        	<sysproperty key="org.jboss.esb.test.db.driver" value="${org.jboss.esb.test.db.driver}"/>
+	        	<sysproperty key="org.jboss.esb.test.db.url" value="${org.jboss.esb.test.db.url}"/>
+	        	<sysproperty key="org.jboss.esb.test.db.user" value="${org.jboss.esb.test.db.user}"/>
+	        	<sysproperty key="org.jboss.esb.test.db.password" value="${org.jboss.esb.test.db.password}"/>
+	        	<sysproperty key="org.jboss.esb.test.ftp.hostname" value="${org.jboss.esb.test.ftp.hostname}"/>
+	        	<sysproperty key="org.jboss.esb.test.ftp.user" value="${org.jboss.esb.test.ftp.user}"/>
+	        	<sysproperty key="org.jboss.esb.test.ftp.pwd" value="${org.jboss.esb.test.ftp.pwd}"/>
+	        	<sysproperty key="org.jboss.esb.test.ftp.dir" value="${org.jboss.esb.test.ftp.dir}"/>
+                        <sysproperty key="org.jboss.esb.test.persistdb.dir" value="${org.jboss.esb.test.persistdb.dir}"/>
+	        	<sysproperty key="log4j.configuration" value="log4j.xml"/>
+	        </junit>
+	        <junitreport>
+	            <fileset dir="${org.jboss.esb.tests.report.dir}">
+	                <include name="*.xml"/>
+	            </fileset>
+	            <report format="frames" todir="${org.jboss.esb.tests.report.dir}"/>
+	            <report format="noframes" todir="${org.jboss.esb.tests.report.dir}"/>
+	        </junitreport>
+	    </target>
+</project>

Copied: labs/jbossesb/trunk/product/rosetta/tests/resources (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/resources/device-profile.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources/device-profile.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/resources/device-profile.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,15 +0,0 @@
-<?xml version="1.0"?>
-<!DOCTYPE device-profiles PUBLIC "-//MILYN//DTD TINAK 1.0//EN" "http://www.milyn.org/dtd/device-profile-1.0.dtd">
-
-<device-profiles>
-	<device-profile name="type:Acme-Order-XML" list="profile1,profile2"/>
-	<device-profile name="from:Acme" list="profile23,profile24"/>
-	<device-profile name="to:AcmePartner" list="profile55,profile56"/>
-
-	<device-profile name="profile1" list="A"/>
-	<device-profile name="profile2" list="B"/>
-	<device-profile name="profile23" list="C"/>
-	<device-profile name="profile24" list="D"/>
-	<device-profile name="profile55" list="E"/>
-	<device-profile name="profile56" list="E"/>
-</device-profiles>

Copied: labs/jbossesb/trunk/product/rosetta/tests/resources/device-profile.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources/device-profile.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/resources/device-profile.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/resources/device-profile.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,15 @@
+<?xml version="1.0"?>
+<!DOCTYPE device-profiles PUBLIC "-//MILYN//DTD TINAK 1.0//EN" "http://www.milyn.org/dtd/device-profile-1.0.dtd">
+
+<device-profiles>
+	<device-profile name="type:Acme-Order-XML" list="profile1,profile2"/>
+	<device-profile name="from:Acme" list="profile23,profile24"/>
+	<device-profile name="to:AcmePartner" list="profile55,profile56"/>
+
+	<device-profile name="profile1" list="A"/>
+	<device-profile name="profile2" list="B"/>
+	<device-profile name="profile23" list="C"/>
+	<device-profile name="profile24" list="D"/>
+	<device-profile name="profile55" list="E"/>
+	<device-profile name="profile56" list="E"/>
+</device-profiles>

Copied: labs/jbossesb/trunk/product/rosetta/tests/resources/etc (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources/etc)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/resources/etc/jbossesb-test-properties.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources/etc/jbossesb-test-properties.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/resources/etc/jbossesb-test-properties.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,40 +0,0 @@
-<?xml version="1.0" encoding="ISO-8859-1"?>
-<!--
-  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.
--->
-<!-- $Id: default-jbossesb-properties.xml $ -->
-<!--
-  These options are described in the JBossESB manual.
-  Defaults are provided here for convenience only.
- 
-  Please read through this file prior to using the system, and consider
-  updating the specified entries.
--->
-<esb
-  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
-    <properties name="core">
-		<property name="org.jboss.soa.esb.jndi.server.context.factory" value="foobar"/>
-		<property name="org.jboss.soa.esb.objStore.configFile" value="file:config.xml"/>
-    </properties>
-    <properties name="transports" depends="core">
-    	<property name="org.jboss.soa.esb.mail.smtp.host" value="thishost"/>
-    </properties>
-</esb>

Copied: labs/jbossesb/trunk/product/rosetta/tests/resources/etc/jbossesb-test-properties.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources/etc/jbossesb-test-properties.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/resources/etc/jbossesb-test-properties.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/resources/etc/jbossesb-test-properties.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<!--
+  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.
+-->
+<!-- $Id: default-jbossesb-properties.xml $ -->
+<!--
+  These options are described in the JBossESB manual.
+  Defaults are provided here for convenience only.
+ 
+  Please read through this file prior to using the system, and consider
+  updating the specified entries.
+-->
+<esb
+  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+  xsi:noNamespaceSchemaLocation="jbossesb-1_0.xsd">
+    <properties name="core">
+		<property name="org.jboss.soa.esb.jndi.server.context.factory" value="foobar"/>
+		<property name="org.jboss.soa.esb.objStore.configFile" value="file:config.xml"/>
+    </properties>
+    <properties name="transports" depends="core">
+    	<property name="org.jboss.soa.esb.mail.smtp.host" value="thishost"/>
+    </properties>
+</esb>

Deleted: labs/jbossesb/trunk/product/rosetta/tests/resources/etc/log4j.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources/etc/log4j.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/resources/etc/log4j.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,103 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  Log4j Configuration                                                  -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: log4j.xml,v 1.26.2.10 2006/04/21 17:29:20 csuconic Exp $ -->
-
-<!--
-   | For more configuration infromation and examples see the Jakarta Log4j
-   | owebsite: http://jakarta.apache.org/log4j
- -->
-
-<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
-
-   <!-- ============================== -->
-   <!-- Append messages to the console -->
-   <!-- ============================== -->
-
-   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
-      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
-	  <param name="Threshold" value="FATAL"/>
-      <param name="Target" value="System.out"/>
-
-      <layout class="org.apache.log4j.PatternLayout">
-         <!-- The default pattern: Date Priority [Category] Message\n -->
-         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
-      </layout>
-   </appender>
-   
-   <!-- ================ -->
-   <!-- Limit categories -->
-   <!-- ================ -->
-
-   <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
-   <category name="org.apache">
-      <priority value="ERROR"/>
-   </category>
-
-   <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
-   <category name="org.jboss.serial">
-      <priority value="ERROR"/>
-   </category>
-
-   <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
-   <category name="org.jgroups">
-      <priority value="ERROR"/>
-   </category>
-
-   <!-- Limit the jacorb category to WARN as its INFO is verbose -->
-   <category name="jacorb">
-      <priority value="ERROR"/>
-   </category>
-
-   <!-- Limit JBoss categories -->
-   <category name="org.jboss">
-      <priority value="ERROR"/>
-   </category>
-
-
-   <!-- Limit the JSR77 categories -->
-   <category name="org.jboss.management">
-      <priority value="ERROR"/>
-   </category>
-
-   <!-- Limit Axis based webservice category -->
-   <category name="org.jboss.webservice">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.jboss.axis">
-      <priority value="ERROR"/>
-   </category>
-
-   <category name="org.milyn">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.milyn.delivery.SmooksXML">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.milyn.delivery.serialize.Serializer">
-      <priority value="ERROR"/>
-   </category>
-   <category name="org.milyn.cdr.XMLConfigDigester">
-      <priority value="ERROR"/>
-   </category>
-
-   <category name="org.mockejb">
-      <priority value="ERROR"/>
-   </category>
-
-   <!-- ======================= -->
-   <!-- Setup the Root category -->
-   <!-- ======================= -->
-
-   <root>
-      <appender-ref ref="CONSOLE"/>
-   </root>
-
- 
-</log4j:configuration>

Copied: labs/jbossesb/trunk/product/rosetta/tests/resources/etc/log4j.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources/etc/log4j.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/resources/etc/log4j.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/resources/etc/log4j.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,103 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE log4j:configuration SYSTEM "log4j.dtd">
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  Log4j Configuration                                                  -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: log4j.xml,v 1.26.2.10 2006/04/21 17:29:20 csuconic Exp $ -->
+
+<!--
+   | For more configuration infromation and examples see the Jakarta Log4j
+   | owebsite: http://jakarta.apache.org/log4j
+ -->
+
+<log4j:configuration xmlns:log4j="http://jakarta.apache.org/log4j/" debug="false">
+
+   <!-- ============================== -->
+   <!-- Append messages to the console -->
+   <!-- ============================== -->
+
+   <appender name="CONSOLE" class="org.apache.log4j.ConsoleAppender">
+      <errorHandler class="org.jboss.logging.util.OnlyOnceErrorHandler"/>
+	  <param name="Threshold" value="FATAL"/>
+      <param name="Target" value="System.out"/>
+
+      <layout class="org.apache.log4j.PatternLayout">
+         <!-- The default pattern: Date Priority [Category] Message\n -->
+         <param name="ConversionPattern" value="%d{ABSOLUTE} %-5p [%c{1}] %m%n"/>
+      </layout>
+   </appender>
+   
+   <!-- ================ -->
+   <!-- Limit categories -->
+   <!-- ================ -->
+
+   <!-- Limit the org.apache category to INFO as its DEBUG is verbose -->
+   <category name="org.apache">
+      <priority value="ERROR"/>
+   </category>
+
+   <!-- Limit the org.jboss.serial (jboss-serialization) to INFO as its DEBUG is verbose -->
+   <category name="org.jboss.serial">
+      <priority value="ERROR"/>
+   </category>
+
+   <!-- Limit the org.jgroups category to WARN as its INFO is verbose -->
+   <category name="org.jgroups">
+      <priority value="ERROR"/>
+   </category>
+
+   <!-- Limit the jacorb category to WARN as its INFO is verbose -->
+   <category name="jacorb">
+      <priority value="ERROR"/>
+   </category>
+
+   <!-- Limit JBoss categories -->
+   <category name="org.jboss">
+      <priority value="ERROR"/>
+   </category>
+
+
+   <!-- Limit the JSR77 categories -->
+   <category name="org.jboss.management">
+      <priority value="ERROR"/>
+   </category>
+
+   <!-- Limit Axis based webservice category -->
+   <category name="org.jboss.webservice">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.jboss.axis">
+      <priority value="ERROR"/>
+   </category>
+
+   <category name="org.milyn">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.milyn.delivery.SmooksXML">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.milyn.delivery.serialize.Serializer">
+      <priority value="ERROR"/>
+   </category>
+   <category name="org.milyn.cdr.XMLConfigDigester">
+      <priority value="ERROR"/>
+   </category>
+
+   <category name="org.mockejb">
+      <priority value="ERROR"/>
+   </category>
+
+   <!-- ======================= -->
+   <!-- Setup the Root category -->
+   <!-- ======================= -->
+
+   <root>
+      <appender-ref ref="CONSOLE"/>
+   </root>
+
+ 
+</log4j:configuration>

Deleted: labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.properties
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.properties	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.properties	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,17 +0,0 @@
-#HSQL Database Engine
-#Wed Dec 20 22:13:18 GMT 2006
-hsqldb.script_format=0
-runtime.gc_interval=0
-sql.enforce_strict_size=false
-hsqldb.cache_size_scale=8
-readonly=false
-hsqldb.nio_data_file=true
-hsqldb.cache_scale=14
-version=1.8.0
-hsqldb.default_table_type=memory
-hsqldb.cache_file_scale=1
-hsqldb.log_size=200
-modified=no
-hsqldb.cache_version=1.7.0
-hsqldb.original_version=1.8.0
-hsqldb.compatible_version=1.8.0

Copied: labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.properties (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.properties)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.properties	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,17 @@
+#HSQL Database Engine
+#Wed Dec 20 22:13:18 GMT 2006
+hsqldb.script_format=0
+runtime.gc_interval=0
+sql.enforce_strict_size=false
+hsqldb.cache_size_scale=8
+readonly=false
+hsqldb.nio_data_file=true
+hsqldb.cache_scale=14
+version=1.8.0
+hsqldb.default_table_type=memory
+hsqldb.cache_file_scale=1
+hsqldb.log_size=200
+modified=no
+hsqldb.cache_version=1.7.0
+hsqldb.original_version=1.8.0
+hsqldb.compatible_version=1.8.0

Deleted: labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.script
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.script	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.script	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,159 +0,0 @@
-CREATE SCHEMA PUBLIC AUTHORIZATION DBA
-CREATE MEMORY TABLE "pooltest"(A CHAR(1))
-CREATE MEMORY TABLE MESSAGE(UUID VARCHAR NOT NULL,TYPE VARCHAR NOT NULL,MESSAGE VARCHAR NOT NULL,CONSTRAINT PK_UID PRIMARY KEY(UUID))
-CREATE MEMORY TABLE BUSINESS_ENTITY(BUSINESS_KEY VARCHAR(41) NOT NULL PRIMARY KEY,AUTHORIZED_NAME VARCHAR(255) NOT NULL,PUBLISHER_ID VARCHAR(20),OPERATOR VARCHAR(255) NOT NULL,LAST_UPDATE TIMESTAMP NOT NULL)
-CREATE MEMORY TABLE BUSINESS_DESCR(BUSINESS_KEY VARCHAR(41) NOT NULL,BUSINESS_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,BUSINESS_DESCR_ID),CONSTRAINT SYS_FK_163 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
-CREATE MEMORY TABLE BUSINESS_CATEGORY(BUSINESS_KEY VARCHAR(41) NOT NULL,CATEGORY_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(41),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,CATEGORY_ID),CONSTRAINT SYS_FK_167 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
-CREATE MEMORY TABLE BUSINESS_IDENTIFIER(BUSINESS_KEY VARCHAR(41) NOT NULL,IDENTIFIER_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(41),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,IDENTIFIER_ID),CONSTRAINT SYS_FK_171 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
-CREATE MEMORY TABLE BUSINESS_NAME(BUSINESS_KEY VARCHAR(41) NOT NULL,BUSINESS_NAME_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),NAME VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,BUSINESS_NAME_ID),CONSTRAINT SYS_FK_175 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
-CREATE MEMORY TABLE CONTACT(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,USE_TYPE VARCHAR(255),PERSON_NAME VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,CONTACT_ID),CONSTRAINT SYS_FK_179 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
-CREATE MEMORY TABLE CONTACT_DESCR(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,CONTACT_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,CONTACT_ID,CONTACT_DESCR_ID),CONSTRAINT SYS_FK_183 FOREIGN KEY(BUSINESS_KEY,CONTACT_ID) REFERENCES CONTACT(BUSINESS_KEY,CONTACT_ID))
-CREATE MEMORY TABLE ADDRESS(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,ADDRESS_ID INTEGER NOT NULL,USE_TYPE VARCHAR(255),SORT_CODE VARCHAR(10),TMODEL_KEY VARCHAR(41),PRIMARY KEY(BUSINESS_KEY,CONTACT_ID,ADDRESS_ID),CONSTRAINT SYS_FK_187 FOREIGN KEY(BUSINESS_KEY,CONTACT_ID) REFERENCES CONTACT(BUSINESS_KEY,CONTACT_ID))
-CREATE MEMORY TABLE ADDRESS_LINE(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,ADDRESS_ID INTEGER NOT NULL,ADDRESS_LINE_ID INTEGER NOT NULL,LINE VARCHAR(80) NOT NULL,KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255),PRIMARY KEY(BUSINESS_KEY,CONTACT_ID,ADDRESS_ID,ADDRESS_LINE_ID),CONSTRAINT SYS_FK_191 FOREIGN KEY(BUSINESS_KEY,CONTACT_ID,ADDRESS_ID) REFERENCES ADDRESS(BUSINESS_KEY,CONTACT_ID,ADDRESS_ID))
-CREATE MEMORY TABLE EMAIL(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,EMAIL_ID INTEGER NOT NULL,USE_TYPE VARCHAR(255),EMAIL_ADDRESS VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,CONTACT_ID,EMAIL_ID),CONSTRAINT SYS_FK_195 FOREIGN KEY(BUSINESS_KEY,CONTACT_ID) REFERENCES CONTACT(BUSINESS_KEY,CONTACT_ID))
-CREATE MEMORY TABLE PHONE(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,PHONE_ID INTEGER NOT NULL,USE_TYPE VARCHAR(255),PHONE_NUMBER VARCHAR(50) NOT NULL,PRIMARY KEY(BUSINESS_KEY,CONTACT_ID,PHONE_ID),CONSTRAINT SYS_FK_199 FOREIGN KEY(BUSINESS_KEY,CONTACT_ID) REFERENCES CONTACT(BUSINESS_KEY,CONTACT_ID))
-CREATE MEMORY TABLE DISCOVERY_URL(BUSINESS_KEY VARCHAR(41) NOT NULL,DISCOVERY_URL_ID INTEGER NOT NULL,USE_TYPE VARCHAR(255) NOT NULL,URL VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,DISCOVERY_URL_ID),CONSTRAINT SYS_FK_203 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
-CREATE MEMORY TABLE BUSINESS_SERVICE(BUSINESS_KEY VARCHAR(41) NOT NULL,SERVICE_KEY VARCHAR(41) NOT NULL PRIMARY KEY,LAST_UPDATE TIMESTAMP NOT NULL,CONSTRAINT SYS_FK_207 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
-CREATE MEMORY TABLE SERVICE_DESCR(SERVICE_KEY VARCHAR(41) NOT NULL,SERVICE_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(SERVICE_KEY,SERVICE_DESCR_ID),CONSTRAINT SYS_FK_211 FOREIGN KEY(SERVICE_KEY) REFERENCES BUSINESS_SERVICE(SERVICE_KEY))
-CREATE MEMORY TABLE SERVICE_CATEGORY(SERVICE_KEY VARCHAR(41) NOT NULL,CATEGORY_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(41),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(SERVICE_KEY,CATEGORY_ID),CONSTRAINT SYS_FK_215 FOREIGN KEY(SERVICE_KEY) REFERENCES BUSINESS_SERVICE(SERVICE_KEY))
-CREATE MEMORY TABLE SERVICE_NAME(SERVICE_KEY VARCHAR(41) NOT NULL,SERVICE_NAME_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),NAME VARCHAR(255) NOT NULL,PRIMARY KEY(SERVICE_KEY,SERVICE_NAME_ID),CONSTRAINT SYS_FK_219 FOREIGN KEY(SERVICE_KEY) REFERENCES BUSINESS_SERVICE(SERVICE_KEY))
-CREATE MEMORY TABLE BINDING_TEMPLATE(SERVICE_KEY VARCHAR(41) NOT NULL,BINDING_KEY VARCHAR(41) NOT NULL PRIMARY KEY,ACCESS_POINT_TYPE VARCHAR(20),ACCESS_POINT_URL VARCHAR(255),HOSTING_REDIRECTOR VARCHAR(255),LAST_UPDATE TIMESTAMP NOT NULL,CONSTRAINT SYS_FK_223 FOREIGN KEY(SERVICE_KEY) REFERENCES BUSINESS_SERVICE(SERVICE_KEY))
-CREATE MEMORY TABLE BINDING_CATEGORY(BINDING_KEY VARCHAR(41) NOT NULL,CATEGORY_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(41),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(BINDING_KEY,CATEGORY_ID),CONSTRAINT SYS_FK_227 FOREIGN KEY(BINDING_KEY) REFERENCES BINDING_TEMPLATE(BINDING_KEY))
-CREATE MEMORY TABLE BINDING_DESCR(BINDING_KEY VARCHAR(41) NOT NULL,BINDING_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BINDING_KEY,BINDING_DESCR_ID),CONSTRAINT SYS_FK_231 FOREIGN KEY(BINDING_KEY) REFERENCES BINDING_TEMPLATE(BINDING_KEY))
-CREATE MEMORY TABLE TMODEL_INSTANCE_INFO(BINDING_KEY VARCHAR(41) NOT NULL,TMODEL_INSTANCE_INFO_ID INTEGER NOT NULL,TMODEL_KEY VARCHAR(41) NOT NULL,OVERVIEW_URL VARCHAR(255),INSTANCE_PARMS VARCHAR(255),PRIMARY KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID),CONSTRAINT SYS_FK_235 FOREIGN KEY(BINDING_KEY) REFERENCES BINDING_TEMPLATE(BINDING_KEY))
-CREATE MEMORY TABLE TMODEL_INSTANCE_INFO_DESCR(BINDING_KEY VARCHAR(41) NOT NULL,TMODEL_INSTANCE_INFO_ID INTEGER NOT NULL,TMODEL_INSTANCE_INFO_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID,TMODEL_INSTANCE_INFO_DESCR_ID),CONSTRAINT SYS_FK_239 FOREIGN KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID) REFERENCES TMODEL_INSTANCE_INFO(BINDING_KEY,TMODEL_INSTANCE_INFO_ID))
-CREATE MEMORY TABLE INSTANCE_DETAILS_DESCR(BINDING_KEY VARCHAR(41) NOT NULL,TMODEL_INSTANCE_INFO_ID INTEGER NOT NULL,INSTANCE_DETAILS_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID,INSTANCE_DETAILS_DESCR_ID),CONSTRAINT SYS_FK_243 FOREIGN KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID) REFERENCES TMODEL_INSTANCE_INFO(BINDING_KEY,TMODEL_INSTANCE_INFO_ID))
-CREATE MEMORY TABLE INSTANCE_DETAILS_DOC_DESCR(BINDING_KEY VARCHAR(41) NOT NULL,TMODEL_INSTANCE_INFO_ID INTEGER NOT NULL,INSTANCE_DETAILS_DOC_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID,INSTANCE_DETAILS_DOC_DESCR_ID),CONSTRAINT SYS_FK_247 FOREIGN KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID) REFERENCES TMODEL_INSTANCE_INFO(BINDING_KEY,TMODEL_INSTANCE_INFO_ID))
-CREATE MEMORY TABLE TMODEL(TMODEL_KEY VARCHAR(41) NOT NULL PRIMARY KEY,AUTHORIZED_NAME VARCHAR(255) NOT NULL,PUBLISHER_ID VARCHAR(20),OPERATOR VARCHAR(255) NOT NULL,NAME VARCHAR(255) NOT NULL,OVERVIEW_URL VARCHAR(255),DELETED VARCHAR(5),LAST_UPDATE TIMESTAMP NOT NULL)
-CREATE MEMORY TABLE TMODEL_DESCR(TMODEL_KEY VARCHAR(41) NOT NULL,TMODEL_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(TMODEL_KEY,TMODEL_DESCR_ID),CONSTRAINT SYS_FK_252 FOREIGN KEY(TMODEL_KEY) REFERENCES TMODEL(TMODEL_KEY))
-CREATE MEMORY TABLE TMODEL_CATEGORY(TMODEL_KEY VARCHAR(41) NOT NULL,CATEGORY_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(255),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(TMODEL_KEY,CATEGORY_ID),CONSTRAINT SYS_FK_256 FOREIGN KEY(TMODEL_KEY) REFERENCES TMODEL(TMODEL_KEY))
-CREATE MEMORY TABLE TMODEL_IDENTIFIER(TMODEL_KEY VARCHAR(41) NOT NULL,IDENTIFIER_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(255),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(TMODEL_KEY,IDENTIFIER_ID),CONSTRAINT SYS_FK_260 FOREIGN KEY(TMODEL_KEY) REFERENCES TMODEL(TMODEL_KEY))
-CREATE MEMORY TABLE TMODEL_DOC_DESCR(TMODEL_KEY VARCHAR(41) NOT NULL,TMODEL_DOC_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(TMODEL_KEY,TMODEL_DOC_DESCR_ID),CONSTRAINT SYS_FK_264 FOREIGN KEY(TMODEL_KEY) REFERENCES TMODEL(TMODEL_KEY))
-CREATE MEMORY TABLE PUBLISHER_ASSERTION(FROM_KEY VARCHAR(41) NOT NULL,TO_KEY VARCHAR(41) NOT NULL,TMODEL_KEY VARCHAR(41) NOT NULL,KEY_NAME VARCHAR(255) NOT NULL,KEY_VALUE VARCHAR(255) NOT NULL,FROM_CHECK VARCHAR(5) NOT NULL,TO_CHECK VARCHAR(5) NOT NULL,CONSTRAINT SYS_FK_268 FOREIGN KEY(FROM_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY),CONSTRAINT SYS_FK_269 FOREIGN KEY(TO_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
-CREATE MEMORY TABLE PUBLISHER(PUBLISHER_ID VARCHAR(20) NOT NULL PRIMARY KEY,PUBLISHER_NAME VARCHAR(255) NOT NULL,EMAIL_ADDRESS VARCHAR(255),IS_ADMIN VARCHAR(5),IS_ENABLED VARCHAR(5),MAX_BUSINESSES INTEGER,MAX_SERVICES_PER_BUSINESS INTEGER,MAX_BINDINGS_PER_SERVICE INTEGER,MAX_TMODELS INTEGER)
-CREATE MEMORY TABLE AUTH_TOKEN(AUTH_TOKEN VARCHAR(51) NOT NULL PRIMARY KEY,PUBLISHER_ID VARCHAR(20) NOT NULL,PUBLISHER_NAME VARCHAR(255) NOT NULL,CREATED TIMESTAMP NOT NULL,LAST_USED TIMESTAMP NOT NULL,NUMBER_OF_USES INTEGER NOT NULL,TOKEN_STATE INTEGER NOT NULL)
-CREATE USER SA PASSWORD ""
-GRANT DBA TO SA
-SET WRITE_DELAY 20
-SET SCHEMA PUBLIC
-INSERT INTO MESSAGE VALUES('urn:jboss:esb:message:UID:674a50d0-c925-412a-b9cf-cb485a4d109f','urn:jboss:esb:message:type:JAVA_SERIALIZED','rO0ABXNyAEBvcmcuamJvc3MuaW50ZXJuYWwuc29hLmVzYi5tZXNzYWdlLmZvcm1hdC5zZXJpYWxp\u000aemVkLk1lc3NhZ2VJbXBsAAAAAAAAAAACAAZMAAtfcHJvcGVydGllc3QAJkxvcmcvamJvc3Mvc29h\u000aL2VzYi9tZXNzYWdlL1Byb3BlcnRpZXM7TAAOX3RoZUF0dGFjaG1lbnR0AEVMb3JnL2pib3NzL2lu\u000adGVybmFsL3NvYS9lc2IvbWVzc2FnZS9mb3JtYXQvc2VyaWFsaXplZC9BdHRhY2htZW50SW1wbDtM\u000aAAhfdGhlQm9keXQAP0xvcmcvamJvc3MvaW50ZXJuYWwvc29hL2VzYi9tZXNzYWdlL2Zvcm1hdC9z\u000aZXJpYWxpemVkL0JvZHlJbXBsO0wAC190aGVDb250ZXh0dABCTG9yZy9qYm9zcy9pbnRlcm5hbC9z\u000ab2EvZXNiL21lc3NhZ2UvZm9ybWF0L3NlcmlhbGl6ZWQvQ29udGV4dEltcGw7TAAJX3RoZUZhdWx0\u000adABATG9yZy9qYm9zcy9pbnRlcm5hbC9zb2EvZXNiL21lc3NhZ2UvZm9ybWF0L3NlcmlhbGl6ZWQv\u000aRmF1bHRJbXBsO0wACl90aGVIZWFkZXJ0AEFMb3JnL2pib3NzL2ludGVybmFsL3NvYS9lc2IvbWVz\u000ac2FnZS9mb3JtYXQvc2VyaWFsaXplZC9IZWFkZXJJbXBsO3hwc3IAQ29yZy5qYm9zcy5pbnRlcm5h\u000abC5zb2EuZXNiLm1lc3NhZ2UuZm9ybW!
 F0LnNlcmlhbGl6ZWQuUHJvcGVydGllc0ltcGwAAAAAAAAA\u000aAAIAAUwABl90YWJsZXQAFUxqYXZhL3V0aWwvSGFzaHRhYmxlO3hwc3IAE2phdmEudXRpbC5IYXNo\u000adGFibGUTuw8lIUrkuAMAAkYACmxvYWRGYWN0b3JJAAl0aHJlc2hvbGR4cD9AAAAAAAAIdwgAAAAL\u000aAAAAAnQABXByb3AydAAEdmFsMnQABXByb3AxdAAEdmFsMXhzcgBDb3JnLmpib3NzLmludGVybmFs\u000aLnNvYS5lc2IubWVzc2FnZS5mb3JtYXQuc2VyaWFsaXplZC5BdHRhY2htZW50SW1wbAAAAAAAAAAA\u000aAgACTAAFX2xpc3R0ABVMamF2YS91dGlsL0FycmF5TGlzdDtMAAZfdGFibGVxAH4ACXhwc3IAE2ph\u000admEudXRpbC5BcnJheUxpc3R4gdIdmcdhnQMAAUkABHNpemV4cAAAAAJ3BAAAAAp0ABBURVNUIEFU\u000aVEFDSE1FTlQxdAAQVEVTVCBBVFRBQ0hNRU5UMnhzcQB+AAs/QAAAAAAACHcIAAAACwAAAAB4c3IA\u000aPW9yZy5qYm9zcy5pbnRlcm5hbC5zb2EuZXNiLm1lc3NhZ2UuZm9ybWF0LnNlcmlhbGl6ZWQuQm9k\u000aeUltcGwAAAAAAAAAAAIAAlsACF9jb250ZW50dAACW0JMAAhfb2JqZWN0c3EAfgAJeHB1cgACW0Ks\u000a8xf4BghU4AIAAHhwAAAACVRFU1QgQk9EWXNxAH4ACz9AAAAAAAAIdwgAAAALAAAAAHhzcgBAb3Jn\u000aLmpib3NzLmludGVybmFsLnNvYS5lc2IubWVzc2FnZS5mb3JtYXQuc2VyaWFsaXplZC5Db250ZXh0\u000aSW1wbAAAAAAAAAAAAgAAeHBzcgA+b3JnLm!
 pib3NzLmludGVybmFsLnNvYS5lc2IubWVzc2FnZS5m\u000ab3JtYXQuc2VyaWFsaXplZC
5GYXVsdEltcGwAAAAAAAAAAAIAAkwABV9jb2RldAAOTGphdmEvbmV0\u000aL1VSSTtMAAdfcmVhc29udAASTGphdmEvbGFuZy9TdHJpbmc7eHBwcHNyAD9vcmcuamJvc3MuaW50\u000aZXJuYWwuc29hLmVzYi5tZXNzYWdlLmZvcm1hdC5zZXJpYWxpemVkLkhlYWRlckltcGwAAAAAAAAA\u000aAAIAAUwABV9jYWxsdAAjTG9yZy9qYm9zcy9zb2EvZXNiL2FkZHJlc3NpbmcvQ2FsbDt4cHA=')
-INSERT INTO MESSAGE VALUES('urn:jboss:esb:message:UID:a89a113b-5211-4465-8dd1-75b76a3c17ac','urn:jboss:esb:message:type:JBOSS_XML','rO0ABXQB4Dw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04Ij8+CjxFbnZlbG9wZT4K\u000aICAgIDxIZWFkZXIvPgogICAgPENvbnRleHQvPgogICAgPEJvZHk+CiAgICAgICAgPEJ5dGVzPjwh\u000aW0NEQVRBW1ZFVlRWQ0JDVDBSWl1dPjwvQnl0ZXM+CiAgICA8L0JvZHk+CiAgICA8QXR0YWNobWVu\u000adD4KICAgICAgICA8VW5OYW1lZD48IVtDREFUQVtyTzBBQlhRQUVGUkZVMVFnUVZSVVFVTklUVVZP\u000aVkRFPV1dPjwvVW5OYW1lZD4KICAgICAgICA8VW5OYW1lZD48IVtDREFUQVtyTzBBQlhRQUVGUkZV\u000aMVFnUVZSVVFVTklUVVZPVkRJPV1dPjwvVW5OYW1lZD4KICAgIDwvQXR0YWNobWVudD4KICAgIDxQ\u000acm9wZXJ0aWVzPgogICAgICAgIDxwcm9wMj48IVtDREFUQVtyTzBBQlhRQUJIWmhiREk9XV0+PC9w\u000acm9wMj4KICAgICAgICA8cHJvcDE+PCFbQ0RBVEFbck8wQUJYUUFCSFpoYkRFPV1dPjwvcHJvcDE+\u000aCiAgICA8L1Byb3BlcnRpZXM+CjwvRW52ZWxvcGU+Cg==')
-INSERT INTO BUSINESS_ENTITY VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D','JBoss ESB User','jbossesb','jUDDI.org','2006-12-13 19:59:46.310000000')
-INSERT INTO BUSINESS_DESCR VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,'','Red Hat/JBoss Professional Open Source, Services for the JBossESB')
-INSERT INTO BUSINESS_NAME VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,'en','Red Hat/JBossESB')
-INSERT INTO CONTACT VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,NULL,'JBossESB')
-INSERT INTO ADDRESS VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,NULL,NULL,NULL)
-INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,0,'','STREET_NUMBER','3340')
-INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,1,'','STREET','Peachtree Road, NE, Suite 1200')
-INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,2,'','CITY','Atlanta')
-INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,3,'','COUNTRY','USA')
-INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,4,'','POSTALCODE','30326')
-INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,5,'','STATE','GA')
-INSERT INTO EMAIL VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,NULL,'jbossesb at jboss.com')
-INSERT INTO PHONE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,NULL,'404 467-8555')
-INSERT INTO DISCOVERY_URL VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,'businessEntity','http://localhost:8080/juddi/uddiget.jsp?businesskey=63A6CB40-8B0E-11DB-8B40-B10B88B41A9D')
-INSERT INTO TMODEL VALUES('uuid:082B0851-25D8-303C-B332-F24A6D53E38E','Administrator','admin','jUDDI.org','uddi-org:wsdl:portTypeReference','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#portTypeReference',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:2EC65201-9109-3919-9BEC-C9DBEFCACCF6','Administrator','admin','jUDDI.org','uddi-org:xml:localName','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#xmlLocalName',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:327A56F0-3299-4461-BC23-5CD513E95C55','Administrator','admin','jUDDI.org','uddi-org:operators','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#Operators',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:4064C064-6D14-4F35-8953-9652106476A9','Administrator','admin','jUDDI.org','uddi-org:owningBusiness','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#owningBusiness',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:4DC74177-7806-34D9-AECD-33C57DC3A865','Administrator','admin','jUDDI.org','uddi-org:wsdl:categorization:protocol','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#protocol',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88','Administrator','admin','jUDDI.org','uddi-org:iso-ch:3166-1999','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#ISO3166',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:6E090AFA-33E5-36EB-81B7-1CA18373F457','Administrator','admin','jUDDI.org','uddi-org:wsdl:types','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#wsdlTypes',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:6E10B91B-BABC-3442-B8FC-5A3C8FDE0794','Administrator','admin','jUDDI.org','uddi-org:protocol:http','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#http',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:807A2C6A-EE22-470D-ADC7-E0424A337C03','Administrator','admin','jUDDI.org','uddi-org:relationships','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#Relationships',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:8609C81E-EE1F-4D5A-B202-3EB13AD01823','Administrator','admin','jUDDI.org','dnb-com:D-U-N-S','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#D-U-N-S',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:A035A07C-F362-44DD-8F95-E2B134BF43B4','Administrator','admin','jUDDI.org','uddi-org:general_keywords','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#GenKW',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:AA254698-93DE-3870-8DF3-A5C075D64A0E','Administrator','admin','jUDDI.org','uddi-org:protocol:soap','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#soap',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:AD61DE98-4DB8-31B2-A299-A2373DC97212','Administrator','admin','jUDDI.org','uddi-org:wsdl:address','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#Address',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:B1B1BAF5-2329-43E6-AE13-BA8E97195039','Administrator','admin','jUDDI.org','thomasregister-com:supplierID','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#Thomas',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2','Administrator','admin','jUDDI.org','ntis-gov:naics:1997','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#NAICS',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','Administrator','admin','jUDDI.org','uddi-org:types','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#UDDItypes',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:CD153257-086A-4237-B336-6BDCBDCC6634','Administrator','admin','jUDDI.org','unspsc-org:unspsc','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#UNSPSC',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:D01987D1-AB2E-3013-9BE2-2A66EB99D824','Administrator','admin','jUDDI.org','uddi-org:xml:namespace','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#xmlNamespace',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:DB77450D-9FA8-45D4-A7BC-04411D14E384','Administrator','admin','jUDDI.org','unspsc-org:unspsc:3-1','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#UNSPSC31',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E','Administrator','admin','jUDDI.org','uddi-org:isReplacedBy','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#IsReplacedBy',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL VALUES('uuid:E5C43936-86E4-37BF-8196-1D04B35C0099','Administrator','admin','jUDDI.org','uddi-org:wsdl:categorization:transport','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#transport',NULL,'2006-12-13 00:00:00.0')
-INSERT INTO TMODEL_DESCR VALUES('uuid:082B0851-25D8-303C-B332-F24A6D53E38E',0,'en','A category system used to reference a wsdl:portType tModel')
-INSERT INTO TMODEL_DESCR VALUES('uuid:2EC65201-9109-3919-9BEC-C9DBEFCACCF6',0,'en','A category system used to indicate XML local names')
-INSERT INTO TMODEL_DESCR VALUES('uuid:327A56F0-3299-4461-BC23-5CD513E95C55',0,'en','Taxonomy for categorizing the businessEntity of an operator of a registry.')
-INSERT INTO TMODEL_DESCR VALUES('uuid:4064C064-6D14-4F35-8953-9652106476A9',0,'en','A pointer to a businessEntity that owns the tagged data.')
-INSERT INTO TMODEL_DESCR VALUES('uuid:4DC74177-7806-34D9-AECD-33C57DC3A865',0,'en','Category system used to describe the protocol supported by a wsdl:binding.')
-INSERT INTO TMODEL_DESCR VALUES('uuid:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88',0,'en','ISO 3166-1:1997 and 3166-2:1998. Codes for names of countries and their subdivisions. Part 1: Country codes. Part 2:Country subdivision codes. Update newsletters include ISO 3166-1 V-1 (1998-02-05), V-2 (1999-10-01), ISO 3166-2 I-1 (1998)')
-INSERT INTO TMODEL_DESCR VALUES('uuid:6E090AFA-33E5-36EB-81B7-1CA18373F457',0,'en','WSDL Type Category System')
-INSERT INTO TMODEL_DESCR VALUES('uuid:6E10B91B-BABC-3442-B8FC-5A3C8FDE0794',0,'en','A tModel that represents the HTTP protocol')
-INSERT INTO TMODEL_DESCR VALUES('uuid:807A2C6A-EE22-470D-ADC7-E0424A337C03',0,'en','Starter set classifications of businessEntity relationships')
-INSERT INTO TMODEL_DESCR VALUES('uuid:8609C81E-EE1F-4D5A-B202-3EB13AD01823',0,'en','Dun&Bradstreet D-U-N-S\u00c6 Number')
-INSERT INTO TMODEL_DESCR VALUES('uuid:A035A07C-F362-44DD-8F95-E2B134BF43B4',0,'en','Special taxonomy consisting of namespace identifiers and the keywords associated with the namespaces')
-INSERT INTO TMODEL_DESCR VALUES('uuid:AA254698-93DE-3870-8DF3-A5C075D64A0E',0,'en','A tModel that represents the SOAP 1.1 protocol')
-INSERT INTO TMODEL_DESCR VALUES('uuid:AD61DE98-4DB8-31B2-A299-A2373DC97212',0,'en','A tModel used to indicate the WSDL address option.')
-INSERT INTO TMODEL_DESCR VALUES('uuid:B1B1BAF5-2329-43E6-AE13-BA8E97195039',0,'en','Thomas Registry Suppliers')
-INSERT INTO TMODEL_DESCR VALUES('uuid:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2',0,'en','Business Taxonomy: NAICS(1997 Release)')
-INSERT INTO TMODEL_DESCR VALUES('uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4',0,'en','UDDI Type Taxonomy')
-INSERT INTO TMODEL_DESCR VALUES('uuid:CD153257-086A-4237-B336-6BDCBDCC6634',0,'en','Product Taxonomy: UNSPSC (Version 7.3)')
-INSERT INTO TMODEL_DESCR VALUES('uuid:D01987D1-AB2E-3013-9BE2-2A66EB99D824',0,'en','A category system used to indicate namespaces')
-INSERT INTO TMODEL_DESCR VALUES('uuid:DB77450D-9FA8-45D4-A7BC-04411D14E384',0,'en','Product Taxonomy: UNSPSC (Version 3.1)')
-INSERT INTO TMODEL_DESCR VALUES('uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E',0,'en','An identifier system used to point (using UDDI keys) to the tModel (or businessEntity) that is the logical replacement for the one in which isReplacedBy is used')
-INSERT INTO TMODEL_DESCR VALUES('uuid:E5C43936-86E4-37BF-8196-1D04B35C0099',0,'en','Category system used to describe the transport supported by a wsdl:binding.')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:082B0851-25D8-303C-B332-F24A6D53E38E',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','checked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:082B0851-25D8-303C-B332-F24A6D53E38E',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:2EC65201-9109-3919-9BEC-C9DBEFCACCF6',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','unchecked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:2EC65201-9109-3919-9BEC-C9DBEFCACCF6',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:327A56F0-3299-4461-BC23-5CD513E95C55',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:327A56F0-3299-4461-BC23-5CD513E95C55',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:4064C064-6D14-4F35-8953-9652106476A9',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:4064C064-6D14-4F35-8953-9652106476A9',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:4DC74177-7806-34D9-AECD-33C57DC3A865',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:4DC74177-7806-34D9-AECD-33C57DC3A865',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','checked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:6E090AFA-33E5-36EB-81B7-1CA18373F457',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','unchecked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:6E090AFA-33E5-36EB-81B7-1CA18373F457',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:6E10B91B-BABC-3442-B8FC-5A3C8FDE0794',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','protocol')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:807A2C6A-EE22-470D-ADC7-E0424A337C03',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','relationship')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:8609C81E-EE1F-4D5A-B202-3EB13AD01823',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','identifier')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:A035A07C-F362-44DD-8F95-E2B134BF43B4',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:AA254698-93DE-3870-8DF3-A5C075D64A0E',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','protocol')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:B1B1BAF5-2329-43E6-AE13-BA8E97195039',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','identifier')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:CD153257-086A-4237-B336-6BDCBDCC6634',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:CD153257-086A-4237-B336-6BDCBDCC6634',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','Checked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:D01987D1-AB2E-3013-9BE2-2A66EB99D824',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','unchecked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:D01987D1-AB2E-3013-9BE2-2A66EB99D824',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:DB77450D-9FA8-45D4-A7BC-04411D14E384',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','identifier')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:E5C43936-86E4-37BF-8196-1D04B35C0099',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
-INSERT INTO TMODEL_CATEGORY VALUES('uuid:E5C43936-86E4-37BF-8196-1D04B35C0099',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','checked')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:082B0851-25D8-303C-B332-F24A6D53E38E',0,'en','The WSDL portType Reference category system provides a mechanism to indicate that a UDDI entity has a relationship with a certain wsdl:portType tModel.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:2EC65201-9109-3919-9BEC-C9DBEFCACCF6',0,'en','The XML Local Name tModel provides a mechanism to indicate the name attribute for the uddi:businessService.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:327A56F0-3299-4461-BC23-5CD513E95C55',0,'en','This checked value set is used to identify UDDI operators.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:4064C064-6D14-4F35-8953-9652106476A9',0,'en','This tModel indicates the businessEntity that published or owns the tagged tModel. Used with tModels to establish an "owned" relationship with a registered businessEntity.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:4DC74177-7806-34D9-AECD-33C57DC3A865',0,'en','The Protocol Categorization tModel provides a mechanism to capture this protocol information in the UDDI binding tModel.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88',0,'en','Taxonomy used to categorize entries by geographic location.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:6E090AFA-33E5-36EB-81B7-1CA18373F457',0,'en','The WSDL Entity Type tModel uses a number of UDDI entities to represent the various entities within a WSDL document.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:6E10B91B-BABC-3442-B8FC-5A3C8FDE0794',0,'en','The HTTP Protocol tModel can be used to indicate that a Web service supports the HTTP protocol.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:807A2C6A-EE22-470D-ADC7-E0424A337C03',0,'en','This tModel is used to describe business relationships. Used in the publisher assertion messages.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:8609C81E-EE1F-4D5A-B202-3EB13AD01823',0,'en','This tModel is used for the Dun&Bradstreet D-U-N-S\u00c6 Number identifier.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:A035A07C-F362-44DD-8F95-E2B134BF43B4',0,'en','This tModel defines an unidentified taxonomy.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:AA254698-93DE-3870-8DF3-A5C075D64A0E',0,'en','The SOAP Protocol tModel can be used to indicate that a Web service supports the SOAP 1.1 protocol.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:AD61DE98-4DB8-31B2-A299-A2373DC97212',0,'en','The WSDL Address tModel provides A mechanism to indicate that the endpoint address should be obtained from a WSDL document.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:B1B1BAF5-2329-43E6-AE13-BA8E97195039',0,'en','This tModel is used for the Thomas Register supplier identifier codes.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2',0,'en','This tModel defines the NAICS industry taxonomy.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4',0,'en','Taxonomy used to categorize Service Descriptions.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:CD153257-086A-4237-B336-6BDCBDCC6634',0,'en','This tModel defines Version 7.3 of the UNSPSC product taxonomy.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:D01987D1-AB2E-3013-9BE2-2A66EB99D824',0,'en','A namespace provides necessary qualifying information about a technical concept or model. The XML Namespace tModel provides a mechanism to associate a namespace with a UDDI entity.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:DB77450D-9FA8-45D4-A7BC-04411D14E384',0,'en','This tModel defines the UNSPSC product taxonomy.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E',0,'en','This is a checked value set.')
-INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:E5C43936-86E4-37BF-8196-1D04B35C0099',0,'en','The Transport Categorization tModel provides a mechanism to capture transport information in the UDDI binding tModel which allows a user to search for bindings that implement a specific transport protocol.')
-INSERT INTO PUBLISHER VALUES('jbossesb','JBoss ESB User','kurt.stam at jboss.org','true','true',25,20,10,100)
-INSERT INTO AUTH_TOKEN VALUES('authToken:6398E890-8B0E-11DB-A890-BD3378DEEA8D','jbossesb','JBoss ESB User','2006-12-13 19:59:45.483000000','2006-12-13 19:59:45.515000000',1,1)
-INSERT INTO AUTH_TOKEN VALUES('authToken:63B08F40-8B0E-11DB-8F40-B83B3B891F3B','jbossesb','JBoss ESB User','2006-12-13 19:59:45.612000000','2006-12-13 19:59:45.631000000',1,1)
-INSERT INTO AUTH_TOKEN VALUES('authToken:63C17F30-8B0E-11DB-BF30-ADDE2FF4F176','jbossesb','JBoss ESB User','2006-12-13 19:59:45.704000000','2006-12-13 19:59:45.721000000',1,1)
-INSERT INTO AUTH_TOKEN VALUES('authToken:63CCA2C0-8B0E-11DB-A2C0-8EA621ECD068','jbossesb','JBoss ESB User','2006-12-13 19:59:45.787000000','2006-12-13 19:59:45.808000000',1,1)
-INSERT INTO AUTH_TOKEN VALUES('authToken:63D55550-8B0E-11DB-9550-9A038CCD580B','jbossesb','JBoss ESB User','2006-12-13 19:59:45.836000000','2006-12-13 19:59:45.849000000',1,1)
-INSERT INTO AUTH_TOKEN VALUES('authToken:6404A2B0-8B0E-11DB-A2B0-8E8E8812A522','jbossesb','JBoss ESB User','2006-12-13 19:59:46.139000000','2006-12-13 19:59:46.152000000',1,1)
-INSERT INTO AUTH_TOKEN VALUES('authToken:64101460-8B0E-11DB-9460-B33C0E8B0E1F','jbossesb','JBoss ESB User','2006-12-13 19:59:46.221000000','2006-12-13 19:59:46.235000000',1,1)
-INSERT INTO AUTH_TOKEN VALUES('authToken:6419B150-8B0E-11DB-B150-85E328013947','jbossesb','JBoss ESB User','2006-12-13 19:59:46.278000000','2006-12-13 19:59:46.298000000',1,1)

Copied: labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.script (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.script)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.script	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/resources/etc/persistUnitTestDB.script	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,159 @@
+CREATE SCHEMA PUBLIC AUTHORIZATION DBA
+CREATE MEMORY TABLE "pooltest"(A CHAR(1))
+CREATE MEMORY TABLE MESSAGE(UUID VARCHAR NOT NULL,TYPE VARCHAR NOT NULL,MESSAGE VARCHAR NOT NULL,CONSTRAINT PK_UID PRIMARY KEY(UUID))
+CREATE MEMORY TABLE BUSINESS_ENTITY(BUSINESS_KEY VARCHAR(41) NOT NULL PRIMARY KEY,AUTHORIZED_NAME VARCHAR(255) NOT NULL,PUBLISHER_ID VARCHAR(20),OPERATOR VARCHAR(255) NOT NULL,LAST_UPDATE TIMESTAMP NOT NULL)
+CREATE MEMORY TABLE BUSINESS_DESCR(BUSINESS_KEY VARCHAR(41) NOT NULL,BUSINESS_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,BUSINESS_DESCR_ID),CONSTRAINT SYS_FK_163 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
+CREATE MEMORY TABLE BUSINESS_CATEGORY(BUSINESS_KEY VARCHAR(41) NOT NULL,CATEGORY_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(41),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,CATEGORY_ID),CONSTRAINT SYS_FK_167 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
+CREATE MEMORY TABLE BUSINESS_IDENTIFIER(BUSINESS_KEY VARCHAR(41) NOT NULL,IDENTIFIER_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(41),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,IDENTIFIER_ID),CONSTRAINT SYS_FK_171 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
+CREATE MEMORY TABLE BUSINESS_NAME(BUSINESS_KEY VARCHAR(41) NOT NULL,BUSINESS_NAME_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),NAME VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,BUSINESS_NAME_ID),CONSTRAINT SYS_FK_175 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
+CREATE MEMORY TABLE CONTACT(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,USE_TYPE VARCHAR(255),PERSON_NAME VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,CONTACT_ID),CONSTRAINT SYS_FK_179 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
+CREATE MEMORY TABLE CONTACT_DESCR(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,CONTACT_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,CONTACT_ID,CONTACT_DESCR_ID),CONSTRAINT SYS_FK_183 FOREIGN KEY(BUSINESS_KEY,CONTACT_ID) REFERENCES CONTACT(BUSINESS_KEY,CONTACT_ID))
+CREATE MEMORY TABLE ADDRESS(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,ADDRESS_ID INTEGER NOT NULL,USE_TYPE VARCHAR(255),SORT_CODE VARCHAR(10),TMODEL_KEY VARCHAR(41),PRIMARY KEY(BUSINESS_KEY,CONTACT_ID,ADDRESS_ID),CONSTRAINT SYS_FK_187 FOREIGN KEY(BUSINESS_KEY,CONTACT_ID) REFERENCES CONTACT(BUSINESS_KEY,CONTACT_ID))
+CREATE MEMORY TABLE ADDRESS_LINE(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,ADDRESS_ID INTEGER NOT NULL,ADDRESS_LINE_ID INTEGER NOT NULL,LINE VARCHAR(80) NOT NULL,KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255),PRIMARY KEY(BUSINESS_KEY,CONTACT_ID,ADDRESS_ID,ADDRESS_LINE_ID),CONSTRAINT SYS_FK_191 FOREIGN KEY(BUSINESS_KEY,CONTACT_ID,ADDRESS_ID) REFERENCES ADDRESS(BUSINESS_KEY,CONTACT_ID,ADDRESS_ID))
+CREATE MEMORY TABLE EMAIL(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,EMAIL_ID INTEGER NOT NULL,USE_TYPE VARCHAR(255),EMAIL_ADDRESS VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,CONTACT_ID,EMAIL_ID),CONSTRAINT SYS_FK_195 FOREIGN KEY(BUSINESS_KEY,CONTACT_ID) REFERENCES CONTACT(BUSINESS_KEY,CONTACT_ID))
+CREATE MEMORY TABLE PHONE(BUSINESS_KEY VARCHAR(41) NOT NULL,CONTACT_ID INTEGER NOT NULL,PHONE_ID INTEGER NOT NULL,USE_TYPE VARCHAR(255),PHONE_NUMBER VARCHAR(50) NOT NULL,PRIMARY KEY(BUSINESS_KEY,CONTACT_ID,PHONE_ID),CONSTRAINT SYS_FK_199 FOREIGN KEY(BUSINESS_KEY,CONTACT_ID) REFERENCES CONTACT(BUSINESS_KEY,CONTACT_ID))
+CREATE MEMORY TABLE DISCOVERY_URL(BUSINESS_KEY VARCHAR(41) NOT NULL,DISCOVERY_URL_ID INTEGER NOT NULL,USE_TYPE VARCHAR(255) NOT NULL,URL VARCHAR(255) NOT NULL,PRIMARY KEY(BUSINESS_KEY,DISCOVERY_URL_ID),CONSTRAINT SYS_FK_203 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
+CREATE MEMORY TABLE BUSINESS_SERVICE(BUSINESS_KEY VARCHAR(41) NOT NULL,SERVICE_KEY VARCHAR(41) NOT NULL PRIMARY KEY,LAST_UPDATE TIMESTAMP NOT NULL,CONSTRAINT SYS_FK_207 FOREIGN KEY(BUSINESS_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
+CREATE MEMORY TABLE SERVICE_DESCR(SERVICE_KEY VARCHAR(41) NOT NULL,SERVICE_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(SERVICE_KEY,SERVICE_DESCR_ID),CONSTRAINT SYS_FK_211 FOREIGN KEY(SERVICE_KEY) REFERENCES BUSINESS_SERVICE(SERVICE_KEY))
+CREATE MEMORY TABLE SERVICE_CATEGORY(SERVICE_KEY VARCHAR(41) NOT NULL,CATEGORY_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(41),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(SERVICE_KEY,CATEGORY_ID),CONSTRAINT SYS_FK_215 FOREIGN KEY(SERVICE_KEY) REFERENCES BUSINESS_SERVICE(SERVICE_KEY))
+CREATE MEMORY TABLE SERVICE_NAME(SERVICE_KEY VARCHAR(41) NOT NULL,SERVICE_NAME_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),NAME VARCHAR(255) NOT NULL,PRIMARY KEY(SERVICE_KEY,SERVICE_NAME_ID),CONSTRAINT SYS_FK_219 FOREIGN KEY(SERVICE_KEY) REFERENCES BUSINESS_SERVICE(SERVICE_KEY))
+CREATE MEMORY TABLE BINDING_TEMPLATE(SERVICE_KEY VARCHAR(41) NOT NULL,BINDING_KEY VARCHAR(41) NOT NULL PRIMARY KEY,ACCESS_POINT_TYPE VARCHAR(20),ACCESS_POINT_URL VARCHAR(255),HOSTING_REDIRECTOR VARCHAR(255),LAST_UPDATE TIMESTAMP NOT NULL,CONSTRAINT SYS_FK_223 FOREIGN KEY(SERVICE_KEY) REFERENCES BUSINESS_SERVICE(SERVICE_KEY))
+CREATE MEMORY TABLE BINDING_CATEGORY(BINDING_KEY VARCHAR(41) NOT NULL,CATEGORY_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(41),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(BINDING_KEY,CATEGORY_ID),CONSTRAINT SYS_FK_227 FOREIGN KEY(BINDING_KEY) REFERENCES BINDING_TEMPLATE(BINDING_KEY))
+CREATE MEMORY TABLE BINDING_DESCR(BINDING_KEY VARCHAR(41) NOT NULL,BINDING_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BINDING_KEY,BINDING_DESCR_ID),CONSTRAINT SYS_FK_231 FOREIGN KEY(BINDING_KEY) REFERENCES BINDING_TEMPLATE(BINDING_KEY))
+CREATE MEMORY TABLE TMODEL_INSTANCE_INFO(BINDING_KEY VARCHAR(41) NOT NULL,TMODEL_INSTANCE_INFO_ID INTEGER NOT NULL,TMODEL_KEY VARCHAR(41) NOT NULL,OVERVIEW_URL VARCHAR(255),INSTANCE_PARMS VARCHAR(255),PRIMARY KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID),CONSTRAINT SYS_FK_235 FOREIGN KEY(BINDING_KEY) REFERENCES BINDING_TEMPLATE(BINDING_KEY))
+CREATE MEMORY TABLE TMODEL_INSTANCE_INFO_DESCR(BINDING_KEY VARCHAR(41) NOT NULL,TMODEL_INSTANCE_INFO_ID INTEGER NOT NULL,TMODEL_INSTANCE_INFO_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID,TMODEL_INSTANCE_INFO_DESCR_ID),CONSTRAINT SYS_FK_239 FOREIGN KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID) REFERENCES TMODEL_INSTANCE_INFO(BINDING_KEY,TMODEL_INSTANCE_INFO_ID))
+CREATE MEMORY TABLE INSTANCE_DETAILS_DESCR(BINDING_KEY VARCHAR(41) NOT NULL,TMODEL_INSTANCE_INFO_ID INTEGER NOT NULL,INSTANCE_DETAILS_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID,INSTANCE_DETAILS_DESCR_ID),CONSTRAINT SYS_FK_243 FOREIGN KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID) REFERENCES TMODEL_INSTANCE_INFO(BINDING_KEY,TMODEL_INSTANCE_INFO_ID))
+CREATE MEMORY TABLE INSTANCE_DETAILS_DOC_DESCR(BINDING_KEY VARCHAR(41) NOT NULL,TMODEL_INSTANCE_INFO_ID INTEGER NOT NULL,INSTANCE_DETAILS_DOC_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID,INSTANCE_DETAILS_DOC_DESCR_ID),CONSTRAINT SYS_FK_247 FOREIGN KEY(BINDING_KEY,TMODEL_INSTANCE_INFO_ID) REFERENCES TMODEL_INSTANCE_INFO(BINDING_KEY,TMODEL_INSTANCE_INFO_ID))
+CREATE MEMORY TABLE TMODEL(TMODEL_KEY VARCHAR(41) NOT NULL PRIMARY KEY,AUTHORIZED_NAME VARCHAR(255) NOT NULL,PUBLISHER_ID VARCHAR(20),OPERATOR VARCHAR(255) NOT NULL,NAME VARCHAR(255) NOT NULL,OVERVIEW_URL VARCHAR(255),DELETED VARCHAR(5),LAST_UPDATE TIMESTAMP NOT NULL)
+CREATE MEMORY TABLE TMODEL_DESCR(TMODEL_KEY VARCHAR(41) NOT NULL,TMODEL_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(TMODEL_KEY,TMODEL_DESCR_ID),CONSTRAINT SYS_FK_252 FOREIGN KEY(TMODEL_KEY) REFERENCES TMODEL(TMODEL_KEY))
+CREATE MEMORY TABLE TMODEL_CATEGORY(TMODEL_KEY VARCHAR(41) NOT NULL,CATEGORY_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(255),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(TMODEL_KEY,CATEGORY_ID),CONSTRAINT SYS_FK_256 FOREIGN KEY(TMODEL_KEY) REFERENCES TMODEL(TMODEL_KEY))
+CREATE MEMORY TABLE TMODEL_IDENTIFIER(TMODEL_KEY VARCHAR(41) NOT NULL,IDENTIFIER_ID INTEGER NOT NULL,TMODEL_KEY_REF VARCHAR(255),KEY_NAME VARCHAR(255),KEY_VALUE VARCHAR(255) NOT NULL,PRIMARY KEY(TMODEL_KEY,IDENTIFIER_ID),CONSTRAINT SYS_FK_260 FOREIGN KEY(TMODEL_KEY) REFERENCES TMODEL(TMODEL_KEY))
+CREATE MEMORY TABLE TMODEL_DOC_DESCR(TMODEL_KEY VARCHAR(41) NOT NULL,TMODEL_DOC_DESCR_ID INTEGER NOT NULL,LANG_CODE VARCHAR(5),DESCR VARCHAR(255) NOT NULL,PRIMARY KEY(TMODEL_KEY,TMODEL_DOC_DESCR_ID),CONSTRAINT SYS_FK_264 FOREIGN KEY(TMODEL_KEY) REFERENCES TMODEL(TMODEL_KEY))
+CREATE MEMORY TABLE PUBLISHER_ASSERTION(FROM_KEY VARCHAR(41) NOT NULL,TO_KEY VARCHAR(41) NOT NULL,TMODEL_KEY VARCHAR(41) NOT NULL,KEY_NAME VARCHAR(255) NOT NULL,KEY_VALUE VARCHAR(255) NOT NULL,FROM_CHECK VARCHAR(5) NOT NULL,TO_CHECK VARCHAR(5) NOT NULL,CONSTRAINT SYS_FK_268 FOREIGN KEY(FROM_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY),CONSTRAINT SYS_FK_269 FOREIGN KEY(TO_KEY) REFERENCES BUSINESS_ENTITY(BUSINESS_KEY))
+CREATE MEMORY TABLE PUBLISHER(PUBLISHER_ID VARCHAR(20) NOT NULL PRIMARY KEY,PUBLISHER_NAME VARCHAR(255) NOT NULL,EMAIL_ADDRESS VARCHAR(255),IS_ADMIN VARCHAR(5),IS_ENABLED VARCHAR(5),MAX_BUSINESSES INTEGER,MAX_SERVICES_PER_BUSINESS INTEGER,MAX_BINDINGS_PER_SERVICE INTEGER,MAX_TMODELS INTEGER)
+CREATE MEMORY TABLE AUTH_TOKEN(AUTH_TOKEN VARCHAR(51) NOT NULL PRIMARY KEY,PUBLISHER_ID VARCHAR(20) NOT NULL,PUBLISHER_NAME VARCHAR(255) NOT NULL,CREATED TIMESTAMP NOT NULL,LAST_USED TIMESTAMP NOT NULL,NUMBER_OF_USES INTEGER NOT NULL,TOKEN_STATE INTEGER NOT NULL)
+CREATE USER SA PASSWORD ""
+GRANT DBA TO SA
+SET WRITE_DELAY 20
+SET SCHEMA PUBLIC
+INSERT INTO MESSAGE VALUES('urn:jboss:esb:message:UID:674a50d0-c925-412a-b9cf-cb485a4d109f','urn:jboss:esb:message:type:JAVA_SERIALIZED','rO0ABXNyAEBvcmcuamJvc3MuaW50ZXJuYWwuc29hLmVzYi5tZXNzYWdlLmZvcm1hdC5zZXJpYWxp\u000aemVkLk1lc3NhZ2VJbXBsAAAAAAAAAAACAAZMAAtfcHJvcGVydGllc3QAJkxvcmcvamJvc3Mvc29h\u000aL2VzYi9tZXNzYWdlL1Byb3BlcnRpZXM7TAAOX3RoZUF0dGFjaG1lbnR0AEVMb3JnL2pib3NzL2lu\u000adGVybmFsL3NvYS9lc2IvbWVzc2FnZS9mb3JtYXQvc2VyaWFsaXplZC9BdHRhY2htZW50SW1wbDtM\u000aAAhfdGhlQm9keXQAP0xvcmcvamJvc3MvaW50ZXJuYWwvc29hL2VzYi9tZXNzYWdlL2Zvcm1hdC9z\u000aZXJpYWxpemVkL0JvZHlJbXBsO0wAC190aGVDb250ZXh0dABCTG9yZy9qYm9zcy9pbnRlcm5hbC9z\u000ab2EvZXNiL21lc3NhZ2UvZm9ybWF0L3NlcmlhbGl6ZWQvQ29udGV4dEltcGw7TAAJX3RoZUZhdWx0\u000adABATG9yZy9qYm9zcy9pbnRlcm5hbC9zb2EvZXNiL21lc3NhZ2UvZm9ybWF0L3NlcmlhbGl6ZWQv\u000aRmF1bHRJbXBsO0wACl90aGVIZWFkZXJ0AEFMb3JnL2pib3NzL2ludGVybmFsL3NvYS9lc2IvbWVz\u000ac2FnZS9mb3JtYXQvc2VyaWFsaXplZC9IZWFkZXJJbXBsO3hwc3IAQ29yZy5qYm9zcy5pbnRlcm5h\u000abC5zb2EuZXNiLm1lc3NhZ2UuZm9ybW!
 F0LnNlcmlhbGl6ZWQuUHJvcGVydGllc0ltcGwAAAAAAAAA\u000aAAIAAUwABl90YWJsZXQAFUxqYXZhL3V0aWwvSGFzaHRhYmxlO3hwc3IAE2phdmEudXRpbC5IYXNo\u000adGFibGUTuw8lIUrkuAMAAkYACmxvYWRGYWN0b3JJAAl0aHJlc2hvbGR4cD9AAAAAAAAIdwgAAAAL\u000aAAAAAnQABXByb3AydAAEdmFsMnQABXByb3AxdAAEdmFsMXhzcgBDb3JnLmpib3NzLmludGVybmFs\u000aLnNvYS5lc2IubWVzc2FnZS5mb3JtYXQuc2VyaWFsaXplZC5BdHRhY2htZW50SW1wbAAAAAAAAAAA\u000aAgACTAAFX2xpc3R0ABVMamF2YS91dGlsL0FycmF5TGlzdDtMAAZfdGFibGVxAH4ACXhwc3IAE2ph\u000admEudXRpbC5BcnJheUxpc3R4gdIdmcdhnQMAAUkABHNpemV4cAAAAAJ3BAAAAAp0ABBURVNUIEFU\u000aVEFDSE1FTlQxdAAQVEVTVCBBVFRBQ0hNRU5UMnhzcQB+AAs/QAAAAAAACHcIAAAACwAAAAB4c3IA\u000aPW9yZy5qYm9zcy5pbnRlcm5hbC5zb2EuZXNiLm1lc3NhZ2UuZm9ybWF0LnNlcmlhbGl6ZWQuQm9k\u000aeUltcGwAAAAAAAAAAAIAAlsACF9jb250ZW50dAACW0JMAAhfb2JqZWN0c3EAfgAJeHB1cgACW0Ks\u000a8xf4BghU4AIAAHhwAAAACVRFU1QgQk9EWXNxAH4ACz9AAAAAAAAIdwgAAAALAAAAAHhzcgBAb3Jn\u000aLmpib3NzLmludGVybmFsLnNvYS5lc2IubWVzc2FnZS5mb3JtYXQuc2VyaWFsaXplZC5Db250ZXh0\u000aSW1wbAAAAAAAAAAAAgAAeHBzcgA+b3JnLm!
 pib3NzLmludGVybmFsLnNvYS5lc2IubWVzc2FnZS5m\u000ab3JtYXQuc2VyaWFsaXplZC
5GYXVsdEltcGwAAAAAAAAAAAIAAkwABV9jb2RldAAOTGphdmEvbmV0\u000aL1VSSTtMAAdfcmVhc29udAASTGphdmEvbGFuZy9TdHJpbmc7eHBwcHNyAD9vcmcuamJvc3MuaW50\u000aZXJuYWwuc29hLmVzYi5tZXNzYWdlLmZvcm1hdC5zZXJpYWxpemVkLkhlYWRlckltcGwAAAAAAAAA\u000aAAIAAUwABV9jYWxsdAAjTG9yZy9qYm9zcy9zb2EvZXNiL2FkZHJlc3NpbmcvQ2FsbDt4cHA=')
+INSERT INTO MESSAGE VALUES('urn:jboss:esb:message:UID:a89a113b-5211-4465-8dd1-75b76a3c17ac','urn:jboss:esb:message:type:JBOSS_XML','rO0ABXQB4Dw/eG1sIHZlcnNpb249IjEuMCIgZW5jb2Rpbmc9IlVURi04Ij8+CjxFbnZlbG9wZT4K\u000aICAgIDxIZWFkZXIvPgogICAgPENvbnRleHQvPgogICAgPEJvZHk+CiAgICAgICAgPEJ5dGVzPjwh\u000aW0NEQVRBW1ZFVlRWQ0JDVDBSWl1dPjwvQnl0ZXM+CiAgICA8L0JvZHk+CiAgICA8QXR0YWNobWVu\u000adD4KICAgICAgICA8VW5OYW1lZD48IVtDREFUQVtyTzBBQlhRQUVGUkZVMVFnUVZSVVFVTklUVVZP\u000aVkRFPV1dPjwvVW5OYW1lZD4KICAgICAgICA8VW5OYW1lZD48IVtDREFUQVtyTzBBQlhRQUVGUkZV\u000aMVFnUVZSVVFVTklUVVZPVkRJPV1dPjwvVW5OYW1lZD4KICAgIDwvQXR0YWNobWVudD4KICAgIDxQ\u000acm9wZXJ0aWVzPgogICAgICAgIDxwcm9wMj48IVtDREFUQVtyTzBBQlhRQUJIWmhiREk9XV0+PC9w\u000acm9wMj4KICAgICAgICA8cHJvcDE+PCFbQ0RBVEFbck8wQUJYUUFCSFpoYkRFPV1dPjwvcHJvcDE+\u000aCiAgICA8L1Byb3BlcnRpZXM+CjwvRW52ZWxvcGU+Cg==')
+INSERT INTO BUSINESS_ENTITY VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D','JBoss ESB User','jbossesb','jUDDI.org','2006-12-13 19:59:46.310000000')
+INSERT INTO BUSINESS_DESCR VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,'','Red Hat/JBoss Professional Open Source, Services for the JBossESB')
+INSERT INTO BUSINESS_NAME VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,'en','Red Hat/JBossESB')
+INSERT INTO CONTACT VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,NULL,'JBossESB')
+INSERT INTO ADDRESS VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,NULL,NULL,NULL)
+INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,0,'','STREET_NUMBER','3340')
+INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,1,'','STREET','Peachtree Road, NE, Suite 1200')
+INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,2,'','CITY','Atlanta')
+INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,3,'','COUNTRY','USA')
+INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,4,'','POSTALCODE','30326')
+INSERT INTO ADDRESS_LINE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,5,'','STATE','GA')
+INSERT INTO EMAIL VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,NULL,'jbossesb at jboss.com')
+INSERT INTO PHONE VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,0,NULL,'404 467-8555')
+INSERT INTO DISCOVERY_URL VALUES('63A6CB40-8B0E-11DB-8B40-B10B88B41A9D',0,'businessEntity','http://localhost:8080/juddi/uddiget.jsp?businesskey=63A6CB40-8B0E-11DB-8B40-B10B88B41A9D')
+INSERT INTO TMODEL VALUES('uuid:082B0851-25D8-303C-B332-F24A6D53E38E','Administrator','admin','jUDDI.org','uddi-org:wsdl:portTypeReference','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#portTypeReference',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:2EC65201-9109-3919-9BEC-C9DBEFCACCF6','Administrator','admin','jUDDI.org','uddi-org:xml:localName','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#xmlLocalName',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:327A56F0-3299-4461-BC23-5CD513E95C55','Administrator','admin','jUDDI.org','uddi-org:operators','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#Operators',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:4064C064-6D14-4F35-8953-9652106476A9','Administrator','admin','jUDDI.org','uddi-org:owningBusiness','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#owningBusiness',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:4DC74177-7806-34D9-AECD-33C57DC3A865','Administrator','admin','jUDDI.org','uddi-org:wsdl:categorization:protocol','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#protocol',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88','Administrator','admin','jUDDI.org','uddi-org:iso-ch:3166-1999','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#ISO3166',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:6E090AFA-33E5-36EB-81B7-1CA18373F457','Administrator','admin','jUDDI.org','uddi-org:wsdl:types','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#wsdlTypes',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:6E10B91B-BABC-3442-B8FC-5A3C8FDE0794','Administrator','admin','jUDDI.org','uddi-org:protocol:http','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#http',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:807A2C6A-EE22-470D-ADC7-E0424A337C03','Administrator','admin','jUDDI.org','uddi-org:relationships','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#Relationships',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:8609C81E-EE1F-4D5A-B202-3EB13AD01823','Administrator','admin','jUDDI.org','dnb-com:D-U-N-S','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#D-U-N-S',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:A035A07C-F362-44DD-8F95-E2B134BF43B4','Administrator','admin','jUDDI.org','uddi-org:general_keywords','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#GenKW',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:AA254698-93DE-3870-8DF3-A5C075D64A0E','Administrator','admin','jUDDI.org','uddi-org:protocol:soap','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#soap',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:AD61DE98-4DB8-31B2-A299-A2373DC97212','Administrator','admin','jUDDI.org','uddi-org:wsdl:address','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#Address',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:B1B1BAF5-2329-43E6-AE13-BA8E97195039','Administrator','admin','jUDDI.org','thomasregister-com:supplierID','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#Thomas',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2','Administrator','admin','jUDDI.org','ntis-gov:naics:1997','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#NAICS',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','Administrator','admin','jUDDI.org','uddi-org:types','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#UDDItypes',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:CD153257-086A-4237-B336-6BDCBDCC6634','Administrator','admin','jUDDI.org','unspsc-org:unspsc','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#UNSPSC',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:D01987D1-AB2E-3013-9BE2-2A66EB99D824','Administrator','admin','jUDDI.org','uddi-org:xml:namespace','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#xmlNamespace',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:DB77450D-9FA8-45D4-A7BC-04411D14E384','Administrator','admin','jUDDI.org','unspsc-org:unspsc:3-1','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#UNSPSC31',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E','Administrator','admin','jUDDI.org','uddi-org:isReplacedBy','http://www.uddi.org/taxonomies/UDDI_Taxonomy_tModels.htm#IsReplacedBy',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL VALUES('uuid:E5C43936-86E4-37BF-8196-1D04B35C0099','Administrator','admin','jUDDI.org','uddi-org:wsdl:categorization:transport','http://www.oasis-open.org/committees/uddi-spec/doc/tn/uddi-spec-tc-tn-wsdl-v2.htm#transport',NULL,'2006-12-13 00:00:00.0')
+INSERT INTO TMODEL_DESCR VALUES('uuid:082B0851-25D8-303C-B332-F24A6D53E38E',0,'en','A category system used to reference a wsdl:portType tModel')
+INSERT INTO TMODEL_DESCR VALUES('uuid:2EC65201-9109-3919-9BEC-C9DBEFCACCF6',0,'en','A category system used to indicate XML local names')
+INSERT INTO TMODEL_DESCR VALUES('uuid:327A56F0-3299-4461-BC23-5CD513E95C55',0,'en','Taxonomy for categorizing the businessEntity of an operator of a registry.')
+INSERT INTO TMODEL_DESCR VALUES('uuid:4064C064-6D14-4F35-8953-9652106476A9',0,'en','A pointer to a businessEntity that owns the tagged data.')
+INSERT INTO TMODEL_DESCR VALUES('uuid:4DC74177-7806-34D9-AECD-33C57DC3A865',0,'en','Category system used to describe the protocol supported by a wsdl:binding.')
+INSERT INTO TMODEL_DESCR VALUES('uuid:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88',0,'en','ISO 3166-1:1997 and 3166-2:1998. Codes for names of countries and their subdivisions. Part 1: Country codes. Part 2:Country subdivision codes. Update newsletters include ISO 3166-1 V-1 (1998-02-05), V-2 (1999-10-01), ISO 3166-2 I-1 (1998)')
+INSERT INTO TMODEL_DESCR VALUES('uuid:6E090AFA-33E5-36EB-81B7-1CA18373F457',0,'en','WSDL Type Category System')
+INSERT INTO TMODEL_DESCR VALUES('uuid:6E10B91B-BABC-3442-B8FC-5A3C8FDE0794',0,'en','A tModel that represents the HTTP protocol')
+INSERT INTO TMODEL_DESCR VALUES('uuid:807A2C6A-EE22-470D-ADC7-E0424A337C03',0,'en','Starter set classifications of businessEntity relationships')
+INSERT INTO TMODEL_DESCR VALUES('uuid:8609C81E-EE1F-4D5A-B202-3EB13AD01823',0,'en','Dun&Bradstreet D-U-N-S\u00c6 Number')
+INSERT INTO TMODEL_DESCR VALUES('uuid:A035A07C-F362-44DD-8F95-E2B134BF43B4',0,'en','Special taxonomy consisting of namespace identifiers and the keywords associated with the namespaces')
+INSERT INTO TMODEL_DESCR VALUES('uuid:AA254698-93DE-3870-8DF3-A5C075D64A0E',0,'en','A tModel that represents the SOAP 1.1 protocol')
+INSERT INTO TMODEL_DESCR VALUES('uuid:AD61DE98-4DB8-31B2-A299-A2373DC97212',0,'en','A tModel used to indicate the WSDL address option.')
+INSERT INTO TMODEL_DESCR VALUES('uuid:B1B1BAF5-2329-43E6-AE13-BA8E97195039',0,'en','Thomas Registry Suppliers')
+INSERT INTO TMODEL_DESCR VALUES('uuid:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2',0,'en','Business Taxonomy: NAICS(1997 Release)')
+INSERT INTO TMODEL_DESCR VALUES('uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4',0,'en','UDDI Type Taxonomy')
+INSERT INTO TMODEL_DESCR VALUES('uuid:CD153257-086A-4237-B336-6BDCBDCC6634',0,'en','Product Taxonomy: UNSPSC (Version 7.3)')
+INSERT INTO TMODEL_DESCR VALUES('uuid:D01987D1-AB2E-3013-9BE2-2A66EB99D824',0,'en','A category system used to indicate namespaces')
+INSERT INTO TMODEL_DESCR VALUES('uuid:DB77450D-9FA8-45D4-A7BC-04411D14E384',0,'en','Product Taxonomy: UNSPSC (Version 3.1)')
+INSERT INTO TMODEL_DESCR VALUES('uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E',0,'en','An identifier system used to point (using UDDI keys) to the tModel (or businessEntity) that is the logical replacement for the one in which isReplacedBy is used')
+INSERT INTO TMODEL_DESCR VALUES('uuid:E5C43936-86E4-37BF-8196-1D04B35C0099',0,'en','Category system used to describe the transport supported by a wsdl:binding.')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:082B0851-25D8-303C-B332-F24A6D53E38E',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','checked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:082B0851-25D8-303C-B332-F24A6D53E38E',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:2EC65201-9109-3919-9BEC-C9DBEFCACCF6',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','unchecked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:2EC65201-9109-3919-9BEC-C9DBEFCACCF6',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:327A56F0-3299-4461-BC23-5CD513E95C55',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:327A56F0-3299-4461-BC23-5CD513E95C55',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:4064C064-6D14-4F35-8953-9652106476A9',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:4064C064-6D14-4F35-8953-9652106476A9',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:4DC74177-7806-34D9-AECD-33C57DC3A865',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:4DC74177-7806-34D9-AECD-33C57DC3A865',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','checked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:6E090AFA-33E5-36EB-81B7-1CA18373F457',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','unchecked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:6E090AFA-33E5-36EB-81B7-1CA18373F457',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:6E10B91B-BABC-3442-B8FC-5A3C8FDE0794',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','protocol')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:807A2C6A-EE22-470D-ADC7-E0424A337C03',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','relationship')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:8609C81E-EE1F-4D5A-B202-3EB13AD01823',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','identifier')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:A035A07C-F362-44DD-8F95-E2B134BF43B4',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:AA254698-93DE-3870-8DF3-A5C075D64A0E',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','protocol')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:B1B1BAF5-2329-43E6-AE13-BA8E97195039',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','identifier')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:CD153257-086A-4237-B336-6BDCBDCC6634',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:CD153257-086A-4237-B336-6BDCBDCC6634',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','Checked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:D01987D1-AB2E-3013-9BE2-2A66EB99D824',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','unchecked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:D01987D1-AB2E-3013-9BE2-2A66EB99D824',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:DB77450D-9FA8-45D4-A7BC-04411D14E384',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','identifier')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','types','checked')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:E5C43936-86E4-37BF-8196-1D04B35C0099',0,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','categorization')
+INSERT INTO TMODEL_CATEGORY VALUES('uuid:E5C43936-86E4-37BF-8196-1D04B35C0099',1,'uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4','uddi-org:types','checked')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:082B0851-25D8-303C-B332-F24A6D53E38E',0,'en','The WSDL portType Reference category system provides a mechanism to indicate that a UDDI entity has a relationship with a certain wsdl:portType tModel.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:2EC65201-9109-3919-9BEC-C9DBEFCACCF6',0,'en','The XML Local Name tModel provides a mechanism to indicate the name attribute for the uddi:businessService.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:327A56F0-3299-4461-BC23-5CD513E95C55',0,'en','This checked value set is used to identify UDDI operators.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:4064C064-6D14-4F35-8953-9652106476A9',0,'en','This tModel indicates the businessEntity that published or owns the tagged tModel. Used with tModels to establish an "owned" relationship with a registered businessEntity.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:4DC74177-7806-34D9-AECD-33C57DC3A865',0,'en','The Protocol Categorization tModel provides a mechanism to capture this protocol information in the UDDI binding tModel.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:4E49A8D6-D5A2-4FC2-93A0-0411D8D19E88',0,'en','Taxonomy used to categorize entries by geographic location.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:6E090AFA-33E5-36EB-81B7-1CA18373F457',0,'en','The WSDL Entity Type tModel uses a number of UDDI entities to represent the various entities within a WSDL document.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:6E10B91B-BABC-3442-B8FC-5A3C8FDE0794',0,'en','The HTTP Protocol tModel can be used to indicate that a Web service supports the HTTP protocol.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:807A2C6A-EE22-470D-ADC7-E0424A337C03',0,'en','This tModel is used to describe business relationships. Used in the publisher assertion messages.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:8609C81E-EE1F-4D5A-B202-3EB13AD01823',0,'en','This tModel is used for the Dun&Bradstreet D-U-N-S\u00c6 Number identifier.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:A035A07C-F362-44DD-8F95-E2B134BF43B4',0,'en','This tModel defines an unidentified taxonomy.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:AA254698-93DE-3870-8DF3-A5C075D64A0E',0,'en','The SOAP Protocol tModel can be used to indicate that a Web service supports the SOAP 1.1 protocol.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:AD61DE98-4DB8-31B2-A299-A2373DC97212',0,'en','The WSDL Address tModel provides A mechanism to indicate that the endpoint address should be obtained from a WSDL document.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:B1B1BAF5-2329-43E6-AE13-BA8E97195039',0,'en','This tModel is used for the Thomas Register supplier identifier codes.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:C0B9FE13-179F-413D-8A5B-5004DB8E5BB2',0,'en','This tModel defines the NAICS industry taxonomy.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:C1ACF26D-9672-4404-9D70-39B756E62AB4',0,'en','Taxonomy used to categorize Service Descriptions.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:CD153257-086A-4237-B336-6BDCBDCC6634',0,'en','This tModel defines Version 7.3 of the UNSPSC product taxonomy.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:D01987D1-AB2E-3013-9BE2-2A66EB99D824',0,'en','A namespace provides necessary qualifying information about a technical concept or model. The XML Namespace tModel provides a mechanism to associate a namespace with a UDDI entity.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:DB77450D-9FA8-45D4-A7BC-04411D14E384',0,'en','This tModel defines the UNSPSC product taxonomy.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:E59AE320-77A5-11D5-B898-0004AC49CC1E',0,'en','This is a checked value set.')
+INSERT INTO TMODEL_DOC_DESCR VALUES('uuid:E5C43936-86E4-37BF-8196-1D04B35C0099',0,'en','The Transport Categorization tModel provides a mechanism to capture transport information in the UDDI binding tModel which allows a user to search for bindings that implement a specific transport protocol.')
+INSERT INTO PUBLISHER VALUES('jbossesb','JBoss ESB User','kurt.stam at jboss.org','true','true',25,20,10,100)
+INSERT INTO AUTH_TOKEN VALUES('authToken:6398E890-8B0E-11DB-A890-BD3378DEEA8D','jbossesb','JBoss ESB User','2006-12-13 19:59:45.483000000','2006-12-13 19:59:45.515000000',1,1)
+INSERT INTO AUTH_TOKEN VALUES('authToken:63B08F40-8B0E-11DB-8F40-B83B3B891F3B','jbossesb','JBoss ESB User','2006-12-13 19:59:45.612000000','2006-12-13 19:59:45.631000000',1,1)
+INSERT INTO AUTH_TOKEN VALUES('authToken:63C17F30-8B0E-11DB-BF30-ADDE2FF4F176','jbossesb','JBoss ESB User','2006-12-13 19:59:45.704000000','2006-12-13 19:59:45.721000000',1,1)
+INSERT INTO AUTH_TOKEN VALUES('authToken:63CCA2C0-8B0E-11DB-A2C0-8EA621ECD068','jbossesb','JBoss ESB User','2006-12-13 19:59:45.787000000','2006-12-13 19:59:45.808000000',1,1)
+INSERT INTO AUTH_TOKEN VALUES('authToken:63D55550-8B0E-11DB-9550-9A038CCD580B','jbossesb','JBoss ESB User','2006-12-13 19:59:45.836000000','2006-12-13 19:59:45.849000000',1,1)
+INSERT INTO AUTH_TOKEN VALUES('authToken:6404A2B0-8B0E-11DB-A2B0-8E8E8812A522','jbossesb','JBoss ESB User','2006-12-13 19:59:46.139000000','2006-12-13 19:59:46.152000000',1,1)
+INSERT INTO AUTH_TOKEN VALUES('authToken:64101460-8B0E-11DB-9460-B33C0E8B0E1F','jbossesb','JBoss ESB User','2006-12-13 19:59:46.221000000','2006-12-13 19:59:46.235000000',1,1)
+INSERT INTO AUTH_TOKEN VALUES('authToken:6419B150-8B0E-11DB-B150-85E328013947','jbossesb','JBoss ESB User','2006-12-13 19:59:46.278000000','2006-12-13 19:59:46.298000000',1,1)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourier.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourier.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,92 +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, JBoss Inc.
- */
-package org.jboss.internal.soa.esb.couriers;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierTimeoutException;
-import org.jboss.soa.esb.couriers.TwoWayCourier;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * Mock Courier impl.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MockCourier implements TwoWayCourier {
-
-    public boolean deliveryResult = true;
-    public Message message;
-    public Message pickupMessage;
-    public boolean deliveryAttempted = false;
-    public CourierException courierException;
-    public MalformedEPRException malformedEPRException;
-
-    public MockCourier(boolean deliveryResult) {
-        this.deliveryResult = deliveryResult;
-    }
-
-    public MockCourier(CourierException courierException) {
-        this.courierException = courierException;
-    }
-
-    public MockCourier(MalformedEPRException malformedEPRException) {
-        this.malformedEPRException = malformedEPRException;
-    }
-
-    public boolean deliver(Message message) throws CourierException, MalformedEPRException {
-        deliveryAttempted = true;
-
-        if(courierException != null) {
-            throw courierException;
-        } else if(malformedEPRException != null) {
-            throw malformedEPRException;
-        }
-
-        if(deliveryResult) {
-            // Only set the message ref if "successful"...
-            this.message = message;
-        }
-        
-        return deliveryResult;
-    }
-
-    public void cleanup() {
-    }
-
-    public void reset() {
-        message = null;
-        deliveryAttempted = false;
-    }
-
-    public Message pickup(long waitTime) throws CourierException, CourierTimeoutException {
-        return pickupMessage;
-    }
-
-    public Message pickup(long waitTime, EPR epr) throws CourierException, CourierTimeoutException, MalformedEPRException {
-        return pickupMessage;
-    }
-
-    public void setToEpr(EPR toEPR) throws CourierException, MalformedEPRException {
-    }
-
-    public void setReplyToEpr(EPR replyToEPR) throws CourierException, MalformedEPRException {
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourier.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourier.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourier.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourier.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,92 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.couriers;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierTimeoutException;
+import org.jboss.soa.esb.couriers.TwoWayCourier;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * Mock Courier impl.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MockCourier implements TwoWayCourier {
+
+    public boolean deliveryResult = true;
+    public Message message;
+    public Message pickupMessage;
+    public boolean deliveryAttempted = false;
+    public CourierException courierException;
+    public MalformedEPRException malformedEPRException;
+
+    public MockCourier(boolean deliveryResult) {
+        this.deliveryResult = deliveryResult;
+    }
+
+    public MockCourier(CourierException courierException) {
+        this.courierException = courierException;
+    }
+
+    public MockCourier(MalformedEPRException malformedEPRException) {
+        this.malformedEPRException = malformedEPRException;
+    }
+
+    public boolean deliver(Message message) throws CourierException, MalformedEPRException {
+        deliveryAttempted = true;
+
+        if(courierException != null) {
+            throw courierException;
+        } else if(malformedEPRException != null) {
+            throw malformedEPRException;
+        }
+
+        if(deliveryResult) {
+            // Only set the message ref if "successful"...
+            this.message = message;
+        }
+        
+        return deliveryResult;
+    }
+
+    public void cleanup() {
+    }
+
+    public void reset() {
+        message = null;
+        deliveryAttempted = false;
+    }
+
+    public Message pickup(long waitTime) throws CourierException, CourierTimeoutException {
+        return pickupMessage;
+    }
+
+    public Message pickup(long waitTime, EPR epr) throws CourierException, CourierTimeoutException, MalformedEPRException {
+        return pickupMessage;
+    }
+
+    public void setToEpr(EPR toEPR) throws CourierException, MalformedEPRException {
+    }
+
+    public void setReplyToEpr(EPR replyToEPR) throws CourierException, MalformedEPRException {
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourierFactory.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourierFactory.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourierFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,73 +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, JBoss Inc.
- */
-package org.jboss.internal.soa.esb.couriers;
-
-import java.util.Hashtable;
-import java.util.Map;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.TwoWayCourier;
-
-/**
- * Mock CourierFactory.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MockCourierFactory extends CourierFactory {
-
-    public static CourierException courierException;
-    public static MalformedEPRException malformedEPRException;
-    public static Hashtable<EPR, TwoWayCourier> couriers = new Hashtable<EPR, TwoWayCourier>();
-    private static CourierFactory originalInstance;
-    
-    public TwoWayCourier getMessageCourier(EPR toEPR) throws CourierException, MalformedEPRException {
-        if(courierException != null) {
-            throw courierException;
-        } else if(malformedEPRException != null) {
-            throw malformedEPRException;
-        }
-        
-        return couriers.get(toEPR);
-    }
-
-    public static void install() {
-        originalInstance = CourierFactory.getInstance();
-        CourierFactory.setInstance(new MockCourierFactory());
-    }
-
-    public static void uninstall() {
-        CourierFactory.setInstance(originalInstance);
-        reset();
-    }
-
-    public static void reset() {
-        couriers.clear();
-        courierException = null;
-        malformedEPRException = null;
-    }
-
-    public static void resetCouriers() {
-        for (Map.Entry<EPR, TwoWayCourier> entry : couriers.entrySet()) {
-            ((MockCourier)entry.getValue()).reset();
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourierFactory.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourierFactory.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourierFactory.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/MockCourierFactory.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,73 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.couriers;
+
+import java.util.Hashtable;
+import java.util.Map;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.TwoWayCourier;
+
+/**
+ * Mock CourierFactory.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MockCourierFactory extends CourierFactory {
+
+    public static CourierException courierException;
+    public static MalformedEPRException malformedEPRException;
+    public static Hashtable<EPR, TwoWayCourier> couriers = new Hashtable<EPR, TwoWayCourier>();
+    private static CourierFactory originalInstance;
+    
+    public TwoWayCourier getMessageCourier(EPR toEPR) throws CourierException, MalformedEPRException {
+        if(courierException != null) {
+            throw courierException;
+        } else if(malformedEPRException != null) {
+            throw malformedEPRException;
+        }
+        
+        return couriers.get(toEPR);
+    }
+
+    public static void install() {
+        originalInstance = CourierFactory.getInstance();
+        CourierFactory.setInstance(new MockCourierFactory());
+    }
+
+    public static void uninstall() {
+        CourierFactory.setInstance(originalInstance);
+        reset();
+    }
+
+    public static void reset() {
+        couriers.clear();
+        courierException = null;
+        malformedEPRException = null;
+    }
+
+    public static void resetCouriers() {
+        for (Map.Entry<EPR, TwoWayCourier> entry : couriers.entrySet()) {
+            ((MockCourier)entry.getValue()).reset();
+        }
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierIntegrationTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierIntegrationTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,122 +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.internal.soa.esb.couriers.tests;
-
-import java.io.File;
-import java.net.URI;
-import java.net.URL;
-import java.util.UUID;
-
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.TwoWayCourier;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-/**
- * Tests for internal FtpFileHandler class
- * 
- * @since Version 4.0
- * 
- */
-
-public class CourierIntegrationTest extends BaseTest
-{
-
-	public void testDeliverFile () throws Exception
-	{
-		final File file = new File(System.getProperty("java.io.tmpdir")) ;
-		deliver(file.toURL().toExternalForm());
-		
-		file.delete();
-	}
-	
-	public void testDeliverFTP () throws Exception
-	{
-		if (getFtpPwd() != null)
-			deliver("ftp://"+getFtpUser()+":"+getFtpPwd()+"@"+getFtpHostname()+"/"+getFtpDir());
-		else
-			deliver("ftp://"+getFtpUser()+"@"+getFtpHostname()+"/"+getFtpDir());
-	}
-	
-	public void testPickupFile () throws Exception
-	{
-		final File file = new File(System.getProperty("java.io.tmpdir")) ;
-		deliver(file.toURL().toExternalForm());
-		
-		pickup(file.toURL().toExternalForm());
-		
-		file.delete();
-	}
-	
-	public void testPickupFTP () throws Exception
-	{
-		testDeliverFTP();
-		
-		if (getFtpPwd() != null)
-			pickup("ftp://"+getFtpUser()+":"+getFtpPwd()+"@"+getFtpHostname()+"/"+getFtpDir());
-		else
-			pickup("ftp://"+getFtpUser()+"@"+getFtpHostname()+"/"+getFtpDir());
-	}
-	
-	private final FileEpr getEpr(String sUrl) throws Exception
-	{
-		String protocol = new URL(sUrl).getProtocol();
-
-		if ("ftp".equals(protocol))
-			return new FTPEpr(sUrl);
-		if ("file".equals(protocol))
-			return new FileEpr(sUrl);
-
-		throw new IllegalArgumentException("Not a recognised protocol!");
-	}
-	
-	private final void pickup (String url) throws Exception
-	{
-		FileEpr epr = getEpr(url);
-		epr.setInputSuffix(".esbMessage");
-		epr.setPostDelete(true);
-		TwoWayCourier courier = CourierFactory.getPickupCourier(epr);
-
-		Message message = null;
-		while (null != (message = courier.pickup(100)))
-			System.out.println(message.getHeader().getCall().getMessageID());
-	}
-
-	private final void deliver (String url) throws Exception
-	{
-		Call call = new Call(getEpr(url));
-		call.setMessageID(new URI(UUID.randomUUID().toString()));
-
-		Message message = MessageFactory.getInstance().getMessage();
-		message.getHeader().setCall(call);
-		message.getBody().setByteArray("Hello World".getBytes());
-		Courier courier = CourierFactory.getCourier(call.getTo());
-
-		courier.deliver(message);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierIntegrationTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierIntegrationTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierIntegrationTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,122 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers.tests;
+
+import java.io.File;
+import java.net.URI;
+import java.net.URL;
+import java.util.UUID;
+
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.TwoWayCourier;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+/**
+ * Tests for internal FtpFileHandler class
+ * 
+ * @since Version 4.0
+ * 
+ */
+
+public class CourierIntegrationTest extends BaseTest
+{
+
+	public void testDeliverFile () throws Exception
+	{
+		final File file = new File(System.getProperty("java.io.tmpdir")) ;
+		deliver(file.toURL().toExternalForm());
+		
+		file.delete();
+	}
+	
+	public void testDeliverFTP () throws Exception
+	{
+		if (getFtpPwd() != null)
+			deliver("ftp://"+getFtpUser()+":"+getFtpPwd()+"@"+getFtpHostname()+"/"+getFtpDir());
+		else
+			deliver("ftp://"+getFtpUser()+"@"+getFtpHostname()+"/"+getFtpDir());
+	}
+	
+	public void testPickupFile () throws Exception
+	{
+		final File file = new File(System.getProperty("java.io.tmpdir")) ;
+		deliver(file.toURL().toExternalForm());
+		
+		pickup(file.toURL().toExternalForm());
+		
+		file.delete();
+	}
+	
+	public void testPickupFTP () throws Exception
+	{
+		testDeliverFTP();
+		
+		if (getFtpPwd() != null)
+			pickup("ftp://"+getFtpUser()+":"+getFtpPwd()+"@"+getFtpHostname()+"/"+getFtpDir());
+		else
+			pickup("ftp://"+getFtpUser()+"@"+getFtpHostname()+"/"+getFtpDir());
+	}
+	
+	private final FileEpr getEpr(String sUrl) throws Exception
+	{
+		String protocol = new URL(sUrl).getProtocol();
+
+		if ("ftp".equals(protocol))
+			return new FTPEpr(sUrl);
+		if ("file".equals(protocol))
+			return new FileEpr(sUrl);
+
+		throw new IllegalArgumentException("Not a recognised protocol!");
+	}
+	
+	private final void pickup (String url) throws Exception
+	{
+		FileEpr epr = getEpr(url);
+		epr.setInputSuffix(".esbMessage");
+		epr.setPostDelete(true);
+		TwoWayCourier courier = CourierFactory.getPickupCourier(epr);
+
+		Message message = null;
+		while (null != (message = courier.pickup(100)))
+			System.out.println(message.getHeader().getCall().getMessageID());
+	}
+
+	private final void deliver (String url) throws Exception
+	{
+		Call call = new Call(getEpr(url));
+		call.setMessageID(new URI(UUID.randomUUID().toString()));
+
+		Message message = MessageFactory.getInstance().getMessage();
+		message.getHeader().setCall(call);
+		message.getBody().setByteArray("Hello World".getBytes());
+		Courier courier = CourierFactory.getCourier(call.getTo());
+
+		courier.deliver(message);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierUtilUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierUtilUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.internal.soa.esb.couriers.tests;
-
-import java.io.File;
-import java.net.URI;
-
-import junit.framework.Assert;
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.couriers.CourierUtil;
-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.junit.Test;
-
-/**
- * Tests for internal FtpFileHandler class
- * 
- * @since Version 4.0
- * 
- */
-public class CourierUtilUnitTest extends BaseTest
-{
-	private Logger log = Logger.getLogger( CourierUtilUnitTest.class );
-	
-	public static junit.framework.Test suite()
-	{
-		return new JUnit4TestAdapter(CourierUtilUnitTest.class);
-	}
-	
-	@Test
-	public void testMessageToFile () throws Exception
-	{
-		Message msg1 = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-		
-		msg1.getBody().add("foo", "bar");
-		msg1.getHeader().getCall().setTo(new HTTPEpr("http://foo.bar"));
-		msg1.getHeader().getCall().setMessageID(new URI("urn:1234"));
-		
-		log.debug("Saving: "+msg1.getHeader().getCall());
-		
-		File f = CourierUtil.messageToLocalFile(new File("."), msg1);
-		
-		f.delete();
-	}
-	
-	@Test
-	public void testMessageFromFile () throws Exception
-	{
-		Message msg1 = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-		
-		msg1.getBody().add("foo", "bar");
-		msg1.getHeader().getCall().setTo(new HTTPEpr("http://foo.bar"));
-		msg1.getHeader().getCall().setMessageID(new URI("urn:1234"));
-		
-		Assert.assertEquals(msg1.getHeader().getCall().getTo().getAddr().toString(), "PortReference < http://foo.bar >");
-		
-		File theFile = new File(".");
-		File tmpFile = CourierUtil.messageToLocalFile(theFile, msg1);
-		
-		Message msg2 = CourierUtil.messageFromLocalFile(tmpFile);
-		
-		log.debug("Restored: "+msg2.getHeader().getCall());
-		
-		tmpFile.delete();
-		
-		Assert.assertNotNull(msg2);
-		Assert.assertEquals(msg2.getBody().get("foo"), "bar");
-		Assert.assertEquals(msg2.getHeader().getCall().getMessageID().toString(), "urn:1234");
-		Assert.assertEquals(msg2.getHeader().getCall().getTo().getAddr().toString(), "PortReference < http://foo.bar >");
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierUtilUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierUtilUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierUtilUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/CourierUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,97 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers.tests;
+
+import java.io.File;
+import java.net.URI;
+
+import junit.framework.Assert;
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.couriers.CourierUtil;
+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.junit.Test;
+
+/**
+ * Tests for internal FtpFileHandler class
+ * 
+ * @since Version 4.0
+ * 
+ */
+public class CourierUtilUnitTest extends BaseTest
+{
+	private Logger log = Logger.getLogger( CourierUtilUnitTest.class );
+	
+	public static junit.framework.Test suite()
+	{
+		return new JUnit4TestAdapter(CourierUtilUnitTest.class);
+	}
+	
+	@Test
+	public void testMessageToFile () throws Exception
+	{
+		Message msg1 = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+		
+		msg1.getBody().add("foo", "bar");
+		msg1.getHeader().getCall().setTo(new HTTPEpr("http://foo.bar"));
+		msg1.getHeader().getCall().setMessageID(new URI("urn:1234"));
+		
+		log.debug("Saving: "+msg1.getHeader().getCall());
+		
+		File f = CourierUtil.messageToLocalFile(new File("."), msg1);
+		
+		f.delete();
+	}
+	
+	@Test
+	public void testMessageFromFile () throws Exception
+	{
+		Message msg1 = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+		
+		msg1.getBody().add("foo", "bar");
+		msg1.getHeader().getCall().setTo(new HTTPEpr("http://foo.bar"));
+		msg1.getHeader().getCall().setMessageID(new URI("urn:1234"));
+		
+		Assert.assertEquals(msg1.getHeader().getCall().getTo().getAddr().toString(), "PortReference < http://foo.bar >");
+		
+		File theFile = new File(".");
+		File tmpFile = CourierUtil.messageToLocalFile(theFile, msg1);
+		
+		Message msg2 = CourierUtil.messageFromLocalFile(tmpFile);
+		
+		log.debug("Restored: "+msg2.getHeader().getCall());
+		
+		tmpFile.delete();
+		
+		Assert.assertNotNull(msg2);
+		Assert.assertEquals(msg2.getBody().get("foo"), "bar");
+		Assert.assertEquals(msg2.getHeader().getCall().getMessageID().toString(), "urn:1234");
+		Assert.assertEquals(msg2.getHeader().getCall().getTo().getAddr().toString(), "PortReference < http://foo.bar >");
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,305 +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.internal.soa.esb.couriers.tests;
-
-import java.io.File;
-import java.io.FileFilter;
-import java.io.PrintStream;
-import java.net.URI;
-import java.util.UUID;
-
-import junit.framework.Assert;
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.couriers.TwoWayCourier;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Tests for internal FileCourier class 
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- * @since Version 4.0
- *
- */
-public class FileCourierUnitTest 
-{
-	private static Logger _logger		= Logger.getLogger(FileCourierUnitTest.class);
-	private static final String TMP_DIR = System.getProperty("java.io.tmpdir");
-	
-	static File _tmpDir = new File(TMP_DIR);
-	static String TEST_SUFFIX	= ".testMessage";
-	static String ERROR_SUFFIX	= ".myErrorSuffix";
-	static String WORK_SUFFIX	= ".inProcessMessage";
-	static String DONE_SUFFIX	= ".doneMessage";
-	
-	@BeforeClass
-	public static void setUp() throws Exception
-	{
-		_logger.debug("tmp directory = <"+_tmpDir+">");
-		purgeStaleFiles();
-	}
-	
-	@AfterClass
-	public static void tearDown() throws Exception
-	{
-		purgeStaleFiles();
-	}
-
-	public static junit.framework.Test suite() {
-		return new JUnit4TestAdapter(FileCourierUnitTest.class);
-	}
-	
-	private static void purgeStaleFiles()
-	{
-		FileFilter ff = new FileFilter() 
-		{
-				public boolean accept(File file)
-				{
-					return 
-						(  file.getName().endsWith(TEST_SUFFIX)
-						 ||file.getName().endsWith(WORK_SUFFIX)
-						 ||file.getName().endsWith(DONE_SUFFIX)
-						 ||file.getName().endsWith(ERROR_SUFFIX)
-						);
-				}
-			};
-		for (File file:_tmpDir.listFiles(ff))
-		{
-			_logger.debug("delete of "+file.toString()+" = "+file.delete());
-		}
-		
-	}
-
-	@Test
-	public void testMessageAttributes() throws Exception 
-    {
-		ModulePropertyManager.getPropertyManager(ModulePropertyManager.FILTER_MODULE).setProperty("org.jboss.soa.esb.courier.filter.0", "org.jboss.internal.soa.esb.message.metadata.MetaDataFilter");
-
-		String contents = "This is the text that travels in the Message body";
-
-		// toEpr for files must be a directory
-		FileEpr toEpr = new FileEpr(_tmpDir.toURL());
-		// FileEpr uses the postSuffix as the extension for messages delivered (default = ".esbMessage")
-		toEpr.setPostSuffix(TEST_SUFFIX);
-		
-		Message msg = MessageFactory.getInstance().getMessage();
-		msg.getBody().setByteArray(contents.getBytes());
-
-		Call call = new Call(toEpr);
-		String uid = UUID.randomUUID().toString();
-		call.setMessageID(new URI(uid));
-		msg.getHeader().setCall(call);
-		
-		CourierUtil.deliverMessage(msg);
-		
-		String timeSent = (String) msg.getProperties().getProperty(Environment.MESSAGE_ENTRY_TIME);
-		String source = (String) msg.getProperties().getProperty(Environment.MESSAGE_SOURCE);
-		
-		File theFile = new File(_tmpDir,uid+TEST_SUFFIX);
-		Assert.assertTrue(theFile.exists());
-		_logger.info("Message file "+theFile.toString()+" successfully created");
-				
-		FileEpr fromEpr = new FileEpr(toEpr.getURL());
-		fromEpr.setInputSuffix(TEST_SUFFIX);
-		fromEpr.setPostSuffix(DONE_SUFFIX);
-		
-		TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
-		Message retrieved = pickUp.pickup(1000);
-		Assert.assertFalse("Null message retrieved",null==retrieved);
-		
-		String back = new String(retrieved.getBody().getByteArray());
-		Assert.assertEquals(contents,back);
-		_logger.info("Contents of retrieved msg equal original text <"+back+">");
-		
-		theFile = new File(_tmpDir,uid+TEST_SUFFIX+DONE_SUFFIX);
-		Assert.assertTrue(theFile.exists());
-		_logger.info("Retrieved message properly renamed to <"+theFile.toString()+">");
-		
-		Assert.assertEquals(timeSent, retrieved.getProperties().getProperty(Environment.MESSAGE_ENTRY_TIME));
-		Assert.assertEquals(source, retrieved.getProperties().getProperty(Environment.MESSAGE_SOURCE));
-		Assert.assertNotNull(retrieved.getProperties().getProperty(Environment.MESSAGE_EXIT_TIME));
-		
-		purgeStaleFiles();
-    }
-	
-	@Test
-	public void testStoreRetrieve() throws Exception 
-    {
-		String contents = "This is the text that travels in the Message body";
-
-		// toEpr for files must be a directory
-		FileEpr toEpr = new FileEpr(_tmpDir.toURL());
-		// FileEpr uses the postSuffix as the extension for messages delivered (default = ".esbMessage")
-		toEpr.setPostSuffix(TEST_SUFFIX);
-		
-		Message msg = MessageFactory.getInstance().getMessage();
-		msg.getBody().setByteArray(contents.getBytes());
-
-		Call call = new Call(toEpr);
-		String uid = UUID.randomUUID().toString();
-		call.setMessageID(new URI(uid));
-		msg.getHeader().setCall(call);
-		
-		CourierUtil.deliverMessage(msg);
-		File theFile = new File(_tmpDir,uid+TEST_SUFFIX);
-		Assert.assertTrue(theFile.exists());
-		_logger.info("Message file "+theFile.toString()+" successfully created");
-				
-		FileEpr fromEpr = new FileEpr(toEpr.getURL());
-		fromEpr.setInputSuffix(TEST_SUFFIX);
-		fromEpr.setPostSuffix(DONE_SUFFIX);
-		
-		TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
-		Message retrieved = pickUp.pickup(1000);
-		Assert.assertFalse("Null message retrieved",null==retrieved);
-		
-		String back = new String(retrieved.getBody().getByteArray());
-		Assert.assertEquals(contents,back);
-		_logger.info("Contents of retrieved msg equal original text <"+back+">");
-		
-		theFile = new File(_tmpDir,uid+TEST_SUFFIX+DONE_SUFFIX);
-		Assert.assertTrue(theFile.exists());
-		_logger.info("Retrieved message properly renamed to <"+theFile.toString()+">");
-		
-		purgeStaleFiles();
-    }
-
-	@Test
-	public void testStoreAndDelete() throws Exception 
-    {
-		String contents = "This is the text that travels in the Message body";
-
-		// toEpr for files must be a directory
-		FileEpr toEpr = new FileEpr(_tmpDir.toURL());
-		// FileEpr uses the postSuffix as the extension for messages delivered (default = ".esbMessage")
-		toEpr.setPostSuffix(TEST_SUFFIX);
-		
-		Message msg = MessageFactory.getInstance().getMessage();
-		msg.getBody().setByteArray(contents.getBytes());
-
-		Call call = new Call(toEpr);
-		final String uid = UUID.randomUUID().toString();
-		call.setMessageID(new URI(uid));
-		msg.getHeader().setCall(call);
-		
-		CourierUtil.deliverMessage(msg);
-		File theFile = new File(_tmpDir,uid+TEST_SUFFIX);
-		Assert.assertTrue(theFile.exists());
-		_logger.info("Message file "+theFile.toString()+" successfully created");
-				
-		FileEpr fromEpr = new FileEpr(toEpr.getURL());
-		fromEpr.setInputSuffix(TEST_SUFFIX);
-		// setting postdelete to true will delete input Message files, if they were picked up
-		fromEpr.setPostDelete(true);
-		
-		TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
-		Message retrieved = pickUp.pickup(1000);
-		Assert.assertFalse("Null message retrieved",null==retrieved);
-		
-		String back = new String(retrieved.getBody().getByteArray());
-		Assert.assertEquals(contents,back);
-		_logger.info("Contents of retrieved msg equal original text <"+back+">");
-		
-		FileFilter ff = new FileFilter()
-		{ public boolean accept(File file)
-			{return file.getName().startsWith(uid); }
-		};
-		File[] all = new File(TMP_DIR).listFiles(ff);
-		Assert.assertTrue(null==all || all.length<1);
-		_logger.info("Good message file properly deleted ");
-		
-		purgeStaleFiles();
-    }
-
-	@Test
-	public void testBadMessageRename() throws Exception 
-    {
-		String uid = UUID.randomUUID().toString();
-		File theFile = new File(_tmpDir,uid+TEST_SUFFIX);
-		PrintStream out = new PrintStream(theFile);
-		out.print("This is an invalid message");
-		out.close();
-		Assert.assertTrue(theFile.exists());
-		_logger.info("Invalid Message file "+theFile.toString()+" successfully created");
-				
-		FileEpr fromEpr = new FileEpr(_tmpDir.toURL()) ;
-		fromEpr.setInputSuffix(TEST_SUFFIX);
-		fromEpr.setPostSuffix(DONE_SUFFIX);
-		fromEpr.setErrorSuffix(ERROR_SUFFIX);
-		// Don't delete - default is to delete files in error
-		fromEpr.setErrorDelete(false);
-		
-		TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
-		Message retrieved = pickUp.pickup(1000);
-		Assert.assertTrue("Null message retrieved",null==retrieved);
-		
-		theFile = new File(_tmpDir,uid+TEST_SUFFIX+ERROR_SUFFIX);
-		Assert.assertTrue(theFile.exists());
-		_logger.info("Message file properly renamed to "+theFile.toString());
-		
-		purgeStaleFiles();
-    }
-
-	@Test
-	public void testBadMessageDelete() throws Exception 
-    {
-		final String uid = UUID.randomUUID().toString();
-		File theFile = new File(_tmpDir,uid+TEST_SUFFIX);
-		PrintStream out = new PrintStream(theFile);
-		out.print("This is an invalid message");
-		out.close();
-		Assert.assertTrue(theFile.exists());
-		_logger.info("Invalid Message file "+theFile.toString()+" successfully created");
-				
-		FileEpr fromEpr = new FileEpr(_tmpDir.toURL());
-		fromEpr.setInputSuffix(TEST_SUFFIX);
-		fromEpr.setPostSuffix(DONE_SUFFIX);
-		fromEpr.setErrorSuffix(ERROR_SUFFIX);
-		// Not using setErrorDelete(false) should delete files in error
-		
-		TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
-		Message retrieved = pickUp.pickup(1000);
-		Assert.assertTrue("Null message retrieved",null==retrieved);
-		
-		FileFilter ff = new FileFilter()
-		{ public boolean accept(File file)
-			{return file.getName().startsWith(uid); }
-		};
-		File[] all = new File(TMP_DIR).listFiles(ff);
-		Assert.assertTrue(null==all || all.length<1);
-		_logger.info("Bad message file properly deleted ");
-		
-		purgeStaleFiles();
-    }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FileCourierUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,305 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers.tests;
+
+import java.io.File;
+import java.io.FileFilter;
+import java.io.PrintStream;
+import java.net.URI;
+import java.util.UUID;
+
+import junit.framework.Assert;
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.couriers.TwoWayCourier;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Tests for internal FileCourier class 
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ * @since Version 4.0
+ *
+ */
+public class FileCourierUnitTest 
+{
+	private static Logger _logger		= Logger.getLogger(FileCourierUnitTest.class);
+	private static final String TMP_DIR = System.getProperty("java.io.tmpdir");
+	
+	static File _tmpDir = new File(TMP_DIR);
+	static String TEST_SUFFIX	= ".testMessage";
+	static String ERROR_SUFFIX	= ".myErrorSuffix";
+	static String WORK_SUFFIX	= ".inProcessMessage";
+	static String DONE_SUFFIX	= ".doneMessage";
+	
+	@BeforeClass
+	public static void setUp() throws Exception
+	{
+		_logger.debug("tmp directory = <"+_tmpDir+">");
+		purgeStaleFiles();
+	}
+	
+	@AfterClass
+	public static void tearDown() throws Exception
+	{
+		purgeStaleFiles();
+	}
+
+	public static junit.framework.Test suite() {
+		return new JUnit4TestAdapter(FileCourierUnitTest.class);
+	}
+	
+	private static void purgeStaleFiles()
+	{
+		FileFilter ff = new FileFilter() 
+		{
+				public boolean accept(File file)
+				{
+					return 
+						(  file.getName().endsWith(TEST_SUFFIX)
+						 ||file.getName().endsWith(WORK_SUFFIX)
+						 ||file.getName().endsWith(DONE_SUFFIX)
+						 ||file.getName().endsWith(ERROR_SUFFIX)
+						);
+				}
+			};
+		for (File file:_tmpDir.listFiles(ff))
+		{
+			_logger.debug("delete of "+file.toString()+" = "+file.delete());
+		}
+		
+	}
+
+	@Test
+	public void testMessageAttributes() throws Exception 
+    {
+		ModulePropertyManager.getPropertyManager(ModulePropertyManager.FILTER_MODULE).setProperty("org.jboss.soa.esb.courier.filter.0", "org.jboss.internal.soa.esb.message.metadata.MetaDataFilter");
+
+		String contents = "This is the text that travels in the Message body";
+
+		// toEpr for files must be a directory
+		FileEpr toEpr = new FileEpr(_tmpDir.toURL());
+		// FileEpr uses the postSuffix as the extension for messages delivered (default = ".esbMessage")
+		toEpr.setPostSuffix(TEST_SUFFIX);
+		
+		Message msg = MessageFactory.getInstance().getMessage();
+		msg.getBody().setByteArray(contents.getBytes());
+
+		Call call = new Call(toEpr);
+		String uid = UUID.randomUUID().toString();
+		call.setMessageID(new URI(uid));
+		msg.getHeader().setCall(call);
+		
+		CourierUtil.deliverMessage(msg);
+		
+		String timeSent = (String) msg.getProperties().getProperty(Environment.MESSAGE_ENTRY_TIME);
+		String source = (String) msg.getProperties().getProperty(Environment.MESSAGE_SOURCE);
+		
+		File theFile = new File(_tmpDir,uid+TEST_SUFFIX);
+		Assert.assertTrue(theFile.exists());
+		_logger.info("Message file "+theFile.toString()+" successfully created");
+				
+		FileEpr fromEpr = new FileEpr(toEpr.getURL());
+		fromEpr.setInputSuffix(TEST_SUFFIX);
+		fromEpr.setPostSuffix(DONE_SUFFIX);
+		
+		TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
+		Message retrieved = pickUp.pickup(1000);
+		Assert.assertFalse("Null message retrieved",null==retrieved);
+		
+		String back = new String(retrieved.getBody().getByteArray());
+		Assert.assertEquals(contents,back);
+		_logger.info("Contents of retrieved msg equal original text <"+back+">");
+		
+		theFile = new File(_tmpDir,uid+TEST_SUFFIX+DONE_SUFFIX);
+		Assert.assertTrue(theFile.exists());
+		_logger.info("Retrieved message properly renamed to <"+theFile.toString()+">");
+		
+		Assert.assertEquals(timeSent, retrieved.getProperties().getProperty(Environment.MESSAGE_ENTRY_TIME));
+		Assert.assertEquals(source, retrieved.getProperties().getProperty(Environment.MESSAGE_SOURCE));
+		Assert.assertNotNull(retrieved.getProperties().getProperty(Environment.MESSAGE_EXIT_TIME));
+		
+		purgeStaleFiles();
+    }
+	
+	@Test
+	public void testStoreRetrieve() throws Exception 
+    {
+		String contents = "This is the text that travels in the Message body";
+
+		// toEpr for files must be a directory
+		FileEpr toEpr = new FileEpr(_tmpDir.toURL());
+		// FileEpr uses the postSuffix as the extension for messages delivered (default = ".esbMessage")
+		toEpr.setPostSuffix(TEST_SUFFIX);
+		
+		Message msg = MessageFactory.getInstance().getMessage();
+		msg.getBody().setByteArray(contents.getBytes());
+
+		Call call = new Call(toEpr);
+		String uid = UUID.randomUUID().toString();
+		call.setMessageID(new URI(uid));
+		msg.getHeader().setCall(call);
+		
+		CourierUtil.deliverMessage(msg);
+		File theFile = new File(_tmpDir,uid+TEST_SUFFIX);
+		Assert.assertTrue(theFile.exists());
+		_logger.info("Message file "+theFile.toString()+" successfully created");
+				
+		FileEpr fromEpr = new FileEpr(toEpr.getURL());
+		fromEpr.setInputSuffix(TEST_SUFFIX);
+		fromEpr.setPostSuffix(DONE_SUFFIX);
+		
+		TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
+		Message retrieved = pickUp.pickup(1000);
+		Assert.assertFalse("Null message retrieved",null==retrieved);
+		
+		String back = new String(retrieved.getBody().getByteArray());
+		Assert.assertEquals(contents,back);
+		_logger.info("Contents of retrieved msg equal original text <"+back+">");
+		
+		theFile = new File(_tmpDir,uid+TEST_SUFFIX+DONE_SUFFIX);
+		Assert.assertTrue(theFile.exists());
+		_logger.info("Retrieved message properly renamed to <"+theFile.toString()+">");
+		
+		purgeStaleFiles();
+    }
+
+	@Test
+	public void testStoreAndDelete() throws Exception 
+    {
+		String contents = "This is the text that travels in the Message body";
+
+		// toEpr for files must be a directory
+		FileEpr toEpr = new FileEpr(_tmpDir.toURL());
+		// FileEpr uses the postSuffix as the extension for messages delivered (default = ".esbMessage")
+		toEpr.setPostSuffix(TEST_SUFFIX);
+		
+		Message msg = MessageFactory.getInstance().getMessage();
+		msg.getBody().setByteArray(contents.getBytes());
+
+		Call call = new Call(toEpr);
+		final String uid = UUID.randomUUID().toString();
+		call.setMessageID(new URI(uid));
+		msg.getHeader().setCall(call);
+		
+		CourierUtil.deliverMessage(msg);
+		File theFile = new File(_tmpDir,uid+TEST_SUFFIX);
+		Assert.assertTrue(theFile.exists());
+		_logger.info("Message file "+theFile.toString()+" successfully created");
+				
+		FileEpr fromEpr = new FileEpr(toEpr.getURL());
+		fromEpr.setInputSuffix(TEST_SUFFIX);
+		// setting postdelete to true will delete input Message files, if they were picked up
+		fromEpr.setPostDelete(true);
+		
+		TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
+		Message retrieved = pickUp.pickup(1000);
+		Assert.assertFalse("Null message retrieved",null==retrieved);
+		
+		String back = new String(retrieved.getBody().getByteArray());
+		Assert.assertEquals(contents,back);
+		_logger.info("Contents of retrieved msg equal original text <"+back+">");
+		
+		FileFilter ff = new FileFilter()
+		{ public boolean accept(File file)
+			{return file.getName().startsWith(uid); }
+		};
+		File[] all = new File(TMP_DIR).listFiles(ff);
+		Assert.assertTrue(null==all || all.length<1);
+		_logger.info("Good message file properly deleted ");
+		
+		purgeStaleFiles();
+    }
+
+	@Test
+	public void testBadMessageRename() throws Exception 
+    {
+		String uid = UUID.randomUUID().toString();
+		File theFile = new File(_tmpDir,uid+TEST_SUFFIX);
+		PrintStream out = new PrintStream(theFile);
+		out.print("This is an invalid message");
+		out.close();
+		Assert.assertTrue(theFile.exists());
+		_logger.info("Invalid Message file "+theFile.toString()+" successfully created");
+				
+		FileEpr fromEpr = new FileEpr(_tmpDir.toURL()) ;
+		fromEpr.setInputSuffix(TEST_SUFFIX);
+		fromEpr.setPostSuffix(DONE_SUFFIX);
+		fromEpr.setErrorSuffix(ERROR_SUFFIX);
+		// Don't delete - default is to delete files in error
+		fromEpr.setErrorDelete(false);
+		
+		TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
+		Message retrieved = pickUp.pickup(1000);
+		Assert.assertTrue("Null message retrieved",null==retrieved);
+		
+		theFile = new File(_tmpDir,uid+TEST_SUFFIX+ERROR_SUFFIX);
+		Assert.assertTrue(theFile.exists());
+		_logger.info("Message file properly renamed to "+theFile.toString());
+		
+		purgeStaleFiles();
+    }
+
+	@Test
+	public void testBadMessageDelete() throws Exception 
+    {
+		final String uid = UUID.randomUUID().toString();
+		File theFile = new File(_tmpDir,uid+TEST_SUFFIX);
+		PrintStream out = new PrintStream(theFile);
+		out.print("This is an invalid message");
+		out.close();
+		Assert.assertTrue(theFile.exists());
+		_logger.info("Invalid Message file "+theFile.toString()+" successfully created");
+				
+		FileEpr fromEpr = new FileEpr(_tmpDir.toURL());
+		fromEpr.setInputSuffix(TEST_SUFFIX);
+		fromEpr.setPostSuffix(DONE_SUFFIX);
+		fromEpr.setErrorSuffix(ERROR_SUFFIX);
+		// Not using setErrorDelete(false) should delete files in error
+		
+		TwoWayCourier pickUp = CourierFactory.getPickupCourier(fromEpr);
+		Message retrieved = pickUp.pickup(1000);
+		Assert.assertTrue("Null message retrieved",null==retrieved);
+		
+		FileFilter ff = new FileFilter()
+		{ public boolean accept(File file)
+			{return file.getName().startsWith(uid); }
+		};
+		File[] all = new File(TMP_DIR).listFiles(ff);
+		Assert.assertTrue(null==all || all.length<1);
+		_logger.info("Bad message file properly deleted ");
+		
+		purgeStaleFiles();
+    }
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FtpFileHandlerIntegrationTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FtpFileHandlerIntegrationTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FtpFileHandlerIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,280 +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.internal.soa.esb.couriers.tests;
-
-import java.io.File;
-
-import junit.framework.Assert;
-import junit.framework.JUnit4TestAdapter;
-
-import org.jboss.internal.soa.esb.couriers.helpers.FileHandlerFactory;
-import org.jboss.internal.soa.esb.couriers.helpers.FtpFileHandler;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.junit.Test;
-
-/**
- * Tests for internal FtpFileHandler class
- * 
- * @since Version 4.0
- * 
- */
-public class FtpFileHandlerIntegrationTest extends BaseTest
-{
-	public static junit.framework.Test suite()
-	{
-		System.err.println("<------------------------------------------>");
-		System.err.println("<- FTPFileHandlerIntegrationTest requires ->");
-		System.err.println("<- an available FTP server to work.       ->");
-		System.err.println("<------------------------------------------>");
-		
-		return new JUnit4TestAdapter(FtpFileHandlerIntegrationTest.class);
-	}
-	
-	@Test
-	public void testConstructor () throws Exception
-	{
-		FTPEpr ftpEpr = new FTPEpr("ftp://test:password@foo.bar");
-
-		try
-		{
-			@SuppressWarnings("unused")
-			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-			
-			Assert.fail();
-		}
-		
-		ftpEpr = new FTPEpr("ftp://foo.bar");
-		
-		try
-		{
-			@SuppressWarnings("unused")
-			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-			
-			Assert.fail();
-		}
-	}
-	
-	@Test
-	public void testInvalidConnect () throws Exception
-	{
-		File theFile = new File("test.txt");
-		FTPEpr ftpEpr = new FTPEpr("ftp://test:password@foo.bar");
-
-		try
-		{
-			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
-			
-			@SuppressWarnings("unused")
-			byte[] content = handler.getFileContents(theFile);
-		}
-		catch (CourierException ex)
-		{
-			// good!!
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-			
-			Assert.fail();
-		}
-	
-		ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + ":9090");
-		
-		try
-		{
-			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
-			
-			@SuppressWarnings("unused")
-			byte[] content = handler.getFileContents(theFile);
-		}
-		catch (CourierException ex)
-		{
-			// good!!
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-			
-			Assert.fail();
-		}
-		
-		ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname());
-		
-		try
-		{
-			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
-			
-			@SuppressWarnings("unused")
-			byte[] content = handler.getFileContents(theFile);
-		}
-		catch (CourierException ex)
-		{
-			// good!!
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-			
-			Assert.fail();
-		}
-	}
-	
-	@Test
-	public void testValidConnect () throws Exception
-	{
-		FTPEpr ftpEpr = null;
-		
-		if (getFtpPwd() != null)
-			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + ":" + getFtpPwd()+ "@" + getFtpHostname() + getFtpDir());
-		else
-			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());
-
-		try
-		{
-			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
-			
-			@SuppressWarnings("unused")
-			File[] files = handler.getFileList();
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-			
-			Assert.fail();
-		}
-	}
-	
-	@Test
-	public void testDeleteBadFile () throws Exception
-	{
-		File theFile = new File("test1234567890.txt");
-		FTPEpr ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());
-
-		try
-		{
-			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
-			
-			handler.deleteFile(theFile);
-		}
-		catch (CourierException ex)
-		{
-			// TODO should really look for false being returned to indicate no such file!
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-			
-			Assert.fail();
-		}
-	}
-	
-	@Test
-	public void testGetFileList () throws Exception
-	{
-		FTPEpr ftpEpr = null;
-		
-		if (getFtpPwd() != null)
-			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + ":" + getFtpPwd()+ "@" + getFtpHostname() + getFtpDir());
-		else
-			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());
-			
-		try
-		{
-			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
-			
-			File[] files = handler.getFileList();
-			
-			System.err.print("Received information on ");
-			
-			if (files != null)
-				System.err.println(files.length+" files");
-			else
-				System.err.println("zero files");
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-			
-			Assert.fail();
-		}
-	}
-	
-	@Test
-	public void testGetFile () throws Exception
-	{
-		FTPEpr ftpEpr = null;
-		
-		if (getFtpPwd() != null)
-			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + ":" + getFtpPwd()+ "@" + getFtpHostname() + getFtpDir());
-		else
-			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());
-
-		try
-		{
-			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
-			
-			File[] files = handler.getFileList();
-			
-			if ((files != null) && (files.length > 0))
-			{
-				System.err.println("Getting file "+files[0]);
-				
-				/*
-				 * This may return files within subdirectories. Unfortunately
-				 * the FTP Courier doesn't cope with them. At least it now
-				 * ignores them safely.
-				 */
-				
-				byte[] contents = handler.getFileContents(files[0]);
-				
-				if (contents != null)
-				{
-					String theFile = new String(contents);
-					
-					System.err.println("Received:\n"+theFile);
-				}
-				else
-					System.err.println("Received: no file contents. Probably a directory.");
-			}
-			else
-				System.err.println("No files on remote server.");
-		}
-		catch (Exception ex)
-		{
-			ex.printStackTrace();
-			
-			Assert.fail();
-		}
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FtpFileHandlerIntegrationTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FtpFileHandlerIntegrationTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FtpFileHandlerIntegrationTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/couriers/tests/FtpFileHandlerIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,280 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.internal.soa.esb.couriers.tests;
+
+import java.io.File;
+
+import junit.framework.Assert;
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.internal.soa.esb.couriers.helpers.FileHandlerFactory;
+import org.jboss.internal.soa.esb.couriers.helpers.FtpFileHandler;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.junit.Test;
+
+/**
+ * Tests for internal FtpFileHandler class
+ * 
+ * @since Version 4.0
+ * 
+ */
+public class FtpFileHandlerIntegrationTest extends BaseTest
+{
+	public static junit.framework.Test suite()
+	{
+		System.err.println("<------------------------------------------>");
+		System.err.println("<- FTPFileHandlerIntegrationTest requires ->");
+		System.err.println("<- an available FTP server to work.       ->");
+		System.err.println("<------------------------------------------>");
+		
+		return new JUnit4TestAdapter(FtpFileHandlerIntegrationTest.class);
+	}
+	
+	@Test
+	public void testConstructor () throws Exception
+	{
+		FTPEpr ftpEpr = new FTPEpr("ftp://test:password@foo.bar");
+
+		try
+		{
+			@SuppressWarnings("unused")
+			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+			
+			Assert.fail();
+		}
+		
+		ftpEpr = new FTPEpr("ftp://foo.bar");
+		
+		try
+		{
+			@SuppressWarnings("unused")
+			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+			
+			Assert.fail();
+		}
+	}
+	
+	@Test
+	public void testInvalidConnect () throws Exception
+	{
+		File theFile = new File("test.txt");
+		FTPEpr ftpEpr = new FTPEpr("ftp://test:password@foo.bar");
+
+		try
+		{
+			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
+			
+			@SuppressWarnings("unused")
+			byte[] content = handler.getFileContents(theFile);
+		}
+		catch (CourierException ex)
+		{
+			// good!!
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+			
+			Assert.fail();
+		}
+	
+		ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + ":9090");
+		
+		try
+		{
+			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
+			
+			@SuppressWarnings("unused")
+			byte[] content = handler.getFileContents(theFile);
+		}
+		catch (CourierException ex)
+		{
+			// good!!
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+			
+			Assert.fail();
+		}
+		
+		ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname());
+		
+		try
+		{
+			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
+			
+			@SuppressWarnings("unused")
+			byte[] content = handler.getFileContents(theFile);
+		}
+		catch (CourierException ex)
+		{
+			// good!!
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+			
+			Assert.fail();
+		}
+	}
+	
+	@Test
+	public void testValidConnect () throws Exception
+	{
+		FTPEpr ftpEpr = null;
+		
+		if (getFtpPwd() != null)
+			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + ":" + getFtpPwd()+ "@" + getFtpHostname() + getFtpDir());
+		else
+			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());
+
+		try
+		{
+			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
+			
+			@SuppressWarnings("unused")
+			File[] files = handler.getFileList();
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+			
+			Assert.fail();
+		}
+	}
+	
+	@Test
+	public void testDeleteBadFile () throws Exception
+	{
+		File theFile = new File("test1234567890.txt");
+		FTPEpr ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());
+
+		try
+		{
+			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
+			
+			handler.deleteFile(theFile);
+		}
+		catch (CourierException ex)
+		{
+			// TODO should really look for false being returned to indicate no such file!
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+			
+			Assert.fail();
+		}
+	}
+	
+	@Test
+	public void testGetFileList () throws Exception
+	{
+		FTPEpr ftpEpr = null;
+		
+		if (getFtpPwd() != null)
+			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + ":" + getFtpPwd()+ "@" + getFtpHostname() + getFtpDir());
+		else
+			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());
+			
+		try
+		{
+			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
+			
+			File[] files = handler.getFileList();
+			
+			System.err.print("Received information on ");
+			
+			if (files != null)
+				System.err.println(files.length+" files");
+			else
+				System.err.println("zero files");
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+			
+			Assert.fail();
+		}
+	}
+	
+	@Test
+	public void testGetFile () throws Exception
+	{
+		FTPEpr ftpEpr = null;
+		
+		if (getFtpPwd() != null)
+			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + ":" + getFtpPwd()+ "@" + getFtpHostname() + getFtpDir());
+		else
+			ftpEpr = new FTPEpr("ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir());
+
+		try
+		{
+			FtpFileHandler handler = (FtpFileHandler) FileHandlerFactory.getInstance().getFileHandler(ftpEpr);
+			
+			File[] files = handler.getFileList();
+			
+			if ((files != null) && (files.length > 0))
+			{
+				System.err.println("Getting file "+files[0]);
+				
+				/*
+				 * This may return files within subdirectories. Unfortunately
+				 * the FTP Courier doesn't cope with them. At least it now
+				 * ignores them safely.
+				 */
+				
+				byte[] contents = handler.getFileContents(files[0]);
+				
+				if (contents != null)
+				{
+					String theFile = new String(contents);
+					
+					System.err.println("Received:\n"+theFile);
+				}
+				else
+					System.err.println("Received: no file contents. Probably a directory.");
+			}
+			else
+				System.err.println("No files on remote server.");
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+			
+			Assert.fail();
+		}
+	}
+	
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/ContractInfoUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/ContractInfoUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/ContractInfoUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,29 +0,0 @@
-package org.jboss.internal.soa.esb.publish;
-
-import junit.framework.TestCase;
-
-/**
- * @author
- */
-public class ContractInfoUnitTest extends TestCase {
-
-    public void test() {
-        assertContractorArgChecksOK(null, "a");
-        assertContractorArgChecksOK(" ", "a");
-        assertContractorArgChecksOK("a", null);
-        assertContractorArgChecksOK("a", " ");
-
-        ContractInfo contractInfo = new ContractInfo("mime", "data");
-        assertEquals("mime", contractInfo.getMimeType());
-        assertEquals("data", contractInfo.getData());
-    }
-
-    private void assertContractorArgChecksOK(String mimeType, String data) {
-        try {
-            new ContractInfo(mimeType, data);
-            fail("Expected IllegalArgumentException");
-        } catch(IllegalArgumentException e) {
-            // Expected
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/ContractInfoUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/ContractInfoUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/ContractInfoUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/publish/ContractInfoUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,29 @@
+package org.jboss.internal.soa.esb.publish;
+
+import junit.framework.TestCase;
+
+/**
+ * @author
+ */
+public class ContractInfoUnitTest extends TestCase {
+
+    public void test() {
+        assertContractorArgChecksOK(null, "a");
+        assertContractorArgChecksOK(" ", "a");
+        assertContractorArgChecksOK("a", null);
+        assertContractorArgChecksOK("a", " ");
+
+        ContractInfo contractInfo = new ContractInfo("mime", "data");
+        assertEquals("mime", contractInfo.getMimeType());
+        assertEquals("data", contractInfo.getData());
+    }
+
+    private void assertContractorArgChecksOK(String mimeType, String data) {
+        try {
+            new ContractInfo(mimeType, data);
+            fail("Expected IllegalArgumentException");
+        } catch(IllegalArgumentException e) {
+            // Expected
+        }
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,280 +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.internal.soa.esb.services.registry;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.InputStream;
-import java.net.URLDecoder;
-import java.sql.DriverManager;
-import java.sql.Statement;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Properties;
-
-import javax.xml.registry.BulkResponse;
-import javax.xml.registry.BusinessLifeCycleManager;
-import javax.xml.registry.BusinessQueryManager;
-import javax.xml.registry.Connection;
-import javax.xml.registry.JAXRException;
-import javax.xml.registry.RegistryService;
-import javax.xml.registry.infomodel.Classification;
-import javax.xml.registry.infomodel.ClassificationScheme;
-import javax.xml.registry.infomodel.Organization;
-import javax.xml.registry.infomodel.Service;
-import javax.xml.registry.infomodel.ServiceBinding;
-import javax.xml.registry.infomodel.User;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Testing the registry.
- * 
- * @author kstam
- *
- */
-public class JAXRRegistryUnitTest
-{
-	private static Logger logger = Logger.getLogger(JAXRRegistryUnitTest.class);
-    private static String mDbDriver;
-	private static String mDbUrl;
-	private static String mDbUsername;
-	private static String mDbPassword;
-	/**
-	 * Tests the successful creation of the RED HAT/JBossESB Organization.
-	 */
-	@Test
-	public void publishOrganization() 
-	{
-		try {
-			Organization org = JAXRRegistryImpl.createJBossESBOrganization();
-			logger.debug("Succesfully created organization: " + org.getName().getValue());
-			assertEquals("Red Hat/JBossESB", org.getName().getValue());
-		} catch (JAXRException je) {
-			logger.debug(je.getLocalizedMessage(), je);
-			assertTrue(false);
-		}
-	}
-	@Test
-	public void findOrganization() 
-	{
-		try {
-			Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB");
-			logger.debug("Succesfully created organization: " + org.getName().getValue());
-			assertEquals("Red Hat/JBossESB", org.getName().getValue());
-		} catch (JAXRException je) {
-			logger.debug(je.getLocalizedMessage(), je);
-			assertTrue(false);
-		}
-		try {
-			Organization org = JAXRRegistryImpl.findOrganization("Not Existing Org");
-			logger.debug("Could not find non-existing organization.");
-			assertEquals(null, org);
-		} catch (JAXRException je) {
-			logger.error(je.getLocalizedMessage(), je);
-			assertTrue(false);
-		}
-	}
-	/**
-	 * Tests the successful registration of a Service.
-	 *
-	 */
-	@Test
-	public void publishService()
-	{
-		try {
-			JAXRRegistryImpl registry = new JAXRRegistryImpl();
-			registry.registerService("registry", "Registry Test ServiceName", "Registry Test Service Description");
-		} catch (JAXRException je) {
-			logger.error(je.getLocalizedMessage(), je);
-			assertTrue(false);
-		}
-	}
-	@Test
-	public void publishServiceBinding()
-	{
-		try {
-			EPR epr = new EPR();
-			JAXRRegistryImpl registry = new JAXRRegistryImpl();
-			registry.registerEPR("registry", "Registry Test ServiceName", "Registry Test Service Description",
-					epr, "EPR description");
-			registry.registerEPR("registry", "Registry Test ServiceName", "Registry Test Service Description",
-					epr, "EPR description");
-			registry.unRegisterEPR("registry", "Registry Test ServiceName", epr);
-		} catch (RegistryException re) {
-			logger.error(re.getLocalizedMessage(), re);
-			assertTrue(false);
-		}
-	}
-	/**
-	 * Queries the newly added information
-	 * @throws Exception
-	 */
-	@Test
-	public void findServicesForAnOrganization()
-    {
-		try {
-			Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB");
-			//Listing out the services and their Bindings
-			logger.debug("-------------------------------------------------");
-			logger.debug("Organization name: " + org.getName().getValue());
-			logger.debug("Description: " + org.getDescription().getValue());
-			logger.debug("Key id: " + org.getKey().getId());
-			User primaryContact = org.getPrimaryContact();
-			logger.debug("Primary Contact: " + primaryContact.getPersonName().getFullName());
-			Collection services = org.getServices();
-			for (Iterator serviceIter = services.iterator();serviceIter.hasNext();) {
-				Service service = (Service) serviceIter.next();
-				logger.debug("- Service Name: " + service.getName().getValue());
-				logger.debug("  Service Key : " + service.getKey().getId());
-				Collection serviceBindings = service.getServiceBindings();
-				for (Iterator serviceBindingIter = serviceBindings.iterator();serviceBindingIter.hasNext();){
-					ServiceBinding serviceBinding = (ServiceBinding) serviceBindingIter.next();
-					logger.debug("  ServiceBinding Description: " + serviceBinding.getDescription().getValue());
-					String xml = URLDecoder.decode(serviceBinding.getAccessURI(),"UTF-8");
-					logger.debug("  ServiceBinding URI: " + xml);
-					assertEquals(EPRHelper.toXMLString(new EPR()),xml);
-				}
-			}
-			logger.debug("-------------------------------------------------");
-	    } catch (Exception je) {
-	    	logger.error(je);
-			assertTrue(false);
-		}
-    }
-	/**
-	 * This doesn't work because scout drops the classifications on the floor.
-	 * We're ignoring this test until I come up with a patch.
-	 *
-	 */
-	public void findServicesByClassification()
-	{
-		Connection connection = JAXRRegistryImpl.getConnection();
-		try {
-			// Get registry service and business query manager
-			RegistryService rs = connection.getRegistryService();
-			BusinessQueryManager bqm = rs.getBusinessQueryManager();
-			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
-			ClassificationScheme classificationScheme = bqm.findClassificationSchemeByName(null, "uddi-org:general_keywords");
-			Classification classification = blm.createClassification(classificationScheme,
-					"Test transformation service", "transformation");
-			Collection<Classification> classifications = new ArrayList<Classification>();
-			classifications.add(classification);
-			//Here I'd like to test filtering by this classification, but scout ignored the classification
-			String name=classificationScheme.getName().getValue();
-			logger.debug("Name=" + name);
-			Collection<String> nameParams = new ArrayList<String>();
-			//The name of the service is wild
-			nameParams.add("%");
-			BulkResponse bs = bqm.findServices(null, null,nameParams,classifications, null);
-			int status = bs.getStatus();
-			logger.debug("status=" + status);
-		} catch (JAXRException je) {
-			logger.error(je);
-		}
-		finally{}
-	}
-	/**
-	 * Setup the database.
-	 * @throws Exception
-	 */
-	@BeforeClass
-	public static void runBeforeAllTests() throws Exception {
-		try {
-			TestEnvironmentUtil.setESBPropertiesFileToUse();
-			//Set the juddi properties file in System so juddi will pick it up later and use the test values.
-			String juddiPropertiesFile = "/org/jboss/soa/esb/services/registry/juddi-unittest.properties";
-			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
-			//Read this properties file to get the db connection string
-			Properties props = new Properties();
-			InputStream inStream = Class.class.getResourceAsStream(juddiPropertiesFile);
-			props.load(inStream);
-			mDbDriver    = props.getProperty("juddi.jdbcDriver");
-			mDbUrl       = props.getProperty("juddi.jdbcUrl");
-			mDbUsername  = props.getProperty("juddi.jdbcUsername");
-			mDbPassword  = props.getProperty("juddi.jdbcPassword");
-			
-			String database="not tested yet";
-			if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
-				database = "hsqldb";
-				//Bring up hsql on default port 9001
-				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir() + "build/hsqltestdb", "juddi");
-			} else if ("com.mysql.jdbc.Driver".equals(mDbDriver)) {
-				database = "mysql";
-			} //add and test your own database..
-			
-			//Get the registry-schema create scripts
-			String sqlDir = TestEnvironmentUtil.getUserDir() + "install/jUDDI-registry/sql/" + database + "/";
-			//Drop what is there now, if exists. We want to start fresh.
-			String sqlDropCmd      = FileUtil.readTextFile(new File(sqlDir + "drop_database.sql"));
-			String sqlCreateCmd    = FileUtil.readTextFile(new File(sqlDir + "create_database.sql"));
-			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir + "insert_publishers.sql"));
-			
-			try {
-				Class.forName(mDbDriver);
-			} catch (Exception e) {
-				logger.error("ERROR: failed to load " + database + " JDBC driver.", e);
-				return;
-			}
-			java.sql.Connection con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
-			Statement stmnt = con.createStatement();
-			logger.debug("Dropping the schema if exist");
-			stmnt.execute(sqlDropCmd);
-			logger.debug("Creating the juddi-schema");
-			stmnt.execute(sqlCreateCmd);
-			logger.debug("Adding the jbossesb publisher");
-			stmnt.execute(sqlInsertPubCmd);
-		} catch (Exception e) {
-			logger.error("We should stop testing, since we don't have a db.", e);
-			assertTrue(false);
-		}
-	}
-	/**
-	 * Shutdown the database
-	 * @throws Exception
-	 */
-	@AfterClass
-	public static void runAfterAllTests() throws Exception {
-		if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
-			HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
-		}
-	}
-
-	public static junit.framework.Test suite() {
-		return new JUnit4TestAdapter(JAXRRegistryUnitTest.class);
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/JAXRRegistryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,280 @@
+/*
+* JBoss, Home of Professional Open Source
+* Copyright 2006, JBoss Inc., and individual contributors as indicated
+* by the @authors tag. See the copyright.txt in the distribution for a
+* full listing of individual contributors.
+*
+* This is free software; you can redistribute it and/or modify it
+* under the terms of the GNU Lesser General Public License as
+* published by the Free Software Foundation; either version 2.1 of
+* the License, or (at your option) any later version.
+*
+* This software is distributed in the hope that it will be useful,
+* but WITHOUT ANY WARRANTY; without even the implied warranty of
+* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+* Lesser General Public License for more details.
+*
+* You should have received a copy of the GNU Lesser General Public
+* License along with this software; if not, write to the Free
+* Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+* 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+*/
+package org.jboss.internal.soa.esb.services.registry;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.InputStream;
+import java.net.URLDecoder;
+import java.sql.DriverManager;
+import java.sql.Statement;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Properties;
+
+import javax.xml.registry.BulkResponse;
+import javax.xml.registry.BusinessLifeCycleManager;
+import javax.xml.registry.BusinessQueryManager;
+import javax.xml.registry.Connection;
+import javax.xml.registry.JAXRException;
+import javax.xml.registry.RegistryService;
+import javax.xml.registry.infomodel.Classification;
+import javax.xml.registry.infomodel.ClassificationScheme;
+import javax.xml.registry.infomodel.Organization;
+import javax.xml.registry.infomodel.Service;
+import javax.xml.registry.infomodel.ServiceBinding;
+import javax.xml.registry.infomodel.User;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.testutils.FileUtil;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Testing the registry.
+ * 
+ * @author kstam
+ *
+ */
+public class JAXRRegistryUnitTest
+{
+	private static Logger logger = Logger.getLogger(JAXRRegistryUnitTest.class);
+    private static String mDbDriver;
+	private static String mDbUrl;
+	private static String mDbUsername;
+	private static String mDbPassword;
+	/**
+	 * Tests the successful creation of the RED HAT/JBossESB Organization.
+	 */
+	@Test
+	public void publishOrganization() 
+	{
+		try {
+			Organization org = JAXRRegistryImpl.createJBossESBOrganization();
+			logger.debug("Succesfully created organization: " + org.getName().getValue());
+			assertEquals("Red Hat/JBossESB", org.getName().getValue());
+		} catch (JAXRException je) {
+			logger.debug(je.getLocalizedMessage(), je);
+			assertTrue(false);
+		}
+	}
+	@Test
+	public void findOrganization() 
+	{
+		try {
+			Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB");
+			logger.debug("Succesfully created organization: " + org.getName().getValue());
+			assertEquals("Red Hat/JBossESB", org.getName().getValue());
+		} catch (JAXRException je) {
+			logger.debug(je.getLocalizedMessage(), je);
+			assertTrue(false);
+		}
+		try {
+			Organization org = JAXRRegistryImpl.findOrganization("Not Existing Org");
+			logger.debug("Could not find non-existing organization.");
+			assertEquals(null, org);
+		} catch (JAXRException je) {
+			logger.error(je.getLocalizedMessage(), je);
+			assertTrue(false);
+		}
+	}
+	/**
+	 * Tests the successful registration of a Service.
+	 *
+	 */
+	@Test
+	public void publishService()
+	{
+		try {
+			JAXRRegistryImpl registry = new JAXRRegistryImpl();
+			registry.registerService("registry", "Registry Test ServiceName", "Registry Test Service Description");
+		} catch (JAXRException je) {
+			logger.error(je.getLocalizedMessage(), je);
+			assertTrue(false);
+		}
+	}
+	@Test
+	public void publishServiceBinding()
+	{
+		try {
+			EPR epr = new EPR();
+			JAXRRegistryImpl registry = new JAXRRegistryImpl();
+			registry.registerEPR("registry", "Registry Test ServiceName", "Registry Test Service Description",
+					epr, "EPR description");
+			registry.registerEPR("registry", "Registry Test ServiceName", "Registry Test Service Description",
+					epr, "EPR description");
+			registry.unRegisterEPR("registry", "Registry Test ServiceName", epr);
+		} catch (RegistryException re) {
+			logger.error(re.getLocalizedMessage(), re);
+			assertTrue(false);
+		}
+	}
+	/**
+	 * Queries the newly added information
+	 * @throws Exception
+	 */
+	@Test
+	public void findServicesForAnOrganization()
+    {
+		try {
+			Organization org = JAXRRegistryImpl.findOrganization("Red Hat/JBossESB");
+			//Listing out the services and their Bindings
+			logger.debug("-------------------------------------------------");
+			logger.debug("Organization name: " + org.getName().getValue());
+			logger.debug("Description: " + org.getDescription().getValue());
+			logger.debug("Key id: " + org.getKey().getId());
+			User primaryContact = org.getPrimaryContact();
+			logger.debug("Primary Contact: " + primaryContact.getPersonName().getFullName());
+			Collection services = org.getServices();
+			for (Iterator serviceIter = services.iterator();serviceIter.hasNext();) {
+				Service service = (Service) serviceIter.next();
+				logger.debug("- Service Name: " + service.getName().getValue());
+				logger.debug("  Service Key : " + service.getKey().getId());
+				Collection serviceBindings = service.getServiceBindings();
+				for (Iterator serviceBindingIter = serviceBindings.iterator();serviceBindingIter.hasNext();){
+					ServiceBinding serviceBinding = (ServiceBinding) serviceBindingIter.next();
+					logger.debug("  ServiceBinding Description: " + serviceBinding.getDescription().getValue());
+					String xml = URLDecoder.decode(serviceBinding.getAccessURI(),"UTF-8");
+					logger.debug("  ServiceBinding URI: " + xml);
+					assertEquals(EPRHelper.toXMLString(new EPR()),xml);
+				}
+			}
+			logger.debug("-------------------------------------------------");
+	    } catch (Exception je) {
+	    	logger.error(je);
+			assertTrue(false);
+		}
+    }
+	/**
+	 * This doesn't work because scout drops the classifications on the floor.
+	 * We're ignoring this test until I come up with a patch.
+	 *
+	 */
+	public void findServicesByClassification()
+	{
+		Connection connection = JAXRRegistryImpl.getConnection();
+		try {
+			// Get registry service and business query manager
+			RegistryService rs = connection.getRegistryService();
+			BusinessQueryManager bqm = rs.getBusinessQueryManager();
+			BusinessLifeCycleManager blm = rs.getBusinessLifeCycleManager();
+			ClassificationScheme classificationScheme = bqm.findClassificationSchemeByName(null, "uddi-org:general_keywords");
+			Classification classification = blm.createClassification(classificationScheme,
+					"Test transformation service", "transformation");
+			Collection<Classification> classifications = new ArrayList<Classification>();
+			classifications.add(classification);
+			//Here I'd like to test filtering by this classification, but scout ignored the classification
+			String name=classificationScheme.getName().getValue();
+			logger.debug("Name=" + name);
+			Collection<String> nameParams = new ArrayList<String>();
+			//The name of the service is wild
+			nameParams.add("%");
+			BulkResponse bs = bqm.findServices(null, null,nameParams,classifications, null);
+			int status = bs.getStatus();
+			logger.debug("status=" + status);
+		} catch (JAXRException je) {
+			logger.error(je);
+		}
+		finally{}
+	}
+	/**
+	 * Setup the database.
+	 * @throws Exception
+	 */
+	@BeforeClass
+	public static void runBeforeAllTests() throws Exception {
+		try {
+			TestEnvironmentUtil.setESBPropertiesFileToUse();
+			//Set the juddi properties file in System so juddi will pick it up later and use the test values.
+			String juddiPropertiesFile = "/org/jboss/soa/esb/services/registry/juddi-unittest.properties";
+			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
+			//Read this properties file to get the db connection string
+			Properties props = new Properties();
+			InputStream inStream = Class.class.getResourceAsStream(juddiPropertiesFile);
+			props.load(inStream);
+			mDbDriver    = props.getProperty("juddi.jdbcDriver");
+			mDbUrl       = props.getProperty("juddi.jdbcUrl");
+			mDbUsername  = props.getProperty("juddi.jdbcUsername");
+			mDbPassword  = props.getProperty("juddi.jdbcPassword");
+			
+			String database="not tested yet";
+			if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
+				database = "hsqldb";
+				//Bring up hsql on default port 9001
+				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir() + "build/hsqltestdb", "juddi");
+			} else if ("com.mysql.jdbc.Driver".equals(mDbDriver)) {
+				database = "mysql";
+			} //add and test your own database..
+			
+			//Get the registry-schema create scripts
+			String sqlDir = TestEnvironmentUtil.getUserDir() + "install/jUDDI-registry/sql/" + database + "/";
+			//Drop what is there now, if exists. We want to start fresh.
+			String sqlDropCmd      = FileUtil.readTextFile(new File(sqlDir + "drop_database.sql"));
+			String sqlCreateCmd    = FileUtil.readTextFile(new File(sqlDir + "create_database.sql"));
+			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir + "insert_publishers.sql"));
+			
+			try {
+				Class.forName(mDbDriver);
+			} catch (Exception e) {
+				logger.error("ERROR: failed to load " + database + " JDBC driver.", e);
+				return;
+			}
+			java.sql.Connection con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
+			Statement stmnt = con.createStatement();
+			logger.debug("Dropping the schema if exist");
+			stmnt.execute(sqlDropCmd);
+			logger.debug("Creating the juddi-schema");
+			stmnt.execute(sqlCreateCmd);
+			logger.debug("Adding the jbossesb publisher");
+			stmnt.execute(sqlInsertPubCmd);
+		} catch (Exception e) {
+			logger.error("We should stop testing, since we don't have a db.", e);
+			assertTrue(false);
+		}
+	}
+	/**
+	 * Shutdown the database
+	 * @throws Exception
+	 */
+	@AfterClass
+	public static void runAfterAllTests() throws Exception {
+		if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
+			HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
+		}
+	}
+
+	public static junit.framework.Test suite() {
+		return new JUnit4TestAdapter(JAXRRegistryUnitTest.class);
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,238 +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.internal.soa.esb.services.registry;
-
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.couriers.MockCourier;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-import org.jboss.soa.esb.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryException;
-
-import com.arjuna.common.util.propertyservice.PropertyManager;
-
-/**
- * Mock Registry implementation.
- * <p/>
- * Avoids the need to setup HSQLDB etc.
- * <p/>
- * Just call {@link #install()} and {@link #uninstall()} from inside your test setUp and tearDown
- * methods respectfully.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MockRegistry implements Registry {
-
-    private static final String REGISTRY_IMPEMENTATION_CLASS_ORIGINAL = Environment.REGISTRY_IMPEMENTATION_CLASS + "#Original";
-    public static PropertyManager regPropManager = ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE);
-    public static List<RepositoryEntry> repository = new ArrayList<RepositoryEntry>();
-
-    /**
-     * Install this Mock Registry impl as the registry implementation to be used.
-     * <p/>
-     * Call this method in the test setUp.
-     */
-    public static void install() {
-        if (regPropManager == null) {
-            TestCase.fail("Failed to locate PropertyManager for [" + ModulePropertyManager.REGISTRY_MODULE + "].");
-        }
-        String currentRegImpl = regPropManager.getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS);
-
-        if (currentRegImpl != null) {
-            // Save the current/original.
-            regPropManager.setProperty(REGISTRY_IMPEMENTATION_CLASS_ORIGINAL, currentRegImpl);
-        }
-        regPropManager.setProperty(Environment.REGISTRY_IMPEMENTATION_CLASS, MockRegistry.class.getName());
-    }
-
-    /**
-     * Uninstall this Mock Registry impl as the registry implementation to be used. Reinstate the reg impl that was
-     * specified prior to the install.
-     * <p/>
-     * Call this method in the test tearDown.
-     */
-    public static void uninstall() {
-        if (regPropManager == null) {
-            TestCase.fail("Failed to locate PropertyManager for [" + ModulePropertyManager.REGISTRY_MODULE + "].");
-        }
-        String originalRegImpl = regPropManager.getProperty(REGISTRY_IMPEMENTATION_CLASS_ORIGINAL);
-
-        if (originalRegImpl != null) {
-            // Reset the original.
-            regPropManager.setProperty(Environment.REGISTRY_IMPEMENTATION_CLASS, originalRegImpl);
-            regPropManager.removeProperty(REGISTRY_IMPEMENTATION_CLASS_ORIGINAL);
-        } else {
-            // It wasn't set in the first place, so just unset the impl
-            regPropManager.removeProperty(Environment.REGISTRY_IMPEMENTATION_CLASS);
-        }
-    }
-
-    /**
-     * Utility method for registering a courier for a service.
-     * <p/>
-     * The utility creates an empty EPR against
-     *
-     * @param category Service category.
-     * @param service Service name.
-     * @param courier EPR Courier.
-     */
-    public static void register(String category, String service, MockCourier courier) {
-        EPR epr = new EPR();
-        register(category, service, epr, courier);
-    }
-
-    /**
-     * Utility method for registering a service EPR, as well as its courier.
-     * @param category Service category.
-     * @param service Service name.
-     * @param epr Service EPR.
-     * @param courier EPR Courier.
-     */
-    public static void register(String category, String service, EPR epr, MockCourier courier) {
-        repository.add(new RepositoryEntry(category, service, "", epr, ""));
-        MockCourierFactory.couriers.put(epr, courier);
-    }
-
-    /* (non-Javadoc)
-      * @see org.jboss.soa.esb.services.registry.Registry#registerEPR(java.lang.String, java.lang.String, java.lang.String, org.jboss.soa.esb.addressing.EPR, java.lang.String)
-      */
-    public void registerEPR(String serviceCategoryName, String serviceName,
-                            String serviceDescription, EPR epr, String eprDescription)
-            throws RegistryException {
-
-        repository.add(new RepositoryEntry(serviceCategoryName, serviceName, serviceDescription, epr, eprDescription));
-    }
-
-    /* (non-Javadoc)
-      * @see org.jboss.soa.esb.services.registry.Registry#unRegisterService(java.lang.String, java.lang.String)
-      */
-    public void unRegisterService(String category, String serviceName) throws RegistryException {
-        unRegisterEPR(category, serviceName, null);
-    }
-
-    /* (non-Javadoc)
-      * @see org.jboss.soa.esb.services.registry.Registry#unRegisterEPR(java.lang.String, java.lang.String, org.jboss.soa.esb.addressing.EPR)
-      */
-    public void unRegisterEPR(String serviceCategoryName, String serviceName, EPR epr) throws RegistryException {
-        int indexOf = repository.indexOf(new RepositoryEntry(serviceCategoryName, serviceName, null, epr, null));
-
-        if (indexOf == -1) {
-            throw new RegistryException("Registry entry [" + serviceCategoryName + "][" + serviceName + "] not found.");
-        }
-        repository.remove(indexOf);
-    }
-
-    /* (non-Javadoc)
-      * @see org.jboss.soa.esb.services.registry.Registry#findAllServices()
-      */
-    public Collection<String> findAllServices() throws RegistryException {
-        Collection<String> services = new ArrayList<String>();
-        for (RepositoryEntry entry : repository) {
-            services.add(entry.serviceName);
-        }
-        return services;
-    }
-
-    /* (non-Javadoc)
-      * @see org.jboss.soa.esb.services.registry.Registry#findServices(java.lang.String)
-      */
-    public Collection<String> findServices(String serviceCategoryName)
-            throws RegistryException {
-        Collection<String> services = new ArrayList<String>();
-        for (RepositoryEntry entry : repository) {
-            if (serviceCategoryName.equals(entry.serviceCategoryName)) {
-                services.add(entry.serviceName);
-            }
-        }
-        return services;
-    }
-
-    /* (non-Javadoc)
-      * @see org.jboss.soa.esb.services.registry.Registry#findEPRs(java.lang.String, java.lang.String)
-      */
-    public Collection<EPR> findEPRs(String serviceCategoryName,
-                                    String serviceName) throws RegistryException {
-        Collection<EPR> services = new ArrayList<EPR>();
-        for (RepositoryEntry entry : repository) {
-            if (serviceCategoryName.equals(entry.serviceCategoryName) && serviceName.equals(entry.serviceName)) {
-                services.add(entry.epr);
-            }
-        }
-        return services;
-    }
-
-    /* (non-Javadoc)
-      * @see org.jboss.soa.esb.services.registry.Registry#findEPR(java.lang.String, java.lang.String)
-      */
-    public EPR findEPR(String serviceCategoryName, String serviceName)
-            throws RegistryException {
-        for (RepositoryEntry entry : repository) {
-            if (serviceCategoryName.equals(entry.serviceCategoryName) && serviceName.equals(entry.serviceName)) {
-                return entry.epr;
-            }
-        }
-        return null;
-    }
-
-    public static class RepositoryEntry {
-        public String serviceCategoryName;
-        public String serviceName;
-        public String serviceDescription;
-        public EPR epr;
-        public String eprDescription;
-
-        public RepositoryEntry(String serviceCategoryName, String serviceName, String serviceDescription, EPR epr, String eprDescription) {
-            this.serviceCategoryName = serviceCategoryName;
-            this.serviceName = serviceName;
-            this.serviceDescription = serviceDescription;
-            this.epr = epr;
-            this.eprDescription = eprDescription;
-        }
-
-        public boolean equals(Object obj) {
-            if (obj instanceof RepositoryEntry) {
-                RepositoryEntry entry = (RepositoryEntry) obj;
-
-                if (serviceCategoryName != null && !serviceCategoryName.equalsIgnoreCase(entry.serviceCategoryName)) {
-                    return false;
-                }
-                if (serviceName != null && !serviceName.equalsIgnoreCase(entry.serviceName)) {
-                    return false;
-                }
-                if (epr != null && epr != entry.epr) {
-                    return false;
-                }
-
-                return true;
-            }
-
-            return false;
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistry.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,238 @@
+/*
+ * 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.internal.soa.esb.services.registry;
+
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.couriers.MockCourier;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+import org.jboss.soa.esb.services.registry.Registry;
+import org.jboss.soa.esb.services.registry.RegistryException;
+
+import com.arjuna.common.util.propertyservice.PropertyManager;
+
+/**
+ * Mock Registry implementation.
+ * <p/>
+ * Avoids the need to setup HSQLDB etc.
+ * <p/>
+ * Just call {@link #install()} and {@link #uninstall()} from inside your test setUp and tearDown
+ * methods respectfully.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MockRegistry implements Registry {
+
+    private static final String REGISTRY_IMPEMENTATION_CLASS_ORIGINAL = Environment.REGISTRY_IMPEMENTATION_CLASS + "#Original";
+    public static PropertyManager regPropManager = ModulePropertyManager.getPropertyManager(ModulePropertyManager.REGISTRY_MODULE);
+    public static List<RepositoryEntry> repository = new ArrayList<RepositoryEntry>();
+
+    /**
+     * Install this Mock Registry impl as the registry implementation to be used.
+     * <p/>
+     * Call this method in the test setUp.
+     */
+    public static void install() {
+        if (regPropManager == null) {
+            TestCase.fail("Failed to locate PropertyManager for [" + ModulePropertyManager.REGISTRY_MODULE + "].");
+        }
+        String currentRegImpl = regPropManager.getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS);
+
+        if (currentRegImpl != null) {
+            // Save the current/original.
+            regPropManager.setProperty(REGISTRY_IMPEMENTATION_CLASS_ORIGINAL, currentRegImpl);
+        }
+        regPropManager.setProperty(Environment.REGISTRY_IMPEMENTATION_CLASS, MockRegistry.class.getName());
+    }
+
+    /**
+     * Uninstall this Mock Registry impl as the registry implementation to be used. Reinstate the reg impl that was
+     * specified prior to the install.
+     * <p/>
+     * Call this method in the test tearDown.
+     */
+    public static void uninstall() {
+        if (regPropManager == null) {
+            TestCase.fail("Failed to locate PropertyManager for [" + ModulePropertyManager.REGISTRY_MODULE + "].");
+        }
+        String originalRegImpl = regPropManager.getProperty(REGISTRY_IMPEMENTATION_CLASS_ORIGINAL);
+
+        if (originalRegImpl != null) {
+            // Reset the original.
+            regPropManager.setProperty(Environment.REGISTRY_IMPEMENTATION_CLASS, originalRegImpl);
+            regPropManager.removeProperty(REGISTRY_IMPEMENTATION_CLASS_ORIGINAL);
+        } else {
+            // It wasn't set in the first place, so just unset the impl
+            regPropManager.removeProperty(Environment.REGISTRY_IMPEMENTATION_CLASS);
+        }
+    }
+
+    /**
+     * Utility method for registering a courier for a service.
+     * <p/>
+     * The utility creates an empty EPR against
+     *
+     * @param category Service category.
+     * @param service Service name.
+     * @param courier EPR Courier.
+     */
+    public static void register(String category, String service, MockCourier courier) {
+        EPR epr = new EPR();
+        register(category, service, epr, courier);
+    }
+
+    /**
+     * Utility method for registering a service EPR, as well as its courier.
+     * @param category Service category.
+     * @param service Service name.
+     * @param epr Service EPR.
+     * @param courier EPR Courier.
+     */
+    public static void register(String category, String service, EPR epr, MockCourier courier) {
+        repository.add(new RepositoryEntry(category, service, "", epr, ""));
+        MockCourierFactory.couriers.put(epr, courier);
+    }
+
+    /* (non-Javadoc)
+      * @see org.jboss.soa.esb.services.registry.Registry#registerEPR(java.lang.String, java.lang.String, java.lang.String, org.jboss.soa.esb.addressing.EPR, java.lang.String)
+      */
+    public void registerEPR(String serviceCategoryName, String serviceName,
+                            String serviceDescription, EPR epr, String eprDescription)
+            throws RegistryException {
+
+        repository.add(new RepositoryEntry(serviceCategoryName, serviceName, serviceDescription, epr, eprDescription));
+    }
+
+    /* (non-Javadoc)
+      * @see org.jboss.soa.esb.services.registry.Registry#unRegisterService(java.lang.String, java.lang.String)
+      */
+    public void unRegisterService(String category, String serviceName) throws RegistryException {
+        unRegisterEPR(category, serviceName, null);
+    }
+
+    /* (non-Javadoc)
+      * @see org.jboss.soa.esb.services.registry.Registry#unRegisterEPR(java.lang.String, java.lang.String, org.jboss.soa.esb.addressing.EPR)
+      */
+    public void unRegisterEPR(String serviceCategoryName, String serviceName, EPR epr) throws RegistryException {
+        int indexOf = repository.indexOf(new RepositoryEntry(serviceCategoryName, serviceName, null, epr, null));
+
+        if (indexOf == -1) {
+            throw new RegistryException("Registry entry [" + serviceCategoryName + "][" + serviceName + "] not found.");
+        }
+        repository.remove(indexOf);
+    }
+
+    /* (non-Javadoc)
+      * @see org.jboss.soa.esb.services.registry.Registry#findAllServices()
+      */
+    public Collection<String> findAllServices() throws RegistryException {
+        Collection<String> services = new ArrayList<String>();
+        for (RepositoryEntry entry : repository) {
+            services.add(entry.serviceName);
+        }
+        return services;
+    }
+
+    /* (non-Javadoc)
+      * @see org.jboss.soa.esb.services.registry.Registry#findServices(java.lang.String)
+      */
+    public Collection<String> findServices(String serviceCategoryName)
+            throws RegistryException {
+        Collection<String> services = new ArrayList<String>();
+        for (RepositoryEntry entry : repository) {
+            if (serviceCategoryName.equals(entry.serviceCategoryName)) {
+                services.add(entry.serviceName);
+            }
+        }
+        return services;
+    }
+
+    /* (non-Javadoc)
+      * @see org.jboss.soa.esb.services.registry.Registry#findEPRs(java.lang.String, java.lang.String)
+      */
+    public Collection<EPR> findEPRs(String serviceCategoryName,
+                                    String serviceName) throws RegistryException {
+        Collection<EPR> services = new ArrayList<EPR>();
+        for (RepositoryEntry entry : repository) {
+            if (serviceCategoryName.equals(entry.serviceCategoryName) && serviceName.equals(entry.serviceName)) {
+                services.add(entry.epr);
+            }
+        }
+        return services;
+    }
+
+    /* (non-Javadoc)
+      * @see org.jboss.soa.esb.services.registry.Registry#findEPR(java.lang.String, java.lang.String)
+      */
+    public EPR findEPR(String serviceCategoryName, String serviceName)
+            throws RegistryException {
+        for (RepositoryEntry entry : repository) {
+            if (serviceCategoryName.equals(entry.serviceCategoryName) && serviceName.equals(entry.serviceName)) {
+                return entry.epr;
+            }
+        }
+        return null;
+    }
+
+    public static class RepositoryEntry {
+        public String serviceCategoryName;
+        public String serviceName;
+        public String serviceDescription;
+        public EPR epr;
+        public String eprDescription;
+
+        public RepositoryEntry(String serviceCategoryName, String serviceName, String serviceDescription, EPR epr, String eprDescription) {
+            this.serviceCategoryName = serviceCategoryName;
+            this.serviceName = serviceName;
+            this.serviceDescription = serviceDescription;
+            this.epr = epr;
+            this.eprDescription = eprDescription;
+        }
+
+        public boolean equals(Object obj) {
+            if (obj instanceof RepositoryEntry) {
+                RepositoryEntry entry = (RepositoryEntry) obj;
+
+                if (serviceCategoryName != null && !serviceCategoryName.equalsIgnoreCase(entry.serviceCategoryName)) {
+                    return false;
+                }
+                if (serviceName != null && !serviceName.equalsIgnoreCase(entry.serviceName)) {
+                    return false;
+                }
+                if (epr != null && epr != entry.epr) {
+                    return false;
+                }
+
+                return true;
+            }
+
+            return false;
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,108 +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.internal.soa.esb.services.registry;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.services.registry.Registry;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.services.registry.RegistryFactory;
-
-/**
- * MockRegistry Unit Test.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MockRegistryUnitTest extends TestCase {
-
-	public void test_install_uninstall() throws RegistryException {
-		assertNotSame(MockRegistry.class.getName(), MockRegistry.regPropManager.getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS));
-		
-		MockRegistry.install();
-		assertEquals(MockRegistry.class.getName(), MockRegistry.regPropManager.getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS));
-		Registry registry = RegistryFactory.getRegistry();
-		assertTrue(registry instanceof MockRegistry);
-		
-		MockRegistry.uninstall();
-		assertNotSame(MockRegistry.class.getName(), MockRegistry.regPropManager.getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS));
-	}
-
-	public void test_features() throws RegistryException {
-		MockRegistry registry = new MockRegistry();
-		EPR epr = new EPR();
-		List<String> services = new ArrayList<String>();
-		List<EPR> eprs = new ArrayList<EPR>();
-		
-		registry.registerEPR("cat1", "cat1-service1", "service-desc", epr, "epr-desc"); 
-		registry.registerEPR("cat1", "cat1-service2", "service-desc", epr, "epr-desc"); 
-		registry.registerEPR("cat1", "cat1-service3", "service-desc", epr, "epr-desc"); 
-		registry.registerEPR("cat2", "cat2-service1", "service-desc", epr, "epr-desc"); 
-		registry.registerEPR("cat2", "cat2-service2", "service-desc", epr, "epr-desc"); 
-		registry.registerEPR("cat2", "cat2-service3", "service-desc", epr, "epr-desc"); 
-
-		services.addAll(registry.findAllServices());
-		assertEquals(6, services.size());
-		assertEquals("cat1-service1", services.get(0));
-		assertEquals("cat2-service1", services.get(3));
-		assertEquals("cat2-service3", services.get(5));
-
-		services.clear();
-		services.addAll(registry.findServices("cat1"));
-		assertEquals(3, services.size());
-		assertEquals("cat1-service1", services.get(0));
-		assertEquals("cat1-service2", services.get(1));
-		assertEquals("cat1-service3", services.get(2));
-
-		assertEquals(epr, registry.findEPR("cat1", "cat1-service1"));
-
-		try {
-			registry.unRegisterService("cat2", "cat1-service2");
-			fail("Expected RegistryException for unknown service.");
-		} catch(RegistryException e) {
-			//OK
-		}
-		
-		eprs.addAll(registry.findEPRs("cat1", "cat1-service1"));
-		assertEquals(1, eprs.size());
-		assertEquals(epr, eprs.get(0));
-
-		registry.unRegisterService("cat1", "cat1-service2");
-		services.clear();
-		services.addAll(registry.findAllServices());
-		assertEquals(5, services.size());
-		assertEquals("cat1-service1", services.get(0));
-		assertEquals("cat1-service3", services.get(1));
-		assertEquals("cat2-service1", services.get(2));
-
-		registry.unRegisterEPR("cat2", "cat2-service2", epr);
-		services.clear();
-		services.addAll(registry.findAllServices());
-		assertEquals(4, services.size());
-		assertEquals("cat1-service1", services.get(0));
-		assertEquals("cat1-service3", services.get(1));
-		assertEquals("cat2-service1", services.get(2));
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/services/registry/MockRegistryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,108 @@
+/*
+ * 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.internal.soa.esb.services.registry;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.services.registry.Registry;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.services.registry.RegistryFactory;
+
+/**
+ * MockRegistry Unit Test.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MockRegistryUnitTest extends TestCase {
+
+	public void test_install_uninstall() throws RegistryException {
+		assertNotSame(MockRegistry.class.getName(), MockRegistry.regPropManager.getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS));
+		
+		MockRegistry.install();
+		assertEquals(MockRegistry.class.getName(), MockRegistry.regPropManager.getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS));
+		Registry registry = RegistryFactory.getRegistry();
+		assertTrue(registry instanceof MockRegistry);
+		
+		MockRegistry.uninstall();
+		assertNotSame(MockRegistry.class.getName(), MockRegistry.regPropManager.getProperty(Environment.REGISTRY_IMPEMENTATION_CLASS));
+	}
+
+	public void test_features() throws RegistryException {
+		MockRegistry registry = new MockRegistry();
+		EPR epr = new EPR();
+		List<String> services = new ArrayList<String>();
+		List<EPR> eprs = new ArrayList<EPR>();
+		
+		registry.registerEPR("cat1", "cat1-service1", "service-desc", epr, "epr-desc"); 
+		registry.registerEPR("cat1", "cat1-service2", "service-desc", epr, "epr-desc"); 
+		registry.registerEPR("cat1", "cat1-service3", "service-desc", epr, "epr-desc"); 
+		registry.registerEPR("cat2", "cat2-service1", "service-desc", epr, "epr-desc"); 
+		registry.registerEPR("cat2", "cat2-service2", "service-desc", epr, "epr-desc"); 
+		registry.registerEPR("cat2", "cat2-service3", "service-desc", epr, "epr-desc"); 
+
+		services.addAll(registry.findAllServices());
+		assertEquals(6, services.size());
+		assertEquals("cat1-service1", services.get(0));
+		assertEquals("cat2-service1", services.get(3));
+		assertEquals("cat2-service3", services.get(5));
+
+		services.clear();
+		services.addAll(registry.findServices("cat1"));
+		assertEquals(3, services.size());
+		assertEquals("cat1-service1", services.get(0));
+		assertEquals("cat1-service2", services.get(1));
+		assertEquals("cat1-service3", services.get(2));
+
+		assertEquals(epr, registry.findEPR("cat1", "cat1-service1"));
+
+		try {
+			registry.unRegisterService("cat2", "cat1-service2");
+			fail("Expected RegistryException for unknown service.");
+		} catch(RegistryException e) {
+			//OK
+		}
+		
+		eprs.addAll(registry.findEPRs("cat1", "cat1-service1"));
+		assertEquals(1, eprs.size());
+		assertEquals(epr, eprs.get(0));
+
+		registry.unRegisterService("cat1", "cat1-service2");
+		services.clear();
+		services.addAll(registry.findAllServices());
+		assertEquals(5, services.size());
+		assertEquals("cat1-service1", services.get(0));
+		assertEquals("cat1-service3", services.get(1));
+		assertEquals("cat2-service1", services.get(2));
+
+		registry.unRegisterEPR("cat2", "cat2-service2", epr);
+		services.clear();
+		services.addAll(registry.findAllServices());
+		assertEquals(4, services.size());
+		assertEquals("cat1-service1", services.get(0));
+		assertEquals("cat1-service3", services.get(1));
+		assertEquals("cat2-service1", services.get(2));
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/OGNLUtilsUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/OGNLUtilsUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/OGNLUtilsUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,108 +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, JBoss Inc.
- */
-package org.jboss.internal.soa.esb.soap;
-
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map;
-
-import javax.xml.namespace.NamespaceContext;
-import javax.xml.xpath.XPath;
-import javax.xml.xpath.XPathConstants;
-import javax.xml.xpath.XPathExpressionException;
-import javax.xml.xpath.XPathFactory;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-/**
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class OGNLUtilsUnitTest extends TestCase {
-
-    public void test() throws IOException, SAXException, ConfigurationException, XPathExpressionException {
-        Node node;
-
-        // Test regular node...
-        node = getNode("/soapenv:Envelope/soapenv:Body/cus:customerOrder/cus:header/cus:customerName");
-        assertEquals("customerOrder.header.customerName", OGNLUtils.getOGNLExpression((Element) node));
-
-        // Test collection nodes...
-        node = getNode("/soapenv:Envelope/soapenv:Body/cus:customerOrder/cus:items/cus:item[1]");
-        assertEquals("customerOrder.items[0]", OGNLUtils.getOGNLExpression((Element) node));
-
-        node = getNode("/soapenv:Envelope/soapenv:Body/cus:customerOrder/cus:items/cus:item[2]");
-        assertEquals("customerOrder.items[1]", OGNLUtils.getOGNLExpression((Element) node));
-
-        node = getNode("/soapenv:Envelope/soapenv:Body/cus:customerOrder/cus:items/cus:item[2]/cus:partNumber");
-        assertEquals("customerOrder.items[1].partNumber", OGNLUtils.getOGNLExpression((Element) node));
-    }
-
-    private Node getNode(String xpath) throws IOException, SAXException, XPathExpressionException {
-        Document order = YADOMUtil.parseStream(getClass().getResourceAsStream("ognl-test-01.xml"), false, false, true);
-        XPathFactory xPathFactory = XPathFactory.newInstance();
-        XPath xpathEvaluater = xPathFactory.newXPath();
-
-        xpathEvaluater.setNamespaceContext(new MockNamespaceContext());
-
-        return (Node) xpathEvaluater.evaluate(xpath, order, XPathConstants.NODE);        
-    }
-
-    class MockNamespaceContext implements NamespaceContext {
-
-        private Map<String, String> namespaces = new HashMap<String, String>();
-        private Map<String, String> prefixes = new HashMap<String, String>();
-
-        public MockNamespaceContext() {
-            namespaces.put("soapenv", "http://schemas.xmlsoap.org/soap/envelope/");
-            namespaces.put("cus", "http://schemas.active-endpoints.com/sample/customerorder/2006/04/CustomerOrder.xsd");
-            namespaces.put("stan", "http://schemas.active-endpoints.com/sample/standardtypes/2006/04/StandardTypes.xsd");
-            prefixes.put("http://schemas.xmlsoap.org/soap/envelope/", "soapenv");
-            prefixes.put("http://schemas.active-endpoints.com/sample/customerorder/2006/04/CustomerOrder.xsd", "cus");
-            prefixes.put("http://schemas.active-endpoints.com/sample/standardtypes/2006/04/StandardTypes.xsd", "stan");
-        }
-
-        public String getNamespaceURI(String prefix) {
-            return namespaces.get(prefix);
-        }
-
-        public String getPrefix(String namespaceURI) {
-            return prefixes.get(namespaceURI);
-        }
-
-        public Iterator getPrefixes(String namespaceURI) {
-            ArrayList<String> list = new ArrayList<String>();
-
-            if(prefixes.containsKey(namespaceURI)) {
-                list.add(prefixes.get(namespaceURI));
-            }
-
-            return list.iterator();
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/OGNLUtilsUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/OGNLUtilsUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/OGNLUtilsUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/OGNLUtilsUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,108 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.internal.soa.esb.soap;
+
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.xml.namespace.NamespaceContext;
+import javax.xml.xpath.XPath;
+import javax.xml.xpath.XPathConstants;
+import javax.xml.xpath.XPathExpressionException;
+import javax.xml.xpath.XPathFactory;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class OGNLUtilsUnitTest extends TestCase {
+
+    public void test() throws IOException, SAXException, ConfigurationException, XPathExpressionException {
+        Node node;
+
+        // Test regular node...
+        node = getNode("/soapenv:Envelope/soapenv:Body/cus:customerOrder/cus:header/cus:customerName");
+        assertEquals("customerOrder.header.customerName", OGNLUtils.getOGNLExpression((Element) node));
+
+        // Test collection nodes...
+        node = getNode("/soapenv:Envelope/soapenv:Body/cus:customerOrder/cus:items/cus:item[1]");
+        assertEquals("customerOrder.items[0]", OGNLUtils.getOGNLExpression((Element) node));
+
+        node = getNode("/soapenv:Envelope/soapenv:Body/cus:customerOrder/cus:items/cus:item[2]");
+        assertEquals("customerOrder.items[1]", OGNLUtils.getOGNLExpression((Element) node));
+
+        node = getNode("/soapenv:Envelope/soapenv:Body/cus:customerOrder/cus:items/cus:item[2]/cus:partNumber");
+        assertEquals("customerOrder.items[1].partNumber", OGNLUtils.getOGNLExpression((Element) node));
+    }
+
+    private Node getNode(String xpath) throws IOException, SAXException, XPathExpressionException {
+        Document order = YADOMUtil.parseStream(getClass().getResourceAsStream("ognl-test-01.xml"), false, false, true);
+        XPathFactory xPathFactory = XPathFactory.newInstance();
+        XPath xpathEvaluater = xPathFactory.newXPath();
+
+        xpathEvaluater.setNamespaceContext(new MockNamespaceContext());
+
+        return (Node) xpathEvaluater.evaluate(xpath, order, XPathConstants.NODE);        
+    }
+
+    class MockNamespaceContext implements NamespaceContext {
+
+        private Map<String, String> namespaces = new HashMap<String, String>();
+        private Map<String, String> prefixes = new HashMap<String, String>();
+
+        public MockNamespaceContext() {
+            namespaces.put("soapenv", "http://schemas.xmlsoap.org/soap/envelope/");
+            namespaces.put("cus", "http://schemas.active-endpoints.com/sample/customerorder/2006/04/CustomerOrder.xsd");
+            namespaces.put("stan", "http://schemas.active-endpoints.com/sample/standardtypes/2006/04/StandardTypes.xsd");
+            prefixes.put("http://schemas.xmlsoap.org/soap/envelope/", "soapenv");
+            prefixes.put("http://schemas.active-endpoints.com/sample/customerorder/2006/04/CustomerOrder.xsd", "cus");
+            prefixes.put("http://schemas.active-endpoints.com/sample/standardtypes/2006/04/StandardTypes.xsd", "stan");
+        }
+
+        public String getNamespaceURI(String prefix) {
+            return namespaces.get(prefix);
+        }
+
+        public String getPrefix(String namespaceURI) {
+            return prefixes.get(namespaceURI);
+        }
+
+        public Iterator getPrefixes(String namespaceURI) {
+            ArrayList<String> list = new ArrayList<String>();
+
+            if(prefixes.containsKey(namespaceURI)) {
+                list.add(prefixes.get(namespaceURI));
+            }
+
+            return list.iterator();
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/ognl-test-01.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/ognl-test-01.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/ognl-test-01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,27 +0,0 @@
-<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="http://schemas.active-endpoints.com/sample/customerorder/2006/04/CustomerOrder.xsd" xmlns:stan="http://schemas.active-endpoints.com/sample/standardtypes/2006/04/StandardTypes.xsd">
-   <soapenv:Header/>
-   <soapenv:Body>
-      <cus:customerOrder>
-         <cus:header>
-             <cus:customerName>?</cus:customerName>
-         </cus:header>
-         <cus:items>
-            <!--1 or more repetitions:-->
-            <cus:item>
-               <cus:partNumber>?</cus:partNumber>
-               <cus:description>?</cus:description>
-               <cus:quantity>?</cus:quantity>
-               <cus:price>?</cus:price>
-               <cus:extensionAmount>?</cus:extensionAmount>
-            </cus:item>
-            <cus:item>
-               <cus:partNumber>?</cus:partNumber>
-               <cus:description>?</cus:description>
-               <cus:quantity>?</cus:quantity>
-               <cus:price>?</cus:price>
-               <cus:extensionAmount>?</cus:extensionAmount>
-            </cus:item>
-         </cus:items>
-      </cus:customerOrder>
-   </soapenv:Body>
-</soapenv:Envelope>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/ognl-test-01.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/ognl-test-01.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/ognl-test-01.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/soap/ognl-test-01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,27 @@
+<soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:cus="http://schemas.active-endpoints.com/sample/customerorder/2006/04/CustomerOrder.xsd" xmlns:stan="http://schemas.active-endpoints.com/sample/standardtypes/2006/04/StandardTypes.xsd">
+   <soapenv:Header/>
+   <soapenv:Body>
+      <cus:customerOrder>
+         <cus:header>
+             <cus:customerName>?</cus:customerName>
+         </cus:header>
+         <cus:items>
+            <!--1 or more repetitions:-->
+            <cus:item>
+               <cus:partNumber>?</cus:partNumber>
+               <cus:description>?</cus:description>
+               <cus:quantity>?</cus:quantity>
+               <cus:price>?</cus:price>
+               <cus:extensionAmount>?</cus:extensionAmount>
+            </cus:item>
+            <cus:item>
+               <cus:partNumber>?</cus:partNumber>
+               <cus:description>?</cus:description>
+               <cus:quantity>?</cus:quantity>
+               <cus:price>?</cus:price>
+               <cus:extensionAmount>?</cus:extensionAmount>
+            </cus:item>
+         </cus:items>
+      </cus:customerOrder>
+   </soapenv:Body>
+</soapenv:Envelope>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/EdtFtpImplUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/EdtFtpImplUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/EdtFtpImplUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,336 +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.internal.soa.esb.util;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.MalformedURLException;
-import java.net.URISyntaxException;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.util.embedded.EmbeddableException;
-import org.jboss.internal.soa.esb.util.embedded.ftp.FtpTestUtil;
-import org.jboss.internal.soa.esb.util.embedded.ftp.NoConfigFileFtpServer;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.util.RemoteFileSystem;
-import org.jboss.soa.esb.util.RemoteFileSystemException;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Unit test for EdtFtpImpl that uses an embedded ftp server
- * 
- * @author Daniel Bevenius
- * 
- */
-public class EdtFtpImplUnitTest 
-{
-	private static Logger log = Logger.getLogger( EdtFtpImplUnitTest.class );
-	
-	/* EmbeddedFtp Server */
-	private static NoConfigFileFtpServer ftpServer;
-
-	/* Instance of class under test */
-	private static EdtFtpImpl edtFtpImpl;
-	
-	private static String remoteInputDirName;
-	private static String remoteUploadDirName;
-	private static final String INPUT_SUFFIX = ".txt";
-	private static final String RENAMED_SUFFIX = ".renamed";
-	
-	/* Content for created test files */
-	private static final String TEST_FILE_CONTENT = EdtFtpImplUnitTest.class .getName() + " junit ftp test";
-	private File testFile;
-	private File renamedFile;
-
-	@BeforeClass
-	public static void classSetup() throws EmbeddableException, ConfigurationException, RemoteFileSystemException, MalformedURLException, URISyntaxException
-	{
-		ftpServer = new NoConfigFileFtpServer();
-		ftpServer.setPort( 2221 );
-		ftpServer.start();
-
-		remoteInputDirName = "/" + ftpServer.getLocalInputDir().getName();
-		remoteUploadDirName = "/" + ftpServer.getLocalUploadDir().getName();
-		edtFtpImpl = new EdtFtpImpl( createConfigTree(), true );
-	}
-
-	@AfterClass
-	public static void classTearDown() throws EmbeddableException
-	{
-		try
-		{
-			ftpServer.stop();
-		} 
-		catch (Exception e)
-		{
-			log.warn( e.getMessage() );
-		}
-		
-		if  ( !FtpTestUtil.deleteDir( ftpServer.getFtpServerDir() ) )
-		{
-			log.warn( "Could not delete " +  ftpServer.getFtpServerDir() ) ;
-		}
-	}
-
-	@Before
-	public void setUp()
-	{
-		testFile = FtpTestUtil.createTestFile( ftpServer.getLocalInputDir(), getClass().getName() + INPUT_SUFFIX, TEST_FILE_CONTENT );
-	}
-	
-	@After
-	public void tearDown()
-	{
-		FtpTestUtil.deleteFile( testFile );
-		FtpTestUtil.deleteFile( renamedFile );
-	}
-	
-	@Test
-	public void construtor_FTPEpr() 
-	{
-		try
-		{
-			new EdtFtpImpl( createFTPEpr(), true );
-		}
-		catch ( Exception e )
-		{
-			fail ( e.getMessage() );
-		}
-	}
-	
-	@Test
-	public void getRemoteDir() throws RemoteFileSystemException
-	{
-		String oldRemoteDir =  remoteInputDirName;
-		try
-		{
-			edtFtpImpl.setRemoteDir( remoteUploadDirName );
-			assertEquals( "The remote dir was not changed.", remoteUploadDirName, edtFtpImpl.getRemoteDir() );
-		} 
-		finally
-		{
-			try { edtFtpImpl.setRemoteDir( oldRemoteDir ); } catch (Exception e) { fail( e.getMessage() ); }
-		}
-	}
-
-	@Test
-	public void setRemoteDir() throws RemoteFileSystemException
-	{
-		String oldRemoteDir = remoteInputDirName;
-		try
-		{
-			edtFtpImpl.setRemoteDir( remoteUploadDirName );
-
-			String actualRemoteDir = edtFtpImpl.getRemoteDir();
-			assertFalse( "The setRemoteDir method did not change the directory!", oldRemoteDir.equals( actualRemoteDir ) );
-		} 
-		finally
-		{
-			try { edtFtpImpl.setRemoteDir( oldRemoteDir ); } catch (Exception e) { fail( e.getMessage() ); }
-		}
-	}
-
-	@Test
-	public void getFileListFromRemoteDir() throws RemoteFileSystemException, IOException
-	{
-		String[] fileListFromRemoteDir = edtFtpImpl .getFileListFromRemoteDir( INPUT_SUFFIX );
-		assertNotNull( fileListFromRemoteDir );
-		List<String> fileList = Arrays.asList( fileListFromRemoteDir );
-		assertTrue( "The test file was not included in the List! ", fileList.contains( testFile.getName() ) );
-	}
-
-	@Test
-	public void deleteRemoteFile() throws RemoteFileSystemException
-	{
-		edtFtpImpl.deleteRemoteFile( testFile.getName() );
-		assertFalse( "File was not deleted", testFile.exists() );
-	}
-
-	@Test
-	public void remoteDelete() throws RemoteFileSystemException
-	{
-		edtFtpImpl.remoteDelete( testFile );
-		assertFalse( testFile.exists() );
-	}
-
-	@Test
-	public void renameInRemoteDir() throws RemoteFileSystemException
-	{
-		File from = testFile;
-		String toFileName = from.getName() + RENAMED_SUFFIX;
-			
-		edtFtpImpl.renameInRemoteDir( from.getName(), toFileName );
-
-		renamedFile = new File( ftpServer.getLocalInputDir(), toFileName );
-		assertFalse( "The file was not removed from the filesystem", from .exists() );
-		assertTrue( "The named file does not exist", renamedFile.exists() );
-	}
-
-	@Test
-	public void remoteRename_To_Different_RemoteDir() throws RemoteFileSystemException
-	{
-		File from = createAbsoluteFromFile();
-		File to = createAbsoluteToFileUploadDir();
-
-		edtFtpImpl.remoteRename( from, to );
-
-		renamedFile = new File( ftpServer.getLocalUploadDir(), to.getName() );
-		assertFalse( "The file was not removed from the filesystem", from .exists() );
-		assertTrue( renamedFile + " was not found in dir " + ftpServer.getLocalUploadDir(), renamedFile.exists() );
-	}
-	
-	@Test
-	public void remoteRename_To_Same_RemoteDir() throws RemoteFileSystemException
-	{
-		File from =  createAbsoluteFromFile();
-		File to = createAbsoluteToFile();
-			
-		edtFtpImpl.remoteRename( from, to );
-
-		renamedFile = new File( ftpServer.getLocalInputDir(), testFile.getName() + RENAMED_SUFFIX );
-		assertFalse( testFile.exists() );
-		assertTrue( renamedFile.exists() );
-	}
-	
-	@Test
-	public void downloadFile() throws RemoteFileSystemException, IOException
-	{
-		File localFile = null;
-		File localDownloadedlFile = null;
-		String testFileName = "downloadFileTestFile.txt";
-		try
-		{
-			localFile = FtpTestUtil.createTestFile( ftpServer .getLocalInputDir(), testFileName, TEST_FILE_CONTENT );
-			String remoteFileName = "/input/" + localFile.getName();
-			String downloadFileName = testFileName + ".downloaded";
-
-			edtFtpImpl.downloadFile( remoteFileName, downloadFileName );
-
-			localDownloadedlFile = new File( ftpServer.getRootDir(), downloadFileName );
-			assertTrue( "The remote file should not have been removed.", localFile.exists() );
-			assertTrue( "File was not downloaded ", localDownloadedlFile .exists() );
-		} 
-		finally
-		{
-			FtpTestUtil.deleteFile( localDownloadedlFile );
-			FtpTestUtil.deleteFile( localFile );
-		}
-	}
-
-	@Test
-	public void uploadFile() throws RemoteFileSystemException
-	{
-		File localFile = null;
-		File remoteFile = null;
-		String testFileName = "uploadFileTestFile.txt";
-		try
-		{
-			localFile = FtpTestUtil.createTestFile(  ftpServer.getLocalInputDir(),  testFileName, TEST_FILE_CONTENT );
-			
-			String renameTo = testFileName + RENAMED_SUFFIX;
-			edtFtpImpl.uploadFile( localFile, renameTo );
-			remoteFile = new File ( ftpServer.getLocalInputDir(), renameTo );
-			
-			assertTrue( "The file was not uploaded succesfully." , remoteFile.exists() );
-		} 
-		finally
-		{
-			FtpTestUtil.deleteFile( remoteFile );
-			FtpTestUtil.deleteFile( localFile );
-		}
-	}
-
-	private static ConfigTree createConfigTree()
-	{
-		ConfigTree configTree = new ConfigTree( "junitEdtFtpImplTest" );
-		try
-		{
-			configTree.setAttribute( FileEpr.URL_TAG, ftpServer.getURL().toString() ) ;
-		}
-		catch ( MalformedURLException e )
-		{
-			log.error(  e  );
-			fail ( e.getMessage() );
-		}
-		configTree.setAttribute( RemoteFileSystem.PARMS_FTP_SERVER, ftpServer .getHost() );
-		configTree.setAttribute( RemoteFileSystem.PARMS_USER, ftpServer .getUserName() );
-		configTree.setAttribute( RemoteFileSystem.PARMS_PASSWD, ftpServer .getPassword() );
-		configTree.setAttribute( RemoteFileSystem.PARMS_REMOTE_DIR, remoteInputDirName );
-		configTree.setAttribute( RemoteFileSystem.PARMS_PORT, Integer .toString( ftpServer.getPort() ) );
-		configTree.setAttribute( RemoteFileSystem.PARMS_LOCAL_DIR, ftpServer .getRootDir() );
-		configTree.setAttribute( RemoteFileSystem.PARMS_ASCII, Boolean .toString( false ) );
-		configTree.setAttribute( RemoteFileSystem.PARMS_PASSIVE, Boolean .toString( false ) );
-		return configTree;
-	}
-	
-	private static FTPEpr createFTPEpr() throws MalformedURLException, URISyntaxException
-	{
-		FTPEpr epr = new FTPEpr ( new EPR() );
-		epr.setURL( ftpServer.getURL() );
-		epr.setUserName( ftpServer.getUserName() );
-		epr.setErrorDirectory( ftpServer.getErrorDirName() );
-		epr.setInputSuffix( INPUT_SUFFIX );
-		epr.setPassword( ftpServer.getPassword() );
-		epr.setPostDirectory( ftpServer.getUploadDirName() );
-		epr.setWorkSuffix( ".work" );
-		return epr;
-	}
-	
-	private File createAbsoluteFromFile()
-	{
-		return new File ( remoteInputDirName + "/" + testFile.getName() );
-	}
-	
-	private File createAbsoluteToFile()
-	{
-		return new File ( remoteInputDirName + "/" + testFile.getName() + RENAMED_SUFFIX );
-	}
-	
-	private File createAbsoluteToFileUploadDir()
-	{
-		return new File ( remoteUploadDirName + "/" +  testFile.getName() + RENAMED_SUFFIX );
-	}
-
-	public static junit.framework.Test suite()
-	{
-		return new JUnit4TestAdapter( EdtFtpImplUnitTest.class);
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/EdtFtpImplUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/EdtFtpImplUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/EdtFtpImplUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/EdtFtpImplUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,336 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.util;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.MalformedURLException;
+import java.net.URISyntaxException;
+import java.util.Arrays;
+import java.util.List;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.embedded.EmbeddableException;
+import org.jboss.internal.soa.esb.util.embedded.ftp.FtpTestUtil;
+import org.jboss.internal.soa.esb.util.embedded.ftp.NoConfigFileFtpServer;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.util.RemoteFileSystem;
+import org.jboss.soa.esb.util.RemoteFileSystemException;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Unit test for EdtFtpImpl that uses an embedded ftp server
+ * 
+ * @author Daniel Bevenius
+ * 
+ */
+public class EdtFtpImplUnitTest 
+{
+	private static Logger log = Logger.getLogger( EdtFtpImplUnitTest.class );
+	
+	/* EmbeddedFtp Server */
+	private static NoConfigFileFtpServer ftpServer;
+
+	/* Instance of class under test */
+	private static EdtFtpImpl edtFtpImpl;
+	
+	private static String remoteInputDirName;
+	private static String remoteUploadDirName;
+	private static final String INPUT_SUFFIX = ".txt";
+	private static final String RENAMED_SUFFIX = ".renamed";
+	
+	/* Content for created test files */
+	private static final String TEST_FILE_CONTENT = EdtFtpImplUnitTest.class .getName() + " junit ftp test";
+	private File testFile;
+	private File renamedFile;
+
+	@BeforeClass
+	public static void classSetup() throws EmbeddableException, ConfigurationException, RemoteFileSystemException, MalformedURLException, URISyntaxException
+	{
+		ftpServer = new NoConfigFileFtpServer();
+		ftpServer.setPort( 2221 );
+		ftpServer.start();
+
+		remoteInputDirName = "/" + ftpServer.getLocalInputDir().getName();
+		remoteUploadDirName = "/" + ftpServer.getLocalUploadDir().getName();
+		edtFtpImpl = new EdtFtpImpl( createConfigTree(), true );
+	}
+
+	@AfterClass
+	public static void classTearDown() throws EmbeddableException
+	{
+		try
+		{
+			ftpServer.stop();
+		} 
+		catch (Exception e)
+		{
+			log.warn( e.getMessage() );
+		}
+		
+		if  ( !FtpTestUtil.deleteDir( ftpServer.getFtpServerDir() ) )
+		{
+			log.warn( "Could not delete " +  ftpServer.getFtpServerDir() ) ;
+		}
+	}
+
+	@Before
+	public void setUp()
+	{
+		testFile = FtpTestUtil.createTestFile( ftpServer.getLocalInputDir(), getClass().getName() + INPUT_SUFFIX, TEST_FILE_CONTENT );
+	}
+	
+	@After
+	public void tearDown()
+	{
+		FtpTestUtil.deleteFile( testFile );
+		FtpTestUtil.deleteFile( renamedFile );
+	}
+	
+	@Test
+	public void construtor_FTPEpr() 
+	{
+		try
+		{
+			new EdtFtpImpl( createFTPEpr(), true );
+		}
+		catch ( Exception e )
+		{
+			fail ( e.getMessage() );
+		}
+	}
+	
+	@Test
+	public void getRemoteDir() throws RemoteFileSystemException
+	{
+		String oldRemoteDir =  remoteInputDirName;
+		try
+		{
+			edtFtpImpl.setRemoteDir( remoteUploadDirName );
+			assertEquals( "The remote dir was not changed.", remoteUploadDirName, edtFtpImpl.getRemoteDir() );
+		} 
+		finally
+		{
+			try { edtFtpImpl.setRemoteDir( oldRemoteDir ); } catch (Exception e) { fail( e.getMessage() ); }
+		}
+	}
+
+	@Test
+	public void setRemoteDir() throws RemoteFileSystemException
+	{
+		String oldRemoteDir = remoteInputDirName;
+		try
+		{
+			edtFtpImpl.setRemoteDir( remoteUploadDirName );
+
+			String actualRemoteDir = edtFtpImpl.getRemoteDir();
+			assertFalse( "The setRemoteDir method did not change the directory!", oldRemoteDir.equals( actualRemoteDir ) );
+		} 
+		finally
+		{
+			try { edtFtpImpl.setRemoteDir( oldRemoteDir ); } catch (Exception e) { fail( e.getMessage() ); }
+		}
+	}
+
+	@Test
+	public void getFileListFromRemoteDir() throws RemoteFileSystemException, IOException
+	{
+		String[] fileListFromRemoteDir = edtFtpImpl .getFileListFromRemoteDir( INPUT_SUFFIX );
+		assertNotNull( fileListFromRemoteDir );
+		List<String> fileList = Arrays.asList( fileListFromRemoteDir );
+		assertTrue( "The test file was not included in the List! ", fileList.contains( testFile.getName() ) );
+	}
+
+	@Test
+	public void deleteRemoteFile() throws RemoteFileSystemException
+	{
+		edtFtpImpl.deleteRemoteFile( testFile.getName() );
+		assertFalse( "File was not deleted", testFile.exists() );
+	}
+
+	@Test
+	public void remoteDelete() throws RemoteFileSystemException
+	{
+		edtFtpImpl.remoteDelete( testFile );
+		assertFalse( testFile.exists() );
+	}
+
+	@Test
+	public void renameInRemoteDir() throws RemoteFileSystemException
+	{
+		File from = testFile;
+		String toFileName = from.getName() + RENAMED_SUFFIX;
+			
+		edtFtpImpl.renameInRemoteDir( from.getName(), toFileName );
+
+		renamedFile = new File( ftpServer.getLocalInputDir(), toFileName );
+		assertFalse( "The file was not removed from the filesystem", from .exists() );
+		assertTrue( "The named file does not exist", renamedFile.exists() );
+	}
+
+	@Test
+	public void remoteRename_To_Different_RemoteDir() throws RemoteFileSystemException
+	{
+		File from = createAbsoluteFromFile();
+		File to = createAbsoluteToFileUploadDir();
+
+		edtFtpImpl.remoteRename( from, to );
+
+		renamedFile = new File( ftpServer.getLocalUploadDir(), to.getName() );
+		assertFalse( "The file was not removed from the filesystem", from .exists() );
+		assertTrue( renamedFile + " was not found in dir " + ftpServer.getLocalUploadDir(), renamedFile.exists() );
+	}
+	
+	@Test
+	public void remoteRename_To_Same_RemoteDir() throws RemoteFileSystemException
+	{
+		File from =  createAbsoluteFromFile();
+		File to = createAbsoluteToFile();
+			
+		edtFtpImpl.remoteRename( from, to );
+
+		renamedFile = new File( ftpServer.getLocalInputDir(), testFile.getName() + RENAMED_SUFFIX );
+		assertFalse( testFile.exists() );
+		assertTrue( renamedFile.exists() );
+	}
+	
+	@Test
+	public void downloadFile() throws RemoteFileSystemException, IOException
+	{
+		File localFile = null;
+		File localDownloadedlFile = null;
+		String testFileName = "downloadFileTestFile.txt";
+		try
+		{
+			localFile = FtpTestUtil.createTestFile( ftpServer .getLocalInputDir(), testFileName, TEST_FILE_CONTENT );
+			String remoteFileName = "/input/" + localFile.getName();
+			String downloadFileName = testFileName + ".downloaded";
+
+			edtFtpImpl.downloadFile( remoteFileName, downloadFileName );
+
+			localDownloadedlFile = new File( ftpServer.getRootDir(), downloadFileName );
+			assertTrue( "The remote file should not have been removed.", localFile.exists() );
+			assertTrue( "File was not downloaded ", localDownloadedlFile .exists() );
+		} 
+		finally
+		{
+			FtpTestUtil.deleteFile( localDownloadedlFile );
+			FtpTestUtil.deleteFile( localFile );
+		}
+	}
+
+	@Test
+	public void uploadFile() throws RemoteFileSystemException
+	{
+		File localFile = null;
+		File remoteFile = null;
+		String testFileName = "uploadFileTestFile.txt";
+		try
+		{
+			localFile = FtpTestUtil.createTestFile(  ftpServer.getLocalInputDir(),  testFileName, TEST_FILE_CONTENT );
+			
+			String renameTo = testFileName + RENAMED_SUFFIX;
+			edtFtpImpl.uploadFile( localFile, renameTo );
+			remoteFile = new File ( ftpServer.getLocalInputDir(), renameTo );
+			
+			assertTrue( "The file was not uploaded succesfully." , remoteFile.exists() );
+		} 
+		finally
+		{
+			FtpTestUtil.deleteFile( remoteFile );
+			FtpTestUtil.deleteFile( localFile );
+		}
+	}
+
+	private static ConfigTree createConfigTree()
+	{
+		ConfigTree configTree = new ConfigTree( "junitEdtFtpImplTest" );
+		try
+		{
+			configTree.setAttribute( FileEpr.URL_TAG, ftpServer.getURL().toString() ) ;
+		}
+		catch ( MalformedURLException e )
+		{
+			log.error(  e  );
+			fail ( e.getMessage() );
+		}
+		configTree.setAttribute( RemoteFileSystem.PARMS_FTP_SERVER, ftpServer .getHost() );
+		configTree.setAttribute( RemoteFileSystem.PARMS_USER, ftpServer .getUserName() );
+		configTree.setAttribute( RemoteFileSystem.PARMS_PASSWD, ftpServer .getPassword() );
+		configTree.setAttribute( RemoteFileSystem.PARMS_REMOTE_DIR, remoteInputDirName );
+		configTree.setAttribute( RemoteFileSystem.PARMS_PORT, Integer .toString( ftpServer.getPort() ) );
+		configTree.setAttribute( RemoteFileSystem.PARMS_LOCAL_DIR, ftpServer .getRootDir() );
+		configTree.setAttribute( RemoteFileSystem.PARMS_ASCII, Boolean .toString( false ) );
+		configTree.setAttribute( RemoteFileSystem.PARMS_PASSIVE, Boolean .toString( false ) );
+		return configTree;
+	}
+	
+	private static FTPEpr createFTPEpr() throws MalformedURLException, URISyntaxException
+	{
+		FTPEpr epr = new FTPEpr ( new EPR() );
+		epr.setURL( ftpServer.getURL() );
+		epr.setUserName( ftpServer.getUserName() );
+		epr.setErrorDirectory( ftpServer.getErrorDirName() );
+		epr.setInputSuffix( INPUT_SUFFIX );
+		epr.setPassword( ftpServer.getPassword() );
+		epr.setPostDirectory( ftpServer.getUploadDirName() );
+		epr.setWorkSuffix( ".work" );
+		return epr;
+	}
+	
+	private File createAbsoluteFromFile()
+	{
+		return new File ( remoteInputDirName + "/" + testFile.getName() );
+	}
+	
+	private File createAbsoluteToFile()
+	{
+		return new File ( remoteInputDirName + "/" + testFile.getName() + RENAMED_SUFFIX );
+	}
+	
+	private File createAbsoluteToFileUploadDir()
+	{
+		return new File ( remoteUploadDirName + "/" +  testFile.getName() + RENAMED_SUFFIX );
+	}
+
+	public static junit.framework.Test suite()
+	{
+		return new JUnit4TestAdapter( EdtFtpImplUnitTest.class);
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,18 +0,0 @@
-<JBossESB parameterReloadSecs="120">
-	<FtpDownloadTest listenerClass="org.jboss.soa.esb.listeners.gateway.SecureFtpGateway" 
-		actionClass="org.jboss.soa.esb.actions.FtpDownloader" 
-		pollLatencySecs="30" 
-		maxThreads="1" 
-		inputDir="/logs" 
-		inputSuffix=".zip" 
-		workSuffix=".INPROC" 
-		errorDir="/" 
-		errorSuffix=".ERR" 
-		postDelete="true" 
-		ftpServer="ftp.xxx.xx" 
-		ftpUser="user" 
-		ftpPassword="password" 
-		ftpLocalDir="/home/dbrum/dev/beta1/fromFTP" ftpAscii="true">
-		ftpPassive="true"
-        </FtpDownloadTest>
-</JBossESB>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/SecureFtpTestConfig.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,18 @@
+<JBossESB parameterReloadSecs="120">
+	<FtpDownloadTest listenerClass="org.jboss.soa.esb.listeners.gateway.SecureFtpGateway" 
+		actionClass="org.jboss.soa.esb.actions.FtpDownloader" 
+		pollLatencySecs="30" 
+		maxThreads="1" 
+		inputDir="/logs" 
+		inputSuffix=".zip" 
+		workSuffix=".INPROC" 
+		errorDir="/" 
+		errorSuffix=".ERR" 
+		postDelete="true" 
+		ftpServer="ftp.xxx.xx" 
+		ftpUser="user" 
+		ftpPassword="password" 
+		ftpLocalDir="/home/dbrum/dev/beta1/fromFTP" ftpAscii="true">
+		ftpPassive="true"
+        </FtpDownloadTest>
+</JBossESB>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddableException.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddableException.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddableException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.internal.soa.esb.util.embedded;
-
-/**
- * 
- * @author Daniel Bevenius
- *
- */
-public class EmbeddableException extends Exception
-{
-
-    private static final long serialVersionUID = 1L;
-
-    public EmbeddableException()
-	{
-		super();
-	}
-
-	public EmbeddableException(String message, Throwable cause)
-	{
-		super( message, cause );
-	}
-
-	public EmbeddableException(String message)
-	{
-		super( message );
-	}
-
-	public EmbeddableException(Throwable cause)
-	{
-		super( cause );
-	}
-	
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddableException.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddableException.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddableException.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddableException.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.util.embedded;
+
+/**
+ * 
+ * @author Daniel Bevenius
+ *
+ */
+public class EmbeddableException extends Exception
+{
+
+    private static final long serialVersionUID = 1L;
+
+    public EmbeddableException()
+	{
+		super();
+	}
+
+	public EmbeddableException(String message, Throwable cause)
+	{
+		super( message, cause );
+	}
+
+	public EmbeddableException(String message)
+	{
+		super( message );
+	}
+
+	public EmbeddableException(Throwable cause)
+	{
+		super( cause );
+	}
+	
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddedServer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddedServer.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddedServer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,36 +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.internal.soa.esb.util.embedded;
-
-/**
- * Simply interface for different types of embedded servers
- * 
- * @author Daniel Bevenius
- *
- */
-public interface EmbeddedServer
-{
-	void start() throws EmbeddableException;
-	
-	void stop() throws EmbeddableException;
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddedServer.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddedServer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddedServer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/EmbeddedServer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,36 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.util.embedded;
+
+/**
+ * Simply interface for different types of embedded servers
+ * 
+ * @author Daniel Bevenius
+ *
+ */
+public interface EmbeddedServer
+{
+	void start() throws EmbeddableException;
+	
+	void stop() throws EmbeddableException;
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/EmbeddedFtpServer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/EmbeddedFtpServer.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/EmbeddedFtpServer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,133 +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.internal.soa.esb.util.embedded.ftp;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.util.Properties;
-
-import org.apache.ftpserver.ConfigurableFtpServerContext;
-import org.apache.ftpserver.FtpServer;
-import org.apache.ftpserver.config.PropertiesConfiguration;
-import org.apache.ftpserver.ftplet.Configuration;
-import org.apache.ftpserver.interfaces.FtpServerContext;
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.util.embedded.EmbeddableException;
-import org.jboss.internal.soa.esb.util.embedded.EmbeddedServer;
-
-/**
- * Class that can be used to test ftp functionality.
- * 
- * @author Daniel Bevenius
- *
- */
-public class EmbeddedFtpServer implements EmbeddedServer
-{
-	private static Logger log = Logger.getLogger(EmbeddedFtpServer.class);
-	
-	private Properties ftpProperties;
-	
-	private FtpServer server;
-	
-	public EmbeddedFtpServer()
-	{
-	}
-
-	/**
-	 * 
-	 * @param configFile	path to the ftpserver properties file used
-	 * 						to configure the ftpserver.
-	 */
-	public EmbeddedFtpServer( String configFile)
-	{
-		if (configFile == null)
-			throw new IllegalArgumentException("configFile must not be null");
-		
-		try
-		{
-			ftpProperties = getConfiguration( configFile ) ;
-		} 
-		catch (IOException e)
-		{
-			log.error( e );
-			throw new IllegalStateException ( "Could not configure the ftp server");
-		}
-	}
-	
-	public EmbeddedFtpServer( Properties ftpProperties )
-	{
-		this.ftpProperties = ftpProperties;
-	}
-	
-	
-	public void addProperties( Properties ftpProperties)
-	{
-		if ( this.ftpProperties == null )
-			this.ftpProperties = ftpProperties;
-		else
-			this.ftpProperties.putAll( ftpProperties );
-	}
-	
-	public void start() throws EmbeddableException 
-	{
-		try 
-		{
-			Configuration configuration = new PropertiesConfiguration( ftpProperties );
-			FtpServerContext context = new ConfigurableFtpServerContext( configuration );
-			server = new FtpServer( context );
-			server.start();
-		} 
-		catch (IOException e) 
-		{
-			log.error( e );
-			throw new EmbeddableException( e );
-		} 
-		catch (Exception e) 
-		{
-			log.error( e );
-			throw new EmbeddableException( e );
-		}
-	}
-	
-	public void stop() throws EmbeddableException  
-	{ 
-		server.stop();
-	}
-	
-	private static Properties getConfiguration( String configFile ) throws IOException
-	{
-		FileInputStream in = null;
-		try 
-		{
-			in = new FileInputStream( configFile );
-			Properties props = new Properties();
-			props.load( in );
-			return props;
-		} 
-		finally
-		{
-			if ( in != null )
-				in.close();
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/EmbeddedFtpServer.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/EmbeddedFtpServer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/EmbeddedFtpServer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/EmbeddedFtpServer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,133 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.util.embedded.ftp;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.util.Properties;
+
+import org.apache.ftpserver.ConfigurableFtpServerContext;
+import org.apache.ftpserver.FtpServer;
+import org.apache.ftpserver.config.PropertiesConfiguration;
+import org.apache.ftpserver.ftplet.Configuration;
+import org.apache.ftpserver.interfaces.FtpServerContext;
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.embedded.EmbeddableException;
+import org.jboss.internal.soa.esb.util.embedded.EmbeddedServer;
+
+/**
+ * Class that can be used to test ftp functionality.
+ * 
+ * @author Daniel Bevenius
+ *
+ */
+public class EmbeddedFtpServer implements EmbeddedServer
+{
+	private static Logger log = Logger.getLogger(EmbeddedFtpServer.class);
+	
+	private Properties ftpProperties;
+	
+	private FtpServer server;
+	
+	public EmbeddedFtpServer()
+	{
+	}
+
+	/**
+	 * 
+	 * @param configFile	path to the ftpserver properties file used
+	 * 						to configure the ftpserver.
+	 */
+	public EmbeddedFtpServer( String configFile)
+	{
+		if (configFile == null)
+			throw new IllegalArgumentException("configFile must not be null");
+		
+		try
+		{
+			ftpProperties = getConfiguration( configFile ) ;
+		} 
+		catch (IOException e)
+		{
+			log.error( e );
+			throw new IllegalStateException ( "Could not configure the ftp server");
+		}
+	}
+	
+	public EmbeddedFtpServer( Properties ftpProperties )
+	{
+		this.ftpProperties = ftpProperties;
+	}
+	
+	
+	public void addProperties( Properties ftpProperties)
+	{
+		if ( this.ftpProperties == null )
+			this.ftpProperties = ftpProperties;
+		else
+			this.ftpProperties.putAll( ftpProperties );
+	}
+	
+	public void start() throws EmbeddableException 
+	{
+		try 
+		{
+			Configuration configuration = new PropertiesConfiguration( ftpProperties );
+			FtpServerContext context = new ConfigurableFtpServerContext( configuration );
+			server = new FtpServer( context );
+			server.start();
+		} 
+		catch (IOException e) 
+		{
+			log.error( e );
+			throw new EmbeddableException( e );
+		} 
+		catch (Exception e) 
+		{
+			log.error( e );
+			throw new EmbeddableException( e );
+		}
+	}
+	
+	public void stop() throws EmbeddableException  
+	{ 
+		server.stop();
+	}
+	
+	private static Properties getConfiguration( String configFile ) throws IOException
+	{
+		FileInputStream in = null;
+		try 
+		{
+			in = new FileInputStream( configFile );
+			Properties props = new Properties();
+			props.load( in );
+			return props;
+		} 
+		finally
+		{
+			if ( in != null )
+				in.close();
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/FtpTestUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/FtpTestUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/FtpTestUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,125 +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.internal.soa.esb.util.embedded.ftp;
-
-import java.io.Closeable;
-import java.io.File;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.util.Scanner;
-
-import org.apache.log4j.Logger;
-
-/**
- * Util methods created for embedded FTP server test
- * 
- * @author Daniel Bevenius
- *
- */
-public class FtpTestUtil
-{
-	private static Logger log = Logger.getLogger( FtpTestUtil.class );
-	
-	private FtpTestUtil() { }
-	
-	/**
-	 * Can be used to test the embedded ftp server 
-	 * with a local client.  Useful for debugging when you need to know
-	 * what a specific command does on the ftp server ( like CWD )
-	 * 
-	 * Add a call to this method in youre test method
-	 * and you can start a local ftp client that connects to the
-	 * embedded ftp server. 
-	 *
-	 */
-	public static void promptForQuit()
-	{
-		System.out.println( "Enter q to quit:" );
-		Scanner scanner = new Scanner( System.in );
-		scanner.hasNext( "q" );
-	}
-	
-	public static boolean deleteFile( File file )
-	{
-		if ( file != null && file.exists() )
-		{
-			return file.delete();
-		}
-		return true; 
-	}
-	
-	public static boolean deleteDir( File dir )
-	{
-		if ( dir.isDirectory() ) 
-		{
-            String[] filesInDir = dir.list();
-            for ( String fileName : filesInDir )
-            {
-                if ( ! ( deleteDir( new File( dir, fileName ) ) ) ) 
-                    return false;
-            }
-		}
-		return dir.delete();
-	}
-	
-	public static File createTestFile( final File dir, final String fileName, final String fileContents )
-	{
-		return createTestFile( dir.getAbsolutePath() + File.separator + fileName, fileContents );
-	}
-
-	public static File createTestFile( final String fileName, String fileContents)
-	{
-		File testFile = new File ( fileName );
-		FileWriter writer = null;
-		try
-		{
-			testFile.createNewFile();
-			writer = new FileWriter( testFile );
-			writer.write( fileContents );
-		} 
-		catch (IOException e)
-		{
-			log.error ( e.getMessage() );
-		} 
-		finally
-		{
-			close( writer );
-		}
-		return testFile;
-	}
-	
-	public static void close( Closeable c )
-	{
-		if (c != null)
-		{
-			try
-			{
-				c.close();
-			} catch (IOException e)
-			{
-				log.warn( e );
-				/* ignore */
-			}
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/FtpTestUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/FtpTestUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/FtpTestUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/FtpTestUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,125 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.util.embedded.ftp;
+
+import java.io.Closeable;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.util.Scanner;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Util methods created for embedded FTP server test
+ * 
+ * @author Daniel Bevenius
+ *
+ */
+public class FtpTestUtil
+{
+	private static Logger log = Logger.getLogger( FtpTestUtil.class );
+	
+	private FtpTestUtil() { }
+	
+	/**
+	 * Can be used to test the embedded ftp server 
+	 * with a local client.  Useful for debugging when you need to know
+	 * what a specific command does on the ftp server ( like CWD )
+	 * 
+	 * Add a call to this method in youre test method
+	 * and you can start a local ftp client that connects to the
+	 * embedded ftp server. 
+	 *
+	 */
+	public static void promptForQuit()
+	{
+		System.out.println( "Enter q to quit:" );
+		Scanner scanner = new Scanner( System.in );
+		scanner.hasNext( "q" );
+	}
+	
+	public static boolean deleteFile( File file )
+	{
+		if ( file != null && file.exists() )
+		{
+			return file.delete();
+		}
+		return true; 
+	}
+	
+	public static boolean deleteDir( File dir )
+	{
+		if ( dir.isDirectory() ) 
+		{
+            String[] filesInDir = dir.list();
+            for ( String fileName : filesInDir )
+            {
+                if ( ! ( deleteDir( new File( dir, fileName ) ) ) ) 
+                    return false;
+            }
+		}
+		return dir.delete();
+	}
+	
+	public static File createTestFile( final File dir, final String fileName, final String fileContents )
+	{
+		return createTestFile( dir.getAbsolutePath() + File.separator + fileName, fileContents );
+	}
+
+	public static File createTestFile( final String fileName, String fileContents)
+	{
+		File testFile = new File ( fileName );
+		FileWriter writer = null;
+		try
+		{
+			testFile.createNewFile();
+			writer = new FileWriter( testFile );
+			writer.write( fileContents );
+		} 
+		catch (IOException e)
+		{
+			log.error ( e.getMessage() );
+		} 
+		finally
+		{
+			close( writer );
+		}
+		return testFile;
+	}
+	
+	public static void close( Closeable c )
+	{
+		if (c != null)
+		{
+			try
+			{
+				c.close();
+			} catch (IOException e)
+			{
+				log.warn( e );
+				/* ignore */
+			}
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/NoConfigFileFtpServer.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/NoConfigFileFtpServer.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/NoConfigFileFtpServer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,332 +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.internal.soa.esb.util.embedded.ftp;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.net.URL;
-import java.util.Properties;
-
-import org.apache.ftpserver.ftplet.Authority;
-import org.apache.ftpserver.ftplet.FtpException;
-import org.apache.ftpserver.listener.io.IOListener;
-import org.apache.ftpserver.usermanager.BaseUser;
-import org.apache.ftpserver.usermanager.PropertiesUserManager;
-import org.apache.ftpserver.usermanager.WritePermission;
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.util.embedded.EmbeddableException;
-
-/**
- * This class extends EmbeddedFtpServer and can be used without
- * having a configuration file for the ftp server.
- * 
- * By default this class will create and perform operations on the following directories:
- *	/tmp/ftpserver/home/
- *									input/
- *									upload/
- *									error/
- *
- *
- *	The default host is localhost and the default port is 21.
- *	But this can be changed by calling any of the setters before calling start.
- *	
- *	Usage:
- *	NoConfigFileFtpServer ftpServer = new NoConfigFileFtpServer();
- *	ftpServer.setPort( 2221 ) ;
- *	ftpServer.start();
- * ...
- * ftpServer.stop();
- * 
- * @author Daniel Bevenius
- *
- */
-public class NoConfigFileFtpServer extends EmbeddedFtpServer
-{
-	private Logger log = Logger.getLogger( NoConfigFileFtpServer.class );
-	
-	/* root dir for ftp server */
-	private String rootDir = System.getProperty( "java.io.tmpdir" );
-	
-	/* name of the server directory. This will be created directly below the rootDir */
-	private String serverDirName = "ftpserver";
-	private File ftpServerDir;
-	
-	/* name of the user home dir. This will be created directly below the ftpServerDir */
-	private String homeDirName = "home";
-	private File ftpHomeDir;
-	
-	/* File that point to the local input directory.  */
-	private String inputDirName = "input";
-	private String remoteInputDir = "/input";
-	private File localInputDir;
-	
-	/* File that point to the local upload directory.  */
-	private String uploadDirName = "upload";
-	private File localUploadDir;
-	
-	/* File that point to the local error directory.  */
-	private String errorDirName = "error";
-	private File localErrorDir;
-	
-	/* this file is created by the FTP server. Will be named rootDir/ftpServerDir/user.properties */
-	private String userPropertiesFileName = "user.properties";
-	private File ftpUserPropertiesFile;
-	
-	/* ftp connection settings */
-	private String host = "localhost";
-	private int port = 21;
-	private String userName = "anonymous";
-	private String password = "letMeIn";
-	
-	public void start() throws EmbeddableException
-	{
-		createDirs();
-		addProperties( getDefaultProperties() );
-		createUsers();
-		super.start();
-	}
-
-	protected void createUsers()
-	{
-		try
-		{
-			PropertiesUserManager propertiesUserManager = new PropertiesUserManager();
-			propertiesUserManager.setPropFile(  ftpUserPropertiesFile );
-			BaseUser ftpUser = new BaseUser();
-			ftpUser.setName( userName );
-			ftpUser.setPassword( password );
-			ftpUser.setHomeDirectory( ftpHomeDir.getAbsolutePath() );
-			Authority[] auths = { new WritePermission() };
-			ftpUser.setAuthorities( auths );
-	        ftpUser.setEnabled(  true );
-	        propertiesUserManager.configure();
-			propertiesUserManager.save( ftpUser );
-			
-			BaseUser adminUser = new BaseUser();
-			adminUser.setName( "admin" );
-			adminUser.setHomeDirectory( ftpHomeDir.getAbsolutePath() );
-			propertiesUserManager.save( adminUser );
-		} 
-		catch (FtpException e)
-		{
-			log.error( e );
-		}
-	}
-
-	protected Properties getDefaultProperties()
-	{
-		Properties properties = new Properties();
-        properties.setProperty("config.listeners.default.port", Integer.toString( port ) );
-        properties.setProperty("config.listeners.default.class", IOListener.class.getName() );
-        properties.setProperty("config.connection-manager.anonymous-login-enabled", "true");
-        properties.setProperty("config.user-manager.prop-file", ftpUserPropertiesFile.getAbsolutePath() );
-		return properties;
-	}
-
-	protected void createDirs()
-	{
-			ftpServerDir = new File ( rootDir + File.separator + serverDirName );
-			if ( ftpServerDir.exists() )
-				ftpServerDir.delete();
-			
-			ftpServerDir.mkdirs();
-	        ftpUserPropertiesFile = new File ( ftpServerDir.getAbsolutePath() + File.separator + userPropertiesFileName);
-			
-			ftpHomeDir = new File(  ftpServerDir, homeDirName );
-			ftpHomeDir.mkdirs();
-			
-			localInputDir = new File( ftpHomeDir,  inputDirName );
-			localInputDir.mkdir();
-			
-			localUploadDir = new File( ftpHomeDir,  uploadDirName);
-			localUploadDir.mkdir();
-			
-			localErrorDir = new File( ftpHomeDir,  errorDirName);
-			localErrorDir.mkdir();
-	}
-
-	public  File getFtpServerDir()
-	{
-		return ftpServerDir;
-	}
-
-	public  void setFtpServerDir( File ftpServerDir )
-	{
-		this.ftpServerDir = ftpServerDir;
-	}
-
-	public  File getFtpHomeDir()
-	{
-		return ftpHomeDir;
-	}
-
-	public void setFtpHomeDir( File ftpHomeDir )
-	{
-		this.ftpHomeDir = ftpHomeDir;
-	}
-
-	public  File getFtpPropertiesFile()
-	{
-		return ftpUserPropertiesFile;
-	}
-
-	public void setFtpPropertiesFile( File ftpPropertiesFile )
-	{
-		this.ftpUserPropertiesFile = ftpPropertiesFile;
-	}
-
-	public int getPort()
-	{
-		return port;
-	}
-
-	public void setPort( int port )
-	{
-		this.port = port;
-	}
-
-	public File getLocalInputDir()
-	{
-		return localInputDir;
-	}
-
-	public void setLocalInputDir( File localInputDir )
-	{
-		this.localInputDir = localInputDir;
-	}
-
-	public File getLocalUploadDir()
-	{
-		return localUploadDir;
-	}
-
-	public void setLocalUploadDir( File localUploadDir )
-	{
-		this.localUploadDir = localUploadDir;
-	}
-
-	public String getHost()
-	{
-		return host;
-	}
-
-	public void setHost( String host )
-	{
-		this.host = host;
-	}
-
-	public String getRootDir()
-	{
-		return rootDir;
-	}
-
-	public void setRootDir( String rootDir )
-	{
-		this.rootDir = rootDir;
-	}
-
-	public String getUserName()
-	{
-		return userName;
-	}
-
-	public void setUserName( String userName )
-	{
-		this.userName = userName;
-	}
-
-	public String getPassword()
-	{
-		return password;
-	}
-
-	public void setPassword( String password )
-	{
-		this.password = password;
-	}
-
-	public URL getURL() throws MalformedURLException
-	{
-		return new URL ( "ftp://" + userName + ":" + password + "@" + host + ":" + port + "/" + remoteInputDir );
-	}
-
-	public String getServerDirName()
-	{
-		return serverDirName;
-	}
-
-	public void setServerDirName( String serverDirName )
-	{
-		this.serverDirName = serverDirName;
-	}
-
-	public String getHomeDirName()
-	{
-		return homeDirName;
-	}
-
-	public void setHomeDirName( String homeDirName )
-	{
-		this.homeDirName = homeDirName;
-	}
-
-	public String getInputDirName()
-	{
-		return inputDirName;
-	}
-
-	public void setInputDirName( String inputDirName )
-	{
-		this.inputDirName = inputDirName;
-	}
-
-	public String getUploadDirName()
-	{
-		return uploadDirName;
-	}
-
-	public void setUploadDirName( String uploadDirName )
-	{
-		this.uploadDirName = uploadDirName;
-	}
-
-	public String getErrorDirName()
-	{
-		return errorDirName;
-	}
-
-	public void setErrorDirName( String errorDirName )
-	{
-		this.errorDirName = errorDirName;
-	}
-
-	public File getLocalErrorDir()
-	{
-		return localErrorDir;
-	}
-
-	public void setLocalErrorDir( File localErrorDir )
-	{
-		this.localErrorDir = localErrorDir;
-	}
-		
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/NoConfigFileFtpServer.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/NoConfigFileFtpServer.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/NoConfigFileFtpServer.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/internal/soa/esb/util/embedded/ftp/NoConfigFileFtpServer.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,332 @@
+/*
+ * JBoss, Home of Professional Open Source Copyright 2006, JBoss Inc., and
+ * individual contributors as indicated by the @authors tag. See the
+ * copyright.txt in the distribution for a full listing of individual
+ * contributors.
+ * 
+ * This is free software; you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free
+ * Software Foundation; either version 2.1 of the License, or (at your option)
+ * any later version.
+ * 
+ * This software is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
+ * details.
+ * 
+ * You should have received a copy of the GNU Lesser General Public License
+ * along with this software; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA, or see the FSF
+ * site: http://www.fsf.org.
+ */
+package org.jboss.internal.soa.esb.util.embedded.ftp;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.util.Properties;
+
+import org.apache.ftpserver.ftplet.Authority;
+import org.apache.ftpserver.ftplet.FtpException;
+import org.apache.ftpserver.listener.io.IOListener;
+import org.apache.ftpserver.usermanager.BaseUser;
+import org.apache.ftpserver.usermanager.PropertiesUserManager;
+import org.apache.ftpserver.usermanager.WritePermission;
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.embedded.EmbeddableException;
+
+/**
+ * This class extends EmbeddedFtpServer and can be used without
+ * having a configuration file for the ftp server.
+ * 
+ * By default this class will create and perform operations on the following directories:
+ *	/tmp/ftpserver/home/
+ *									input/
+ *									upload/
+ *									error/
+ *
+ *
+ *	The default host is localhost and the default port is 21.
+ *	But this can be changed by calling any of the setters before calling start.
+ *	
+ *	Usage:
+ *	NoConfigFileFtpServer ftpServer = new NoConfigFileFtpServer();
+ *	ftpServer.setPort( 2221 ) ;
+ *	ftpServer.start();
+ * ...
+ * ftpServer.stop();
+ * 
+ * @author Daniel Bevenius
+ *
+ */
+public class NoConfigFileFtpServer extends EmbeddedFtpServer
+{
+	private Logger log = Logger.getLogger( NoConfigFileFtpServer.class );
+	
+	/* root dir for ftp server */
+	private String rootDir = System.getProperty( "java.io.tmpdir" );
+	
+	/* name of the server directory. This will be created directly below the rootDir */
+	private String serverDirName = "ftpserver";
+	private File ftpServerDir;
+	
+	/* name of the user home dir. This will be created directly below the ftpServerDir */
+	private String homeDirName = "home";
+	private File ftpHomeDir;
+	
+	/* File that point to the local input directory.  */
+	private String inputDirName = "input";
+	private String remoteInputDir = "/input";
+	private File localInputDir;
+	
+	/* File that point to the local upload directory.  */
+	private String uploadDirName = "upload";
+	private File localUploadDir;
+	
+	/* File that point to the local error directory.  */
+	private String errorDirName = "error";
+	private File localErrorDir;
+	
+	/* this file is created by the FTP server. Will be named rootDir/ftpServerDir/user.properties */
+	private String userPropertiesFileName = "user.properties";
+	private File ftpUserPropertiesFile;
+	
+	/* ftp connection settings */
+	private String host = "localhost";
+	private int port = 21;
+	private String userName = "anonymous";
+	private String password = "letMeIn";
+	
+	public void start() throws EmbeddableException
+	{
+		createDirs();
+		addProperties( getDefaultProperties() );
+		createUsers();
+		super.start();
+	}
+
+	protected void createUsers()
+	{
+		try
+		{
+			PropertiesUserManager propertiesUserManager = new PropertiesUserManager();
+			propertiesUserManager.setPropFile(  ftpUserPropertiesFile );
+			BaseUser ftpUser = new BaseUser();
+			ftpUser.setName( userName );
+			ftpUser.setPassword( password );
+			ftpUser.setHomeDirectory( ftpHomeDir.getAbsolutePath() );
+			Authority[] auths = { new WritePermission() };
+			ftpUser.setAuthorities( auths );
+	        ftpUser.setEnabled(  true );
+	        propertiesUserManager.configure();
+			propertiesUserManager.save( ftpUser );
+			
+			BaseUser adminUser = new BaseUser();
+			adminUser.setName( "admin" );
+			adminUser.setHomeDirectory( ftpHomeDir.getAbsolutePath() );
+			propertiesUserManager.save( adminUser );
+		} 
+		catch (FtpException e)
+		{
+			log.error( e );
+		}
+	}
+
+	protected Properties getDefaultProperties()
+	{
+		Properties properties = new Properties();
+        properties.setProperty("config.listeners.default.port", Integer.toString( port ) );
+        properties.setProperty("config.listeners.default.class", IOListener.class.getName() );
+        properties.setProperty("config.connection-manager.anonymous-login-enabled", "true");
+        properties.setProperty("config.user-manager.prop-file", ftpUserPropertiesFile.getAbsolutePath() );
+		return properties;
+	}
+
+	protected void createDirs()
+	{
+			ftpServerDir = new File ( rootDir + File.separator + serverDirName );
+			if ( ftpServerDir.exists() )
+				ftpServerDir.delete();
+			
+			ftpServerDir.mkdirs();
+	        ftpUserPropertiesFile = new File ( ftpServerDir.getAbsolutePath() + File.separator + userPropertiesFileName);
+			
+			ftpHomeDir = new File(  ftpServerDir, homeDirName );
+			ftpHomeDir.mkdirs();
+			
+			localInputDir = new File( ftpHomeDir,  inputDirName );
+			localInputDir.mkdir();
+			
+			localUploadDir = new File( ftpHomeDir,  uploadDirName);
+			localUploadDir.mkdir();
+			
+			localErrorDir = new File( ftpHomeDir,  errorDirName);
+			localErrorDir.mkdir();
+	}
+
+	public  File getFtpServerDir()
+	{
+		return ftpServerDir;
+	}
+
+	public  void setFtpServerDir( File ftpServerDir )
+	{
+		this.ftpServerDir = ftpServerDir;
+	}
+
+	public  File getFtpHomeDir()
+	{
+		return ftpHomeDir;
+	}
+
+	public void setFtpHomeDir( File ftpHomeDir )
+	{
+		this.ftpHomeDir = ftpHomeDir;
+	}
+
+	public  File getFtpPropertiesFile()
+	{
+		return ftpUserPropertiesFile;
+	}
+
+	public void setFtpPropertiesFile( File ftpPropertiesFile )
+	{
+		this.ftpUserPropertiesFile = ftpPropertiesFile;
+	}
+
+	public int getPort()
+	{
+		return port;
+	}
+
+	public void setPort( int port )
+	{
+		this.port = port;
+	}
+
+	public File getLocalInputDir()
+	{
+		return localInputDir;
+	}
+
+	public void setLocalInputDir( File localInputDir )
+	{
+		this.localInputDir = localInputDir;
+	}
+
+	public File getLocalUploadDir()
+	{
+		return localUploadDir;
+	}
+
+	public void setLocalUploadDir( File localUploadDir )
+	{
+		this.localUploadDir = localUploadDir;
+	}
+
+	public String getHost()
+	{
+		return host;
+	}
+
+	public void setHost( String host )
+	{
+		this.host = host;
+	}
+
+	public String getRootDir()
+	{
+		return rootDir;
+	}
+
+	public void setRootDir( String rootDir )
+	{
+		this.rootDir = rootDir;
+	}
+
+	public String getUserName()
+	{
+		return userName;
+	}
+
+	public void setUserName( String userName )
+	{
+		this.userName = userName;
+	}
+
+	public String getPassword()
+	{
+		return password;
+	}
+
+	public void setPassword( String password )
+	{
+		this.password = password;
+	}
+
+	public URL getURL() throws MalformedURLException
+	{
+		return new URL ( "ftp://" + userName + ":" + password + "@" + host + ":" + port + "/" + remoteInputDir );
+	}
+
+	public String getServerDirName()
+	{
+		return serverDirName;
+	}
+
+	public void setServerDirName( String serverDirName )
+	{
+		this.serverDirName = serverDirName;
+	}
+
+	public String getHomeDirName()
+	{
+		return homeDirName;
+	}
+
+	public void setHomeDirName( String homeDirName )
+	{
+		this.homeDirName = homeDirName;
+	}
+
+	public String getInputDirName()
+	{
+		return inputDirName;
+	}
+
+	public void setInputDirName( String inputDirName )
+	{
+		this.inputDirName = inputDirName;
+	}
+
+	public String getUploadDirName()
+	{
+		return uploadDirName;
+	}
+
+	public void setUploadDirName( String uploadDirName )
+	{
+		this.uploadDirName = uploadDirName;
+	}
+
+	public String getErrorDirName()
+	{
+		return errorDirName;
+	}
+
+	public void setErrorDirName( String errorDirName )
+	{
+		this.errorDirName = errorDirName;
+	}
+
+	public File getLocalErrorDir()
+	{
+		return localErrorDir;
+	}
+
+	public void setLocalErrorDir( File localErrorDir )
+	{
+		this.localErrorDir = localErrorDir;
+	}
+		
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/StreamUtils.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/StreamUtils.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/StreamUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,60 +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;
-
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-
-/**
- * Stream handling utilities for testing.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class StreamUtils {
-	private static Logger log = Logger.getLogger( StreamUtils.class );
-
-	/**
-	 * Read the supplied InputStream and return as an array of bytes.
-	 * @param stream The stream to read.
-	 * @return The stream contents in an array of bytes.
-	 */
-	public static byte[] readStream(InputStream stream) {
-		ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
-		byte[] buffer = new byte[256];
-		int readCount = 0;
-		
-		try {
-			while((readCount = stream.read(buffer)) != -1) {
-				outBuffer.write(buffer, 0, readCount);
-			}
-		} catch (IOException e) {
-			log.error(e);
-			TestCase.fail("Error reading input stream - See above stack trace.");
-		}		
-		
-		return outBuffer.toByteArray();
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/StreamUtils.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/StreamUtils.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/StreamUtils.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/StreamUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,60 @@
+/*
+ * 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;
+
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+
+/**
+ * Stream handling utilities for testing.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class StreamUtils {
+	private static Logger log = Logger.getLogger( StreamUtils.class );
+
+	/**
+	 * Read the supplied InputStream and return as an array of bytes.
+	 * @param stream The stream to read.
+	 * @return The stream contents in an array of bytes.
+	 */
+	public static byte[] readStream(InputStream stream) {
+		ByteArrayOutputStream outBuffer = new ByteArrayOutputStream();
+		byte[] buffer = new byte[256];
+		int readCount = 0;
+		
+		try {
+			while((readCount = stream.read(buffer)) != -1) {
+				outBuffer.write(buffer, 0, readCount);
+			}
+		} catch (IOException e) {
+			log.error(e);
+			TestCase.fail("Error reading input stream - See above stack trace.");
+		}		
+		
+		return outBuffer.toByteArray();
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/W3CDomUtils.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/W3CDomUtils.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/W3CDomUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,37 +0,0 @@
-package org.jboss.soa.esb;
-
-import java.io.ByteArrayOutputStream;
-
-import javax.xml.transform.OutputKeys;
-import javax.xml.transform.Transformer;
-import javax.xml.transform.TransformerFactory;
-import javax.xml.transform.dom.DOMSource;
-import javax.xml.transform.stream.StreamResult;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.w3c.dom.Document;
-
-public abstract class W3CDomUtils {
-	private static Logger log = Logger.getLogger( W3CDomUtils.class );
-
-	public static String serialize(Document document) {
-		DOMSource src = new DOMSource(document);
-
-		ByteArrayOutputStream byteBuf = new ByteArrayOutputStream(5000);
-		StreamResult res = new StreamResult(byteBuf);
-
-		try {
-			Transformer transformer = TransformerFactory.newInstance().newTransformer();
-			transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
-			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
-			transformer.transform(src, res);
-		} catch (Exception e) {
-			log.error(e);
-			TestCase.fail("Failed to serialise doc.  See above stack trace.");
-		}
-		
-		return byteBuf.toString();
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/W3CDomUtils.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/W3CDomUtils.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/W3CDomUtils.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/W3CDomUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,37 @@
+package org.jboss.soa.esb;
+
+import java.io.ByteArrayOutputStream;
+
+import javax.xml.transform.OutputKeys;
+import javax.xml.transform.Transformer;
+import javax.xml.transform.TransformerFactory;
+import javax.xml.transform.dom.DOMSource;
+import javax.xml.transform.stream.StreamResult;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.w3c.dom.Document;
+
+public abstract class W3CDomUtils {
+	private static Logger log = Logger.getLogger( W3CDomUtils.class );
+
+	public static String serialize(Document document) {
+		DOMSource src = new DOMSource(document);
+
+		ByteArrayOutputStream byteBuf = new ByteArrayOutputStream(5000);
+		StreamResult res = new StreamResult(byteBuf);
+
+		try {
+			Transformer transformer = TransformerFactory.newInstance().newTransformer();
+			transformer.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
+			transformer.setOutputProperty(OutputKeys.INDENT, "yes");
+			transformer.transform(src, res);
+		} catch (Exception e) {
+			log.error(e);
+			TestCase.fail("Failed to serialise doc.  See above stack trace.");
+		}
+		
+		return byteBuf.toString();
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,188 +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.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.helpers.ConfigTree;
-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.notification.NotificationList;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-import org.xml.sax.SAXException;
-
-
-/**
- * Unit tests for the ActionUtils class.
- *
- * @author <a href="mailto:jplenhart at yahoo.com">jplenhart at yahoo.com</a>
- */
-
-public class ActionUtilsUnitTest extends BaseTest
-{
-    private static final String CURRENT_OBJECT = "org.jboss.soa.esb.actions.current.after";
-    private Logger logger = Logger.getLogger(this.getClass());
-
-
-    /**
-     * Testing the Utility to get the Task
-     * before Object
-     */
-    public void testGetTaskBeforeObject()
-    {
-        Message msg1 = MessageFactory.getInstance().getMessage(MessageType.DEFAULT_TYPE);
-        String anyText = "A bunch of text";
-        msg1.getBody().add(ActionUtils.BEFORE_ACTION, anyText.getBytes());
-
-        Object obj = ActionUtils.getTaskBeforeObject(msg1);
-        String anyTextAfter = new String((byte[]) obj);
-        assertTrue(anyText.equals(anyTextAfter));
-    }
-
-    /**
-     * Testing the Utility to get the Copy
-     * The current Message Body Object
-     * to the Previous
-     */
-    public void testCopyCurrentToPrevious()
-    {
-        String beforeAction = "before action";
-        String currentObject = "current action";
-
-        Message msg1 = MessageFactory.getInstance().getMessage(MessageType.DEFAULT_TYPE);
-        msg1.getBody().add(ActionUtils.BEFORE_ACTION, beforeAction.getBytes());
-        msg1.getBody().add(CURRENT_OBJECT, currentObject.getBytes());
-        ActionUtils.copyCurrentToPrevious(msg1);
-
-        // Both BEFORE_ACTION and CURRENT_OBJECT should be equal
-        Object objBeforeAction = msg1.getBody().get(ActionUtils.BEFORE_ACTION);
-        Object objCurrentObject = msg1.getBody().get(CURRENT_OBJECT);
-        assertEquals(objBeforeAction, objCurrentObject);
-    }
-
-    /**
-     * Convenience Method to Obtain a Stream
-     * To a Mock File
-     */
-    private InputStream getStream(String sName)
-    {
-        InputStream oRet = getClass().getResourceAsStream(sName);
-
-        if (null == oRet)
-        {
-            try
-            {
-                oRet = new FileInputStream(sName);
-            }
-            catch (IOException e)
-            {
-                /* OK  Just fall through */
-            }
-        }
-
-        return oRet;
-    }
-
-
-    /**
-     * Convenience Method to Build a ConfigTree from a File
-     */
-    private ConfigTree getConfigTreeFromInputStream(String fileName)
-            throws SAXException, IOException
-    {
-        String pathToFile = new StringBuilder()
-                .append(TestEnvironmentUtil.getUserDir("product"))
-                .append("rosetta/tests/src/org/jboss/soa/esb/actions/")
-                .append(fileName).toString();
-
-        logger.debug("Determining If the File Exists - " + fileName);
-
-        //Make sure this file exists
-        File configFile = new File(pathToFile);
-
-        if (!configFile.exists())
-        {
-            logger.error("File does not Exist - Failing the Test");
-            assertTrue(false);
-        }
-        else
-        {
-            logger.debug("Found the File");
-        }
-
-        ConfigTree confTree = ConfigTree.fromInputStream(getStream(pathToFile));
-
-        return confTree;
-    }
-
-
-    /**
-     * Testing the ActionUtils class to verify that the
-     * Correct NotifyList is returned based on a Mock ConfigTree
-     */
-    public void testGetNotifyList()
-    {
-        try
-        {
-            ConfigTree confTree =
-                    getConfigTreeFromInputStream("NotificationList_01.xml");
-            NotificationList list = ActionUtils.getNotifyList(confTree, "OK");
-
-            // Expecting a NotificationList Returned (If one is not returned we get Null)
-            assertNotNull(list);
-
-            //Since it is not Null -- Verify the content
-            assertEquals(1, list.getAllChildren().length);
-            assertEquals(
-                    "NotifyConsole",
-                    list.getFirstChild("target").getAttribute("class"));
-        }
-        catch (IOException _ioex)
-        {
-            logger.error("IOException: " + _ioex.getMessage());
-            assertTrue(false);
-        }
-        catch (SAXException _saxex)
-        {
-            logger.error("SAXException: " + _saxex.getMessage());
-            assertTrue(false);
-        }
-        catch (Exception _ex)
-        {
-            logger.error("Exception: " + _ex.getMessage());
-            assertTrue(false);
-        }
-    }
-
-    public static junit.framework.Test suite()
-    {
-        return new JUnit4TestAdapter(ActionUtilsUnitTest.class);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/ActionUtilsUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,188 @@
+/*
+ * 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.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.helpers.ConfigTree;
+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.notification.NotificationList;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+import org.xml.sax.SAXException;
+
+
+/**
+ * Unit tests for the ActionUtils class.
+ *
+ * @author <a href="mailto:jplenhart at yahoo.com">jplenhart at yahoo.com</a>
+ */
+
+public class ActionUtilsUnitTest extends BaseTest
+{
+    private static final String CURRENT_OBJECT = "org.jboss.soa.esb.actions.current.after";
+    private Logger logger = Logger.getLogger(this.getClass());
+
+
+    /**
+     * Testing the Utility to get the Task
+     * before Object
+     */
+    public void testGetTaskBeforeObject()
+    {
+        Message msg1 = MessageFactory.getInstance().getMessage(MessageType.DEFAULT_TYPE);
+        String anyText = "A bunch of text";
+        msg1.getBody().add(ActionUtils.BEFORE_ACTION, anyText.getBytes());
+
+        Object obj = ActionUtils.getTaskBeforeObject(msg1);
+        String anyTextAfter = new String((byte[]) obj);
+        assertTrue(anyText.equals(anyTextAfter));
+    }
+
+    /**
+     * Testing the Utility to get the Copy
+     * The current Message Body Object
+     * to the Previous
+     */
+    public void testCopyCurrentToPrevious()
+    {
+        String beforeAction = "before action";
+        String currentObject = "current action";
+
+        Message msg1 = MessageFactory.getInstance().getMessage(MessageType.DEFAULT_TYPE);
+        msg1.getBody().add(ActionUtils.BEFORE_ACTION, beforeAction.getBytes());
+        msg1.getBody().add(CURRENT_OBJECT, currentObject.getBytes());
+        ActionUtils.copyCurrentToPrevious(msg1);
+
+        // Both BEFORE_ACTION and CURRENT_OBJECT should be equal
+        Object objBeforeAction = msg1.getBody().get(ActionUtils.BEFORE_ACTION);
+        Object objCurrentObject = msg1.getBody().get(CURRENT_OBJECT);
+        assertEquals(objBeforeAction, objCurrentObject);
+    }
+
+    /**
+     * Convenience Method to Obtain a Stream
+     * To a Mock File
+     */
+    private InputStream getStream(String sName)
+    {
+        InputStream oRet = getClass().getResourceAsStream(sName);
+
+        if (null == oRet)
+        {
+            try
+            {
+                oRet = new FileInputStream(sName);
+            }
+            catch (IOException e)
+            {
+                /* OK  Just fall through */
+            }
+        }
+
+        return oRet;
+    }
+
+
+    /**
+     * Convenience Method to Build a ConfigTree from a File
+     */
+    private ConfigTree getConfigTreeFromInputStream(String fileName)
+            throws SAXException, IOException
+    {
+        String pathToFile = new StringBuilder()
+                .append(TestEnvironmentUtil.getUserDir("product"))
+                .append("rosetta/tests/src/org/jboss/soa/esb/actions/")
+                .append(fileName).toString();
+
+        logger.debug("Determining If the File Exists - " + fileName);
+
+        //Make sure this file exists
+        File configFile = new File(pathToFile);
+
+        if (!configFile.exists())
+        {
+            logger.error("File does not Exist - Failing the Test");
+            assertTrue(false);
+        }
+        else
+        {
+            logger.debug("Found the File");
+        }
+
+        ConfigTree confTree = ConfigTree.fromInputStream(getStream(pathToFile));
+
+        return confTree;
+    }
+
+
+    /**
+     * Testing the ActionUtils class to verify that the
+     * Correct NotifyList is returned based on a Mock ConfigTree
+     */
+    public void testGetNotifyList()
+    {
+        try
+        {
+            ConfigTree confTree =
+                    getConfigTreeFromInputStream("NotificationList_01.xml");
+            NotificationList list = ActionUtils.getNotifyList(confTree, "OK");
+
+            // Expecting a NotificationList Returned (If one is not returned we get Null)
+            assertNotNull(list);
+
+            //Since it is not Null -- Verify the content
+            assertEquals(1, list.getAllChildren().length);
+            assertEquals(
+                    "NotifyConsole",
+                    list.getFirstChild("target").getAttribute("class"));
+        }
+        catch (IOException _ioex)
+        {
+            logger.error("IOException: " + _ioex.getMessage());
+            assertTrue(false);
+        }
+        catch (SAXException _saxex)
+        {
+            logger.error("SAXException: " + _saxex.getMessage());
+            assertTrue(false);
+        }
+        catch (Exception _ex)
+        {
+            logger.error("Exception: " + _ex.getMessage());
+            assertTrue(false);
+        }
+    }
+
+    public static junit.framework.Test suite()
+    {
+        return new JUnit4TestAdapter(ActionUtilsUnitTest.class);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/MockPojoAction.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/MockPojoAction.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/MockPojoAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,77 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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;
-
-
-/**
- * Used to test pojo related functionality.
- * 
- * @author danielmarchant
- *
- */
-public class MockPojoAction {
-
-	public static MockPojo getMockPojo() {
-		return new MockPojoAction.MockPojo();
-	}
-	
-	public static class MockPojo {
-		public MockPojo() {
-			
-		}
-		public String name;
-		public String value;
-		public List<MockPojo> list;
-		
-		public String getName() {
-			return name;
-		}
-		public void setName(String name) {
-			this.name = name;
-		}
-		public String getValue() {
-			return value;
-		}
-		public void setValue(String value) {
-			this.value = value;
-		}
-		
-		public List<MockPojo> getList() {
-			return list;
-		}
-		
-		public void setList(List<MockPojo> listIn ){
-			list = listIn;
-		}
-		
-	}
-	
-	public String message = "WentThrough";
-	
-	public MockPojo doPojoAction(MockPojo pojo) {
-		pojo.setName(message);
-		return pojo;
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/MockPojoAction.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/MockPojoAction.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/MockPojoAction.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/MockPojoAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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;
+
+
+/**
+ * Used to test pojo related functionality.
+ * 
+ * @author danielmarchant
+ *
+ */
+public class MockPojoAction {
+
+	public static MockPojo getMockPojo() {
+		return new MockPojoAction.MockPojo();
+	}
+	
+	public static class MockPojo {
+		public MockPojo() {
+			
+		}
+		public String name;
+		public String value;
+		public List<MockPojo> list;
+		
+		public String getName() {
+			return name;
+		}
+		public void setName(String name) {
+			this.name = name;
+		}
+		public String getValue() {
+			return value;
+		}
+		public void setValue(String value) {
+			this.value = value;
+		}
+		
+		public List<MockPojo> getList() {
+			return list;
+		}
+		
+		public void setList(List<MockPojo> listIn ){
+			list = listIn;
+		}
+		
+	}
+	
+	public String message = "WentThrough";
+	
+	public MockPojo doPojoAction(MockPojo pojo) {
+		pojo.setName(message);
+		return pojo;
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/NotificationList_01.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/NotificationList_01.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/NotificationList_01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,6 +0,0 @@
-<action  class="org.jboss.soa.esb.actions.Notifier"  okMethod="notifyOK">
-	<NotificationList type="OK"> 
-		<target class="NotifyConsole" /> 
-	</NotificationList> 
-</action>
-	   

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/NotificationList_01.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/NotificationList_01.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/NotificationList_01.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/NotificationList_01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,6 @@
+<action  class="org.jboss.soa.esb.actions.Notifier"  okMethod="notifyOK">
+	<NotificationList type="OK"> 
+		<target class="NotifyConsole" /> 
+	</NotificationList> 
+</action>
+	   

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/TestBean.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/TestBean.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/TestBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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;
-
-/**
- * Just a simple test JavaBean class.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class TestBean implements java.io.Serializable 
-{
-	private static final long serialVersionUID = 1L;
-	private String name;
-    private String phone;
-
-    public TestBean() {
-    }
-    public TestBean(String name, String phone) {
-        this.name = name;
-        this.phone = phone;
-    }
-    
-    public String getName() {
-        return name;
-    }
-    public void setName(String name) {
-        this.name = name;
-    }
-    public String getPhone() {
-        return phone;
-    }
-    public void setPhone(String phone) {
-        this.phone = phone;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/TestBean.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/TestBean.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/TestBean.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/TestBean.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and individual contributors as indicated
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+package org.jboss.soa.esb.actions;
+
+/**
+ * Just a simple test JavaBean class.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class TestBean implements java.io.Serializable 
+{
+	private static final long serialVersionUID = 1L;
+	private String name;
+    private String phone;
+
+    public TestBean() {
+    }
+    public TestBean(String name, String phone) {
+        this.name = name;
+        this.phone = phone;
+    }
+    
+    public String getName() {
+        return name;
+    }
+    public void setName(String name) {
+        this.name = name;
+    }
+    public String getPhone() {
+        return phone;
+    }
+    public void setPhone(String phone) {
+        this.phone = phone;
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ByteArrayToStringUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ByteArrayToStringUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ByteArrayToStringUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,60 +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.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-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.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-/**
- * ByteArrayToString unit tests.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ByteArrayToStringUnitTest extends TestCase
-{
-
-	public void test() throws ActionProcessingException
-	{
-		List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
-
-		properties.add(new KeyValuePair("encoding", "UTF-8"));
-		ByteArrayToString byteArrayToString = new ByteArrayToString(
-				"actionName", properties);
-
-		String sTest = "TestString";
-		Message msg = MessageFactory.getInstance().getMessage();
-		ActionUtils.setTaskObject(msg,sTest.getBytes());
-		byteArrayToString.process(msg);
-		String decodedBytes = (String)ActionUtils.getTaskObject(msg);
-		assertEquals(sTest, decodedBytes);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ByteArrayToStringUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ByteArrayToStringUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ByteArrayToStringUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ByteArrayToStringUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,60 @@
+/*
+ * 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.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+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.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+/**
+ * ByteArrayToString unit tests.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class ByteArrayToStringUnitTest extends TestCase
+{
+
+	public void test() throws ActionProcessingException
+	{
+		List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+
+		properties.add(new KeyValuePair("encoding", "UTF-8"));
+		ByteArrayToString byteArrayToString = new ByteArrayToString(
+				"actionName", properties);
+
+		String sTest = "TestString";
+		Message msg = MessageFactory.getInstance().getMessage();
+		ActionUtils.setTaskObject(msg,sTest.getBytes());
+		byteArrayToString.process(msg);
+		String decodedBytes = (String)ActionUtils.getTaskObject(msg);
+		assertEquals(sTest, decodedBytes);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/LongToDateConverter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/LongToDateConverter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/LongToDateConverter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,63 +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.util.Date;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * LongToDate Converter Test Action Handler.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class LongToDateConverter extends AbstractActionPipelineProcessor
-{
-	private Logger log = Logger.getLogger( LongToDateConverter.class );
-
-	/*
-	 * (non-Javadoc)
-	 * 
-	 * @see org.jboss.soa.esb.actions.ActionProcessor#processAction(java.lang.Object)
-	 */
-	public Message process(Message message) throws ActionProcessingException
-	{
-		Object oCurr = ActionUtils.getTaskObject(message);
-		if (!(oCurr instanceof Long))
-		{
-			throw new ActionProcessingException(
-					"This action handler only accepts Long object instances.");
-		}
-		log.debug("LongToDateConverter");
-
-        try { ActionUtils.setTaskObject(message,new Date((Long)oCurr)); }
-        catch (Exception e)
-        { throw new ActionProcessingException(e); }
-        return message;
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/LongToDateConverter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/LongToDateConverter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/LongToDateConverter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/LongToDateConverter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,63 @@
+/*
+ * 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.util.Date;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * LongToDate Converter Test Action Handler.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class LongToDateConverter extends AbstractActionPipelineProcessor
+{
+	private Logger log = Logger.getLogger( LongToDateConverter.class );
+
+	/*
+	 * (non-Javadoc)
+	 * 
+	 * @see org.jboss.soa.esb.actions.ActionProcessor#processAction(java.lang.Object)
+	 */
+	public Message process(Message message) throws ActionProcessingException
+	{
+		Object oCurr = ActionUtils.getTaskObject(message);
+		if (!(oCurr instanceof Long))
+		{
+			throw new ActionProcessingException(
+					"This action handler only accepts Long object instances.");
+		}
+		log.debug("LongToDateConverter");
+
+        try { ActionUtils.setTaskObject(message,new Date((Long)oCurr)); }
+        catch (Exception e)
+        { throw new ActionProcessingException(e); }
+        return message;
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectInvokeTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectInvokeTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectInvokeTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,93 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005, 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.util.ArrayList;
-import java.util.List;
-
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.actions.MockPojoAction;
-import org.jboss.soa.esb.actions.MockPojoAction.MockPojo;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.junit.Assert;
-import org.junit.Test;
-
-
-/**
- * 
- * @author danielmarchant
- *
- */
-public class ObjectInvokeTest {
-
-	@Test
-	public void testObjectInvoke() throws Exception {
-		
-	     MockPojo pojoObj = new MockPojo();
-	     pojoObj.name="Hello";
-	     String name = pojoObj.name;
-
-         MockPojoAction.MockPojo pojo = ( MockPojoAction.MockPojo ) test_invoke(MockPojoAction.class.getName(), "doPojoAction", pojoObj);
-		
-	     Assert.assertNotNull(pojo.name);
-	     Assert.assertNotSame(" Process didn't work " , name,pojo.name);
-	}
-	
-    //@Test
-    public void test_unknownProcesor() throws Exception {
-        test_invoke("com.acme.UnknownProcessor", "doPojoAction", new MockPojo());
-        // Expected a ConfigurationException of some sort here!!
-    }
-
-    // @Test
-    public void test_invalidMethodName() throws Exception {
-        test_invoke(MockPojoAction.class.getName(), "goPojoAction", new MockPojo());
-    }
-
-    @Test
-    public void test_invalidProcessorParamType() throws Exception {
-        try {
-            test_invoke(MockPojoAction.class.getName(), "doPojoAction", new String(""));
-            Assert.fail("Expected ActionProcessingException");
-        } catch(ActionProcessingException e) {
-            Assert.assertEquals("Invalid arguments for class-processor [ org.jboss.soa.esb.actions.MockPojoAction] for Action Processor: ObjectInvoke", e.getMessage());
-        }
-    }
-
-    private Object test_invoke(String className, String methodName, Object param) throws ActionProcessingException {
-        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
-        properties.add(new KeyValuePair("class-processor", className));
-        properties.add(new KeyValuePair("class-method", methodName));
-
-        Message oMsg = MessageFactory.getInstance().getMessage();
-        ActionUtils.setTaskObject(oMsg, param);
-
-        ObjectInvoke objectInvoke = new ObjectInvoke("ObjectInvoke",properties);
-        objectInvoke.process(oMsg);
-
-        return ActionUtils.getTaskObject(oMsg);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectInvokeTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectInvokeTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectInvokeTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectInvokeTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,93 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005, 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.util.ArrayList;
+import java.util.List;
+
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.actions.MockPojoAction;
+import org.jboss.soa.esb.actions.MockPojoAction.MockPojo;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.junit.Assert;
+import org.junit.Test;
+
+
+/**
+ * 
+ * @author danielmarchant
+ *
+ */
+public class ObjectInvokeTest {
+
+	@Test
+	public void testObjectInvoke() throws Exception {
+		
+	     MockPojo pojoObj = new MockPojo();
+	     pojoObj.name="Hello";
+	     String name = pojoObj.name;
+
+         MockPojoAction.MockPojo pojo = ( MockPojoAction.MockPojo ) test_invoke(MockPojoAction.class.getName(), "doPojoAction", pojoObj);
+		
+	     Assert.assertNotNull(pojo.name);
+	     Assert.assertNotSame(" Process didn't work " , name,pojo.name);
+	}
+	
+    //@Test
+    public void test_unknownProcesor() throws Exception {
+        test_invoke("com.acme.UnknownProcessor", "doPojoAction", new MockPojo());
+        // Expected a ConfigurationException of some sort here!!
+    }
+
+    // @Test
+    public void test_invalidMethodName() throws Exception {
+        test_invoke(MockPojoAction.class.getName(), "goPojoAction", new MockPojo());
+    }
+
+    @Test
+    public void test_invalidProcessorParamType() throws Exception {
+        try {
+            test_invoke(MockPojoAction.class.getName(), "doPojoAction", new String(""));
+            Assert.fail("Expected ActionProcessingException");
+        } catch(ActionProcessingException e) {
+            Assert.assertEquals("Invalid arguments for class-processor [ org.jboss.soa.esb.actions.MockPojoAction] for Action Processor: ObjectInvoke", e.getMessage());
+        }
+    }
+
+    private Object test_invoke(String className, String methodName, Object param) throws ActionProcessingException {
+        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+        properties.add(new KeyValuePair("class-processor", className));
+        properties.add(new KeyValuePair("class-method", methodName));
+
+        Message oMsg = MessageFactory.getInstance().getMessage();
+        ActionUtils.setTaskObject(oMsg, param);
+
+        ObjectInvoke objectInvoke = new ObjectInvoke("ObjectInvoke",properties);
+        objectInvoke.process(oMsg);
+
+        return ActionUtils.getTaskObject(oMsg);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToCSVStringUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToCSVStringUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToCSVStringUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,113 +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.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-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.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-/**
- * ObjectToCSVString unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ObjectToCSVStringUnitTest extends TestCase {
-	
-	private Logger log = Logger.getLogger( ObjectToCSVStringUnitTest.class );
-
-    public void test() throws ConfigurationException, ActionProcessingException {
-        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
-        Message oMsg = MessageFactory.getInstance().getMessage();
-        
-        // Single value - property exist on bean...
-        properties.add(new KeyValuePair(ObjectToCSVString.BEAN_PROPERTIES_PROP, "name"));
-        ObjectToCSVString processor = new ObjectToCSVString("ObjectToCSVString", properties);
-        
-		ActionUtils.setTaskObject(oMsg,new TestBean());
-        oMsg = processor.process(oMsg);
-        assertEquals("Tom Fennelly", ActionUtils.getTaskObject(oMsg));
-
-        // Multi value - properties all exist on bean...
-        properties.clear();
-        properties.add(new KeyValuePair(ObjectToCSVString.BEAN_PROPERTIES_PROP, "name,age"));
-        processor = new ObjectToCSVString("ObjectToCSVString", properties);
-        ActionUtils.setTaskObject(oMsg,new TestBean());
-        processor.process(oMsg);
-        assertEquals("Tom Fennelly,21", ActionUtils.getTaskObject(oMsg));
-
-        // Multi value - some properties exist on bean and some don't...
-        properties.clear();
-        properties.add(new KeyValuePair(ObjectToCSVString.BEAN_PROPERTIES_PROP, "id,name,phone,age"));
-        processor = new ObjectToCSVString("ObjectToCSVString", properties);
-        ActionUtils.setTaskObject(oMsg,new TestBean());
-        log.warn( "The following two error messages are intentional" );
-        processor.process(oMsg);
-        assertEquals("<no-such-property>,Tom Fennelly,<no-such-property>,21", ActionUtils.getTaskObject(oMsg));
-
-        // Single value - property doesn't exist on bean...
-        properties.clear();
-        properties.add(new KeyValuePair(ObjectToCSVString.BEAN_PROPERTIES_PROP, "id"));
-        processor = new ObjectToCSVString("ObjectToCSVString", properties);
-        ActionUtils.setTaskObject(oMsg,new TestBean());
-        log.warn( "The following error message is intentional" );
-        processor.process(oMsg);
-        assertEquals("<no-such-property>", ActionUtils.getTaskObject(oMsg));
-
-        // Single value - property doesn't exist on bean and "fail-on-missing-property" action config is set on...
-        properties.clear();
-        properties.add(new KeyValuePair(ObjectToCSVString.BEAN_PROPERTIES_PROP, "id"));
-        properties.add(new KeyValuePair(ObjectToCSVString.FAIL_ON_MISSING_PROPERTY, "true"));
-        processor = new ObjectToCSVString("ObjectToCSVString", properties);
-        ActionUtils.setTaskObject(oMsg,new TestBean());
-        try {
-	        log.warn( "The following error message is intentional" );
-        	processor.process(oMsg);
-        	fail("Expected ActionProcessingException");
-        } catch(ActionProcessingException e) {
-        	assertEquals("Bean method: getId not found/accessible on message object org.jboss.soa.esb.actions.converters.ObjectToCSVStringUnitTest$TestBean", e.getMessage());
-        }
-    }
-    
-    public static class TestBean  implements java.io.Serializable
-    {
-		private static final long serialVersionUID = 1L;
-		private String name = "Tom Fennelly";
-        private int age = 21; // hehehehe
-        
-        public int getAge() {
-            return age;
-        }
-        public String getName() {
-            return name;
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToCSVStringUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToCSVStringUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToCSVStringUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToCSVStringUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,113 @@
+/*
+ * 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.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+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.helpers.KeyValuePair;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+/**
+ * ObjectToCSVString unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class ObjectToCSVStringUnitTest extends TestCase {
+	
+	private Logger log = Logger.getLogger( ObjectToCSVStringUnitTest.class );
+
+    public void test() throws ConfigurationException, ActionProcessingException {
+        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+        Message oMsg = MessageFactory.getInstance().getMessage();
+        
+        // Single value - property exist on bean...
+        properties.add(new KeyValuePair(ObjectToCSVString.BEAN_PROPERTIES_PROP, "name"));
+        ObjectToCSVString processor = new ObjectToCSVString("ObjectToCSVString", properties);
+        
+		ActionUtils.setTaskObject(oMsg,new TestBean());
+        oMsg = processor.process(oMsg);
+        assertEquals("Tom Fennelly", ActionUtils.getTaskObject(oMsg));
+
+        // Multi value - properties all exist on bean...
+        properties.clear();
+        properties.add(new KeyValuePair(ObjectToCSVString.BEAN_PROPERTIES_PROP, "name,age"));
+        processor = new ObjectToCSVString("ObjectToCSVString", properties);
+        ActionUtils.setTaskObject(oMsg,new TestBean());
+        processor.process(oMsg);
+        assertEquals("Tom Fennelly,21", ActionUtils.getTaskObject(oMsg));
+
+        // Multi value - some properties exist on bean and some don't...
+        properties.clear();
+        properties.add(new KeyValuePair(ObjectToCSVString.BEAN_PROPERTIES_PROP, "id,name,phone,age"));
+        processor = new ObjectToCSVString("ObjectToCSVString", properties);
+        ActionUtils.setTaskObject(oMsg,new TestBean());
+        log.warn( "The following two error messages are intentional" );
+        processor.process(oMsg);
+        assertEquals("<no-such-property>,Tom Fennelly,<no-such-property>,21", ActionUtils.getTaskObject(oMsg));
+
+        // Single value - property doesn't exist on bean...
+        properties.clear();
+        properties.add(new KeyValuePair(ObjectToCSVString.BEAN_PROPERTIES_PROP, "id"));
+        processor = new ObjectToCSVString("ObjectToCSVString", properties);
+        ActionUtils.setTaskObject(oMsg,new TestBean());
+        log.warn( "The following error message is intentional" );
+        processor.process(oMsg);
+        assertEquals("<no-such-property>", ActionUtils.getTaskObject(oMsg));
+
+        // Single value - property doesn't exist on bean and "fail-on-missing-property" action config is set on...
+        properties.clear();
+        properties.add(new KeyValuePair(ObjectToCSVString.BEAN_PROPERTIES_PROP, "id"));
+        properties.add(new KeyValuePair(ObjectToCSVString.FAIL_ON_MISSING_PROPERTY, "true"));
+        processor = new ObjectToCSVString("ObjectToCSVString", properties);
+        ActionUtils.setTaskObject(oMsg,new TestBean());
+        try {
+	        log.warn( "The following error message is intentional" );
+        	processor.process(oMsg);
+        	fail("Expected ActionProcessingException");
+        } catch(ActionProcessingException e) {
+        	assertEquals("Bean method: getId not found/accessible on message object org.jboss.soa.esb.actions.converters.ObjectToCSVStringUnitTest$TestBean", e.getMessage());
+        }
+    }
+    
+    public static class TestBean  implements java.io.Serializable
+    {
+		private static final long serialVersionUID = 1L;
+		private String name = "Tom Fennelly";
+        private int age = 21; // hehehehe
+        
+        public int getAge() {
+            return age;
+        }
+        public String getName() {
+            return name;
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToXStreamUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToXStreamUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToXStreamUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,109 +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.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.actions.TestBean;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-import com.thoughtworks.xstream.XStream;
-import com.thoughtworks.xstream.io.xml.DomDriver;
-
-/**
- * ObjectToXStream unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class ObjectToXStreamUnitTest extends TestCase {
-
-    public void test_default() throws ActionProcessingException {
-        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
-        
-        ObjectToXStream objectToXStream = new ObjectToXStream("TestBean-Serialiser", properties);
-        
-        Message oMsg = MessageFactory.getInstance().getMessage();
-        ActionUtils.setTaskObject(oMsg,new TestBean("Tom", "1234"));
-        oMsg = objectToXStream.process(oMsg);
-        String xml = (String)ActionUtils.getTaskObject(oMsg);
-        XStream xstream = new XStream(new DomDriver());
-        TestBean bean = new TestBean();
-
-        assertTrue("Expected [<TestBean>].  Got [" + xml + "]", xml.startsWith("<TestBean>"));
-        xstream.alias("TestBean", TestBean.class);
-        xstream.fromXML(xml, bean);
-        
-        assertEquals("Tom", bean.getName());
-        assertEquals("1234", bean.getPhone());
-    }
-
-    public void test_with_package() throws ActionProcessingException {
-        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
-        
-        properties.add(new KeyValuePair("exclude-package", "false"));
-        ObjectToXStream objectToXStream = new ObjectToXStream("TestBean-Serialiser", properties);
-        
-        Message oMsg = MessageFactory.getInstance().getMessage();
-        ActionUtils.setTaskObject(oMsg,new TestBean("Tom", "1234"));
-        objectToXStream.process(oMsg);
-        String xml = (String)ActionUtils.getTaskObject(oMsg);
-
-        XStream xstream = new XStream(new DomDriver());
-        TestBean bean = new TestBean();
-
-        assertTrue("Expected start with [<" + TestBean.class.getName() + ">].  Got [" + xml + "]", xml.startsWith("<" + TestBean.class.getName() + ">"));
-        xstream.fromXML(xml, bean);
-        
-        assertEquals("Tom", bean.getName());
-        assertEquals("1234", bean.getPhone());
-    }
-
-    public void test_with_alias() throws ActionProcessingException {
-        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
-        
-        properties.add(new KeyValuePair("class-alias", "TomsClass"));
-        ObjectToXStream objectToXStream = new ObjectToXStream("TestBean-Serialiser", properties);
-        
-        Message oMsg = MessageFactory.getInstance().getMessage();
-        ActionUtils.setTaskObject(oMsg,new TestBean("Tom", "1234"));
-        objectToXStream.process(oMsg);
-        String xml = (String)ActionUtils.getTaskObject(oMsg);
-
-        XStream xstream = new XStream(new DomDriver());
-        xstream.alias("TomsClass", TestBean.class);
-        TestBean bean = new TestBean();
-
-        assertTrue("Expected start with [<TomsClass>].  Got [" + xml + "]", xml.startsWith("<TomsClass>"));
-        xstream.fromXML(xml, bean);
-        
-        assertEquals("Tom", bean.getName());
-        assertEquals("1234", bean.getPhone());
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToXStreamUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToXStreamUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToXStreamUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/ObjectToXStreamUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,109 @@
+/*
+ * 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.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.actions.TestBean;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+import com.thoughtworks.xstream.XStream;
+import com.thoughtworks.xstream.io.xml.DomDriver;
+
+/**
+ * ObjectToXStream unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class ObjectToXStreamUnitTest extends TestCase {
+
+    public void test_default() throws ActionProcessingException {
+        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+        
+        ObjectToXStream objectToXStream = new ObjectToXStream("TestBean-Serialiser", properties);
+        
+        Message oMsg = MessageFactory.getInstance().getMessage();
+        ActionUtils.setTaskObject(oMsg,new TestBean("Tom", "1234"));
+        oMsg = objectToXStream.process(oMsg);
+        String xml = (String)ActionUtils.getTaskObject(oMsg);
+        XStream xstream = new XStream(new DomDriver());
+        TestBean bean = new TestBean();
+
+        assertTrue("Expected [<TestBean>].  Got [" + xml + "]", xml.startsWith("<TestBean>"));
+        xstream.alias("TestBean", TestBean.class);
+        xstream.fromXML(xml, bean);
+        
+        assertEquals("Tom", bean.getName());
+        assertEquals("1234", bean.getPhone());
+    }
+
+    public void test_with_package() throws ActionProcessingException {
+        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+        
+        properties.add(new KeyValuePair("exclude-package", "false"));
+        ObjectToXStream objectToXStream = new ObjectToXStream("TestBean-Serialiser", properties);
+        
+        Message oMsg = MessageFactory.getInstance().getMessage();
+        ActionUtils.setTaskObject(oMsg,new TestBean("Tom", "1234"));
+        objectToXStream.process(oMsg);
+        String xml = (String)ActionUtils.getTaskObject(oMsg);
+
+        XStream xstream = new XStream(new DomDriver());
+        TestBean bean = new TestBean();
+
+        assertTrue("Expected start with [<" + TestBean.class.getName() + ">].  Got [" + xml + "]", xml.startsWith("<" + TestBean.class.getName() + ">"));
+        xstream.fromXML(xml, bean);
+        
+        assertEquals("Tom", bean.getName());
+        assertEquals("1234", bean.getPhone());
+    }
+
+    public void test_with_alias() throws ActionProcessingException {
+        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+        
+        properties.add(new KeyValuePair("class-alias", "TomsClass"));
+        ObjectToXStream objectToXStream = new ObjectToXStream("TestBean-Serialiser", properties);
+        
+        Message oMsg = MessageFactory.getInstance().getMessage();
+        ActionUtils.setTaskObject(oMsg,new TestBean("Tom", "1234"));
+        objectToXStream.process(oMsg);
+        String xml = (String)ActionUtils.getTaskObject(oMsg);
+
+        XStream xstream = new XStream(new DomDriver());
+        xstream.alias("TomsClass", TestBean.class);
+        TestBean bean = new TestBean();
+
+        assertTrue("Expected start with [<TomsClass>].  Got [" + xml + "]", xml.startsWith("<TomsClass>"));
+        xstream.fromXML(xml, bean);
+        
+        assertEquals("Tom", bean.getName());
+        assertEquals("1234", bean.getPhone());
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/StringToLongConverter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/StringToLongConverter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/StringToLongConverter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,52 +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 org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * StringToLong Converter Test Action Handler.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- * @since Version 4.0
- */
-public class StringToLongConverter extends AbstractActionPipelineProcessor {
-
-    /* (non-Javadoc)
-     * @see org.jboss.soa.esb.actions.ActionProcessor#processAction(java.lang.Object)
-     */
-    public Message process(Message message) throws ActionProcessingException {
-    	Object oCurr = ActionUtils.getTaskObject(message);
-        if(!(oCurr instanceof String)) {
-            throw new ActionProcessingException("This action handler only accepts String object instances.");
-        }
-        
-        System.out.println("StringToLongConverter");
-        try { ActionUtils.setTaskObject(message,new Long((String)oCurr)); }
-        catch (Exception e)
-        { throw new ActionProcessingException(e); }
-        return message;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/StringToLongConverter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/StringToLongConverter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/StringToLongConverter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/StringToLongConverter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,52 @@
+/*
+ * 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 org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * StringToLong Converter Test Action Handler.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ * @since Version 4.0
+ */
+public class StringToLongConverter extends AbstractActionPipelineProcessor {
+
+    /* (non-Javadoc)
+     * @see org.jboss.soa.esb.actions.ActionProcessor#processAction(java.lang.Object)
+     */
+    public Message process(Message message) throws ActionProcessingException {
+    	Object oCurr = ActionUtils.getTaskObject(message);
+        if(!(oCurr instanceof String)) {
+            throw new ActionProcessingException("This action handler only accepts String object instances.");
+        }
+        
+        System.out.println("StringToLongConverter");
+        try { ActionUtils.setTaskObject(message,new Long((String)oCurr)); }
+        catch (Exception e)
+        { throw new ActionProcessingException(e); }
+        return message;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/XStreamToObjectUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/XStreamToObjectUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/XStreamToObjectUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,291 +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 static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-import java.util.Map;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.actions.TestBean;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.KeyValuePair;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.junit.Test;
-
-import com.thoughtworks.xstream.XStream;
-
-/**
- * XStreamToObject unit tests.
- * @author daniel Marchant
- * @author Daniel Bevenius
- * @since Version 4.0
- */
-public class XStreamToObjectUnitTest {
-	
-	@Test
-    public void test_default() throws ActionProcessingException {
-        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
-        properties.add(new KeyValuePair("incoming-type",TestBean.class.getName() ));
-        
-        XStreamToObject xstreamToObject = new XStreamToObject("IntroductionsAnnotationReaderUnitTest-Serialiser", properties);
-
-        Message oMsg = MessageFactory.getInstance().getMessage();
-
-        String msg = "<" + TestBean.class.getSimpleName() + "> <name>Tom</name><phone>1234</phone></" + TestBean.class.getSimpleName() + ">";
-        
-        ActionUtils.setTaskObject(oMsg,msg);
-        oMsg = xstreamToObject.process(oMsg);
-       
-        TestBean bean = (TestBean)ActionUtils.getTaskObject(oMsg);
-  
-        assertEquals("Tom", bean.getName());
-        assertEquals("1234", bean.getPhone());
-         
-    }
-
-	@Test
-    public void test_with_package() throws ActionProcessingException {
-        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
-        properties.add(new KeyValuePair("exclude-package", "false"));
-        properties.add(new KeyValuePair("incoming-type",TestBean.class.getName() ));
-        
-        XStreamToObject xstreamToObject = new XStreamToObject("IntroductionsAnnotationReaderUnitTest-Serialiser", properties);
-
-        Message oMsg = MessageFactory.getInstance().getMessage();
-        
-        String msg = "<" + TestBean.class.getName() + "> <name>Tom</name><phone>1234</phone></"+ TestBean.class.getName() +">";
-        
-        ActionUtils.setTaskObject(oMsg,msg);
-        oMsg = xstreamToObject.process(oMsg);
-       
-        TestBean bean = (TestBean)ActionUtils.getTaskObject(oMsg);
-  
-        assertEquals("Tom", bean.getName());
-        assertEquals("1234", bean.getPhone());
-        
-    }
-
-	@Test
-    public void test_with_alias() throws ActionProcessingException {
-        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
-        
-        properties.add(new KeyValuePair("class-alias", "TomsClass"));
-        properties.add(new KeyValuePair("exclude-package", "false"));
-        properties.add(new KeyValuePair("incoming-type",TestBean.class.getName() ));
-        
-        XStreamToObject xstreamToObject = new XStreamToObject("IntroductionsAnnotationReaderUnitTest-Serialiser", properties);
-
-        Message oMsg = MessageFactory.getInstance().getMessage();
-        
-        String msg = "<TomsClass><name>Tom</name><phone>1234</phone></TomsClass>";
-        
-        ActionUtils.setTaskObject(oMsg,msg);
-        oMsg = xstreamToObject.process(oMsg);
-       
-        TestBean bean = (TestBean)ActionUtils.getTaskObject(oMsg);
-  
-        assertEquals("Tom", bean.getName());
-        assertEquals("1234", bean.getPhone());
-    }
-    
-	@Test
-    public void getAliases()
-    {
-    	ConfigTree configTree = getConfigTreeWithAliases("TomsClass", false, TestBean.class, null );
-        XStreamToObject xstreamToObject = new XStreamToObject( configTree );
-        
-        Map<String, String> aliases = xstreamToObject.getAliases( configTree );
-        
-        assertAliases( aliases );
-    }
-    
-	@Test
-    public void addAliases() throws ActionProcessingException
-    {
-    	ConfigTree configTree = getConfigTreeWithAliases("TomsClass", false, TestBean.class, null );
-        XStreamToObject xstreamToObject = new XStreamToObject( configTree );
-        
-        Map<String, String> aliases = xstreamToObject.getAliases( configTree );
-        xstreamToObject.addAliases( aliases, new XStream() );
-        
-        assertAliases( aliases );
-    }
-    
-	@Test
-    public void addAliasesNegative() throws ActionProcessingException
-    {
-    	ConfigTree configTree = getConfigTree( "TomsClass", false, TestBean.class, null );
-        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass", false, TestBean.class, null );
-        
-        Map<String, String> aliases = xstreamToObject.getAliases( configTree );
-        xstreamToObject.addAliases( aliases, new XStream() );
-        
-    	assertEquals( "Aliases map should have been empty!", 0,  aliases.size() );
-    	
-    }
-    
-	@Test
-    public void test_with_multiple_aliases() throws ActionProcessingException {
-    	
-        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass", false, TestBean.class, null );
-
-        Message oMsg = MessageFactory.getInstance().getMessage();
-        
-        String msg = "<TomsClass><name>Tom</name><phone>1234</phone></TomsClass>";
-        
-        ActionUtils.setTaskObject(oMsg,msg);
-        oMsg = xstreamToObject.process(oMsg);
-       
-        TestBean bean = (TestBean)ActionUtils.getTaskObject(oMsg);
-  
-        assertEquals("Tom", bean.getName());
-        assertEquals("1234", bean.getPhone());
-    }
-    
-	@Test
-    public void test_setRootNodeNegative() throws ActionProcessingException
-    {
-        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass", false, TestBean.class, null );
-        assertEquals ( null , xstreamToObject.getRootNodeName() );
-    }
-    
-	@Test
-    public void fromXmlToObject_with_rootNode() throws ActionProcessingException
-    {
-    	String rootNodeName = "/someNode/TomsClass";
-        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass", false, TestBean.class, rootNodeName );
-        
-        String xml = "<someNode><TomsClass><name>Tom</name><phone>1234</phone></TomsClass></someNode>";
-        Object obj = new TestBean();
-        
-        xstreamToObject.fromXmlToObject( xml, obj );
-        
-        assertTrue( obj instanceof TestBean );
-        assertEquals("1234", ((TestBean)obj).getPhone());
-    }
-    
-	@Test
-    public void fromXmlToObject_with_rootNode_as_second_child_node() throws ActionProcessingException
-    {
-    	String rootNodeName = "/someNode/TomsClass2";
-        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass2", false,TestBean2.class, rootNodeName );
-        
-        String xml = "<someNode><TomsClass><name>Tom</name><phone>1234</phone></TomsClass><TomsClass2><name>Daniel</name></TomsClass2></someNode>";
-        Object obj = new TestBean2();
-        
-        xstreamToObject.fromXmlToObject( xml, obj );
-        
-        assertTrue( obj instanceof TestBean2 );
-        assertEquals("Daniel", ((TestBean2)obj).getName());
-    }
-	
-	@Test
-    public void fromXmlToObject_with_rootNode_as_second_child_node_and_sibling() throws ActionProcessingException
-    {
-    	String rootNodeName = "/someNode/TomsClass2[2]";
-        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass2", false,TestBean2.class, rootNodeName );
-        
-        String xml = "<someNode><TomsClass><name>Tom</name><phone>1234</phone></TomsClass><TomsClass2><name>Daniel</name></TomsClass2><TomsClass2><name>Bevenius</name></TomsClass2></someNode>";
-        Object obj = new TestBean2();
-        
-        xstreamToObject.fromXmlToObject( xml, obj );
-        
-        assertTrue( obj instanceof TestBean2 );
-        assertEquals("Bevenius", ((TestBean2)obj).getName());
-    }
-    
-    private XStreamToObject createXStreamObject( String classAlias, boolean exludePackage, Class incomingType, String rootNodeName)
-    {
-    	ConfigTree configTree = getConfigTree( classAlias, exludePackage, incomingType, rootNodeName);
-        return new XStreamToObject( configTree );
-    }
-    
-    private void assertAliases( Map<String, String> aliases )
-    {
-    	assertNotNull( "Aliases map should not have been null!",  aliases );
-        assertEquals( TestBean.class.getName(), aliases.get( "aliasName1" ) );
-        assertEquals( TestBean.class.getName(), aliases.get( "aliasName2" ) );
-    }
-    
-    private ConfigTree getConfigTree(String classAlias, boolean excludePackage, Class incomingType, String rootNodeName)
-	{
-		ConfigTree configTree = new ConfigTree ("test");
-    	configTree.setAttribute( "class-alias", classAlias);
-    	configTree.setAttribute( "exclude-package", String.valueOf( excludePackage ));
-    	configTree.setAttribute( "incoming-type", incomingType.getName());
-    	configTree.setAttribute( "root-node", rootNodeName );
-		return configTree;
-	}
-
-    private ConfigTree getConfigTreeWithAliases(String classAlias, boolean excludePackage, Class incomingType, String rootNodeName)
-	{
-		ConfigTree configTree = getConfigTree( classAlias,false, incomingType, rootNodeName );
-		
-    	ConfigTree alias1 = new ConfigTree( "alias", configTree);
-    	alias1.setAttribute( "name", "aliasName1");
-    	alias1.setAttribute( "class", TestBean.class.getName());
-    	
-    	ConfigTree alias2 = new ConfigTree( "alias", configTree);
-    	alias2.setAttribute( "name", "aliasName2");
-    	alias2.setAttribute( "class", TestBean.class.getName());
-    	
-		return configTree;
-	}
-
-    /**
-     * Just a bean for testing
-     */
-	private static class TestBean2 {
-		private String name;
-
-		public String getName()
-		{
-			return name;
-		}
-
-		public void setName( String name )
-		{
-			this.name = name;
-		}
-		
-	}
-	
-	/**
-	 * Just here to get Ant to find annotated test.
-	 */
-	public static junit.framework.Test suite()
-	{
-		return new JUnit4TestAdapter( XStreamToObjectUnitTest.class);
-	}
-	
-}	
-	
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/XStreamToObjectUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/XStreamToObjectUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/XStreamToObjectUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/converters/XStreamToObjectUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,291 @@
+/*
+ * 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.actions.TestBean;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.KeyValuePair;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.junit.Test;
+
+import com.thoughtworks.xstream.XStream;
+
+/**
+ * XStreamToObject unit tests.
+ * @author daniel Marchant
+ * @author Daniel Bevenius
+ * @since Version 4.0
+ */
+public class XStreamToObjectUnitTest {
+	
+	@Test
+    public void test_default() throws ActionProcessingException {
+        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+        properties.add(new KeyValuePair("incoming-type",TestBean.class.getName() ));
+        
+        XStreamToObject xstreamToObject = new XStreamToObject("IntroductionsAnnotationReaderUnitTest-Serialiser", properties);
+
+        Message oMsg = MessageFactory.getInstance().getMessage();
+
+        String msg = "<" + TestBean.class.getSimpleName() + "> <name>Tom</name><phone>1234</phone></" + TestBean.class.getSimpleName() + ">";
+        
+        ActionUtils.setTaskObject(oMsg,msg);
+        oMsg = xstreamToObject.process(oMsg);
+       
+        TestBean bean = (TestBean)ActionUtils.getTaskObject(oMsg);
+  
+        assertEquals("Tom", bean.getName());
+        assertEquals("1234", bean.getPhone());
+         
+    }
+
+	@Test
+    public void test_with_package() throws ActionProcessingException {
+        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+        properties.add(new KeyValuePair("exclude-package", "false"));
+        properties.add(new KeyValuePair("incoming-type",TestBean.class.getName() ));
+        
+        XStreamToObject xstreamToObject = new XStreamToObject("IntroductionsAnnotationReaderUnitTest-Serialiser", properties);
+
+        Message oMsg = MessageFactory.getInstance().getMessage();
+        
+        String msg = "<" + TestBean.class.getName() + "> <name>Tom</name><phone>1234</phone></"+ TestBean.class.getName() +">";
+        
+        ActionUtils.setTaskObject(oMsg,msg);
+        oMsg = xstreamToObject.process(oMsg);
+       
+        TestBean bean = (TestBean)ActionUtils.getTaskObject(oMsg);
+  
+        assertEquals("Tom", bean.getName());
+        assertEquals("1234", bean.getPhone());
+        
+    }
+
+	@Test
+    public void test_with_alias() throws ActionProcessingException {
+        List<KeyValuePair> properties = new ArrayList<KeyValuePair>();
+        
+        properties.add(new KeyValuePair("class-alias", "TomsClass"));
+        properties.add(new KeyValuePair("exclude-package", "false"));
+        properties.add(new KeyValuePair("incoming-type",TestBean.class.getName() ));
+        
+        XStreamToObject xstreamToObject = new XStreamToObject("IntroductionsAnnotationReaderUnitTest-Serialiser", properties);
+
+        Message oMsg = MessageFactory.getInstance().getMessage();
+        
+        String msg = "<TomsClass><name>Tom</name><phone>1234</phone></TomsClass>";
+        
+        ActionUtils.setTaskObject(oMsg,msg);
+        oMsg = xstreamToObject.process(oMsg);
+       
+        TestBean bean = (TestBean)ActionUtils.getTaskObject(oMsg);
+  
+        assertEquals("Tom", bean.getName());
+        assertEquals("1234", bean.getPhone());
+    }
+    
+	@Test
+    public void getAliases()
+    {
+    	ConfigTree configTree = getConfigTreeWithAliases("TomsClass", false, TestBean.class, null );
+        XStreamToObject xstreamToObject = new XStreamToObject( configTree );
+        
+        Map<String, String> aliases = xstreamToObject.getAliases( configTree );
+        
+        assertAliases( aliases );
+    }
+    
+	@Test
+    public void addAliases() throws ActionProcessingException
+    {
+    	ConfigTree configTree = getConfigTreeWithAliases("TomsClass", false, TestBean.class, null );
+        XStreamToObject xstreamToObject = new XStreamToObject( configTree );
+        
+        Map<String, String> aliases = xstreamToObject.getAliases( configTree );
+        xstreamToObject.addAliases( aliases, new XStream() );
+        
+        assertAliases( aliases );
+    }
+    
+	@Test
+    public void addAliasesNegative() throws ActionProcessingException
+    {
+    	ConfigTree configTree = getConfigTree( "TomsClass", false, TestBean.class, null );
+        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass", false, TestBean.class, null );
+        
+        Map<String, String> aliases = xstreamToObject.getAliases( configTree );
+        xstreamToObject.addAliases( aliases, new XStream() );
+        
+    	assertEquals( "Aliases map should have been empty!", 0,  aliases.size() );
+    	
+    }
+    
+	@Test
+    public void test_with_multiple_aliases() throws ActionProcessingException {
+    	
+        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass", false, TestBean.class, null );
+
+        Message oMsg = MessageFactory.getInstance().getMessage();
+        
+        String msg = "<TomsClass><name>Tom</name><phone>1234</phone></TomsClass>";
+        
+        ActionUtils.setTaskObject(oMsg,msg);
+        oMsg = xstreamToObject.process(oMsg);
+       
+        TestBean bean = (TestBean)ActionUtils.getTaskObject(oMsg);
+  
+        assertEquals("Tom", bean.getName());
+        assertEquals("1234", bean.getPhone());
+    }
+    
+	@Test
+    public void test_setRootNodeNegative() throws ActionProcessingException
+    {
+        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass", false, TestBean.class, null );
+        assertEquals ( null , xstreamToObject.getRootNodeName() );
+    }
+    
+	@Test
+    public void fromXmlToObject_with_rootNode() throws ActionProcessingException
+    {
+    	String rootNodeName = "/someNode/TomsClass";
+        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass", false, TestBean.class, rootNodeName );
+        
+        String xml = "<someNode><TomsClass><name>Tom</name><phone>1234</phone></TomsClass></someNode>";
+        Object obj = new TestBean();
+        
+        xstreamToObject.fromXmlToObject( xml, obj );
+        
+        assertTrue( obj instanceof TestBean );
+        assertEquals("1234", ((TestBean)obj).getPhone());
+    }
+    
+	@Test
+    public void fromXmlToObject_with_rootNode_as_second_child_node() throws ActionProcessingException
+    {
+    	String rootNodeName = "/someNode/TomsClass2";
+        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass2", false,TestBean2.class, rootNodeName );
+        
+        String xml = "<someNode><TomsClass><name>Tom</name><phone>1234</phone></TomsClass><TomsClass2><name>Daniel</name></TomsClass2></someNode>";
+        Object obj = new TestBean2();
+        
+        xstreamToObject.fromXmlToObject( xml, obj );
+        
+        assertTrue( obj instanceof TestBean2 );
+        assertEquals("Daniel", ((TestBean2)obj).getName());
+    }
+	
+	@Test
+    public void fromXmlToObject_with_rootNode_as_second_child_node_and_sibling() throws ActionProcessingException
+    {
+    	String rootNodeName = "/someNode/TomsClass2[2]";
+        XStreamToObject xstreamToObject = createXStreamObject( "TomsClass2", false,TestBean2.class, rootNodeName );
+        
+        String xml = "<someNode><TomsClass><name>Tom</name><phone>1234</phone></TomsClass><TomsClass2><name>Daniel</name></TomsClass2><TomsClass2><name>Bevenius</name></TomsClass2></someNode>";
+        Object obj = new TestBean2();
+        
+        xstreamToObject.fromXmlToObject( xml, obj );
+        
+        assertTrue( obj instanceof TestBean2 );
+        assertEquals("Bevenius", ((TestBean2)obj).getName());
+    }
+    
+    private XStreamToObject createXStreamObject( String classAlias, boolean exludePackage, Class incomingType, String rootNodeName)
+    {
+    	ConfigTree configTree = getConfigTree( classAlias, exludePackage, incomingType, rootNodeName);
+        return new XStreamToObject( configTree );
+    }
+    
+    private void assertAliases( Map<String, String> aliases )
+    {
+    	assertNotNull( "Aliases map should not have been null!",  aliases );
+        assertEquals( TestBean.class.getName(), aliases.get( "aliasName1" ) );
+        assertEquals( TestBean.class.getName(), aliases.get( "aliasName2" ) );
+    }
+    
+    private ConfigTree getConfigTree(String classAlias, boolean excludePackage, Class incomingType, String rootNodeName)
+	{
+		ConfigTree configTree = new ConfigTree ("test");
+    	configTree.setAttribute( "class-alias", classAlias);
+    	configTree.setAttribute( "exclude-package", String.valueOf( excludePackage ));
+    	configTree.setAttribute( "incoming-type", incomingType.getName());
+    	configTree.setAttribute( "root-node", rootNodeName );
+		return configTree;
+	}
+
+    private ConfigTree getConfigTreeWithAliases(String classAlias, boolean excludePackage, Class incomingType, String rootNodeName)
+	{
+		ConfigTree configTree = getConfigTree( classAlias,false, incomingType, rootNodeName );
+		
+    	ConfigTree alias1 = new ConfigTree( "alias", configTree);
+    	alias1.setAttribute( "name", "aliasName1");
+    	alias1.setAttribute( "class", TestBean.class.getName());
+    	
+    	ConfigTree alias2 = new ConfigTree( "alias", configTree);
+    	alias2.setAttribute( "name", "aliasName2");
+    	alias2.setAttribute( "class", TestBean.class.getName());
+    	
+		return configTree;
+	}
+
+    /**
+     * Just a bean for testing
+     */
+	private static class TestBean2 {
+		private String name;
+
+		public String getName()
+		{
+			return name;
+		}
+
+		public void setName( String name )
+		{
+			this.name = name;
+		}
+		
+	}
+	
+	/**
+	 * Just here to get Ant to find annotated test.
+	 */
+	public static junit.framework.Test suite()
+	{
+		return new JUnit4TestAdapter( XStreamToObjectUnitTest.class);
+	}
+	
+}	
+	
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/EchoRouterUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/EchoRouterUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/EchoRouterUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,46 +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 junit.framework.TestCase;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-public class EchoRouterUnitTest extends TestCase
-{
-	public EchoRouterUnitTest ()
-	{
-	}
-
-	public void testRouter () throws Exception
-	{
-		EchoRouter router = new EchoRouter(null);
-		Message msg = MessageFactory.getInstance().getMessage();
-		
-		msg.getBody().setByteArray("hello world".getBytes());
-		
-		router.process(msg);
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/EchoRouterUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/EchoRouterUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/EchoRouterUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/EchoRouterUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,46 @@
+/*
+ * 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 junit.framework.TestCase;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+public class EchoRouterUnitTest extends TestCase
+{
+	public EchoRouterUnitTest ()
+	{
+	}
+
+	public void testRouter () throws Exception
+	{
+		EchoRouter router = new EchoRouter(null);
+		Message msg = MessageFactory.getInstance().getMessage();
+		
+		msg.getBody().setByteArray("hello world".getBytes());
+		
+		router.process(msg);
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/HttpRouterUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/HttpRouterUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/HttpRouterUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,113 +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 static org.junit.Assert.fail;
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.junit.Before;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class HttpRouterUnitTest
-{
-	private Logger log = Logger.getLogger( HttpRouterUnitTest.class );
-	
-	private Message msg = MessageFactory.getInstance().getMessage();
-	private ConfigTree tree = new ConfigTree("test");
-	
-	@Before
-	public void setUp()
-	{
-		msg.getBody().setByteArray("hello world".getBytes());
-	}
-	
-	
-	@Test ( expected = ActionProcessingException.class )
-	public void testRouter_UnknownHost() throws ActionProcessingException
-	{
-		setRouterURL( "http://foo.bar" );
-		HttpRouter router = new HttpRouter(tree);
-		log.warn( "The following errors are intentional" );
-		router.process(msg);
-	}
-	
-	/**
-	 * Should this test really be here? Is this not dependant on a 
-	 * running http server...
-	 */
-	@Test ( timeout=7000, expected = ActionProcessingException.class )
-	@Ignore
-	public void testRouter_IP_Address() throws ActionProcessingException
-	{
-		setRouterURL( "http://172.16.127.160:9090" );
-		HttpRouter router = new HttpRouter(tree);
-		
-		Message msg = MessageFactory.getInstance().getMessage();
-		
-		msg.getBody().setByteArray("hello world".getBytes());
-		
-		boolean exception = false;
-		
-		try
-		{
-			router.process(msg);
-		}
-		catch (ActionProcessingException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		tree.setAttribute(ListenerTagNames.HTTP_ROUTER_ROUTE_URL, "http://172.16.127.160:9090");
-		
-		router = new HttpRouter(tree);
-		
-		try
-		{
-			router.process(msg);
-		}
-		catch (ActionProcessingException ex)
-		{
-			//fail();
-		}
-	}
-	
-	private void setRouterURL( String url )
-	{
-		tree.setAttribute(ListenerTagNames.HTTP_ROUTER_ROUTE_URL, url);
-	}
-	
-	public static junit.framework.Test suite() {
-		return new JUnit4TestAdapter(HttpRouterUnitTest.class);
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/HttpRouterUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/HttpRouterUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/HttpRouterUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/HttpRouterUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,113 @@
+/*
+ * 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 static org.junit.Assert.fail;
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.junit.Before;
+import org.junit.Ignore;
+import org.junit.Test;
+
+public class HttpRouterUnitTest
+{
+	private Logger log = Logger.getLogger( HttpRouterUnitTest.class );
+	
+	private Message msg = MessageFactory.getInstance().getMessage();
+	private ConfigTree tree = new ConfigTree("test");
+	
+	@Before
+	public void setUp()
+	{
+		msg.getBody().setByteArray("hello world".getBytes());
+	}
+	
+	
+	@Test ( expected = ActionProcessingException.class )
+	public void testRouter_UnknownHost() throws ActionProcessingException
+	{
+		setRouterURL( "http://foo.bar" );
+		HttpRouter router = new HttpRouter(tree);
+		log.warn( "The following errors are intentional" );
+		router.process(msg);
+	}
+	
+	/**
+	 * Should this test really be here? Is this not dependant on a 
+	 * running http server...
+	 */
+	@Test ( timeout=7000, expected = ActionProcessingException.class )
+	@Ignore
+	public void testRouter_IP_Address() throws ActionProcessingException
+	{
+		setRouterURL( "http://172.16.127.160:9090" );
+		HttpRouter router = new HttpRouter(tree);
+		
+		Message msg = MessageFactory.getInstance().getMessage();
+		
+		msg.getBody().setByteArray("hello world".getBytes());
+		
+		boolean exception = false;
+		
+		try
+		{
+			router.process(msg);
+		}
+		catch (ActionProcessingException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		tree.setAttribute(ListenerTagNames.HTTP_ROUTER_ROUTE_URL, "http://172.16.127.160:9090");
+		
+		router = new HttpRouter(tree);
+		
+		try
+		{
+			router.process(msg);
+		}
+		catch (ActionProcessingException ex)
+		{
+			//fail();
+		}
+	}
+	
+	private void setRouterURL( String url )
+	{
+		tree.setAttribute(ListenerTagNames.HTTP_ROUTER_ROUTE_URL, url);
+	}
+	
+	public static junit.framework.Test suite() {
+		return new JUnit4TestAdapter(HttpRouterUnitTest.class);
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,82 +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 junit.framework.TestCase;
-
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-public class JmsRouterUnitTest extends TestCase
-{
-	public JmsRouterUnitTest ()
-	{
-	}
-
-	public void testRouter () throws Exception
-	{
-		ConfigTree tree = new ConfigTree("test");
-		
-		tree.setAttribute("jndiName", "foobar");
-		
-		JMSRouter router = new JMSRouter(tree);
-		boolean exception = false;
-		
-		Message msg = MessageFactory.getInstance().getMessage();
-		
-		msg.getBody().setByteArray("hello world".getBytes());
-		
-		try
-		{
-			router.route(msg);
-		}
-		catch (ActionProcessingException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		router.unwrap = true;
-		
-		try
-		{
-			msg.getBody().add("org.jboss.soa.esb.actions.current.after", "hello world");
-			router.process(msg);
-		}
-		catch (ActionProcessingException ex)
-		{
-			exception = true;
-		}
-
-		if (!exception)
-			fail();
-		
-		router.getErrorNotification(null);
-		router.getOkNotification(null);
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/routing/JmsRouterUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,82 @@
+/*
+ * 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 junit.framework.TestCase;
+
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+public class JmsRouterUnitTest extends TestCase
+{
+	public JmsRouterUnitTest ()
+	{
+	}
+
+	public void testRouter () throws Exception
+	{
+		ConfigTree tree = new ConfigTree("test");
+		
+		tree.setAttribute("jndiName", "foobar");
+		
+		JMSRouter router = new JMSRouter(tree);
+		boolean exception = false;
+		
+		Message msg = MessageFactory.getInstance().getMessage();
+		
+		msg.getBody().setByteArray("hello world".getBytes());
+		
+		try
+		{
+			router.route(msg);
+		}
+		catch (ActionProcessingException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		router.unwrap = true;
+		
+		try
+		{
+			msg.getBody().add("org.jboss.soa.esb.actions.current.after", "hello world");
+			router.process(msg);
+		}
+		catch (ActionProcessingException ex)
+		{
+			exception = true;
+		}
+
+		if (!exception)
+			fail();
+		
+		router.getErrorNotification(null);
+		router.getOkNotification(null);
+	}
+	
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,81 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.actions.scripting;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-/**
- * Unit tests for GroovyActionProcessor.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class GroovyActionProcessorUnitTest extends TestCase {
-
-    public void test_script_file() throws ConfigurationException, ActionLifecycleException, ActionProcessingException {
-        ConfigTree config = getConfig("test.groovy");
-        String messageContents = "Hello World!";
-
-        config.setAttribute("messageContents", messageContents);
-
-        GroovyActionProcessor processor = new GroovyActionProcessor(config);
-        Message message = MessageFactory.getInstance().getMessage();
-
-        assertProcessingOK(processor, message, messageContents);
-    }
-
-    public void test_script_inlined() throws ConfigurationException, ActionLifecycleException, ActionProcessingException {
-        ConfigTree config = new ConfigTree("<config/>");
-        String messageContents = "Hello World - Inlined!";
-
-        config.setAttribute("messageContents", messageContents);
-
-        GroovyActionProcessor processor = new GroovyActionProcessor(config);
-        Message message = MessageFactory.getInstance().getMessage();
-
-        // Set the script as the message task object...
-        ActionUtils.setTaskObject(message, "import org.jboss.soa.esb.message.*\n" +
-                "message.getBody().setByteArray(config.getAttribute(\"messageContents\").getBytes());");
-
-        assertProcessingOK(processor, message, messageContents);
-    }
-
-    private void assertProcessingOK(GroovyActionProcessor processor, Message message, String messageContents) throws ActionLifecycleException, ActionProcessingException {
-        processor.initialise();
-        processor.process(message);
-        byte[] bodyContents = message.getBody().getByteArray();
-        assertNotNull("Expected body contents to be set.", bodyContents);
-        assertEquals(messageContents, new String(bodyContents));
-    }
-
-    private ConfigTree getConfig(String script) {
-        ConfigTree config = new ConfigTree("<config/>");
-
-        config.setAttribute("script", "/org/jboss/soa/esb/actions/scripting/" + script);
-        
-        return config;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/GroovyActionProcessorUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,81 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.actions.scripting;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+/**
+ * Unit tests for GroovyActionProcessor.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class GroovyActionProcessorUnitTest extends TestCase {
+
+    public void test_script_file() throws ConfigurationException, ActionLifecycleException, ActionProcessingException {
+        ConfigTree config = getConfig("test.groovy");
+        String messageContents = "Hello World!";
+
+        config.setAttribute("messageContents", messageContents);
+
+        GroovyActionProcessor processor = new GroovyActionProcessor(config);
+        Message message = MessageFactory.getInstance().getMessage();
+
+        assertProcessingOK(processor, message, messageContents);
+    }
+
+    public void test_script_inlined() throws ConfigurationException, ActionLifecycleException, ActionProcessingException {
+        ConfigTree config = new ConfigTree("<config/>");
+        String messageContents = "Hello World - Inlined!";
+
+        config.setAttribute("messageContents", messageContents);
+
+        GroovyActionProcessor processor = new GroovyActionProcessor(config);
+        Message message = MessageFactory.getInstance().getMessage();
+
+        // Set the script as the message task object...
+        ActionUtils.setTaskObject(message, "import org.jboss.soa.esb.message.*\n" +
+                "message.getBody().setByteArray(config.getAttribute(\"messageContents\").getBytes());");
+
+        assertProcessingOK(processor, message, messageContents);
+    }
+
+    private void assertProcessingOK(GroovyActionProcessor processor, Message message, String messageContents) throws ActionLifecycleException, ActionProcessingException {
+        processor.initialise();
+        processor.process(message);
+        byte[] bodyContents = message.getBody().getByteArray();
+        assertNotNull("Expected body contents to be set.", bodyContents);
+        assertEquals(messageContents, new String(bodyContents));
+    }
+
+    private ConfigTree getConfig(String script) {
+        ConfigTree config = new ConfigTree("<config/>");
+
+        config.setAttribute("script", "/org/jboss/soa/esb/actions/scripting/" + script);
+        
+        return config;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/test.groovy
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/test.groovy	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/test.groovy	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,3 +0,0 @@
-import org.jboss.soa.esb.message.*
-
-message.getBody().setByteArray(config.getAttribute("messageContents").getBytes());
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/test.groovy (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/test.groovy)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/test.groovy	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/scripting/test.groovy	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,3 @@
+import org.jboss.soa.esb.message.*
+
+message.getBody().setByteArray(config.getAttribute("messageContents").getBytes());
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates/MockActionUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates/MockActionUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates/MockActionUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,49 +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 junit.framework.TestCase;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-public class MockActionUnitTest extends TestCase
-{
-	public void testMockAction ()
-	{
-		MockAction action = new MockAction();
-		Message msg = MessageFactory.getInstance().getMessage();
-		
-		msg.getBody().add("Hello", "World");
-		
-		action.process(msg);
-	}
-	
-	public void testMockComposer ()
-	{
-		MockComposer composer = new MockComposer();
-		
-		composer.composeEmptyMessage("Hello World");
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates/MockActionUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates/MockActionUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates/MockActionUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/actions/templates/MockActionUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,49 @@
+/*
+ * 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 junit.framework.TestCase;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+public class MockActionUnitTest extends TestCase
+{
+	public void testMockAction ()
+	{
+		MockAction action = new MockAction();
+		Message msg = MessageFactory.getInstance().getMessage();
+		
+		msg.getBody().add("Hello", "World");
+		
+		action.process(msg);
+	}
+	
+	public void testMockComposer ()
+	{
+		MockComposer composer = new MockComposer();
+		
+		composer.composeEmptyMessage("Hello World");
+	}
+	
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFileReplyToEprUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFileReplyToEprUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFileReplyToEprUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,139 +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.addressing.eprs.tests;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Unit tests for file default reply to
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
- */
-
-
-public class DefaultFileReplyToEprUnitTest
-{
-
-	private static Class thisClass = DefaultFileReplyToEprUnitTest.class;
-	static Logger _logger = Logger.getLogger(thisClass);
-	
-    public static junit.framework.Test suite()
-    {
-        return new JUnit4TestAdapter(thisClass);
-    }
-    
-    static File WORKDIR;
-    static
-    {
-    	String os = System.getProperty("os.name","").toLowerCase();
-    	String dflt = (os.indexOf("win")>=0) ? "/temp": "/tmp";
-    	WORKDIR	= new File(System.getProperty("java.io.tmpdir",dflt));
-    }
-
-	
-    @BeforeClass
-    public static void runBeforeAllTests()
-    {
-    	_logger.info("@BeforeClass invoked");
-    }
-
-
-    @AfterClass
-    public static void runAfterAllTests() throws Exception
-    {
-    	_logger.info("_________________________________________");
-    	_logger.info("@AfterClass invoked");
-    }
-
-    
-  @Test
-    public void testFileEpr()
-    {
-  		_logger.info("_________________________________________");
-    	_logger.info("testFileEpr() invoked");
-        try
-        {
-        	String initialSuffix = ".msg";
-        	
-        	//  Send a Message that will be picked up by a listener, and specify replyTo
-        	FileEpr toEpr = new FileEpr(WORKDIR.toURI().toString());
-        	toEpr.setInputSuffix(initialSuffix);
-        	toEpr.setPostDelete(true);
-        	toEpr.setPostSuffix(initialSuffix);
-        	FileEpr replyToEpr = (FileEpr)CourierUtil.getDefaultReplyToEpr(toEpr);
-
-        	String text_1 = "Outgoing";
-        	Message outgoingMsg = MessageFactory.getInstance().getMessage();
-        	outgoingMsg.getHeader().getCall().setTo(toEpr);
-        	outgoingMsg.getHeader().getCall().setReplyTo(replyToEpr);
-        	outgoingMsg.getBody().setByteArray(text_1.getBytes());
-        	CourierUtil.deliverMessage(outgoingMsg);
-
-        	// Mock a service that picks up the original message and replies
-        	FileEpr serviceEpr = new FileEpr(toEpr.getURL());
-        	serviceEpr.setInputSuffix(initialSuffix);
-        	serviceEpr.setPostDelete(true);
-        	PickUpOnlyCourier listener = CourierFactory.getPickupCourier(serviceEpr);
-        	Message received = listener.pickup(100);
-        	String text_2 = new String(received.getBody().getByteArray());
-        	assertTrue(text_1.equals(text_2));
-        	assertTrue(replyToEpr.equals(received.getHeader().getCall().getReplyTo()));
-        	
-        	// now respond to replyTo
-        	text_2	+= " + processed by listener";
-        	Message response = MessageFactory.getInstance().getMessage();
-        	response.getHeader().getCall().setTo(received.getHeader().getCall().getReplyTo());
-        	response.getBody().setByteArray(text_2.getBytes());
-        	CourierUtil.deliverMessage(response);
-        	
-        	// try to pick up reply
-        	PickUpOnlyCourier waiter = CourierFactory.getPickupCourier(replyToEpr);
-        	Message finalMsg = waiter.pickup(100);
-        	assertTrue(text_2.equals(new String(finalMsg.getBody().getByteArray())));
-        	
-        	_logger.info(text_2+"... and back from local filesystem");
-        	_logger.info("getDefaultReplyToEpr test succeeded for local file transport");
-
-        }
-        catch (Exception e)
-        {
-        	_logger.error(e);
-            assertTrue(false);
-        }
-    }
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFileReplyToEprUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFileReplyToEprUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFileReplyToEprUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFileReplyToEprUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,139 @@
+/*
+ * 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.addressing.eprs.tests;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Unit tests for file default reply to
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
+ */
+
+
+public class DefaultFileReplyToEprUnitTest
+{
+
+	private static Class thisClass = DefaultFileReplyToEprUnitTest.class;
+	static Logger _logger = Logger.getLogger(thisClass);
+	
+    public static junit.framework.Test suite()
+    {
+        return new JUnit4TestAdapter(thisClass);
+    }
+    
+    static File WORKDIR;
+    static
+    {
+    	String os = System.getProperty("os.name","").toLowerCase();
+    	String dflt = (os.indexOf("win")>=0) ? "/temp": "/tmp";
+    	WORKDIR	= new File(System.getProperty("java.io.tmpdir",dflt));
+    }
+
+	
+    @BeforeClass
+    public static void runBeforeAllTests()
+    {
+    	_logger.info("@BeforeClass invoked");
+    }
+
+
+    @AfterClass
+    public static void runAfterAllTests() throws Exception
+    {
+    	_logger.info("_________________________________________");
+    	_logger.info("@AfterClass invoked");
+    }
+
+    
+  @Test
+    public void testFileEpr()
+    {
+  		_logger.info("_________________________________________");
+    	_logger.info("testFileEpr() invoked");
+        try
+        {
+        	String initialSuffix = ".msg";
+        	
+        	//  Send a Message that will be picked up by a listener, and specify replyTo
+        	FileEpr toEpr = new FileEpr(WORKDIR.toURI().toString());
+        	toEpr.setInputSuffix(initialSuffix);
+        	toEpr.setPostDelete(true);
+        	toEpr.setPostSuffix(initialSuffix);
+        	FileEpr replyToEpr = (FileEpr)CourierUtil.getDefaultReplyToEpr(toEpr);
+
+        	String text_1 = "Outgoing";
+        	Message outgoingMsg = MessageFactory.getInstance().getMessage();
+        	outgoingMsg.getHeader().getCall().setTo(toEpr);
+        	outgoingMsg.getHeader().getCall().setReplyTo(replyToEpr);
+        	outgoingMsg.getBody().setByteArray(text_1.getBytes());
+        	CourierUtil.deliverMessage(outgoingMsg);
+
+        	// Mock a service that picks up the original message and replies
+        	FileEpr serviceEpr = new FileEpr(toEpr.getURL());
+        	serviceEpr.setInputSuffix(initialSuffix);
+        	serviceEpr.setPostDelete(true);
+        	PickUpOnlyCourier listener = CourierFactory.getPickupCourier(serviceEpr);
+        	Message received = listener.pickup(100);
+        	String text_2 = new String(received.getBody().getByteArray());
+        	assertTrue(text_1.equals(text_2));
+        	assertTrue(replyToEpr.equals(received.getHeader().getCall().getReplyTo()));
+        	
+        	// now respond to replyTo
+        	text_2	+= " + processed by listener";
+        	Message response = MessageFactory.getInstance().getMessage();
+        	response.getHeader().getCall().setTo(received.getHeader().getCall().getReplyTo());
+        	response.getBody().setByteArray(text_2.getBytes());
+        	CourierUtil.deliverMessage(response);
+        	
+        	// try to pick up reply
+        	PickUpOnlyCourier waiter = CourierFactory.getPickupCourier(replyToEpr);
+        	Message finalMsg = waiter.pickup(100);
+        	assertTrue(text_2.equals(new String(finalMsg.getBody().getByteArray())));
+        	
+        	_logger.info(text_2+"... and back from local filesystem");
+        	_logger.info("getDefaultReplyToEpr test succeeded for local file transport");
+
+        }
+        catch (Exception e)
+        {
+        	_logger.error(e);
+            assertTrue(false);
+        }
+    }
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFtpReplyToEprIntegrationTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFtpReplyToEprIntegrationTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFtpReplyToEprIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,140 +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.addressing.eprs.tests;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Unit tests for default reply to
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
- */
-
-
-public class DefaultFtpReplyToEprIntegrationTest extends BaseTest
-{
-
-	private static Class thisClass = DefaultFtpReplyToEprIntegrationTest.class;
-	static Logger _logger = Logger.getLogger(thisClass);
-	
-    public static junit.framework.Test suite()
-    {
-        return new JUnit4TestAdapter(thisClass);
-    }
-    
-    @BeforeClass
-    public static void runBeforeAllTests()
-    {
-    	_logger.info("@BeforeClass invoked");
-    }
-
-
-    @AfterClass
-    public static void runAfterAllTests() throws Exception
-    {
-    	_logger.info("_________________________________________");
-    	_logger.info("@AfterClass invoked");
-    }
-
-    
-    @Test
-    public void mockTest() {
-  	_logger.info("place holder");
-  	assertTrue(true);
-  }
-
-    @Test
-    public void testFTPEpr()
-    {
-    	String ftpUrl = null;
-
-    	if (getFtpPwd() != null)
-			ftpUrl = "ftp://" + getFtpUser() + ":" + getFtpPwd()+ "@" + getFtpHostname() + getFtpDir();
-		else
-			ftpUrl = "ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir();
-    	
-    	_logger.info("_________________________________________");
-    	_logger.info("testFTPEpr() invoked");
-        try
-        {
-        	String initialSuffix = ".ftpmsg";
-        	
-        	//  Send a Message that will be picked up by a listener, and specify replyTo
-        	FTPEpr toEpr = new FTPEpr(ftpUrl);
-        	toEpr.setInputSuffix(initialSuffix);
-        	toEpr.setPostDelete(true);
-        	toEpr.setPostSuffix(initialSuffix);
-        	FTPEpr replyToEpr = (FTPEpr)CourierUtil.getDefaultReplyToEpr(toEpr);
-
-        	String text_1 = "Outgoing";
-        	Message outgoingMsg = MessageFactory.getInstance().getMessage();
-        	outgoingMsg.getHeader().getCall().setTo(toEpr);
-        	outgoingMsg.getHeader().getCall().setReplyTo(replyToEpr);
-        	outgoingMsg.getBody().setByteArray(text_1.getBytes());
-        	CourierUtil.deliverMessage(outgoingMsg);
-
-        	// Mock a service that picks up the original message and replies
-        	FTPEpr serviceEpr = new FTPEpr(toEpr.getURL());
-        	serviceEpr.setInputSuffix(initialSuffix);
-        	serviceEpr.setPostDelete(true);
-        	PickUpOnlyCourier listener = CourierFactory.getPickupCourier(serviceEpr);
-        	Message received = listener.pickup(100);
-        	String text_2 = new String(received.getBody().getByteArray());
-        	assertTrue(text_1.equals(text_2));
-        	assertTrue(replyToEpr.equals(received.getHeader().getCall().getReplyTo()));
-        	
-        	// now respond to replyTo
-        	text_2	+= " + processed by listener";
-        	Message response = MessageFactory.getInstance().getMessage();
-        	response.getHeader().getCall().setTo(received.getHeader().getCall().getReplyTo());
-        	response.getBody().setByteArray(text_2.getBytes());
-        	CourierUtil.deliverMessage(response);
-        	
-        	// try to pick up reply
-        	PickUpOnlyCourier waiter = CourierFactory.getPickupCourier(replyToEpr);
-        	Message finalMsg = waiter.pickup(100);
-        	assertTrue(text_2.equals(new String(finalMsg.getBody().getByteArray())));
-        	
-        	_logger.info(text_2+"... and back from FTP server");
-        	_logger.info("getDefaultReplyToEpr test succeeded for FTP transport");
-
-        }
-        catch (Exception e)
-        {
-        	_logger.error(e);
-            assertTrue(false);
-        }
-    }
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFtpReplyToEprIntegrationTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFtpReplyToEprIntegrationTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFtpReplyToEprIntegrationTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultFtpReplyToEprIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,140 @@
+/*
+ * 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.addressing.eprs.tests;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Unit tests for default reply to
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
+ */
+
+
+public class DefaultFtpReplyToEprIntegrationTest extends BaseTest
+{
+
+	private static Class thisClass = DefaultFtpReplyToEprIntegrationTest.class;
+	static Logger _logger = Logger.getLogger(thisClass);
+	
+    public static junit.framework.Test suite()
+    {
+        return new JUnit4TestAdapter(thisClass);
+    }
+    
+    @BeforeClass
+    public static void runBeforeAllTests()
+    {
+    	_logger.info("@BeforeClass invoked");
+    }
+
+
+    @AfterClass
+    public static void runAfterAllTests() throws Exception
+    {
+    	_logger.info("_________________________________________");
+    	_logger.info("@AfterClass invoked");
+    }
+
+    
+    @Test
+    public void mockTest() {
+  	_logger.info("place holder");
+  	assertTrue(true);
+  }
+
+    @Test
+    public void testFTPEpr()
+    {
+    	String ftpUrl = null;
+
+    	if (getFtpPwd() != null)
+			ftpUrl = "ftp://" + getFtpUser() + ":" + getFtpPwd()+ "@" + getFtpHostname() + getFtpDir();
+		else
+			ftpUrl = "ftp://" + getFtpUser() + "@" + getFtpHostname() + getFtpDir();
+    	
+    	_logger.info("_________________________________________");
+    	_logger.info("testFTPEpr() invoked");
+        try
+        {
+        	String initialSuffix = ".ftpmsg";
+        	
+        	//  Send a Message that will be picked up by a listener, and specify replyTo
+        	FTPEpr toEpr = new FTPEpr(ftpUrl);
+        	toEpr.setInputSuffix(initialSuffix);
+        	toEpr.setPostDelete(true);
+        	toEpr.setPostSuffix(initialSuffix);
+        	FTPEpr replyToEpr = (FTPEpr)CourierUtil.getDefaultReplyToEpr(toEpr);
+
+        	String text_1 = "Outgoing";
+        	Message outgoingMsg = MessageFactory.getInstance().getMessage();
+        	outgoingMsg.getHeader().getCall().setTo(toEpr);
+        	outgoingMsg.getHeader().getCall().setReplyTo(replyToEpr);
+        	outgoingMsg.getBody().setByteArray(text_1.getBytes());
+        	CourierUtil.deliverMessage(outgoingMsg);
+
+        	// Mock a service that picks up the original message and replies
+        	FTPEpr serviceEpr = new FTPEpr(toEpr.getURL());
+        	serviceEpr.setInputSuffix(initialSuffix);
+        	serviceEpr.setPostDelete(true);
+        	PickUpOnlyCourier listener = CourierFactory.getPickupCourier(serviceEpr);
+        	Message received = listener.pickup(100);
+        	String text_2 = new String(received.getBody().getByteArray());
+        	assertTrue(text_1.equals(text_2));
+        	assertTrue(replyToEpr.equals(received.getHeader().getCall().getReplyTo()));
+        	
+        	// now respond to replyTo
+        	text_2	+= " + processed by listener";
+        	Message response = MessageFactory.getInstance().getMessage();
+        	response.getHeader().getCall().setTo(received.getHeader().getCall().getReplyTo());
+        	response.getBody().setByteArray(text_2.getBytes());
+        	CourierUtil.deliverMessage(response);
+        	
+        	// try to pick up reply
+        	PickUpOnlyCourier waiter = CourierFactory.getPickupCourier(replyToEpr);
+        	Message finalMsg = waiter.pickup(100);
+        	assertTrue(text_2.equals(new String(finalMsg.getBody().getByteArray())));
+        	
+        	_logger.info(text_2+"... and back from FTP server");
+        	_logger.info("getDefaultReplyToEpr test succeeded for FTP transport");
+
+        }
+        catch (Exception e)
+        {
+        	_logger.error(e);
+            assertTrue(false);
+        }
+    }
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,211 +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.addressing.eprs.tests;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.net.URISyntaxException;
-import java.sql.SQLException;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.couriers.CourierUtil;
-import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
-import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Unit tests for file default reply to
- *
- * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
- */
-
-
-public class DefaultJdbcReplyToEprUnitTest
-{
-
-	private static Class thisClass = DefaultJdbcReplyToEprUnitTest.class;
-	static Logger _logger = Logger.getLogger(thisClass);
-	
-    public static junit.framework.Test suite()
-    {
-        return new JUnit4TestAdapter(thisClass);
-    }
-    
-    static File WORKDIR;
-    static
-    {
-    	String os = System.getProperty("os.name","").toLowerCase();
-    	String dflt = (os.indexOf("win")>=0) ? "/temp": "/tmp";
-    	WORKDIR	= new File(System.getProperty("java.io.tmpdir",dflt));
-    }
-
-	private static String _dbFileName = WORKDIR + "/defaultReplyEprDB";
-	private static String mDbDriver ="org.hsqldb.jdbcDriver";
-	private static String mDbUrl = "jdbc:hsqldb:" + (new File(_dbFileName)).toURI();
-	private static String mDbUsername = "sa";
-	private static String mDbPassword ="";
-	private static JdbcCleanConn _dbConn; 
-	
-    @BeforeClass
-    public static void runBeforeAllTests()
-    {
-    	_logger.info("@Starting HSQL database");
-        try
-        {
-        	Class.forName(mDbDriver);
-            HsqldbUtil.startHsqldb(_dbFileName, "defaultReplyEprDB");
-            _dbConn = new JdbcCleanConn
-  				(new SimpleDataSource(mDbDriver,mDbUrl,mDbUsername,mDbPassword));
-            createMessageTable("foo");
-            createMessageTable("foo_reply_table");
-        }
-        catch (Exception e)
-        {
-            _logger.error("No Database Available - Stop Testing", e);
-            assertTrue(false);
-        }
-    }
-
-
-    @AfterClass
-    public static void runAfterAllTests() throws Exception
-    {
-    	_logger.info("_________________________________________");
-    	try
-        {
-    		dropTable("foo");
-            dropTable("foo_reply_table");
-        	_dbConn.release();
-        }
-    	finally
-    	{
-    		HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
-    		_logger.info("Database Shutdown Complete");
-    	}
-    }
-
-    
-  @Test
-    public void testJdbcReplyEpr()
-    {
-  		_logger.info("_________________________________________");
-    	_logger.info("testJdbcReplyEpr() invoked");
-        try
-        {
-        	//  Send a Message that will be picked up by a listener, and specify replyTo
-        	JDBCEpr toEpr = getEpr("foo");
-        	JDBCEpr replyToEpr = (JDBCEpr)CourierUtil.getDefaultReplyToEpr(toEpr);
-
-        	String text_1 = "Outgoing";
-        	Message outgoingMsg = MessageFactory.getInstance().getMessage();
-        	outgoingMsg.getHeader().getCall().setTo(toEpr);
-        	outgoingMsg.getHeader().getCall().setReplyTo(replyToEpr);
-        	outgoingMsg.getBody().setByteArray(text_1.getBytes());
-        	CourierUtil.deliverMessage(outgoingMsg);
-
-        	// Mock a service that picks up the original message and replies
-        	JDBCEpr serviceEpr = getEpr("foo");
-        	PickUpOnlyCourier listener = CourierFactory.getPickupCourier(serviceEpr);
-        	Message received = listener.pickup(100);
-        	String text_2 = new String(received.getBody().getByteArray());
-        	assertTrue(text_1.equals(text_2));
-//        	assertTrue(replyToEpr.equals(received.getHeader().getCall().getReplyTo()));
-        	
-        	// now respond to replyTo
-        	text_2	+= " + processed by listener";
-        	Message response = MessageFactory.getInstance().getMessage();
-        	response.getHeader().getCall().setTo(received.getHeader().getCall().getReplyTo());
-        	response.getBody().setByteArray(text_2.getBytes());
-        	CourierUtil.deliverMessage(response);
-        	
-        	// try to pick up reply
-        	PickUpOnlyCourier waiter = CourierFactory.getPickupCourier(replyToEpr);
-        	Message finalMsg = waiter.pickup(100);
-        	assertTrue(text_2.equals(new String(finalMsg.getBody().getByteArray())));
-        	
-        	_logger.info(text_2+"... and back from jdbc ReplyTo EPR");
-        	_logger.info("getDefaultReplyToEpr test succeeded for JDBC message transport");
-
-        }
-        catch (Exception e)
-        {
-  			_logger.error(e);
-            assertTrue(false);
-        }
-    }
-	private static void dropTable(String tableName) throws Exception
-	{
-			StringBuilder sb = new StringBuilder("drop table ")
-				.append(tableName).append(" if exists");
-			_dbConn.execUpdWait(_dbConn.prepareStatement(sb.toString()),1);
-            _dbConn.commit();
-    }
-  	private static void createMessageTable(String tableName) throws Exception
-  	{
-  		try
-  		{
-  			dropTable(tableName);
-  			JDBCEpr epr = getEpr(tableName);
-  			StringBuilder sb = new StringBuilder("create table ").append(tableName)
-  				.append("(").append(epr.getMessageIdColumn())	.append(" varchar")
-  				.append(",").append(epr.getStatusColumn())		.append(" varchar")
-  				.append(",").append(epr.getTimestampColumn())	.append(" bigint")
-  				.append(",").append(epr.getDataColumn())		.append(" varchar")
-  				.append(")")
-  			;
-  			_dbConn.execUpdWait(_dbConn.prepareStatement(sb.toString()),1);
-            _dbConn.commit();
-  		}
-  		catch (SQLException e) 
-  		{
-  			_logger.error(e);
-  			throw e;
-  		}
-  	}
-  	
-  	private static JDBCEpr getEpr(String tableName) throws URISyntaxException
-  	{
-		JDBCEpr epr = new JDBCEpr(mDbUrl,true,true);
-		epr.setDriver	(mDbDriver);
-		epr.setUserName	(mDbUsername);
-		epr.setPassword	(mDbPassword);
-
-		epr.setTableName		(tableName);
-		epr.setMessageIdColumn	("message_id_col");
-		epr.setStatusColumn		("status_col");
-		epr.setDataColumn		("data_col");
-		epr.setTimestampColumn	("stamp_col");
-
-		return epr;
-  	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/eprs/tests/DefaultJdbcReplyToEprUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,211 @@
+/*
+ * 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.addressing.eprs.tests;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.net.URISyntaxException;
+import java.sql.SQLException;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.PickUpOnlyCourier;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.couriers.CourierUtil;
+import org.jboss.soa.esb.helpers.persist.JdbcCleanConn;
+import org.jboss.soa.esb.helpers.persist.SimpleDataSource;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Unit tests for file default reply to
+ *
+ * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
+ */
+
+
+public class DefaultJdbcReplyToEprUnitTest
+{
+
+	private static Class thisClass = DefaultJdbcReplyToEprUnitTest.class;
+	static Logger _logger = Logger.getLogger(thisClass);
+	
+    public static junit.framework.Test suite()
+    {
+        return new JUnit4TestAdapter(thisClass);
+    }
+    
+    static File WORKDIR;
+    static
+    {
+    	String os = System.getProperty("os.name","").toLowerCase();
+    	String dflt = (os.indexOf("win")>=0) ? "/temp": "/tmp";
+    	WORKDIR	= new File(System.getProperty("java.io.tmpdir",dflt));
+    }
+
+	private static String _dbFileName = WORKDIR + "/defaultReplyEprDB";
+	private static String mDbDriver ="org.hsqldb.jdbcDriver";
+	private static String mDbUrl = "jdbc:hsqldb:" + (new File(_dbFileName)).toURI();
+	private static String mDbUsername = "sa";
+	private static String mDbPassword ="";
+	private static JdbcCleanConn _dbConn; 
+	
+    @BeforeClass
+    public static void runBeforeAllTests()
+    {
+    	_logger.info("@Starting HSQL database");
+        try
+        {
+        	Class.forName(mDbDriver);
+            HsqldbUtil.startHsqldb(_dbFileName, "defaultReplyEprDB");
+            _dbConn = new JdbcCleanConn
+  				(new SimpleDataSource(mDbDriver,mDbUrl,mDbUsername,mDbPassword));
+            createMessageTable("foo");
+            createMessageTable("foo_reply_table");
+        }
+        catch (Exception e)
+        {
+            _logger.error("No Database Available - Stop Testing", e);
+            assertTrue(false);
+        }
+    }
+
+
+    @AfterClass
+    public static void runAfterAllTests() throws Exception
+    {
+    	_logger.info("_________________________________________");
+    	try
+        {
+    		dropTable("foo");
+            dropTable("foo_reply_table");
+        	_dbConn.release();
+        }
+    	finally
+    	{
+    		HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
+    		_logger.info("Database Shutdown Complete");
+    	}
+    }
+
+    
+  @Test
+    public void testJdbcReplyEpr()
+    {
+  		_logger.info("_________________________________________");
+    	_logger.info("testJdbcReplyEpr() invoked");
+        try
+        {
+        	//  Send a Message that will be picked up by a listener, and specify replyTo
+        	JDBCEpr toEpr = getEpr("foo");
+        	JDBCEpr replyToEpr = (JDBCEpr)CourierUtil.getDefaultReplyToEpr(toEpr);
+
+        	String text_1 = "Outgoing";
+        	Message outgoingMsg = MessageFactory.getInstance().getMessage();
+        	outgoingMsg.getHeader().getCall().setTo(toEpr);
+        	outgoingMsg.getHeader().getCall().setReplyTo(replyToEpr);
+        	outgoingMsg.getBody().setByteArray(text_1.getBytes());
+        	CourierUtil.deliverMessage(outgoingMsg);
+
+        	// Mock a service that picks up the original message and replies
+        	JDBCEpr serviceEpr = getEpr("foo");
+        	PickUpOnlyCourier listener = CourierFactory.getPickupCourier(serviceEpr);
+        	Message received = listener.pickup(100);
+        	String text_2 = new String(received.getBody().getByteArray());
+        	assertTrue(text_1.equals(text_2));
+//        	assertTrue(replyToEpr.equals(received.getHeader().getCall().getReplyTo()));
+        	
+        	// now respond to replyTo
+        	text_2	+= " + processed by listener";
+        	Message response = MessageFactory.getInstance().getMessage();
+        	response.getHeader().getCall().setTo(received.getHeader().getCall().getReplyTo());
+        	response.getBody().setByteArray(text_2.getBytes());
+        	CourierUtil.deliverMessage(response);
+        	
+        	// try to pick up reply
+        	PickUpOnlyCourier waiter = CourierFactory.getPickupCourier(replyToEpr);
+        	Message finalMsg = waiter.pickup(100);
+        	assertTrue(text_2.equals(new String(finalMsg.getBody().getByteArray())));
+        	
+        	_logger.info(text_2+"... and back from jdbc ReplyTo EPR");
+        	_logger.info("getDefaultReplyToEpr test succeeded for JDBC message transport");
+
+        }
+        catch (Exception e)
+        {
+  			_logger.error(e);
+            assertTrue(false);
+        }
+    }
+	private static void dropTable(String tableName) throws Exception
+	{
+			StringBuilder sb = new StringBuilder("drop table ")
+				.append(tableName).append(" if exists");
+			_dbConn.execUpdWait(_dbConn.prepareStatement(sb.toString()),1);
+            _dbConn.commit();
+    }
+  	private static void createMessageTable(String tableName) throws Exception
+  	{
+  		try
+  		{
+  			dropTable(tableName);
+  			JDBCEpr epr = getEpr(tableName);
+  			StringBuilder sb = new StringBuilder("create table ").append(tableName)
+  				.append("(").append(epr.getMessageIdColumn())	.append(" varchar")
+  				.append(",").append(epr.getStatusColumn())		.append(" varchar")
+  				.append(",").append(epr.getTimestampColumn())	.append(" bigint")
+  				.append(",").append(epr.getDataColumn())		.append(" varchar")
+  				.append(")")
+  			;
+  			_dbConn.execUpdWait(_dbConn.prepareStatement(sb.toString()),1);
+            _dbConn.commit();
+  		}
+  		catch (SQLException e) 
+  		{
+  			_logger.error(e);
+  			throw e;
+  		}
+  	}
+  	
+  	private static JDBCEpr getEpr(String tableName) throws URISyntaxException
+  	{
+		JDBCEpr epr = new JDBCEpr(mDbUrl,true,true);
+		epr.setDriver	(mDbDriver);
+		epr.setUserName	(mDbUsername);
+		epr.setPassword	(mDbPassword);
+
+		epr.setTableName		(tableName);
+		epr.setMessageIdColumn	("message_id_col");
+		epr.setStatusColumn		("status_col");
+		epr.setDataColumn		("data_col");
+		epr.setTimestampColumn	("stamp_col");
+
+		return epr;
+  	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/EmailUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/EmailUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/EmailUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,68 +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.addressing.helpers.tests;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.addressing.eprs.EmailEpr;
-
-/**
- * Unit tests for the EPR class.
- * 
- * @author Mark Little
- */
-
-public class EmailUnitTest extends TestCase
-{
-
-	public void testConstructor ()
-	{
-		try
-		{
-			new EmailEpr(EmailEpr.SMTP_PROTOCOL, "myhost", "25", "foo", "bar");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGet ()
-	{
-		try
-		{
-			EmailEpr em = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "myhost", "25", "foo", "bar");
-			
-			assertEquals(em.getHost(), "myhost");
-			assertEquals(em.getProtocol(), EmailEpr.SMTP_PROTOCOL);
-			assertEquals(em.getPort(), 25);
-			assertEquals(em.getUserName(), "foo");
-			assertEquals(em.getPassword(), "bar");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/EmailUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/EmailUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/EmailUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/EmailUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,68 @@
+/*
+ * 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.addressing.helpers.tests;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.eprs.EmailEpr;
+
+/**
+ * Unit tests for the EPR class.
+ * 
+ * @author Mark Little
+ */
+
+public class EmailUnitTest extends TestCase
+{
+
+	public void testConstructor ()
+	{
+		try
+		{
+			new EmailEpr(EmailEpr.SMTP_PROTOCOL, "myhost", "25", "foo", "bar");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGet ()
+	{
+		try
+		{
+			EmailEpr em = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "myhost", "25", "foo", "bar");
+			
+			assertEquals(em.getHost(), "myhost");
+			assertEquals(em.getProtocol(), EmailEpr.SMTP_PROTOCOL);
+			assertEquals(em.getPort(), 25);
+			assertEquals(em.getUserName(), "foo");
+			assertEquals(em.getPassword(), "bar");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/FTPUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/FTPUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/FTPUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.addressing.helpers.tests;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-
-/**
- * Unit tests for the EPR class.
- * 
- * @author Mark Little
- */
-
-public class FTPUnitTest extends TestCase
-{
-
-	public void testConstructor ()
-	{
-		try
-		{
-			new FTPEpr("ftp://foo.com");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGet ()
-	{
-		try
-		{
-			FTPEpr ftp = new FTPEpr("ftp://foo.com");
-			
-			assertEquals(ftp.getURL().toString(), "ftp://foo.com");
-			assertEquals(ftp.getURL().getHost(), "foo.com");
-			assertEquals(ftp.getURL().getProtocol(), "ftp");
-			
-			ftp.setPassword("foobar");
-			assertEquals(ftp.getPassword(), "foobar");
-			
-			ftp.setUserName("barfoo");
-			assertEquals(ftp.getUserName(), "barfoo");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/FTPUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/FTPUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/FTPUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/FTPUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,72 @@
+/*
+ * 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.addressing.helpers.tests;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+
+/**
+ * Unit tests for the EPR class.
+ * 
+ * @author Mark Little
+ */
+
+public class FTPUnitTest extends TestCase
+{
+
+	public void testConstructor ()
+	{
+		try
+		{
+			new FTPEpr("ftp://foo.com");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGet ()
+	{
+		try
+		{
+			FTPEpr ftp = new FTPEpr("ftp://foo.com");
+			
+			assertEquals(ftp.getURL().toString(), "ftp://foo.com");
+			assertEquals(ftp.getURL().getHost(), "foo.com");
+			assertEquals(ftp.getURL().getProtocol(), "ftp");
+			
+			ftp.setPassword("foobar");
+			assertEquals(ftp.getPassword(), "foobar");
+			
+			ftp.setUserName("barfoo");
+			assertEquals(ftp.getUserName(), "barfoo");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/HTTPUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/HTTPUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/HTTPUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,73 +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.addressing.helpers.tests;
-
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
-
-/**
- * Unit tests for the EPR class.
- * 
- * @author Mark Little
- */
-
-public class HTTPUnitTest extends TestCase
-{
-
-	public void testConstructor ()
-	{
-		try
-		{
-			String url1 = "http://www.local.bar:8080";
-			new HTTPEpr(url1);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGet ()
-	{
-		try
-		{
-			String url1 = "http://www.local.bar:8080";
-			HTTPEpr epr = new HTTPEpr(url1);
-			
-			assertEquals(epr.getURL().toString(), url1);
-			
-			String url2 = "http://foo.com";
-			epr.setURL(new URL(url2));
-			
-			assertEquals(epr.getURL().toString(), url2);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/HTTPUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/HTTPUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/HTTPUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/HTTPUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,73 @@
+/*
+ * 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.addressing.helpers.tests;
+
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
+
+/**
+ * Unit tests for the EPR class.
+ * 
+ * @author Mark Little
+ */
+
+public class HTTPUnitTest extends TestCase
+{
+
+	public void testConstructor ()
+	{
+		try
+		{
+			String url1 = "http://www.local.bar:8080";
+			new HTTPEpr(url1);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGet ()
+	{
+		try
+		{
+			String url1 = "http://www.local.bar:8080";
+			HTTPEpr epr = new HTTPEpr(url1);
+			
+			assertEquals(epr.getURL().toString(), url1);
+			
+			String url2 = "http://foo.com";
+			epr.setURL(new URL(url2));
+			
+			assertEquals(epr.getURL().toString(), url2);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JDBCUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JDBCUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JDBCUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.addressing.helpers.tests;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-
-/**
- * Unit tests for the EPR class.
- * 
- * @author Mark Little
- */
-
-public class JDBCUnitTest extends TestCase
-{
-
-	public void testConstructor ()
-	{
-		try
-		{
-			new JDBCEpr("jdbc:arjuna:oracle:thin", "CREATE TABLE foo");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGet ()
-	{
-		try
-		{
-			JDBCEpr em = new JDBCEpr("jdbc:arjuna:oracle:thin", "CREATE TABLE foo");
-			
-			assertEquals(em.getURL(), "jdbc:arjuna:oracle:thin");
-			assertEquals(em.getSQL(), "CREATE TABLE foo");
-			
-			em.setURL("jdbc:arjuna:oracle:thin");
-			assertEquals(em.getURL(), "jdbc:arjuna:oracle:thin");
-			
-			em.setUserName("me");
-			assertEquals(em.getUserName(), "me");
-			
-			em.setPassword("foobar");
-			assertEquals(em.getPassword(), "foobar");
-			
-			try
-			{
-				em.setSQL("INVALID");
-				
-				fail();
-			}
-			catch (IllegalStateException ex)
-			{
-			}
-			catch (Exception ex)
-			{
-				fail(ex.toString());
-			}
-			
-			em.setDriver("cloudscape");
-			assertEquals(em.getDriver(), "cloudscape");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JDBCUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JDBCUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JDBCUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JDBCUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,91 @@
+/*
+ * 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.addressing.helpers.tests;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+
+/**
+ * Unit tests for the EPR class.
+ * 
+ * @author Mark Little
+ */
+
+public class JDBCUnitTest extends TestCase
+{
+
+	public void testConstructor ()
+	{
+		try
+		{
+			new JDBCEpr("jdbc:arjuna:oracle:thin", "CREATE TABLE foo");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGet ()
+	{
+		try
+		{
+			JDBCEpr em = new JDBCEpr("jdbc:arjuna:oracle:thin", "CREATE TABLE foo");
+			
+			assertEquals(em.getURL(), "jdbc:arjuna:oracle:thin");
+			assertEquals(em.getSQL(), "CREATE TABLE foo");
+			
+			em.setURL("jdbc:arjuna:oracle:thin");
+			assertEquals(em.getURL(), "jdbc:arjuna:oracle:thin");
+			
+			em.setUserName("me");
+			assertEquals(em.getUserName(), "me");
+			
+			em.setPassword("foobar");
+			assertEquals(em.getPassword(), "foobar");
+			
+			try
+			{
+				em.setSQL("INVALID");
+				
+				fail();
+			}
+			catch (IllegalStateException ex)
+			{
+			}
+			catch (Exception ex)
+			{
+				fail(ex.toString());
+			}
+			
+			em.setDriver("cloudscape");
+			assertEquals(em.getDriver(), "cloudscape");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,67 +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.addressing.helpers.tests;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-
-/**
- * Unit tests for the EPR class.
- * 
- * @author Mark Little
- */
-
-public class JMSUnitTest extends TestCase
-{
-
-	public void testConstructor ()
-	{
-		try
-		{
-			new JMSEpr(JMSEpr.ONE_ONE_PROTOCOL, JMSEpr.QUEUE_TYPE, "bar", "foobar",null,null);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGet ()
-	{
-		try
-		{
-			JMSEpr jms = new JMSEpr(JMSEpr.ONE_ONE_PROTOCOL, JMSEpr.QUEUE_TYPE, "bar", "foobar",null,null);
-			
-			assertEquals(jms.getVersion(), JMSEpr.ONE_ONE_PROTOCOL);
-			assertEquals(jms.getConnectionFactory(), "foobar");
-			assertEquals(jms.getDestinationType(), JMSEpr.QUEUE_TYPE);
-			assertEquals(jms.getDestinationName(), "bar");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/helpers/tests/JMSUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,67 @@
+/*
+ * 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.addressing.helpers.tests;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+
+/**
+ * Unit tests for the EPR class.
+ * 
+ * @author Mark Little
+ */
+
+public class JMSUnitTest extends TestCase
+{
+
+	public void testConstructor ()
+	{
+		try
+		{
+			new JMSEpr(JMSEpr.ONE_ONE_PROTOCOL, JMSEpr.QUEUE_TYPE, "bar", "foobar",null,null);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGet ()
+	{
+		try
+		{
+			JMSEpr jms = new JMSEpr(JMSEpr.ONE_ONE_PROTOCOL, JMSEpr.QUEUE_TYPE, "bar", "foobar",null,null);
+			
+			assertEquals(jms.getVersion(), JMSEpr.ONE_ONE_PROTOCOL);
+			assertEquals(jms.getConnectionFactory(), "foobar");
+			assertEquals(jms.getDestinationType(), JMSEpr.QUEUE_TYPE);
+			assertEquals(jms.getDestinationName(), "bar");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,195 +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.addressing.tests;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.EPR;
-
-/**
- * Unit tests for the Class class.
- * 
- * @author Mark Little
- */
-
-public class CallUnitTest extends TestCase
-{
-	public void testConstructor ()
-	{
-		Call call = new Call();
-		
-		try
-		{
-			assertEquals((call.getTo() == null), true);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testEPRConstructor ()
-	{
-		try
-		{
-			EPR epr = new EPR(new URI("http://localhost"));
-			Call call = new Call(epr);
-			
-			assertEquals(call.getTo().equals(epr), true);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGetTo ()
-	{
-		Call call = new Call();
-		
-		try
-		{
-			EPR epr = new EPR(new URI("http://localhost"));
-			
-			call.setTo(epr);
-			
-			assertEquals(call.getTo().equals(epr), true);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGetFrom ()
-	{
-		Call call = new Call();
-		
-		try
-		{
-			EPR epr = new EPR(new URI("http://localhost"));
-			
-			call.setFrom(epr);
-			
-			assertEquals(call.getFrom().equals(epr), true);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGetReplyTo ()
-	{
-		Call call = new Call();
-		
-		try
-		{
-			EPR epr = new EPR(new URI("http://localhost"));
-			
-			call.setReplyTo(epr);
-			
-			assertEquals(call.getReplyTo().equals(epr), true);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGetFaultTo ()
-	{
-		Call call = new Call();
-		
-		try
-		{
-			EPR epr = new EPR(new URI("http://localhost"));
-			
-			call.setFaultTo(epr);
-			
-			assertEquals(call.getFaultTo().equals(epr), true);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGetRelatesTo ()
-	{
-		Call call = new Call();
-		
-		try
-		{
-			URI uri = new URI("urn:1234");
-			
-			call.setRelatesTo(uri);
-			
-			assertEquals(call.getRelatesTo().equals(uri), true);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGetAction ()
-	{
-		Call call = new Call();
-		
-		try
-		{
-			URI uri = new URI("urn:1234");
-			
-			call.setAction(uri);
-			
-			assertEquals(call.getAction().equals(uri), true);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetGetMessageID ()
-	{
-		Call call = new Call();
-		
-		try
-		{
-			URI uri = new URI("urn:1234");
-			
-			call.setMessageID(uri);
-			
-			assertEquals(call.getMessageID().equals(uri), true);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/CallUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,195 @@
+/*
+ * 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.addressing.tests;
+
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class CallUnitTest extends TestCase
+{
+	public void testConstructor ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			assertEquals((call.getTo() == null), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testEPRConstructor ()
+	{
+		try
+		{
+			EPR epr = new EPR(new URI("http://localhost"));
+			Call call = new Call(epr);
+			
+			assertEquals(call.getTo().equals(epr), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetTo ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			EPR epr = new EPR(new URI("http://localhost"));
+			
+			call.setTo(epr);
+			
+			assertEquals(call.getTo().equals(epr), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetFrom ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			EPR epr = new EPR(new URI("http://localhost"));
+			
+			call.setFrom(epr);
+			
+			assertEquals(call.getFrom().equals(epr), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetReplyTo ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			EPR epr = new EPR(new URI("http://localhost"));
+			
+			call.setReplyTo(epr);
+			
+			assertEquals(call.getReplyTo().equals(epr), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetFaultTo ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			EPR epr = new EPR(new URI("http://localhost"));
+			
+			call.setFaultTo(epr);
+			
+			assertEquals(call.getFaultTo().equals(epr), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetRelatesTo ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			URI uri = new URI("urn:1234");
+			
+			call.setRelatesTo(uri);
+			
+			assertEquals(call.getRelatesTo().equals(uri), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetAction ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			URI uri = new URI("urn:1234");
+			
+			call.setAction(uri);
+			
+			assertEquals(call.getAction().equals(uri), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetGetMessageID ()
+	{
+		Call call = new Call();
+		
+		try
+		{
+			URI uri = new URI("urn:1234");
+			
+			call.setMessageID(uri);
+			
+			assertEquals(call.getMessageID().equals(uri), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,172 +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.addressing.tests;
-
-import java.io.StringWriter;
-import java.net.URI;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.addressing.helpers.PortReferenceHelper;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.PortReference;
-import org.jboss.soa.esb.addressing.XMLUtil;
-import org.jboss.soa.esb.addressing.eprs.EmailEpr;
-import org.jboss.soa.esb.message.tests.XMLMessageUnitTest;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
-/**
- * Unit tests for the EPR class.
- * 
- * @author Mark Little
- */
-
-public class EPRUnitTest extends TestCase
-{
-	
-	private Logger log = Logger.getLogger( XMLMessageUnitTest.class );
-	
-	public void testConstructor ()
-	{
-		EPR epr = new EPR();
-		
-		log.debug("Default EPR: "+epr);
-	}
-	
-	public void testPortReferenceConstructor ()
-	{
-		EPR epr = new EPR(new PortReference("http://localhost:8080"));
-		
-		assertEquals(epr.getAddr().getAddress(), "http://localhost:8080");
-	}
-	
-	public void testURIConstructor ()
-	{
-		try
-		{
-			EPR epr = new EPR(new URI("urn:foo/bar"));
-			
-			assertEquals(epr.getAddr().getAddress(), "urn:foo/bar");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testGetAddr ()
-	{
-		try
-		{
-			EPR epr = new EPR(new URI("urn:foo/bar"));
-		
-			assertEquals(epr.getAddr().getAddress(), "urn:foo/bar");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSetAddr ()
-	{
-		EPR epr = new EPR();
-		
-		epr.setAddr(new PortReference("http://localhost"));
-
-		try
-		{
-			assertEquals(epr.getAddr().getAddress(), "http://localhost");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testToFromXML ()
-	{
-		try
-		{
-			EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
-			
-			final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-			final DocumentBuilder builder = factory.newDocumentBuilder();
-			Document doc = builder.newDocument();
-			Element header = doc.createElement("header");
-			Element fromElement = doc.createElementNS(XMLUtil.WSA_NAMESPACE_URI, XMLUtil.WSA_PREFIX+":"+XMLUtil.FROM_TAG);
-			
-			doc.appendChild(header);
-			header.appendChild(fromElement);
-			
-			PortReferenceHelper.toXML(header, doc, fromElement, email.getAddr(), false);
-
-			final StringWriter sWriter = new StringWriter() ;
-			final OutputFormat format = new OutputFormat() ;
-			format.setIndenting(true) ;
-
-			final XMLSerializer xmlS = new XMLSerializer(sWriter, format) ;
-
-			xmlS.asDOMSerializer() ;
-			xmlS.serialize(doc) ;
-
-			log.debug("Exported XML: "+sWriter.toString());
-			
-			PortReference pr = PortReferenceHelper.fromXML(fromElement, false);			
-			
-			EPR basicEpr = new EPR(pr);
-			EmailEpr nEpr = new EmailEpr(basicEpr);
-
-			assertEquals(nEpr.getAddr().getAddress(), email.getAddr().getAddress());
-		}
-		catch (Exception ex)
-		{
-			fail();
-		}		
-	}
-	
-	public void testEquals ()
-	{
-		try
-		{
-			EPR epr1 = new EPR(new URI("http://localhost"));
-			EPR epr2 = new EPR(new URI("http://localhost"));
-			EPR epr3 = new EPR(new URI("http://localhost:8080"));
-			
-			assertEquals(epr1.equals(epr2), true);
-			assertEquals(epr1.equals(epr3), false);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/tests/EPRUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,172 @@
+/*
+ * 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.addressing.tests;
+
+import java.io.StringWriter;
+import java.net.URI;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.addressing.helpers.PortReferenceHelper;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.PortReference;
+import org.jboss.soa.esb.addressing.XMLUtil;
+import org.jboss.soa.esb.addressing.eprs.EmailEpr;
+import org.jboss.soa.esb.message.tests.XMLMessageUnitTest;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+
+import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+/**
+ * Unit tests for the EPR class.
+ * 
+ * @author Mark Little
+ */
+
+public class EPRUnitTest extends TestCase
+{
+	
+	private Logger log = Logger.getLogger( XMLMessageUnitTest.class );
+	
+	public void testConstructor ()
+	{
+		EPR epr = new EPR();
+		
+		log.debug("Default EPR: "+epr);
+	}
+	
+	public void testPortReferenceConstructor ()
+	{
+		EPR epr = new EPR(new PortReference("http://localhost:8080"));
+		
+		assertEquals(epr.getAddr().getAddress(), "http://localhost:8080");
+	}
+	
+	public void testURIConstructor ()
+	{
+		try
+		{
+			EPR epr = new EPR(new URI("urn:foo/bar"));
+			
+			assertEquals(epr.getAddr().getAddress(), "urn:foo/bar");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testGetAddr ()
+	{
+		try
+		{
+			EPR epr = new EPR(new URI("urn:foo/bar"));
+		
+			assertEquals(epr.getAddr().getAddress(), "urn:foo/bar");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSetAddr ()
+	{
+		EPR epr = new EPR();
+		
+		epr.setAddr(new PortReference("http://localhost"));
+
+		try
+		{
+			assertEquals(epr.getAddr().getAddress(), "http://localhost");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testToFromXML ()
+	{
+		try
+		{
+			EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
+			
+			final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+			final DocumentBuilder builder = factory.newDocumentBuilder();
+			Document doc = builder.newDocument();
+			Element header = doc.createElement("header");
+			Element fromElement = doc.createElementNS(XMLUtil.WSA_NAMESPACE_URI, XMLUtil.WSA_PREFIX+":"+XMLUtil.FROM_TAG);
+			
+			doc.appendChild(header);
+			header.appendChild(fromElement);
+			
+			PortReferenceHelper.toXML(header, doc, fromElement, email.getAddr(), false);
+
+			final StringWriter sWriter = new StringWriter() ;
+			final OutputFormat format = new OutputFormat() ;
+			format.setIndenting(true) ;
+
+			final XMLSerializer xmlS = new XMLSerializer(sWriter, format) ;
+
+			xmlS.asDOMSerializer() ;
+			xmlS.serialize(doc) ;
+
+			log.debug("Exported XML: "+sWriter.toString());
+			
+			PortReference pr = PortReferenceHelper.fromXML(fromElement, false);			
+			
+			EPR basicEpr = new EPR(pr);
+			EmailEpr nEpr = new EmailEpr(basicEpr);
+
+			assertEquals(nEpr.getAddr().getAddress(), email.getAddr().getAddress());
+		}
+		catch (Exception ex)
+		{
+			fail();
+		}		
+	}
+	
+	public void testEquals ()
+	{
+		try
+		{
+			EPR epr1 = new EPR(new URI("http://localhost"));
+			EPR epr2 = new EPR(new URI("http://localhost"));
+			EPR epr3 = new EPR(new URI("http://localhost:8080"));
+			
+			assertEquals(epr1.equals(epr2), true);
+			assertEquals(epr1.equals(epr3), false);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,62 +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.addressing.util.tests;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.EmailEpr;
-import org.jboss.soa.esb.message.tests.XMLMessageUnitTest;
-
-/**
- * Unit tests for the Class class.
- * 
- * @author Mark Little
- */
-
-public class EPRHelperUnitTest extends TestCase
-{
-	private Logger log = Logger.getLogger( XMLMessageUnitTest.class );
-	
-	public void testToFromXMLString () throws MarshalException, UnmarshalException
-	{
-		EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
-		
-		String xmlString = EPRHelper.toXMLString(email);
-		
-		log.debug("xmlString is: "+xmlString);
-		
-		EPR epr = EPRHelper.fromXMLString(xmlString);
-		
-		if (epr instanceof EmailEpr)
-		{
-		}
-		else
-		    fail();
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRHelperUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,62 @@
+/*
+ * 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.addressing.util.tests;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.addressing.helpers.EPRHelper;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.EmailEpr;
+import org.jboss.soa.esb.message.tests.XMLMessageUnitTest;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class EPRHelperUnitTest extends TestCase
+{
+	private Logger log = Logger.getLogger( XMLMessageUnitTest.class );
+	
+	public void testToFromXMLString () throws MarshalException, UnmarshalException
+	{
+		EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
+		
+		String xmlString = EPRHelper.toXMLString(email);
+		
+		log.debug("xmlString is: "+xmlString);
+		
+		EPR epr = EPRHelper.fromXMLString(xmlString);
+		
+		if (epr instanceof EmailEpr)
+		{
+		}
+		else
+		    fail();
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRManagerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRManagerUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRManagerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,124 +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.addressing.util.tests;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.EmailEpr;
-import org.jboss.soa.esb.addressing.util.EPRManager;
-
-/**
- * Unit tests for the Class class.
- * 
- * @author Mark Little
- */
-
-public class EPRManagerUnitTest extends TestCase
-{
-	private Logger log = Logger.getLogger( EPRManagerUnitTest.class );
-	
-	public void testCreate ()
-	{
-		EPRManager manager1 = EPRManager.getInstance(null);
-		EPRManager manager2 = EPRManager.getInstance("");
-		EPRManager manager3 = EPRManager.getInstance("/tmp");
-		
-		assertEquals(manager1.equals(manager2), true);
-		assertEquals(manager1.equals(manager3), false);
-	}
-	
-	public void testInputOutput ()
-	{
-		EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
-		
-		String tmpDir = System.getProperty("java.io.tmpdir");
-		EPRManager manager = EPRManager.getInstance(tmpDir);
-
-		try
-		{
-			manager.saveEPR("MyEmail", email);
-
-			EmailEpr loaded = new EmailEpr(manager.loadEPR("MyEmail"));
-		
-			assertEquals(loaded.getHost().equals("foobar"), true);
-			assertEquals(loaded.getPassword().equals("letmein"), true);
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			fail(ex.toString());
-		}
-		finally
-		{
-			try
-			{
-				manager.removeEPR("MyEmail");
-			}
-			catch (Exception ex)
-			{
-			}
-		}
-	}
-	
-	public void testSpecificInputOutput ()
-	{
-		EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
-		
-		String tmpDir = System.getProperty("java.io.tmpdir");
-		EPRManager manager = EPRManager.getInstance(tmpDir);
-
-		try
-		{
-			manager.saveEPR("MyEmail", email);
-			
-			EPR epr = manager.loadEPR("MyEmail");
-			
-			if (epr instanceof EmailEpr)
-			{
-			    
-			}
-			else
-			    fail();
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			fail(ex.toString());
-		}
-		finally
-		{
-			try
-			{
-				manager.removeEPR("MyEmail");
-			}
-			catch (Exception ex)
-			{
-			}
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRManagerUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRManagerUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRManagerUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/addressing/util/tests/EPRManagerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,124 @@
+/*
+ * 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.addressing.util.tests;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.EmailEpr;
+import org.jboss.soa.esb.addressing.util.EPRManager;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class EPRManagerUnitTest extends TestCase
+{
+	private Logger log = Logger.getLogger( EPRManagerUnitTest.class );
+	
+	public void testCreate ()
+	{
+		EPRManager manager1 = EPRManager.getInstance(null);
+		EPRManager manager2 = EPRManager.getInstance("");
+		EPRManager manager3 = EPRManager.getInstance("/tmp");
+		
+		assertEquals(manager1.equals(manager2), true);
+		assertEquals(manager1.equals(manager3), false);
+	}
+	
+	public void testInputOutput ()
+	{
+		EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
+		
+		String tmpDir = System.getProperty("java.io.tmpdir");
+		EPRManager manager = EPRManager.getInstance(tmpDir);
+
+		try
+		{
+			manager.saveEPR("MyEmail", email);
+
+			EmailEpr loaded = new EmailEpr(manager.loadEPR("MyEmail"));
+		
+			assertEquals(loaded.getHost().equals("foobar"), true);
+			assertEquals(loaded.getPassword().equals("letmein"), true);
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			fail(ex.toString());
+		}
+		finally
+		{
+			try
+			{
+				manager.removeEPR("MyEmail");
+			}
+			catch (Exception ex)
+			{
+			}
+		}
+	}
+	
+	public void testSpecificInputOutput ()
+	{
+		EmailEpr email = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foobar", "25", "me", "letmein");
+		
+		String tmpDir = System.getProperty("java.io.tmpdir");
+		EPRManager manager = EPRManager.getInstance(tmpDir);
+
+		try
+		{
+			manager.saveEPR("MyEmail", email);
+			
+			EPR epr = manager.loadEPR("MyEmail");
+			
+			if (epr instanceof EmailEpr)
+			{
+			    
+			}
+			else
+			    fail();
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			fail(ex.toString());
+		}
+		finally
+		{
+			try
+			{
+				manager.removeEPR("MyEmail");
+			}
+			catch (Exception ex)
+			{
+			}
+		}
+	}
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,124 +0,0 @@
-package org.jboss.soa.esb.command;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.command.CommandQueue;
-import org.jboss.internal.soa.esb.command.CommandQueueException;
-import org.jboss.internal.soa.esb.command.InMemoryCommandQueue;
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-public class InMemoryCommandQueueUnitTest extends TestCase {
-
-	public void test_args() throws CommandQueueException {
-		InMemoryCommandQueue commandQueue = new InMemoryCommandQueue();
-		
-		try {
-			commandQueue.open(null);
-			fail("Expected IllegalArgumentException.");
-		} catch (IllegalArgumentException e) {
-			// OK
-		}
-
-		ConfigTree config = new ConfigTree("config");
-		try {
-			commandQueue.open(config);
-			fail("Expected CommandQueueException.");
-		} catch (CommandQueueException e) {
-			// OK
-		}
-	}
-	
-	public void test_queue_open_close() throws CommandQueueException {
-		ConfigTree config = new ConfigTree("config");
-		InMemoryCommandQueue commandQueue = new InMemoryCommandQueue();
-
-		config.setAttribute(InMemoryCommandQueue.COMMAND_QUEUE_NAME, "test-queue");
-		assertEquals(null, InMemoryCommandQueue.getQueue("test-queue"));
-		commandQueue.open(config);
-		assertEquals(commandQueue, InMemoryCommandQueue.getQueue("test-queue"));
-		commandQueue.close();
-		assertEquals(null, InMemoryCommandQueue.getQueue("test-queue"));
-	}
-	
-	public void test_queue_receive() throws CommandQueueException, InterruptedException {
-		ConfigTree config = new ConfigTree("config");
-		InMemoryCommandQueue commandQueue = new InMemoryCommandQueue();
-
-		// receive should fail if the queue hasn't been opened yet...
-		try {
-			commandQueue.receiveCommand(0);
-			fail("Expected CommandQueueException.");
-		} catch (CommandQueueException e) {
-			// OK
-		}
-		
-		config.setAttribute(InMemoryCommandQueue.COMMAND_QUEUE_NAME, "test-queue");
-		commandQueue.open(config);
-		
-		// Start the consumer thread - it will receive the commands from the queue.
-		CommandConsumerThread consumerThread = new CommandConsumerThread(commandQueue);
-		consumerThread.start();
-		
-		// Make sure the thread is running.
-		assertTrue(consumerThread.isRunning);
-		
-		commandQueue.addCommand("command1");
-		assertCommandReceived(consumerThread, "command1", 0);
-		commandQueue.addCommand("command2");
-		assertCommandReceived(consumerThread, "command2", 1);
-		commandQueue.addCommand("command3");
-		assertCommandReceived(consumerThread, "command3", 2);
-		
-		// Stop the queue thread...
-		commandQueue.addCommand("stop");
-		Thread.sleep(50);
-		assertTrue(!consumerThread.isRunning);  // this flag being reset proves the stop command was consumed and so the queue is really working
-		assertEquals(4, consumerThread.unblockCount); // Should have unblocked 4 times - once for each command.
-		
-		// receive should fail if the queue has been closed...
-		commandQueue.close();
-		try {
-			commandQueue.receiveCommand(0);
-			fail("Expected CommandQueueException.");
-		} catch (CommandQueueException e) {
-			// OK
-		}
-	}
-	
-	private void assertCommandReceived(CommandConsumerThread consumerThread, String expected, int index) throws InterruptedException {
-		Thread.sleep(50);
-		assertEquals("Received commands queue is not the expected length.", index + 1, consumerThread.commandsReceived.size());
-		assertEquals("Command not found as last added command.", expected, consumerThread.commandsReceived.get(index));
-	}
-
-	private class CommandConsumerThread extends Thread {
-
-		private List<String> commandsReceived = new ArrayList<String>();
-		private CommandQueue commandQueue;
-		private boolean isRunning = true;
-		private int unblockCount = 0;
-		
-		private CommandConsumerThread(CommandQueue commandQueue) {
-			this.commandQueue = commandQueue;
-		}
-		
-		@Override
-		public void run() {
-			String command = null;
-			
-			while(!"stop".equals(command)) {
-				try {
-					command = commandQueue.receiveCommand(0);
-					commandsReceived.add(command);
-				} catch (CommandQueueException e) {
-					fail("CommandQueue Exception: " + e.getMessage());
-				}
-				unblockCount++;
-			}
-			isRunning = false;
-		}		
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/command/InMemoryCommandQueueUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,124 @@
+package org.jboss.soa.esb.command;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.command.CommandQueue;
+import org.jboss.internal.soa.esb.command.CommandQueueException;
+import org.jboss.internal.soa.esb.command.InMemoryCommandQueue;
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+public class InMemoryCommandQueueUnitTest extends TestCase {
+
+	public void test_args() throws CommandQueueException {
+		InMemoryCommandQueue commandQueue = new InMemoryCommandQueue();
+		
+		try {
+			commandQueue.open(null);
+			fail("Expected IllegalArgumentException.");
+		} catch (IllegalArgumentException e) {
+			// OK
+		}
+
+		ConfigTree config = new ConfigTree("config");
+		try {
+			commandQueue.open(config);
+			fail("Expected CommandQueueException.");
+		} catch (CommandQueueException e) {
+			// OK
+		}
+	}
+	
+	public void test_queue_open_close() throws CommandQueueException {
+		ConfigTree config = new ConfigTree("config");
+		InMemoryCommandQueue commandQueue = new InMemoryCommandQueue();
+
+		config.setAttribute(InMemoryCommandQueue.COMMAND_QUEUE_NAME, "test-queue");
+		assertEquals(null, InMemoryCommandQueue.getQueue("test-queue"));
+		commandQueue.open(config);
+		assertEquals(commandQueue, InMemoryCommandQueue.getQueue("test-queue"));
+		commandQueue.close();
+		assertEquals(null, InMemoryCommandQueue.getQueue("test-queue"));
+	}
+	
+	public void test_queue_receive() throws CommandQueueException, InterruptedException {
+		ConfigTree config = new ConfigTree("config");
+		InMemoryCommandQueue commandQueue = new InMemoryCommandQueue();
+
+		// receive should fail if the queue hasn't been opened yet...
+		try {
+			commandQueue.receiveCommand(0);
+			fail("Expected CommandQueueException.");
+		} catch (CommandQueueException e) {
+			// OK
+		}
+		
+		config.setAttribute(InMemoryCommandQueue.COMMAND_QUEUE_NAME, "test-queue");
+		commandQueue.open(config);
+		
+		// Start the consumer thread - it will receive the commands from the queue.
+		CommandConsumerThread consumerThread = new CommandConsumerThread(commandQueue);
+		consumerThread.start();
+		
+		// Make sure the thread is running.
+		assertTrue(consumerThread.isRunning);
+		
+		commandQueue.addCommand("command1");
+		assertCommandReceived(consumerThread, "command1", 0);
+		commandQueue.addCommand("command2");
+		assertCommandReceived(consumerThread, "command2", 1);
+		commandQueue.addCommand("command3");
+		assertCommandReceived(consumerThread, "command3", 2);
+		
+		// Stop the queue thread...
+		commandQueue.addCommand("stop");
+		Thread.sleep(50);
+		assertTrue(!consumerThread.isRunning);  // this flag being reset proves the stop command was consumed and so the queue is really working
+		assertEquals(4, consumerThread.unblockCount); // Should have unblocked 4 times - once for each command.
+		
+		// receive should fail if the queue has been closed...
+		commandQueue.close();
+		try {
+			commandQueue.receiveCommand(0);
+			fail("Expected CommandQueueException.");
+		} catch (CommandQueueException e) {
+			// OK
+		}
+	}
+	
+	private void assertCommandReceived(CommandConsumerThread consumerThread, String expected, int index) throws InterruptedException {
+		Thread.sleep(50);
+		assertEquals("Received commands queue is not the expected length.", index + 1, consumerThread.commandsReceived.size());
+		assertEquals("Command not found as last added command.", expected, consumerThread.commandsReceived.get(index));
+	}
+
+	private class CommandConsumerThread extends Thread {
+
+		private List<String> commandsReceived = new ArrayList<String>();
+		private CommandQueue commandQueue;
+		private boolean isRunning = true;
+		private int unblockCount = 0;
+		
+		private CommandConsumerThread(CommandQueue commandQueue) {
+			this.commandQueue = commandQueue;
+		}
+		
+		@Override
+		public void run() {
+			String command = null;
+			
+			while(!"stop".equals(command)) {
+				try {
+					command = commandQueue.receiveCommand(0);
+					commandsReceived.add(command);
+				} catch (CommandQueueException e) {
+					fail("CommandQueue Exception: " + e.getMessage());
+				}
+				unblockCount++;
+			}
+			isRunning = false;
+		}		
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,235 +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.common.tests;
-
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.SQLException;
-import java.util.HashMap;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-
-/**
- * Base test class for esb test classes, uses jboss logging.
- * 
- * @author <a href="mailto:arvinder.singh at indigo-logic.com">Arvinder Singh</a>
- * @version <tt>$Revision:$</tt> $Id:$
- */
-
-/*
- * This should probably use its own property file.
- */
-
-public class BaseTest extends TestCase
-{
-
-	/** The Database driver used for unit tests */
-	public static String DB_DRIVER = "org.jboss.esb.test.db.driver";
-
-	/** The Database connection url used for unit tests */
-	public static String DB_URL = "org.jboss.esb.test.db.url";
-
-	/** The Database user name used for unit tests */
-	public static String DB_USERNAME = "org.jboss.esb.test.db.user";
-
-	/** The Database password used for unit tests */
-	public static String DB_PASSWORD = "org.jboss.esb.test.db.password";
-	
-	/** The FTP hostname used for unit tests **/
-	public static String FTP_HOSTNAME = "org.jboss.esb.test.ftp.hostname" ;
-	
-	/** The FTP user used for unit tests **/
-	public static String FTP_USER = "org.jboss.esb.test.ftp.user" ;
-	
-	/** The FTP directory used for unit tests **/
-	public static String FTP_DIR = "org.jboss.esb.test.ftp.dir" ;
-	
-	/** The FTP password for unit tests **/
-	public static String FTP_PWD = "org.jboss.esb.test.ftp.pwd";
-
-	/** The Logger. */
-	protected Logger log = Logger.getLogger(getClass());
-
-	/** Contains user and or deployment specific paramater */
-	public static HashMap<String, String> SYSTEM_PARAMETERS;
-
-	/**
-	 * Default class constructor.
-	 */
-	public BaseTest()
-	{
-		SYSTEM_PARAMETERS = readSystemParameters();
-	}
-
-	/**
-	 * Utility constructor.
-	 * 
-	 * @param name
-	 *            The test name.
-	 */
-	public BaseTest(String name)
-	{
-		super(name);
-		SYSTEM_PARAMETERS = readSystemParameters();
-	}
-
-	/**
-	 * Reading system parameter that are set by the ant build when invoking the
-	 * junit call. The parameter values should be set in the
-	 * deployment.properties file. If the particular parameter is not found it
-	 * will receive a default value.
-	 */
-	private HashMap<String, String> readSystemParameters()
-	{
-		// Reading system parameter
-		String dbDriver = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
-				.getProperty(DB_DRIVER, "org.hsqldb.jdbcDriver");
-		String dbUrl = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
-				.getProperty(DB_URL, "jdbc:hsqldb:.");
-		String dbUsername = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
-				.getProperty(DB_USERNAME, "sa");
-		String dbPassword = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
-				.getProperty(DB_PASSWORD, "");
-		String ftpHostname = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
-		.getProperty(FTP_HOSTNAME, "ftp.ncl.ac.uk");
-		String ftpUser = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
-		.getProperty(FTP_USER, "anonymous");
-		String ftpDir = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
-		.getProperty(FTP_DIR, "/pub/DNS");
-		String ftpPwd = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
-		.getProperty(FTP_PWD, "");
-
-		// Setting the paremeters in the HashMap
-		HashMap<String, String> systemParameters = new HashMap<String, String>();
-		systemParameters.put(DB_DRIVER, dbDriver);
-		systemParameters.put(DB_URL, dbUrl);
-		systemParameters.put(DB_USERNAME, dbUsername);
-		systemParameters.put(DB_PASSWORD, dbPassword);
-		systemParameters.put(FTP_HOSTNAME, ftpHostname);
-		systemParameters.put(FTP_USER, ftpUser);
-		systemParameters.put(FTP_DIR, ftpDir);
-		systemParameters.put(FTP_PWD, ftpPwd);
-
-		log.debug("DB parameters:");
-		log.debug("Driver=" + dbDriver);
-		log.debug("url=" + dbUrl);
-		log.debug("username=" + dbUsername);
-		log.debug("password=" + dbPassword);
-		log.debug("FTP parameters:");
-		log.debug("Hostname=" + ftpHostname);
-		log.debug("User=" + ftpUser);
-		log.debug("Dir=" + ftpDir);
-		log.debug("Password="+ftpPwd);
-
-		return systemParameters;
-	}
-
-	protected String getDbUrl()
-	{
-		return SYSTEM_PARAMETERS.get(DB_URL);
-	}
-
-	protected String getDbUser()
-	{
-		return SYSTEM_PARAMETERS.get(DB_USERNAME);
-	}
-
-	protected String getDbPassword()
-	{
-		return SYSTEM_PARAMETERS.get(DB_PASSWORD);
-	}
-
-	protected String getDbDriver()
-	{
-		return SYSTEM_PARAMETERS.get(DB_DRIVER);
-	}
-	
-	protected String getFtpHostname()
-	{
-		return SYSTEM_PARAMETERS.get(FTP_HOSTNAME) ;
-	}
-	
-	protected String getFtpUser()
-	{
-		return SYSTEM_PARAMETERS.get(FTP_USER) ;
-	}
-	
-	protected String getFtpDir()
-	{
-		return SYSTEM_PARAMETERS.get(FTP_DIR) ;
-	}
-	
-	protected String getFtpPwd ()
-	{
-		return SYSTEM_PARAMETERS.get(FTP_PWD);
-	}
-
-	public Connection getDbConnection() throws SQLException
-	{
-		registerJdbcDriver();
-		return DriverManager.getConnection(getDbUrl(), getDbUser(),
-				getDbPassword());
-	}
-
-	public Connection getDbConnection(String username, String password)
-			throws SQLException
-	{
-		registerJdbcDriver();
-		return DriverManager.getConnection(getDbUrl(), username, password);
-	}
-
-	/**
-	 * Set the test ObjStoreConfigFile location in the classpath/filesystem.
-	 * 
-	 * @param filePath
-	 *            Classpath/filesystem location.
-	 */
-	public void setObjStoreConfigFile(String filePath)
-	{
-		if (filePath == null)
-		{
-			ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperties()
-					.remove(Environment.OBJECT_STORE_CONFIG_FILE);
-		} else
-		{
-			ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
-					Environment.OBJECT_STORE_CONFIG_FILE, filePath);
-		}
-	}
-
-	private void registerJdbcDriver()
-	{
-		try
-		{
-			Class.forName(getDbDriver()).newInstance();
-		} catch (Exception e)
-		{
-			log.error(e);
-			fail("JDBC Driver [" + getDbDriver()
-					+ "] not available in classpath.");
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/BaseTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,235 @@
+/*
+ * 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.common.tests;
+
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.SQLException;
+import java.util.HashMap;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+
+/**
+ * Base test class for esb test classes, uses jboss logging.
+ * 
+ * @author <a href="mailto:arvinder.singh at indigo-logic.com">Arvinder Singh</a>
+ * @version <tt>$Revision:$</tt> $Id:$
+ */
+
+/*
+ * This should probably use its own property file.
+ */
+
+public class BaseTest extends TestCase
+{
+
+	/** The Database driver used for unit tests */
+	public static String DB_DRIVER = "org.jboss.esb.test.db.driver";
+
+	/** The Database connection url used for unit tests */
+	public static String DB_URL = "org.jboss.esb.test.db.url";
+
+	/** The Database user name used for unit tests */
+	public static String DB_USERNAME = "org.jboss.esb.test.db.user";
+
+	/** The Database password used for unit tests */
+	public static String DB_PASSWORD = "org.jboss.esb.test.db.password";
+	
+	/** The FTP hostname used for unit tests **/
+	public static String FTP_HOSTNAME = "org.jboss.esb.test.ftp.hostname" ;
+	
+	/** The FTP user used for unit tests **/
+	public static String FTP_USER = "org.jboss.esb.test.ftp.user" ;
+	
+	/** The FTP directory used for unit tests **/
+	public static String FTP_DIR = "org.jboss.esb.test.ftp.dir" ;
+	
+	/** The FTP password for unit tests **/
+	public static String FTP_PWD = "org.jboss.esb.test.ftp.pwd";
+
+	/** The Logger. */
+	protected Logger log = Logger.getLogger(getClass());
+
+	/** Contains user and or deployment specific paramater */
+	public static HashMap<String, String> SYSTEM_PARAMETERS;
+
+	/**
+	 * Default class constructor.
+	 */
+	public BaseTest()
+	{
+		SYSTEM_PARAMETERS = readSystemParameters();
+	}
+
+	/**
+	 * Utility constructor.
+	 * 
+	 * @param name
+	 *            The test name.
+	 */
+	public BaseTest(String name)
+	{
+		super(name);
+		SYSTEM_PARAMETERS = readSystemParameters();
+	}
+
+	/**
+	 * Reading system parameter that are set by the ant build when invoking the
+	 * junit call. The parameter values should be set in the
+	 * deployment.properties file. If the particular parameter is not found it
+	 * will receive a default value.
+	 */
+	private HashMap<String, String> readSystemParameters()
+	{
+		// Reading system parameter
+		String dbDriver = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+				.getProperty(DB_DRIVER, "org.hsqldb.jdbcDriver");
+		String dbUrl = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+				.getProperty(DB_URL, "jdbc:hsqldb:.");
+		String dbUsername = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+				.getProperty(DB_USERNAME, "sa");
+		String dbPassword = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+				.getProperty(DB_PASSWORD, "");
+		String ftpHostname = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+		.getProperty(FTP_HOSTNAME, "ftp.ncl.ac.uk");
+		String ftpUser = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+		.getProperty(FTP_USER, "anonymous");
+		String ftpDir = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+		.getProperty(FTP_DIR, "/pub/DNS");
+		String ftpPwd = ModulePropertyManager.getPropertyManager(ModulePropertyManager.CONNECTION_MODULE)
+		.getProperty(FTP_PWD, "");
+
+		// Setting the paremeters in the HashMap
+		HashMap<String, String> systemParameters = new HashMap<String, String>();
+		systemParameters.put(DB_DRIVER, dbDriver);
+		systemParameters.put(DB_URL, dbUrl);
+		systemParameters.put(DB_USERNAME, dbUsername);
+		systemParameters.put(DB_PASSWORD, dbPassword);
+		systemParameters.put(FTP_HOSTNAME, ftpHostname);
+		systemParameters.put(FTP_USER, ftpUser);
+		systemParameters.put(FTP_DIR, ftpDir);
+		systemParameters.put(FTP_PWD, ftpPwd);
+
+		log.debug("DB parameters:");
+		log.debug("Driver=" + dbDriver);
+		log.debug("url=" + dbUrl);
+		log.debug("username=" + dbUsername);
+		log.debug("password=" + dbPassword);
+		log.debug("FTP parameters:");
+		log.debug("Hostname=" + ftpHostname);
+		log.debug("User=" + ftpUser);
+		log.debug("Dir=" + ftpDir);
+		log.debug("Password="+ftpPwd);
+
+		return systemParameters;
+	}
+
+	protected String getDbUrl()
+	{
+		return SYSTEM_PARAMETERS.get(DB_URL);
+	}
+
+	protected String getDbUser()
+	{
+		return SYSTEM_PARAMETERS.get(DB_USERNAME);
+	}
+
+	protected String getDbPassword()
+	{
+		return SYSTEM_PARAMETERS.get(DB_PASSWORD);
+	}
+
+	protected String getDbDriver()
+	{
+		return SYSTEM_PARAMETERS.get(DB_DRIVER);
+	}
+	
+	protected String getFtpHostname()
+	{
+		return SYSTEM_PARAMETERS.get(FTP_HOSTNAME) ;
+	}
+	
+	protected String getFtpUser()
+	{
+		return SYSTEM_PARAMETERS.get(FTP_USER) ;
+	}
+	
+	protected String getFtpDir()
+	{
+		return SYSTEM_PARAMETERS.get(FTP_DIR) ;
+	}
+	
+	protected String getFtpPwd ()
+	{
+		return SYSTEM_PARAMETERS.get(FTP_PWD);
+	}
+
+	public Connection getDbConnection() throws SQLException
+	{
+		registerJdbcDriver();
+		return DriverManager.getConnection(getDbUrl(), getDbUser(),
+				getDbPassword());
+	}
+
+	public Connection getDbConnection(String username, String password)
+			throws SQLException
+	{
+		registerJdbcDriver();
+		return DriverManager.getConnection(getDbUrl(), username, password);
+	}
+
+	/**
+	 * Set the test ObjStoreConfigFile location in the classpath/filesystem.
+	 * 
+	 * @param filePath
+	 *            Classpath/filesystem location.
+	 */
+	public void setObjStoreConfigFile(String filePath)
+	{
+		if (filePath == null)
+		{
+			ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).getProperties()
+					.remove(Environment.OBJECT_STORE_CONFIG_FILE);
+		} else
+		{
+			ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
+					Environment.OBJECT_STORE_CONFIG_FILE, filePath);
+		}
+	}
+
+	private void registerJdbcDriver()
+	{
+		try
+		{
+			Class.forName(getDbDriver()).newInstance();
+		} catch (Exception e)
+		{
+			log.error(e);
+			fail("JDBC Driver [" + getDbDriver()
+					+ "] not available in classpath.");
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/MockDataSource.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/MockDataSource.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/MockDataSource.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,94 +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.common.tests;
-
-import java.io.PrintWriter;
-import java.sql.Connection;
-import java.sql.SQLException;
-
-import javax.sql.DataSource;
-
-
-/**
- * Mock {@link javax.sql.DataSource} implementation.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MockDataSource implements DataSource {
-
-	private BaseTest testClass;
-	private int loginTimeout;
-	private PrintWriter printWriter;
-
-	/**
-	 * Construct from a BaseTest 
-	 */
-	public MockDataSource(BaseTest testClass) {
-		if(testClass == null) {
-			throw new IllegalArgumentException("null 'testClass' arg.");
-		}
-		this.testClass = testClass;
-		printWriter = new PrintWriter(System.out);
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.sql.DataSource#getConnection()
-	 */
-	public Connection getConnection() throws SQLException {
-		return testClass.getDbConnection();
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.sql.DataSource#getConnection(java.lang.String, java.lang.String)
-	 */
-	public Connection getConnection(String username, String password) throws SQLException {
-		return testClass.getDbConnection(username, password);
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.sql.DataSource#getLogWriter()
-	 */
-	public PrintWriter getLogWriter() throws SQLException {
-		return printWriter;
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.sql.DataSource#setLogWriter(java.io.PrintWriter)
-	 */
-	public void setLogWriter(PrintWriter printWriter) throws SQLException {
-		this.printWriter = printWriter;
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.sql.DataSource#getLoginTimeout()
-	 */
-	public int getLoginTimeout() throws SQLException {
-		return loginTimeout;
-	}
-
-	/* (non-Javadoc)
-	 * @see javax.sql.DataSource#setLoginTimeout(int)
-	 */
-	public void setLoginTimeout(int loginTimeout) throws SQLException {
-		this.loginTimeout = loginTimeout;
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/MockDataSource.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/MockDataSource.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/MockDataSource.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/MockDataSource.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,94 @@
+/*
+ * 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.common.tests;
+
+import java.io.PrintWriter;
+import java.sql.Connection;
+import java.sql.SQLException;
+
+import javax.sql.DataSource;
+
+
+/**
+ * Mock {@link javax.sql.DataSource} implementation.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MockDataSource implements DataSource {
+
+	private BaseTest testClass;
+	private int loginTimeout;
+	private PrintWriter printWriter;
+
+	/**
+	 * Construct from a BaseTest 
+	 */
+	public MockDataSource(BaseTest testClass) {
+		if(testClass == null) {
+			throw new IllegalArgumentException("null 'testClass' arg.");
+		}
+		this.testClass = testClass;
+		printWriter = new PrintWriter(System.out);
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.sql.DataSource#getConnection()
+	 */
+	public Connection getConnection() throws SQLException {
+		return testClass.getDbConnection();
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.sql.DataSource#getConnection(java.lang.String, java.lang.String)
+	 */
+	public Connection getConnection(String username, String password) throws SQLException {
+		return testClass.getDbConnection(username, password);
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.sql.DataSource#getLogWriter()
+	 */
+	public PrintWriter getLogWriter() throws SQLException {
+		return printWriter;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.sql.DataSource#setLogWriter(java.io.PrintWriter)
+	 */
+	public void setLogWriter(PrintWriter printWriter) throws SQLException {
+		this.printWriter = printWriter;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.sql.DataSource#getLoginTimeout()
+	 */
+	public int getLoginTimeout() throws SQLException {
+		return loginTimeout;
+	}
+
+	/* (non-Javadoc)
+	 * @see javax.sql.DataSource#setLoginTimeout(int)
+	 */
+	public void setLoginTimeout(int loginTimeout) throws SQLException {
+		this.loginTimeout = loginTimeout;
+	}
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.common.tests.propertymanager;
-
-import junit.framework.ComparisonFailure;
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.common.Environment;
-
-import com.arjuna.common.internal.util.propertyservice.plugins.io.XMLFilePlugin;
-import com.arjuna.common.util.propertyservice.PropertyManager;
-import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
-
-public class PropertyManagerUnitTest extends TestCase
-{
-	
-	private Logger log = Logger.getLogger( PropertyManagerUnitTest.class );
-
-	public void testPropertyManager ()
-	{
-		System.setProperty("com.arjuna.common.util.propertyservice.verbosePropertyManager", "ON");
-		
-		PropertyManager corepm = PropertyManagerFactory.getPropertyManager("test.core", "core");
-		
-		try
-        {
-            corepm.load(XMLFilePlugin.class.getName(), "jbossesb-test-properties.xml");
-        }
-        catch (Exception e)
-        {
-        	log.error(e);
-        	
-            fail(e.toString());
-        }
-        
-		assertEquals(corepm.getProperty(Environment.JNDI_SERVER_CONTEXT_FACTORY), "foobar");		
-		assertEquals(corepm.getProperty(Environment.OBJECT_STORE_CONFIG_FILE), "file:config.xml");
-		
-		try
-		{
-			assertEquals(corepm.getProperty(Environment.SMTP_HOST), "thishost");
-			
-			fail();
-		}
-		catch (ComparisonFailure ex)
-		{
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-		
-		PropertyManager transportpm = PropertyManagerFactory.getPropertyManager("test.transports", "transports");
-		
-		try
-        {
-            transportpm.load(XMLFilePlugin.class.getName(), "jbossesb-test-properties.xml");
-        }
-        catch (Exception e)
-        {
-        	log.error(e);
-        	
-            fail(e.toString());
-        }
-        
-        assertEquals(transportpm.getProperty(Environment.JNDI_SERVER_CONTEXT_FACTORY), "foobar");
-        assertEquals(transportpm.getProperty(Environment.SMTP_HOST), "thishost");
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/propertymanager/PropertyManagerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,90 @@
+/*
+ * 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.common.tests.propertymanager;
+
+import junit.framework.ComparisonFailure;
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.common.Environment;
+
+import com.arjuna.common.internal.util.propertyservice.plugins.io.XMLFilePlugin;
+import com.arjuna.common.util.propertyservice.PropertyManager;
+import com.arjuna.common.util.propertyservice.PropertyManagerFactory;
+
+public class PropertyManagerUnitTest extends TestCase
+{
+	
+	private Logger log = Logger.getLogger( PropertyManagerUnitTest.class );
+
+	public void testPropertyManager ()
+	{
+		System.setProperty("com.arjuna.common.util.propertyservice.verbosePropertyManager", "ON");
+		
+		PropertyManager corepm = PropertyManagerFactory.getPropertyManager("test.core", "core");
+		
+		try
+        {
+            corepm.load(XMLFilePlugin.class.getName(), "jbossesb-test-properties.xml");
+        }
+        catch (Exception e)
+        {
+        	log.error(e);
+        	
+            fail(e.toString());
+        }
+        
+		assertEquals(corepm.getProperty(Environment.JNDI_SERVER_CONTEXT_FACTORY), "foobar");		
+		assertEquals(corepm.getProperty(Environment.OBJECT_STORE_CONFIG_FILE), "file:config.xml");
+		
+		try
+		{
+			assertEquals(corepm.getProperty(Environment.SMTP_HOST), "thishost");
+			
+			fail();
+		}
+		catch (ComparisonFailure ex)
+		{
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+		
+		PropertyManager transportpm = PropertyManagerFactory.getPropertyManager("test.transports", "transports");
+		
+		try
+        {
+            transportpm.load(XMLFilePlugin.class.getName(), "jbossesb-test-properties.xml");
+        }
+        catch (Exception e)
+        {
+        	log.error(e);
+        	
+            fail(e.toString());
+        }
+        
+        assertEquals(transportpm.getProperty(Environment.JNDI_SERVER_CONTEXT_FACTORY), "foobar");
+        assertEquals(transportpm.getProperty(Environment.SMTP_HOST), "thishost");
+	}
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,133 +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.common.tests.utils;
-
-import java.util.Properties;
-
-import javax.jms.Message;
-import javax.jms.MessageConsumer;
-import javax.jms.Queue;
-import javax.jms.QueueConnection;
-import javax.jms.QueueConnectionFactory;
-import javax.jms.QueueReceiver;
-import javax.jms.QueueSession;
-import javax.jms.Topic;
-import javax.jms.TopicConnection;
-import javax.jms.TopicConnectionFactory;
-import javax.jms.TopicSession;
-import javax.jms.TopicSubscriber;
-import javax.naming.Context;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.helpers.NamingContext;
-
-public class DrainQueuesAndTopics
-{
-	private Logger log = Logger.getLogger( DrainQueuesAndTopics.class );
-	
-	private static final int	  MAX_TIMES_NOMSG = 10;
- 
-  public DrainQueuesAndTopics() throws Exception
-  {
-	  purgeQueueTopic("queue/A");
-	  purgeQueueTopic("queue/B");
-	  purgeQueueTopic("topic/testTopic");
-  } //__________________________________
-  
-  public int purgeQueueTopic(String p_sName) throws Exception
-  { 
-	int iRet = 0;
-	log.debug(p_sName);
-	MessageConsumer oCns = null;
-	switch(p_sName.toLowerCase().charAt(0))
-	{	case 't' : oCns = getTopic(p_sName);	break;
-		case 'q' : oCns = getQueue(p_sName);	break;
-	}
-	if (null==oCns)
-		return 0;
-	
-	for (int iNoRcv=0; iNoRcv < MAX_TIMES_NOMSG; )
-	{	Message oMsg = oCns.receive(200);
-		if (null==oMsg)
-		{	iNoRcv++;
-			log.debug(".");
-			continue;
-		}
-		iRet++;
-		dumpMessage(oMsg);
-		iNoRcv = 0;
-	}
-	log.debug("");
-	return iRet;
-  } //__________________________________
-  
-  void dumpMessage(Message pM)
-  {
-	  log.debug(pM);
-  } //__________________________________
-  
-  QueueReceiver getQueue(String p_sJndi) throws Exception
-  {
-      Properties environment = new Properties();
-      environment.setProperty(Context.PROVIDER_URL, NamingContext.JBOSS_PROVIDER_URL);
-      environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
-      environment.setProperty(Context.URL_PKG_PREFIXES, NamingContext.JBOSS_URL_PKG_PREFIX);
-      Context oCtx = NamingContext.getServerContext(environment);
-      
-	QueueConnection oQconn = null;
-	QueueSession 	oQsess = null;
-	QueueConnectionFactory qcf = (QueueConnectionFactory) oCtx
-		.lookup("ConnectionFactory");
-
-	oQconn = qcf.createQueueConnection();
-	oQsess = oQconn.createQueueSession(false
-			,QueueSession.AUTO_ACKNOWLEDGE);
-    Queue oQueue
-    	= (Queue) oCtx.lookup(p_sJndi);
-    oCtx.close();
-    QueueReceiver oRcv = oQsess.createReceiver(oQueue);
-    oQconn.start();
-    return oRcv;
-  } //__________________________________
-
-  TopicSubscriber getTopic(String p_sJndi) throws Exception
-  {
-      Properties environment = new Properties();
-      environment.setProperty(Context.PROVIDER_URL, NamingContext.JBOSS_PROVIDER_URL);
-      environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
-      environment.setProperty(Context.URL_PKG_PREFIXES, NamingContext.JBOSS_URL_PKG_PREFIX);
-      Context oCtx = NamingContext.getServerContext(environment);
-	TopicConnection oTconn = null;
-	TopicSession 	oTsess = null;
-	TopicConnectionFactory qcf = (TopicConnectionFactory) oCtx
-		.lookup("ConnectionFactory");
-
-	oTconn = qcf.createTopicConnection();
-	oTsess = oTconn.createTopicSession(false
-			,QueueSession.AUTO_ACKNOWLEDGE);
-    Topic oT = (Topic) oCtx.lookup(p_sJndi);
-    oCtx.close();
-    TopicSubscriber oRcv = oTsess.createSubscriber(oT);
-    oTconn.start();
-    return oRcv;
-  } //__________________________________ 
-} //____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/common/tests/utils/DrainQueuesAndTopics.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,133 @@
+/*
+ * 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.common.tests.utils;
+
+import java.util.Properties;
+
+import javax.jms.Message;
+import javax.jms.MessageConsumer;
+import javax.jms.Queue;
+import javax.jms.QueueConnection;
+import javax.jms.QueueConnectionFactory;
+import javax.jms.QueueReceiver;
+import javax.jms.QueueSession;
+import javax.jms.Topic;
+import javax.jms.TopicConnection;
+import javax.jms.TopicConnectionFactory;
+import javax.jms.TopicSession;
+import javax.jms.TopicSubscriber;
+import javax.naming.Context;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.helpers.NamingContext;
+
+public class DrainQueuesAndTopics
+{
+	private Logger log = Logger.getLogger( DrainQueuesAndTopics.class );
+	
+	private static final int	  MAX_TIMES_NOMSG = 10;
+ 
+  public DrainQueuesAndTopics() throws Exception
+  {
+	  purgeQueueTopic("queue/A");
+	  purgeQueueTopic("queue/B");
+	  purgeQueueTopic("topic/testTopic");
+  } //__________________________________
+  
+  public int purgeQueueTopic(String p_sName) throws Exception
+  { 
+	int iRet = 0;
+	log.debug(p_sName);
+	MessageConsumer oCns = null;
+	switch(p_sName.toLowerCase().charAt(0))
+	{	case 't' : oCns = getTopic(p_sName);	break;
+		case 'q' : oCns = getQueue(p_sName);	break;
+	}
+	if (null==oCns)
+		return 0;
+	
+	for (int iNoRcv=0; iNoRcv < MAX_TIMES_NOMSG; )
+	{	Message oMsg = oCns.receive(200);
+		if (null==oMsg)
+		{	iNoRcv++;
+			log.debug(".");
+			continue;
+		}
+		iRet++;
+		dumpMessage(oMsg);
+		iNoRcv = 0;
+	}
+	log.debug("");
+	return iRet;
+  } //__________________________________
+  
+  void dumpMessage(Message pM)
+  {
+	  log.debug(pM);
+  } //__________________________________
+  
+  QueueReceiver getQueue(String p_sJndi) throws Exception
+  {
+      Properties environment = new Properties();
+      environment.setProperty(Context.PROVIDER_URL, NamingContext.JBOSS_PROVIDER_URL);
+      environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
+      environment.setProperty(Context.URL_PKG_PREFIXES, NamingContext.JBOSS_URL_PKG_PREFIX);
+      Context oCtx = NamingContext.getServerContext(environment);
+      
+	QueueConnection oQconn = null;
+	QueueSession 	oQsess = null;
+	QueueConnectionFactory qcf = (QueueConnectionFactory) oCtx
+		.lookup("ConnectionFactory");
+
+	oQconn = qcf.createQueueConnection();
+	oQsess = oQconn.createQueueSession(false
+			,QueueSession.AUTO_ACKNOWLEDGE);
+    Queue oQueue
+    	= (Queue) oCtx.lookup(p_sJndi);
+    oCtx.close();
+    QueueReceiver oRcv = oQsess.createReceiver(oQueue);
+    oQconn.start();
+    return oRcv;
+  } //__________________________________
+
+  TopicSubscriber getTopic(String p_sJndi) throws Exception
+  {
+      Properties environment = new Properties();
+      environment.setProperty(Context.PROVIDER_URL, NamingContext.JBOSS_PROVIDER_URL);
+      environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
+      environment.setProperty(Context.URL_PKG_PREFIXES, NamingContext.JBOSS_URL_PKG_PREFIX);
+      Context oCtx = NamingContext.getServerContext(environment);
+	TopicConnection oTconn = null;
+	TopicSession 	oTsess = null;
+	TopicConnectionFactory qcf = (TopicConnectionFactory) oCtx
+		.lookup("ConnectionFactory");
+
+	oTconn = qcf.createTopicConnection();
+	oTsess = oTconn.createTopicSession(false
+			,QueueSession.AUTO_ACKNOWLEDGE);
+    Topic oT = (Topic) oCtx.lookup(p_sJndi);
+    oCtx.close();
+    TopicSubscriber oRcv = oTsess.createSubscriber(oT);
+    oTconn.start();
+    return oRcv;
+  } //__________________________________ 
+} //____________________________________________________________________________

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,57 +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.helpers;
-
-import java.util.Hashtable;
-import java.util.Properties;
-
-import javax.naming.Context;
-import javax.naming.NamingException;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-
-/**
- * AppServerContex unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class AppServerContextUnitTest extends TestCase {
-	
-	private Logger log = Logger.getLogger( AppServerContextUnitTest.class );
-	
-	public void test_AppServerContext() throws NamingException {
-        Properties environment = new Properties();
-        environment.setProperty(Context.PROVIDER_URL, "http://localhost:1234");
-        environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
-        environment.setProperty(Context.URL_PKG_PREFIXES, NamingContext.JBOSS_URL_PKG_PREFIX);
-        Context ctx = NamingContext.getServerContext(environment);
-		
-		
-		Hashtable props = ctx.getEnvironment();
-		log.debug(props);
-		assertEquals("org.jnp.interfaces.NamingContextFactory", props.get(Context.INITIAL_CONTEXT_FACTORY));
-		assertEquals("http://localhost:1234", props.get(Context.PROVIDER_URL));
-		assertEquals("", props.get("java.naming.factory.url.pkgs"));
-        ctx.close();
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/AppServerContextUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,57 @@
+/*
+ * 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.helpers;
+
+import java.util.Hashtable;
+import java.util.Properties;
+
+import javax.naming.Context;
+import javax.naming.NamingException;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+
+/**
+ * AppServerContex unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class AppServerContextUnitTest extends TestCase {
+	
+	private Logger log = Logger.getLogger( AppServerContextUnitTest.class );
+	
+	public void test_AppServerContext() throws NamingException {
+        Properties environment = new Properties();
+        environment.setProperty(Context.PROVIDER_URL, "http://localhost:1234");
+        environment.setProperty(Context.INITIAL_CONTEXT_FACTORY, NamingContext.JBOSS_INITIAL_CONTEXT_FACTORY);
+        environment.setProperty(Context.URL_PKG_PREFIXES, NamingContext.JBOSS_URL_PKG_PREFIX);
+        Context ctx = NamingContext.getServerContext(environment);
+		
+		
+		Hashtable props = ctx.getEnvironment();
+		log.debug(props);
+		assertEquals("org.jnp.interfaces.NamingContextFactory", props.get(Context.INITIAL_CONTEXT_FACTORY));
+		assertEquals("http://localhost:1234", props.get(Context.PROVIDER_URL));
+		assertEquals("", props.get("java.naming.factory.url.pkgs"));
+        ctx.close();
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/ConfigTreeUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/ConfigTreeUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/ConfigTreeUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,263 +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.helpers;
-
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.Arrays;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.soa.esb.testutils.StringUtils;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.xml.sax.SAXException;
-import org.xml.sax.SAXParseException;
-
-/**
- * Unit tests for the ConfigTree class.
- * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
- */
-public class ConfigTreeUnitTest extends BaseTest {
-	private Logger log = Logger.getLogger( ConfigTreeUnitTest.class );
-
-	public void test_fromInputStream_args() throws SAXException, IOException {
-		try {
-			ConfigTree.fromInputStream(null);
-			fail("Expected IllegalArgumentException on null stream.");
-		} catch(IllegalArgumentException e) {
-			// Expected
-		}
-	}
-	
-	private InputStream getStream(String sName)
-	{
-		InputStream oRet =getClass().getResourceAsStream(sName);
-		if (null==oRet)
-			try { oRet = new FileInputStream(sName); }
-			catch(IOException e) { /* OK  Just fall through */}
-		return oRet;
-	}
-	
-	public void test_fromInputStream_and_toXML() throws SAXException, IOException
-	{
-		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile1.xml"));
-		byte[] expected = StreamUtils.readStream(getStream("expected_01.xml"));
-		
-		// Create the ConfigTree from a Stream.  Then...
-		// Dump the XML to a buffer and compare it with the expected - checking that the
-		// Created ConfigTree DOM is the same as what was supplied in the stream.  Also
-		// tests the toXML method.  If this fails, either fromInputStream is not working correctly
-		// or the toXML method is not serialising correctly.
-		String output = null;
-		try { output = confTree.toXml(); }
-		catch (Exception e) 
-		{ 
-			log.error(e);
-		}
-		assertTrue("ConfigTree creation from a stream failed, or, ConfigTree toXML failed - failed to produce the same XML.", 
-				StringUtils.equalsIgnoreLinebreaks(new String(expected), output, false));
-	}
-
-	public void test_fromXML_args() throws SAXException, IOException
-	{		
-		try {
-			ConfigTree.fromXml(null);
-			fail("Expected IllegalArgumentException on null String.");
-		} catch(IllegalArgumentException e) {
-			// Expected
-		}
-		try {
-			ConfigTree.fromXml(" ");
-			fail("Expected SAXParseException on null String.");
-		} catch(SAXParseException e) {
-			// Expected
-		}
-	}
-
-	public void test_fromXML_and_toXML() throws SAXException, IOException
-	{
-		byte[] source = StreamUtils.readStream(getStream("expected_01.xml"));
-		ConfigTree confTree = ConfigTree.fromXml(new String(source));
-		byte[] expected = source;
-		
-		// Create the ConfigTree from a String.  Then...
-		// Dump the XML to a buffer and compare it with the expected - checking that the
-		// Created ConfigTree DOM is the same as what was supplied in the stream.  Also
-		// tests the toXML method.  If this fails, either fromInputStream is not working correctly
-		// or the toXML method is not serialising correctly.
-		String output = confTree.toXml();
-		assertTrue("ConfigTree creation from a String failed, or, ConfigTree toXML failed - failed to produce the same XML.", 
-				StringUtils.equalsIgnoreLinebreaks(new String(expected), output, false));
-	}
-
-	public void test_Constructor_Clone() throws SAXException, IOException {
-		ConfigTree conf1 = ConfigTree.fromInputStream(getStream("testfile1.xml"));
-//		ByteArrayOutputStream output;
-		byte[] expected = StreamUtils.readStream(getStream("expected_01.xml"));	
-		// Create a new ConfigTree from an existing one and compare it with the expected.
-		ConfigTree conf2 = conf1.cloneObj();
-		assertTrue("ConfigTree creation from a stream failed, or, cloneObj failed - failed to produce the same XML.", 
-				StringUtils.equalsIgnoreLinebreaks(new String(expected), conf2.toXml(), false));
-	}
-
-	public void test_Constructor_String_withoutparent() throws SAXException, IOException {
-		// Create a new ConfigTree from without a parent ConfigTree.
-		ConfigTree confTree = new ConfigTree("newConfigTree",null);
-		
-		assertEquals("New ConfigTree invalid.", "<newConfigTree/>" , confTree.toXml());
-	}
-	
-	public void test_getName() {
-		ConfigTree confTree = new ConfigTree("newConfigTree",null);
-		assertEquals("getName returned invalid data.", "newConfigTree", confTree.getName());
-	}
-	
-	public void test_getAttrKeys_hasnokeys() throws SAXException, IOException {
-		ConfigTree confTree = new ConfigTree("newConfigTree",null);		
-		assertTrue("invalid attribute name list", confTree.attributeCount()== 0);
-	}
-	
-	public void test_getAttrKeys_haskeys() throws SAXException, IOException {
-		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile2.xml"));
-		String[] expected = new String[] {"attrib1", "attrib2", "attrib3"};
-		Arrays.sort(expected);
-		String[] actual = confTree.getAttributeNames().toArray(new String[confTree.attributeCount()]);
-		Arrays.sort(actual);
-		
-		assertTrue("invalid attribute name list", Arrays.equals(expected, actual));
-	}
-	
-	public void test_getAttr() throws SAXException, IOException {
-		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile2.xml"));
-		
-		assertEquals("invalid attribute value", "value2", confTree.getAttribute("attrib2"));
-		assertEquals("invalid attribute value", null, confTree.getAttribute("attribXX"));
-	}
-	
-	public void test_getTextChildren() throws SAXException, IOException {
-		// This test also tests the static method getTextValue. 
-		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile3.xml"));
-		
-		// REVIEW: These tests capture the current behavior of the getTextChildren method.  I'm not convinced this behavior is correct!!
-		// I think perhaps this method should not be depending on getTextValue because getTextValue
-		// concatentates the child text nodes.
-		assertTrue("invalid Text Children list", 
-				"Some root text... and some more root text...".equals(confTree.getWholeText()));
-		assertTrue("invalid Text Children list", 
-				Arrays.equals(new String[] {"", "Some nested text..."}, confTree.getTextChildren("el")));
-	}
-
-	public void test_getElementChildren() throws SAXException, IOException {
-		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile3.xml"));
-		ConfigTree[] confTrees;
-
-		String expected = new String(StreamUtils.readStream(getStream("expected_03.xml"))).trim();
-		assertEquals("Wrong ConfigTree ElementChild value.", expected, confTree.toString().trim());
-
-		// Test the nested <el> elements - of which there are 2...
-		confTrees = confTree.getChildren("el");
-		assertEquals("Wrong number of ConfigTree ElementChildren.", 2, confTrees.length);
-		assertEquals("Wrong ConfigTree ElementChild value.", "<el index=\"1\"/>", confTrees[0].toString().trim());
-		assertEquals("Wrong ConfigTree ElementChild value.", "<el index=\"2\">Some nested text...</el>", confTrees[1].toString().trim());
-
-		// Test for a non-existant element...
-		confTrees = confTree.getChildren("xxxx");
-		assertEquals("Wrong number of ConfigTree ElementChildren.", 0, confTrees.length);
-	}
-	
-	public void test_getFirstElementChild() throws SAXException, IOException {
-		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile3.xml"));
-		
-		String expected = new String(StreamUtils.readStream(getStream("expected_03.xml"))).trim();
-		assertEquals("Wrong ConfigTree ElementChild value.", expected, confTree.toString().trim());
-
-		// Test the nested <el> elements - of which there are 2...
-		confTree = confTree.getFirstChild("el");
-		assertEquals("Wrong ConfigTree ElementChild value.", "<el index=\"1\"/>", confTree.toString().trim());
-
-		// Test for a non-existant element...
-		confTree = confTree.getFirstChild("xxxx");
-		assertEquals("Expected null ConfigTree ElementChildren for non-existant element.", null, confTree);
-	}
-
-	public void test_getAllElemChildren() throws SAXException, IOException {
-		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile3.xml"));
-		ConfigTree[] confTrees;
-
-		confTrees = confTree.getAllChildren();
-		assertEquals("Wrong number of ConfigTree ElementChildren.", 2, confTrees.length);
-		assertEquals("Wrong ConfigTree ElementChild value.", "<el index=\"1\"/>", confTrees[0].toString().trim());
-		assertEquals("Wrong ConfigTree ElementChild value.", "<el index=\"2\">Some nested text...</el>", confTrees[1].toString().trim());
-
-		// REVIEW: Note, this method only returns ConfigTree instances for the child elements
-		// of the document root node. Comparing this to the behaviour of getFirstElementChild
-		// would seem to demonstrate an inconsitency???  To be consistent, I would expect this method 
-		// to return a list of 3 ConfigTree instances - the <root> and 2 <el> elements.
-	}
-	
-	public void test_setAttr() throws SAXException, IOException {
-		ConfigTree confTree = new ConfigTree("newConfigTree");
-		
-		confTree.setAttribute("attrib1", "value1");
-		assertEquals("value1", confTree.getAttribute("attrib1"));
-
-		// A null value removes the attribute.
-		confTree.setAttribute("attrib1", null);
-		assertEquals(null, confTree.getAttribute("attrib1"));
-
-		try { confTree.setAttribute(null, null); }
-		catch (IllegalArgumentException e) {/* OK  we expect this */}
-		catch (Exception e2) {fail(e2.getMessage());}
-	}
-	
-	public void test_addElemChild() throws SAXException, IOException {
-		ConfigTree ConfigTree1 = new ConfigTree("newConfigTree");
-		ConfigTree ConfigTreeX = new ConfigTree("X",ConfigTree1);
-		new ConfigTree("Y1",ConfigTree1);
-		new ConfigTree("Y2",ConfigTreeX);
-		
-		assertEquals("<newConfigTree><X><Y2/></X><Y1/></newConfigTree>", ConfigTree1.toString().trim());
-	}
-	
-	public void test_rmvChildsByName() throws SAXException, IOException {
-		ConfigTree ConfigTree1 = new ConfigTree("newConfigTree");
-		ConfigTree ConfigTreeX = new ConfigTree("X",ConfigTree1);
-		new ConfigTree("Y1",ConfigTree1);
-		new ConfigTree("Y2",ConfigTreeX);
-		
-		assertEquals("<newConfigTree><X><Y2/></X><Y1/></newConfigTree>", ConfigTree1.toString().trim());
-		ConfigTree1.removeChildrenByName("Y1");
-		assertEquals("<newConfigTree><X><Y2/></X></newConfigTree>", ConfigTree1.toString().trim());
-	}
-	
-	public void test_cloneObj() throws SAXException, IOException {
-		ConfigTree ConfigTree1 = new ConfigTree("newConfigTree");
-		new ConfigTree("X",ConfigTree1);
-		new ConfigTree("Y",ConfigTree1);
-		
-		ConfigTree clone = ConfigTree1.cloneObj();
-		
-		assertTrue("Clone should produce a completely different object", (ConfigTree1 != clone));
-		assertEquals("Clone should produce the same XML", ConfigTree1.toString(), clone.toString());
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/ConfigTreeUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/ConfigTreeUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/ConfigTreeUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/ConfigTreeUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,263 @@
+/*
+ * 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.helpers;
+
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.Arrays;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.testutils.StringUtils;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.xml.sax.SAXException;
+import org.xml.sax.SAXParseException;
+
+/**
+ * Unit tests for the ConfigTree class.
+ * @author <a href="mailto:schifest at heuristica.com.ar">schifest at heuristica.com.ar</a>
+ */
+public class ConfigTreeUnitTest extends BaseTest {
+	private Logger log = Logger.getLogger( ConfigTreeUnitTest.class );
+
+	public void test_fromInputStream_args() throws SAXException, IOException {
+		try {
+			ConfigTree.fromInputStream(null);
+			fail("Expected IllegalArgumentException on null stream.");
+		} catch(IllegalArgumentException e) {
+			// Expected
+		}
+	}
+	
+	private InputStream getStream(String sName)
+	{
+		InputStream oRet =getClass().getResourceAsStream(sName);
+		if (null==oRet)
+			try { oRet = new FileInputStream(sName); }
+			catch(IOException e) { /* OK  Just fall through */}
+		return oRet;
+	}
+	
+	public void test_fromInputStream_and_toXML() throws SAXException, IOException
+	{
+		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile1.xml"));
+		byte[] expected = StreamUtils.readStream(getStream("expected_01.xml"));
+		
+		// Create the ConfigTree from a Stream.  Then...
+		// Dump the XML to a buffer and compare it with the expected - checking that the
+		// Created ConfigTree DOM is the same as what was supplied in the stream.  Also
+		// tests the toXML method.  If this fails, either fromInputStream is not working correctly
+		// or the toXML method is not serialising correctly.
+		String output = null;
+		try { output = confTree.toXml(); }
+		catch (Exception e) 
+		{ 
+			log.error(e);
+		}
+		assertTrue("ConfigTree creation from a stream failed, or, ConfigTree toXML failed - failed to produce the same XML.", 
+				StringUtils.equalsIgnoreLinebreaks(new String(expected), output, false));
+	}
+
+	public void test_fromXML_args() throws SAXException, IOException
+	{		
+		try {
+			ConfigTree.fromXml(null);
+			fail("Expected IllegalArgumentException on null String.");
+		} catch(IllegalArgumentException e) {
+			// Expected
+		}
+		try {
+			ConfigTree.fromXml(" ");
+			fail("Expected SAXParseException on null String.");
+		} catch(SAXParseException e) {
+			// Expected
+		}
+	}
+
+	public void test_fromXML_and_toXML() throws SAXException, IOException
+	{
+		byte[] source = StreamUtils.readStream(getStream("expected_01.xml"));
+		ConfigTree confTree = ConfigTree.fromXml(new String(source));
+		byte[] expected = source;
+		
+		// Create the ConfigTree from a String.  Then...
+		// Dump the XML to a buffer and compare it with the expected - checking that the
+		// Created ConfigTree DOM is the same as what was supplied in the stream.  Also
+		// tests the toXML method.  If this fails, either fromInputStream is not working correctly
+		// or the toXML method is not serialising correctly.
+		String output = confTree.toXml();
+		assertTrue("ConfigTree creation from a String failed, or, ConfigTree toXML failed - failed to produce the same XML.", 
+				StringUtils.equalsIgnoreLinebreaks(new String(expected), output, false));
+	}
+
+	public void test_Constructor_Clone() throws SAXException, IOException {
+		ConfigTree conf1 = ConfigTree.fromInputStream(getStream("testfile1.xml"));
+//		ByteArrayOutputStream output;
+		byte[] expected = StreamUtils.readStream(getStream("expected_01.xml"));	
+		// Create a new ConfigTree from an existing one and compare it with the expected.
+		ConfigTree conf2 = conf1.cloneObj();
+		assertTrue("ConfigTree creation from a stream failed, or, cloneObj failed - failed to produce the same XML.", 
+				StringUtils.equalsIgnoreLinebreaks(new String(expected), conf2.toXml(), false));
+	}
+
+	public void test_Constructor_String_withoutparent() throws SAXException, IOException {
+		// Create a new ConfigTree from without a parent ConfigTree.
+		ConfigTree confTree = new ConfigTree("newConfigTree",null);
+		
+		assertEquals("New ConfigTree invalid.", "<newConfigTree/>" , confTree.toXml());
+	}
+	
+	public void test_getName() {
+		ConfigTree confTree = new ConfigTree("newConfigTree",null);
+		assertEquals("getName returned invalid data.", "newConfigTree", confTree.getName());
+	}
+	
+	public void test_getAttrKeys_hasnokeys() throws SAXException, IOException {
+		ConfigTree confTree = new ConfigTree("newConfigTree",null);		
+		assertTrue("invalid attribute name list", confTree.attributeCount()== 0);
+	}
+	
+	public void test_getAttrKeys_haskeys() throws SAXException, IOException {
+		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile2.xml"));
+		String[] expected = new String[] {"attrib1", "attrib2", "attrib3"};
+		Arrays.sort(expected);
+		String[] actual = confTree.getAttributeNames().toArray(new String[confTree.attributeCount()]);
+		Arrays.sort(actual);
+		
+		assertTrue("invalid attribute name list", Arrays.equals(expected, actual));
+	}
+	
+	public void test_getAttr() throws SAXException, IOException {
+		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile2.xml"));
+		
+		assertEquals("invalid attribute value", "value2", confTree.getAttribute("attrib2"));
+		assertEquals("invalid attribute value", null, confTree.getAttribute("attribXX"));
+	}
+	
+	public void test_getTextChildren() throws SAXException, IOException {
+		// This test also tests the static method getTextValue. 
+		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile3.xml"));
+		
+		// REVIEW: These tests capture the current behavior of the getTextChildren method.  I'm not convinced this behavior is correct!!
+		// I think perhaps this method should not be depending on getTextValue because getTextValue
+		// concatentates the child text nodes.
+		assertTrue("invalid Text Children list", 
+				"Some root text... and some more root text...".equals(confTree.getWholeText()));
+		assertTrue("invalid Text Children list", 
+				Arrays.equals(new String[] {"", "Some nested text..."}, confTree.getTextChildren("el")));
+	}
+
+	public void test_getElementChildren() throws SAXException, IOException {
+		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile3.xml"));
+		ConfigTree[] confTrees;
+
+		String expected = new String(StreamUtils.readStream(getStream("expected_03.xml"))).trim();
+		assertEquals("Wrong ConfigTree ElementChild value.", expected, confTree.toString().trim());
+
+		// Test the nested <el> elements - of which there are 2...
+		confTrees = confTree.getChildren("el");
+		assertEquals("Wrong number of ConfigTree ElementChildren.", 2, confTrees.length);
+		assertEquals("Wrong ConfigTree ElementChild value.", "<el index=\"1\"/>", confTrees[0].toString().trim());
+		assertEquals("Wrong ConfigTree ElementChild value.", "<el index=\"2\">Some nested text...</el>", confTrees[1].toString().trim());
+
+		// Test for a non-existant element...
+		confTrees = confTree.getChildren("xxxx");
+		assertEquals("Wrong number of ConfigTree ElementChildren.", 0, confTrees.length);
+	}
+	
+	public void test_getFirstElementChild() throws SAXException, IOException {
+		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile3.xml"));
+		
+		String expected = new String(StreamUtils.readStream(getStream("expected_03.xml"))).trim();
+		assertEquals("Wrong ConfigTree ElementChild value.", expected, confTree.toString().trim());
+
+		// Test the nested <el> elements - of which there are 2...
+		confTree = confTree.getFirstChild("el");
+		assertEquals("Wrong ConfigTree ElementChild value.", "<el index=\"1\"/>", confTree.toString().trim());
+
+		// Test for a non-existant element...
+		confTree = confTree.getFirstChild("xxxx");
+		assertEquals("Expected null ConfigTree ElementChildren for non-existant element.", null, confTree);
+	}
+
+	public void test_getAllElemChildren() throws SAXException, IOException {
+		ConfigTree confTree = ConfigTree.fromInputStream(getStream("testfile3.xml"));
+		ConfigTree[] confTrees;
+
+		confTrees = confTree.getAllChildren();
+		assertEquals("Wrong number of ConfigTree ElementChildren.", 2, confTrees.length);
+		assertEquals("Wrong ConfigTree ElementChild value.", "<el index=\"1\"/>", confTrees[0].toString().trim());
+		assertEquals("Wrong ConfigTree ElementChild value.", "<el index=\"2\">Some nested text...</el>", confTrees[1].toString().trim());
+
+		// REVIEW: Note, this method only returns ConfigTree instances for the child elements
+		// of the document root node. Comparing this to the behaviour of getFirstElementChild
+		// would seem to demonstrate an inconsitency???  To be consistent, I would expect this method 
+		// to return a list of 3 ConfigTree instances - the <root> and 2 <el> elements.
+	}
+	
+	public void test_setAttr() throws SAXException, IOException {
+		ConfigTree confTree = new ConfigTree("newConfigTree");
+		
+		confTree.setAttribute("attrib1", "value1");
+		assertEquals("value1", confTree.getAttribute("attrib1"));
+
+		// A null value removes the attribute.
+		confTree.setAttribute("attrib1", null);
+		assertEquals(null, confTree.getAttribute("attrib1"));
+
+		try { confTree.setAttribute(null, null); }
+		catch (IllegalArgumentException e) {/* OK  we expect this */}
+		catch (Exception e2) {fail(e2.getMessage());}
+	}
+	
+	public void test_addElemChild() throws SAXException, IOException {
+		ConfigTree ConfigTree1 = new ConfigTree("newConfigTree");
+		ConfigTree ConfigTreeX = new ConfigTree("X",ConfigTree1);
+		new ConfigTree("Y1",ConfigTree1);
+		new ConfigTree("Y2",ConfigTreeX);
+		
+		assertEquals("<newConfigTree><X><Y2/></X><Y1/></newConfigTree>", ConfigTree1.toString().trim());
+	}
+	
+	public void test_rmvChildsByName() throws SAXException, IOException {
+		ConfigTree ConfigTree1 = new ConfigTree("newConfigTree");
+		ConfigTree ConfigTreeX = new ConfigTree("X",ConfigTree1);
+		new ConfigTree("Y1",ConfigTree1);
+		new ConfigTree("Y2",ConfigTreeX);
+		
+		assertEquals("<newConfigTree><X><Y2/></X><Y1/></newConfigTree>", ConfigTree1.toString().trim());
+		ConfigTree1.removeChildrenByName("Y1");
+		assertEquals("<newConfigTree><X><Y2/></X></newConfigTree>", ConfigTree1.toString().trim());
+	}
+	
+	public void test_cloneObj() throws SAXException, IOException {
+		ConfigTree ConfigTree1 = new ConfigTree("newConfigTree");
+		new ConfigTree("X",ConfigTree1);
+		new ConfigTree("Y",ConfigTree1);
+		
+		ConfigTree clone = ConfigTree1.cloneObj();
+		
+		assertTrue("Clone should produce a completely different object", (ConfigTree1 != clone));
+		assertEquals("Clone should produce the same XML", ConfigTree1.toString(), clone.toString());
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/EmailUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/EmailUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/EmailUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,94 +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.helpers;
-
-import java.io.IOException;
-
-import javax.mail.Address;
-import javax.mail.MessagingException;
-import javax.mail.internet.AddressException;
-import javax.mail.internet.MimeBodyPart;
-import javax.mail.internet.MimeMessage;
-import javax.mail.internet.MimeMultipart;
-
-import junit.framework.TestCase;
-
-/**
- * Tests for the EsbEmail class.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class EmailUnitTest extends TestCase {
-
-	private ConfigTree mailParams;
-	
-	@Override
-	protected void setUp() throws Exception {
-		mailParams = ConfigTree.fromInputStream(getClass().getResourceAsStream("testfile4.xml"));
-	}
-
-	public void test_Email() throws AddressException, MessagingException, IOException {
-		// Look at the source message in testfile4.xml before reading this test.
-		
-        Email esbMail = new Email();
-        esbMail.setSendTo(mailParams.getAttribute(Email.SENDTO));
-        esbMail.setFrom(mailParams.getAttribute(Email.FROM));
-        esbMail.setCopyTo(mailParams.getAttribute(Email.COPYTO));
-        esbMail.setSubject(mailParams.getAttribute(Email.SUBJECT));
-
-        esbMail.setAttachments(mailParams.getTextChildren(Email.ATTACH));
-        esbMail.setMessage(mailParams.getAttribute(Email.MESSAGE));
-		MimeMessage message = esbMail.getMailMessage();
-		Address[] addresses;
-
-		// Check the "from" address details...
-		addresses = message.getFrom();
-		assertEquals(1, addresses.length);
-		assertEquals("x.x at x.com", addresses[0].toString());
-		
-		// Check the "to" address details...
-		addresses = message.getRecipients(MimeMessage.RecipientType.TO); 
-		assertEquals(2, addresses.length);
-		assertEquals("b.b at b.com", addresses[0].toString());
-		assertEquals("c.c at c.com", addresses[1].toString());
-		
-		// Check the "cc" address details...
-		addresses = message.getRecipients(MimeMessage.RecipientType.CC); 
-		assertEquals(2, addresses.length);
-		assertEquals("d.d at c.com", addresses[0].toString());
-		assertEquals("e.e at e.com", addresses[1].toString());
-		
-		// Check the "subject"...
-		assertEquals("Unit Test - Subject", message.getSubject());
-		
-		// Check the message body, including attachments...
-		MimeMultipart content = (MimeMultipart) message.getContent(); // expect a cast exception if it's not the expected type!
-		assertEquals(3, content.getCount()); // the message and the 2 attachments - see testfile4.xml
-		MimeBodyPart part = (MimeBodyPart) content.getBodyPart(0); // the message
-		assertEquals("Unit Test - Message", ((String)part.getContent()).trim());
-		part = (MimeBodyPart) content.getBodyPart(1); // attachement 1
-		assertEquals("attachment1.txt", ((String)part.getFileName()).trim());
-		part = (MimeBodyPart) content.getBodyPart(2); // attachement 2
-		assertEquals("attachment2.txt", ((String)part.getFileName()).trim());
-	}
-	
-	// TODO: Add some negative tests!!!
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/EmailUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/EmailUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/EmailUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/EmailUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,94 @@
+/*
+ * 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.helpers;
+
+import java.io.IOException;
+
+import javax.mail.Address;
+import javax.mail.MessagingException;
+import javax.mail.internet.AddressException;
+import javax.mail.internet.MimeBodyPart;
+import javax.mail.internet.MimeMessage;
+import javax.mail.internet.MimeMultipart;
+
+import junit.framework.TestCase;
+
+/**
+ * Tests for the EsbEmail class.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class EmailUnitTest extends TestCase {
+
+	private ConfigTree mailParams;
+	
+	@Override
+	protected void setUp() throws Exception {
+		mailParams = ConfigTree.fromInputStream(getClass().getResourceAsStream("testfile4.xml"));
+	}
+
+	public void test_Email() throws AddressException, MessagingException, IOException {
+		// Look at the source message in testfile4.xml before reading this test.
+		
+        Email esbMail = new Email();
+        esbMail.setSendTo(mailParams.getAttribute(Email.SENDTO));
+        esbMail.setFrom(mailParams.getAttribute(Email.FROM));
+        esbMail.setCopyTo(mailParams.getAttribute(Email.COPYTO));
+        esbMail.setSubject(mailParams.getAttribute(Email.SUBJECT));
+
+        esbMail.setAttachments(mailParams.getTextChildren(Email.ATTACH));
+        esbMail.setMessage(mailParams.getAttribute(Email.MESSAGE));
+		MimeMessage message = esbMail.getMailMessage();
+		Address[] addresses;
+
+		// Check the "from" address details...
+		addresses = message.getFrom();
+		assertEquals(1, addresses.length);
+		assertEquals("x.x at x.com", addresses[0].toString());
+		
+		// Check the "to" address details...
+		addresses = message.getRecipients(MimeMessage.RecipientType.TO); 
+		assertEquals(2, addresses.length);
+		assertEquals("b.b at b.com", addresses[0].toString());
+		assertEquals("c.c at c.com", addresses[1].toString());
+		
+		// Check the "cc" address details...
+		addresses = message.getRecipients(MimeMessage.RecipientType.CC); 
+		assertEquals(2, addresses.length);
+		assertEquals("d.d at c.com", addresses[0].toString());
+		assertEquals("e.e at e.com", addresses[1].toString());
+		
+		// Check the "subject"...
+		assertEquals("Unit Test - Subject", message.getSubject());
+		
+		// Check the message body, including attachments...
+		MimeMultipart content = (MimeMultipart) message.getContent(); // expect a cast exception if it's not the expected type!
+		assertEquals(3, content.getCount()); // the message and the 2 attachments - see testfile4.xml
+		MimeBodyPart part = (MimeBodyPart) content.getBodyPart(0); // the message
+		assertEquals("Unit Test - Message", ((String)part.getContent()).trim());
+		part = (MimeBodyPart) content.getBodyPart(1); // attachement 1
+		assertEquals("attachment1.txt", ((String)part.getFileName()).trim());
+		part = (MimeBodyPart) content.getBodyPart(2); // attachement 2
+		assertEquals("attachment2.txt", ((String)part.getFileName()).trim());
+	}
+	
+	// TODO: Add some negative tests!!!
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/KeyValuePairUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/KeyValuePairUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/KeyValuePairUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.soa.esb.helpers;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-/**
- * Unit tests for the KeyValuePair class.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class KeyValuePairUnitTest extends TestCase {
-
-	public void test_Constructor_args() {
-		try {
-			new KeyValuePair(null, "aaa");
-			fail("Expected IllegalArgumentException");
-		} catch(IllegalArgumentException e) {
-			// expected
-		}
-		try {
-			new KeyValuePair(" ", "aaa");
-			fail("Expected IllegalArgumentException");
-		} catch(IllegalArgumentException e) {
-			// expected
-		}
-		new KeyValuePair("a", "aaa");
-		new KeyValuePair("a", null);
-		new KeyValuePair("a", "");
-	}
-
-	public void test_methods() {
-		KeyValuePair kvp = new KeyValuePair("key", "value");
-		
-		assertEquals("key", kvp.getKey());
-		assertEquals("value", kvp.getValue());
-		assertEquals("value", kvp.toString());
-		assertEquals("KVpair[key=value]", kvp.dump());
-	}
-
-    public void test_list() {
-        List<KeyValuePair> list = new ArrayList<KeyValuePair>();
-        
-        list.add(new KeyValuePair("key1", "value1"));
-        list.add(new KeyValuePair("key2", "true"));
-        list.add(new KeyValuePair("key3", "false"));
-        list.add(new KeyValuePair("key4", "2"));
-        list.add(new KeyValuePair("key5", "10.8"));
-
-        assertEquals("value1", KeyValuePair.getValue("key1", list));
-        assertEquals("true", KeyValuePair.getValue("key2", list));
-        assertEquals("false", KeyValuePair.getValue("key3", list));
-        assertEquals("2", KeyValuePair.getValue("key4", list));
-
-        assertEquals(true, KeyValuePair.getBooleanValue("key2", list, false));
-        assertEquals(false, KeyValuePair.getBooleanValue("key3", list, true));
-        assertEquals(true, KeyValuePair.getBooleanValue("key1", list, true));
-
-        assertEquals(2.0, KeyValuePair.getDoubleValue("key4", list, 10.0));
-        assertEquals(10.8, KeyValuePair.getDoubleValue("key5", list, 2.0));
-        assertEquals(100.0, KeyValuePair.getDoubleValue("key1", list, 100.0));
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/KeyValuePairUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/KeyValuePairUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/KeyValuePairUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/KeyValuePairUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,84 @@
+/*
+ * 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.helpers;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+/**
+ * Unit tests for the KeyValuePair class.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class KeyValuePairUnitTest extends TestCase {
+
+	public void test_Constructor_args() {
+		try {
+			new KeyValuePair(null, "aaa");
+			fail("Expected IllegalArgumentException");
+		} catch(IllegalArgumentException e) {
+			// expected
+		}
+		try {
+			new KeyValuePair(" ", "aaa");
+			fail("Expected IllegalArgumentException");
+		} catch(IllegalArgumentException e) {
+			// expected
+		}
+		new KeyValuePair("a", "aaa");
+		new KeyValuePair("a", null);
+		new KeyValuePair("a", "");
+	}
+
+	public void test_methods() {
+		KeyValuePair kvp = new KeyValuePair("key", "value");
+		
+		assertEquals("key", kvp.getKey());
+		assertEquals("value", kvp.getValue());
+		assertEquals("value", kvp.toString());
+		assertEquals("KVpair[key=value]", kvp.dump());
+	}
+
+    public void test_list() {
+        List<KeyValuePair> list = new ArrayList<KeyValuePair>();
+        
+        list.add(new KeyValuePair("key1", "value1"));
+        list.add(new KeyValuePair("key2", "true"));
+        list.add(new KeyValuePair("key3", "false"));
+        list.add(new KeyValuePair("key4", "2"));
+        list.add(new KeyValuePair("key5", "10.8"));
+
+        assertEquals("value1", KeyValuePair.getValue("key1", list));
+        assertEquals("true", KeyValuePair.getValue("key2", list));
+        assertEquals("false", KeyValuePair.getValue("key3", list));
+        assertEquals("2", KeyValuePair.getValue("key4", list));
+
+        assertEquals(true, KeyValuePair.getBooleanValue("key2", list, false));
+        assertEquals(false, KeyValuePair.getBooleanValue("key3", list, true));
+        assertEquals(true, KeyValuePair.getBooleanValue("key1", list, true));
+
+        assertEquals(2.0, KeyValuePair.getDoubleValue("key4", list, 10.0));
+        assertEquals(10.8, KeyValuePair.getDoubleValue("key5", list, 2.0));
+        assertEquals(100.0, KeyValuePair.getDoubleValue("key1", list, 100.0));
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_01.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_01.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,7 +0,0 @@
-<test>
-	<el index="1"/>
-	<el index="2">
-		<el index="2.1"/>
-		And some text...
-	</el>
-</test>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_01.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_01.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_01.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,7 @@
+<test>
+	<el index="1"/>
+	<el index="2">
+		<el index="2.1"/>
+		And some text...
+	</el>
+</test>

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_02.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_02.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_02.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1 +0,0 @@
-<test>&#10;<el index="1"/>&#10;<el index="2">&#10;<el index="2.1"/>&#10;And some text...&#10;</el>&#10;</test>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_02.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_02.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_02.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_02.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1 @@
+<test>&#10;<el index="1"/>&#10;<el index="2">&#10;<el index="2.1"/>&#10;And some text...&#10;</el>&#10;</test>
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_03.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_03.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_03.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1 +0,0 @@
-<root><el index="1"/>Some root text...<el index="2">Some nested text...</el> and some more root text...</root>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_03.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_03.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_03.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/expected_03.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1 @@
+<root><el index="1"/>Some root text...<el index="2">Some nested text...</el> and some more root text...</root>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,131 +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.helpers.persist;
-
-import static org.junit.Assert.assertTrue;
-
-import java.sql.PreparedStatement;
-import java.sql.ResultSet;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Unit tests for the JdbcCleanConn class.
- *
- * @author <a href="mailto:jplenhart at yahoo.com">jplenhart at yahoo.com</a>
- */
-
-
-public class JdbcCleanConnUnitTest
-{
-
-    private static final String PERSIST_DB_DIR = System.getProperty("org.jboss.esb.test.persistdb.dir",
-    		"./rosetta/tests/resources/etc") ;
-    private static String mDbDriver ="org.hsqldb.jdbcDriver";
-    private static String mDbUrl = "jdbc:hsqldb:file:" + PERSIST_DB_DIR + "/persistUnitTestDB";
-    private static String mDbUsername = "sa";
-    private static String mDbPassword ="";
-
-    /**
-     * Setup the database.
-     */
-    @BeforeClass
-    public static void runBeforeAllTests()
-    {
-        try
-        {
-            HsqldbUtil.startHsqldb(PERSIST_DB_DIR + "/persistUnitTestDB", "persistUnitTestDB");
-        }
-        catch (Exception e)
-        {
-            e.printStackTrace();
-            System.out.println("No Database Available - Stop Testing");
-            assertTrue(false);
-        }
-
-    }
-
-
-    /**
-     *
-     * Instantiate with all Correct Parameters
-     * Using our SimpleDataSource and verify we can
-     * connect to the database
-     */
-    @Test
-    public void instantiateWithSimpleDataSource()
-    {
-        try
-        {
-            SimpleDataSource ds = new SimpleDataSource(mDbDriver, mDbUrl, mDbUsername, mDbPassword);
-            JdbcCleanConn jClnConn = new JdbcCleanConn(ds);
-            PreparedStatement pstat = jClnConn.prepareStatement("select * from message", ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY);
-            //Now Execute the PreparedStatement
-            ResultSet rs = jClnConn.execQueryWait(pstat,1);
-
-            if(rs.next())
-                assertTrue(true);
-            else
-                assertTrue(false);
-
-
-        }
-        catch (Exception _ex)
-        {
-            _ex.printStackTrace();
-            assertTrue(false);
-        }
-
-    }
-
-
-
-
-    /**
-     * Shutdown the database
-     *
-     * @throws Exception
-     */
-    @AfterClass
-    public static void runAfterAllTests() throws Exception
-    {
-        if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
-        {
-            HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
-            System.out.println("Database Shutdown Complete");
-        }
-
-    }
-
-    public static junit.framework.Test suite()
-    {
-        return new JUnit4TestAdapter(JdbcCleanConnUnitTest.class);
-    }
-
-
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/JdbcCleanConnUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,131 @@
+/*
+ * 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.helpers.persist;
+
+import static org.junit.Assert.assertTrue;
+
+import java.sql.PreparedStatement;
+import java.sql.ResultSet;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Unit tests for the JdbcCleanConn class.
+ *
+ * @author <a href="mailto:jplenhart at yahoo.com">jplenhart at yahoo.com</a>
+ */
+
+
+public class JdbcCleanConnUnitTest
+{
+
+    private static final String PERSIST_DB_DIR = System.getProperty("org.jboss.esb.test.persistdb.dir",
+    		"./rosetta/tests/resources/etc") ;
+    private static String mDbDriver ="org.hsqldb.jdbcDriver";
+    private static String mDbUrl = "jdbc:hsqldb:file:" + PERSIST_DB_DIR + "/persistUnitTestDB";
+    private static String mDbUsername = "sa";
+    private static String mDbPassword ="";
+
+    /**
+     * Setup the database.
+     */
+    @BeforeClass
+    public static void runBeforeAllTests()
+    {
+        try
+        {
+            HsqldbUtil.startHsqldb(PERSIST_DB_DIR + "/persistUnitTestDB", "persistUnitTestDB");
+        }
+        catch (Exception e)
+        {
+            e.printStackTrace();
+            System.out.println("No Database Available - Stop Testing");
+            assertTrue(false);
+        }
+
+    }
+
+
+    /**
+     *
+     * Instantiate with all Correct Parameters
+     * Using our SimpleDataSource and verify we can
+     * connect to the database
+     */
+    @Test
+    public void instantiateWithSimpleDataSource()
+    {
+        try
+        {
+            SimpleDataSource ds = new SimpleDataSource(mDbDriver, mDbUrl, mDbUsername, mDbPassword);
+            JdbcCleanConn jClnConn = new JdbcCleanConn(ds);
+            PreparedStatement pstat = jClnConn.prepareStatement("select * from message", ResultSet.TYPE_FORWARD_ONLY,ResultSet.CONCUR_READ_ONLY);
+            //Now Execute the PreparedStatement
+            ResultSet rs = jClnConn.execQueryWait(pstat,1);
+
+            if(rs.next())
+                assertTrue(true);
+            else
+                assertTrue(false);
+
+
+        }
+        catch (Exception _ex)
+        {
+            _ex.printStackTrace();
+            assertTrue(false);
+        }
+
+    }
+
+
+
+
+    /**
+     * Shutdown the database
+     *
+     * @throws Exception
+     */
+    @AfterClass
+    public static void runAfterAllTests() throws Exception
+    {
+        if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
+        {
+            HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
+            System.out.println("Database Shutdown Complete");
+        }
+
+    }
+
+    public static junit.framework.Test suite()
+    {
+        return new JUnit4TestAdapter(JdbcCleanConnUnitTest.class);
+    }
+
+
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,183 +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.helpers.persist;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.sql.Connection;
-import java.sql.ResultSet;
-import java.sql.Statement;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Unit tests for the SimpleDataSource class.
- *
- * @author <a href="mailto:jplenhart at yahoo.com">jplenhart at yahoo.com</a>
- */
-
-
-public class SimpleDataSourceUnitTest
-{
-
-    private static final String PERSIST_DB_DIR = System.getProperty("org.jboss.esb.test.persistdb.dir",
-    		"./rosetta/tests/resources/etc") ;
-    private static String mDbDriver ="org.hsqldb.jdbcDriver";
-    private static String mDbUrl = "jdbc:hsqldb:file:" + PERSIST_DB_DIR + "/persistUnitTestDB";
-    private static String mDbUsername = "sa";
-    private static String mDbPassword ="";
-
-    private static Logger logger = Logger.getLogger(SimpleDataSourceUnitTest.class);
-
-
-
-
-    /**
-     * Setup the database.
-     */
-    @BeforeClass
-    public static void runBeforeAllTests()
-    {
-        try
-        {
-            HsqldbUtil.startHsqldb(PERSIST_DB_DIR + "/persistUnitTestDB", "persistUnitTestDB");
-        }
-        catch (Exception e)
-        {
-			logger.error("No Database Available - Stop Testing", e);
-            assertTrue(false);
-        }
-
-    }
-
-
-    /**
-     *
-     * Instantiate with all Correct Parameters
-     * Connect to the Database validate timeout
-     */
-    @Test
-    public void instantiateAndSetTimeout()
-    {
-        try
-        {
-            SimpleDataSource simpleDS = new SimpleDataSource(mDbDriver, mDbUrl, mDbUsername, mDbPassword);
-
-            simpleDS.setLoginTimeout(10000);
-            assertEquals(simpleDS.getLoginTimeout(),10000);
-        }
-        catch (Exception _ex)
-        {
-            logger.error(_ex.getLocalizedMessage(), _ex);
-            assertTrue(false);
-        }
-
-    }
-
-    /**
-     *
-     * Instantiate with all Correct Parameters
-     * Connect to the Database and Run a Simple
-     * Query
-     */
-    @Test
-    public void instantiateWithCorrectParameters()
-    {
-
-        try
-        {
-            SimpleDataSource simpleDS = new SimpleDataSource(mDbDriver, mDbUrl, mDbUsername, mDbPassword);
-            // Grab the connection created and do a simple Query - we expect a result
-            Connection con = simpleDS.getConnection();
-            Statement stat = con.createStatement();
-            ResultSet rs = stat.executeQuery("select * from message");
-
-            if(rs.next())
-                assertTrue(true);
-            else
-                assertTrue(false);
-        }
-        catch (Exception _ex)
-        {
-            logger.error(_ex.getLocalizedMessage(), _ex);
-            assertTrue(false);
-        }
-    }
-
-    /**
-     *
-     * Instantiate with InCorrect Parameters
-     * Connect to the Database - verify it errors properly
-     * by throwing an Exception
-     */
-    @Test
-    public void instantiateWithInCorrectParameters()
-    {
-
-        try
-        {
-            // Setting a Bogus Driver
-            SimpleDataSource simpleDS = new SimpleDataSource("bogusDriver", mDbUrl, mDbUsername, mDbPassword);
-            logger.log(Level.INFO, simpleDS); 
-            assertTrue(false);
-        }
-        catch (Exception _ex)
-        {
-            // This is Expected
-            assertTrue(true);
-        }
-
-    }
-
-
-
-    /**
-     * Shutdown the database
-     *
-     * @throws Exception
-     */
-    @AfterClass
-    public static void runAfterAllTests() throws Exception
-    {
-        if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
-        {
-            HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
-            logger.debug("Database Shutdown Complete");
-        }
-    }
-
-    public static junit.framework.Test suite()
-    {
-        return new JUnit4TestAdapter(SimpleDataSourceUnitTest.class);
-    }
-
-
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/persist/SimpleDataSourceUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,183 @@
+/*
+ * 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.helpers.persist;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.sql.Connection;
+import java.sql.ResultSet;
+import java.sql.Statement;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Unit tests for the SimpleDataSource class.
+ *
+ * @author <a href="mailto:jplenhart at yahoo.com">jplenhart at yahoo.com</a>
+ */
+
+
+public class SimpleDataSourceUnitTest
+{
+
+    private static final String PERSIST_DB_DIR = System.getProperty("org.jboss.esb.test.persistdb.dir",
+    		"./rosetta/tests/resources/etc") ;
+    private static String mDbDriver ="org.hsqldb.jdbcDriver";
+    private static String mDbUrl = "jdbc:hsqldb:file:" + PERSIST_DB_DIR + "/persistUnitTestDB";
+    private static String mDbUsername = "sa";
+    private static String mDbPassword ="";
+
+    private static Logger logger = Logger.getLogger(SimpleDataSourceUnitTest.class);
+
+
+
+
+    /**
+     * Setup the database.
+     */
+    @BeforeClass
+    public static void runBeforeAllTests()
+    {
+        try
+        {
+            HsqldbUtil.startHsqldb(PERSIST_DB_DIR + "/persistUnitTestDB", "persistUnitTestDB");
+        }
+        catch (Exception e)
+        {
+			logger.error("No Database Available - Stop Testing", e);
+            assertTrue(false);
+        }
+
+    }
+
+
+    /**
+     *
+     * Instantiate with all Correct Parameters
+     * Connect to the Database validate timeout
+     */
+    @Test
+    public void instantiateAndSetTimeout()
+    {
+        try
+        {
+            SimpleDataSource simpleDS = new SimpleDataSource(mDbDriver, mDbUrl, mDbUsername, mDbPassword);
+
+            simpleDS.setLoginTimeout(10000);
+            assertEquals(simpleDS.getLoginTimeout(),10000);
+        }
+        catch (Exception _ex)
+        {
+            logger.error(_ex.getLocalizedMessage(), _ex);
+            assertTrue(false);
+        }
+
+    }
+
+    /**
+     *
+     * Instantiate with all Correct Parameters
+     * Connect to the Database and Run a Simple
+     * Query
+     */
+    @Test
+    public void instantiateWithCorrectParameters()
+    {
+
+        try
+        {
+            SimpleDataSource simpleDS = new SimpleDataSource(mDbDriver, mDbUrl, mDbUsername, mDbPassword);
+            // Grab the connection created and do a simple Query - we expect a result
+            Connection con = simpleDS.getConnection();
+            Statement stat = con.createStatement();
+            ResultSet rs = stat.executeQuery("select * from message");
+
+            if(rs.next())
+                assertTrue(true);
+            else
+                assertTrue(false);
+        }
+        catch (Exception _ex)
+        {
+            logger.error(_ex.getLocalizedMessage(), _ex);
+            assertTrue(false);
+        }
+    }
+
+    /**
+     *
+     * Instantiate with InCorrect Parameters
+     * Connect to the Database - verify it errors properly
+     * by throwing an Exception
+     */
+    @Test
+    public void instantiateWithInCorrectParameters()
+    {
+
+        try
+        {
+            // Setting a Bogus Driver
+            SimpleDataSource simpleDS = new SimpleDataSource("bogusDriver", mDbUrl, mDbUsername, mDbPassword);
+            logger.log(Level.INFO, simpleDS); 
+            assertTrue(false);
+        }
+        catch (Exception _ex)
+        {
+            // This is Expected
+            assertTrue(true);
+        }
+
+    }
+
+
+
+    /**
+     * Shutdown the database
+     *
+     * @throws Exception
+     */
+    @AfterClass
+    public static void runAfterAllTests() throws Exception
+    {
+        if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
+        {
+            HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
+            logger.debug("Database Shutdown Complete");
+        }
+    }
+
+    public static junit.framework.Test suite()
+    {
+        return new JUnit4TestAdapter(SimpleDataSourceUnitTest.class);
+    }
+
+
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile1.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile1.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile1.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,7 +0,0 @@
-<test>
-	<el index="1"/>
-	<el index="2">
-		<el index="2.1"/>
-		And some text...
-	</el>
-</test>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile1.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile1.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile1.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile1.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,7 @@
+<test>
+	<el index="1"/>
+	<el index="2">
+		<el index="2.1"/>
+		And some text...
+	</el>
+</test>
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile2.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile2.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile2.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1 +0,0 @@
-<test attrib1="value1" attrib2="value2" attrib3="valu3" />
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile2.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile2.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile2.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile2.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1 @@
+<test attrib1="value1" attrib2="value2" attrib3="valu3" />
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile3.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile3.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile3.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1 +0,0 @@
-<root><el index="1"/>Some root text...<el index="2">Some nested text...</el> and some more root text...</root>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile3.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile3.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile3.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile3.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1 @@
+<root><el index="1"/>Some root text...<el index="2">Some nested text...</el> and some more root text...</root>
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile4.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile4.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile4.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,9 +0,0 @@
-<mailParams	from="x.x at x.com" 
-			sendTo="b.b at b.com,c.c at c.com" 
-			ccTo="d.d at c.com,e.e at e.com" 
-			subject="Unit Test - Subject" message="Unit Test - Message">
-			
-	<attachment>attachment1.txt</attachment>
-	<attachment>attachment2.txt</attachment>
-	
-</mailParams>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile4.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile4.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile4.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/helpers/testfile4.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,9 @@
+<mailParams	from="x.x at x.com" 
+			sendTo="b.b at b.com,c.c at c.com" 
+			ccTo="d.d at c.com,e.e at e.com" 
+			subject="Unit Test - Subject" message="Unit Test - Message">
+			
+	<attachment>attachment1.txt</attachment>
+	<attachment>attachment2.txt</attachment>
+	
+</mailParams>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/LifecycleUtilUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/LifecycleUtilUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/LifecycleUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,84 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2006, JBoss Inc., and individual contributors as indicated
- * by the @authors tag. See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-
-package org.jboss.soa.esb.listeners;
-
-import java.io.File;
-import java.io.FileInputStream;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
-
-public class LifecycleUtilUnitTest extends TestCase
-{
-	public void testLifecycleUtil () throws Exception
-	{
-                final File tmpDir = new File(System.getProperty("java.io.tmpdir"));
-                final String tmpDirURL = tmpDir.toURL().toExternalForm() ;
-                
-		boolean exception = false;
-		
-		try
-		{
-			LifecycleUtil.getListeners("fubar");
-		}
-		catch (IllegalArgumentException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		try
-		{
-			String configFile = getClass().getResource("listenerFile.xml").getFile();
-			FileInputStream input = new FileInputStream(configFile);
-			byte[] data = new byte[input.available()];
-			
-			input.read(data);
-
-			ParamRepositoryFactory.getInstance().add("test", new String(data));
-                        
-                        final ConfigTree tree = LifecycleUtil.getConfigTree("test") ;
-                        final ConfigTree actionConfig = tree.getFirstChild("DummyActionConfig") ;
-                        final ConfigTree epr = actionConfig.getFirstChild("EPR") ;
-                        epr.setAttribute("URL", tmpDirURL) ;
-			
-			LifecycleUtil.getListeners(tree);
-		}
-		catch (IllegalArgumentException ex)
-		{
-			fail();
-		}
-		
-		ConfigTree test = new ConfigTree("test");
-		
-		test.setAttribute(ListenerTagNames.GATEWAY_CLASS_TAG, "org.jboss.soa.esb.listeners.gateway.FileGatewayListener");
-	
-		LifecycleUtil.getGateways(test);
-		LifecycleUtil.getGateways("test");
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/LifecycleUtilUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/LifecycleUtilUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/LifecycleUtilUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/LifecycleUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,84 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.io.FileInputStream;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.parameters.ParamRepositoryFactory;
+
+public class LifecycleUtilUnitTest extends TestCase
+{
+	public void testLifecycleUtil () throws Exception
+	{
+                final File tmpDir = new File(System.getProperty("java.io.tmpdir"));
+                final String tmpDirURL = tmpDir.toURL().toExternalForm() ;
+                
+		boolean exception = false;
+		
+		try
+		{
+			LifecycleUtil.getListeners("fubar");
+		}
+		catch (IllegalArgumentException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		try
+		{
+			String configFile = getClass().getResource("listenerFile.xml").getFile();
+			FileInputStream input = new FileInputStream(configFile);
+			byte[] data = new byte[input.available()];
+			
+			input.read(data);
+
+			ParamRepositoryFactory.getInstance().add("test", new String(data));
+                        
+                        final ConfigTree tree = LifecycleUtil.getConfigTree("test") ;
+                        final ConfigTree actionConfig = tree.getFirstChild("DummyActionConfig") ;
+                        final ConfigTree epr = actionConfig.getFirstChild("EPR") ;
+                        epr.setAttribute("URL", tmpDirURL) ;
+			
+			LifecycleUtil.getListeners(tree);
+		}
+		catch (IllegalArgumentException ex)
+		{
+			fail();
+		}
+		
+		ConfigTree test = new ConfigTree("test");
+		
+		test.setAttribute(ListenerTagNames.GATEWAY_CLASS_TAG, "org.jboss.soa.esb.listeners.gateway.FileGatewayListener");
+	
+		LifecycleUtil.getGateways(test);
+		LifecycleUtil.getGateways("test");
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerConfigUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerConfigUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerConfigUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,82 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners;
-
-import java.io.IOException;
-import java.io.InputStream;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.config.ESBAwareGenerator;
-import org.jboss.soa.esb.listeners.config.GatewayGenerator;
-import org.jboss.soa.esb.listeners.config.Generator;
-import org.w3c.dom.Document;
-
-/**
- * Test utility class for generating a listener configuration from an xsd based config.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public abstract class ListenerConfigUtil {
-
-    /**
-     * Generate an ESB aware listener config from the supplied XSD based configuration.
-     *
-     * @param config       The XSD based config stream.
-     * @param listenerName The name of listener configuration.  This is the name supplied in
-     *                     the "name" attribute on the listener config.
-     * @return The listener ConfigTree config.
-     * @throws ConfigurationException Bad listener ESB configuration.
-     * @throws IOException            Unable to read the ESB listener configuration.
-     */
-    public static ConfigTree getESBAwareListenerConfig(InputStream config, String listenerName) throws ConfigurationException, IOException {
-        Generator.XMLBeansModel model = Generator.parseConfig(config);
-
-        ESBAwareGenerator awareGenerator = new ESBAwareGenerator(model);
-        Document awareConfig = awareGenerator.generate();
-
-        return getConfigTree(awareConfig, listenerName);
-    }
-
-    /**
-     * Generate a Gateway listener config from the supplied XSD based configuration.
-     *
-     * @param config       The XSD based config stream.
-     * @param listenerName The name of listener configuration.  This is the name supplied in
-     *                     the "name" attribute on the listener config.
-     * @return The listener ConfigTree config.
-     * @throws ConfigurationException Bad listener ESB configuration.
-     * @throws IOException            Unable to read the ESB listener configuration.
-     */
-    public static ConfigTree getGatewayListenerConfig(InputStream config, String listenerName) throws ConfigurationException, IOException {
-        Generator.XMLBeansModel model = Generator.parseConfig(config);
-
-        GatewayGenerator gatewayGenerator = new GatewayGenerator(model);
-        Document gatewayConfig = gatewayGenerator.generate();
-
-        return getConfigTree(gatewayConfig, listenerName);
-    }
-
-    private static ConfigTree getConfigTree(Document configDoc, String listenerName) {
-        ConfigTree config = ConfigTree.fromElement(configDoc.getDocumentElement());
-
-        return config.getFirstChild(listenerName);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerConfigUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerConfigUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerConfigUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerConfigUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,82 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners;
+
+import java.io.IOException;
+import java.io.InputStream;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.config.ESBAwareGenerator;
+import org.jboss.soa.esb.listeners.config.GatewayGenerator;
+import org.jboss.soa.esb.listeners.config.Generator;
+import org.w3c.dom.Document;
+
+/**
+ * Test utility class for generating a listener configuration from an xsd based config.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public abstract class ListenerConfigUtil {
+
+    /**
+     * Generate an ESB aware listener config from the supplied XSD based configuration.
+     *
+     * @param config       The XSD based config stream.
+     * @param listenerName The name of listener configuration.  This is the name supplied in
+     *                     the "name" attribute on the listener config.
+     * @return The listener ConfigTree config.
+     * @throws ConfigurationException Bad listener ESB configuration.
+     * @throws IOException            Unable to read the ESB listener configuration.
+     */
+    public static ConfigTree getESBAwareListenerConfig(InputStream config, String listenerName) throws ConfigurationException, IOException {
+        Generator.XMLBeansModel model = Generator.parseConfig(config);
+
+        ESBAwareGenerator awareGenerator = new ESBAwareGenerator(model);
+        Document awareConfig = awareGenerator.generate();
+
+        return getConfigTree(awareConfig, listenerName);
+    }
+
+    /**
+     * Generate a Gateway listener config from the supplied XSD based configuration.
+     *
+     * @param config       The XSD based config stream.
+     * @param listenerName The name of listener configuration.  This is the name supplied in
+     *                     the "name" attribute on the listener config.
+     * @return The listener ConfigTree config.
+     * @throws ConfigurationException Bad listener ESB configuration.
+     * @throws IOException            Unable to read the ESB listener configuration.
+     */
+    public static ConfigTree getGatewayListenerConfig(InputStream config, String listenerName) throws ConfigurationException, IOException {
+        Generator.XMLBeansModel model = Generator.parseConfig(config);
+
+        GatewayGenerator gatewayGenerator = new GatewayGenerator(model);
+        Document gatewayConfig = gatewayGenerator.generate();
+
+        return getConfigTree(gatewayConfig, listenerName);
+    }
+
+    private static ConfigTree getConfigTree(Document configDoc, String listenerName) {
+        ConfigTree config = ConfigTree.fromElement(configDoc.getDocumentElement());
+
+        return config.getFirstChild(listenerName);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,261 +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;
-
-import java.io.File;
-import java.io.InputStream;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.Statement;
-import java.util.LinkedList;
-import java.util.Properties;
-import java.util.Queue;
-import java.util.Random;
-import java.util.concurrent.TimeUnit;
-import java.util.concurrent.locks.Condition;
-import java.util.concurrent.locks.Lock;
-import java.util.concurrent.locks.ReentrantLock;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-
-public class ListenerManagerBaseTest extends BaseTest
-{
-	/**
-	 * The message lock.
-	 */
-	private static Lock lock = new ReentrantLock() ;
-	/**
-	 * The not empty condition.
-	 */
-	private static Condition notEmpty = lock.newCondition() ;
-	/**
-	 * The queue of messages.
-	 */
-	private static final Queue<String> MESSAGES = new LinkedList<String>() ;
-	
-	/**
-	 * Clear the current message queue.
-	 */
-	protected static void clearMessages()
-	{
-		lock.lock() ;
-		try
-		{
-			MESSAGES.clear() ;
-		}
-		finally
-		{
-			lock.unlock() ;
-		}
-	}
-	
-	/**
-	 * Add the message to the message queue.
-	 * @param text The message text.
-	 */
-	protected static void addMessage(final byte[] text)
-	{
-		lock.lock() ;
-		try
-		{
-			final boolean notify = (MESSAGES.size() == 0) ;
-			final String message = new String(text) ;
-			MESSAGES.add(message) ;
-			if (notify)
-			{
-				notEmpty.signal() ;
-			}
-		}
-		finally
-		{
-			lock.unlock() ;
-		}
-	}
-	
-	/**
-	 * Get the first message from the queue.
-	 * @param timeout The maximum time to wait before returning. 
-	 * @return The first message in the queue or null on timeout.
-	 */
-	protected static String getMessage(final long timeout)
-	{
-            final long endTime = System.currentTimeMillis() + timeout ;
-            lock.lock() ;
-            try
-            {
-                while (MESSAGES.size() == 0)
-                {
-                    final long delay = endTime - System.currentTimeMillis() ;
-                    if (delay > 0)
-                    {
-                        try
-                        {
-                            notEmpty.await(delay, TimeUnit.MILLISECONDS) ;
-                        }
-                        catch (final InterruptedException ie) {} // Ignore the interrupt
-                    }
-                    else
-                    {
-                        return null ;
-                    }
-                }
-                final String message = MESSAGES.remove() ;
-                return message ;
-            }
-            finally
-            {
-                lock.unlock();
-            }
-	}
-
-	protected void runBeforeAllTests()
-	{
-		try
-		{
-			TestEnvironmentUtil.setESBPropertiesFileToUse("product",
-					"../product");
-			// Set the juddi properties file in System so juddi will pick it up
-			// later and use the test values.
-			String juddiPropertiesFile = "/org/jboss/soa/esb/listeners/juddi-unittest.properties";
-			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
-			// Read this properties file to get the db connection string
-			Properties props = new Properties();
-			InputStream inStream = Class.class
-					.getResourceAsStream(juddiPropertiesFile);
-
-			props.load(inStream);
-			mDbDriver = props.getProperty("juddi.jdbcDriver");
-			mDbUrl = props.getProperty("juddi.jdbcUrl");
-			mDbUsername = props.getProperty("juddi.jdbcUsername");
-			mDbPassword = props.getProperty("juddi.jdbcPassword");
-
-			String database = "not tested yet";
-			if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
-			{
-				database = "hsqldb";
-				// Bring up hsql on default port 9001
-				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir(
-						"product", "../product")
-						+ "/build/hsqltestdb", "juddi");
-			}
-			else if ("com.mysql.jdbc.Driver".equals(mDbDriver))
-			{
-				database = "mysql";
-			} // add and test your own database..
-
-			// Get the registry-schema create scripts
-			String sqlDir = TestEnvironmentUtil.getUserDir("product",
-					"../product")
-					+ "/install/jUDDI-registry/sql/" + database + "/";
-			// Drop what is there now, if exists. We want to start fresh.
-			String sqlDropCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "drop_database.sql"));
-			String sqlCreateCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "create_database.sql"));
-			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "insert_publishers.sql"));
-
-			try
-			{
-				Class.forName(mDbDriver);
-			}
-			catch (Exception e)
-			{
-				log.error("ERROR: failed to load " + database
-						+ " JDBC driver.", e);
-				return;
-			}
-			con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
-			Statement stmnt = con.createStatement();
-			stmnt.execute(sqlDropCmd);
-			stmnt.execute(sqlCreateCmd);
-			stmnt.execute(sqlInsertPubCmd);
-			stmnt.close();
-		}
-		catch (Throwable e)
-		{
-			log.error("We should stop testing, since we don't have a db.", e);
-			assertTrue(false);
-		}
-	}
-
-	protected final void runAfterAllTests()
-	{
-		try
-		{
-			Thread.sleep(1000);
-			Statement stmnt = con.createStatement();
-
-			stmnt.execute("SHUTDOWN");
-			stmnt.close();
-
-			con.close();
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-		}
-	}
-
-	protected static final String TMP_DIR = System
-			.getProperty("java.io.tmpdir");
-
-	protected static Logger _logger = Logger
-			.getLogger(ListenerManagerBaseTest.class);
-
-	private static String mDbDriver;
-
-	private static String mDbUrl;
-
-	private static String mDbUsername;
-
-	private static String mDbPassword;
-
-	private static Connection con;
-
-	public static class MockMessageAwareAction
-	{
-		Random _rand = new Random(System.currentTimeMillis());
-
-		ConfigTree _config;
-
-		public MockMessageAwareAction(ConfigTree config)
-		{
-			_config = config;
-		}
-
-		public Message notifyTest(Message message) throws Exception
-		{
-			addMessage(message.getBody().getByteArray());
-
-			return message;
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerBaseTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,261 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.Statement;
+import java.util.LinkedList;
+import java.util.Properties;
+import java.util.Queue;
+import java.util.Random;
+import java.util.concurrent.TimeUnit;
+import java.util.concurrent.locks.Condition;
+import java.util.concurrent.locks.Lock;
+import java.util.concurrent.locks.ReentrantLock;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.testutils.FileUtil;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+
+public class ListenerManagerBaseTest extends BaseTest
+{
+	/**
+	 * The message lock.
+	 */
+	private static Lock lock = new ReentrantLock() ;
+	/**
+	 * The not empty condition.
+	 */
+	private static Condition notEmpty = lock.newCondition() ;
+	/**
+	 * The queue of messages.
+	 */
+	private static final Queue<String> MESSAGES = new LinkedList<String>() ;
+	
+	/**
+	 * Clear the current message queue.
+	 */
+	protected static void clearMessages()
+	{
+		lock.lock() ;
+		try
+		{
+			MESSAGES.clear() ;
+		}
+		finally
+		{
+			lock.unlock() ;
+		}
+	}
+	
+	/**
+	 * Add the message to the message queue.
+	 * @param text The message text.
+	 */
+	protected static void addMessage(final byte[] text)
+	{
+		lock.lock() ;
+		try
+		{
+			final boolean notify = (MESSAGES.size() == 0) ;
+			final String message = new String(text) ;
+			MESSAGES.add(message) ;
+			if (notify)
+			{
+				notEmpty.signal() ;
+			}
+		}
+		finally
+		{
+			lock.unlock() ;
+		}
+	}
+	
+	/**
+	 * Get the first message from the queue.
+	 * @param timeout The maximum time to wait before returning. 
+	 * @return The first message in the queue or null on timeout.
+	 */
+	protected static String getMessage(final long timeout)
+	{
+            final long endTime = System.currentTimeMillis() + timeout ;
+            lock.lock() ;
+            try
+            {
+                while (MESSAGES.size() == 0)
+                {
+                    final long delay = endTime - System.currentTimeMillis() ;
+                    if (delay > 0)
+                    {
+                        try
+                        {
+                            notEmpty.await(delay, TimeUnit.MILLISECONDS) ;
+                        }
+                        catch (final InterruptedException ie) {} // Ignore the interrupt
+                    }
+                    else
+                    {
+                        return null ;
+                    }
+                }
+                final String message = MESSAGES.remove() ;
+                return message ;
+            }
+            finally
+            {
+                lock.unlock();
+            }
+	}
+
+	protected void runBeforeAllTests()
+	{
+		try
+		{
+			TestEnvironmentUtil.setESBPropertiesFileToUse("product",
+					"../product");
+			// Set the juddi properties file in System so juddi will pick it up
+			// later and use the test values.
+			String juddiPropertiesFile = "/org/jboss/soa/esb/listeners/juddi-unittest.properties";
+			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
+			// Read this properties file to get the db connection string
+			Properties props = new Properties();
+			InputStream inStream = Class.class
+					.getResourceAsStream(juddiPropertiesFile);
+
+			props.load(inStream);
+			mDbDriver = props.getProperty("juddi.jdbcDriver");
+			mDbUrl = props.getProperty("juddi.jdbcUrl");
+			mDbUsername = props.getProperty("juddi.jdbcUsername");
+			mDbPassword = props.getProperty("juddi.jdbcPassword");
+
+			String database = "not tested yet";
+			if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
+			{
+				database = "hsqldb";
+				// Bring up hsql on default port 9001
+				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir(
+						"product", "../product")
+						+ "/build/hsqltestdb", "juddi");
+			}
+			else if ("com.mysql.jdbc.Driver".equals(mDbDriver))
+			{
+				database = "mysql";
+			} // add and test your own database..
+
+			// Get the registry-schema create scripts
+			String sqlDir = TestEnvironmentUtil.getUserDir("product",
+					"../product")
+					+ "/install/jUDDI-registry/sql/" + database + "/";
+			// Drop what is there now, if exists. We want to start fresh.
+			String sqlDropCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "drop_database.sql"));
+			String sqlCreateCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "create_database.sql"));
+			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "insert_publishers.sql"));
+
+			try
+			{
+				Class.forName(mDbDriver);
+			}
+			catch (Exception e)
+			{
+				log.error("ERROR: failed to load " + database
+						+ " JDBC driver.", e);
+				return;
+			}
+			con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
+			Statement stmnt = con.createStatement();
+			stmnt.execute(sqlDropCmd);
+			stmnt.execute(sqlCreateCmd);
+			stmnt.execute(sqlInsertPubCmd);
+			stmnt.close();
+		}
+		catch (Throwable e)
+		{
+			log.error("We should stop testing, since we don't have a db.", e);
+			assertTrue(false);
+		}
+	}
+
+	protected final void runAfterAllTests()
+	{
+		try
+		{
+			Thread.sleep(1000);
+			Statement stmnt = con.createStatement();
+
+			stmnt.execute("SHUTDOWN");
+			stmnt.close();
+
+			con.close();
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+		}
+	}
+
+	protected static final String TMP_DIR = System
+			.getProperty("java.io.tmpdir");
+
+	protected static Logger _logger = Logger
+			.getLogger(ListenerManagerBaseTest.class);
+
+	private static String mDbDriver;
+
+	private static String mDbUrl;
+
+	private static String mDbUsername;
+
+	private static String mDbPassword;
+
+	private static Connection con;
+
+	public static class MockMessageAwareAction
+	{
+		Random _rand = new Random(System.currentTimeMillis());
+
+		ConfigTree _config;
+
+		public MockMessageAwareAction(ConfigTree config)
+		{
+			_config = config;
+		}
+
+		public Message notifyTest(Message message) throws Exception
+		{
+			addMessage(message.getBody().getByteArray());
+
+			return message;
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFTPIntegrationTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFTPIntegrationTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFTPIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,129 +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;
-
-import java.io.FileInputStream;
-import java.net.URI;
-import java.util.List;
-import java.util.UUID;
-
-import junit.framework.Assert;
-
-import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-public class ListenerManagerFTPIntegrationTest extends ListenerManagerFileUnitTest
-{
-
-	public ListenerManagerFTPIntegrationTest ()
-	{
-		_file = "listenerFtp.xml";
-	}
-	
-	protected void oneTest () throws Exception
-	{
-		// Write some messages to EPR obtained from configuration file
-		String configFile = getClass().getResource(_file).getFile();
-		ConfigTree tree = ConfigTree.fromInputStream(new FileInputStream(
-				configFile));
-		String url = null;
-		
-		if (getFtpPwd() == null)
-			url = "ftp://"+getFtpUser()+"@"+getFtpHostname()+":"+getFtpDir();
-		else
-			url = "ftp://"+getFtpUser()+":"+getFtpPwd()+"@"+getFtpHostname()+":"+getFtpDir();
-		
-		ConfigTree eprElement = tree.getAllChildren()[0].getFirstChild("EPR");
-		eprElement.setAttribute(ListenerTagNames.URL_TAG, url);
-		
-		EPR toEPR = ListenerUtil.assembleEpr(eprElement);
-
-		if (toEPR instanceof FTPEpr)
-		{
-			//			 take inputSuffix as outputSuffix for initial message sending
-			eprElement.setAttribute(FileEpr.POST_SUFFIX_TAG, eprElement
-					.getAttribute(FileEpr.INPUT_SUFFIX_TAG));
-			eprElement.setAttribute(FileEpr.INPUT_SUFFIX_TAG, null);
-			toEPR = ListenerUtil.assembleEpr(eprElement);
-		}
-		else
-			Assert.fail();
-		
-		String THE_TEXT = "___Config=" + _file + "___ Message Content ___";
-
-		int howMany = 10; // how many messages do you want to send before the
-							// listener comes up
-		
-		DeliverOnlyCourier sender = CourierFactory.getCourier(toEPR);
-		
-		Message message = MessageFactory.getInstance().getMessage();
-		message.getHeader().setCall(new Call(toEPR));
-		message.getBody().setByteArray(THE_TEXT.getBytes());
-		
-		for (int i1 = 0; i1 < howMany; i1++)
-		{
-			URI uri = new URI(UUID.randomUUID().toString());
-			message.getHeader().getCall().setMessageID(uri);
-			sender.deliver(message);
-		}
-
-                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(tree) ;
-                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
-                controller.start() ;
-                
-		_logger.debug(" All child listeners ready");
-
-		// JUST FOR THIS TEST:
-		// Give your listener some time to process queued messages (see howMany
-		// above)
-		// Time allowed, and maxThreads in config file will impact how many
-		// messages
-		// will be processed, and how many will remain unprocessed
-		
-                try
-                {
-                    for (int count = 0 ; count < howMany ; count++)
-                    {
-                    	final String response = getMessage(10000) ;
-                    	assertNotNull("getMessage timeout", response) ;
-                    	assertEquals(THE_TEXT, response);
-                    }
-                }
-                finally
-                {
-                    _logger.debug("going to stop");
-                    controller.stop() ;
-                    _logger.debug("back from stop");
-                }
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFTPIntegrationTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFTPIntegrationTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFTPIntegrationTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFTPIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,129 @@
+/*
+ * 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;
+
+import java.io.FileInputStream;
+import java.net.URI;
+import java.util.List;
+import java.util.UUID;
+
+import junit.framework.Assert;
+
+import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+public class ListenerManagerFTPIntegrationTest extends ListenerManagerFileUnitTest
+{
+
+	public ListenerManagerFTPIntegrationTest ()
+	{
+		_file = "listenerFtp.xml";
+	}
+	
+	protected void oneTest () throws Exception
+	{
+		// Write some messages to EPR obtained from configuration file
+		String configFile = getClass().getResource(_file).getFile();
+		ConfigTree tree = ConfigTree.fromInputStream(new FileInputStream(
+				configFile));
+		String url = null;
+		
+		if (getFtpPwd() == null)
+			url = "ftp://"+getFtpUser()+"@"+getFtpHostname()+":"+getFtpDir();
+		else
+			url = "ftp://"+getFtpUser()+":"+getFtpPwd()+"@"+getFtpHostname()+":"+getFtpDir();
+		
+		ConfigTree eprElement = tree.getAllChildren()[0].getFirstChild("EPR");
+		eprElement.setAttribute(ListenerTagNames.URL_TAG, url);
+		
+		EPR toEPR = ListenerUtil.assembleEpr(eprElement);
+
+		if (toEPR instanceof FTPEpr)
+		{
+			//			 take inputSuffix as outputSuffix for initial message sending
+			eprElement.setAttribute(FileEpr.POST_SUFFIX_TAG, eprElement
+					.getAttribute(FileEpr.INPUT_SUFFIX_TAG));
+			eprElement.setAttribute(FileEpr.INPUT_SUFFIX_TAG, null);
+			toEPR = ListenerUtil.assembleEpr(eprElement);
+		}
+		else
+			Assert.fail();
+		
+		String THE_TEXT = "___Config=" + _file + "___ Message Content ___";
+
+		int howMany = 10; // how many messages do you want to send before the
+							// listener comes up
+		
+		DeliverOnlyCourier sender = CourierFactory.getCourier(toEPR);
+		
+		Message message = MessageFactory.getInstance().getMessage();
+		message.getHeader().setCall(new Call(toEPR));
+		message.getBody().setByteArray(THE_TEXT.getBytes());
+		
+		for (int i1 = 0; i1 < howMany; i1++)
+		{
+			URI uri = new URI(UUID.randomUUID().toString());
+			message.getHeader().getCall().setMessageID(uri);
+			sender.deliver(message);
+		}
+
+                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(tree) ;
+                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
+                controller.start() ;
+                
+		_logger.debug(" All child listeners ready");
+
+		// JUST FOR THIS TEST:
+		// Give your listener some time to process queued messages (see howMany
+		// above)
+		// Time allowed, and maxThreads in config file will impact how many
+		// messages
+		// will be processed, and how many will remain unprocessed
+		
+                try
+                {
+                    for (int count = 0 ; count < howMany ; count++)
+                    {
+                    	final String response = getMessage(10000) ;
+                    	assertNotNull("getMessage timeout", response) ;
+                    	assertEquals(THE_TEXT, response);
+                    }
+                }
+                finally
+                {
+                    _logger.debug("going to stop");
+                    controller.stop() ;
+                    _logger.debug("back from stop");
+                }
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,164 +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;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.net.URI;
-import java.util.List;
-import java.util.UUID;
-
-import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-public class ListenerManagerFileUnitTest extends ListenerManagerBaseTest
-{
-	public ListenerManagerFileUnitTest ()
-	{
-		_file = "listenerFile.xml";
-	}
-
-	public void testListener ()
-	{
-		_logger.info("___Test for FILENAME: " + _file
-					+ " starting ____________________");
-		
-		try
-		{
-			oneTest();
-		}
-		catch (Exception ex)
-		{
-			_logger.error(ex.toString(), ex);
-            ex.printStackTrace();
-            fail();
-		}
-		
-		_logger.info("___Test for FILENAME: " + _file
-					+ " FINISHED ____________________");
-	}
-
-	public void setUp()
-	{
-		_logger.info("Writing temp files to " + TMP_DIR);
-
-		clearMessages() ;
-
-		// initialize registry
-		runBeforeAllTests();
-	}
-
-	public void tearDown()
-	{
-		clearMessages() ;
-		
-		runAfterAllTests();
-	}
-	
-	// TODO more refactoring, since oneText is duplicated a lot!
-	
-	protected void oneTest () throws Exception
-	{	
-		// Write wome messages to EPR obtained from configuration file
-		String configFile = getClass().getResource(_file).getFile();
-		ConfigTree tree = ConfigTree.fromInputStream(new FileInputStream(
-				configFile));
-		final File tmpDir = new File(System.getProperty("java.io.tmpdir")) ;
-		final String tmpDirForm = tmpDir.toURL().toExternalForm() ;
-
-        ConfigTree eprElement = tree.getAllChildren()[0].getFirstChild("EPR");
-		eprElement.setAttribute(ListenerTagNames.URL_TAG, tmpDirForm) ;
-		
-		EPR toEPR = ListenerUtil.assembleEpr(eprElement);
-		
-		if (toEPR instanceof FileEpr)
-		{
-			// take inputSuffix as outputSuffix for initial message sending
-			eprElement.setAttribute(FileEpr.POST_SUFFIX_TAG, eprElement
-					.getAttribute(FileEpr.INPUT_SUFFIX_TAG));
-			eprElement.setAttribute(FileEpr.INPUT_SUFFIX_TAG, null);
-			toEPR = ListenerUtil.assembleEpr(eprElement);
-		}
-		else
-			fail();
-		
-		String THE_TEXT = "___Config=" + _file + "___ Message Content ___";
-
-		int howMany = 10; // how many messages do you want to send before the
-							// listener comes up
-		
-		DeliverOnlyCourier sender = CourierFactory.getCourier(toEPR);
-		
-		Message message = MessageFactory.getInstance().getMessage();
-		message.getHeader().setCall(new Call(toEPR));
-		message.getBody().setByteArray(THE_TEXT.getBytes());
-		
-		for (int i1 = 0; i1 < howMany; i1++)
-		{
-			URI uri = new URI(UUID.randomUUID().toString());
-			message.getHeader().getCall().setMessageID(uri);
-			sender.deliver(message);
-		}
-
-		//		 launch listener manager in a child thread
-		final ConfigTree newTree = ConfigTree.fromInputStream(new FileInputStream(
-				configFile));
-		final ConfigTree newTreeEPRElement = newTree.getAllChildren()[0].getFirstChild("EPR");
-		newTreeEPRElement.setAttribute(ListenerTagNames.URL_TAG, tmpDirForm) ;
-                
-                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(newTree) ;
-                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
-                controller.start() ;
-                
-		_logger.debug(" All child listeners ready");
-
-		// JUST FOR THIS TEST:
-		// Give your listener some time to process queued messages (see howMany
-		// above)
-		// Time allowed, and maxThreads in config file will impact how many
-		// messages
-		// will be processed, and how many will remain unprocessed
-		
-		for (int count = 0 ; count < howMany ; count++)
-		{
-			final String response = getMessage(10000) ;
-			assertNotNull("getMessage timeout", response) ;
-			assertEquals(THE_TEXT, response);
-		}
-
-		_logger.debug("going to stop");
-		controller.stop();
-		_logger.debug("back from stop");
-	}
-	
-	protected String _file;
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerFileUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,164 @@
+/*
+ * 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;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.net.URI;
+import java.util.List;
+import java.util.UUID;
+
+import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+public class ListenerManagerFileUnitTest extends ListenerManagerBaseTest
+{
+	public ListenerManagerFileUnitTest ()
+	{
+		_file = "listenerFile.xml";
+	}
+
+	public void testListener ()
+	{
+		_logger.info("___Test for FILENAME: " + _file
+					+ " starting ____________________");
+		
+		try
+		{
+			oneTest();
+		}
+		catch (Exception ex)
+		{
+			_logger.error(ex.toString(), ex);
+            ex.printStackTrace();
+            fail();
+		}
+		
+		_logger.info("___Test for FILENAME: " + _file
+					+ " FINISHED ____________________");
+	}
+
+	public void setUp()
+	{
+		_logger.info("Writing temp files to " + TMP_DIR);
+
+		clearMessages() ;
+
+		// initialize registry
+		runBeforeAllTests();
+	}
+
+	public void tearDown()
+	{
+		clearMessages() ;
+		
+		runAfterAllTests();
+	}
+	
+	// TODO more refactoring, since oneText is duplicated a lot!
+	
+	protected void oneTest () throws Exception
+	{	
+		// Write wome messages to EPR obtained from configuration file
+		String configFile = getClass().getResource(_file).getFile();
+		ConfigTree tree = ConfigTree.fromInputStream(new FileInputStream(
+				configFile));
+		final File tmpDir = new File(System.getProperty("java.io.tmpdir")) ;
+		final String tmpDirForm = tmpDir.toURL().toExternalForm() ;
+
+        ConfigTree eprElement = tree.getAllChildren()[0].getFirstChild("EPR");
+		eprElement.setAttribute(ListenerTagNames.URL_TAG, tmpDirForm) ;
+		
+		EPR toEPR = ListenerUtil.assembleEpr(eprElement);
+		
+		if (toEPR instanceof FileEpr)
+		{
+			// take inputSuffix as outputSuffix for initial message sending
+			eprElement.setAttribute(FileEpr.POST_SUFFIX_TAG, eprElement
+					.getAttribute(FileEpr.INPUT_SUFFIX_TAG));
+			eprElement.setAttribute(FileEpr.INPUT_SUFFIX_TAG, null);
+			toEPR = ListenerUtil.assembleEpr(eprElement);
+		}
+		else
+			fail();
+		
+		String THE_TEXT = "___Config=" + _file + "___ Message Content ___";
+
+		int howMany = 10; // how many messages do you want to send before the
+							// listener comes up
+		
+		DeliverOnlyCourier sender = CourierFactory.getCourier(toEPR);
+		
+		Message message = MessageFactory.getInstance().getMessage();
+		message.getHeader().setCall(new Call(toEPR));
+		message.getBody().setByteArray(THE_TEXT.getBytes());
+		
+		for (int i1 = 0; i1 < howMany; i1++)
+		{
+			URI uri = new URI(UUID.randomUUID().toString());
+			message.getHeader().getCall().setMessageID(uri);
+			sender.deliver(message);
+		}
+
+		//		 launch listener manager in a child thread
+		final ConfigTree newTree = ConfigTree.fromInputStream(new FileInputStream(
+				configFile));
+		final ConfigTree newTreeEPRElement = newTree.getAllChildren()[0].getFirstChild("EPR");
+		newTreeEPRElement.setAttribute(ListenerTagNames.URL_TAG, tmpDirForm) ;
+                
+                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(newTree) ;
+                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
+                controller.start() ;
+                
+		_logger.debug(" All child listeners ready");
+
+		// JUST FOR THIS TEST:
+		// Give your listener some time to process queued messages (see howMany
+		// above)
+		// Time allowed, and maxThreads in config file will impact how many
+		// messages
+		// will be processed, and how many will remain unprocessed
+		
+		for (int count = 0 ; count < howMany ; count++)
+		{
+			final String response = getMessage(10000) ;
+			assertNotNull("getMessage timeout", response) ;
+			assertEquals(THE_TEXT, response);
+		}
+
+		_logger.debug("going to stop");
+		controller.stop();
+		_logger.debug("back from stop");
+	}
+	
+	protected String _file;
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,159 +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;
-
-import java.io.FileInputStream;
-import java.net.URI;
-import java.sql.SQLException;
-import java.sql.Statement;
-import java.util.List;
-import java.util.UUID;
-
-import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-public class ListenerManagerJDBCUnitTest extends ListenerManagerFileUnitTest
-{
-	public ListenerManagerJDBCUnitTest()
-	{
-		_file = "listenerJdbc.xml";
-	}
-
-	public void setUp()
-	{
-		_logger.info("Writing temp files to " + TMP_DIR);
-
-		clearMessages() ;
-		
-
-		try
-		{
-			Statement stmt = getDbConnection().createStatement();
-
-			try
-			{
-				stmt.executeUpdate("DROP TABLE esb_messages");
-			}
-			catch (Exception e)
-			{
-				// Ignore
-			}
-
-			stmt.executeUpdate("CREATE TABLE esb_messages (message_id varchar NOT NULL, message varchar, status varchar, insert_timestamp bigint, CONSTRAINT pkey_esb_messages PRIMARY KEY (message_id))");
-		}
-	catch (SQLException ex)
-		{
-			_logger.error(ex);
-
-			fail();
-		}
-
-		// initialize registry
-		runBeforeAllTests();
-	}
-	
-	protected void oneTest () throws Exception
-	{
-		// Write wome messages to EPR obtained from configuration file
-		String configFile = getClass().getResource(_file).getFile();
-		ConfigTree tree = ConfigTree.fromInputStream(new FileInputStream(
-				configFile));
-		ConfigTree eprElement = tree.getAllChildren()[0].getFirstChild("EPR");
-		
-		eprElement.setAttribute(ListenerTagNames.URL_TAG, getDbUrl());
-		eprElement.setAttribute("driver", getDbDriver());
-		eprElement.setAttribute("username", getDbUser());
-		eprElement.setAttribute("password", getDbPassword());
-		
-		EPR toEPR = ListenerUtil.assembleEpr(eprElement);
-
-		if (toEPR instanceof JDBCEpr)
-		{
-			// OK, so ignore
-		}
-		else
-			fail();
-		
-		String THE_TEXT = "___Config=" + _file + "___ Message Content ___";
-
-		int howMany = 10; // how many messages do you want to send before the
-							// listener comes up
-		
-		DeliverOnlyCourier sender = CourierFactory.getCourier(toEPR);
-		
-		Message message = MessageFactory.getInstance().getMessage();
-		message.getHeader().setCall(new Call(toEPR));
-		message.getBody().setByteArray(THE_TEXT.getBytes());
-		
-		for (int i1 = 0; i1 < howMany; i1++)
-		{
-			URI uri = new URI(UUID.randomUUID().toString());
-			message.getHeader().getCall().setMessageID(uri);
-			sender.deliver(message);
-		}
-
-		//		 launch listener manager in a child thread
-		final ConfigTree newTree = ConfigTree.fromInputStream(new FileInputStream(
-				configFile));
-		
-		eprElement = newTree.getAllChildren()[0].getFirstChild("EPR");
-		
-		eprElement.setAttribute(ListenerTagNames.URL_TAG, getDbUrl());
-		eprElement.setAttribute("driver", getDbDriver());
-		eprElement.setAttribute("username", getDbUser());
-		eprElement.setAttribute("password", getDbPassword());
-
-                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(newTree) ;
-                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
-                controller.start() ;
-                
-		_logger.debug(" All child listeners ready");
-
-		// JUST FOR THIS TEST:
-		// Give your listener some time to process queued messages (see howMany
-		// above)
-		// Time allowed, and maxThreads in config file will impact how many
-		// messages
-		// will be processed, and how many will remain unprocessed
-		
-		for (int count = 0 ; count < howMany ; count++)
-		{
-			final String response = getMessage(10000) ;
-			assertNotNull("getMessage timeout", response) ;
-			assertEquals(THE_TEXT, response);
-		}
-
-		_logger.debug("going to stop");
-		controller.stop();
-		_logger.debug("back from stop");
-	}
-
-}
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJDBCUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,159 @@
+/*
+ * 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;
+
+import java.io.FileInputStream;
+import java.net.URI;
+import java.sql.SQLException;
+import java.sql.Statement;
+import java.util.List;
+import java.util.UUID;
+
+import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+public class ListenerManagerJDBCUnitTest extends ListenerManagerFileUnitTest
+{
+	public ListenerManagerJDBCUnitTest()
+	{
+		_file = "listenerJdbc.xml";
+	}
+
+	public void setUp()
+	{
+		_logger.info("Writing temp files to " + TMP_DIR);
+
+		clearMessages() ;
+		
+
+		try
+		{
+			Statement stmt = getDbConnection().createStatement();
+
+			try
+			{
+				stmt.executeUpdate("DROP TABLE esb_messages");
+			}
+			catch (Exception e)
+			{
+				// Ignore
+			}
+
+			stmt.executeUpdate("CREATE TABLE esb_messages (message_id varchar NOT NULL, message varchar, status varchar, insert_timestamp bigint, CONSTRAINT pkey_esb_messages PRIMARY KEY (message_id))");
+		}
+	catch (SQLException ex)
+		{
+			_logger.error(ex);
+
+			fail();
+		}
+
+		// initialize registry
+		runBeforeAllTests();
+	}
+	
+	protected void oneTest () throws Exception
+	{
+		// Write wome messages to EPR obtained from configuration file
+		String configFile = getClass().getResource(_file).getFile();
+		ConfigTree tree = ConfigTree.fromInputStream(new FileInputStream(
+				configFile));
+		ConfigTree eprElement = tree.getAllChildren()[0].getFirstChild("EPR");
+		
+		eprElement.setAttribute(ListenerTagNames.URL_TAG, getDbUrl());
+		eprElement.setAttribute("driver", getDbDriver());
+		eprElement.setAttribute("username", getDbUser());
+		eprElement.setAttribute("password", getDbPassword());
+		
+		EPR toEPR = ListenerUtil.assembleEpr(eprElement);
+
+		if (toEPR instanceof JDBCEpr)
+		{
+			// OK, so ignore
+		}
+		else
+			fail();
+		
+		String THE_TEXT = "___Config=" + _file + "___ Message Content ___";
+
+		int howMany = 10; // how many messages do you want to send before the
+							// listener comes up
+		
+		DeliverOnlyCourier sender = CourierFactory.getCourier(toEPR);
+		
+		Message message = MessageFactory.getInstance().getMessage();
+		message.getHeader().setCall(new Call(toEPR));
+		message.getBody().setByteArray(THE_TEXT.getBytes());
+		
+		for (int i1 = 0; i1 < howMany; i1++)
+		{
+			URI uri = new URI(UUID.randomUUID().toString());
+			message.getHeader().getCall().setMessageID(uri);
+			sender.deliver(message);
+		}
+
+		//		 launch listener manager in a child thread
+		final ConfigTree newTree = ConfigTree.fromInputStream(new FileInputStream(
+				configFile));
+		
+		eprElement = newTree.getAllChildren()[0].getFirstChild("EPR");
+		
+		eprElement.setAttribute(ListenerTagNames.URL_TAG, getDbUrl());
+		eprElement.setAttribute("driver", getDbDriver());
+		eprElement.setAttribute("username", getDbUser());
+		eprElement.setAttribute("password", getDbPassword());
+
+                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(newTree) ;
+                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
+                controller.start() ;
+                
+		_logger.debug(" All child listeners ready");
+
+		// JUST FOR THIS TEST:
+		// Give your listener some time to process queued messages (see howMany
+		// above)
+		// Time allowed, and maxThreads in config file will impact how many
+		// messages
+		// will be processed, and how many will remain unprocessed
+		
+		for (int count = 0 ; count < howMany ; count++)
+		{
+			final String response = getMessage(10000) ;
+			assertNotNull("getMessage timeout", response) ;
+			assertEquals(THE_TEXT, response);
+		}
+
+		_logger.debug("going to stop");
+		controller.stop();
+		_logger.debug("back from stop");
+	}
+
+}
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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;
-
-import java.io.FileInputStream;
-import java.net.URI;
-import java.util.List;
-import java.util.UUID;
-
-import junit.framework.Assert;
-
-import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.couriers.CourierFactory;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-public class ListenerManagerJMSXntegrationTest extends ListenerManagerBaseTest
-{
-	public ListenerManagerJMSXntegrationTest ()
-	{
-		this("listenerJms.xml");
-	}
-	
-	public ListenerManagerJMSXntegrationTest (String configFile)
-	{
-		_file = configFile;
-	}
-	
-	public void setUp()
-	{
-		_logger.info("Writing temp files to " + TMP_DIR);
-
-		clearMessages() ;
-
-		// initialize registry
-		runBeforeAllTests();
-	}
-
-	public void testListener () throws Exception
-	{
-		_logger.info("___Test for FILENAME: " + _file
-					+ " starting ____________________");
-		
-		oneTest(_file);
-		
-		_logger.info("___Test for FILENAME: " + _file
-					+ " FINISHED ____________________");
-	}
-
-	protected void oneTest (String fileName) throws Exception
-	{	
-		// Write wome messages to EPR obtained from configuration file
-		String configFile = getClass().getResource(fileName).getFile();
-		ConfigTree tree = ConfigTree.fromInputStream(new FileInputStream(
-				configFile));		
-		ConfigTree eprElement = tree.getAllChildren()[0].getFirstChild("EPR");
-		
-		EPR toEPR = ListenerUtil.assembleEpr(eprElement);
-		
-		if (toEPR instanceof JMSEpr)
-		{
-			// good, just checking!
-		}
-		else
-			Assert.fail();
-		
-		String THE_TEXT = "___Config=" + fileName + "___ Message Content ___";
-
-		int howMany = 10; // how many messages do you want to send before the
-							// listener comes up
-		
-		DeliverOnlyCourier sender = CourierFactory.getCourier(toEPR);
-		
-		Message message = MessageFactory.getInstance().getMessage();
-		message.getHeader().setCall(new Call(toEPR));
-		message.getBody().setByteArray(THE_TEXT.getBytes());
-		
-		for (int i1 = 0; i1 < howMany; i1++)
-		{
-			URI uri = new URI(UUID.randomUUID().toString());
-			message.getHeader().getCall().setMessageID(uri);
-			sender.deliver(message);
-		}
-
-		//		 launch listener manager in a child thread
-		final ConfigTree newTree = ConfigTree.fromInputStream(new FileInputStream(
-				configFile));
-
-                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(newTree) ;
-                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
-                controller.start() ;
-                
-		_logger.debug(" All child listeners ready");
-
-		// JUST FOR THIS TEST:
-		// Give your listener some time to process queued messages (see howMany
-		// above)
-		// Time allowed, and maxThreads in config file will impact how many
-		// messages
-		// will be processed, and how many will remain unprocessed
-		
-		for (int count = 0 ; count < howMany ; count++)
-		{
-			final String response = getMessage(10000) ;
-			assertNotNull("getMessage timeout", response) ;
-			assertEquals(THE_TEXT, response);
-		}
-
-		_logger.debug("going to stop");
-		controller.stop();
-		_logger.debug("back from stop");
-	}
-	
-	protected String _file;
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/ListenerManagerJMSXntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,142 @@
+/*
+ * 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;
+
+import java.io.FileInputStream;
+import java.net.URI;
+import java.util.List;
+import java.util.UUID;
+
+import junit.framework.Assert;
+
+import org.jboss.internal.soa.esb.couriers.DeliverOnlyCourier;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.couriers.CourierFactory;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycle;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+public class ListenerManagerJMSXntegrationTest extends ListenerManagerBaseTest
+{
+	public ListenerManagerJMSXntegrationTest ()
+	{
+		this("listenerJms.xml");
+	}
+	
+	public ListenerManagerJMSXntegrationTest (String configFile)
+	{
+		_file = configFile;
+	}
+	
+	public void setUp()
+	{
+		_logger.info("Writing temp files to " + TMP_DIR);
+
+		clearMessages() ;
+
+		// initialize registry
+		runBeforeAllTests();
+	}
+
+	public void testListener () throws Exception
+	{
+		_logger.info("___Test for FILENAME: " + _file
+					+ " starting ____________________");
+		
+		oneTest(_file);
+		
+		_logger.info("___Test for FILENAME: " + _file
+					+ " FINISHED ____________________");
+	}
+
+	protected void oneTest (String fileName) throws Exception
+	{	
+		// Write wome messages to EPR obtained from configuration file
+		String configFile = getClass().getResource(fileName).getFile();
+		ConfigTree tree = ConfigTree.fromInputStream(new FileInputStream(
+				configFile));		
+		ConfigTree eprElement = tree.getAllChildren()[0].getFirstChild("EPR");
+		
+		EPR toEPR = ListenerUtil.assembleEpr(eprElement);
+		
+		if (toEPR instanceof JMSEpr)
+		{
+			// good, just checking!
+		}
+		else
+			Assert.fail();
+		
+		String THE_TEXT = "___Config=" + fileName + "___ Message Content ___";
+
+		int howMany = 10; // how many messages do you want to send before the
+							// listener comes up
+		
+		DeliverOnlyCourier sender = CourierFactory.getCourier(toEPR);
+		
+		Message message = MessageFactory.getInstance().getMessage();
+		message.getHeader().setCall(new Call(toEPR));
+		message.getBody().setByteArray(THE_TEXT.getBytes());
+		
+		for (int i1 = 0; i1 < howMany; i1++)
+		{
+			URI uri = new URI(UUID.randomUUID().toString());
+			message.getHeader().getCall().setMessageID(uri);
+			sender.deliver(message);
+		}
+
+		//		 launch listener manager in a child thread
+		final ConfigTree newTree = ConfigTree.fromInputStream(new FileInputStream(
+				configFile));
+
+                final List<ManagedLifecycle> instances = LifecycleUtil.getListeners(newTree) ;
+                final ManagedLifecycleController controller = new ManagedLifecycleController(instances) ;
+                controller.start() ;
+                
+		_logger.debug(" All child listeners ready");
+
+		// JUST FOR THIS TEST:
+		// Give your listener some time to process queued messages (see howMany
+		// above)
+		// Time allowed, and maxThreads in config file will impact how many
+		// messages
+		// will be processed, and how many will remain unprocessed
+		
+		for (int count = 0 ; count < howMany ; count++)
+		{
+			final String response = getMessage(10000) ;
+			assertNotNull("getMessage timeout", response) ;
+			assertEquals(THE_TEXT, response);
+		}
+
+		_logger.debug("going to stop");
+		controller.stop();
+		_logger.debug("back from stop");
+	}
+	
+	protected String _file;
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,138 +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;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.services.registry.RegistryException;
-
-public class RegistryUtilUnitTest extends ListenerManagerBaseTest
-{
-	@SuppressWarnings("unused")
-	private Logger log = Logger.getLogger( RegistryUtilUnitTest.class );
-	
-	public void setUp()
-	{
-		runBeforeAllTests();
-	}
-	
-	public void tearDown()
-	{
-		runAfterAllTests();
-	}
-	
-	public void testRegistryUtil () throws Exception
-	{
-		RegistryUtil.getEprManager();
-		HTTPEpr epr = new HTTPEpr("http://foo.bar");
-		ConfigTree tree = new ConfigTree("test");
-		
-		tree.setAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, "eprmanager");
-		tree.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, "test");
-		
-		RegistryUtil.register(tree, epr);
-		RegistryUtil.unregister("eprmanager", "test", epr);
-		
-		boolean exception = false;
-		
-		try
-		{
-			// case difference is deliberate!
-			
-			RegistryUtil.getEprs("eprmanager", "test");
-            fail("Expected RegistryException");
-        }
-		catch (RegistryException ex)
-		{
-		}
-		
-		RegistryUtil.register(tree, epr);
-		
-		try
-		{
-			// case difference is deliberate!
-			
-			RegistryUtil.getEprs("eprManager", "test");
-		}
-		catch (RegistryException ex)
-		{
-			fail();
-		}
-		
-		RegistryUtil.unregister("eprmanager", "test", epr);
-		
-		exception = false;
-		
-		try
-		{
-			RegistryUtil.getEprs("foobar", "test");
-		}
-		catch (RegistryException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		tree.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, "");
-		
-		try
-		{
-			RegistryUtil.register(tree, epr);
-			
-			fail();
-		}
-		catch (RegistryException ex)
-		{
-		}
-		
-		@SuppressWarnings("unused")
-        ListenerInitializationException exp = new ListenerInitializationException();
-		
-		exp = new ListenerInitializationException("bad things");
-		exp = new ListenerInitializationException("more bad things", new RuntimeException());
-		exp = new ListenerInitializationException(new RuntimeException());
-		
-		try
-		{
-			RegistryUtil.unregister("eprmanager", "", epr);
-		}
-		catch (Exception ex)
-		{
-			fail();
-		}
-		
-		try
-		{
-			RegistryUtil.getEprs("", "test");
-			
-			fail();
-		}
-		catch (RegistryException ex)
-		{
-		}
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/RegistryUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,138 @@
+/*
+ * 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;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.services.registry.RegistryException;
+
+public class RegistryUtilUnitTest extends ListenerManagerBaseTest
+{
+	@SuppressWarnings("unused")
+	private Logger log = Logger.getLogger( RegistryUtilUnitTest.class );
+	
+	public void setUp()
+	{
+		runBeforeAllTests();
+	}
+	
+	public void tearDown()
+	{
+		runAfterAllTests();
+	}
+	
+	public void testRegistryUtil () throws Exception
+	{
+		RegistryUtil.getEprManager();
+		HTTPEpr epr = new HTTPEpr("http://foo.bar");
+		ConfigTree tree = new ConfigTree("test");
+		
+		tree.setAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG, "eprmanager");
+		tree.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, "test");
+		
+		RegistryUtil.register(tree, epr);
+		RegistryUtil.unregister("eprmanager", "test", epr);
+		
+		boolean exception = false;
+		
+		try
+		{
+			// case difference is deliberate!
+			
+			RegistryUtil.getEprs("eprmanager", "test");
+            fail("Expected RegistryException");
+        }
+		catch (RegistryException ex)
+		{
+		}
+		
+		RegistryUtil.register(tree, epr);
+		
+		try
+		{
+			// case difference is deliberate!
+			
+			RegistryUtil.getEprs("eprManager", "test");
+		}
+		catch (RegistryException ex)
+		{
+			fail();
+		}
+		
+		RegistryUtil.unregister("eprmanager", "test", epr);
+		
+		exception = false;
+		
+		try
+		{
+			RegistryUtil.getEprs("foobar", "test");
+		}
+		catch (RegistryException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		tree.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, "");
+		
+		try
+		{
+			RegistryUtil.register(tree, epr);
+			
+			fail();
+		}
+		catch (RegistryException ex)
+		{
+		}
+		
+		@SuppressWarnings("unused")
+        ListenerInitializationException exp = new ListenerInitializationException();
+		
+		exp = new ListenerInitializationException("bad things");
+		exp = new ListenerInitializationException("more bad things", new RuntimeException());
+		exp = new ListenerInitializationException(new RuntimeException());
+		
+		try
+		{
+			RegistryUtil.unregister("eprmanager", "", epr);
+		}
+		catch (Exception ex)
+		{
+			fail();
+		}
+		
+		try
+		{
+			RegistryUtil.getEprs("", "test");
+			
+			fail();
+		}
+		catch (RegistryException ex)
+		{
+		}
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StandAloneBootStrapperUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StandAloneBootStrapperUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StandAloneBootStrapperUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.listeners;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.ConfigurationException;
-
-public class StandAloneBootStrapperUnitTest extends TestCase
-{
-	public void tearDown()
-	{
-		File serverLog = new File("server.log");
-		if ( serverLog.exists() )
-			serverLog.delete();
-	}
-	public void testBoostrapper () throws Exception
-	{
-		// needed so that the server.log file path in log4j.xml is correct
-		System.setProperty( "jboss.server.log.dir", "." );
-		String[] args = new String[0];
-		
-		try
-		{
-			StandAloneBootStrapper.main(args);
-			fail();
-		}
-		catch (Exception ex)
-		{
-		}
-		
-		args = new String[2];
-		
-		args[0] = "gatewayExample.xml";
-		args[1] = "5";
-		
-		try
-		{
-			StandAloneBootStrapper.main(args);
-			
-			fail();
-		}
-		catch (ConfigurationException ex)
-		{
-		}
-		
-		args[1] = "abc";
-		
-		try
-		{
-			StandAloneBootStrapper.main(args);			
-			fail();
-		}
-		catch (Exception ex)
-		{
-		}
-		
-		args[0] = "install/conf/jbossesb.xml";
-		args[1] = "5";
-		
-		try
-		{
-			StandAloneBootStrapper.main(args);		
-		}
-		catch (ConfigurationException ex)
-		{
-		}
-
-		StandAloneBootStrapper bootstrapper = new StandAloneBootStrapper("install/conf/jbossesb.xml", "etc/schemas/xml/jbossesb-1.0.1.xsd");
-		
-		bootstrapper.requestEnd();
-		bootstrapper.runAfter();
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StandAloneBootStrapperUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StandAloneBootStrapperUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StandAloneBootStrapperUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StandAloneBootStrapperUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,97 @@
+/*
+ * 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;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.ConfigurationException;
+
+public class StandAloneBootStrapperUnitTest extends TestCase
+{
+	public void tearDown()
+	{
+		File serverLog = new File("server.log");
+		if ( serverLog.exists() )
+			serverLog.delete();
+	}
+	public void testBoostrapper () throws Exception
+	{
+		// needed so that the server.log file path in log4j.xml is correct
+		System.setProperty( "jboss.server.log.dir", "." );
+		String[] args = new String[0];
+		
+		try
+		{
+			StandAloneBootStrapper.main(args);
+			fail();
+		}
+		catch (Exception ex)
+		{
+		}
+		
+		args = new String[2];
+		
+		args[0] = "gatewayExample.xml";
+		args[1] = "5";
+		
+		try
+		{
+			StandAloneBootStrapper.main(args);
+			
+			fail();
+		}
+		catch (ConfigurationException ex)
+		{
+		}
+		
+		args[1] = "abc";
+		
+		try
+		{
+			StandAloneBootStrapper.main(args);			
+			fail();
+		}
+		catch (Exception ex)
+		{
+		}
+		
+		args[0] = "install/conf/jbossesb.xml";
+		args[1] = "5";
+		
+		try
+		{
+			StandAloneBootStrapper.main(args);		
+		}
+		catch (ConfigurationException ex)
+		{
+		}
+
+		StandAloneBootStrapper bootstrapper = new StandAloneBootStrapper("install/conf/jbossesb.xml", "etc/schemas/xml/jbossesb-1.0.1.xsd");
+		
+		bootstrapper.requestEnd();
+		bootstrapper.runAfter();
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StateUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StateUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StateUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,42 +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;
-
-import junit.framework.TestCase;
-
-public class StateUnitTest extends TestCase
-{
-	public void testState () throws Exception
-	{
-		State s = State.Uninitialised;
-		
-		if (!s.isGettingReady())
-			fail();
-		
-		s = State.Shutting_down;
-		
-		if (s.isGettingReady())
-			fail();
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StateUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StateUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StateUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/StateUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,42 @@
+/*
+ * 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;
+
+import junit.framework.TestCase;
+
+public class StateUnitTest extends TestCase
+{
+	public void testState () throws Exception
+	{
+		State s = State.Uninitialised;
+		
+		if (!s.isGettingReady())
+			fail();
+		
+		s = State.Shutting_down;
+		
+		if (s.isGettingReady())
+			fail();
+	}
+	
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config)


Property changes on: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config
___________________________________________________________________
Name: svn:ignore
   + jbossesb-gateway.xml
jbossesb-listener.xml


Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,100 +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.config;
-
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-import org.junit.Test;
-
-/**
- * Testing configuration controller.
- * 
- * @author kurt.stam at redhat.com
- *
- */
-public class ConfigurationControlerUnitTest 
-{
-	private static Logger logger = Logger.getLogger(ConfigurationControlerUnitTest.class);
-	
-	/**
-	 * Testing the Content Based Router.
-	 */
-	@Test
-	public void readAndGenerateConfig() throws Exception
-	{
-		String configFileName = TestEnvironmentUtil.getUserDir("product") 
-			+ "rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml";
-		//Make sure this file exists
-		File configFile = new File(configFileName);
-		if (!configFile.exists()){
-			assertTrue(false);
-		}
-		//Remove the listener and gateway configuration files if the exist
-		File currentDir = configFile.getParentFile();
-		if (null==currentDir)
-			currentDir=new File("");
-		File listenerFile = new File(currentDir + File.separator + "jbossesb-listener.xml");
-		if (listenerFile.exists()) {
-			listenerFile.delete();
-		}
-		File gatewayFile = new File(currentDir + File.separator + "jbossesb-gateway.xml");
-		if (gatewayFile.exists()) {
-			gatewayFile.delete();
-		}
-		String validationFileName = TestEnvironmentUtil.getUserDir("product") 
-			+ "etc/schemas/xml/jbossesb-1.0.1.xsd";
-//		Make sure this file exists
-		File validationFile = new File(validationFileName);
-		if (!validationFile.exists()){
-			assertTrue(false);
-		}
-		new ConfigurationController(configFileName, validationFileName);
-		for (int i=0; i<currentDir.listFiles().length;i++){
-			logger.info(currentDir.listFiles()[i].getName());
-		}
-		if (listenerFile.exists()) {
-			listenerFile.delete();
-		} else {
-			//Listener file should exist if all was successful
-			System.out.println("file=" + listenerFile.getAbsolutePath() + " does not exist, while it should have.");
-			assertTrue(false);
-		}
-		if (gatewayFile.exists()) {
-			gatewayFile.delete();
-		} else {
-			//Gateway file should exist if all was successful
-			System.out.println("file=" + gatewayFile.getAbsolutePath() + " does not exist, while it should have.");
-			assertTrue(false);
-		}
-	}
-	
-	public static junit.framework.Test suite() {
-		return new JUnit4TestAdapter(ConfigurationControlerUnitTest.class);
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControlerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,100 @@
+/*
+* 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.config;
+
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+import org.junit.Test;
+
+/**
+ * Testing configuration controller.
+ * 
+ * @author kurt.stam at redhat.com
+ *
+ */
+public class ConfigurationControlerUnitTest 
+{
+	private static Logger logger = Logger.getLogger(ConfigurationControlerUnitTest.class);
+	
+	/**
+	 * Testing the Content Based Router.
+	 */
+	@Test
+	public void readAndGenerateConfig() throws Exception
+	{
+		String configFileName = TestEnvironmentUtil.getUserDir("product") 
+			+ "rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml";
+		//Make sure this file exists
+		File configFile = new File(configFileName);
+		if (!configFile.exists()){
+			assertTrue(false);
+		}
+		//Remove the listener and gateway configuration files if the exist
+		File currentDir = configFile.getParentFile();
+		if (null==currentDir)
+			currentDir=new File("");
+		File listenerFile = new File(currentDir + File.separator + "jbossesb-listener.xml");
+		if (listenerFile.exists()) {
+			listenerFile.delete();
+		}
+		File gatewayFile = new File(currentDir + File.separator + "jbossesb-gateway.xml");
+		if (gatewayFile.exists()) {
+			gatewayFile.delete();
+		}
+		String validationFileName = TestEnvironmentUtil.getUserDir("product") 
+			+ "etc/schemas/xml/jbossesb-1.0.1.xsd";
+//		Make sure this file exists
+		File validationFile = new File(validationFileName);
+		if (!validationFile.exists()){
+			assertTrue(false);
+		}
+		new ConfigurationController(configFileName, validationFileName);
+		for (int i=0; i<currentDir.listFiles().length;i++){
+			logger.info(currentDir.listFiles()[i].getName());
+		}
+		if (listenerFile.exists()) {
+			listenerFile.delete();
+		} else {
+			//Listener file should exist if all was successful
+			System.out.println("file=" + listenerFile.getAbsolutePath() + " does not exist, while it should have.");
+			assertTrue(false);
+		}
+		if (gatewayFile.exists()) {
+			gatewayFile.delete();
+		} else {
+			//Gateway file should exist if all was successful
+			System.out.println("file=" + gatewayFile.getAbsolutePath() + " does not exist, while it should have.");
+			assertTrue(false);
+		}
+	}
+	
+	public static junit.framework.Test suite() {
+		return new JUnit4TestAdapter(ConfigurationControlerUnitTest.class);
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,60 +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.config;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-
-public class ConfigurationControllerServiceUnitTest extends TestCase
-{
-	private Logger log = Logger
-			.getLogger( ConfigurationControllerServiceUnitTest.class );
-	public void testService ()
-	{
-		ConfigurationControllerService service = new ConfigurationControllerService();		
-		String conf = service.getConfigurationFile();
-		
-		service.setConfigurationFile(conf);
-		
-		System.setProperty("jboss.server.config.url", "http://foo.bar");
-		
-		try
-		{
-			service.startService();
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			fail();
-		}
-		
-		try
-		{
-			service.stopService();
-		}
-		catch (Exception ex)
-		{
-			fail();
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ConfigurationControllerServiceUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,60 @@
+/*
+ * 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.config;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+
+public class ConfigurationControllerServiceUnitTest extends TestCase
+{
+	private Logger log = Logger
+			.getLogger( ConfigurationControllerServiceUnitTest.class );
+	public void testService ()
+	{
+		ConfigurationControllerService service = new ConfigurationControllerService();		
+		String conf = service.getConfigurationFile();
+		
+		service.setConfigurationFile(conf);
+		
+		System.setProperty("jboss.server.config.url", "http://foo.bar");
+		
+		try
+		{
+			service.startService();
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			fail();
+		}
+		
+		try
+		{
+			service.stopService();
+		}
+		catch (Exception ex)
+		{
+			fail();
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,206 +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.config;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.config.JmsBusDocument.JmsBus;
-import org.jboss.soa.esb.listeners.config.JmsListenerDocument.JmsListener;
-import org.jboss.soa.esb.listeners.config.JmsMessageFilterDocument.JmsMessageFilter;
-import org.jboss.soa.esb.listeners.config.JmsProviderDocument.JmsProvider;
-import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
-import org.jboss.soa.esb.testutils.FileUtil;
-
-/**
- * Generator unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class GeneratorUnitTest extends TestCase {
-	
-	private Logger log = Logger.getLogger( GeneratorUnitTest.class );
-	
-	private File outdir = new File("test-outdir");
-	private File gatewayConfig;
-	private File awareConfig;
-
-	public void test_constructor() throws ConfigurationException, IOException {
-		try {
-			new Generator(null);
-			fail("Expected IllegalArgumentException.");
-		} catch (IllegalArgumentException e) {
-			// OK
-		}
-	}
-	
-	public void test_generate_badagrs() throws ConfigurationException, IOException {
-		test_generate_badargs(null, "null 'outdir' arg in method call");
-		test_generate_badargs(new File("build.xml"), "'outdir' exists, but is not a directory");
-	}
-	
-	public void test_generate_files() throws ConfigurationException, IOException {
-		test_generate_files("jbossesb_config_01.xml");
-		test_generate_files("jbossesb_config_02.xml");
-	}
-		
-	public void test_generate_files(String filename) throws ConfigurationException, IOException {
-		Generator generator = new Generator(getClass().getResourceAsStream(filename));
-		String expectedGatewayConfig = new String(StreamUtils.readStream(getClass().getResourceAsStream("jbossesb_config_01_gateways.xml"))).trim();
-		String expectedESBAwareConfig = new String(StreamUtils.readStream(getClass().getResourceAsStream("jbossesb_config_01_esbaware.xml"))).trim();
-		String actualGatewayConfig;
-		String actualESBAwareConfig;
-		
-		expectedGatewayConfig = removeEOL(expectedGatewayConfig);
-		expectedESBAwareConfig = removeEOL(expectedESBAwareConfig);
-		
-		generator.generate(outdir);
-		
-		gatewayConfig = new File(outdir, Generator.ESB_CONFIG_GATEWAY_XML_FILE);
-		assertTrue(gatewayConfig.exists());
-		actualGatewayConfig = FileUtil.readTextFile(gatewayConfig);
-		log.debug("actual  [" + removeEOL(actualGatewayConfig) + "]");
-        log.debug("expected[" + expectedGatewayConfig + "]");
-		assertEquals(expectedGatewayConfig, removeEOL(actualGatewayConfig));
-		
-		awareConfig = new File(outdir, Generator.ESB_CONFIG_XML_FILE);
-		assertTrue(awareConfig.exists());
-		actualESBAwareConfig = FileUtil.readTextFile(awareConfig);
-		log.debug("[" + actualESBAwareConfig + "]");
-		actualESBAwareConfig = removeEOL(actualESBAwareConfig);
-		boolean isIndentical = expectedESBAwareConfig.equals(actualESBAwareConfig);
-		log.debug("Strings identical=" + isIndentical);
-		assertEquals(expectedESBAwareConfig, actualESBAwareConfig);
-	}
-
-	public void test_bad_base_listener_busref() throws ConfigurationException, IOException {
-		Generator generator = new Generator(getClass().getResourceAsStream("jbossesb_config_03.xml"));
-		
-		try {
-			generator.generate(outdir);
-			fail("Expected ConfigurationException");
-		} catch(ConfigurationException e) {
-			if(!e.getMessage().equals("The base Listener config [JMS-ESBListener] must reference a base Bus config type (<bus>).")) {
-				fail("Wrong exception");
-			}
-		}
-	}
-	
-	public static String removeEOL(String string) {
-		StringBuffer stringBuf = new StringBuffer(string.length());
-
-		for(int i = 0; i < string.length(); i++) {
-			char character = string.charAt(i);
-			
-			if(character != '\r' && character != '\n') {
-				stringBuf.append(character);
-			}
-		}
-		
-		return stringBuf.toString();
-	}
-
-	public void test_model() throws ConfigurationException, IOException {
-		Generator generator = new Generator(getClass().getResourceAsStream("jbossesb_config_01.xml"));
-		XMLBeansModel model = generator.getModel();
-
-		JmsBus bus = (JmsBus)model.getBus("server1-jms");
-		JmsProvider provider = (JmsProvider) model.getProvider(bus);
-		assertEquals("server1-jms", bus.getBusid());
-		assertEquals("com.xyz.provider.XYZConnectionFactory", provider.getConnectionFactory());
-		assertEquals("com.xyz.provider.NamingContextFactory", provider.getJndiContextFactory());
-		assertEquals("xyz://server1:9876", provider.getJndiURL());
-		assertEquals("com.xyz", provider.getJndiPkgPrefix());
-		JmsMessageFilter busDestination = bus.getJmsMessageFilter();
-		assertEquals("queue/A", busDestination.getDestName());
-		assertEquals(JmsMessageFilter.DestType.QUEUE, busDestination.getDestType());
-		assertEquals("service='Reconciliation'", busDestination.getSelector());
-
-		List<Listener> gateways = model.getGatewayListeners();
-		assertEquals(2, gateways.size());
-		JmsListener gatewayListener = (JmsListener)gateways.get(0);
-		assertEquals("Bank-JMS-Gateway", gatewayListener.getName());
-		assertEquals("server1-jms", gatewayListener.getBusidref());
-		assertTrue(gatewayListener.getIsGateway());
-		assertEquals(1, gatewayListener.getMaxThreads());
-
-		List<Listener> awareListeners = model.getESBAwareListeners();
-		assertEquals(4, awareListeners.size());
-		JmsListener awareListener = (JmsListener)awareListeners.get(0);
-		assertEquals("Bank-Listener", awareListener.getName());
-		assertEquals("local-jms", awareListener.getBusidref());
-		assertTrue(!awareListener.getIsGateway());
-		assertEquals(2, awareListener.getMaxThreads());
-		JmsMessageFilter listenerDestination = awareListener.getJmsMessageFilter();
-		assertEquals("queue/B", listenerDestination.getDestName());
-		assertEquals(JmsMessageFilter.DestType.TOPIC, listenerDestination.getDestType());
-		assertEquals("service='Reconciliation'", listenerDestination.getSelector());
-		
-		Listener untypedAwareListener = awareListeners.get(1);
-		assertEquals("Bank-Listener-Generic", untypedAwareListener.getName());
-		assertEquals("my-generic-bus", untypedAwareListener.getBusidref());
-		assertTrue(!untypedAwareListener.getIsGateway());
-		
-		Service gatewayService = model.getService(gatewayListener);
-		Service awareService = model.getService(awareListener);
-		assertSame(gatewayService, awareService);
-		assertEquals("Bank", awareService.getCategory());
-		assertEquals("Reconciliation", awareService.getName());
-		assertEquals("Bank Reconciliation Service", awareService.getDescription());
-	}
-
-	private void test_generate_badargs(File outdir, String expectedMessage) throws ConfigurationException, IOException {
-		Generator generator = new Generator(getClass().getResourceAsStream("jbossesb_config_01.xml"));
-
-		try {
-			generator.generate(outdir);
-			fail("Expected IllegalArgumentException.");
-		} catch(IllegalArgumentException e) {
-			// Expected
-			if(!e.getMessage().startsWith(expectedMessage)) {
-				fail("Unexpected exception message.  Expected message to start with [" + expectedMessage + "].  Message was [" + e.getMessage() + "].");
-			}
-		}
-	}
-
-	/* (non-Javadoc)
-	 * @see junit.framework.TestCase#tearDown()
-	 */
-	@Override
-	protected void tearDown() throws Exception {
-		if(awareConfig != null && awareConfig.exists()) {
-			awareConfig.delete();
-		}
-		if(gatewayConfig != null && gatewayConfig.exists()) {
-			gatewayConfig.delete();
-		}
-		if(outdir.exists()) {
-			outdir.delete();
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/GeneratorUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,206 @@
+/*
+ * 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.config;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.config.JmsBusDocument.JmsBus;
+import org.jboss.soa.esb.listeners.config.JmsListenerDocument.JmsListener;
+import org.jboss.soa.esb.listeners.config.JmsMessageFilterDocument.JmsMessageFilter;
+import org.jboss.soa.esb.listeners.config.JmsProviderDocument.JmsProvider;
+import org.jboss.soa.esb.listeners.config.ServiceDocument.Service;
+import org.jboss.soa.esb.testutils.FileUtil;
+
+/**
+ * Generator unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class GeneratorUnitTest extends TestCase {
+	
+	private Logger log = Logger.getLogger( GeneratorUnitTest.class );
+	
+	private File outdir = new File("test-outdir");
+	private File gatewayConfig;
+	private File awareConfig;
+
+	public void test_constructor() throws ConfigurationException, IOException {
+		try {
+			new Generator(null);
+			fail("Expected IllegalArgumentException.");
+		} catch (IllegalArgumentException e) {
+			// OK
+		}
+	}
+	
+	public void test_generate_badagrs() throws ConfigurationException, IOException {
+		test_generate_badargs(null, "null 'outdir' arg in method call");
+		test_generate_badargs(new File("build.xml"), "'outdir' exists, but is not a directory");
+	}
+	
+	public void test_generate_files() throws ConfigurationException, IOException {
+		test_generate_files("jbossesb_config_01.xml");
+		test_generate_files("jbossesb_config_02.xml");
+	}
+		
+	public void test_generate_files(String filename) throws ConfigurationException, IOException {
+		Generator generator = new Generator(getClass().getResourceAsStream(filename));
+		String expectedGatewayConfig = new String(StreamUtils.readStream(getClass().getResourceAsStream("jbossesb_config_01_gateways.xml"))).trim();
+		String expectedESBAwareConfig = new String(StreamUtils.readStream(getClass().getResourceAsStream("jbossesb_config_01_esbaware.xml"))).trim();
+		String actualGatewayConfig;
+		String actualESBAwareConfig;
+		
+		expectedGatewayConfig = removeEOL(expectedGatewayConfig);
+		expectedESBAwareConfig = removeEOL(expectedESBAwareConfig);
+		
+		generator.generate(outdir);
+		
+		gatewayConfig = new File(outdir, Generator.ESB_CONFIG_GATEWAY_XML_FILE);
+		assertTrue(gatewayConfig.exists());
+		actualGatewayConfig = FileUtil.readTextFile(gatewayConfig);
+		log.debug("actual  [" + removeEOL(actualGatewayConfig) + "]");
+        log.debug("expected[" + expectedGatewayConfig + "]");
+		assertEquals(expectedGatewayConfig, removeEOL(actualGatewayConfig));
+		
+		awareConfig = new File(outdir, Generator.ESB_CONFIG_XML_FILE);
+		assertTrue(awareConfig.exists());
+		actualESBAwareConfig = FileUtil.readTextFile(awareConfig);
+		log.debug("[" + actualESBAwareConfig + "]");
+		actualESBAwareConfig = removeEOL(actualESBAwareConfig);
+		boolean isIndentical = expectedESBAwareConfig.equals(actualESBAwareConfig);
+		log.debug("Strings identical=" + isIndentical);
+		assertEquals(expectedESBAwareConfig, actualESBAwareConfig);
+	}
+
+	public void test_bad_base_listener_busref() throws ConfigurationException, IOException {
+		Generator generator = new Generator(getClass().getResourceAsStream("jbossesb_config_03.xml"));
+		
+		try {
+			generator.generate(outdir);
+			fail("Expected ConfigurationException");
+		} catch(ConfigurationException e) {
+			if(!e.getMessage().equals("The base Listener config [JMS-ESBListener] must reference a base Bus config type (<bus>).")) {
+				fail("Wrong exception");
+			}
+		}
+	}
+	
+	public static String removeEOL(String string) {
+		StringBuffer stringBuf = new StringBuffer(string.length());
+
+		for(int i = 0; i < string.length(); i++) {
+			char character = string.charAt(i);
+			
+			if(character != '\r' && character != '\n') {
+				stringBuf.append(character);
+			}
+		}
+		
+		return stringBuf.toString();
+	}
+
+	public void test_model() throws ConfigurationException, IOException {
+		Generator generator = new Generator(getClass().getResourceAsStream("jbossesb_config_01.xml"));
+		XMLBeansModel model = generator.getModel();
+
+		JmsBus bus = (JmsBus)model.getBus("server1-jms");
+		JmsProvider provider = (JmsProvider) model.getProvider(bus);
+		assertEquals("server1-jms", bus.getBusid());
+		assertEquals("com.xyz.provider.XYZConnectionFactory", provider.getConnectionFactory());
+		assertEquals("com.xyz.provider.NamingContextFactory", provider.getJndiContextFactory());
+		assertEquals("xyz://server1:9876", provider.getJndiURL());
+		assertEquals("com.xyz", provider.getJndiPkgPrefix());
+		JmsMessageFilter busDestination = bus.getJmsMessageFilter();
+		assertEquals("queue/A", busDestination.getDestName());
+		assertEquals(JmsMessageFilter.DestType.QUEUE, busDestination.getDestType());
+		assertEquals("service='Reconciliation'", busDestination.getSelector());
+
+		List<Listener> gateways = model.getGatewayListeners();
+		assertEquals(2, gateways.size());
+		JmsListener gatewayListener = (JmsListener)gateways.get(0);
+		assertEquals("Bank-JMS-Gateway", gatewayListener.getName());
+		assertEquals("server1-jms", gatewayListener.getBusidref());
+		assertTrue(gatewayListener.getIsGateway());
+		assertEquals(1, gatewayListener.getMaxThreads());
+
+		List<Listener> awareListeners = model.getESBAwareListeners();
+		assertEquals(4, awareListeners.size());
+		JmsListener awareListener = (JmsListener)awareListeners.get(0);
+		assertEquals("Bank-Listener", awareListener.getName());
+		assertEquals("local-jms", awareListener.getBusidref());
+		assertTrue(!awareListener.getIsGateway());
+		assertEquals(2, awareListener.getMaxThreads());
+		JmsMessageFilter listenerDestination = awareListener.getJmsMessageFilter();
+		assertEquals("queue/B", listenerDestination.getDestName());
+		assertEquals(JmsMessageFilter.DestType.TOPIC, listenerDestination.getDestType());
+		assertEquals("service='Reconciliation'", listenerDestination.getSelector());
+		
+		Listener untypedAwareListener = awareListeners.get(1);
+		assertEquals("Bank-Listener-Generic", untypedAwareListener.getName());
+		assertEquals("my-generic-bus", untypedAwareListener.getBusidref());
+		assertTrue(!untypedAwareListener.getIsGateway());
+		
+		Service gatewayService = model.getService(gatewayListener);
+		Service awareService = model.getService(awareListener);
+		assertSame(gatewayService, awareService);
+		assertEquals("Bank", awareService.getCategory());
+		assertEquals("Reconciliation", awareService.getName());
+		assertEquals("Bank Reconciliation Service", awareService.getDescription());
+	}
+
+	private void test_generate_badargs(File outdir, String expectedMessage) throws ConfigurationException, IOException {
+		Generator generator = new Generator(getClass().getResourceAsStream("jbossesb_config_01.xml"));
+
+		try {
+			generator.generate(outdir);
+			fail("Expected IllegalArgumentException.");
+		} catch(IllegalArgumentException e) {
+			// Expected
+			if(!e.getMessage().startsWith(expectedMessage)) {
+				fail("Unexpected exception message.  Expected message to start with [" + expectedMessage + "].  Message was [" + e.getMessage() + "].");
+			}
+		}
+	}
+
+	/* (non-Javadoc)
+	 * @see junit.framework.TestCase#tearDown()
+	 */
+	@Override
+	protected void tearDown() throws Exception {
+		if(awareConfig != null && awareConfig.exists()) {
+			awareConfig.delete();
+		}
+		if(gatewayConfig != null && gatewayConfig.exists()) {
+			gatewayConfig.delete();
+		}
+		if(outdir.exists()) {
+			outdir.delete();
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockContractPublisher.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockContractPublisher.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockContractPublisher.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,20 +0,0 @@
-package org.jboss.soa.esb.listeners.config;
-
-import org.jboss.internal.soa.esb.publish.ActionContractPublisher;
-import org.jboss.internal.soa.esb.publish.ContractInfo;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-
-/**
- * @author
- */
-public class MockContractPublisher implements ActionContractPublisher {
-    public static ContractInfo contractInfo;
-
-    public void setActionConfig(ActionDocument.Action actionConfig) throws ConfigurationException {
-    }
-
-    public ContractInfo getContractInfo(EPR epr) {
-        return contractInfo;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockContractPublisher.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockContractPublisher.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockContractPublisher.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockContractPublisher.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,20 @@
+package org.jboss.soa.esb.listeners.config;
+
+import org.jboss.internal.soa.esb.publish.ActionContractPublisher;
+import org.jboss.internal.soa.esb.publish.ContractInfo;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+
+/**
+ * @author
+ */
+public class MockContractPublisher implements ActionContractPublisher {
+    public static ContractInfo contractInfo;
+
+    public void setActionConfig(ActionDocument.Action actionConfig) throws ConfigurationException {
+    }
+
+    public ContractInfo getContractInfo(EPR epr) {
+        return contractInfo;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,45 +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.config;
-
-import junit.framework.TestCase;
-
-public class MockXmlValidatorUnitTest extends TestCase
-{
-	public void testMockValidator ()
-	{
-		MockXmlValidatorImpl impl = new MockXmlValidatorImpl();
-		
-		impl.getValidationResults();
-		impl.getXMLDocument();
-		
-		try
-		{
-			impl.validate(null);
-			impl.validate(null, null);
-		}
-		catch (Exception ex)
-		{
-			fail();
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MockXmlValidatorUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,45 @@
+/*
+ * 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.config;
+
+import junit.framework.TestCase;
+
+public class MockXmlValidatorUnitTest extends TestCase
+{
+	public void testMockValidator ()
+	{
+		MockXmlValidatorImpl impl = new MockXmlValidatorImpl();
+		
+		impl.getValidationResults();
+		impl.getXMLDocument();
+		
+		try
+		{
+			impl.validate(null);
+			impl.validate(null, null);
+		}
+		catch (Exception ex)
+		{
+			fail();
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MyPublishedAction.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MyPublishedAction.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MyPublishedAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,16 +0,0 @@
-package org.jboss.soa.esb.listeners.config;
-
-import org.jboss.internal.soa.esb.publish.Publish;
-import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.message.Message;
-
-/**
- * @author
- */
- at Publish(MockContractPublisher.class)
-public class MyPublishedAction extends AbstractActionPipelineProcessor {
-    public Message process(final Message message) throws ActionProcessingException {
-        return null;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MyPublishedAction.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MyPublishedAction.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MyPublishedAction.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/MyPublishedAction.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,16 @@
+package org.jboss.soa.esb.listeners.config;
+
+import org.jboss.internal.soa.esb.publish.Publish;
+import org.jboss.soa.esb.actions.AbstractActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * @author
+ */
+ at Publish(MockContractPublisher.class)
+public class MyPublishedAction extends AbstractActionPipelineProcessor {
+    public Message process(final Message message) throws ActionProcessingException {
+        return null;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,51 +0,0 @@
-package org.jboss.soa.esb.listeners.config;
-
-import java.io.IOException;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
-
-/**
- * @author
- */
-public class ServicePublisherUnitTest extends TestCase {
-
-    public void test() throws ConfigurationException, IOException {
-        Generator generator;
-        ManagedLifecycleController controller1 = new ManagedLifecycleController(null); // TODO: Introduce an interface and Mock for ManagedLifecycleController
-        ManagedLifecycleController controller2 = new ManagedLifecycleController(null); // TODO: Introduce an interface and Mock for ManagedLifecycleController
-
-        generator = new Generator(getClass().getResourceAsStream("jbossesb_config_04.xml"));
-        ServicePublisher.addServicePublishers(controller1, generator.getModel());
-        List<ServicePublisher> publishers = ServicePublisher.getServicePublishers();
-        assertEquals(2, publishers.size());
-        assertEquals("A1", publishers.get(0).getCategory() + publishers.get(0).getServiceName());
-        assertEquals(null, publishers.get(0).getContractPublisher());
-        assertEquals("B2", publishers.get(1).getCategory() + publishers.get(1).getServiceName());
-        assertEquals(null, publishers.get(1).getContractPublisher());
-
-        generator = new Generator(getClass().getResourceAsStream("jbossesb_config_05.xml"));
-        ServicePublisher.addServicePublishers(controller2, generator.getModel());
-        publishers = ServicePublisher.getServicePublishers();
-        assertEquals(4, publishers.size());
-        assertEquals("A1", publishers.get(0).getCategory() + publishers.get(0).getServiceName());
-        assertEquals(null, publishers.get(0).getContractPublisher());
-        assertEquals("B2", publishers.get(1).getCategory() + publishers.get(1).getServiceName());
-        assertEquals(null, publishers.get(1).getContractPublisher());
-        assertEquals("C3", publishers.get(2).getCategory() + publishers.get(2).getServiceName());
-        assertEquals(null, publishers.get(2).getContractPublisher());
-        assertEquals("D4", publishers.get(3).getCategory() + publishers.get(3).getServiceName());
-        assertTrue(publishers.get(3).getContractPublisher() instanceof MockContractPublisher);
-
-        ServicePublisher.removeServicePublishers(controller1);
-        publishers = ServicePublisher.getServicePublishers();
-        assertEquals(2, publishers.size());
-        assertEquals("C3", publishers.get(0).getCategory() + publishers.get(0).getServiceName());
-        assertEquals(null, publishers.get(0).getContractPublisher());
-        assertEquals("D4", publishers.get(1).getCategory() + publishers.get(1).getServiceName());
-        assertTrue(publishers.get(1).getContractPublisher() instanceof MockContractPublisher);
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/ServicePublisherUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,51 @@
+package org.jboss.soa.esb.listeners.config;
+
+import java.io.IOException;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleController;
+
+/**
+ * @author
+ */
+public class ServicePublisherUnitTest extends TestCase {
+
+    public void test() throws ConfigurationException, IOException {
+        Generator generator;
+        ManagedLifecycleController controller1 = new ManagedLifecycleController(null); // TODO: Introduce an interface and Mock for ManagedLifecycleController
+        ManagedLifecycleController controller2 = new ManagedLifecycleController(null); // TODO: Introduce an interface and Mock for ManagedLifecycleController
+
+        generator = new Generator(getClass().getResourceAsStream("jbossesb_config_04.xml"));
+        ServicePublisher.addServicePublishers(controller1, generator.getModel());
+        List<ServicePublisher> publishers = ServicePublisher.getServicePublishers();
+        assertEquals(2, publishers.size());
+        assertEquals("A1", publishers.get(0).getCategory() + publishers.get(0).getServiceName());
+        assertEquals(null, publishers.get(0).getContractPublisher());
+        assertEquals("B2", publishers.get(1).getCategory() + publishers.get(1).getServiceName());
+        assertEquals(null, publishers.get(1).getContractPublisher());
+
+        generator = new Generator(getClass().getResourceAsStream("jbossesb_config_05.xml"));
+        ServicePublisher.addServicePublishers(controller2, generator.getModel());
+        publishers = ServicePublisher.getServicePublishers();
+        assertEquals(4, publishers.size());
+        assertEquals("A1", publishers.get(0).getCategory() + publishers.get(0).getServiceName());
+        assertEquals(null, publishers.get(0).getContractPublisher());
+        assertEquals("B2", publishers.get(1).getCategory() + publishers.get(1).getServiceName());
+        assertEquals(null, publishers.get(1).getContractPublisher());
+        assertEquals("C3", publishers.get(2).getCategory() + publishers.get(2).getServiceName());
+        assertEquals(null, publishers.get(2).getContractPublisher());
+        assertEquals("D4", publishers.get(3).getCategory() + publishers.get(3).getServiceName());
+        assertTrue(publishers.get(3).getContractPublisher() instanceof MockContractPublisher);
+
+        ServicePublisher.removeServicePublishers(controller1);
+        publishers = ServicePublisher.getServicePublishers();
+        assertEquals(2, publishers.size());
+        assertEquals("C3", publishers.get(0).getCategory() + publishers.get(0).getServiceName());
+        assertEquals(null, publishers.get(0).getContractPublisher());
+        assertEquals("D4", publishers.get(1).getCategory() + publishers.get(1).getServiceName());
+        assertTrue(publishers.get(1).getContractPublisher() instanceof MockContractPublisher);
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,211 +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.config;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.StringWriter;
-import java.util.Collection;
-
-import javax.xml.transform.stream.StreamSource;
-
-import junit.framework.JUnit4TestAdapter;
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.xml.sax.InputSource;
-import org.xml.sax.SAXParseException;
-
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
-/**
- * XmlValidator unit tests.
- * @author <a href="mailto:ddegroff at ddegroff.com">ddegroff at ddegroff.com</a>
- */
-public class XmlValidatorUnitTest extends TestCase {
-	
-	private Logger log = Logger.getLogger( XmlValidatorUnitTest.class );
-	
-	private static String testXml;
-	private static InputSource inputSource;
-	private static StreamSource validationSource;
-	private static XmlValidatorImpl xmlValidation;
-	private boolean isValid = false;
-	
-	@Override
-	protected void setUp() throws Exception
-	{
-		testXml = "etc/examples/listeners/jbossesb_config_01.xml";
-		File validationFile = new File(testXml);
-		try {
-			if (validationFile.exists()) {
-				log.debug("validationFile "+testXml+" exists");
-			} else {
-				throw new IOException();
-			}
-		} catch (IOException e) {
-			log.error("validationFile "+testXml+" does not exist");
-		}
-		try {
-			InputStream inputStream = new FileInputStream(validationFile);
-			inputSource = new InputSource(inputStream);
-			xmlValidation = new XmlValidatorImpl(inputSource);
-		} catch (Exception e) {
-			log.error(e);
-		}
-		String validationFileName = TestEnvironmentUtil.getUserDir("product") 
-			+ "etc/schemas/xml/jbossesb-1.0.1.xsd";
-		try {
-			validationSource = new StreamSource(validationFileName);
-		} catch (Exception e) {
-			log.error(e);
-		}		
-	}
-	
-	@Test 
-	public void testValidateXml() throws Exception {
-		isValid = xmlValidation.validate(inputSource);
-		if (isValid) {
-			log.debug(testXml+" is valid");
-		} else {
-			log.error(testXml+" is invalid -- see getValidationResults()");
-			Collection<String> validationResults = xmlValidation.getValidationResults();
-
-			if (validationResults.size() == 0) {
-			} else {
-				log.debug("Validation Results:");
-				Object[] valResults = validationResults.toArray();
-    		for (int i = 0; i < validationResults.size(); i++) {
-        	log.debug(valResults[i].toString());
-    		}
-			}
-		}
-	}
-	@Test
-	public void testValidateXmlAndSchema() throws Exception {
-		isValid = xmlValidation.validate(inputSource,validationSource);
-		if (isValid) {
-			log.debug(testXml+" is valid");
-		} else {
-			log.error(testXml+" is invalid -- see getValidationResults()");
-			Collection<String> validationResults = xmlValidation.getValidationResults();
-
-			if (validationResults.size() == 0) {
-			} else {
-				log.debug("Validation Results:");
-				Object[] valResults = validationResults.toArray();
-    		for (int i = 0; i < validationResults.size(); i++) {
-        	log.debug(valResults[i].toString());
-    		}
-			}
-		}
-	}
-	
-	public void testValidateXmlAndDefaultSchema() throws Exception
-	{
-		isValid = xmlValidation.validate(inputSource, null);
-		
-		if (isValid)
-		{
-			log.debug(testXml+" is valid");
-		} 
-		else 
-		{
-			log.debug(testXml+" is invalid -- see getValidationResults()");
-			Collection<String> validationResults = xmlValidation.getValidationResults();
-
-			if (validationResults.size() == 0) 
-			{
-			} 
-			else 
-			{
-				log.debug("Validation Results:");
-				Object[] valResults = validationResults.toArray();
-				
-	    		for (int i = 0; i < validationResults.size(); i++) 
-	    		{
-	    			log.debug(valResults[i].toString());
-	    		}
-			}
-		}
-	}
-	
-	public void testXmlErrorHandler() throws Exception
-	{
-		XmlValidatorImpl foo = new XmlValidatorImpl();
-		XmlValidatorImpl.XmlErrorHandler handler = foo.new XmlErrorHandler();
-		
-		handler.warning(new SAXParseException("foo", null));
-		handler.error(new SAXParseException("foo", null));
-		handler.fatalError(new SAXParseException("foo", null));
-	}
-	
-	@Test
-	public void testGetDocument() throws Exception {
-		Document document = xmlValidation.getXMLDocument();
-		if (document != null) {
-			final StringWriter sWriter = new StringWriter() ;
-			final OutputFormat format = new OutputFormat() ;
-			format.setIndenting(true) ;
-			final XMLSerializer xmlS = new XMLSerializer(sWriter, format) ;
-			xmlS.asDOMSerializer() ;
-			xmlS.serialize(document) ;
-			log.debug(sWriter.toString()) ;
-		}
-	}
-	@Test
-	public void testGetValidationResults() throws Exception {
-		if (isValid) {
-
-		} else {
-			Collection<String> validationResults = xmlValidation.getValidationResults();
-
-			if (validationResults.size() == 0) {
-			} else {
-				log.debug("Validation Results:");
-				Object[] valResults = validationResults.toArray();
-    		for (int i = 0; i < validationResults.size(); i++) {
-        	log.debug(valResults[i]);
-    		}
-			}
-		}
-	}
-	
-	public void testException () throws Exception
-	{
-		@SuppressWarnings("unused")
-        XmlValidatorException ex = new XmlValidatorException("foobar");
-		ex = new XmlValidatorException();
-		ex = new XmlValidatorException("foobar", new Exception());
-	}
-		
-	public static junit.framework.Test suite() {
-		return new JUnit4TestAdapter(XmlValidatorUnitTest.class);
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/XmlValidatorUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,211 @@
+/*
+ * 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.config;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.StringWriter;
+import java.util.Collection;
+
+import javax.xml.transform.stream.StreamSource;
+
+import junit.framework.JUnit4TestAdapter;
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.xml.sax.InputSource;
+import org.xml.sax.SAXParseException;
+
+import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+/**
+ * XmlValidator unit tests.
+ * @author <a href="mailto:ddegroff at ddegroff.com">ddegroff at ddegroff.com</a>
+ */
+public class XmlValidatorUnitTest extends TestCase {
+	
+	private Logger log = Logger.getLogger( XmlValidatorUnitTest.class );
+	
+	private static String testXml;
+	private static InputSource inputSource;
+	private static StreamSource validationSource;
+	private static XmlValidatorImpl xmlValidation;
+	private boolean isValid = false;
+	
+	@Override
+	protected void setUp() throws Exception
+	{
+		testXml = "etc/examples/listeners/jbossesb_config_01.xml";
+		File validationFile = new File(testXml);
+		try {
+			if (validationFile.exists()) {
+				log.debug("validationFile "+testXml+" exists");
+			} else {
+				throw new IOException();
+			}
+		} catch (IOException e) {
+			log.error("validationFile "+testXml+" does not exist");
+		}
+		try {
+			InputStream inputStream = new FileInputStream(validationFile);
+			inputSource = new InputSource(inputStream);
+			xmlValidation = new XmlValidatorImpl(inputSource);
+		} catch (Exception e) {
+			log.error(e);
+		}
+		String validationFileName = TestEnvironmentUtil.getUserDir("product") 
+			+ "etc/schemas/xml/jbossesb-1.0.1.xsd";
+		try {
+			validationSource = new StreamSource(validationFileName);
+		} catch (Exception e) {
+			log.error(e);
+		}		
+	}
+	
+	@Test 
+	public void testValidateXml() throws Exception {
+		isValid = xmlValidation.validate(inputSource);
+		if (isValid) {
+			log.debug(testXml+" is valid");
+		} else {
+			log.error(testXml+" is invalid -- see getValidationResults()");
+			Collection<String> validationResults = xmlValidation.getValidationResults();
+
+			if (validationResults.size() == 0) {
+			} else {
+				log.debug("Validation Results:");
+				Object[] valResults = validationResults.toArray();
+    		for (int i = 0; i < validationResults.size(); i++) {
+        	log.debug(valResults[i].toString());
+    		}
+			}
+		}
+	}
+	@Test
+	public void testValidateXmlAndSchema() throws Exception {
+		isValid = xmlValidation.validate(inputSource,validationSource);
+		if (isValid) {
+			log.debug(testXml+" is valid");
+		} else {
+			log.error(testXml+" is invalid -- see getValidationResults()");
+			Collection<String> validationResults = xmlValidation.getValidationResults();
+
+			if (validationResults.size() == 0) {
+			} else {
+				log.debug("Validation Results:");
+				Object[] valResults = validationResults.toArray();
+    		for (int i = 0; i < validationResults.size(); i++) {
+        	log.debug(valResults[i].toString());
+    		}
+			}
+		}
+	}
+	
+	public void testValidateXmlAndDefaultSchema() throws Exception
+	{
+		isValid = xmlValidation.validate(inputSource, null);
+		
+		if (isValid)
+		{
+			log.debug(testXml+" is valid");
+		} 
+		else 
+		{
+			log.debug(testXml+" is invalid -- see getValidationResults()");
+			Collection<String> validationResults = xmlValidation.getValidationResults();
+
+			if (validationResults.size() == 0) 
+			{
+			} 
+			else 
+			{
+				log.debug("Validation Results:");
+				Object[] valResults = validationResults.toArray();
+				
+	    		for (int i = 0; i < validationResults.size(); i++) 
+	    		{
+	    			log.debug(valResults[i].toString());
+	    		}
+			}
+		}
+	}
+	
+	public void testXmlErrorHandler() throws Exception
+	{
+		XmlValidatorImpl foo = new XmlValidatorImpl();
+		XmlValidatorImpl.XmlErrorHandler handler = foo.new XmlErrorHandler();
+		
+		handler.warning(new SAXParseException("foo", null));
+		handler.error(new SAXParseException("foo", null));
+		handler.fatalError(new SAXParseException("foo", null));
+	}
+	
+	@Test
+	public void testGetDocument() throws Exception {
+		Document document = xmlValidation.getXMLDocument();
+		if (document != null) {
+			final StringWriter sWriter = new StringWriter() ;
+			final OutputFormat format = new OutputFormat() ;
+			format.setIndenting(true) ;
+			final XMLSerializer xmlS = new XMLSerializer(sWriter, format) ;
+			xmlS.asDOMSerializer() ;
+			xmlS.serialize(document) ;
+			log.debug(sWriter.toString()) ;
+		}
+	}
+	@Test
+	public void testGetValidationResults() throws Exception {
+		if (isValid) {
+
+		} else {
+			Collection<String> validationResults = xmlValidation.getValidationResults();
+
+			if (validationResults.size() == 0) {
+			} else {
+				log.debug("Validation Results:");
+				Object[] valResults = validationResults.toArray();
+    		for (int i = 0; i < validationResults.size(); i++) {
+        	log.debug(valResults[i]);
+    		}
+			}
+		}
+	}
+	
+	public void testException () throws Exception
+	{
+		@SuppressWarnings("unused")
+        XmlValidatorException ex = new XmlValidatorException("foobar");
+		ex = new XmlValidatorException();
+		ex = new XmlValidatorException("foobar", new Exception());
+	}
+		
+	public static junit.framework.Test suite() {
+		return new JUnit4TestAdapter(XmlValidatorUnitTest.class);
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,111 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
-
-	<providers>
-		<jms-provider name="JBossMQ" connection-factory="ConnectionFactory" jndi-URL="jnp://localhost:1099">
-			<jms-bus busid="local-jms" />
-		</jms-provider>
-		
-		<jms-provider name="JBossMessaging" connection-factory="com.xyz.provider.XYZConnectionFactory" 
-					jndi-context-factory="com.xyz.provider.NamingContextFactory"
-					jndi-URL="xyz://server1:9876" 
-					jndi-pkg-prefix="com.xyz">
-			<jms-bus busid="server1-jms">
-				<jms-message-filter dest-type="QUEUE" dest-name="queue/A" selector="service='Reconciliation'" />
-			</jms-bus>
-		</jms-provider>
-		
-		<ftp-provider name="FTP" hostname="localhost:21">
-			<ftp-bus busid="Ftp-ServerTest">
-				<ftp-message-filter directory="/Temp" input-suffix=".txt" username="joe" password="secret"/>
-			</ftp-bus>
-		</ftp-provider>
-		
-		<sql-provider name="HSQLDB" url="jdbc:postgresql://myhost:5432/testDB" driver="org.postgresql.Driver" username="joe" password="secret">
-			<sql-bus busid="SQL-Test">
-				<sql-message-filter tablename="testtable"/>
-			</sql-bus>
-		</sql-provider>
-
-        <jbr-provider name="JBR" host="192.168.1.111" protocol="http">
-            <jbr-bus busid="HTTP-1" port="8765" />
-            <jbr-bus busid="HTTP-2" port="8766" />
-        </jbr-provider>
-
-        <provider name="JBossAS">
-			<property name="my-generic-provider" value="my-generic-provider#someattribvalue" />
-			
-			<bus busid="my-generic-bus">
-				<property name="my-generic-bus" value="my-generic-bus#someattribvalue" />
-			</bus>
-		</provider>
-
-	</providers>
-	<services>    
-		<service category="Bank" name="Reconciliation" description="Bank Reconciliation Service">
-		
-			<listeners>  
-				<jms-listener name="Bank-JMS-Gateway"
-					busidref="server1-jms"
-					maxThreads="1"
-					is-gateway="true"/>  	    
-                <jbr-listener name="Bank-HTTP-Gateway"
-                    busidref="HTTP-1"
-                    maxThreads="1"
-                    is-gateway="true"/>
-				<jms-listener name="Bank-Listener"
-							busidref="local-jms"
-							maxThreads="2">
-					<jms-message-filter dest-type="TOPIC" dest-name="queue/B" selector="service='Reconciliation'" />
-				</jms-listener>
-				<listener name="Bank-Listener-Generic" 
-							busidref="my-generic-bus"
-							maxThreads="2">
-					<property name="my-generic-listener" value="my-generic-listener#someattribvalue" />
-				</listener>
-			</listeners>    	
-			  
-			<actions>    	    
-				<action name="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter">
-					<property name="propName" value="propValue" />
-					<property name="propName">
-						This is some complex..
-						<!-- property -->
-						value.
-						<xxxx>
-							boooo
-							<yyyy/>
-						</xxxx>
-						<![CDATA[ Some CDATA data...]]>
-					</property>
-				</action>
-			</actions>
-			
-		</service>
-		<service category="Test2" name="FTPTest" description="FTP server Test">
-		
-			<listeners>    	    
-				<ftp-listener name="test-ftp-listener"
-							busidref="Ftp-ServerTest"
-							maxThreads="1"/>
-			</listeners>
-			<actions>    	    
-				<action name="TestFtpRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
-			</actions> 	
-			
-		</service>
-		<service category="Test3" name="SQLTest" description="SQL server Test">
-		
-			<listeners>    	    
-				<sql-listener name="test-sql-listener"
-							busidref="SQL-Test"
-							maxThreads="1"/>
-			</listeners>
-			<actions>    	    
-				<action name="TestSqlRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
-			</actions> 	
-			
-		</service>
-	</services>
-	
-</jbossesb>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,111 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+	<providers>
+		<jms-provider name="JBossMQ" connection-factory="ConnectionFactory" jndi-URL="jnp://localhost:1099">
+			<jms-bus busid="local-jms" />
+		</jms-provider>
+		
+		<jms-provider name="JBossMessaging" connection-factory="com.xyz.provider.XYZConnectionFactory" 
+					jndi-context-factory="com.xyz.provider.NamingContextFactory"
+					jndi-URL="xyz://server1:9876" 
+					jndi-pkg-prefix="com.xyz">
+			<jms-bus busid="server1-jms">
+				<jms-message-filter dest-type="QUEUE" dest-name="queue/A" selector="service='Reconciliation'" />
+			</jms-bus>
+		</jms-provider>
+		
+		<ftp-provider name="FTP" hostname="localhost:21">
+			<ftp-bus busid="Ftp-ServerTest">
+				<ftp-message-filter directory="/Temp" input-suffix=".txt" username="joe" password="secret"/>
+			</ftp-bus>
+		</ftp-provider>
+		
+		<sql-provider name="HSQLDB" url="jdbc:postgresql://myhost:5432/testDB" driver="org.postgresql.Driver" username="joe" password="secret">
+			<sql-bus busid="SQL-Test">
+				<sql-message-filter tablename="testtable"/>
+			</sql-bus>
+		</sql-provider>
+
+        <jbr-provider name="JBR" host="192.168.1.111" protocol="http">
+            <jbr-bus busid="HTTP-1" port="8765" />
+            <jbr-bus busid="HTTP-2" port="8766" />
+        </jbr-provider>
+
+        <provider name="JBossAS">
+			<property name="my-generic-provider" value="my-generic-provider#someattribvalue" />
+			
+			<bus busid="my-generic-bus">
+				<property name="my-generic-bus" value="my-generic-bus#someattribvalue" />
+			</bus>
+		</provider>
+
+	</providers>
+	<services>    
+		<service category="Bank" name="Reconciliation" description="Bank Reconciliation Service">
+		
+			<listeners>  
+				<jms-listener name="Bank-JMS-Gateway"
+					busidref="server1-jms"
+					maxThreads="1"
+					is-gateway="true"/>  	    
+                <jbr-listener name="Bank-HTTP-Gateway"
+                    busidref="HTTP-1"
+                    maxThreads="1"
+                    is-gateway="true"/>
+				<jms-listener name="Bank-Listener"
+							busidref="local-jms"
+							maxThreads="2">
+					<jms-message-filter dest-type="TOPIC" dest-name="queue/B" selector="service='Reconciliation'" />
+				</jms-listener>
+				<listener name="Bank-Listener-Generic" 
+							busidref="my-generic-bus"
+							maxThreads="2">
+					<property name="my-generic-listener" value="my-generic-listener#someattribvalue" />
+				</listener>
+			</listeners>    	
+			  
+			<actions>    	    
+				<action name="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter">
+					<property name="propName" value="propValue" />
+					<property name="propName">
+						This is some complex..
+						<!-- property -->
+						value.
+						<xxxx>
+							boooo
+							<yyyy/>
+						</xxxx>
+						<![CDATA[ Some CDATA data...]]>
+					</property>
+				</action>
+			</actions>
+			
+		</service>
+		<service category="Test2" name="FTPTest" description="FTP server Test">
+		
+			<listeners>    	    
+				<ftp-listener name="test-ftp-listener"
+							busidref="Ftp-ServerTest"
+							maxThreads="1"/>
+			</listeners>
+			<actions>    	    
+				<action name="TestFtpRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+			</actions> 	
+			
+		</service>
+		<service category="Test3" name="SQLTest" description="SQL server Test">
+		
+			<listeners>    	    
+				<sql-listener name="test-sql-listener"
+							busidref="SQL-Test"
+							maxThreads="1"/>
+			</listeners>
+			<actions>    	    
+				<action name="TestSqlRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+			</actions> 	
+			
+		</service>
+	</services>
+	
+</jbossesb>

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!--	NOTE: DO NOT MODIFY	This file was auto-generated.--><jbossesb-listeners parameterReloadSecs="180"><Bank-Listener listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="2" service-category="Bank" service-description="Bank Reconciliation Service" service-name="Reconciliation"><EPR connection-factory="ConnectionFactory" destination-name="queue/B" destination-type="topic" jndi-URL="jnp://localhost:1099" message-selector="service='Reconciliation'" protocol="jms"/><action action="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter" propName="propValue">						This is some complex..						<!-- property -->						value.						<xxxx>							boooo							<yyyy/>						</xxxx>						 Some CDATA data...					</action></Bank-Listener><Bank-Listener-Generic listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="2" my-generic-listener="my-generic-listener#someattribvalue" !
 service-category="Bank" service-description="Bank Reconciliation Service" service-name="Reconciliation"><EPR my-generic-bus="my-generic-bus#someattribvalue" my-generic-provider="my-generic-provider#someattribvalue"/><action action="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter" propName="propValue">						This is some complex..						<!-- property -->						value.						<xxxx>							boooo							<yyyy/>						</xxxx>						 Some CDATA data...					</action></Bank-Listener-Generic><test-ftp-listener listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="1" pollLatencySeconds="10" service-category="Test2" service-description="FTP server Test" service-name="FTPTest"><EPR URL="ftp://joe:secret@localhost:21/Temp" errorDelete="true" inputSuffix=".txt" passive="false" postDelete="true" workSuffix=".esbInProcess"/><action action="TestFtpRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/></test-ftp-listener><test-sq!
 l-listener listenerClass="org.jboss.soa.esb.listeners.message.MessageA
wareListener" maxThreads="1" pollLatencySeconds="10" service-category="Test3" service-description="SQL server Test" service-name="SQLTest"><EPR URL="jdbc:postgresql://myhost:5432/testDB" driver="org.postgresql.Driver" errorDelete="true" insert_timestamp_column="insert_timestamp" message_column="message" message_id_column="message_id" password="secret" postDelete="true" status_column="status" tablename="testtable" username="joe"/><action action="TestSqlRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/></test-sql-listener></jbossesb-listeners>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_esbaware.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><!--	NOTE: DO NOT MODIFY	This file was auto-generated.--><jbossesb-listeners parameterReloadSecs="180"><Bank-Listener listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="2" service-category="Bank" service-description="Bank Reconciliation Service" service-name="Reconciliation"><EPR connection-factory="ConnectionFactory" destination-name="queue/B" destination-type="topic" jndi-URL="jnp://localhost:1099" message-selector="service='Reconciliation'" protocol="jms"/><action action="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter" propName="propValue">						This is some complex..						<!-- property -->						value.						<xxxx>							boooo							<yyyy/>						</xxxx>						 Some CDATA data...					</action></Bank-Listener><Bank-Listener-Generic listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="2" my-generic-listener="my-generic-listener#someattribvalue" !
 service-category="Bank" service-description="Bank Reconciliation Service" service-name="Reconciliation"><EPR my-generic-bus="my-generic-bus#someattribvalue" my-generic-provider="my-generic-provider#someattribvalue"/><action action="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter" propName="propValue">						This is some complex..						<!-- property -->						value.						<xxxx>							boooo							<yyyy/>						</xxxx>						 Some CDATA data...					</action></Bank-Listener-Generic><test-ftp-listener listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener" maxThreads="1" pollLatencySeconds="10" service-category="Test2" service-description="FTP server Test" service-name="FTPTest"><EPR URL="ftp://joe:secret@localhost:21/Temp" errorDelete="true" inputSuffix=".txt" passive="false" postDelete="true" workSuffix=".esbInProcess"/><action action="TestFtpRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/></test-ftp-listener><test-sq!
 l-listener listenerClass="org.jboss.soa.esb.listeners.message.MessageA
wareListener" maxThreads="1" pollLatencySeconds="10" service-category="Test3" service-description="SQL server Test" service-name="SQLTest"><EPR URL="jdbc:postgresql://myhost:5432/testDB" driver="org.postgresql.Driver" errorDelete="true" insert_timestamp_column="insert_timestamp" message_column="message" message_id_column="message_id" password="secret" postDelete="true" status_column="status" tablename="testtable" username="joe"/><action action="TestSqlRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/></test-sql-listener></jbossesb-listeners>

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?><!--	NOTE: DO NOT MODIFY	This file was auto-generated.--><jbossesb-gateways parameterReloadSecs="180"><Bank-JMS-Gateway connection-factory="com.xyz.provider.XYZConnectionFactory" destination-name="queue/A" destination-type="queue" gatewayClass="org.jboss.soa.esb.listeners.gateway.JmsGatewayListener" jndi-URL="xyz://server1:9876" jndi-context-factory="com.xyz.provider.NamingContextFactory" jndi-pkg-prefix="com.xyz" maxThreads="1" message-selector="service='Reconciliation'" service-description="Bank Reconciliation Service" target-service-category="Bank" target-service-name="Reconciliation"/><Bank-HTTP-Gateway gatewayClass="org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener" jbr-serverBindAddress="192.168.1.111" jbr-serverBindPort="8765" jbr-serverProtocol="http" maxThreads="1" service-description="Bank Reconciliation Service" target-service-category="Bank" target-service-name="Reconciliation"/></jbossesb-gateways>        
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_01_gateways.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1 @@
+<?xml version="1.0" encoding="UTF-8"?><!--	NOTE: DO NOT MODIFY	This file was auto-generated.--><jbossesb-gateways parameterReloadSecs="180"><Bank-JMS-Gateway connection-factory="com.xyz.provider.XYZConnectionFactory" destination-name="queue/A" destination-type="queue" gatewayClass="org.jboss.soa.esb.listeners.gateway.JmsGatewayListener" jndi-URL="xyz://server1:9876" jndi-context-factory="com.xyz.provider.NamingContextFactory" jndi-pkg-prefix="com.xyz" maxThreads="1" message-selector="service='Reconciliation'" service-description="Bank Reconciliation Service" target-service-category="Bank" target-service-name="Reconciliation"/><Bank-HTTP-Gateway gatewayClass="org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener" jbr-serverBindAddress="192.168.1.111" jbr-serverBindPort="8765" jbr-serverProtocol="http" maxThreads="1" service-description="Bank Reconciliation Service" target-service-category="Bank" target-service-name="Reconciliation"/></jbossesb-gateways>        
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,156 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
-
-	<providers>
-		<provider name="JBossMQ">
-			<property name="connection-factory" value="ConnectionFactory" />
-			<property name="jndi-URL" value="jnp://localhost:1099" />
-			<property name="protocol" value="jms" />
-			
-			<bus busid="local-jms">
-				<property name="destination-type" value="topic" />
-				<property name="destination-name" value="queue/B" />
-				<property name="message-selector" value="service='Reconciliation'" />
-			</bus>
-		</provider>
-		
-		<provider name="JBossMessaging">
-			<property name="connection-factory" value="com.xyz.provider.XYZConnectionFactory" />
-			<property name="jndi-context-factory" value="com.xyz.provider.NamingContextFactory" />
-			<property name="jndi-URL" value="xyz://server1:9876" />
-			<property name="jndi-pkg-prefix" value="com.xyz" />
-
-			<bus busid="server1-jms">
-				<property name="destination-type" value="queue" />
-				<property name="destination-name" value="queue/A" />
-				<property name="message-selector" value="service='Reconciliation'" />
-			</bus>
-		</provider>
-		
-		<provider name="FTP">
-			<property name="URL" value="ftp://joe:secret@localhost:21/Temp" />
-
-			<bus busid="Ftp-ServerTest">
-				<property name="inputSuffix" value=".txt" />
-				<property name="errorDelete" value="true" />
-				<property name="postDelete" value="true" />
-				<property name="passive" value="false" />
-				<property name="workSuffix" value=".esbInProcess" />
-			</bus>
-		</provider>
-		
-		<provider name="HSQLDB">
-			<property name="URL" value="jdbc:postgresql://myhost:5432/testDB" />
-			<property name="driver" value="org.postgresql.Driver" />
-			<property name="username" value="joe" />
-			<property name="password" value="secret" />
-			
-			<bus busid="SQL-Test">
-				<property name="tablename" value="testtable" />
-
-				<property name="tablename" value="testtable" />
-				<property name="message_column" value="message" />
-				<property name="message_id_column" value="message_id" />
-				<property name="status_column" value="status" />
-				<property name="errorDelete" value="true" />
-				<property name="insert_timestamp_column" value="insert_timestamp" />
-				<property name="postDelete" value="true" />
-			</bus>
-		</provider>
-
-        <provider name="JBR">
-            <property name="jbr-serverBindAddress" value="192.168.1.111" />
-            <property name="jbr-serverProtocol" value="http" />
-
-            <bus busid="HTTP-1">
-                <property name="jbr-serverBindPort" value="8765" />
-            </bus>
-            <bus busid="HTTP-2">
-                <property name="jbr-serverBindPort" value="8766" />
-            </bus>
-        </provider>
-
-        <provider name="JBossAS">
-			<property name="my-generic-provider" value="my-generic-provider#someattribvalue" />
-			
-			<bus busid="my-generic-bus">
-				<property name="my-generic-bus" value="my-generic-bus#someattribvalue" />
-			</bus>
-		</provider>
-
-	</providers>
-	<services>    
-		<service category="Bank" name="Reconciliation" description="Bank Reconciliation Service">
-		
-			<listeners>
-				<listener name="Bank-JMS-Gateway"
-					busidref="server1-jms"
-					maxThreads="1"
-					is-gateway="true">
-					<property name="gatewayClass" value="org.jboss.soa.esb.listeners.gateway.JmsGatewayListener" />
-				</listener> 	    
-                <listener name="Bank-HTTP-Gateway"
-                    busidref="HTTP-1"
-                    maxThreads="1"
-                    is-gateway="true">
-                    <property name="gatewayClass" value="org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener" />
-                </listener>
-				<listener name="Bank-Listener"
-							busidref="local-jms"
-							maxThreads="2">
-				</listener>
-				<listener name="Bank-Listener-Generic" 
-							busidref="my-generic-bus"
-							maxThreads="2">
-					<property name="my-generic-listener" value="my-generic-listener#someattribvalue" />
-				</listener>
-			</listeners>    	
-			  
-			<actions>    	    
-				<action name="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter">
-					<property name="propName" value="propValue" />
-					<property name="propName">
-						This is some complex..
-						<!-- property -->
-						value.
-						<xxxx>
-							boooo
-							<yyyy/>
-						</xxxx>
-						<![CDATA[ Some CDATA data...]]>
-					</property>
-				</action>
-			</actions>
-			
-		</service>
-		<service category="Test2" name="FTPTest" description="FTP server Test">
-		
-			<listeners>    	    
-				<listener name="test-ftp-listener"
-							busidref="Ftp-ServerTest"
-							maxThreads="1">
-							<property name="pollLatencySeconds" value="10" />
-				</listener>
-			</listeners>
-			<actions>    	    
-				<action name="TestFtpRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
-			</actions> 	
-			
-		</service>
-		<service category="Test3" name="SQLTest" description="SQL server Test" is-gateway="false">
-		
-			<listeners>    	    
-				<listener name="test-sql-listener"
-							busidref="SQL-Test"
-							maxThreads="1">
-							<property name="pollLatencySeconds" value="10" />
-				</listener>
-			</listeners>
-			<actions>    	    
-				<action name="TestSqlRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
-			</actions> 	
-			
-		</service>
-	</services>
-	
-</jbossesb>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_02.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,156 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+	<providers>
+		<provider name="JBossMQ">
+			<property name="connection-factory" value="ConnectionFactory" />
+			<property name="jndi-URL" value="jnp://localhost:1099" />
+			<property name="protocol" value="jms" />
+			
+			<bus busid="local-jms">
+				<property name="destination-type" value="topic" />
+				<property name="destination-name" value="queue/B" />
+				<property name="message-selector" value="service='Reconciliation'" />
+			</bus>
+		</provider>
+		
+		<provider name="JBossMessaging">
+			<property name="connection-factory" value="com.xyz.provider.XYZConnectionFactory" />
+			<property name="jndi-context-factory" value="com.xyz.provider.NamingContextFactory" />
+			<property name="jndi-URL" value="xyz://server1:9876" />
+			<property name="jndi-pkg-prefix" value="com.xyz" />
+
+			<bus busid="server1-jms">
+				<property name="destination-type" value="queue" />
+				<property name="destination-name" value="queue/A" />
+				<property name="message-selector" value="service='Reconciliation'" />
+			</bus>
+		</provider>
+		
+		<provider name="FTP">
+			<property name="URL" value="ftp://joe:secret@localhost:21/Temp" />
+
+			<bus busid="Ftp-ServerTest">
+				<property name="inputSuffix" value=".txt" />
+				<property name="errorDelete" value="true" />
+				<property name="postDelete" value="true" />
+				<property name="passive" value="false" />
+				<property name="workSuffix" value=".esbInProcess" />
+			</bus>
+		</provider>
+		
+		<provider name="HSQLDB">
+			<property name="URL" value="jdbc:postgresql://myhost:5432/testDB" />
+			<property name="driver" value="org.postgresql.Driver" />
+			<property name="username" value="joe" />
+			<property name="password" value="secret" />
+			
+			<bus busid="SQL-Test">
+				<property name="tablename" value="testtable" />
+
+				<property name="tablename" value="testtable" />
+				<property name="message_column" value="message" />
+				<property name="message_id_column" value="message_id" />
+				<property name="status_column" value="status" />
+				<property name="errorDelete" value="true" />
+				<property name="insert_timestamp_column" value="insert_timestamp" />
+				<property name="postDelete" value="true" />
+			</bus>
+		</provider>
+
+        <provider name="JBR">
+            <property name="jbr-serverBindAddress" value="192.168.1.111" />
+            <property name="jbr-serverProtocol" value="http" />
+
+            <bus busid="HTTP-1">
+                <property name="jbr-serverBindPort" value="8765" />
+            </bus>
+            <bus busid="HTTP-2">
+                <property name="jbr-serverBindPort" value="8766" />
+            </bus>
+        </provider>
+
+        <provider name="JBossAS">
+			<property name="my-generic-provider" value="my-generic-provider#someattribvalue" />
+			
+			<bus busid="my-generic-bus">
+				<property name="my-generic-bus" value="my-generic-bus#someattribvalue" />
+			</bus>
+		</provider>
+
+	</providers>
+	<services>    
+		<service category="Bank" name="Reconciliation" description="Bank Reconciliation Service">
+		
+			<listeners>
+				<listener name="Bank-JMS-Gateway"
+					busidref="server1-jms"
+					maxThreads="1"
+					is-gateway="true">
+					<property name="gatewayClass" value="org.jboss.soa.esb.listeners.gateway.JmsGatewayListener" />
+				</listener> 	    
+                <listener name="Bank-HTTP-Gateway"
+                    busidref="HTTP-1"
+                    maxThreads="1"
+                    is-gateway="true">
+                    <property name="gatewayClass" value="org.jboss.soa.esb.listeners.gateway.JBossRemotingGatewayListener" />
+                </listener>
+				<listener name="Bank-Listener"
+							busidref="local-jms"
+							maxThreads="2">
+				</listener>
+				<listener name="Bank-Listener-Generic" 
+							busidref="my-generic-bus"
+							maxThreads="2">
+					<property name="my-generic-listener" value="my-generic-listener#someattribvalue" />
+				</listener>
+			</listeners>    	
+			  
+			<actions>    	    
+				<action name="TestDefaultRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter">
+					<property name="propName" value="propValue" />
+					<property name="propName">
+						This is some complex..
+						<!-- property -->
+						value.
+						<xxxx>
+							boooo
+							<yyyy/>
+						</xxxx>
+						<![CDATA[ Some CDATA data...]]>
+					</property>
+				</action>
+			</actions>
+			
+		</service>
+		<service category="Test2" name="FTPTest" description="FTP server Test">
+		
+			<listeners>    	    
+				<listener name="test-ftp-listener"
+							busidref="Ftp-ServerTest"
+							maxThreads="1">
+							<property name="pollLatencySeconds" value="10" />
+				</listener>
+			</listeners>
+			<actions>    	    
+				<action name="TestFtpRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+			</actions> 	
+			
+		</service>
+		<service category="Test3" name="SQLTest" description="SQL server Test" is-gateway="false">
+		
+			<listeners>    	    
+				<listener name="test-sql-listener"
+							busidref="SQL-Test"
+							maxThreads="1">
+							<property name="pollLatencySeconds" value="10" />
+				</listener>
+			</listeners>
+			<actions>    	    
+				<action name="TestSqlRouteAction" class="org.jboss.soa.esb.actions.ContentBasedRouter"/>
+			</actions> 	
+			
+		</service>
+	</services>
+	
+</jbossesb>

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,43 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" >
-
-	<!-- 
-		This is a bad configuration.  The listener below is of the base listener type, yet it references a non-base type bus (jms-bus).
-		Should generate an error.
-	-->
-
-    <providers>
-          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
-                      jndi-context-factory="org.jnp.interfaces.NamingContextFactory "
-                      jndi-URL="localhost" >
-                      
-              <jms-bus busid="quickstartEsbChannel">
-                  <jms-message-filter
-                      dest-type="QUEUE"
-                      dest-name="queue/B"
-                  />
-              </jms-bus>
-
-          </jms-provider>
-      </providers>
-      
-      <services>
-          
-        <service category="HelloWorld_ActionESB" name="SimpleListener" description="Hello World">
-            <listeners>
-                <listener name="JMS-ESBListener"
-                              busidref="quickstartEsbChannel"
-                              maxThreads="1"
-                />                
-            </listeners>
-            <actions>
-               <action name="displayAction" 
-               		class="org.jboss.soa.esb.samples.quickstart.helloworldaction.MyJMSListenerAction" 
-               		process="displayMessage">
-               		<property name="exceptionMethod" value="exceptionHandler"/>
-               </action>
-            </actions>
-        </service>
-      </services>
-     
-</jbossesb>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_03.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,43 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd" >
+
+	<!-- 
+		This is a bad configuration.  The listener below is of the base listener type, yet it references a non-base type bus (jms-bus).
+		Should generate an error.
+	-->
+
+    <providers>
+          <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
+                      jndi-context-factory="org.jnp.interfaces.NamingContextFactory "
+                      jndi-URL="localhost" >
+                      
+              <jms-bus busid="quickstartEsbChannel">
+                  <jms-message-filter
+                      dest-type="QUEUE"
+                      dest-name="queue/B"
+                  />
+              </jms-bus>
+
+          </jms-provider>
+      </providers>
+      
+      <services>
+          
+        <service category="HelloWorld_ActionESB" name="SimpleListener" description="Hello World">
+            <listeners>
+                <listener name="JMS-ESBListener"
+                              busidref="quickstartEsbChannel"
+                              maxThreads="1"
+                />                
+            </listeners>
+            <actions>
+               <action name="displayAction" 
+               		class="org.jboss.soa.esb.samples.quickstart.helloworldaction.MyJMSListenerAction" 
+               		process="displayMessage">
+               		<property name="exceptionMethod" value="exceptionHandler"/>
+               </action>
+            </actions>
+        </service>
+      </services>
+     
+</jbossesb>

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,40 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
-
-	<providers>
-
-        <jbr-provider name="JBR" host="192.168.1.111" protocol="http">
-            <jbr-bus busid="HTTP-1" port="8765" />
-        </jbr-provider>
-
-	</providers>
-	<services>
-
-        <service category="A" name="1" description="A1">
-			<listeners>
-                <jbr-listener name="A1-HTTP"
-                    busidref="HTTP-1"
-                    maxThreads="1"
-                    is-gateway="true"/>
-			</listeners>
-			  
-			<actions>    	    
-				<action name="a1" class="org.jboss.soa.esb.actions.converters.ByteArrayToString" />
-			</actions>
-		</service>
-        <service category="B" name="2" description="A1">
-			<listeners>
-                <jbr-listener name="A1-HTTP"
-                    busidref="HTTP-1"
-                    maxThreads="1"
-                    is-gateway="true"/>
-			</listeners>
-
-			<actions>
-				<action name="a1" class="org.jboss.soa.esb.actions.converters.ByteArrayToString" />
-			</actions>
-		</service>
-
-    </services>
-	
-</jbossesb>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_04.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,40 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+	<providers>
+
+        <jbr-provider name="JBR" host="192.168.1.111" protocol="http">
+            <jbr-bus busid="HTTP-1" port="8765" />
+        </jbr-provider>
+
+	</providers>
+	<services>
+
+        <service category="A" name="1" description="A1">
+			<listeners>
+                <jbr-listener name="A1-HTTP"
+                    busidref="HTTP-1"
+                    maxThreads="1"
+                    is-gateway="true"/>
+			</listeners>
+			  
+			<actions>    	    
+				<action name="a1" class="org.jboss.soa.esb.actions.converters.ByteArrayToString" />
+			</actions>
+		</service>
+        <service category="B" name="2" description="A1">
+			<listeners>
+                <jbr-listener name="A1-HTTP"
+                    busidref="HTTP-1"
+                    maxThreads="1"
+                    is-gateway="true"/>
+			</listeners>
+
+			<actions>
+				<action name="a1" class="org.jboss.soa.esb.actions.converters.ByteArrayToString" />
+			</actions>
+		</service>
+
+    </services>
+	
+</jbossesb>
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,40 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
-
-	<providers>
-
-        <jbr-provider name="JBR" host="192.168.1.111" protocol="http">
-            <jbr-bus busid="HTTP-1" port="8765" />
-        </jbr-provider>
-
-	</providers>
-	<services>
-
-        <service category="C" name="3" description="A1">
-			<listeners>
-                <jbr-listener name="A1-HTTP"
-                    busidref="HTTP-1"
-                    maxThreads="1"
-                    is-gateway="true"/>
-			</listeners>
-			  
-			<actions>    	    
-				<action name="a1" class="org.jboss.soa.esb.actions.converters.ByteArrayToString" />
-			</actions>
-		</service>
-        <service category="D" name="4" description="A1">
-			<listeners>
-                <jbr-listener name="A1-HTTP"
-                    busidref="HTTP-1"
-                    maxThreads="1"
-                    is-gateway="true"/>
-			</listeners>
-
-			<actions>
-				<action name="a1" class="org.jboss.soa.esb.listeners.config.MyPublishedAction" />
-			</actions>
-		</service>
-
-    </services>
-	
-</jbossesb>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/jbossesb_config_05.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,40 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+	<providers>
+
+        <jbr-provider name="JBR" host="192.168.1.111" protocol="http">
+            <jbr-bus busid="HTTP-1" port="8765" />
+        </jbr-provider>
+
+	</providers>
+	<services>
+
+        <service category="C" name="3" description="A1">
+			<listeners>
+                <jbr-listener name="A1-HTTP"
+                    busidref="HTTP-1"
+                    maxThreads="1"
+                    is-gateway="true"/>
+			</listeners>
+			  
+			<actions>    	    
+				<action name="a1" class="org.jboss.soa.esb.actions.converters.ByteArrayToString" />
+			</actions>
+		</service>
+        <service category="D" name="4" description="A1">
+			<listeners>
+                <jbr-listener name="A1-HTTP"
+                    busidref="HTTP-1"
+                    maxThreads="1"
+                    is-gateway="true"/>
+			</listeners>
+
+			<actions>
+				<action name="a1" class="org.jboss.soa.esb.listeners.config.MyPublishedAction" />
+			</actions>
+		</service>
+
+    </services>
+	
+</jbossesb>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapperTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapperTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapperTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,125 +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.config.mappers;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.List;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.listeners.config.Generator;
-import org.jboss.soa.esb.listeners.config.Listener;
-import org.jboss.soa.esb.listeners.config.FtpBusDocument.FtpBus;
-import org.jboss.soa.esb.listeners.config.FtpListenerDocument.FtpListener;
-import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
-import org.jboss.soa.esb.listeners.gateway.ReadOnlyRemoteGatewayListener;
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.Node;
-
-/**
- * Tests the class FtpListenerMapper 
- * 
- * @author Daniel Bevenius
- *
- */
-public class FtpListenerMapperTest
-{
-	@SuppressWarnings("unused")
-	private Logger log = Logger.getLogger(FtpListenerMapperTest.class);
-	
-	private static final String ESB_CONFIG_READ_ONLY = "jbossesb_config_readonly.xml";
-	
-	private static final String GATEWAY_CLASS_ATTRIBUTE = "gatewayClass";
-		
-	@Test
-	public void testReadOnlyConfiguration() throws ConfigurationException, IOException
-	{
-		Element root = createRootElement();
-		XMLBeansModel model = getXmlBeanModel( ESB_CONFIG_READ_ONLY );
-		
-		List<Listener> gateways = model.getGatewayListeners();
-		FtpListener ftpListener = (FtpListener) gateways.get(0);
-		assertEquals ( true, ftpListener.getIsGateway() );
-		
-		FtpBus ftpBus = (FtpBus) model.getBus( ftpListener.getBusidref() );
-		assertNotNull( "FtpBus element should exist", ftpBus );
-		assertEquals ( "read-only attribute should be true", true, ftpBus.getFtpMessageFilter().getReadOnly() );
-		
-		FtpListenerMapper.map( root , ftpListener, model );
-		
-		Node ftpMapperListener = root.getFirstChild();
-		assertNotNull ("ftpMapperListener should not be null", ftpMapperListener ); 
-		assertEquals( ftpListener.getName(), ftpMapperListener.getNodeName() );
-		
-		NamedNodeMap attributes = ftpMapperListener.getAttributes();
-		Node gatewayClass = attributes.getNamedItem( GATEWAY_CLASS_ATTRIBUTE );
-		assertNotNull( "gatewayClass should have been set", gatewayClass );
-		assertEquals( ReadOnlyRemoteGatewayListener.class.getName(), gatewayClass.getNodeValue() );
-	}
-	
-	private XMLBeansModel getXmlBeanModel( String fileName ) throws ConfigurationException, IOException
-	{
-		InputStream inputStream = getClass().getResourceAsStream( ESB_CONFIG_READ_ONLY );
-		GeneratorMock mock = new GeneratorMock( inputStream );
-		XMLBeansModel model = mock.getModel();
-		return model;
-	}
-	
-	private Element createRootElement() throws ConfigurationException
-	{
-		Document doc = YADOMUtil.createDocument();
-		Element root = YADOMUtil.addElement(doc, "jbossesb-gateways");
-		root.setAttribute("parameterReloadSecs", "1000" );
-		return root;
-	}
-	
-	
-	/**
-	 * Just here to get proved access to the XMLBeansModel
-	 *
-	 */
-	private class GeneratorMock extends Generator
-	{
-
-		public GeneratorMock(InputStream config) throws ConfigurationException, IOException
-		{
-			super( config );
-		}
-
-		@Override
-		protected XMLBeansModel getModel()
-		{
-			return super.getModel();
-		}
-		
-		
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapperTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapperTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapperTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/FtpListenerMapperTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,125 @@
+/*
+ * 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.config.mappers;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.listeners.config.Generator;
+import org.jboss.soa.esb.listeners.config.Listener;
+import org.jboss.soa.esb.listeners.config.FtpBusDocument.FtpBus;
+import org.jboss.soa.esb.listeners.config.FtpListenerDocument.FtpListener;
+import org.jboss.soa.esb.listeners.config.Generator.XMLBeansModel;
+import org.jboss.soa.esb.listeners.gateway.ReadOnlyRemoteGatewayListener;
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.Node;
+
+/**
+ * Tests the class FtpListenerMapper 
+ * 
+ * @author Daniel Bevenius
+ *
+ */
+public class FtpListenerMapperTest
+{
+	@SuppressWarnings("unused")
+	private Logger log = Logger.getLogger(FtpListenerMapperTest.class);
+	
+	private static final String ESB_CONFIG_READ_ONLY = "jbossesb_config_readonly.xml";
+	
+	private static final String GATEWAY_CLASS_ATTRIBUTE = "gatewayClass";
+		
+	@Test
+	public void testReadOnlyConfiguration() throws ConfigurationException, IOException
+	{
+		Element root = createRootElement();
+		XMLBeansModel model = getXmlBeanModel( ESB_CONFIG_READ_ONLY );
+		
+		List<Listener> gateways = model.getGatewayListeners();
+		FtpListener ftpListener = (FtpListener) gateways.get(0);
+		assertEquals ( true, ftpListener.getIsGateway() );
+		
+		FtpBus ftpBus = (FtpBus) model.getBus( ftpListener.getBusidref() );
+		assertNotNull( "FtpBus element should exist", ftpBus );
+		assertEquals ( "read-only attribute should be true", true, ftpBus.getFtpMessageFilter().getReadOnly() );
+		
+		FtpListenerMapper.map( root , ftpListener, model );
+		
+		Node ftpMapperListener = root.getFirstChild();
+		assertNotNull ("ftpMapperListener should not be null", ftpMapperListener ); 
+		assertEquals( ftpListener.getName(), ftpMapperListener.getNodeName() );
+		
+		NamedNodeMap attributes = ftpMapperListener.getAttributes();
+		Node gatewayClass = attributes.getNamedItem( GATEWAY_CLASS_ATTRIBUTE );
+		assertNotNull( "gatewayClass should have been set", gatewayClass );
+		assertEquals( ReadOnlyRemoteGatewayListener.class.getName(), gatewayClass.getNodeValue() );
+	}
+	
+	private XMLBeansModel getXmlBeanModel( String fileName ) throws ConfigurationException, IOException
+	{
+		InputStream inputStream = getClass().getResourceAsStream( ESB_CONFIG_READ_ONLY );
+		GeneratorMock mock = new GeneratorMock( inputStream );
+		XMLBeansModel model = mock.getModel();
+		return model;
+	}
+	
+	private Element createRootElement() throws ConfigurationException
+	{
+		Document doc = YADOMUtil.createDocument();
+		Element root = YADOMUtil.addElement(doc, "jbossesb-gateways");
+		root.setAttribute("parameterReloadSecs", "1000" );
+		return root;
+	}
+	
+	
+	/**
+	 * Just here to get proved access to the XMLBeansModel
+	 *
+	 */
+	private class GeneratorMock extends Generator
+	{
+
+		public GeneratorMock(InputStream config) throws ConfigurationException, IOException
+		{
+			super( config );
+		}
+
+		@Override
+		protected XMLBeansModel getModel()
+		{
+			return super.getModel();
+		}
+		
+		
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_01.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_01.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,25 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
-
-	<providers>
-		
-		<ftp-provider name="FTP" hostname="localhost:21">
-			<ftp-bus busid="FtpMapperTest">
-				<ftp-message-filter directory="/Temp" read-only="true" input-suffix=".txt" username="joe" password="secret"/>
-			</ftp-bus>
-		</ftp-provider>
-		
-	</providers>
-	<services>    
-		<service category="Test2" name="FTPTest" description="FTP server Test">
-			
-			<listeners>    	    
-				<ftp-listener name="FtpMapperListener"
-							busidref="FtpMapperTest"
-							is-gateway="true"
-							maxThreads="1"/>
-			</listeners>
-		</service>
-	</services>
-	
-</jbossesb>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_01.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_01.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_01.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,25 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+	<providers>
+		
+		<ftp-provider name="FTP" hostname="localhost:21">
+			<ftp-bus busid="FtpMapperTest">
+				<ftp-message-filter directory="/Temp" read-only="true" input-suffix=".txt" username="joe" password="secret"/>
+			</ftp-bus>
+		</ftp-provider>
+		
+	</providers>
+	<services>    
+		<service category="Test2" name="FTPTest" description="FTP server Test">
+			
+			<listeners>    	    
+				<ftp-listener name="FtpMapperListener"
+							busidref="FtpMapperTest"
+							is-gateway="true"
+							maxThreads="1"/>
+			</listeners>
+		</service>
+	</services>
+	
+</jbossesb>

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_readonly.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_readonly.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_readonly.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,25 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
-
-	<providers>
-		
-		<ftp-provider name="FTP" hostname="localhost:21">
-			<ftp-bus busid="FtpMapperTest">
-				<ftp-message-filter directory="/Temp" read-only="true" input-suffix=".txt" username="joe" password="secret"/>
-			</ftp-bus>
-		</ftp-provider>
-		
-	</providers>
-	<services>    
-		<service category="Test2" name="FTPTest" description="FTP server Test">
-			
-			<listeners>    	    
-				<ftp-listener name="FtpMapperListener"
-							busidref="FtpMapperTest"
-							is-gateway="true"
-							maxThreads="1"/>
-			</listeners>
-		</service>
-	</services>
-	
-</jbossesb>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_readonly.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_readonly.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_readonly.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/config/mappers/jbossesb_config_readonly.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,25 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+	<providers>
+		
+		<ftp-provider name="FTP" hostname="localhost:21">
+			<ftp-bus busid="FtpMapperTest">
+				<ftp-message-filter directory="/Temp" read-only="true" input-suffix=".txt" username="joe" password="secret"/>
+			</ftp-bus>
+		</ftp-provider>
+		
+	</providers>
+	<services>    
+		<service category="Test2" name="FTPTest" description="FTP server Test">
+			
+			<listeners>    	    
+				<ftp-listener name="FtpMapperListener"
+							busidref="FtpMapperTest"
+							is-gateway="true"
+							maxThreads="1"/>
+			</listeners>
+		</service>
+	</services>
+	
+</jbossesb>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,224 +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.gateway;
-
-import java.io.File;
-import java.io.FileOutputStream;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.gateway.FileGatewayListener.PackageFileContents;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-
-public class FileGatewayListenerUnitTest extends BaseTest
-{
-	private Logger log = Logger.getLogger( FileGatewayListenerUnitTest.class );
-	
-	public FileGatewayListenerUnitTest ()
-	{
-	}
-	
-	public void setUp()
-	{
-		MockRegistry.install();
-	}
-	
-	public void tearDown()
-	{
-		MockRegistry.uninstall();
-	}
-
-	public void testGateway () throws Exception
-	{
-		ConfigTree tree = new ConfigTree("test");
-		final File tmpDir = new File(System.getProperty("user.dir")) ;
-		final String tmpDirForm = tmpDir.toURL().toExternalForm() ;
-
-		tree.setAttribute("inputDir", tmpDirForm);
-		tree.setAttribute("target-service-category", "Example");
-		tree.setAttribute("target-service-name", "Test");
-		tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.FileGatewayListener");
-		tree.setAttribute("inputSuffix", "dummy");
-		tree.setAttribute("workSuffix", "work");
-		tree.setAttribute("postDelete", "true");
-		tree.setAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG, "abcd");
-		
-		FileGatewayListener gateway = new FileGatewayListener(tree);
-		boolean exception = false;
-		
-		try
-		{
-			gateway.seeIfOkToWorkOnDir(new File("foobarDir"));
-		}
-		catch (GatewayException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		try
-		{
-			gateway.doInitialise();
-		}
-		catch (ManagedLifecycleException ex)
-		{
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			fail();
-		}
-		
-		exception = false;
-		
-		try
-		{
-			gateway.stop();
-		}
-		catch (ManagedLifecycleException ex)
-		{
-			exception = true;
-		}
-		catch (Exception ex)
-		{
-			fail();
-		}
-		
-		gateway.run();
-		
-		PackageFileContents f = gateway.new PackageFileContents();
-
-		exception = false;
-		
-		try
-		{
-			f.process(new File("hello"));
-		}
-		catch (GatewayException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		exception = false;
-		
-		try
-		{
-			f.process("hello");
-		}
-		catch (ConfigurationException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		File testFile = null;
-		File anTestFile = null;
-		
-		try
-		{
-			testFile = File.createTempFile("foo", "testFile");
-			
-			String testString = "Hello World";
-			FileOutputStream stream = new FileOutputStream(testFile);
-			
-			stream.write(testString.getBytes());
-			stream.close();
-			
-			f = gateway.new PackageFileContents();
-
-			f.process(testFile);
-			
-			File nFile = null;
-			
-			try
-			{
-				byte[] content = gateway.getFileContents(testFile);
-				String value = new String(content);
-				
-				if (!value.equals(testString))
-					fail();
-				
-				if (!gateway.deleteFile(testFile))
-					fail();
-				
-				testFile = File.createTempFile("foo", "testFile",gateway._inputDirectory);
-				anTestFile = File.createTempFile("bar", "testFile",gateway._inputDirectory);				
-
-				tree.setAttribute("inputSuffix", "testFile");
-				gateway = new FileGatewayListener(tree);
-                File[] files = gateway.getFileList();
-				
-				if (files.length != 2)
-				{
-					for (int i = 0; i < files.length; i++)
-						System.err.println(files[i]);
-				
-					fail();	
-				}
-				
-				exception = false;
-				
-				nFile = new File("xyzzy");
-				
-				if (gateway.renameFile(anTestFile, nFile))
-				{
-					anTestFile = nFile;
-				}
-				else
-					fail();
-			}
-			catch (Exception ex)
-			{
-				fail();
-			}
-			finally
-			{
-				nFile.delete();
-			}
-		}
-		catch (Throwable ex)
-		{
-			log.error(ex);
-			
-			fail();
-		}
-		finally
-		{
-			testFile.delete();
-			anTestFile.delete();
-		}
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/FileGatewayListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,224 @@
+/*
+ * 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.gateway;
+
+import java.io.File;
+import java.io.FileOutputStream;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.gateway.FileGatewayListener.PackageFileContents;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+
+public class FileGatewayListenerUnitTest extends BaseTest
+{
+	private Logger log = Logger.getLogger( FileGatewayListenerUnitTest.class );
+	
+	public FileGatewayListenerUnitTest ()
+	{
+	}
+	
+	public void setUp()
+	{
+		MockRegistry.install();
+	}
+	
+	public void tearDown()
+	{
+		MockRegistry.uninstall();
+	}
+
+	public void testGateway () throws Exception
+	{
+		ConfigTree tree = new ConfigTree("test");
+		final File tmpDir = new File(System.getProperty("user.dir")) ;
+		final String tmpDirForm = tmpDir.toURL().toExternalForm() ;
+
+		tree.setAttribute("inputDir", tmpDirForm);
+		tree.setAttribute("target-service-category", "Example");
+		tree.setAttribute("target-service-name", "Test");
+		tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.FileGatewayListener");
+		tree.setAttribute("inputSuffix", "dummy");
+		tree.setAttribute("workSuffix", "work");
+		tree.setAttribute("postDelete", "true");
+		tree.setAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG, "abcd");
+		
+		FileGatewayListener gateway = new FileGatewayListener(tree);
+		boolean exception = false;
+		
+		try
+		{
+			gateway.seeIfOkToWorkOnDir(new File("foobarDir"));
+		}
+		catch (GatewayException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		try
+		{
+			gateway.doInitialise();
+		}
+		catch (ManagedLifecycleException ex)
+		{
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			fail();
+		}
+		
+		exception = false;
+		
+		try
+		{
+			gateway.stop();
+		}
+		catch (ManagedLifecycleException ex)
+		{
+			exception = true;
+		}
+		catch (Exception ex)
+		{
+			fail();
+		}
+		
+		gateway.run();
+		
+		PackageFileContents f = gateway.new PackageFileContents();
+
+		exception = false;
+		
+		try
+		{
+			f.process(new File("hello"));
+		}
+		catch (GatewayException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		exception = false;
+		
+		try
+		{
+			f.process("hello");
+		}
+		catch (ConfigurationException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		File testFile = null;
+		File anTestFile = null;
+		
+		try
+		{
+			testFile = File.createTempFile("foo", "testFile");
+			
+			String testString = "Hello World";
+			FileOutputStream stream = new FileOutputStream(testFile);
+			
+			stream.write(testString.getBytes());
+			stream.close();
+			
+			f = gateway.new PackageFileContents();
+
+			f.process(testFile);
+			
+			File nFile = null;
+			
+			try
+			{
+				byte[] content = gateway.getFileContents(testFile);
+				String value = new String(content);
+				
+				if (!value.equals(testString))
+					fail();
+				
+				if (!gateway.deleteFile(testFile))
+					fail();
+				
+				testFile = File.createTempFile("foo", "testFile",gateway._inputDirectory);
+				anTestFile = File.createTempFile("bar", "testFile",gateway._inputDirectory);				
+
+				tree.setAttribute("inputSuffix", "testFile");
+				gateway = new FileGatewayListener(tree);
+                File[] files = gateway.getFileList();
+				
+				if (files.length != 2)
+				{
+					for (int i = 0; i < files.length; i++)
+						System.err.println(files[i]);
+				
+					fail();	
+				}
+				
+				exception = false;
+				
+				nFile = new File("xyzzy");
+				
+				if (gateway.renameFile(anTestFile, nFile))
+				{
+					anTestFile = nFile;
+				}
+				else
+					fail();
+			}
+			catch (Exception ex)
+			{
+				fail();
+			}
+			finally
+			{
+				nFile.delete();
+			}
+		}
+		catch (Throwable ex)
+		{
+			log.error(ex);
+			
+			fail();
+		}
+		finally
+		{
+			testFile.delete();
+			anTestFile.delete();
+		}
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerBaseTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerBaseTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerBaseTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,143 +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.gateway;
-
-import java.io.File;
-import java.io.InputStream;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.Statement;
-import java.util.Properties;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-
-public class GatewayListenerControllerBaseTest extends BaseTest
-{
-	private static String mDbDriver;
-
-	private static String mDbUrl;
-
-	private static String mDbUsername;
-
-	private static String mDbPassword;
-
-	private static Connection con;
-
-	protected static final String TMP_DIR = System.getProperty("java.io.tmpdir");
-
-	protected static Logger _logger = Logger.getLogger(GatewayListenerControllerBaseTest.class);
-
-	protected void runBeforeAllTests()
-	{
-		try
-		{
-			TestEnvironmentUtil.setESBPropertiesFileToUse("product",
-					"../product");
-			// Set the juddi properties file in System so juddi will pick it up
-			// later and use the test values.
-			String juddiPropertiesFile = "/org/jboss/soa/esb/listeners/gateway/juddi-unittest.properties";
-			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
-			// Read this properties file to get the db connection string
-			Properties props = new Properties();
-			InputStream inStream = Class.class
-					.getResourceAsStream(juddiPropertiesFile);
-
-			props.load(inStream);
-			mDbDriver = props.getProperty("juddi.jdbcDriver");
-			mDbUrl = props.getProperty("juddi.jdbcUrl");
-			mDbUsername = props.getProperty("juddi.jdbcUsername");
-			mDbPassword = props.getProperty("juddi.jdbcPassword");
-
-			String database = "not tested yet";
-			if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
-			{
-				database = "hsqldb";
-				// Bring up hsql on default port 9001
-				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir(
-						"product", "../product")
-						+ "/build/hsqltestdb", "juddi");
-			}
-			else if ("com.mysql.jdbc.Driver".equals(mDbDriver))
-			{
-				database = "mysql";
-			} // add and test your own database..
-
-			// Get the registry-schema create scripts
-			String sqlDir = TestEnvironmentUtil.getUserDir("product",
-					"../product")
-					+ "/install/jUDDI-registry/sql/" + database + "/";
-			// Drop what is there now, if exists. We want to start fresh.
-			String sqlDropCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "drop_database.sql"));
-			String sqlCreateCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "create_database.sql"));
-			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "insert_publishers.sql"));
-
-			try
-			{
-				Class.forName(mDbDriver);
-			}
-			catch (Exception e)
-			{
-				log.error( "ERROR: failed to load " + database
-						+ " JDBC driver.", e);
-				return;
-			}
-			con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
-			Statement stmnt = con.createStatement();
-			stmnt.execute(sqlDropCmd);
-			stmnt.execute(sqlCreateCmd);
-			stmnt.execute(sqlInsertPubCmd);
-			stmnt.close();
-		}
-		catch (Throwable e)
-		{
-			log.error("We should stop testing, since we don't have a db.", e);
-			assertTrue(false);
-		}
-	}
-
-	protected final void runAfterAllTests()
-	{
-		try
-		{
-			Thread.sleep(1000);
-			Statement stmnt = con.createStatement();
-
-			stmnt.execute("SHUTDOWN");
-			stmnt.close();
-
-			con.close();
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerBaseTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerBaseTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerBaseTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GatewayListenerControllerBaseTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,143 @@
+/*
+ * 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.gateway;
+
+import java.io.File;
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.Statement;
+import java.util.Properties;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.testutils.FileUtil;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+
+public class GatewayListenerControllerBaseTest extends BaseTest
+{
+	private static String mDbDriver;
+
+	private static String mDbUrl;
+
+	private static String mDbUsername;
+
+	private static String mDbPassword;
+
+	private static Connection con;
+
+	protected static final String TMP_DIR = System.getProperty("java.io.tmpdir");
+
+	protected static Logger _logger = Logger.getLogger(GatewayListenerControllerBaseTest.class);
+
+	protected void runBeforeAllTests()
+	{
+		try
+		{
+			TestEnvironmentUtil.setESBPropertiesFileToUse("product",
+					"../product");
+			// Set the juddi properties file in System so juddi will pick it up
+			// later and use the test values.
+			String juddiPropertiesFile = "/org/jboss/soa/esb/listeners/gateway/juddi-unittest.properties";
+			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
+			// Read this properties file to get the db connection string
+			Properties props = new Properties();
+			InputStream inStream = Class.class
+					.getResourceAsStream(juddiPropertiesFile);
+
+			props.load(inStream);
+			mDbDriver = props.getProperty("juddi.jdbcDriver");
+			mDbUrl = props.getProperty("juddi.jdbcUrl");
+			mDbUsername = props.getProperty("juddi.jdbcUsername");
+			mDbPassword = props.getProperty("juddi.jdbcPassword");
+
+			String database = "not tested yet";
+			if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
+			{
+				database = "hsqldb";
+				// Bring up hsql on default port 9001
+				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir(
+						"product", "../product")
+						+ "/build/hsqltestdb", "juddi");
+			}
+			else if ("com.mysql.jdbc.Driver".equals(mDbDriver))
+			{
+				database = "mysql";
+			} // add and test your own database..
+
+			// Get the registry-schema create scripts
+			String sqlDir = TestEnvironmentUtil.getUserDir("product",
+					"../product")
+					+ "/install/jUDDI-registry/sql/" + database + "/";
+			// Drop what is there now, if exists. We want to start fresh.
+			String sqlDropCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "drop_database.sql"));
+			String sqlCreateCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "create_database.sql"));
+			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "insert_publishers.sql"));
+
+			try
+			{
+				Class.forName(mDbDriver);
+			}
+			catch (Exception e)
+			{
+				log.error( "ERROR: failed to load " + database
+						+ " JDBC driver.", e);
+				return;
+			}
+			con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
+			Statement stmnt = con.createStatement();
+			stmnt.execute(sqlDropCmd);
+			stmnt.execute(sqlCreateCmd);
+			stmnt.execute(sqlInsertPubCmd);
+			stmnt.close();
+		}
+		catch (Throwable e)
+		{
+			log.error("We should stop testing, since we don't have a db.", e);
+			assertTrue(false);
+		}
+	}
+
+	protected final void runAfterAllTests()
+	{
+		try
+		{
+			Thread.sleep(1000);
+			Statement stmnt = con.createStatement();
+
+			stmnt.execute("SHUTDOWN");
+			stmnt.close();
+
+			con.close();
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,122 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.gateway;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.MockCourier;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.message.BasicMessageComposer;
-import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
-import org.jboss.soa.esb.services.registry.RegistryException;
-
-/**
- * Tests for the Groovy Gateway.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class GroovyGatewayUnitTest extends TestCase {
-	
-	private Logger log = Logger.getLogger( GroovyGatewayUnitTest.class );
-
-    private MockCourier courier1;
-
-    protected void setUp() throws Exception {
-        MockCourierFactory.install();
-        MockRegistry.install();
-        courier1 = new MockCourier(true);
-        MockRegistry.register("x", "y", courier1);
-    }
-
-    protected void tearDown() throws Exception {
-        MockRegistry.uninstall();
-        MockCourierFactory.uninstall();
-    }
-
-    public void test() throws ConfigurationException, InterruptedException, ManagedLifecycleException {
-        ConfigTree config = new ConfigTree("<config/>");
-        final MockGroovyGateway groovyGateway;
-
-        config.setAttribute("script", "/org/jboss/soa/esb/listeners/gateway/testgateway.groovy");
-        groovyGateway = new MockGroovyGateway(config);
-
-        groovyGateway.doInitialise();
-        Thread thread = new Thread(new Runnable() {
-            public void run() {
-                groovyGateway.doRun();
-            }
-        });
-        thread.start();
-
-        Thread.sleep(2000);
-        assertTrue("Is already stopped", (courier1.message == null));
-        groovyGateway.stopped = true;
-        Thread.sleep(2000);
-        assertTrue("Is not stopped", (courier1.message != null));
-        assertEquals("Hi there!", ActionUtils.getTaskObject(courier1.message));
-    }
-
-    // TODO: Fix build such that it can pick up the scripts from the src folder.
-    public void x_test_prebundled() throws ConfigurationException {
-        ConfigTree config = new ConfigTree("<config/>");
-        @SuppressWarnings("unused")
-        GroovyGateway groovyGateway;
-
-        config.setAttribute("script", "MessageInjectionConsole");
-        groovyGateway = new GroovyGateway(config);
-
-        config.setAttribute("script", "MessageInjectionConsole.groovy");
-        groovyGateway = new GroovyGateway(config);
-    }
-
-    private class MockGroovyGateway extends GroovyGateway {
-        
-        private static final long serialVersionUID = 1L;
-        private boolean stopped = false;
-
-        protected MockGroovyGateway(ConfigTree config) throws ConfigurationException {
-            super(config);
-        }
-
-        protected UncomposedMessageDeliveryAdapter createDeliveryAdapter() throws ConfigurationException {
-            try {
-                return new UncomposedMessageDeliveryAdapter("x", "y", new BasicMessageComposer());
-            } catch (RegistryException e) {
-                fail(e.getMessage());
-            }
-            return null;
-        }
-
-        public boolean waitUntilStopped(final long terminationPeriod) {
-            try {
-                Thread.sleep(terminationPeriod);
-            } catch (InterruptedException e) {
-            	log.error(e);
-            }
-            return stopped;
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/GroovyGatewayUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,122 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.MockCourier;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.message.BasicMessageComposer;
+import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
+import org.jboss.soa.esb.services.registry.RegistryException;
+
+/**
+ * Tests for the Groovy Gateway.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class GroovyGatewayUnitTest extends TestCase {
+	
+	private Logger log = Logger.getLogger( GroovyGatewayUnitTest.class );
+
+    private MockCourier courier1;
+
+    protected void setUp() throws Exception {
+        MockCourierFactory.install();
+        MockRegistry.install();
+        courier1 = new MockCourier(true);
+        MockRegistry.register("x", "y", courier1);
+    }
+
+    protected void tearDown() throws Exception {
+        MockRegistry.uninstall();
+        MockCourierFactory.uninstall();
+    }
+
+    public void test() throws ConfigurationException, InterruptedException, ManagedLifecycleException {
+        ConfigTree config = new ConfigTree("<config/>");
+        final MockGroovyGateway groovyGateway;
+
+        config.setAttribute("script", "/org/jboss/soa/esb/listeners/gateway/testgateway.groovy");
+        groovyGateway = new MockGroovyGateway(config);
+
+        groovyGateway.doInitialise();
+        Thread thread = new Thread(new Runnable() {
+            public void run() {
+                groovyGateway.doRun();
+            }
+        });
+        thread.start();
+
+        Thread.sleep(2000);
+        assertTrue("Is already stopped", (courier1.message == null));
+        groovyGateway.stopped = true;
+        Thread.sleep(2000);
+        assertTrue("Is not stopped", (courier1.message != null));
+        assertEquals("Hi there!", ActionUtils.getTaskObject(courier1.message));
+    }
+
+    // TODO: Fix build such that it can pick up the scripts from the src folder.
+    public void x_test_prebundled() throws ConfigurationException {
+        ConfigTree config = new ConfigTree("<config/>");
+        @SuppressWarnings("unused")
+        GroovyGateway groovyGateway;
+
+        config.setAttribute("script", "MessageInjectionConsole");
+        groovyGateway = new GroovyGateway(config);
+
+        config.setAttribute("script", "MessageInjectionConsole.groovy");
+        groovyGateway = new GroovyGateway(config);
+    }
+
+    private class MockGroovyGateway extends GroovyGateway {
+        
+        private static final long serialVersionUID = 1L;
+        private boolean stopped = false;
+
+        protected MockGroovyGateway(ConfigTree config) throws ConfigurationException {
+            super(config);
+        }
+
+        protected UncomposedMessageDeliveryAdapter createDeliveryAdapter() throws ConfigurationException {
+            try {
+                return new UncomposedMessageDeliveryAdapter("x", "y", new BasicMessageComposer());
+            } catch (RegistryException e) {
+                fail(e.getMessage());
+            }
+            return null;
+        }
+
+        public boolean waitUntilStopped(final long terminationPeriod) {
+            try {
+                Thread.sleep(terminationPeriod);
+            } catch (InterruptedException e) {
+            	log.error(e);
+            }
+            return stopped;
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,261 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.gateway;
-
-import java.net.InetAddress;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.MockCourier;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.remoting.Client;
-import org.jboss.remoting.InvokerLocator;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.xml.sax.SAXException;
-
-/**
- * JBossRemotingGatewayListenerUnit unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class JBossRemotingGatewayListenerUnitTest extends TestCase {
-	private Logger log = Logger
-			.getLogger( JBossRemotingGatewayListenerUnitTest.class );
-
-    private JBossRemotingGatewayListener listener;
-
-    private MockCourier courier1;
-    private MockCourier courier2;
-    private EPR epr3 = new EPR();
-    private MockCourier courier3;
-
-    protected void setUp() throws Exception {
-        MockCourierFactory.install();
-        MockRegistry.install();
-
-        courier1 = new MockCourier(false); // Will fail
-        courier2 = new MockCourier(true);  // Will work
-        courier3 = new MockCourier(true);  // Will work
-        MockRegistry.register("cat", "servicex", courier1);
-        MockRegistry.register("cat", "servicex", courier2);
-        MockRegistry.register("cat", "servicex", epr3, courier3);
-     }
-
-    protected void tearDown() throws Exception {
-        MockRegistry.uninstall();
-        MockCourierFactory.uninstall();
-        stopServer();
-    }
-
-    public void test_config() throws SAXException {
-        test_config(null, "servicex", "http", "8888", "");
-        test_config("",   "servicex", "http", "8888", "");
-        test_config("cat", null,      "http", "8888", "");
-        test_config("cat", "",        "http", "8888", "");
-        test_config("cat", "servicex", null,  "8888", "");
-        test_config("cat", "servicex", "",    "8888", "");
-        test_config("cat", "servicex", "http", null,  "");
-        test_config("cat", "servicex", "http", "",    "");
-    }
-
-    public void test_lifecycle() throws SAXException, ConfigurationException, ManagedLifecycleException {
-        ConfigTree config = getConfig("cat", "servicex", "http", "8888");
-
-        listener = new JBossRemotingGatewayListener(config);
-
-        // try starting without initialising...
-        try {
-            listener.start();
-            fail("Expected ManagedLifecycleException");
-        } catch(ManagedLifecycleException e) {}
-
-        // Initialise...
-        listener.doInitialise();
-
-        // try initialising again...
-        try {
-            listener.doInitialise();
-            fail("Expected ManagedLifecycleException");
-        } catch(ManagedLifecycleException e) {}
-
-        // try stopping without starting...
-        try {
-            listener.stop();
-            fail("Expected ManagedLifecycleException");
-        } catch(ManagedLifecycleException e) {}
-
-        // Start...
-        listener.doStart();
-
-        // try starting again...
-        try {
-            listener.start();
-            fail("Expected ManagedLifecycleException");
-        } catch(ManagedLifecycleException e) {}
-
-        // Stop...
-        listener.doStop();
-
-        // try stopping again...
-        try {
-            listener.doStop();
-            fail("Expected ManagedLifecycleException");
-        } catch(ManagedLifecycleException e) {}
-
-        // Start and stop again...
-        listener.doStart();
-        assertTrue(listener.isStarted());
-        listener.doStop();
-        assertTrue(!listener.isStarted());
-    }
-
-    public void test_http_async() throws Throwable {
-        test_delivery("http", false);
-    }
-
-    public void x_test_http_sync() throws Throwable {
-        test_delivery("http", true);
-        System.out.println("Ho " + courier3);
-    }
-
-    public void test_socket_() throws Throwable {
-        test_delivery("socket", false);
-    }
-
-    public void test_delivery(String protocol, boolean synchronous) throws Throwable {
-        startServer(protocol, synchronous);
-        sendMessageToServer(protocol, protocol + "_payload");
-        stopServer();
-    }
-
-    public void x_test_profile() throws Throwable {
-        startServer("http", false);
-        for(int i = 0; i < 10000; i++) {
-            sendMessageToServer("http", "xxx_payload");
-            MockCourierFactory.resetCouriers();
-            Thread.sleep(50);
-        }
-        stopServer();
-    }
-
-    @SuppressWarnings("serial")
-    private void startServer(String protocol, boolean synchronous) throws SAXException, ConfigurationException, ManagedLifecycleException {
-        ConfigTree config = getConfig("cat", "servicex", protocol, "8888");
-
-        if(synchronous) {
-            listener = new JBossRemotingGatewayListener(config) {
-                protected UncomposedMessageDeliveryAdapter createDeliveryAdapter() throws ConfigurationException {
-                    try {
-                        return new UncomposedMessageDeliveryAdapter("cat", "servicex", new JBossRemotingMessageComposer()) {
-                            @SuppressWarnings("unused")
-                            protected EPR getReplyToAddress(EPR toEpr) throws ConfigurationException {
-                                return epr3;
-                            }
-                        };
-                    } catch (RegistryException e) {
-                        e.printStackTrace();
-                        fail(e.getMessage());
-                        return null;
-                    }
-                }
-            };
-        } else {
-            config.setAttribute("synchronous", "false");
-            listener = new JBossRemotingGatewayListener(config);
-        }
-
-        listener.doInitialise();
-        listener.doStart();
-    }
-
-    private void sendMessageToServer(String protocol, Object messagePayload) throws Throwable {
-        String locatorURI = protocol + "://" + InetAddress.getLocalHost().getHostName() + ":8888";
-        InvokerLocator locator = new InvokerLocator(locatorURI);
-        System.out.println("Calling remoting server with locator uri of: " + locatorURI);
-
-        Client remotingClient = null;
-        try {
-            remotingClient = new Client(locator);
-            remotingClient.connect();
-
-            // Make sure the courier doesn't have a payload beforehand...
-            assertEquals(null, courier2.message);
-
-            // Deliver the message to the listener...
-            Object response = remotingClient.invoke(messagePayload);
-            assertEquals("<ack/>", response);
-
-            // Make sure the courier payload after matches the input...
-            Object courierPayloadAfter = ActionUtils.getTaskObject(courier2.message);
-            assertEquals(messagePayload, courierPayloadAfter);
-        } finally {
-            if(remotingClient != null) {
-                remotingClient.disconnect();
-            }
-        }
-    }
-
-    private void stopServer() throws ManagedLifecycleException {
-        if(listener != null && listener.isStarted()) {
-            try {
-                listener.doStop();
-            } finally {
-                listener.doDestroy();
-            }
-        }
-    }
-
-    private ConfigTree getConfig(String category, String service, String protocol, String port) throws SAXException {
-        ConfigTree config = ConfigTree.fromXml("<listener/>");
-
-        config.setAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, category);
-        config.setAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG, service);
-        config.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PROTOCOL, protocol);
-        config.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PORT, port);
-        
-        return config;
-    }
-
-    private void test_config(String category, String service, String protocol, String port, String exception) throws SAXException {
-        ConfigTree config = getConfig(category, service, protocol, port);
-
-        try {
-            listener = new JBossRemotingGatewayListener(config);
-            listener.doInitialise();
-            fail("Expected a ManagedLifecycleException.");
-        } catch (ConfigurationException e) {
-        	log.error(e);
-            fail("Unexpected ConfigurationException. " + e.getMessage());
-        } catch (ManagedLifecycleException e) {
-            Throwable cause = e.getCause();
-
-            assertTrue(cause instanceof ConfigurationException);
-            assertTrue(cause.getMessage().startsWith(exception));
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JBossRemotingGatewayListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,261 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.gateway;
+
+import java.net.InetAddress;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.MockCourier;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.remoting.Client;
+import org.jboss.remoting.InvokerLocator;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.message.UncomposedMessageDeliveryAdapter;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.xml.sax.SAXException;
+
+/**
+ * JBossRemotingGatewayListenerUnit unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class JBossRemotingGatewayListenerUnitTest extends TestCase {
+	private Logger log = Logger
+			.getLogger( JBossRemotingGatewayListenerUnitTest.class );
+
+    private JBossRemotingGatewayListener listener;
+
+    private MockCourier courier1;
+    private MockCourier courier2;
+    private EPR epr3 = new EPR();
+    private MockCourier courier3;
+
+    protected void setUp() throws Exception {
+        MockCourierFactory.install();
+        MockRegistry.install();
+
+        courier1 = new MockCourier(false); // Will fail
+        courier2 = new MockCourier(true);  // Will work
+        courier3 = new MockCourier(true);  // Will work
+        MockRegistry.register("cat", "servicex", courier1);
+        MockRegistry.register("cat", "servicex", courier2);
+        MockRegistry.register("cat", "servicex", epr3, courier3);
+     }
+
+    protected void tearDown() throws Exception {
+        MockRegistry.uninstall();
+        MockCourierFactory.uninstall();
+        stopServer();
+    }
+
+    public void test_config() throws SAXException {
+        test_config(null, "servicex", "http", "8888", "");
+        test_config("",   "servicex", "http", "8888", "");
+        test_config("cat", null,      "http", "8888", "");
+        test_config("cat", "",        "http", "8888", "");
+        test_config("cat", "servicex", null,  "8888", "");
+        test_config("cat", "servicex", "",    "8888", "");
+        test_config("cat", "servicex", "http", null,  "");
+        test_config("cat", "servicex", "http", "",    "");
+    }
+
+    public void test_lifecycle() throws SAXException, ConfigurationException, ManagedLifecycleException {
+        ConfigTree config = getConfig("cat", "servicex", "http", "8888");
+
+        listener = new JBossRemotingGatewayListener(config);
+
+        // try starting without initialising...
+        try {
+            listener.start();
+            fail("Expected ManagedLifecycleException");
+        } catch(ManagedLifecycleException e) {}
+
+        // Initialise...
+        listener.doInitialise();
+
+        // try initialising again...
+        try {
+            listener.doInitialise();
+            fail("Expected ManagedLifecycleException");
+        } catch(ManagedLifecycleException e) {}
+
+        // try stopping without starting...
+        try {
+            listener.stop();
+            fail("Expected ManagedLifecycleException");
+        } catch(ManagedLifecycleException e) {}
+
+        // Start...
+        listener.doStart();
+
+        // try starting again...
+        try {
+            listener.start();
+            fail("Expected ManagedLifecycleException");
+        } catch(ManagedLifecycleException e) {}
+
+        // Stop...
+        listener.doStop();
+
+        // try stopping again...
+        try {
+            listener.doStop();
+            fail("Expected ManagedLifecycleException");
+        } catch(ManagedLifecycleException e) {}
+
+        // Start and stop again...
+        listener.doStart();
+        assertTrue(listener.isStarted());
+        listener.doStop();
+        assertTrue(!listener.isStarted());
+    }
+
+    public void test_http_async() throws Throwable {
+        test_delivery("http", false);
+    }
+
+    public void x_test_http_sync() throws Throwable {
+        test_delivery("http", true);
+        System.out.println("Ho " + courier3);
+    }
+
+    public void test_socket_() throws Throwable {
+        test_delivery("socket", false);
+    }
+
+    public void test_delivery(String protocol, boolean synchronous) throws Throwable {
+        startServer(protocol, synchronous);
+        sendMessageToServer(protocol, protocol + "_payload");
+        stopServer();
+    }
+
+    public void x_test_profile() throws Throwable {
+        startServer("http", false);
+        for(int i = 0; i < 10000; i++) {
+            sendMessageToServer("http", "xxx_payload");
+            MockCourierFactory.resetCouriers();
+            Thread.sleep(50);
+        }
+        stopServer();
+    }
+
+    @SuppressWarnings("serial")
+    private void startServer(String protocol, boolean synchronous) throws SAXException, ConfigurationException, ManagedLifecycleException {
+        ConfigTree config = getConfig("cat", "servicex", protocol, "8888");
+
+        if(synchronous) {
+            listener = new JBossRemotingGatewayListener(config) {
+                protected UncomposedMessageDeliveryAdapter createDeliveryAdapter() throws ConfigurationException {
+                    try {
+                        return new UncomposedMessageDeliveryAdapter("cat", "servicex", new JBossRemotingMessageComposer()) {
+                            @SuppressWarnings("unused")
+                            protected EPR getReplyToAddress(EPR toEpr) throws ConfigurationException {
+                                return epr3;
+                            }
+                        };
+                    } catch (RegistryException e) {
+                        e.printStackTrace();
+                        fail(e.getMessage());
+                        return null;
+                    }
+                }
+            };
+        } else {
+            config.setAttribute("synchronous", "false");
+            listener = new JBossRemotingGatewayListener(config);
+        }
+
+        listener.doInitialise();
+        listener.doStart();
+    }
+
+    private void sendMessageToServer(String protocol, Object messagePayload) throws Throwable {
+        String locatorURI = protocol + "://" + InetAddress.getLocalHost().getHostName() + ":8888";
+        InvokerLocator locator = new InvokerLocator(locatorURI);
+        System.out.println("Calling remoting server with locator uri of: " + locatorURI);
+
+        Client remotingClient = null;
+        try {
+            remotingClient = new Client(locator);
+            remotingClient.connect();
+
+            // Make sure the courier doesn't have a payload beforehand...
+            assertEquals(null, courier2.message);
+
+            // Deliver the message to the listener...
+            Object response = remotingClient.invoke(messagePayload);
+            assertEquals("<ack/>", response);
+
+            // Make sure the courier payload after matches the input...
+            Object courierPayloadAfter = ActionUtils.getTaskObject(courier2.message);
+            assertEquals(messagePayload, courierPayloadAfter);
+        } finally {
+            if(remotingClient != null) {
+                remotingClient.disconnect();
+            }
+        }
+    }
+
+    private void stopServer() throws ManagedLifecycleException {
+        if(listener != null && listener.isStarted()) {
+            try {
+                listener.doStop();
+            } finally {
+                listener.doDestroy();
+            }
+        }
+    }
+
+    private ConfigTree getConfig(String category, String service, String protocol, String port) throws SAXException {
+        ConfigTree config = ConfigTree.fromXml("<listener/>");
+
+        config.setAttribute(ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, category);
+        config.setAttribute(ListenerTagNames.TARGET_SERVICE_NAME_TAG, service);
+        config.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PROTOCOL, protocol);
+        config.setAttribute(JBossRemotingGatewayListener.JBR_SERVER_PORT, port);
+        
+        return config;
+    }
+
+    private void test_config(String category, String service, String protocol, String port, String exception) throws SAXException {
+        ConfigTree config = getConfig(category, service, protocol, port);
+
+        try {
+            listener = new JBossRemotingGatewayListener(config);
+            listener.doInitialise();
+            fail("Expected a ManagedLifecycleException.");
+        } catch (ConfigurationException e) {
+        	log.error(e);
+            fail("Unexpected ConfigurationException. " + e.getMessage());
+        } catch (ManagedLifecycleException e) {
+            Throwable cause = e.getCause();
+
+            assertTrue(cause instanceof ConfigurationException);
+            assertTrue(cause.getMessage().startsWith(exception));
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JMSGatewayListenerIntegrationTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JMSGatewayListenerIntegrationTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JMSGatewayListenerIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,86 +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.gateway;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-
-public class JMSGatewayListenerIntegrationTest extends BaseTest
-{
-	public JMSGatewayListenerIntegrationTest ()
-	{
-	}
-	
-	public void testGateway () throws Exception
-	{
-		ConfigTree tree = new ConfigTree("test");
-		tree.setAttribute("target-service-category", "Example");
-		tree.setAttribute("target-service-name", "Test");
-		tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.JmsGatewayListener");
-		
-		boolean exception = false;
-		JmsGatewayListener gateway = null;
-		
-		try
-		{
-			gateway = new JmsGatewayListener(tree);
-		}
-		catch (ConfigurationException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		tree.setAttribute(JMSEpr.DESTINATION_NAME_TAG, "testtest");
-		tree.setAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG, null);
-		
-		gateway = new JmsGatewayListener(tree);
-		
-		exception = false;
-		
-		try
-		{
-			gateway.doInitialise();
-		}
-		catch (ManagedLifecycleException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		gateway.doDestroy();
-		
-		gateway = new JmsGatewayListener(tree);
-		
-		gateway.resolveComposerClass();
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JMSGatewayListenerIntegrationTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JMSGatewayListenerIntegrationTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JMSGatewayListenerIntegrationTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/JMSGatewayListenerIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,86 @@
+/*
+ * 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.gateway;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+
+public class JMSGatewayListenerIntegrationTest extends BaseTest
+{
+	public JMSGatewayListenerIntegrationTest ()
+	{
+	}
+	
+	public void testGateway () throws Exception
+	{
+		ConfigTree tree = new ConfigTree("test");
+		tree.setAttribute("target-service-category", "Example");
+		tree.setAttribute("target-service-name", "Test");
+		tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.JmsGatewayListener");
+		
+		boolean exception = false;
+		JmsGatewayListener gateway = null;
+		
+		try
+		{
+			gateway = new JmsGatewayListener(tree);
+		}
+		catch (ConfigurationException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		tree.setAttribute(JMSEpr.DESTINATION_NAME_TAG, "testtest");
+		tree.setAttribute(ListenerTagNames.GATEWAY_COMPOSER_CLASS_TAG, null);
+		
+		gateway = new JmsGatewayListener(tree);
+		
+		exception = false;
+		
+		try
+		{
+			gateway.doInitialise();
+		}
+		catch (ManagedLifecycleException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		gateway.doDestroy();
+		
+		gateway = new JmsGatewayListener(tree);
+		
+		gateway.resolveComposerClass();
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,323 +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.gateway;
-
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.util.embedded.EmbeddableException;
-import org.jboss.internal.soa.esb.util.embedded.ftp.FtpTestUtil;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.gateway.remotestrategies.ReadOnlyRemoteFileSystemStrategy;
-import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.DeleteOnEvictTreeCacheListener;
-import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.FtpFileCacheTestUtil;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Unit test for ReadOnlyRemoteGatewayListener that uses an embedded ftp server.
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- *
- */
-public class ReadOnlyRemoteGatewayListenerUnitTest extends RemoteGatewayListenerUnitTest
-{
-	
-	@SuppressWarnings("unused")
-	private Logger log = Logger .getLogger( ReadOnlyRemoteGatewayListenerUnitTest.class );
-	
-	@BeforeClass
-	public static void classSetup() throws EmbeddableException, ConfigurationException, GatewayException, RegistryException, MalformedURLException
-	{
-		ftpServer = createFtpServer();
-		ftpServer.start();
-		
-		createWorkDirectories();
-		configTree = createConfigTree();
-		createRemoteGatewayListener( configTree );
-	}
-	
-	@Test
-	public void deleteFile() throws GatewayException 
-	{
-		File remoteFile = createAbsoluteFromFile();
-				
-		gatewayListener.deleteFile( remoteFile );
-		assertTrue( "Remote file was deleted which should not be possible!",  testFile.exists() );
-	}
-	
-	@Test
-	public void getFileListFromRemoteDir() throws GatewayException
-	{
-		File[] fileListFromRemoteDir = gatewayListener.getFileList();
-			
-		assertNotNull ( fileListFromRemoteDir );
-		assertTrue ( fileListFromRemoteDir.length > 0 );
-			
-		List<File> fileList = Arrays.asList( fileListFromRemoteDir );
-		assertTrue( "The test file was not included in the List! " , fileList.contains( new File ( testFile.getName() )  ));
-	}
-	
-	@Test ( timeout=3000 )
-	public void doRun_PostDir_Same_As_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException
-	{
-		setAbsoluteInputDir();
-		setAbsolutePostDirToInputDir();
-		boolean getCourierReturnValue = true;
-		
-		RemoteGatewayListenerMock mock = createAndStartListener ( configTree,  getCourierReturnValue );
-		
-		File inputDir =  ftpServer.getLocalInputDir();
-		String doneFileName = testFile.getName();
-		
-		waitForFile( inputDir, doneFileName );
-		stopdoRun( mock );
-		
-		File processedFile = new File ( inputDir,  doneFileName );
-		try
-		{
-			assertTrue ( processedFile.exists() );
-		}
-		finally
-		{
-			FtpTestUtil.deleteFile( processedFile );
-		}
-	}
-	
-	/**
-	 * This is a "negtive" test. It verifies that the file was not
-	 * renamed. The name of the method is kept so that it overrides 
-	 * the super classes method.
-	 */
-	@Test
-	public void renameFile_In_Same_Directory() throws GatewayException 
-	{ 
-		File from = createAbsoluteFromFile();
-		File to = createAbsoluteToFile();
-			
-		gatewayListener.renameFile( from, to );
-			
-		renamedFile = new File ( ftpServer.getLocalInputDir(), to.getName() );
-		assertFileExists( testFile );
-		assertFalse( renamedFile.exists() );
-	}
-	
-	@Test 
-	public void getNewInstanceNegative() 
-	{
-		ReadOnlyRemoteGatewayListener listener = (ReadOnlyRemoteGatewayListener) gatewayListener;
-		try
-		{
-			listener.getNewInstanceOf( null );
-			fail ( "an IllegalArgumentException should have been thrown" );
-		} 
-		catch ( Exception e)
-		{
-			assertTrue ( e instanceof IllegalArgumentException );
-		}
-		
-		try
-		{
-			listener.getNewInstanceOf( "some.package.class" );
-			fail ( "a ConfigurationException should have been thrown" );
-		} 
-		catch ( Exception e)
-		{
-			assertTrue ( e instanceof ConfigurationException );
-		}
-	}
-	
-	@Test 
-	public void getNewInstance() throws ConfigurationException
-	{
-		ReadOnlyRemoteGatewayListener listener = (ReadOnlyRemoteGatewayListener) gatewayListener;
-		ReadOnlyRemoteFileSystemStrategy instance = listener.getNewInstanceOf( ReadOnlyRemoteFileSystemStrategy.class.getName() );
-		assertNotNull( "The instance should not be null!", instance );
-	}
-	
-	/**
-	 * Not a valid test for this impl
-	 */
-	@Override
-	public void renameFile_In_Different_Directory() throws GatewayException { }
-	
-	/**
-	 * Not a valid test for this impl
-	 */
-	@Override
-	public void doRun_PostDir_Different_From_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException { }
-	
-	/**
-	 * Not a valid test for this impl
-	 */
-	@Override
-	public void doRun_Negative() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException {}
-	
-	/**
-	 * Override createConfigTree and add the ReadOnlyFileSystem strategy.
-	 * 
-	 * @return
-	 */
-	public static ConfigTree createConfigTree()
-	{
-		ConfigTree configTree = RemoteGatewayListenerUnitTest.createConfigTree();
-		configTree.setAttribute( ReadOnlyRemoteGatewayListener.REMOTE_FILE_SYSTEM_STRATEGY_CLASS, ReadOnlyRemoteFileSystemStrategy.class.getName() );
-		configTree.setAttribute( ReadOnlyRemoteGatewayListener.REMOTE_FILE_SYSTEM_STRATEGY_CONFIG_FILE, FtpFileCacheTestUtil.getCacheConfigFile() );
-		configTree.setAttribute( ReadOnlyRemoteGatewayListener.REMOTE_FILE_SYSTEM_STRATEGY_CACHE_LISTENER, DeleteOnEvictTreeCacheListener.class.getName() );
-		return configTree;
-	}
-	
-	protected static void createRemoteGatewayListener( ConfigTree configTree )
-	throws ConfigurationException, RegistryException, GatewayException
-	{
-		gatewayListener = new ReadOnlyRemoteGatewayListener( configTree );
-	}
-	
-	/**
-	 * Creates a RemoteGatewayListenerMock instance with the passed in arguments, and then starts
-	 * the ReadOnlyRemoteGatewayListener's doRun() method in a new Thread.
-	 * 
-	 * @param configTree The configTree to use to configure the RemoteGatewayListenerMock object
-	 * @param returnValueForCourier	the return value for the getCourier method of the RemoteGatewayListenerMock object
-	 * @return RemoteGatewayListenerMock Mock impl of a RemoteGatewayListener.
-	 */
-	protected RemoteGatewayListenerMock createAndStartListener ( ConfigTree configTree,  boolean returnValueForCourier ) throws ConfigurationException, GatewayException, RegistryException
-	{
-		final RemoteGatewayListenerMock mock = new RemoteGatewayListenerMock( configTree , returnValueForCourier );
-		mock.doInitialise();
-		
-		Thread thread = new Thread ( new Runnable ()  {
-			public void run()
-			{
-				mock.doRun();
-			}
-		});
-		thread.start();
-		
-		return mock;
-		
-	}
-	
-	protected void stopdoRun ( RemoteGatewayListenerMock mock )
-	{
-		if ( mock == null ) return;
-		try 
-		{
-			mock.stop();
-		}
-		catch ( Exception e )
-		{
-			if ( ! (e instanceof ManagedLifecycleException ) )
-				fail ( e.getMessage() );
-		}
-	}
-	
-	/**
-	 *  Mock impl of RemoteGatewayListener. 
-	 */
-	class RemoteGatewayListenerMock extends ReadOnlyRemoteGatewayListener
-	{
-		private static final long serialVersionUID = 1L;
-		
-		/* value that will be returned from the getCourier( EPR ) method */
-		private boolean returnValueForCourier;
-		
-		private boolean finishedOneRun;
-		
-		/**
-		 * Sole constructor
-		 * 
-		 * @param configTree						configTree used to configure this RemoteGatewayListener
-		 * @param returnValueForCourier	value to be returned from this objects getCourier( EPR ) method
-		 * 
-		 */
-		public RemoteGatewayListenerMock ( ConfigTree configTree, boolean returnValueForCourier) throws ConfigurationException, GatewayException, RegistryException
-		{
-			super ( configTree );
-			this.returnValueForCourier = returnValueForCourier;
-		}
-		
-		/**
-		 * Will return a Courier instance that returns the value of the
-		 * field returnValueForCourier.
-		 */
-		@Override
-		protected Courier getCourier( EPR current ) throws CourierException, MalformedEPRException
-		{
-			return new Courier() {
-				public boolean deliver( Message message ) throws CourierException, MalformedEPRException
-				{
-					return returnValueForCourier;
-				}
-				public void cleanup() { }
-			};
-		}
-		
-		@Override
-		protected void doInitialise() 
-		{ 
-			_targetEprs = new ArrayList<EPR>();
-			_targetEprs.add( new JMSEpr( new EPR() ) );
-		};
-		
-		@Override
-		protected boolean waitForRunningStateChange(final ManagedLifecycleThreadState state, final long terminationPeriod)
-		{
-			finishedOneRun = true;
-			return super.waitForRunningStateChange( state, terminationPeriod );
-		}
-		
-		public boolean hasFinishedOneRun()
-		{
-			return finishedOneRun;
-		}
-	}
-	
-	/*
-	 * Just here to help Ant to find annotated test.
-	 */
-	public static junit.framework.Test suite()
-	{
-		return new JUnit4TestAdapter( ReadOnlyRemoteGatewayListenerUnitTest.class);
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/ReadOnlyRemoteGatewayListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,323 @@
+/*
+ * 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.gateway;
+
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.embedded.EmbeddableException;
+import org.jboss.internal.soa.esb.util.embedded.ftp.FtpTestUtil;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.gateway.remotestrategies.ReadOnlyRemoteFileSystemStrategy;
+import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.DeleteOnEvictTreeCacheListener;
+import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.FtpFileCacheTestUtil;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Unit test for ReadOnlyRemoteGatewayListener that uses an embedded ftp server.
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ *
+ */
+public class ReadOnlyRemoteGatewayListenerUnitTest extends RemoteGatewayListenerUnitTest
+{
+	
+	@SuppressWarnings("unused")
+	private Logger log = Logger .getLogger( ReadOnlyRemoteGatewayListenerUnitTest.class );
+	
+	@BeforeClass
+	public static void classSetup() throws EmbeddableException, ConfigurationException, GatewayException, RegistryException, MalformedURLException
+	{
+		ftpServer = createFtpServer();
+		ftpServer.start();
+		
+		createWorkDirectories();
+		configTree = createConfigTree();
+		createRemoteGatewayListener( configTree );
+	}
+	
+	@Test
+	public void deleteFile() throws GatewayException 
+	{
+		File remoteFile = createAbsoluteFromFile();
+				
+		gatewayListener.deleteFile( remoteFile );
+		assertTrue( "Remote file was deleted which should not be possible!",  testFile.exists() );
+	}
+	
+	@Test
+	public void getFileListFromRemoteDir() throws GatewayException
+	{
+		File[] fileListFromRemoteDir = gatewayListener.getFileList();
+			
+		assertNotNull ( fileListFromRemoteDir );
+		assertTrue ( fileListFromRemoteDir.length > 0 );
+			
+		List<File> fileList = Arrays.asList( fileListFromRemoteDir );
+		assertTrue( "The test file was not included in the List! " , fileList.contains( new File ( testFile.getName() )  ));
+	}
+	
+	@Test ( timeout=3000 )
+	public void doRun_PostDir_Same_As_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException
+	{
+		setAbsoluteInputDir();
+		setAbsolutePostDirToInputDir();
+		boolean getCourierReturnValue = true;
+		
+		RemoteGatewayListenerMock mock = createAndStartListener ( configTree,  getCourierReturnValue );
+		
+		File inputDir =  ftpServer.getLocalInputDir();
+		String doneFileName = testFile.getName();
+		
+		waitForFile( inputDir, doneFileName );
+		stopdoRun( mock );
+		
+		File processedFile = new File ( inputDir,  doneFileName );
+		try
+		{
+			assertTrue ( processedFile.exists() );
+		}
+		finally
+		{
+			FtpTestUtil.deleteFile( processedFile );
+		}
+	}
+	
+	/**
+	 * This is a "negtive" test. It verifies that the file was not
+	 * renamed. The name of the method is kept so that it overrides 
+	 * the super classes method.
+	 */
+	@Test
+	public void renameFile_In_Same_Directory() throws GatewayException 
+	{ 
+		File from = createAbsoluteFromFile();
+		File to = createAbsoluteToFile();
+			
+		gatewayListener.renameFile( from, to );
+			
+		renamedFile = new File ( ftpServer.getLocalInputDir(), to.getName() );
+		assertFileExists( testFile );
+		assertFalse( renamedFile.exists() );
+	}
+	
+	@Test 
+	public void getNewInstanceNegative() 
+	{
+		ReadOnlyRemoteGatewayListener listener = (ReadOnlyRemoteGatewayListener) gatewayListener;
+		try
+		{
+			listener.getNewInstanceOf( null );
+			fail ( "an IllegalArgumentException should have been thrown" );
+		} 
+		catch ( Exception e)
+		{
+			assertTrue ( e instanceof IllegalArgumentException );
+		}
+		
+		try
+		{
+			listener.getNewInstanceOf( "some.package.class" );
+			fail ( "a ConfigurationException should have been thrown" );
+		} 
+		catch ( Exception e)
+		{
+			assertTrue ( e instanceof ConfigurationException );
+		}
+	}
+	
+	@Test 
+	public void getNewInstance() throws ConfigurationException
+	{
+		ReadOnlyRemoteGatewayListener listener = (ReadOnlyRemoteGatewayListener) gatewayListener;
+		ReadOnlyRemoteFileSystemStrategy instance = listener.getNewInstanceOf( ReadOnlyRemoteFileSystemStrategy.class.getName() );
+		assertNotNull( "The instance should not be null!", instance );
+	}
+	
+	/**
+	 * Not a valid test for this impl
+	 */
+	@Override
+	public void renameFile_In_Different_Directory() throws GatewayException { }
+	
+	/**
+	 * Not a valid test for this impl
+	 */
+	@Override
+	public void doRun_PostDir_Different_From_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException { }
+	
+	/**
+	 * Not a valid test for this impl
+	 */
+	@Override
+	public void doRun_Negative() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException {}
+	
+	/**
+	 * Override createConfigTree and add the ReadOnlyFileSystem strategy.
+	 * 
+	 * @return
+	 */
+	public static ConfigTree createConfigTree()
+	{
+		ConfigTree configTree = RemoteGatewayListenerUnitTest.createConfigTree();
+		configTree.setAttribute( ReadOnlyRemoteGatewayListener.REMOTE_FILE_SYSTEM_STRATEGY_CLASS, ReadOnlyRemoteFileSystemStrategy.class.getName() );
+		configTree.setAttribute( ReadOnlyRemoteGatewayListener.REMOTE_FILE_SYSTEM_STRATEGY_CONFIG_FILE, FtpFileCacheTestUtil.getCacheConfigFile() );
+		configTree.setAttribute( ReadOnlyRemoteGatewayListener.REMOTE_FILE_SYSTEM_STRATEGY_CACHE_LISTENER, DeleteOnEvictTreeCacheListener.class.getName() );
+		return configTree;
+	}
+	
+	protected static void createRemoteGatewayListener( ConfigTree configTree )
+	throws ConfigurationException, RegistryException, GatewayException
+	{
+		gatewayListener = new ReadOnlyRemoteGatewayListener( configTree );
+	}
+	
+	/**
+	 * Creates a RemoteGatewayListenerMock instance with the passed in arguments, and then starts
+	 * the ReadOnlyRemoteGatewayListener's doRun() method in a new Thread.
+	 * 
+	 * @param configTree The configTree to use to configure the RemoteGatewayListenerMock object
+	 * @param returnValueForCourier	the return value for the getCourier method of the RemoteGatewayListenerMock object
+	 * @return RemoteGatewayListenerMock Mock impl of a RemoteGatewayListener.
+	 */
+	protected RemoteGatewayListenerMock createAndStartListener ( ConfigTree configTree,  boolean returnValueForCourier ) throws ConfigurationException, GatewayException, RegistryException
+	{
+		final RemoteGatewayListenerMock mock = new RemoteGatewayListenerMock( configTree , returnValueForCourier );
+		mock.doInitialise();
+		
+		Thread thread = new Thread ( new Runnable ()  {
+			public void run()
+			{
+				mock.doRun();
+			}
+		});
+		thread.start();
+		
+		return mock;
+		
+	}
+	
+	protected void stopdoRun ( RemoteGatewayListenerMock mock )
+	{
+		if ( mock == null ) return;
+		try 
+		{
+			mock.stop();
+		}
+		catch ( Exception e )
+		{
+			if ( ! (e instanceof ManagedLifecycleException ) )
+				fail ( e.getMessage() );
+		}
+	}
+	
+	/**
+	 *  Mock impl of RemoteGatewayListener. 
+	 */
+	class RemoteGatewayListenerMock extends ReadOnlyRemoteGatewayListener
+	{
+		private static final long serialVersionUID = 1L;
+		
+		/* value that will be returned from the getCourier( EPR ) method */
+		private boolean returnValueForCourier;
+		
+		private boolean finishedOneRun;
+		
+		/**
+		 * Sole constructor
+		 * 
+		 * @param configTree						configTree used to configure this RemoteGatewayListener
+		 * @param returnValueForCourier	value to be returned from this objects getCourier( EPR ) method
+		 * 
+		 */
+		public RemoteGatewayListenerMock ( ConfigTree configTree, boolean returnValueForCourier) throws ConfigurationException, GatewayException, RegistryException
+		{
+			super ( configTree );
+			this.returnValueForCourier = returnValueForCourier;
+		}
+		
+		/**
+		 * Will return a Courier instance that returns the value of the
+		 * field returnValueForCourier.
+		 */
+		@Override
+		protected Courier getCourier( EPR current ) throws CourierException, MalformedEPRException
+		{
+			return new Courier() {
+				public boolean deliver( Message message ) throws CourierException, MalformedEPRException
+				{
+					return returnValueForCourier;
+				}
+				public void cleanup() { }
+			};
+		}
+		
+		@Override
+		protected void doInitialise() 
+		{ 
+			_targetEprs = new ArrayList<EPR>();
+			_targetEprs.add( new JMSEpr( new EPR() ) );
+		};
+		
+		@Override
+		protected boolean waitForRunningStateChange(final ManagedLifecycleThreadState state, final long terminationPeriod)
+		{
+			finishedOneRun = true;
+			return super.waitForRunningStateChange( state, terminationPeriod );
+		}
+		
+		public boolean hasFinishedOneRun()
+		{
+			return finishedOneRun;
+		}
+	}
+	
+	/*
+	 * Just here to help Ant to find annotated test.
+	 */
+	public static junit.framework.Test suite()
+	{
+		return new JUnit4TestAdapter( ReadOnlyRemoteGatewayListenerUnitTest.class);
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,127 +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.gateway;
-
-import java.io.File;
-
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-public class RemoteGatewayListenerIntegrationTest extends BaseTest
-{
-	public RemoteGatewayListenerIntegrationTest ()
-	{
-	}
-
-	public void testGateway () throws Exception
-	{
-		ConfigTree tree = new ConfigTree("test");
-		final File tmpDir = new File(System.getProperty("user.dir")) ;
-		final String tmpDirForm = tmpDir.toURL().toExternalForm() ;
-
-		tree.setAttribute("inputDir", tmpDirForm);
-		tree.setAttribute("target-service-category", "Example");
-		tree.setAttribute("target-service-name", "Test");
-		tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.RemoteGatewayListener");
-		tree.setAttribute("inputSuffix", ".dummy");
-		tree.setAttribute("workSuffix", "work");
-		tree.setAttribute("postDelete", "true");
-		tree.setAttribute("protocol", "ftp");
-		
-		String url = null;
-		
-		if (getFtpUser() != null)
-			url = getFtpUser()+":";
-		
-		if (getFtpPwd() != null)
-			url = url + getFtpPwd()+"@";
-
-		tree.setAttribute(FTPEpr.URL_TAG, "ftp://"+url+getFtpHostname()+"/"+getFtpDir());
-//		tree.setAttribute(FTPEpr.URL_TAG, "ftp://ftpuser:ftppassword@localhost/tmp");
-
-		RemoteGatewayListener gateway = new RemoteGatewayListener(tree);
-		boolean exception = false;
-		
-		try
-		{
-			gateway.deleteFile(new File("foo"));
-		}
-		catch (GatewayException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		gateway.run();
-		
-		try
-		{
-			@SuppressWarnings("unused")
-            byte[] contents = gateway.getFileContents(new File("bar"));
-			
-			fail();
-		}
-		catch (GatewayException ex)
-		{
-		}
-		
-		// TODO this ignores the parameter too!
-		
-		try
-		{
-			gateway.getFileList();
-		}
-		catch (GatewayException ex)
-		{
-			fail();
-		}
-		
-		exception = false;
-		
-		try
-		{
-			gateway.deleteFile(new File("foo"));
-		}
-		catch (GatewayException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		try
-		{
-			gateway.renameFile(new File("foo"), new File("bar"));
-			
-			fail();
-		}
-		catch (GatewayException ex)
-		{
-		}
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerIntegrationTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,127 @@
+/*
+ * 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.gateway;
+
+import java.io.File;
+
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+public class RemoteGatewayListenerIntegrationTest extends BaseTest
+{
+	public RemoteGatewayListenerIntegrationTest ()
+	{
+	}
+
+	public void testGateway () throws Exception
+	{
+		ConfigTree tree = new ConfigTree("test");
+		final File tmpDir = new File(System.getProperty("user.dir")) ;
+		final String tmpDirForm = tmpDir.toURL().toExternalForm() ;
+
+		tree.setAttribute("inputDir", tmpDirForm);
+		tree.setAttribute("target-service-category", "Example");
+		tree.setAttribute("target-service-name", "Test");
+		tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.RemoteGatewayListener");
+		tree.setAttribute("inputSuffix", ".dummy");
+		tree.setAttribute("workSuffix", "work");
+		tree.setAttribute("postDelete", "true");
+		tree.setAttribute("protocol", "ftp");
+		
+		String url = null;
+		
+		if (getFtpUser() != null)
+			url = getFtpUser()+":";
+		
+		if (getFtpPwd() != null)
+			url = url + getFtpPwd()+"@";
+
+		tree.setAttribute(FTPEpr.URL_TAG, "ftp://"+url+getFtpHostname()+"/"+getFtpDir());
+//		tree.setAttribute(FTPEpr.URL_TAG, "ftp://ftpuser:ftppassword@localhost/tmp");
+
+		RemoteGatewayListener gateway = new RemoteGatewayListener(tree);
+		boolean exception = false;
+		
+		try
+		{
+			gateway.deleteFile(new File("foo"));
+		}
+		catch (GatewayException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		gateway.run();
+		
+		try
+		{
+			@SuppressWarnings("unused")
+            byte[] contents = gateway.getFileContents(new File("bar"));
+			
+			fail();
+		}
+		catch (GatewayException ex)
+		{
+		}
+		
+		// TODO this ignores the parameter too!
+		
+		try
+		{
+			gateway.getFileList();
+		}
+		catch (GatewayException ex)
+		{
+			fail();
+		}
+		
+		exception = false;
+		
+		try
+		{
+			gateway.deleteFile(new File("foo"));
+		}
+		catch (GatewayException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		try
+		{
+			gateway.renameFile(new File("foo"), new File("bar"));
+			
+			fail();
+		}
+		catch (GatewayException ex)
+		{
+		}
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,547 +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.gateway;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-import java.net.MalformedURLException;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.List;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.util.embedded.EmbeddableException;
-import org.jboss.internal.soa.esb.util.embedded.ftp.FtpTestUtil;
-import org.jboss.internal.soa.esb.util.embedded.ftp.NoConfigFileFtpServer;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.couriers.Courier;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.junit.After;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-/**
- * Unit test for RemoteGatewayListener that uses an embedded ftp server
- * Tests the RemoteGatewayListener with the default RemoteFileSystemStrategy.
- *  
- * @author Daniel Bevenius
- *
- */
-public class RemoteGatewayListenerUnitTest
-{
-	private static Logger log = Logger.getLogger( RemoteGatewayListenerUnitTest.class );
-	
-	/*  EmbeddedFtp Server  */
-	protected static NoConfigFileFtpServer ftpServer;
-	
-	/* Instance of class under test */
-	protected static RemoteGatewayListener gatewayListener;
-	
-	/*
-	 * ConfigTree configuration. This is a field so that test methods
-	 * can override the default settings created by createConfigTree()
-	 */
-	protected static ConfigTree configTree;
-	
-	/* name of the remote ftp input directory */
-	protected static String remoteInputDirName;
-	
-	/* name of the remote ftp upload directory */
-	protected static String remoteUploadDirName;
-	
-	/* name of the remote ftp error directory */
-	protected static String remoteErrorDirName;
-	
-	private static final String SERVICE_CATEGORY = "RemoteGWListenerTest";
-	private static final String SERVICE_NAME =  SERVICE_CATEGORY;
-	private static final String INPUT_SUFFIX = ".txt";
-	private static final String WORK_SUFFIX = ".esbwork";
-	protected static final String POST_SUFFIX = ".done";
-	private static final String POST_ERROR_SUFFIX = ".error";
-	private static final String POST_DEL = "false";
-	private static final String RENAMED_SUFFIX = ".renamed";
-	
-	protected static final String TEST_FILE_CONTENT = RemoteGatewayListenerUnitTest.class.getName() + " junit ftp test";
-
-	protected File testFile;
-
-	protected File renamedFile;
-	
-	@BeforeClass
-	public static void classSetup() throws EmbeddableException, ConfigurationException, GatewayException, RegistryException, MalformedURLException
-	{
-		ftpServer = createFtpServer();
-		ftpServer.start();
-		
-		createWorkDirectories();
-		
-		configTree = createConfigTree();
-		createRemoteGatewayListener( configTree );
-		
-	}
-
-	protected static void createWorkDirectories()
-	{
-		remoteInputDirName = "/" + ftpServer.getLocalInputDir().getName();
-		remoteUploadDirName = "/" + ftpServer.getLocalUploadDir().getName();
-		remoteErrorDirName = "/" + ftpServer.getLocalErrorDir().getName();
-	}
-
-
-	protected static void createRemoteGatewayListener( ConfigTree configTree )
-			throws ConfigurationException, RegistryException, GatewayException
-	{
-		gatewayListener = new RemoteGatewayListener( configTree );
-	}
-	
-	
-	public static NoConfigFileFtpServer createFtpServer()
-	{
-		ftpServer = new NoConfigFileFtpServer();
-		ftpServer.setPort( 2221 );
-		return ftpServer;
-	}
-	
-	@AfterClass
-	public static void classTearDown() 
-	{
-		try
-		{
-			ftpServer.stop();
-		}
-		catch ( Exception e )
-		{
-			log.warn ( e.getMessage() );
-		}
-		
-		if  ( !FtpTestUtil.deleteDir( ftpServer.getFtpServerDir() ) )
-		{
-			log.warn( "Could not delete " +  ftpServer.getFtpServerDir() ) ;
-		}
-	}
-	
-	@Before
-	public void setUp()
-	{
-		testFile = FtpTestUtil.createTestFile( ftpServer.getLocalInputDir(),  getClass().getName() + INPUT_SUFFIX , TEST_FILE_CONTENT );
-	}
-	
-	@After
-	public void tearDown()
-	{
-		FtpTestUtil.deleteFile( testFile );
-		FtpTestUtil.deleteFile( renamedFile );
-	}
-	
-	/**
-	 * Test with the following configuration:
-	 * inputDir="/input" 
-	 * postDir="/upload" 
-	 */
-	@Test ( timeout=3000 )
-	public void doRun_PostDir_Different_From_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException
-	{
-		setAbsoluteInputDir();
-		setAbsolutePostDirToUploadDir();
-		boolean getCourierReturnValue = true;
-		
-		RemoteGatewayListenerMock mock = createAndStartListener ( configTree,  getCourierReturnValue );
-		
-		File done =  ftpServer.getLocalUploadDir();
-		String doneFileName = testFile.getName() + POST_SUFFIX;
-		
-		waitForFile( done, doneFileName );
-		stopdoRun( mock );
-		
-		File processedFile = new File ( done,  doneFileName );
-		try
-		{
-			assertTrue ( processedFile.exists() );
-		}
-		finally
-		{
-			FtpTestUtil.deleteFile( processedFile );
-		}
-	}
-	
-	/**
-	 * Test with the following configuration:
-	 *	inputDir="/input" 
-	 *	postDir="/input" 
-	 */
-	@Test ( timeout=3000 )
-	public void doRun_PostDir_Same_As_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException
-	{
-		setAbsoluteInputDir();
-		setAbsolutePostDirToInputDir();
-		boolean getCourierReturnValue = true;
-		
-		RemoteGatewayListenerMock mock = createAndStartListener ( configTree,  getCourierReturnValue );
-		
-		File inputDir =  ftpServer.getLocalInputDir();
-		String doneFileName = testFile.getName() + POST_SUFFIX;
-		
-		waitForFile( inputDir, doneFileName );
-		stopdoRun( mock );
-		
-		File processedFile = new File ( inputDir,  doneFileName );
-		try
-		{
-			assertTrue ( processedFile.exists() );
-		}
-		finally
-		{
-			FtpTestUtil.deleteFile( processedFile );
-		}
-	}
-	
-	/**
-	 *  This test will assert that the work file is renamed into the error directory.
-	 *  Test with the following configuration:
-	 *	postDir="/input" 
-	 *	errorDir="/error" 
-	 *
-	 *  Note. when this test runs a stacktrace will be displayed. This is expected.
-	 */
-	@Test ( timeout = 2000 )
-	public void doRun_Negative() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException
-	{
-		setAbsoluteInputDir();
-		setAbsoluteErrorDir();
-		boolean getCourierReturnValue = false;
-		log.error( "The following exceptions are expected: "  );
-		RemoteGatewayListenerMock mock = createAndStartListener ( configTree, getCourierReturnValue );
-		
-		File errorDir =  ftpServer.getLocalErrorDir();
-		String errorFileName = testFile.getName() + POST_ERROR_SUFFIX;
-		waitForFile( errorDir, errorFileName );
-		stopdoRun( mock );
-		
-		File errorFile = new File ( errorDir,  errorFileName );
-		try
-		{
-			assertTrue ( errorFile.exists() );
-		}
-		finally 
-		{
-			FtpTestUtil.deleteFile( errorFile );
-		}
-	}
-	
-	@Test
-	public void renameFile_In_Same_Directory() throws GatewayException
-	{
-		File from = createAbsoluteFromFile();
-		File to = createAbsoluteToFile();
-			
-		gatewayListener.renameFile( from, to );
-			
-		renamedFile = new File ( ftpServer.getLocalInputDir(), to.getName() );
-		assertFileRemoved( testFile );
-		assertFileExists( renamedFile );
-	}
-	
-	@Test
-	public void renameFile_In_Different_Directory() throws GatewayException
-	{
-		File from = createAbsoluteFromFile();
-		File to = createAbsoluteToFileUploadDir();
-			
-		gatewayListener.renameFile( from, to );
-			
-		renamedFile = new File ( ftpServer.getLocalUploadDir(), to.getName() );
-		assertFileRemoved( testFile );
-		assertFileExists( renamedFile );
-	}
-	
-	@Test
-	public void deleteFile() throws GatewayException 
-	{
-		File remoteFile = createAbsoluteFromFile();
-				
-		gatewayListener.deleteFile( remoteFile );
-		assertFalse( "Remote file was not deleted",  testFile.exists() );
-	}
-	
-	@Test
-	public void getFileListFromRemoteDir() throws GatewayException
-	{
-		File[] fileListFromRemoteDir = gatewayListener.getFileList();
-			
-		assertNotNull ( fileListFromRemoteDir );
-		assertTrue ( fileListFromRemoteDir.length > 0 );
-			
-		List<File> fileList = Arrays.asList( fileListFromRemoteDir );
-		assertTrue( "The test file was not included in the List! " , fileList.contains( new File ( testFile.getName() )  ));
-	}
-	
-	@Test
-	public void getFileContents() throws GatewayException
-	{
-		File remoteFileName = createAbsoluteFromFile();
-		byte[] fileContents = gatewayListener.getFileContents( remoteFileName );
-			
-		assertEquals( TEST_FILE_CONTENT, new String ( fileContents ) );
-	}
-	
-	/*
-	 * Will create a configTree that looks like the following:
-	 *  <junitRemoteGatewayListenerTest 
-	 * 	URL="ftp://anonymous:letMeIn@localhost:2221/input"
-	 * 	errorDelete="false" 
-	 * 	errorDir="/error"
-	 * 	errorSuffix=".error" 
-	 * 	gatewayClass="org.jboss.soa.esb.listeners.gateway.RemoteGatewayListener" 
-	 * 	inputSuffix=".txt" 
-	 * 	maxThreads="1" 
-	 * 	passive="false" 
-	 * 	pollLatencySeconds="5" 
-	 * 	postDelete="false" 
-	 *	postDir="/upload" 
-	 *	postSuffix=".done" 
-	 *	service-description="Gateway for SIFO" 
-	 *	target-service-category="RemoteGWListenerTest"
-	 *	target-service-name="RemoteGWListenerTest"
-	 *	workSuffix=".esbwork"
-	 *	/> 
-	 */
-	public static ConfigTree createConfigTree()
-	{
-		ConfigTree configTree = new ConfigTree( "junitRemoteGatewayListenerTest" );
-
-		configTree.setAttribute( ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, SERVICE_CATEGORY );
-		configTree.setAttribute( ListenerTagNames.TARGET_SERVICE_NAME_TAG, SERVICE_NAME );
-
-		try
-		{
-			configTree.setAttribute( ListenerTagNames.URL_TAG, ftpServer.getURL().toString() );
-		} 
-		catch (MalformedURLException e)
-		{
-			fail ( e.getMessage() );
-		} 
-		
-		/* input attributes */
-		configTree.setAttribute( ListenerTagNames.FILE_INPUT_DIR_TAG, remoteInputDirName );
-		configTree.setAttribute( ListenerTagNames.FILE_INPUT_SFX_TAG, INPUT_SUFFIX );
-		configTree.setAttribute( ListenerTagNames.FILE_WORK_SFX_TAG, WORK_SUFFIX );
-		/* post attributes */
-		configTree.setAttribute( ListenerTagNames.FILE_POST_DIR_TAG,  remoteUploadDirName );
-		configTree.setAttribute( ListenerTagNames.FILE_POST_SFX_TAG, POST_SUFFIX);
-		configTree.setAttribute( ListenerTagNames.FILE_POST_DEL_TAG, POST_DEL);
-		/* post error attributes */
-		configTree.setAttribute( ListenerTagNames.FILE_ERROR_DIR_TAG,  remoteErrorDirName );
-		configTree.setAttribute( ListenerTagNames.FILE_ERROR_SFX_TAG, POST_ERROR_SUFFIX);
-		
-		return configTree;
-	}
-	
-	protected void waitForFile( File inDir, String fileNameToWaitfor ) throws InterruptedException
-	{
-		boolean done = false;
-		while( !done )
-		{
-			for( String fileName : inDir.list() )
-			{
-				log.debug( fileName );
-				if ( fileName.equals( fileNameToWaitfor ) )
-				{
-					done = true;
-					break;
-				}
-				else
-					Thread.sleep( 1000 );
-			}
-		}
-	}
-	
-	/**
-	 * Creates a RemoteGatewayListenerMock instance with the passed in arguments, and then starts
-	 * the RemoteGatewayListener's doRun() method in a new Thread.
-	 * 
-	 * @param configTree										The configTree to use to configure the RemoteGatewayListenerMock object
-	 * @param returnValueForCourier					the return value for the getCourier method of the RemoteGatewayListenerMock object
-	 * @return RemoteGatewayListenerMock		Mock impl of a RemoteGatewayListener.
-	 */
-	private RemoteGatewayListenerMock createAndStartListener ( ConfigTree configTree,  boolean returnValueForCourier ) throws ConfigurationException, GatewayException, RegistryException
-	{
-		final RemoteGatewayListenerMock mock = new RemoteGatewayListenerMock( configTree , returnValueForCourier );
-		mock.doInitialise();
-		
-		Thread thread = new Thread ( new Runnable ()  {
-			public void run()
-			{
-				mock.doRun();
-			}
-		});
-		thread.start();
-		
-		return mock;
-		
-	}
-	
-	private void stopdoRun ( RemoteGatewayListenerMock mock )
-	{
-		if ( mock == null ) return;
-		try 
-		{
-			mock.stop();
-		}
-		catch ( Exception e )
-		{
-			if ( ! (e instanceof ManagedLifecycleException ) )
-				fail ( e.getMessage() );
-		}
-	}
-	
-	protected static void assertFileRemoved( File file)
-	{
-		assertFalse( "The file was not removed from the filesystem", file.exists() );
-	}
-	
-	protected static void assertFileExists( File file )
-	{
-		assertTrue( "The file was not renamed to the upload directory.",  file.exists() );
-	}
-	
-	protected void setAbsoluteInputDir()
-	{
-		configTree.setAttribute( ListenerTagNames.FILE_INPUT_DIR_TAG, remoteInputDirName );
-	}
-	
-	protected void setAbsolutePostDirToInputDir()
-	{
-		configTree.setAttribute( ListenerTagNames.FILE_POST_DIR_TAG, remoteInputDirName );
-	}
-	
-	protected void setAbsolutePostDirToUploadDir()
-	{
-		configTree.setAttribute( ListenerTagNames.FILE_POST_DIR_TAG, remoteUploadDirName );
-	}
-	
-	private void setAbsoluteErrorDir()
-	{
-		configTree.setAttribute( ListenerTagNames.FILE_ERROR_DIR_TAG, remoteErrorDirName );
-	}
-	
-	protected File createAbsoluteFromFile()
-	{
-		return new File ( remoteInputDirName + "/" + testFile.getName() );
-	}
-	
-	protected File createAbsoluteToFile()
-	{
-		return new File ( remoteInputDirName + "/" + testFile.getName() + RENAMED_SUFFIX );
-	}
-	
-	private File createAbsoluteToFileUploadDir()
-	{
-		return new File ( remoteUploadDirName + "/" +  testFile.getName() + RENAMED_SUFFIX );
-	}
-	
-	/**
-	 * Just here to get Ant to find annotated test.
-	 */
-	public static junit.framework.Test suite()
-	{
-		return new JUnit4TestAdapter( RemoteGatewayListenerUnitTest.class);
-	}
-	
-	/**
-	 *  Mock impl of RemoteGatewayListener. 
-	 */
-	class RemoteGatewayListenerMock extends RemoteGatewayListener
-	{
-		private static final long serialVersionUID = 1L;
-		
-		/* value that will be returned from the getCourier( EPR ) method */
-		private boolean returnValueForCourier;
-		
-		private boolean finishedOneRun;
-		
-		/**
-		 * Sole constructor
-		 * 
-		 * @param configTree						configTree used to configure this RemoteGatewayListener
-		 * @param returnValueForCourier	value to be returned from this objects getCourier( EPR ) method
-		 * 
-		 */
-		public RemoteGatewayListenerMock ( ConfigTree configTree, boolean returnValueForCourier) throws ConfigurationException, GatewayException, RegistryException
-		{
-			super ( configTree );
-			this.returnValueForCourier = returnValueForCourier;
-		}
-		
-		/**
-		 * Will return a Courier instance that returns the value of the
-		 * field returnValueForCourier.
-		 */
-		@Override
-		protected Courier getCourier( EPR current ) throws CourierException, MalformedEPRException
-		{
-			return new Courier() {
-				public boolean deliver( Message message ) throws CourierException, MalformedEPRException
-				{
-					return returnValueForCourier;
-				}
-				public void cleanup() { }
-			};
-		}
-		
-		@Override
-		protected void doInitialise() 
-		{ 
-			_targetEprs = new ArrayList<EPR>();
-			_targetEprs.add( new JMSEpr( new EPR() ) );
-		};
-		
-		@Override
-		protected boolean waitForRunningStateChange(final ManagedLifecycleThreadState state, final long terminationPeriod)
-		{
-			finishedOneRun = true;
-			return super.waitForRunningStateChange( state, terminationPeriod );
-		}
-		
-		public boolean hasFinishedOneRun()
-		{
-			return finishedOneRun;
-		}
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/RemoteGatewayListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,547 @@
+/*
+ * 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.gateway;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+import java.net.MalformedURLException;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.List;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.util.embedded.EmbeddableException;
+import org.jboss.internal.soa.esb.util.embedded.ftp.FtpTestUtil;
+import org.jboss.internal.soa.esb.util.embedded.ftp.NoConfigFileFtpServer;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.couriers.Courier;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleThreadState;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.junit.After;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+/**
+ * Unit test for RemoteGatewayListener that uses an embedded ftp server
+ * Tests the RemoteGatewayListener with the default RemoteFileSystemStrategy.
+ *  
+ * @author Daniel Bevenius
+ *
+ */
+public class RemoteGatewayListenerUnitTest
+{
+	private static Logger log = Logger.getLogger( RemoteGatewayListenerUnitTest.class );
+	
+	/*  EmbeddedFtp Server  */
+	protected static NoConfigFileFtpServer ftpServer;
+	
+	/* Instance of class under test */
+	protected static RemoteGatewayListener gatewayListener;
+	
+	/*
+	 * ConfigTree configuration. This is a field so that test methods
+	 * can override the default settings created by createConfigTree()
+	 */
+	protected static ConfigTree configTree;
+	
+	/* name of the remote ftp input directory */
+	protected static String remoteInputDirName;
+	
+	/* name of the remote ftp upload directory */
+	protected static String remoteUploadDirName;
+	
+	/* name of the remote ftp error directory */
+	protected static String remoteErrorDirName;
+	
+	private static final String SERVICE_CATEGORY = "RemoteGWListenerTest";
+	private static final String SERVICE_NAME =  SERVICE_CATEGORY;
+	private static final String INPUT_SUFFIX = ".txt";
+	private static final String WORK_SUFFIX = ".esbwork";
+	protected static final String POST_SUFFIX = ".done";
+	private static final String POST_ERROR_SUFFIX = ".error";
+	private static final String POST_DEL = "false";
+	private static final String RENAMED_SUFFIX = ".renamed";
+	
+	protected static final String TEST_FILE_CONTENT = RemoteGatewayListenerUnitTest.class.getName() + " junit ftp test";
+
+	protected File testFile;
+
+	protected File renamedFile;
+	
+	@BeforeClass
+	public static void classSetup() throws EmbeddableException, ConfigurationException, GatewayException, RegistryException, MalformedURLException
+	{
+		ftpServer = createFtpServer();
+		ftpServer.start();
+		
+		createWorkDirectories();
+		
+		configTree = createConfigTree();
+		createRemoteGatewayListener( configTree );
+		
+	}
+
+	protected static void createWorkDirectories()
+	{
+		remoteInputDirName = "/" + ftpServer.getLocalInputDir().getName();
+		remoteUploadDirName = "/" + ftpServer.getLocalUploadDir().getName();
+		remoteErrorDirName = "/" + ftpServer.getLocalErrorDir().getName();
+	}
+
+
+	protected static void createRemoteGatewayListener( ConfigTree configTree )
+			throws ConfigurationException, RegistryException, GatewayException
+	{
+		gatewayListener = new RemoteGatewayListener( configTree );
+	}
+	
+	
+	public static NoConfigFileFtpServer createFtpServer()
+	{
+		ftpServer = new NoConfigFileFtpServer();
+		ftpServer.setPort( 2221 );
+		return ftpServer;
+	}
+	
+	@AfterClass
+	public static void classTearDown() 
+	{
+		try
+		{
+			ftpServer.stop();
+		}
+		catch ( Exception e )
+		{
+			log.warn ( e.getMessage() );
+		}
+		
+		if  ( !FtpTestUtil.deleteDir( ftpServer.getFtpServerDir() ) )
+		{
+			log.warn( "Could not delete " +  ftpServer.getFtpServerDir() ) ;
+		}
+	}
+	
+	@Before
+	public void setUp()
+	{
+		testFile = FtpTestUtil.createTestFile( ftpServer.getLocalInputDir(),  getClass().getName() + INPUT_SUFFIX , TEST_FILE_CONTENT );
+	}
+	
+	@After
+	public void tearDown()
+	{
+		FtpTestUtil.deleteFile( testFile );
+		FtpTestUtil.deleteFile( renamedFile );
+	}
+	
+	/**
+	 * Test with the following configuration:
+	 * inputDir="/input" 
+	 * postDir="/upload" 
+	 */
+	@Test ( timeout=3000 )
+	public void doRun_PostDir_Different_From_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException
+	{
+		setAbsoluteInputDir();
+		setAbsolutePostDirToUploadDir();
+		boolean getCourierReturnValue = true;
+		
+		RemoteGatewayListenerMock mock = createAndStartListener ( configTree,  getCourierReturnValue );
+		
+		File done =  ftpServer.getLocalUploadDir();
+		String doneFileName = testFile.getName() + POST_SUFFIX;
+		
+		waitForFile( done, doneFileName );
+		stopdoRun( mock );
+		
+		File processedFile = new File ( done,  doneFileName );
+		try
+		{
+			assertTrue ( processedFile.exists() );
+		}
+		finally
+		{
+			FtpTestUtil.deleteFile( processedFile );
+		}
+	}
+	
+	/**
+	 * Test with the following configuration:
+	 *	inputDir="/input" 
+	 *	postDir="/input" 
+	 */
+	@Test ( timeout=3000 )
+	public void doRun_PostDir_Same_As_InputDir() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException
+	{
+		setAbsoluteInputDir();
+		setAbsolutePostDirToInputDir();
+		boolean getCourierReturnValue = true;
+		
+		RemoteGatewayListenerMock mock = createAndStartListener ( configTree,  getCourierReturnValue );
+		
+		File inputDir =  ftpServer.getLocalInputDir();
+		String doneFileName = testFile.getName() + POST_SUFFIX;
+		
+		waitForFile( inputDir, doneFileName );
+		stopdoRun( mock );
+		
+		File processedFile = new File ( inputDir,  doneFileName );
+		try
+		{
+			assertTrue ( processedFile.exists() );
+		}
+		finally
+		{
+			FtpTestUtil.deleteFile( processedFile );
+		}
+	}
+	
+	/**
+	 *  This test will assert that the work file is renamed into the error directory.
+	 *  Test with the following configuration:
+	 *	postDir="/input" 
+	 *	errorDir="/error" 
+	 *
+	 *  Note. when this test runs a stacktrace will be displayed. This is expected.
+	 */
+	@Test ( timeout = 2000 )
+	public void doRun_Negative() throws ManagedLifecycleException, ConfigurationException, GatewayException, RegistryException, InterruptedException
+	{
+		setAbsoluteInputDir();
+		setAbsoluteErrorDir();
+		boolean getCourierReturnValue = false;
+		log.error( "The following exceptions are expected: "  );
+		RemoteGatewayListenerMock mock = createAndStartListener ( configTree, getCourierReturnValue );
+		
+		File errorDir =  ftpServer.getLocalErrorDir();
+		String errorFileName = testFile.getName() + POST_ERROR_SUFFIX;
+		waitForFile( errorDir, errorFileName );
+		stopdoRun( mock );
+		
+		File errorFile = new File ( errorDir,  errorFileName );
+		try
+		{
+			assertTrue ( errorFile.exists() );
+		}
+		finally 
+		{
+			FtpTestUtil.deleteFile( errorFile );
+		}
+	}
+	
+	@Test
+	public void renameFile_In_Same_Directory() throws GatewayException
+	{
+		File from = createAbsoluteFromFile();
+		File to = createAbsoluteToFile();
+			
+		gatewayListener.renameFile( from, to );
+			
+		renamedFile = new File ( ftpServer.getLocalInputDir(), to.getName() );
+		assertFileRemoved( testFile );
+		assertFileExists( renamedFile );
+	}
+	
+	@Test
+	public void renameFile_In_Different_Directory() throws GatewayException
+	{
+		File from = createAbsoluteFromFile();
+		File to = createAbsoluteToFileUploadDir();
+			
+		gatewayListener.renameFile( from, to );
+			
+		renamedFile = new File ( ftpServer.getLocalUploadDir(), to.getName() );
+		assertFileRemoved( testFile );
+		assertFileExists( renamedFile );
+	}
+	
+	@Test
+	public void deleteFile() throws GatewayException 
+	{
+		File remoteFile = createAbsoluteFromFile();
+				
+		gatewayListener.deleteFile( remoteFile );
+		assertFalse( "Remote file was not deleted",  testFile.exists() );
+	}
+	
+	@Test
+	public void getFileListFromRemoteDir() throws GatewayException
+	{
+		File[] fileListFromRemoteDir = gatewayListener.getFileList();
+			
+		assertNotNull ( fileListFromRemoteDir );
+		assertTrue ( fileListFromRemoteDir.length > 0 );
+			
+		List<File> fileList = Arrays.asList( fileListFromRemoteDir );
+		assertTrue( "The test file was not included in the List! " , fileList.contains( new File ( testFile.getName() )  ));
+	}
+	
+	@Test
+	public void getFileContents() throws GatewayException
+	{
+		File remoteFileName = createAbsoluteFromFile();
+		byte[] fileContents = gatewayListener.getFileContents( remoteFileName );
+			
+		assertEquals( TEST_FILE_CONTENT, new String ( fileContents ) );
+	}
+	
+	/*
+	 * Will create a configTree that looks like the following:
+	 *  <junitRemoteGatewayListenerTest 
+	 * 	URL="ftp://anonymous:letMeIn@localhost:2221/input"
+	 * 	errorDelete="false" 
+	 * 	errorDir="/error"
+	 * 	errorSuffix=".error" 
+	 * 	gatewayClass="org.jboss.soa.esb.listeners.gateway.RemoteGatewayListener" 
+	 * 	inputSuffix=".txt" 
+	 * 	maxThreads="1" 
+	 * 	passive="false" 
+	 * 	pollLatencySeconds="5" 
+	 * 	postDelete="false" 
+	 *	postDir="/upload" 
+	 *	postSuffix=".done" 
+	 *	service-description="Gateway for SIFO" 
+	 *	target-service-category="RemoteGWListenerTest"
+	 *	target-service-name="RemoteGWListenerTest"
+	 *	workSuffix=".esbwork"
+	 *	/> 
+	 */
+	public static ConfigTree createConfigTree()
+	{
+		ConfigTree configTree = new ConfigTree( "junitRemoteGatewayListenerTest" );
+
+		configTree.setAttribute( ListenerTagNames.TARGET_SERVICE_CATEGORY_TAG, SERVICE_CATEGORY );
+		configTree.setAttribute( ListenerTagNames.TARGET_SERVICE_NAME_TAG, SERVICE_NAME );
+
+		try
+		{
+			configTree.setAttribute( ListenerTagNames.URL_TAG, ftpServer.getURL().toString() );
+		} 
+		catch (MalformedURLException e)
+		{
+			fail ( e.getMessage() );
+		} 
+		
+		/* input attributes */
+		configTree.setAttribute( ListenerTagNames.FILE_INPUT_DIR_TAG, remoteInputDirName );
+		configTree.setAttribute( ListenerTagNames.FILE_INPUT_SFX_TAG, INPUT_SUFFIX );
+		configTree.setAttribute( ListenerTagNames.FILE_WORK_SFX_TAG, WORK_SUFFIX );
+		/* post attributes */
+		configTree.setAttribute( ListenerTagNames.FILE_POST_DIR_TAG,  remoteUploadDirName );
+		configTree.setAttribute( ListenerTagNames.FILE_POST_SFX_TAG, POST_SUFFIX);
+		configTree.setAttribute( ListenerTagNames.FILE_POST_DEL_TAG, POST_DEL);
+		/* post error attributes */
+		configTree.setAttribute( ListenerTagNames.FILE_ERROR_DIR_TAG,  remoteErrorDirName );
+		configTree.setAttribute( ListenerTagNames.FILE_ERROR_SFX_TAG, POST_ERROR_SUFFIX);
+		
+		return configTree;
+	}
+	
+	protected void waitForFile( File inDir, String fileNameToWaitfor ) throws InterruptedException
+	{
+		boolean done = false;
+		while( !done )
+		{
+			for( String fileName : inDir.list() )
+			{
+				log.debug( fileName );
+				if ( fileName.equals( fileNameToWaitfor ) )
+				{
+					done = true;
+					break;
+				}
+				else
+					Thread.sleep( 1000 );
+			}
+		}
+	}
+	
+	/**
+	 * Creates a RemoteGatewayListenerMock instance with the passed in arguments, and then starts
+	 * the RemoteGatewayListener's doRun() method in a new Thread.
+	 * 
+	 * @param configTree										The configTree to use to configure the RemoteGatewayListenerMock object
+	 * @param returnValueForCourier					the return value for the getCourier method of the RemoteGatewayListenerMock object
+	 * @return RemoteGatewayListenerMock		Mock impl of a RemoteGatewayListener.
+	 */
+	private RemoteGatewayListenerMock createAndStartListener ( ConfigTree configTree,  boolean returnValueForCourier ) throws ConfigurationException, GatewayException, RegistryException
+	{
+		final RemoteGatewayListenerMock mock = new RemoteGatewayListenerMock( configTree , returnValueForCourier );
+		mock.doInitialise();
+		
+		Thread thread = new Thread ( new Runnable ()  {
+			public void run()
+			{
+				mock.doRun();
+			}
+		});
+		thread.start();
+		
+		return mock;
+		
+	}
+	
+	private void stopdoRun ( RemoteGatewayListenerMock mock )
+	{
+		if ( mock == null ) return;
+		try 
+		{
+			mock.stop();
+		}
+		catch ( Exception e )
+		{
+			if ( ! (e instanceof ManagedLifecycleException ) )
+				fail ( e.getMessage() );
+		}
+	}
+	
+	protected static void assertFileRemoved( File file)
+	{
+		assertFalse( "The file was not removed from the filesystem", file.exists() );
+	}
+	
+	protected static void assertFileExists( File file )
+	{
+		assertTrue( "The file was not renamed to the upload directory.",  file.exists() );
+	}
+	
+	protected void setAbsoluteInputDir()
+	{
+		configTree.setAttribute( ListenerTagNames.FILE_INPUT_DIR_TAG, remoteInputDirName );
+	}
+	
+	protected void setAbsolutePostDirToInputDir()
+	{
+		configTree.setAttribute( ListenerTagNames.FILE_POST_DIR_TAG, remoteInputDirName );
+	}
+	
+	protected void setAbsolutePostDirToUploadDir()
+	{
+		configTree.setAttribute( ListenerTagNames.FILE_POST_DIR_TAG, remoteUploadDirName );
+	}
+	
+	private void setAbsoluteErrorDir()
+	{
+		configTree.setAttribute( ListenerTagNames.FILE_ERROR_DIR_TAG, remoteErrorDirName );
+	}
+	
+	protected File createAbsoluteFromFile()
+	{
+		return new File ( remoteInputDirName + "/" + testFile.getName() );
+	}
+	
+	protected File createAbsoluteToFile()
+	{
+		return new File ( remoteInputDirName + "/" + testFile.getName() + RENAMED_SUFFIX );
+	}
+	
+	private File createAbsoluteToFileUploadDir()
+	{
+		return new File ( remoteUploadDirName + "/" +  testFile.getName() + RENAMED_SUFFIX );
+	}
+	
+	/**
+	 * Just here to get Ant to find annotated test.
+	 */
+	public static junit.framework.Test suite()
+	{
+		return new JUnit4TestAdapter( RemoteGatewayListenerUnitTest.class);
+	}
+	
+	/**
+	 *  Mock impl of RemoteGatewayListener. 
+	 */
+	class RemoteGatewayListenerMock extends RemoteGatewayListener
+	{
+		private static final long serialVersionUID = 1L;
+		
+		/* value that will be returned from the getCourier( EPR ) method */
+		private boolean returnValueForCourier;
+		
+		private boolean finishedOneRun;
+		
+		/**
+		 * Sole constructor
+		 * 
+		 * @param configTree						configTree used to configure this RemoteGatewayListener
+		 * @param returnValueForCourier	value to be returned from this objects getCourier( EPR ) method
+		 * 
+		 */
+		public RemoteGatewayListenerMock ( ConfigTree configTree, boolean returnValueForCourier) throws ConfigurationException, GatewayException, RegistryException
+		{
+			super ( configTree );
+			this.returnValueForCourier = returnValueForCourier;
+		}
+		
+		/**
+		 * Will return a Courier instance that returns the value of the
+		 * field returnValueForCourier.
+		 */
+		@Override
+		protected Courier getCourier( EPR current ) throws CourierException, MalformedEPRException
+		{
+			return new Courier() {
+				public boolean deliver( Message message ) throws CourierException, MalformedEPRException
+				{
+					return returnValueForCourier;
+				}
+				public void cleanup() { }
+			};
+		}
+		
+		@Override
+		protected void doInitialise() 
+		{ 
+			_targetEprs = new ArrayList<EPR>();
+			_targetEprs.add( new JMSEpr( new EPR() ) );
+		};
+		
+		@Override
+		protected boolean waitForRunningStateChange(final ManagedLifecycleThreadState state, final long terminationPeriod)
+		{
+			finishedOneRun = true;
+			return super.waitForRunningStateChange( state, terminationPeriod );
+		}
+		
+		public boolean hasFinishedOneRun()
+		{
+			return finishedOneRun;
+		}
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListenerUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,199 +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.gateway;
-
-import java.sql.SQLException;
-import java.sql.Statement;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.common.tests.BaseTest;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
-
-public class SqlTableGatewayListenerUnitTest extends BaseTest
-{
-	private Logger log = Logger
-			.getLogger( SqlTableGatewayListenerUnitTest.class );
-	
-	public SqlTableGatewayListenerUnitTest ()
-	{
-	}
-	
-	public void setUp()
-	{
-		try
-		{
-			MockRegistry.install();
-			Statement stmt = getDbConnection().createStatement();
-
-			try
-			{
-				stmt.executeUpdate("DROP TABLE esb_messages");
-			}
-			catch (Exception e)
-			{
-				// Ignore
-			}
-
-			stmt.executeUpdate("CREATE TABLE esb_messages (message_id varchar NOT NULL, message varchar, status varchar, insert_timestamp bigint, CONSTRAINT pkey_esb_messages PRIMARY KEY (message_id))");
-		}
-		catch (SQLException ex)
-		{
-			log.error(ex);
-
-			fail();
-		}
-	}
-	public void tearDown()
-	{
-		MockRegistry.uninstall();
-	}
-	
-	public void testGateway () throws Exception
-	{
-		ConfigTree tree = new ConfigTree("test");
-
-		tree.setAttribute(JDBCEpr.URL_TAG, "jdbc:postgresql://myhost:5432/testDB");
-		tree.setAttribute(JDBCEpr.POST_DEL_TAG, "true");
-		tree.setAttribute(JDBCEpr.ERROR_DEL_TAG, "true");
-		tree.setAttribute(JDBCEpr.DRIVER_TAG, "org.postgresql.Driver");
-		tree.setAttribute(JDBCEpr.TIMESTAMP_COLUMN_TAG, "insert_timestamp");
-		tree.setAttribute(JDBCEpr.MESSAGE_ID_COLUMN_TAG, "message_id");
-		tree.setAttribute(JDBCEpr.PASSWORD_TAG, "secret");
-		tree.setAttribute(JDBCEpr.STATUS_COLUMN_TAG, "status");
-		tree.setAttribute(JDBCEpr.TABLE_NAME_TAG, "testtable");
-		tree.setAttribute(JDBCEpr.USERNAME_TAG, "joe");
-		tree.setAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG, "abcde");
-		tree.setAttribute("target-service-category", "Example");
-		tree.setAttribute("target-service-name", "Test");
-		tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.JdbcTableGatewayListener");
-		
-		SqlTableGatewayListener gateway = new SqlTableGatewayListener(tree);
-		
-		try
-		{
-			gateway.resolveComposerClass();
-		}
-		catch (ConfigurationException ex)
-		{
-			fail();
-		}
-		
-		boolean exception = false;
-		
-		try
-		{
-			gateway.prepareStatements();
-		}
-		catch (RuntimeException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		tree = new ConfigTree("test");
-
-		tree.setAttribute(JDBCEpr.URL_TAG, getDbUrl());
-		tree.setAttribute(JDBCEpr.POST_DEL_TAG, "true");
-		tree.setAttribute(JDBCEpr.ERROR_DEL_TAG, "true");
-		tree.setAttribute(JDBCEpr.DRIVER_TAG, getDbDriver());
-		tree.setAttribute(JDBCEpr.TIMESTAMP_COLUMN_TAG, "insert_timestamp");
-		tree.setAttribute(JDBCEpr.MESSAGE_ID_COLUMN_TAG, "message_id");
-		tree.setAttribute(JDBCEpr.PASSWORD_TAG, getDbPassword());
-		tree.setAttribute(JDBCEpr.STATUS_COLUMN_TAG, "status");
-		tree.setAttribute(JDBCEpr.TABLE_NAME_TAG, "esb_messages");
-		tree.setAttribute(JDBCEpr.USERNAME_TAG, getDbUser());
-		tree.setAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG, "1000");
-		tree.setAttribute("target-service-category", "Example");
-		tree.setAttribute("target-service-name", "Test");
-		tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.JdbcTableGatewayListener");
-		tree.setAttribute(ListenerTagNames.SQL_SELECT_FIELDS_TAG, "esb_messages");
-		
-		exception = false;
-		
-		try
-		{
-			gateway = new SqlTableGatewayListener(tree);
-		}
-		catch (ConfigurationException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-		
-		tree.setAttribute(ListenerTagNames.SQL_SELECT_FIELDS_TAG, "*");
-		
-		gateway = new SqlTableGatewayListener(tree);
-		
-		try
-		{
-			gateway.prepareStatements();
-		}
-		catch (RuntimeException ex)
-		{
-			log.error(ex);
-			
-			fail();
-		}
-		
-		gateway.resolveComposerClass();
-		
-		exception = false;
-		
-		try
-		{
-			gateway.doInitialise();
-		}
-		catch (ManagedLifecycleException ex)
-		{
-			exception = true;
-		}
-		
-		if (!exception)
-			fail();
-	
-		gateway.pollForCandidates();
-		
-		gateway.doDestroy();
-		
-		gateway.changeStatusToDone();
-		
-		try
-		{
-			gateway.deleteCurrentRow();
-		}
-		catch (IllegalStateException ex)
-		{
-			fail();
-		}
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListenerUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListenerUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListenerUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/SqlTableGatewayListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,199 @@
+/*
+ * 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.gateway;
+
+import java.sql.SQLException;
+import java.sql.Statement;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.common.tests.BaseTest;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.lifecycle.ManagedLifecycleException;
+
+public class SqlTableGatewayListenerUnitTest extends BaseTest
+{
+	private Logger log = Logger
+			.getLogger( SqlTableGatewayListenerUnitTest.class );
+	
+	public SqlTableGatewayListenerUnitTest ()
+	{
+	}
+	
+	public void setUp()
+	{
+		try
+		{
+			MockRegistry.install();
+			Statement stmt = getDbConnection().createStatement();
+
+			try
+			{
+				stmt.executeUpdate("DROP TABLE esb_messages");
+			}
+			catch (Exception e)
+			{
+				// Ignore
+			}
+
+			stmt.executeUpdate("CREATE TABLE esb_messages (message_id varchar NOT NULL, message varchar, status varchar, insert_timestamp bigint, CONSTRAINT pkey_esb_messages PRIMARY KEY (message_id))");
+		}
+		catch (SQLException ex)
+		{
+			log.error(ex);
+
+			fail();
+		}
+	}
+	public void tearDown()
+	{
+		MockRegistry.uninstall();
+	}
+	
+	public void testGateway () throws Exception
+	{
+		ConfigTree tree = new ConfigTree("test");
+
+		tree.setAttribute(JDBCEpr.URL_TAG, "jdbc:postgresql://myhost:5432/testDB");
+		tree.setAttribute(JDBCEpr.POST_DEL_TAG, "true");
+		tree.setAttribute(JDBCEpr.ERROR_DEL_TAG, "true");
+		tree.setAttribute(JDBCEpr.DRIVER_TAG, "org.postgresql.Driver");
+		tree.setAttribute(JDBCEpr.TIMESTAMP_COLUMN_TAG, "insert_timestamp");
+		tree.setAttribute(JDBCEpr.MESSAGE_ID_COLUMN_TAG, "message_id");
+		tree.setAttribute(JDBCEpr.PASSWORD_TAG, "secret");
+		tree.setAttribute(JDBCEpr.STATUS_COLUMN_TAG, "status");
+		tree.setAttribute(JDBCEpr.TABLE_NAME_TAG, "testtable");
+		tree.setAttribute(JDBCEpr.USERNAME_TAG, "joe");
+		tree.setAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG, "abcde");
+		tree.setAttribute("target-service-category", "Example");
+		tree.setAttribute("target-service-name", "Test");
+		tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.JdbcTableGatewayListener");
+		
+		SqlTableGatewayListener gateway = new SqlTableGatewayListener(tree);
+		
+		try
+		{
+			gateway.resolveComposerClass();
+		}
+		catch (ConfigurationException ex)
+		{
+			fail();
+		}
+		
+		boolean exception = false;
+		
+		try
+		{
+			gateway.prepareStatements();
+		}
+		catch (RuntimeException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		tree = new ConfigTree("test");
+
+		tree.setAttribute(JDBCEpr.URL_TAG, getDbUrl());
+		tree.setAttribute(JDBCEpr.POST_DEL_TAG, "true");
+		tree.setAttribute(JDBCEpr.ERROR_DEL_TAG, "true");
+		tree.setAttribute(JDBCEpr.DRIVER_TAG, getDbDriver());
+		tree.setAttribute(JDBCEpr.TIMESTAMP_COLUMN_TAG, "insert_timestamp");
+		tree.setAttribute(JDBCEpr.MESSAGE_ID_COLUMN_TAG, "message_id");
+		tree.setAttribute(JDBCEpr.PASSWORD_TAG, getDbPassword());
+		tree.setAttribute(JDBCEpr.STATUS_COLUMN_TAG, "status");
+		tree.setAttribute(JDBCEpr.TABLE_NAME_TAG, "esb_messages");
+		tree.setAttribute(JDBCEpr.USERNAME_TAG, getDbUser());
+		tree.setAttribute(ListenerTagNames.POLL_LATENCY_SECS_TAG, "1000");
+		tree.setAttribute("target-service-category", "Example");
+		tree.setAttribute("target-service-name", "Test");
+		tree.setAttribute("gatewayClass", "org.jboss.soa.esb.listeners.gateway.JdbcTableGatewayListener");
+		tree.setAttribute(ListenerTagNames.SQL_SELECT_FIELDS_TAG, "esb_messages");
+		
+		exception = false;
+		
+		try
+		{
+			gateway = new SqlTableGatewayListener(tree);
+		}
+		catch (ConfigurationException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+		
+		tree.setAttribute(ListenerTagNames.SQL_SELECT_FIELDS_TAG, "*");
+		
+		gateway = new SqlTableGatewayListener(tree);
+		
+		try
+		{
+			gateway.prepareStatements();
+		}
+		catch (RuntimeException ex)
+		{
+			log.error(ex);
+			
+			fail();
+		}
+		
+		gateway.resolveComposerClass();
+		
+		exception = false;
+		
+		try
+		{
+			gateway.doInitialise();
+		}
+		catch (ManagedLifecycleException ex)
+		{
+			exception = true;
+		}
+		
+		if (!exception)
+			fail();
+	
+		gateway.pollForCandidates();
+		
+		gateway.doDestroy();
+		
+		gateway.changeStatusToDone();
+		
+		try
+		{
+			gateway.deleteCurrentRow();
+		}
+		catch (IllegalStateException ex)
+		{
+			fail();
+		}
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/juddi-unittest.properties
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/juddi-unittest.properties	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/juddi-unittest.properties	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any 
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct 
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=org.hsqldb.jdbcDriver
-juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost/juddi
-juddi.jdbcUsername=sa
-juddi.jdbcPassword=
-# jUDDI DataSource to use
-juddi.dataSource=java:comp/env/jdbc/juddiDB
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
- 
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-  

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/juddi-unittest.properties (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/juddi-unittest.properties)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/juddi-unittest.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/juddi-unittest.properties	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any 
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct 
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=org.hsqldb.jdbcDriver
+juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost/juddi
+juddi.jdbcUsername=sa
+juddi.jdbcPassword=
+# jUDDI DataSource to use
+juddi.dataSource=java:comp/env/jdbc/juddiDB
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+ 
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+  

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,143 +0,0 @@
-package org.jboss.soa.esb.listeners.gateway.remotestrategies;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.File;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.cache.CacheException;
-import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.FtpFileCacheTestUtil;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-import org.junit.AfterClass;
-import org.junit.Before;
-import org.junit.BeforeClass;
-import org.junit.Ignore;
-import org.junit.Test;
-
-/**
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- *
- */
-public class ReadOnlyRemoteFileSystemStrategyUnitTest
-{
-	private static Logger log = Logger .getLogger( ReadOnlyRemoteFileSystemStrategyUnitTest.class );
-	
-	private static ReadOnlyRemoteFileSystemStrategy strategy;
-
-	private static ReadOnlyRemoteFileSystemStrategy strategy2;
-	
-	private String testFile1 = "testFile1";
-	private String testFile2 = "testFile2";
-	private String testFile3 = "testFile3";
-	
-	private File[] expectedFileList = new File[] { new File( testFile1 ) , new File( testFile2 ) };
-	private File[] newFileList = new File[] { new File( testFile3 ) };
-	private File[] emptyFileList = new File[] {};
-	
-	@Test
-	public void listFilesNegative() 
-	{
-		try
-		{
-			strategy.filterFileList( null );
-		} 
-		catch (RemoteFileSystemStrategyException e)
-		{
-			fail("Should be ok to pass null as the file array!");
-		}
-	}
-	
-	@Test
-	public void listFiles() throws RemoteFileSystemStrategyException 
-	{
-		File[] filteredFileList = strategy.filterFileList( expectedFileList );
-		assertEquals( expectedFileList, filteredFileList );
-		
-		filteredFileList = strategy.filterFileList( expectedFileList );
-		assertEquals( "No files should have been returned. They should have been cached.", emptyFileList, filteredFileList );
-		
-		filteredFileList = strategy.filterFileList( newFileList );
-		assertEquals( newFileList, filteredFileList );
-		assertTrue ( filteredFileList instanceof File[] );
-	}
-	
-	@Test
-	public void listFiles_With_Two_Strategy_Instances() throws Exception 
-	{
-		
-		try
-		{
-			File[] filteredFileList = strategy2.filterFileList( expectedFileList );
-			assertEquals( expectedFileList, filteredFileList );
-			
-			filteredFileList = strategy.filterFileList( expectedFileList );
-			assertEquals( emptyFileList, filteredFileList );
-			
-			filteredFileList = strategy2.filterFileList( newFileList );
-			assertEquals( newFileList, filteredFileList );
-			
-			filteredFileList = strategy.filterFileList( newFileList );
-			assertEquals( emptyFileList, filteredFileList );
-			
-		}
-		catch ( Exception e )
-		{
-			log.error(e);
-		}
-		finally
-		{
-			strategy2.stop();
-		}
-		
-	}
-	
-	@Before
-	public void setup() throws CacheException
-	{
-		strategy.removeAllData();
-	}
-	
-	@BeforeClass
-	public static void classSetup() throws Exception
-	{
-		registerHsqlDriver();
-		HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir() + "build" + File.separator + "hsqltestdb", "ftpcache");
-		
-		strategy = new ReadOnlyRemoteFileSystemStrategy();
-		strategy.init( FtpFileCacheTestUtil.getCacheConfigFile() );
-		
-		strategy2 = new ReadOnlyRemoteFileSystemStrategy();
-		strategy2.init( FtpFileCacheTestUtil.getCacheConfigFile() );
-	}
-		
-	private static void registerHsqlDriver()
-	{
-		try 
-		{
-			Class.forName( "org.hsqldb.jdbcDriver" );
-		} 
-		catch (Exception e) 
-		{
-			fail( "ERROR: failed to load JDBC driver." + e.getMessage() );
-		}
-	}
-	
-	@AfterClass
-	public static void classTearDown() throws Exception
-	{
-		strategy.stop();
-		strategy2.stop();
-                HsqldbUtil.stopHsqldb( "jdbc:hsqldb:hsql://localhost:9001/ftpcache", "sa", "" );
-	}
-	
-	public static junit.framework.Test suite()
-	{
-		return new JUnit4TestAdapter(ReadOnlyRemoteFileSystemStrategyUnitTest.class);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/ReadOnlyRemoteFileSystemStrategyUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,143 @@
+package org.jboss.soa.esb.listeners.gateway.remotestrategies;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.File;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.cache.CacheException;
+import org.jboss.soa.esb.listeners.gateway.remotestrategies.cache.FtpFileCacheTestUtil;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+import org.junit.AfterClass;
+import org.junit.Before;
+import org.junit.BeforeClass;
+import org.junit.Ignore;
+import org.junit.Test;
+
+/**
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ *
+ */
+public class ReadOnlyRemoteFileSystemStrategyUnitTest
+{
+	private static Logger log = Logger .getLogger( ReadOnlyRemoteFileSystemStrategyUnitTest.class );
+	
+	private static ReadOnlyRemoteFileSystemStrategy strategy;
+
+	private static ReadOnlyRemoteFileSystemStrategy strategy2;
+	
+	private String testFile1 = "testFile1";
+	private String testFile2 = "testFile2";
+	private String testFile3 = "testFile3";
+	
+	private File[] expectedFileList = new File[] { new File( testFile1 ) , new File( testFile2 ) };
+	private File[] newFileList = new File[] { new File( testFile3 ) };
+	private File[] emptyFileList = new File[] {};
+	
+	@Test
+	public void listFilesNegative() 
+	{
+		try
+		{
+			strategy.filterFileList( null );
+		} 
+		catch (RemoteFileSystemStrategyException e)
+		{
+			fail("Should be ok to pass null as the file array!");
+		}
+	}
+	
+	@Test
+	public void listFiles() throws RemoteFileSystemStrategyException 
+	{
+		File[] filteredFileList = strategy.filterFileList( expectedFileList );
+		assertEquals( expectedFileList, filteredFileList );
+		
+		filteredFileList = strategy.filterFileList( expectedFileList );
+		assertEquals( "No files should have been returned. They should have been cached.", emptyFileList, filteredFileList );
+		
+		filteredFileList = strategy.filterFileList( newFileList );
+		assertEquals( newFileList, filteredFileList );
+		assertTrue ( filteredFileList instanceof File[] );
+	}
+	
+	@Test
+	public void listFiles_With_Two_Strategy_Instances() throws Exception 
+	{
+		
+		try
+		{
+			File[] filteredFileList = strategy2.filterFileList( expectedFileList );
+			assertEquals( expectedFileList, filteredFileList );
+			
+			filteredFileList = strategy.filterFileList( expectedFileList );
+			assertEquals( emptyFileList, filteredFileList );
+			
+			filteredFileList = strategy2.filterFileList( newFileList );
+			assertEquals( newFileList, filteredFileList );
+			
+			filteredFileList = strategy.filterFileList( newFileList );
+			assertEquals( emptyFileList, filteredFileList );
+			
+		}
+		catch ( Exception e )
+		{
+			log.error(e);
+		}
+		finally
+		{
+			strategy2.stop();
+		}
+		
+	}
+	
+	@Before
+	public void setup() throws CacheException
+	{
+		strategy.removeAllData();
+	}
+	
+	@BeforeClass
+	public static void classSetup() throws Exception
+	{
+		registerHsqlDriver();
+		HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir() + "build" + File.separator + "hsqltestdb", "ftpcache");
+		
+		strategy = new ReadOnlyRemoteFileSystemStrategy();
+		strategy.init( FtpFileCacheTestUtil.getCacheConfigFile() );
+		
+		strategy2 = new ReadOnlyRemoteFileSystemStrategy();
+		strategy2.init( FtpFileCacheTestUtil.getCacheConfigFile() );
+	}
+		
+	private static void registerHsqlDriver()
+	{
+		try 
+		{
+			Class.forName( "org.hsqldb.jdbcDriver" );
+		} 
+		catch (Exception e) 
+		{
+			fail( "ERROR: failed to load JDBC driver." + e.getMessage() );
+		}
+	}
+	
+	@AfterClass
+	public static void classTearDown() throws Exception
+	{
+		strategy.stop();
+		strategy2.stop();
+                HsqldbUtil.stopHsqldb( "jdbc:hsqldb:hsql://localhost:9001/ftpcache", "sa", "" );
+	}
+	
+	public static junit.framework.Test suite()
+	{
+		return new JUnit4TestAdapter(ReadOnlyRemoteFileSystemStrategyUnitTest.class);
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListenerUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,156 +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.gateway.remotestrategies.cache;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.cache.CacheException;
-import org.jboss.cache.Fqn;
-import org.jboss.cache.Node;
-import org.jboss.cache.TreeCache;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-import org.w3c.dom.NamedNodeMap;
-import org.w3c.dom.NodeList;
-
-/**
- * 
- * @author Daniel Bevenius
- *
- */
-public class DeleteOnEvictTreeCacheListenerUnitTest 
-{
-	@SuppressWarnings("unused")
-	private Logger log = Logger .getLogger( DeleteOnEvictTreeCacheListenerUnitTest.class );
-	
-	private static DeleteOnEvictTreeCacheListener listener;
-	private static TreeCache treeCache;
-	
-	private static final String FQN = "test/junit";
-	private String key = "testKey";
-	private String value = "testValue";
-	private Fqn fqnTest = new Fqn ( new String[] { FQN, key, value} );
-	
-	@Test( expected=IllegalArgumentException.class )
-	public void constructor()
-	{
-		new DeleteOnEvictTreeCacheListener( null );
-	}
-	
-	@Test
-	public void nodeEvict() throws CacheException
-	{
-		treeCache.put( FQN, key, value );
-		Node node = treeCache.get( fqnTest );
-		assertTrue( "The value should have been added!",  treeCache.exists( FQN, key ) );
-		
-		listener.nodeEvicted( fqnTest );
-		node = treeCache.get( fqnTest );
-		assertFalse( "The value should have been removed upon eviction!",  treeCache.exists( fqnTest ) );
-		
-		node = treeCache.get( fqnTest );
-		assertNull ( "The node should have been removed from the cache store", node );
-	}
-	
-	@Test
-	public void testCacheRestart() throws Exception
-	{
-		treeCache.put( FQN, key, value );
-		Object valueBeforeCacheShutdown = treeCache.get( FQN, key );
-		treeCache.stop();
-		treeCache.start();
-		Object valueAfterCacheShutdown = treeCache.get( FQN, key );
-		assertEquals( "Objects should be equal even after a treeCache restart", valueBeforeCacheShutdown, valueAfterCacheShutdown );
-	}
-	
-	@BeforeClass
-	public static void classSetup() throws Exception
-	{
-		FtpFileCacheTestUtil.startDB();
-		startCache();
-	}
-	
-	private static void startCache() throws Exception
-	{
-		treeCache = new TreeCache();
-		listener = new DeleteOnEvictTreeCacheListener( treeCache );
-		treeCache.addTreeCacheListener( listener );
-		FtpFileCacheTestUtil.createTreeCache( treeCache, FtpFileCacheTestUtil.getCacheConfigFile() );
-		treeCache.start();
-	}
-	
-	private static void stopCache()
-	{
-		treeCache.stop();
-	}
-	
-	@AfterClass
-	public static void classTearDown() throws Exception
-	{
-		FtpFileCacheTestUtil.stopDB();
-		stopCache();
-	}
-	
-	public static junit.framework.Test suite() 
-	{
-		return new JUnit4TestAdapter( FtpFileCacheUnitTest.class );
-	}
-	
-	@SuppressWarnings("unused")
-	private int getMaxAgeSeconds()
-	{
-		int maxAgeSeconds = 0;
-		NodeList elementsByTagName = treeCache.getEvictionPolicyConfig().getElementsByTagName( "region" );
-		for ( int i = elementsByTagName.getLength() ; i-->0 ; )
-		{
-			org.w3c.dom.Node region = elementsByTagName.item( i );
-			NamedNodeMap attributes = region.getAttributes();
-			org.w3c.dom.Node fqnNameNode = attributes.getNamedItem( "name" );
-			if ( fqnNameNode.getNodeValue().equals( "/ftp/cache" ))
-			{
-				NodeList childNodes = region.getChildNodes();
-				for ( int y = 0 ; y < childNodes.getLength() ; y ++ )
-				{
-					org.w3c.dom.Node node = childNodes.item( y );
-					if ( node.getNodeName().equals( "attribute" ))
-					{
-						NamedNodeMap attributes2 = node.getAttributes();
-						org.w3c.dom.Node namedItem = attributes2.getNamedItem( "name" );
-						if ( namedItem.getNodeValue().equals("maxAgeSeconds") )
-						{
-							maxAgeSeconds = Integer.valueOf( node.getTextContent() );
-							break;
-						}
-					}
-				}
-			}
-		}
-		return maxAgeSeconds;
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListenerUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListenerUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListenerUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/DeleteOnEvictTreeCacheListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,156 @@
+/*
+ * 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.gateway.remotestrategies.cache;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.cache.CacheException;
+import org.jboss.cache.Fqn;
+import org.jboss.cache.Node;
+import org.jboss.cache.TreeCache;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+import org.w3c.dom.NamedNodeMap;
+import org.w3c.dom.NodeList;
+
+/**
+ * 
+ * @author Daniel Bevenius
+ *
+ */
+public class DeleteOnEvictTreeCacheListenerUnitTest 
+{
+	@SuppressWarnings("unused")
+	private Logger log = Logger .getLogger( DeleteOnEvictTreeCacheListenerUnitTest.class );
+	
+	private static DeleteOnEvictTreeCacheListener listener;
+	private static TreeCache treeCache;
+	
+	private static final String FQN = "test/junit";
+	private String key = "testKey";
+	private String value = "testValue";
+	private Fqn fqnTest = new Fqn ( new String[] { FQN, key, value} );
+	
+	@Test( expected=IllegalArgumentException.class )
+	public void constructor()
+	{
+		new DeleteOnEvictTreeCacheListener( null );
+	}
+	
+	@Test
+	public void nodeEvict() throws CacheException
+	{
+		treeCache.put( FQN, key, value );
+		Node node = treeCache.get( fqnTest );
+		assertTrue( "The value should have been added!",  treeCache.exists( FQN, key ) );
+		
+		listener.nodeEvicted( fqnTest );
+		node = treeCache.get( fqnTest );
+		assertFalse( "The value should have been removed upon eviction!",  treeCache.exists( fqnTest ) );
+		
+		node = treeCache.get( fqnTest );
+		assertNull ( "The node should have been removed from the cache store", node );
+	}
+	
+	@Test
+	public void testCacheRestart() throws Exception
+	{
+		treeCache.put( FQN, key, value );
+		Object valueBeforeCacheShutdown = treeCache.get( FQN, key );
+		treeCache.stop();
+		treeCache.start();
+		Object valueAfterCacheShutdown = treeCache.get( FQN, key );
+		assertEquals( "Objects should be equal even after a treeCache restart", valueBeforeCacheShutdown, valueAfterCacheShutdown );
+	}
+	
+	@BeforeClass
+	public static void classSetup() throws Exception
+	{
+		FtpFileCacheTestUtil.startDB();
+		startCache();
+	}
+	
+	private static void startCache() throws Exception
+	{
+		treeCache = new TreeCache();
+		listener = new DeleteOnEvictTreeCacheListener( treeCache );
+		treeCache.addTreeCacheListener( listener );
+		FtpFileCacheTestUtil.createTreeCache( treeCache, FtpFileCacheTestUtil.getCacheConfigFile() );
+		treeCache.start();
+	}
+	
+	private static void stopCache()
+	{
+		treeCache.stop();
+	}
+	
+	@AfterClass
+	public static void classTearDown() throws Exception
+	{
+		FtpFileCacheTestUtil.stopDB();
+		stopCache();
+	}
+	
+	public static junit.framework.Test suite() 
+	{
+		return new JUnit4TestAdapter( FtpFileCacheUnitTest.class );
+	}
+	
+	@SuppressWarnings("unused")
+	private int getMaxAgeSeconds()
+	{
+		int maxAgeSeconds = 0;
+		NodeList elementsByTagName = treeCache.getEvictionPolicyConfig().getElementsByTagName( "region" );
+		for ( int i = elementsByTagName.getLength() ; i-->0 ; )
+		{
+			org.w3c.dom.Node region = elementsByTagName.item( i );
+			NamedNodeMap attributes = region.getAttributes();
+			org.w3c.dom.Node fqnNameNode = attributes.getNamedItem( "name" );
+			if ( fqnNameNode.getNodeValue().equals( "/ftp/cache" ))
+			{
+				NodeList childNodes = region.getChildNodes();
+				for ( int y = 0 ; y < childNodes.getLength() ; y ++ )
+				{
+					org.w3c.dom.Node node = childNodes.item( y );
+					if ( node.getNodeName().equals( "attribute" ))
+					{
+						NamedNodeMap attributes2 = node.getAttributes();
+						org.w3c.dom.Node namedItem = attributes2.getNamedItem( "name" );
+						if ( namedItem.getNodeValue().equals("maxAgeSeconds") )
+						{
+							maxAgeSeconds = Integer.valueOf( node.getTextContent() );
+							break;
+						}
+					}
+				}
+			}
+		}
+		return maxAgeSeconds;
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,95 +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.gateway.remotestrategies.cache;
-
-import static org.junit.Assert.fail;
-
-import java.io.File;
-
-import org.jboss.cache.ConfigureException;
-import org.jboss.cache.PropertyConfigurator;
-import org.jboss.cache.TreeCache;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-
-/**
- * Simple helper class with util method for getting a cache config
- * file.
- * 
- * @author Daniel Bevenius				
- *
- */
-public class FtpFileCacheTestUtil
-{
-	public static String getCacheConfigFile()
-	{
-		String configFile = TestEnvironmentUtil.getBaseDir() + File.separator + 
-							"rosetta" + File.separator + 
-							"tests" + File.separator + 
-							"src" + File.separator + 
-							"org" + File.separator + 
-							"jboss" + File.separator + 
-							"soa" + File.separator + 
-							"esb" + File.separator + 
-							"listeners" + File.separator + 
-							"gateway" + File.separator + 
-							"remotestrategies" + File.separator + 
-							"cache" + File.separator + 
-							"ftpfile_cache_test.xml";
-		
-		if ( ! new File ( configFile ).exists() )
-			fail( "Could not locate the jboss cache config file: " +  configFile );
-		
-		return configFile;
-	}
-	
-	public static void createTreeCache( TreeCache treeCache, String pathToConfigFile ) throws ConfigureException
-	{
-		PropertyConfigurator configurator = new PropertyConfigurator();
-		configurator.configure( treeCache, pathToConfigFile );
-	}
-	
-	public static void startDB() throws Exception
-	{
-		
-		registerHsqlDriver();
-		HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir() + "build" + File.separator + "hsqltestdb", "ftpcache");
-	}
-	
-	private static void registerHsqlDriver()
-	{
-		try 
-		{
-			Class.forName( "org.hsqldb.jdbcDriver" );
-		} 
-		catch (Exception e) 
-		{
-			fail( "ERROR: failed to load JDBC driver." + e.getMessage() );
-		}
-	}
-	
-	public static void stopDB() throws Exception 
-	{
-		HsqldbUtil.stopHsqldb( "jdbc:hsqldb:hsql://localhost:9001/ftpcache", "sa", "" );
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheTestUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,95 @@
+/*
+ * 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.gateway.remotestrategies.cache;
+
+import static org.junit.Assert.fail;
+
+import java.io.File;
+
+import org.jboss.cache.ConfigureException;
+import org.jboss.cache.PropertyConfigurator;
+import org.jboss.cache.TreeCache;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+
+/**
+ * Simple helper class with util method for getting a cache config
+ * file.
+ * 
+ * @author Daniel Bevenius				
+ *
+ */
+public class FtpFileCacheTestUtil
+{
+	public static String getCacheConfigFile()
+	{
+		String configFile = TestEnvironmentUtil.getBaseDir() + File.separator + 
+							"rosetta" + File.separator + 
+							"tests" + File.separator + 
+							"src" + File.separator + 
+							"org" + File.separator + 
+							"jboss" + File.separator + 
+							"soa" + File.separator + 
+							"esb" + File.separator + 
+							"listeners" + File.separator + 
+							"gateway" + File.separator + 
+							"remotestrategies" + File.separator + 
+							"cache" + File.separator + 
+							"ftpfile_cache_test.xml";
+		
+		if ( ! new File ( configFile ).exists() )
+			fail( "Could not locate the jboss cache config file: " +  configFile );
+		
+		return configFile;
+	}
+	
+	public static void createTreeCache( TreeCache treeCache, String pathToConfigFile ) throws ConfigureException
+	{
+		PropertyConfigurator configurator = new PropertyConfigurator();
+		configurator.configure( treeCache, pathToConfigFile );
+	}
+	
+	public static void startDB() throws Exception
+	{
+		
+		registerHsqlDriver();
+		HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir() + "build" + File.separator + "hsqltestdb", "ftpcache");
+	}
+	
+	private static void registerHsqlDriver()
+	{
+		try 
+		{
+			Class.forName( "org.hsqldb.jdbcDriver" );
+		} 
+		catch (Exception e) 
+		{
+			fail( "ERROR: failed to load JDBC driver." + e.getMessage() );
+		}
+	}
+	
+	public static void stopDB() throws Exception 
+	{
+		HsqldbUtil.stopHsqldb( "jdbc:hsqldb:hsql://localhost:9001/ftpcache", "sa", "" );
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,120 +0,0 @@
-package org.jboss.soa.esb.listeners.gateway.remotestrategies.cache;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertNull;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-
-import java.io.InputStream;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Logger;
-import org.jboss.cache.CacheException;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-
-
-/**
- * Test class FtpFileCache
- * 
- * @author Daniel Bevenius
- *
- */
-public class FtpFileCacheUnitTest
-{
-	private static Logger log = Logger.getLogger(FtpFileCacheUnitTest.class);
-	
-	private static FtpFileCache ftpfileCache;
-
-	@Test
-	public void getConfigInputStream_From_Classpath() throws Exception
-	{
-		String configPath_CP = "/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml";
-		InputStream configInputStream = ftpfileCache.getConfigInputStream( configPath_CP );
-		assertNotNull( "InputStream was null", configInputStream );
-	}
-	
-	@Test 
-	public void getPutAndRemove()
-	{
-		String fileName = "testfile1";
-		try
-		{
-			ftpfileCache.putFileName( fileName );
-			
-			Object obj = ftpfileCache.getFileName( fileName );
-			assertTrue( obj instanceof String );
-			
-			String actualFileName = (String) obj;
-			assertEquals( fileName, actualFileName );
-		}
-		catch (CacheException e)
-		{
-			fail ( e.getMessage() );
-		}
-		finally
-		{
-			try { ftpfileCache.deleteFile( fileName ); } catch (CacheException e) { log.error( e.getMessage() ); }
-		}
-	}
-	
-	@Test 
-	public void addCacheListenerNegative()
-	{
-		try
-		{
-			ftpfileCache.addCacheListener( null );
-		}
-		catch ( Exception e )
-		{
-			fail("Should be ok to pass a null listener! Exception was : "+ e.getMessage() ); 
-		}
-	}
-	
-	@Test
-	public void fileExists() throws CacheException
-	{
-		String fileName = "testfile1";
-		
-		ftpfileCache.putFileName( fileName );
-	
-		boolean fileExistsInCache =  ftpfileCache.containsFile( fileName );
-		assertTrue ( fileExistsInCache );
-	}
-	
-	@Test
-	public void removeAll() throws CacheException 
-	{
-		String fileName = "testfile3";
-		ftpfileCache.putFileName( fileName );
-		ftpfileCache.removeAll();
-		assertNull ( ftpfileCache.getFileName( fileName ));
-		
-	}
-	
-	@BeforeClass
-	public static void classSetup() throws Exception
-	{
-		FtpFileCacheTestUtil.startDB();
-		
-		ftpfileCache = new FtpFileCache ( FtpFileCacheTestUtil.getCacheConfigFile() );
-		ftpfileCache.start();
-	}
-	
-	
-	@AfterClass
-	public static void classTearDown() throws Exception 
-	{
-		ftpfileCache.stop();
-		FtpFileCacheTestUtil.stopDB();
-	}
-	
-	public static junit.framework.Test suite() 
-	{
-		return new JUnit4TestAdapter( FtpFileCacheUnitTest.class );
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/FtpFileCacheUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,120 @@
+package org.jboss.soa.esb.listeners.gateway.remotestrategies.cache;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
+import java.io.InputStream;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Logger;
+import org.jboss.cache.CacheException;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+
+
+/**
+ * Test class FtpFileCache
+ * 
+ * @author Daniel Bevenius
+ *
+ */
+public class FtpFileCacheUnitTest
+{
+	private static Logger log = Logger.getLogger(FtpFileCacheUnitTest.class);
+	
+	private static FtpFileCache ftpfileCache;
+
+	@Test
+	public void getConfigInputStream_From_Classpath() throws Exception
+	{
+		String configPath_CP = "/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml";
+		InputStream configInputStream = ftpfileCache.getConfigInputStream( configPath_CP );
+		assertNotNull( "InputStream was null", configInputStream );
+	}
+	
+	@Test 
+	public void getPutAndRemove()
+	{
+		String fileName = "testfile1";
+		try
+		{
+			ftpfileCache.putFileName( fileName );
+			
+			Object obj = ftpfileCache.getFileName( fileName );
+			assertTrue( obj instanceof String );
+			
+			String actualFileName = (String) obj;
+			assertEquals( fileName, actualFileName );
+		}
+		catch (CacheException e)
+		{
+			fail ( e.getMessage() );
+		}
+		finally
+		{
+			try { ftpfileCache.deleteFile( fileName ); } catch (CacheException e) { log.error( e.getMessage() ); }
+		}
+	}
+	
+	@Test 
+	public void addCacheListenerNegative()
+	{
+		try
+		{
+			ftpfileCache.addCacheListener( null );
+		}
+		catch ( Exception e )
+		{
+			fail("Should be ok to pass a null listener! Exception was : "+ e.getMessage() ); 
+		}
+	}
+	
+	@Test
+	public void fileExists() throws CacheException
+	{
+		String fileName = "testfile1";
+		
+		ftpfileCache.putFileName( fileName );
+	
+		boolean fileExistsInCache =  ftpfileCache.containsFile( fileName );
+		assertTrue ( fileExistsInCache );
+	}
+	
+	@Test
+	public void removeAll() throws CacheException 
+	{
+		String fileName = "testfile3";
+		ftpfileCache.putFileName( fileName );
+		ftpfileCache.removeAll();
+		assertNull ( ftpfileCache.getFileName( fileName ));
+		
+	}
+	
+	@BeforeClass
+	public static void classSetup() throws Exception
+	{
+		FtpFileCacheTestUtil.startDB();
+		
+		ftpfileCache = new FtpFileCache ( FtpFileCacheTestUtil.getCacheConfigFile() );
+		ftpfileCache.start();
+	}
+	
+	
+	@AfterClass
+	public static void classTearDown() throws Exception 
+	{
+		ftpfileCache.stop();
+		FtpFileCacheTestUtil.stopDB();
+	}
+	
+	public static junit.framework.Test suite() 
+	{
+		return new JUnit4TestAdapter( FtpFileCacheUnitTest.class );
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,146 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!--
-	This file is a copy of the one in core/listeners/test/resources/etc and only here
-	to test the ability to specify a configuration file relative to the classes classpath.
--->
-<server>
-
-    <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
-
-    <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
-
-        <depends>jboss:service=Naming</depends>
-        <depends>jboss:service=TransactionManager</depends>
-
-        <!-- Configure the TransactionManager -->
-        <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
-
-        <!-- Isolation level : SERIALIZABLE REPEATABLE_READ (default) READ_COMMITTED READ_UNCOMMITTED NONE -->
-        <!--attribute name="IsolationLevel">REPEATABLE_READ</attribute-->
-        <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
-
-        <!-- Valid modes are LOCAL, REPL_ASYNC and REPL_SYNC -->
-        <attribute name="CacheMode">REPL_SYNC</attribute>
-
-        <!-- Just used for async repl: use a replication queue -->
-        <attribute name="UseReplQueue">false</attribute>
-
-        <!-- Replication interval for replication queue (in ms) -->
-        <attribute name="ReplQueueInterval">0</attribute>
-
-        <!-- Max number of elements which trigger replication -->
-        <attribute name="ReplQueueMaxElements">0</attribute>
-
-        <!-- Name of cluster. Needs to be the same for all clusters, in order to find each other -->
-        <attribute name="ClusterName">FtpFileCache-Cluster</attribute>
-
-        <attribute name="ClusterConfig">
-            <config>
-                <UDP mcast_addr="228.1.2.3" mcast_port="48866" 
-					bind_addr="localhost"
-					receive_on_all_interfaces="true"
-					send_on_all_interfaces="true"
-                    ip_ttl="64" ip_mcast="true" 
-                    mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
-                    ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
-                    loopback="false"/>
-                <PING timeout="2000" num_initial_members="2" up_thread="false" down_thread="false"/>
-                <MERGE2 min_interval="10000" max_interval="20000"/>
-                <!--        <FD shun="true" up_thread="true" down_thread="true" />-->
-                <FD_SOCK/>
-                <VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false"/>
-                <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800" max_xmit_size="8192" up_thread="false" down_thread="false"/>
-                <UNICAST timeout="600,1200,2400" down_thread="false"/>
-                <pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false"/>
-                <FRAG frag_size="8192" down_thread="false" up_thread="false"/>
-                <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true" print_local_addr="true"/>
-                <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
-            </config>
-        </attribute>
-
-        <!-- Whether or not to fetch state on joining a cluster -->
-        <attribute name="FetchStateOnStartup">true</attribute>
-
-        <!--
-            The max amount of time (in milliseconds) we wait until the
-            initial state (ie. the contents of the cache) are retrieved from
-            existing members in a clustered environment
-        -->
-        <attribute name="InitialStateRetrievalTimeout">10000</attribute>
-
-        <!--
-            Number of milliseconds to wait until all responses for a
-            synchronous call have been received.
-        -->
-        <attribute name="SyncReplTimeout">10000</attribute>
-
-        <!-- Max number of milliseconds to wait for a lock acquisition -->
-        <attribute name="LockAcquisitionTimeout">15000</attribute>
-
-
-        <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
-		<attribute name="EvictionPolicyConfig">
-			<config>
-				<attribute name="wakeUpIntervalSeconds">30</attribute>
-				<!-- Cache wide default -->
-				<region name="/_default_">
-					<attribute name="maxNodes">5000</attribute>
-					<attribute name="timeToLiveSeconds">1000</attribute>
-				</region>
-				<region name="/ftp/cache">
-					<attribute name="maxNodes">5000</attribute>
-					<attribute name="timeToLiveSeconds">1000</attribute>
-					<attribute name="maxAgeSeconds">86400</attribute>
-		      </region>
-		   </config>
-		</attribute>
-		
-		<attribute name="CacheLoaderConfiguration">
-	        <config>
-				<!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
-				<passivation>true</passivation>
-				
-				<!-- comma delimited FQNs to preload -->
-				<preload>/ftp/cache</preload>
-				
-				<!-- are the cache loaders shared in a cluster? -->
-				<shared>false</shared>
-				
-				<!-- we can now have multiple cache loaders, which get chained -->
-				<!-- the 'cacheloader' element may be repeated -->
-				<cacheloader>
-					<class>org.jboss.cache.loader.JDBCCacheLoader</class>
-					<properties>
-						cache.jdbc.driver=org.hsqldb.jdbcDriver
-						cache.jdbc.url=jdbc:hsqldb:hsql://localhost:9001/ftpcache
-						cache.jdbc.user=sa
-						cache.jdbc.password=
-					</properties>
-					<!-- whether the cache loader writes are asynchronous -->
-					<async>false</async>
-					
-					<!-- only one cache loader in the chain may set fetchPersistentState to true.
-					An exception is thrown if more than one cache loader sets this to true. -->
-					<fetchPersistentState>false</fetchPersistentState>
-					
-					<!-- determines whether this cache loader ignores writes - defaults to false. -->
-					<ignoreModifications>false</ignoreModifications>
-					
-					<!-- if set to true, purges the contents of this cache loader when the cache starts u Defaults to false. -->
-					<purgeOnStartup>false</purgeOnStartup>
-					
-				</cacheloader>
-			</config>
-		</attribute>
-        
-    </mbean>
-
-
-   <!--  Uncomment to get a graphical view of the TreeCache MBean above -->
-   <!--   <mbean code="org.jboss.cache.TreeCacheView" name="jboss.cache:service=TreeCacheView">-->
-   <!--      <depends>jboss.cache:service=TreeCache</depends>-->
-   <!--      <attribute name="CacheService">jboss.cache:service=TreeCache</attribute>-->
-   <!--   </mbean>-->
-
-
-</server>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/remotestrategies/cache/ftpfile_cache_test.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,146 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+	This file is a copy of the one in core/listeners/test/resources/etc and only here
+	to test the ability to specify a configuration file relative to the classes classpath.
+-->
+<server>
+
+    <classpath codebase="./lib" archives="jboss-cache.jar, jgroups.jar"/>
+
+    <mbean code="org.jboss.cache.TreeCache" name="jboss.cache:service=TreeCache">
+
+        <depends>jboss:service=Naming</depends>
+        <depends>jboss:service=TransactionManager</depends>
+
+        <!-- Configure the TransactionManager -->
+        <attribute name="TransactionManagerLookupClass">org.jboss.cache.DummyTransactionManagerLookup</attribute>
+
+        <!-- Isolation level : SERIALIZABLE REPEATABLE_READ (default) READ_COMMITTED READ_UNCOMMITTED NONE -->
+        <!--attribute name="IsolationLevel">REPEATABLE_READ</attribute-->
+        <attribute name="IsolationLevel">REPEATABLE_READ</attribute>
+
+        <!-- Valid modes are LOCAL, REPL_ASYNC and REPL_SYNC -->
+        <attribute name="CacheMode">REPL_SYNC</attribute>
+
+        <!-- Just used for async repl: use a replication queue -->
+        <attribute name="UseReplQueue">false</attribute>
+
+        <!-- Replication interval for replication queue (in ms) -->
+        <attribute name="ReplQueueInterval">0</attribute>
+
+        <!-- Max number of elements which trigger replication -->
+        <attribute name="ReplQueueMaxElements">0</attribute>
+
+        <!-- Name of cluster. Needs to be the same for all clusters, in order to find each other -->
+        <attribute name="ClusterName">FtpFileCache-Cluster</attribute>
+
+        <attribute name="ClusterConfig">
+            <config>
+                <UDP mcast_addr="228.1.2.3" mcast_port="48866" 
+					bind_addr="localhost"
+					receive_on_all_interfaces="true"
+					send_on_all_interfaces="true"
+                    ip_ttl="64" ip_mcast="true" 
+                    mcast_send_buf_size="150000" mcast_recv_buf_size="80000"
+                    ucast_send_buf_size="150000" ucast_recv_buf_size="80000"
+                    loopback="false"/>
+                <PING timeout="2000" num_initial_members="2" up_thread="false" down_thread="false"/>
+                <MERGE2 min_interval="10000" max_interval="20000"/>
+                <!--        <FD shun="true" up_thread="true" down_thread="true" />-->
+                <FD_SOCK/>
+                <VERIFY_SUSPECT timeout="1500" up_thread="false" down_thread="false"/>
+                <pbcast.NAKACK gc_lag="50" retransmit_timeout="600,1200,2400,4800" max_xmit_size="8192" up_thread="false" down_thread="false"/>
+                <UNICAST timeout="600,1200,2400" down_thread="false"/>
+                <pbcast.STABLE desired_avg_gossip="20000" up_thread="false" down_thread="false"/>
+                <FRAG frag_size="8192" down_thread="false" up_thread="false"/>
+                <pbcast.GMS join_timeout="5000" join_retry_timeout="2000" shun="true" print_local_addr="true"/>
+                <pbcast.STATE_TRANSFER up_thread="true" down_thread="true"/>
+            </config>
+        </attribute>
+
+        <!-- Whether or not to fetch state on joining a cluster -->
+        <attribute name="FetchStateOnStartup">true</attribute>
+
+        <!--
+            The max amount of time (in milliseconds) we wait until the
+            initial state (ie. the contents of the cache) are retrieved from
+            existing members in a clustered environment
+        -->
+        <attribute name="InitialStateRetrievalTimeout">10000</attribute>
+
+        <!--
+            Number of milliseconds to wait until all responses for a
+            synchronous call have been received.
+        -->
+        <attribute name="SyncReplTimeout">10000</attribute>
+
+        <!-- Max number of milliseconds to wait for a lock acquisition -->
+        <attribute name="LockAcquisitionTimeout">15000</attribute>
+
+
+        <attribute name="EvictionPolicyClass">org.jboss.cache.eviction.LRUPolicy</attribute>
+		<attribute name="EvictionPolicyConfig">
+			<config>
+				<attribute name="wakeUpIntervalSeconds">30</attribute>
+				<!-- Cache wide default -->
+				<region name="/_default_">
+					<attribute name="maxNodes">5000</attribute>
+					<attribute name="timeToLiveSeconds">1000</attribute>
+				</region>
+				<region name="/ftp/cache">
+					<attribute name="maxNodes">5000</attribute>
+					<attribute name="timeToLiveSeconds">1000</attribute>
+					<attribute name="maxAgeSeconds">86400</attribute>
+		      </region>
+		   </config>
+		</attribute>
+		
+		<attribute name="CacheLoaderConfiguration">
+	        <config>
+				<!-- if passivation is true, only the first cache loader is used; the rest are ignored -->
+				<passivation>true</passivation>
+				
+				<!-- comma delimited FQNs to preload -->
+				<preload>/ftp/cache</preload>
+				
+				<!-- are the cache loaders shared in a cluster? -->
+				<shared>false</shared>
+				
+				<!-- we can now have multiple cache loaders, which get chained -->
+				<!-- the 'cacheloader' element may be repeated -->
+				<cacheloader>
+					<class>org.jboss.cache.loader.JDBCCacheLoader</class>
+					<properties>
+						cache.jdbc.driver=org.hsqldb.jdbcDriver
+						cache.jdbc.url=jdbc:hsqldb:hsql://localhost:9001/ftpcache
+						cache.jdbc.user=sa
+						cache.jdbc.password=
+					</properties>
+					<!-- whether the cache loader writes are asynchronous -->
+					<async>false</async>
+					
+					<!-- only one cache loader in the chain may set fetchPersistentState to true.
+					An exception is thrown if more than one cache loader sets this to true. -->
+					<fetchPersistentState>false</fetchPersistentState>
+					
+					<!-- determines whether this cache loader ignores writes - defaults to false. -->
+					<ignoreModifications>false</ignoreModifications>
+					
+					<!-- if set to true, purges the contents of this cache loader when the cache starts u Defaults to false. -->
+					<purgeOnStartup>false</purgeOnStartup>
+					
+				</cacheloader>
+			</config>
+		</attribute>
+        
+    </mbean>
+
+
+   <!--  Uncomment to get a graphical view of the TreeCache MBean above -->
+   <!--   <mbean code="org.jboss.cache.TreeCacheView" name="jboss.cache:service=TreeCacheView">-->
+   <!--      <depends>jboss.cache:service=TreeCache</depends>-->
+   <!--      <attribute name="CacheService">jboss.cache:service=TreeCache</attribute>-->
+   <!--   </mbean>-->
+
+
+</server>

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/testgateway.groovy
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/testgateway.groovy	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/testgateway.groovy	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,12 +0,0 @@
-def stopped = false;
-
-println "Starting loop in listener..."
-while(!stopped) {
-    print "."
-    stopped = gateway.waitUntilStopped(200);
-}
-println ""
-println "loop ended"
-
-println "delivering message..."
-deliveryAdapter.deliverAsync("Hi there!");
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/testgateway.groovy (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/testgateway.groovy)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/testgateway.groovy	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/gateway/testgateway.groovy	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,12 @@
+def stopped = false;
+
+println "Starting loop in listener..."
+while(!stopped) {
+    print "."
+    stopped = gateway.waitUntilStopped(200);
+}
+println ""
+println "loop ended"
+
+println "delivering message..."
+deliveryAdapter.deliverAsync("Hi there!");
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/juddi-unittest.properties
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/juddi-unittest.properties	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/juddi-unittest.properties	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,69 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any 
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct 
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=org.hsqldb.jdbcDriver
-juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost/juddi
-juddi.jdbcUsername=sa
-juddi.jdbcPassword=
-# jUDDI DataSource to use
-juddi.dataSource=java:comp/env/jdbc/juddiDB
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
- 
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-  

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/juddi-unittest.properties (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/juddi-unittest.properties)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/juddi-unittest.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/juddi-unittest.properties	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,69 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any 
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct 
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=org.hsqldb.jdbcDriver
+juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost/juddi
+juddi.jdbcUsername=sa
+juddi.jdbcPassword=
+# jUDDI DataSource to use
+juddi.dataSource=java:comp/env/jdbc/juddiDB
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+ 
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+  

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/EsbLifecycleListenerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/EsbLifecycleListenerUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/EsbLifecycleListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,48 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.lifecycle;
-
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.soa.esb.listeners.config.Configuration;
-
-/**
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class EsbLifecycleListenerUnitTest extends TestCase {
-
-    protected void setUp() throws Exception {
-        MockRegistry.install();
-    }
-
-    protected void tearDown() throws Exception {
-        MockRegistry.uninstall();
-    }
-
-    public void test() throws ManagedLifecycleException {
-        String config = new String(StreamUtils.readStream(getClass().getResourceAsStream("config-01.xml")));
-        ManagedLifecycleController controller = Configuration.create(config);
-
-        controller.start();
-        controller.stop();
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/EsbLifecycleListenerUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/EsbLifecycleListenerUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/EsbLifecycleListenerUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/EsbLifecycleListenerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,48 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.lifecycle;
+
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.listeners.config.Configuration;
+
+/**
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class EsbLifecycleListenerUnitTest extends TestCase {
+
+    protected void setUp() throws Exception {
+        MockRegistry.install();
+    }
+
+    protected void tearDown() throws Exception {
+        MockRegistry.uninstall();
+    }
+
+    public void test() throws ManagedLifecycleException {
+        String config = new String(StreamUtils.readStream(getClass().getResourceAsStream("config-01.xml")));
+        ManagedLifecycleController controller = Configuration.create(config);
+
+        controller.start();
+        controller.stop();
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/config-01.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/config-01.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/config-01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,30 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
-
-    <providers>
-        <provider name="provider">
-            <property name="protocol" value="jms" />
-            <bus busid="bus">
-                <property name="destination-type" value="topic" />
-                <property name="destination-name" value="queue/B" />
-            </bus>
-        </provider>
-    </providers>
-
-    <services>
-        <service category="ServiceCat" name="ServiceName" description="Test Service">
-
-            <listeners>
-                <listener name="listener" busidref="bus" is-gateway="true">
-                    <property name="gatewayClass" value="org.jboss.soa.esb.mock.MockListener" />
-                </listener>
-                <listener name="listener" busidref="bus" />
-            </listeners>
-
-            <actions>
-                <action name="action" class="org.jboss.soa.esb.mock.MockAction" />
-            </actions>			
-        </service>
-    </services>
-
-</jbossesb>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/config-01.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/config-01.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/config-01.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/lifecycle/config-01.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,30 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd">
+
+    <providers>
+        <provider name="provider">
+            <property name="protocol" value="jms" />
+            <bus busid="bus">
+                <property name="destination-type" value="topic" />
+                <property name="destination-name" value="queue/B" />
+            </bus>
+        </provider>
+    </providers>
+
+    <services>
+        <service category="ServiceCat" name="ServiceName" description="Test Service">
+
+            <listeners>
+                <listener name="listener" busidref="bus" is-gateway="true">
+                    <property name="gatewayClass" value="org.jboss.soa.esb.mock.MockListener" />
+                </listener>
+                <listener name="listener" busidref="bus" />
+            </listeners>
+
+            <actions>
+                <action name="action" class="org.jboss.soa.esb.mock.MockAction" />
+            </actions>			
+        </service>
+    </services>
+
+</jbossesb>
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFile.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFile.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFile.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,23 +0,0 @@
-<DummyTester parameterReloadSecs="180">
-   <DummyActionConfig
-    service-category="CatgFileEsbListener"
-	service-name="testFileListener"
-	service-description="My Dummy Service Name FILE"
-  	listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener"
-	maxThreads="10"
-	>
-		<EPR
-			URL="file:///tmp"
-			inputSuffix=".testFile"
-			postDelete="true"
-			postSuffix=".processedOK"
-		/>
-		
-		<action class="org.jboss.soa.esb.listeners.ListenerManagerBaseTest$MockMessageAwareAction" process="notifyTest" />
-		<action  class="org.jboss.soa.esb.actions.Notifier"  okMethod="notifyOK">
-		   	<NotificationList type="OK"> 
-				<target class="NotifyConsole" /> 
-			</NotificationList> 
-		</action>
-   </DummyActionConfig>
-</DummyTester>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFile.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFile.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFile.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFile.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,23 @@
+<DummyTester parameterReloadSecs="180">
+   <DummyActionConfig
+    service-category="CatgFileEsbListener"
+	service-name="testFileListener"
+	service-description="My Dummy Service Name FILE"
+  	listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener"
+	maxThreads="10"
+	>
+		<EPR
+			URL="file:///tmp"
+			inputSuffix=".testFile"
+			postDelete="true"
+			postSuffix=".processedOK"
+		/>
+		
+		<action class="org.jboss.soa.esb.listeners.ListenerManagerBaseTest$MockMessageAwareAction" process="notifyTest" />
+		<action  class="org.jboss.soa.esb.actions.Notifier"  okMethod="notifyOK">
+		   	<NotificationList type="OK"> 
+				<target class="NotifyConsole" /> 
+			</NotificationList> 
+		</action>
+   </DummyActionConfig>
+</DummyTester>

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFtp.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFtp.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFtp.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,23 +0,0 @@
-<DummyTester parameterReloadSecs="180">
-   <DummyActionConfig
-    service-category="CatgFileEsbListener"
-	service-name="testFileListener"
-	service-description="My Dummy Service Name FILE"
-  	listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener"
-	maxThreads="10"
-	pollLatencySeconds="1"
-	>
-		<EPR
-			URL="ftp://ftpuser:ftppassword@localhost:/"
-			inputSuffix=".testFile"
-			postDelete="true"
-		/>
-		
-		<action class="org.jboss.soa.esb.listeners.ListenerManagerBaseTest$MockMessageAwareAction" process="notifyTest" />
-		<action  class="org.jboss.soa.esb.actions.Notifier"  okMethod="notifyOK">
-		   	<NotificationList type="OK"> 
-				<target class="NotifyConsole" /> 
-			</NotificationList> 
-		</action>
-   </DummyActionConfig>
-</DummyTester>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFtp.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFtp.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFtp.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerFtp.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,23 @@
+<DummyTester parameterReloadSecs="180">
+   <DummyActionConfig
+    service-category="CatgFileEsbListener"
+	service-name="testFileListener"
+	service-description="My Dummy Service Name FILE"
+  	listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener"
+	maxThreads="10"
+	pollLatencySeconds="1"
+	>
+		<EPR
+			URL="ftp://ftpuser:ftppassword@localhost:/"
+			inputSuffix=".testFile"
+			postDelete="true"
+		/>
+		
+		<action class="org.jboss.soa.esb.listeners.ListenerManagerBaseTest$MockMessageAwareAction" process="notifyTest" />
+		<action  class="org.jboss.soa.esb.actions.Notifier"  okMethod="notifyOK">
+		   	<NotificationList type="OK"> 
+				<target class="NotifyConsole" /> 
+			</NotificationList> 
+		</action>
+   </DummyActionConfig>
+</DummyTester>

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJdbc.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJdbc.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJdbc.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,25 +0,0 @@
-<DummyTester parameterReloadSecs="180">
-   <DummyActionConfig
-    service-category="CatgSqlEsbListener"
-    service-name="testSqlTableListener" 
-    service-description="My Dummy Service Name SQL table"
-      listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener"
-    maxThreads="10"
-    >
-        <EPR 
-            URL="jdbc:postgresql://localhost:5432/testDB"
-            driver="org.postgresql.Driver"
-            username="postgres"
-            password=""
-            tablename="esb_messages" 
-        />
-        
-        <action class="org.jboss.soa.esb.listeners.ListenerManagerBaseTest$MockMessageAwareAction" process="notifyTest" />
-		<action  class="org.jboss.soa.esb.actions.Notifier"  okMethod="notifyOK">
-		   	<NotificationList type="OK"> 
-				<target class="NotifyConsole" /> 
-			</NotificationList> 
-		</action> 
-   </DummyActionConfig>
-</DummyTester>
-

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJdbc.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJdbc.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJdbc.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJdbc.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,25 @@
+<DummyTester parameterReloadSecs="180">
+   <DummyActionConfig
+    service-category="CatgSqlEsbListener"
+    service-name="testSqlTableListener" 
+    service-description="My Dummy Service Name SQL table"
+      listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener"
+    maxThreads="10"
+    >
+        <EPR 
+            URL="jdbc:postgresql://localhost:5432/testDB"
+            driver="org.postgresql.Driver"
+            username="postgres"
+            password=""
+            tablename="esb_messages" 
+        />
+        
+        <action class="org.jboss.soa.esb.listeners.ListenerManagerBaseTest$MockMessageAwareAction" process="notifyTest" />
+		<action  class="org.jboss.soa.esb.actions.Notifier"  okMethod="notifyOK">
+		   	<NotificationList type="OK"> 
+				<target class="NotifyConsole" /> 
+			</NotificationList> 
+		</action> 
+   </DummyActionConfig>
+</DummyTester>
+

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,26 +0,0 @@
-<DummyTester parameterReloadSecs="180">
-   <DummyActionConfig
-    service-category="CatgFileEsbListener"
-	service-name="testFileListener"
-	service-description="My Dummy Service Name FILE"
-  	listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener"
-	maxThreads="10"
-	>
-		<EPR
-			protocol="jms"
-		    connection-factory="ConnectionFactory"
-		    destination-type="queue"
-		    destination-name="queue/A"
-		    jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-		    jndi-URL="localhost"
-		    message-selector="messSelector='testJmsGateway'"
-		/>
-		
-		<action class="org.jboss.soa.esb.listeners.ListenerManagerBaseTest$MockMessageAwareAction" process="notifyTest" />
-		<action  class="org.jboss.soa.esb.actions.Notifier"  okMethod="notifyOK">
-		   	<NotificationList type="OK"> 
-				<target class="NotifyConsole" /> 
-			</NotificationList> 
-		</action>
-   </DummyActionConfig>
-</DummyTester>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/listenerJms.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,26 @@
+<DummyTester parameterReloadSecs="180">
+   <DummyActionConfig
+    service-category="CatgFileEsbListener"
+	service-name="testFileListener"
+	service-description="My Dummy Service Name FILE"
+  	listenerClass="org.jboss.soa.esb.listeners.message.MessageAwareListener"
+	maxThreads="10"
+	>
+		<EPR
+			protocol="jms"
+		    connection-factory="ConnectionFactory"
+		    destination-type="queue"
+		    destination-name="queue/A"
+		    jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+		    jndi-URL="localhost"
+		    message-selector="messSelector='testJmsGateway'"
+		/>
+		
+		<action class="org.jboss.soa.esb.listeners.ListenerManagerBaseTest$MockMessageAwareAction" process="notifyTest" />
+		<action  class="org.jboss.soa.esb.actions.Notifier"  okMethod="notifyOK">
+		   	<NotificationList type="OK"> 
+				<target class="NotifyConsole" /> 
+			</NotificationList> 
+		</action>
+   </DummyActionConfig>
+</DummyTester>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,415 +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.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.message.format.MessageFactory;
-
-public class ActionProcessingPipelineUnitTest extends TestCase
-{
-    @Override
-    protected void setUp() throws Exception
-    {
-        super.setUp();
-        MockActionInfo.reset() ;
-    }
-    
-    /*
-     * Tests to run
-     *  - create a pipeline with a failure, make sure failure is called in correct order and subsequent actions are not called.
-     *    Check initialise and destroy called.
-     *  
-     *  Do the above for each type of action.
-     */
-    
-    public void testActionPipelineProcessor()
-        throws Exception
-    {
-        final ConfigTree configTree = new ConfigTree("parent") ;
-        
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-            null, null, null) ;
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-            null, null, null) ;
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-            null, null, null) ;
-
-        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
-        pipeline.initialise() ;
-        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4) ;
-        
-        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertTrue("Pipeline process failure", result) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4) ;
-        checkOrder(MockActionInfo.getSuccessList(), 4, 2, 0) ;
-        checkOrder(MockActionInfo.getExceptionList()) ;
-        
-        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertTrue("Pipeline process failure", secondResult) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 0, 2, 4) ;
-        checkOrder(MockActionInfo.getSuccessList(), 4, 2, 0, 4, 2, 0) ;
-        checkOrder(MockActionInfo.getExceptionList()) ;
-        
-        pipeline.destroy() ;
-        checkOrder(MockActionInfo.getDestroyList(), 4, 2, 0) ;
-    }
-    
-    public void testActionPipelineProcessorFailure()
-        throws Exception
-    {
-        final ConfigTree configTree = new ConfigTree("parent") ;
-        
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-            null, null, null) ;
-        addAction(configTree, MockActionPipelineProcessorFailure.class.getName(),
-            null, null, null) ;
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-            null, null, null) ;
-
-        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
-        pipeline.initialise() ;
-        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4) ;
-        
-        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertFalse("Pipeline process succeeded", result) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2) ;
-        checkOrder(MockActionInfo.getSuccessList()) ;
-        checkOrder(MockActionInfo.getExceptionList(), 2, 0) ;
-
-        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertFalse("Pipeline process succeeded", secondResult) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 0, 2) ;
-        checkOrder(MockActionInfo.getSuccessList()) ;
-        checkOrder(MockActionInfo.getExceptionList(), 2, 0, 2, 0) ;
-
-        pipeline.destroy() ;
-        checkOrder(MockActionInfo.getDestroyList(), 4, 2, 0) ;
-    }
-    
-    public void testOverriddenActionPipelineProcessor()
-        throws Exception
-    {
-        final ConfigTree configTree = new ConfigTree("parent") ;
-        
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-            "process", null, null) ;
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-            null, "anotherProcessSuccess", null) ;
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-                null, null, "anotherProcessException") ;
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
-
-        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
-        pipeline.initialise() ;
-        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4, 6) ;
-        
-        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertTrue("Pipeline process failure", result) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7) ;
-        checkOrder(MockActionInfo.getSuccessList(), 7, 4, 3, 0) ;
-        checkOrder(MockActionInfo.getExceptionList()) ;
-        
-        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertTrue("Pipeline process failure", secondResult) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7, 0, 2, 4, 6, 7) ;
-        checkOrder(MockActionInfo.getSuccessList(), 7, 4, 3, 0, 7, 4, 3, 0) ;
-        checkOrder(MockActionInfo.getExceptionList()) ;
-        
-        pipeline.destroy() ;
-        checkOrder(MockActionInfo.getDestroyList(), 6, 4, 2, 0) ;
-    }
-    
-    public void testOverriddenActionPipelineProcessorFailure()
-        throws Exception
-    {
-        final ConfigTree configTree = new ConfigTree("parent") ;
-        
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-            "process", null, null) ;
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-            null, "anotherProcessSuccess", null) ;
-        addAction(configTree, MockActionPipelineProcessorFailure.class.getName(),
-                null, null, "anotherProcessException") ;
-        addAction(configTree, MockActionPipelineProcessor.class.getName(),
-            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
-
-        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
-        pipeline.initialise() ;
-        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4, 6) ;
-        
-        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertFalse("Pipeline process succeeded", result) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4) ;
-        checkOrder(MockActionInfo.getSuccessList()) ;
-        checkOrder(MockActionInfo.getExceptionList(), 5, 2, 0) ;
-        
-        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertFalse("Pipeline process succeeded", secondResult) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 0, 2, 4) ;
-        checkOrder(MockActionInfo.getSuccessList()) ;
-        checkOrder(MockActionInfo.getExceptionList(), 5, 2, 0, 5, 2, 0) ;
-        
-        pipeline.destroy() ;
-        checkOrder(MockActionInfo.getDestroyList(), 6, 4, 2, 0) ;
-    }
-    
-    public void testOverriddenActionLifecycleProcessor()
-        throws Exception
-    {
-        final ConfigTree configTree = new ConfigTree("parent") ;
-        
-        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
-            "process", null, null) ;
-        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
-            null, "processSuccess", null) ;
-        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
-                null, null, "processException") ;
-        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
-            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
-
-        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
-        pipeline.initialise() ;
-        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4, 6) ;
-        
-        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertTrue("Pipeline process failure", result) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7) ;
-        checkOrder(MockActionInfo.getSuccessList(), 7, 2) ;
-        checkOrder(MockActionInfo.getExceptionList()) ;
-        
-        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertTrue("Pipeline process failure", secondResult) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7, 0, 2, 4, 6, 7) ;
-        checkOrder(MockActionInfo.getSuccessList(), 7, 2, 7, 2) ;
-        checkOrder(MockActionInfo.getExceptionList()) ;
-        
-        pipeline.destroy() ;
-        checkOrder(MockActionInfo.getDestroyList(), 6, 4, 2, 0) ;
-    }
-    
-    public void testOverriddenActionLifecycleProcessorFailure()
-        throws Exception
-    {
-        final ConfigTree configTree = new ConfigTree("parent") ;
-        
-        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
-            "process", null, null) ;
-        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
-            null, "anotherProcessSuccess", null) ;
-        addAction(configTree, MockActionLifecycleProcessorFailure.class.getName(),
-                null, null, "anotherProcessException") ;
-        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
-            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
-
-        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
-        pipeline.initialise() ;
-        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4, 6) ;
-        
-        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertFalse("Pipeline process succeeded", result) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4) ;
-        checkOrder(MockActionInfo.getSuccessList()) ;
-        checkOrder(MockActionInfo.getExceptionList(), 5) ;
-        
-        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertFalse("Pipeline process succeeded", secondResult) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 0, 2, 4) ;
-        checkOrder(MockActionInfo.getSuccessList()) ;
-        checkOrder(MockActionInfo.getExceptionList(), 5, 5) ;
-        
-        pipeline.destroy() ;
-        checkOrder(MockActionInfo.getDestroyList(), 6, 4, 2, 0) ;
-    }
-    
-    public void testOverriddenActionProcessor()
-        throws Exception
-    {
-        final ConfigTree configTree = new ConfigTree("parent") ;
-        
-        addAction(configTree, MockActionProcessor.class.getName(),
-            "process", null, null) ;
-        addAction(configTree, MockActionProcessor.class.getName(),
-            null, "processSuccess", null) ;
-        addAction(configTree, MockActionProcessor.class.getName(),
-                null, null, "processException") ;
-        addAction(configTree, MockActionProcessor.class.getName(),
-            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
-
-        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
-        pipeline.initialise() ;
-        checkOrder(MockActionInfo.getInitialiseList()) ;
-        
-        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertTrue("Pipeline process failure", result) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7) ;
-        checkOrder(MockActionInfo.getSuccessList(), 7, 2) ;
-        checkOrder(MockActionInfo.getExceptionList()) ;
-        
-        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertTrue("Pipeline process failure", secondResult) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7, 8, 10, 12, 14, 15) ;
-        checkOrder(MockActionInfo.getSuccessList(), 7, 2, 15, 10) ;
-        checkOrder(MockActionInfo.getExceptionList()) ;
-        
-        pipeline.destroy() ;
-        checkOrder(MockActionInfo.getDestroyList()) ;
-    }
-    
-    public void testOverriddenActionProcessorFailure()
-        throws Exception
-    {
-        final ConfigTree configTree = new ConfigTree("parent") ;
-        
-        addAction(configTree, MockActionProcessor.class.getName(),
-            "process", null, null) ;
-        addAction(configTree, MockActionProcessor.class.getName(),
-            null, "anotherProcessSuccess", null) ;
-        addAction(configTree, MockActionProcessorFailure.class.getName(),
-                null, null, "anotherProcessException") ;
-        addAction(configTree, MockActionProcessor.class.getName(),
-            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
-
-        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
-        pipeline.initialise() ;
-        checkOrder(MockActionInfo.getInitialiseList()) ;
-        
-        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertFalse("Pipeline process succeeded", result) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4) ;
-        checkOrder(MockActionInfo.getSuccessList()) ;
-        checkOrder(MockActionInfo.getExceptionList(), 5) ;
-        
-        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
-        assertFalse("Pipeline process succeeded", secondResult) ;
-        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 8, 10) ;
-        checkOrder(MockActionInfo.getSuccessList()) ;
-        checkOrder(MockActionInfo.getExceptionList(), 5, 11) ;
-        
-        pipeline.destroy() ;
-        checkOrder(MockActionInfo.getDestroyList()) ;
-    }
-    
-    public void testErrorActionProcessorException() throws Exception
-	{
-		final ConfigTree configTree = new ConfigTree("parent");
-
-		addAction(configTree, ErrorActionProcessor.class.getName(), "process",
-				null, null);
-		addAction(configTree, ErrorActionProcessor.class.getName(), null,
-				"anotherProcessSuccess", null);
-		addAction(configTree, MockActionProcessorFailure.class.getName(), null,
-				null, "anotherProcessException");
-		addAction(configTree, ErrorActionProcessor.class.getName(),
-				"process, anotherProcess", "anotherProcessSuccess",
-				"anotherProcessException");
-
-		final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(
-				configTree);
-		pipeline.initialise();
-		
-		final boolean result = pipeline.process(MessageFactory.getInstance()
-				.getMessage());
-		
-		assertFalse(result);
-	}
-    
-    public void testNPEActionProcessorException() throws Exception
-	{
-		final ConfigTree configTree = new ConfigTree("parent");
-
-		addAction(configTree, NPEActionProcessor.class.getName(), "process",
-				null, null);
-		addAction(configTree, NPEActionProcessor.class.getName(), null,
-				"anotherProcessSuccess", null);
-		addAction(configTree, MockActionProcessorFailure.class.getName(), null,
-				null, "anotherProcessException");
-		addAction(configTree, ErrorActionProcessor.class.getName(),
-				"process, anotherProcess", "anotherProcessSuccess",
-				"anotherProcessException");
-
-		final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(
-				configTree);
-		pipeline.initialise();
-		
-		final boolean result = pipeline.process(MessageFactory.getInstance()
-				.getMessage());
-		
-		assertFalse(result);
-	}
-    
-    public void testInvalidConstructor()
-        throws Exception
-    {
-        final ConfigTree configTree = new ConfigTree("parent") ;
-        
-        addAction(configTree, MockActionPipelineProcessorConstructorFailure.class.getName(),
-            null, null, null) ;
-        try
-        {
-            new ActionProcessingPipeline(configTree) ;
-            fail("Expected ConfigurationException") ;
-        }
-        catch (final ConfigurationException ce)
-        {
-            
-        }
-    }
-    
-    private void addAction(final ConfigTree configTree, final String actionName,
-        final String processOverride, final String successOverride,
-        final String exceptionOverride)
-    {
-        final ConfigTree actionChild = new ConfigTree(ListenerTagNames.ACTION_ELEMENT_TAG, configTree) ;
-        actionChild.setAttribute(ListenerTagNames.ACTION_CLASS_TAG, actionName) ;
-        if (processOverride != null)
-        {
-            actionChild.setAttribute(ListenerTagNames.PROCESS_METHOD_TAG, processOverride) ;
-        }
-        if (successOverride != null)
-        {
-            actionChild.setAttribute(ListenerTagNames.NORMAL_COMPLETION_METHOD_TAG, successOverride) ;
-        }
-        if (exceptionOverride != null)
-        {
-            actionChild.setAttribute(ListenerTagNames.EXCEPTION_METHOD_TAG, exceptionOverride) ;
-        }
-    }
-    
-    private void checkOrder(final Integer[] list, int ... values)
-    {
-        final int numValues = (values == null ? 0 : values.length) ;
-        final int listLength = (list == null ? 0 : list.length) ;
-        
-        assertEquals("Unexpected list/values count", numValues, listLength) ;
-        
-        for(int count = 0 ; count < numValues ; count++)
-        {
-            assertEquals("Unexpected call order at count " + count, values[count], list[count].intValue()) ;
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ActionProcessingPipelineUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,415 @@
+/*
+ * 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.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.message.format.MessageFactory;
+
+public class ActionProcessingPipelineUnitTest extends TestCase
+{
+    @Override
+    protected void setUp() throws Exception
+    {
+        super.setUp();
+        MockActionInfo.reset() ;
+    }
+    
+    /*
+     * Tests to run
+     *  - create a pipeline with a failure, make sure failure is called in correct order and subsequent actions are not called.
+     *    Check initialise and destroy called.
+     *  
+     *  Do the above for each type of action.
+     */
+    
+    public void testActionPipelineProcessor()
+        throws Exception
+    {
+        final ConfigTree configTree = new ConfigTree("parent") ;
+        
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+            null, null, null) ;
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+            null, null, null) ;
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+            null, null, null) ;
+
+        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
+        pipeline.initialise() ;
+        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4) ;
+        
+        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertTrue("Pipeline process failure", result) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4) ;
+        checkOrder(MockActionInfo.getSuccessList(), 4, 2, 0) ;
+        checkOrder(MockActionInfo.getExceptionList()) ;
+        
+        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertTrue("Pipeline process failure", secondResult) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 0, 2, 4) ;
+        checkOrder(MockActionInfo.getSuccessList(), 4, 2, 0, 4, 2, 0) ;
+        checkOrder(MockActionInfo.getExceptionList()) ;
+        
+        pipeline.destroy() ;
+        checkOrder(MockActionInfo.getDestroyList(), 4, 2, 0) ;
+    }
+    
+    public void testActionPipelineProcessorFailure()
+        throws Exception
+    {
+        final ConfigTree configTree = new ConfigTree("parent") ;
+        
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+            null, null, null) ;
+        addAction(configTree, MockActionPipelineProcessorFailure.class.getName(),
+            null, null, null) ;
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+            null, null, null) ;
+
+        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
+        pipeline.initialise() ;
+        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4) ;
+        
+        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertFalse("Pipeline process succeeded", result) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2) ;
+        checkOrder(MockActionInfo.getSuccessList()) ;
+        checkOrder(MockActionInfo.getExceptionList(), 2, 0) ;
+
+        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertFalse("Pipeline process succeeded", secondResult) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 0, 2) ;
+        checkOrder(MockActionInfo.getSuccessList()) ;
+        checkOrder(MockActionInfo.getExceptionList(), 2, 0, 2, 0) ;
+
+        pipeline.destroy() ;
+        checkOrder(MockActionInfo.getDestroyList(), 4, 2, 0) ;
+    }
+    
+    public void testOverriddenActionPipelineProcessor()
+        throws Exception
+    {
+        final ConfigTree configTree = new ConfigTree("parent") ;
+        
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+            "process", null, null) ;
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+            null, "anotherProcessSuccess", null) ;
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+                null, null, "anotherProcessException") ;
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
+
+        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
+        pipeline.initialise() ;
+        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4, 6) ;
+        
+        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertTrue("Pipeline process failure", result) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7) ;
+        checkOrder(MockActionInfo.getSuccessList(), 7, 4, 3, 0) ;
+        checkOrder(MockActionInfo.getExceptionList()) ;
+        
+        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertTrue("Pipeline process failure", secondResult) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7, 0, 2, 4, 6, 7) ;
+        checkOrder(MockActionInfo.getSuccessList(), 7, 4, 3, 0, 7, 4, 3, 0) ;
+        checkOrder(MockActionInfo.getExceptionList()) ;
+        
+        pipeline.destroy() ;
+        checkOrder(MockActionInfo.getDestroyList(), 6, 4, 2, 0) ;
+    }
+    
+    public void testOverriddenActionPipelineProcessorFailure()
+        throws Exception
+    {
+        final ConfigTree configTree = new ConfigTree("parent") ;
+        
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+            "process", null, null) ;
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+            null, "anotherProcessSuccess", null) ;
+        addAction(configTree, MockActionPipelineProcessorFailure.class.getName(),
+                null, null, "anotherProcessException") ;
+        addAction(configTree, MockActionPipelineProcessor.class.getName(),
+            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
+
+        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
+        pipeline.initialise() ;
+        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4, 6) ;
+        
+        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertFalse("Pipeline process succeeded", result) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4) ;
+        checkOrder(MockActionInfo.getSuccessList()) ;
+        checkOrder(MockActionInfo.getExceptionList(), 5, 2, 0) ;
+        
+        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertFalse("Pipeline process succeeded", secondResult) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 0, 2, 4) ;
+        checkOrder(MockActionInfo.getSuccessList()) ;
+        checkOrder(MockActionInfo.getExceptionList(), 5, 2, 0, 5, 2, 0) ;
+        
+        pipeline.destroy() ;
+        checkOrder(MockActionInfo.getDestroyList(), 6, 4, 2, 0) ;
+    }
+    
+    public void testOverriddenActionLifecycleProcessor()
+        throws Exception
+    {
+        final ConfigTree configTree = new ConfigTree("parent") ;
+        
+        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
+            "process", null, null) ;
+        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
+            null, "processSuccess", null) ;
+        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
+                null, null, "processException") ;
+        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
+            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
+
+        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
+        pipeline.initialise() ;
+        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4, 6) ;
+        
+        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertTrue("Pipeline process failure", result) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7) ;
+        checkOrder(MockActionInfo.getSuccessList(), 7, 2) ;
+        checkOrder(MockActionInfo.getExceptionList()) ;
+        
+        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertTrue("Pipeline process failure", secondResult) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7, 0, 2, 4, 6, 7) ;
+        checkOrder(MockActionInfo.getSuccessList(), 7, 2, 7, 2) ;
+        checkOrder(MockActionInfo.getExceptionList()) ;
+        
+        pipeline.destroy() ;
+        checkOrder(MockActionInfo.getDestroyList(), 6, 4, 2, 0) ;
+    }
+    
+    public void testOverriddenActionLifecycleProcessorFailure()
+        throws Exception
+    {
+        final ConfigTree configTree = new ConfigTree("parent") ;
+        
+        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
+            "process", null, null) ;
+        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
+            null, "anotherProcessSuccess", null) ;
+        addAction(configTree, MockActionLifecycleProcessorFailure.class.getName(),
+                null, null, "anotherProcessException") ;
+        addAction(configTree, MockActionLifecycleProcessor.class.getName(),
+            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
+
+        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
+        pipeline.initialise() ;
+        checkOrder(MockActionInfo.getInitialiseList(), 0, 2, 4, 6) ;
+        
+        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertFalse("Pipeline process succeeded", result) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4) ;
+        checkOrder(MockActionInfo.getSuccessList()) ;
+        checkOrder(MockActionInfo.getExceptionList(), 5) ;
+        
+        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertFalse("Pipeline process succeeded", secondResult) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 0, 2, 4) ;
+        checkOrder(MockActionInfo.getSuccessList()) ;
+        checkOrder(MockActionInfo.getExceptionList(), 5, 5) ;
+        
+        pipeline.destroy() ;
+        checkOrder(MockActionInfo.getDestroyList(), 6, 4, 2, 0) ;
+    }
+    
+    public void testOverriddenActionProcessor()
+        throws Exception
+    {
+        final ConfigTree configTree = new ConfigTree("parent") ;
+        
+        addAction(configTree, MockActionProcessor.class.getName(),
+            "process", null, null) ;
+        addAction(configTree, MockActionProcessor.class.getName(),
+            null, "processSuccess", null) ;
+        addAction(configTree, MockActionProcessor.class.getName(),
+                null, null, "processException") ;
+        addAction(configTree, MockActionProcessor.class.getName(),
+            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
+
+        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
+        pipeline.initialise() ;
+        checkOrder(MockActionInfo.getInitialiseList()) ;
+        
+        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertTrue("Pipeline process failure", result) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7) ;
+        checkOrder(MockActionInfo.getSuccessList(), 7, 2) ;
+        checkOrder(MockActionInfo.getExceptionList()) ;
+        
+        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertTrue("Pipeline process failure", secondResult) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 7, 8, 10, 12, 14, 15) ;
+        checkOrder(MockActionInfo.getSuccessList(), 7, 2, 15, 10) ;
+        checkOrder(MockActionInfo.getExceptionList()) ;
+        
+        pipeline.destroy() ;
+        checkOrder(MockActionInfo.getDestroyList()) ;
+    }
+    
+    public void testOverriddenActionProcessorFailure()
+        throws Exception
+    {
+        final ConfigTree configTree = new ConfigTree("parent") ;
+        
+        addAction(configTree, MockActionProcessor.class.getName(),
+            "process", null, null) ;
+        addAction(configTree, MockActionProcessor.class.getName(),
+            null, "anotherProcessSuccess", null) ;
+        addAction(configTree, MockActionProcessorFailure.class.getName(),
+                null, null, "anotherProcessException") ;
+        addAction(configTree, MockActionProcessor.class.getName(),
+            "process, anotherProcess", "anotherProcessSuccess", "anotherProcessException") ;
+
+        final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(configTree) ;
+        pipeline.initialise() ;
+        checkOrder(MockActionInfo.getInitialiseList()) ;
+        
+        final boolean result = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertFalse("Pipeline process succeeded", result) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4) ;
+        checkOrder(MockActionInfo.getSuccessList()) ;
+        checkOrder(MockActionInfo.getExceptionList(), 5) ;
+        
+        final boolean secondResult = pipeline.process(MessageFactory.getInstance().getMessage()) ;
+        assertFalse("Pipeline process succeeded", secondResult) ;
+        checkOrder(MockActionInfo.getProcessList(), 0, 2, 4, 6, 8, 10) ;
+        checkOrder(MockActionInfo.getSuccessList()) ;
+        checkOrder(MockActionInfo.getExceptionList(), 5, 11) ;
+        
+        pipeline.destroy() ;
+        checkOrder(MockActionInfo.getDestroyList()) ;
+    }
+    
+    public void testErrorActionProcessorException() throws Exception
+	{
+		final ConfigTree configTree = new ConfigTree("parent");
+
+		addAction(configTree, ErrorActionProcessor.class.getName(), "process",
+				null, null);
+		addAction(configTree, ErrorActionProcessor.class.getName(), null,
+				"anotherProcessSuccess", null);
+		addAction(configTree, MockActionProcessorFailure.class.getName(), null,
+				null, "anotherProcessException");
+		addAction(configTree, ErrorActionProcessor.class.getName(),
+				"process, anotherProcess", "anotherProcessSuccess",
+				"anotherProcessException");
+
+		final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(
+				configTree);
+		pipeline.initialise();
+		
+		final boolean result = pipeline.process(MessageFactory.getInstance()
+				.getMessage());
+		
+		assertFalse(result);
+	}
+    
+    public void testNPEActionProcessorException() throws Exception
+	{
+		final ConfigTree configTree = new ConfigTree("parent");
+
+		addAction(configTree, NPEActionProcessor.class.getName(), "process",
+				null, null);
+		addAction(configTree, NPEActionProcessor.class.getName(), null,
+				"anotherProcessSuccess", null);
+		addAction(configTree, MockActionProcessorFailure.class.getName(), null,
+				null, "anotherProcessException");
+		addAction(configTree, ErrorActionProcessor.class.getName(),
+				"process, anotherProcess", "anotherProcessSuccess",
+				"anotherProcessException");
+
+		final ActionProcessingPipeline pipeline = new ActionProcessingPipeline(
+				configTree);
+		pipeline.initialise();
+		
+		final boolean result = pipeline.process(MessageFactory.getInstance()
+				.getMessage());
+		
+		assertFalse(result);
+	}
+    
+    public void testInvalidConstructor()
+        throws Exception
+    {
+        final ConfigTree configTree = new ConfigTree("parent") ;
+        
+        addAction(configTree, MockActionPipelineProcessorConstructorFailure.class.getName(),
+            null, null, null) ;
+        try
+        {
+            new ActionProcessingPipeline(configTree) ;
+            fail("Expected ConfigurationException") ;
+        }
+        catch (final ConfigurationException ce)
+        {
+            
+        }
+    }
+    
+    private void addAction(final ConfigTree configTree, final String actionName,
+        final String processOverride, final String successOverride,
+        final String exceptionOverride)
+    {
+        final ConfigTree actionChild = new ConfigTree(ListenerTagNames.ACTION_ELEMENT_TAG, configTree) ;
+        actionChild.setAttribute(ListenerTagNames.ACTION_CLASS_TAG, actionName) ;
+        if (processOverride != null)
+        {
+            actionChild.setAttribute(ListenerTagNames.PROCESS_METHOD_TAG, processOverride) ;
+        }
+        if (successOverride != null)
+        {
+            actionChild.setAttribute(ListenerTagNames.NORMAL_COMPLETION_METHOD_TAG, successOverride) ;
+        }
+        if (exceptionOverride != null)
+        {
+            actionChild.setAttribute(ListenerTagNames.EXCEPTION_METHOD_TAG, exceptionOverride) ;
+        }
+    }
+    
+    private void checkOrder(final Integer[] list, int ... values)
+    {
+        final int numValues = (values == null ? 0 : values.length) ;
+        final int listLength = (list == null ? 0 : list.length) ;
+        
+        assertEquals("Unexpected list/values count", numValues, listLength) ;
+        
+        for(int count = 0 ; count < numValues ; count++)
+        {
+            assertEquals("Unexpected call order at count " + count, values[count], list[count].intValue()) ;
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ErrorActionProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ErrorActionProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ErrorActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,81 +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.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class ErrorActionProcessor implements ActionPipelineProcessor
-{
-    private final Integer id ;
-    private final Integer anotherId ;
-    
-    public ErrorActionProcessor(final ConfigTree tree)
-    {
-        id = MockActionInfo.getNextId() ;
-        anotherId = MockActionInfo.getNextId() ;
-    }
-    
-    public Message process(Message message) throws ActionProcessingException
-    {
-        throw new ActionProcessingException("foo");
-    }
-    
-    public Message anotherProcess(Message message) throws ActionProcessingException
-    {
-    	throw new ActionProcessingException("foo");
-    }
-
-    public void processException(Message message, Throwable th)
-    {
-        MockActionInfo.addExceptionId(id) ;
-    }
-
-    public void anotherProcessException(Message message, Throwable th)
-    {
-        MockActionInfo.addExceptionId(anotherId) ;
-    }
-
-    public void processSuccess(Message message)
-    {
-        MockActionInfo.addSuccessId(id) ;
-    }
-
-    public void anotherProcessSuccess(Message message)
-    {
-        MockActionInfo.addSuccessId(anotherId) ;
-    }
-
-    public void destroy() throws ActionLifecycleException
-    {
-        MockActionInfo.addDestroyId(id) ;
-    }
-
-    public void initialise() throws ActionLifecycleException
-    {
-        MockActionInfo.addInitialiseId(id) ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ErrorActionProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ErrorActionProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ErrorActionProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/ErrorActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,81 @@
+/*
+ * 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.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class ErrorActionProcessor implements ActionPipelineProcessor
+{
+    private final Integer id ;
+    private final Integer anotherId ;
+    
+    public ErrorActionProcessor(final ConfigTree tree)
+    {
+        id = MockActionInfo.getNextId() ;
+        anotherId = MockActionInfo.getNextId() ;
+    }
+    
+    public Message process(Message message) throws ActionProcessingException
+    {
+        throw new ActionProcessingException("foo");
+    }
+    
+    public Message anotherProcess(Message message) throws ActionProcessingException
+    {
+    	throw new ActionProcessingException("foo");
+    }
+
+    public void processException(Message message, Throwable th)
+    {
+        MockActionInfo.addExceptionId(id) ;
+    }
+
+    public void anotherProcessException(Message message, Throwable th)
+    {
+        MockActionInfo.addExceptionId(anotherId) ;
+    }
+
+    public void processSuccess(Message message)
+    {
+        MockActionInfo.addSuccessId(id) ;
+    }
+
+    public void anotherProcessSuccess(Message message)
+    {
+        MockActionInfo.addSuccessId(anotherId) ;
+    }
+
+    public void destroy() throws ActionLifecycleException
+    {
+        MockActionInfo.addDestroyId(id) ;
+    }
+
+    public void initialise() throws ActionLifecycleException
+    {
+        MockActionInfo.addInitialiseId(id) ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,227 +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.File;
-import java.io.InputStream;
-import java.sql.Connection;
-import java.sql.DriverManager;
-import java.sql.Statement;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.ListenerTagNames;
-import org.jboss.soa.esb.listeners.RegistryUtil;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.services.registry.RegistryException;
-import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-
-public class InvokerUnitTest extends TestCase
-{
-	private Logger log = Logger.getLogger( InvokerUnitTest.class );
-
-	protected final void setup()
-	{
-		try
-		{
-			TestEnvironmentUtil.setESBPropertiesFileToUse("product",
-					"../product");
-			// Set the juddi properties file in System so juddi will pick it up
-			// later and use the test values.
-			String juddiPropertiesFile = "/org/jboss/soa/esb/listeners/juddi-unittest.properties";
-			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
-			// Read this properties file to get the db connection string
-			Properties props = new Properties();
-			InputStream inStream = Class.class
-					.getResourceAsStream(juddiPropertiesFile);
-
-			props.load(inStream);
-			mDbDriver = props.getProperty("juddi.jdbcDriver");
-			mDbUrl = props.getProperty("juddi.jdbcUrl");
-			mDbUsername = props.getProperty("juddi.jdbcUsername");
-			mDbPassword = props.getProperty("juddi.jdbcPassword");
-
-			String database = "not tested yet";
-			if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
-			{
-				database = "hsqldb";
-				// Bring up hsql on default port 9001
-				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir(
-						"product", "../product")
-						+ "/build/hsqltestdb", "juddi");
-			}
-			else if ("com.mysql.jdbc.Driver".equals(mDbDriver))
-			{
-				database = "mysql";
-			} // add and test your own database..
-
-			// Get the registry-schema create scripts
-			String sqlDir = TestEnvironmentUtil.getUserDir("product",
-					"../product")
-					+ "/install/jUDDI-registry/sql/" + database + "/";
-			// Drop what is there now, if exists. We want to start fresh.
-			String sqlDropCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "drop_database.sql"));
-			String sqlCreateCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "create_database.sql"));
-			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir
-					+ "insert_publishers.sql"));
-
-			try
-			{
-				Class.forName(mDbDriver);
-			}
-			catch (Exception e)
-			{
-				log.error("ERROR: failed to load " + database
-						+ " JDBC driver.", e);
-				return;
-			}
-			con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
-			Statement stmnt = con.createStatement();
-			stmnt.execute(sqlDropCmd);
-			stmnt.execute(sqlCreateCmd);
-			stmnt.execute(sqlInsertPubCmd);
-			stmnt.close();
-		}
-		catch (Throwable e)
-		{
-			log.error("We should stop testing, since we don't have a db.", e);
-			assertTrue(false);
-		}
-	}
-
-	protected final void tearDown()
-	{
-		try
-		{
-			Thread.sleep(1000);
-			Statement stmnt = con.createStatement();
-
-			stmnt.execute("SHUTDOWN");
-			stmnt.close();
-
-			con.close();
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-		}
-	}
-
-	public void testInvalidParameters() throws Exception
-	{
-		setup();
-
-		Message message = MessageFactory.getInstance().getMessage();
-
-		try
-		{
-			Invoker.invoke(message, null, null);
-			fail();
-		}
-		catch (RegistryException ex)
-		{
-		}
-
-		try
-		{
-			Invoker.invoke(message, "foo", "bar");
-			fail();
-		}
-		catch (RegistryException ex)
-		{
-		}
-
-		final File tmpDir = new File(System.getProperty("java.io.tmpdir"));
-		final String tmpDirForm = tmpDir.toURL().toExternalForm();
-		FileEpr epr = new FileEpr(tmpDirForm);
-
-		epr.setInputSuffix(".testFile");
-		epr.setPostDelete(true);
-		epr.setPostSuffix(".unitProcessedOK");
-
-		ConfigTree tree = new ConfigTree("test");
-
-		tree.setAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG,
-				"eprmanager");
-		tree.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, "qwerty");
-
-		RegistryUtil.register(tree, epr);
-
-		try
-		{
-			Invoker.invoke(message, "eprmanager", "qwerty");
-		}
-		catch (Exception ex)
-		{
-			fail();
-		}
-
-		RegistryUtil.unregister("eprmanager", "qwerty", epr);
-		
-		try
-		{
-			Invoker
-					.invokeAndAwaitResponse(message, "eprmanager", "qwerty",
-							100);
-		}
-		catch (Exception ex)
-		{
-		}
-		
-		File[] files = tmpDir.listFiles();
-		
-		for (int i = 0; i < files.length; i++)
-		{
-			if ((files[i].getName().endsWith(".unitProcessedOK")) ||
-					(files[i].getName().equals("qwerty")))
-			{
-				try
-				{
-					files[i].delete();
-				}
-				catch (Exception ex)
-				{
-				}
-			}
-		}
-	}
-
-	private static String mDbDriver;
-
-	private static String mDbUrl;
-
-	private static String mDbUsername;
-
-	private static String mDbPassword;
-
-	private static Connection con;
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/InvokerUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,227 @@
+/*
+ * 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.File;
+import java.io.InputStream;
+import java.sql.Connection;
+import java.sql.DriverManager;
+import java.sql.Statement;
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.ListenerTagNames;
+import org.jboss.soa.esb.listeners.RegistryUtil;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.services.registry.RegistryException;
+import org.jboss.soa.esb.testutils.FileUtil;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+
+public class InvokerUnitTest extends TestCase
+{
+	private Logger log = Logger.getLogger( InvokerUnitTest.class );
+
+	protected final void setup()
+	{
+		try
+		{
+			TestEnvironmentUtil.setESBPropertiesFileToUse("product",
+					"../product");
+			// Set the juddi properties file in System so juddi will pick it up
+			// later and use the test values.
+			String juddiPropertiesFile = "/org/jboss/soa/esb/listeners/juddi-unittest.properties";
+			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
+			// Read this properties file to get the db connection string
+			Properties props = new Properties();
+			InputStream inStream = Class.class
+					.getResourceAsStream(juddiPropertiesFile);
+
+			props.load(inStream);
+			mDbDriver = props.getProperty("juddi.jdbcDriver");
+			mDbUrl = props.getProperty("juddi.jdbcUrl");
+			mDbUsername = props.getProperty("juddi.jdbcUsername");
+			mDbPassword = props.getProperty("juddi.jdbcPassword");
+
+			String database = "not tested yet";
+			if ("org.hsqldb.jdbcDriver".equals(mDbDriver))
+			{
+				database = "hsqldb";
+				// Bring up hsql on default port 9001
+				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir(
+						"product", "../product")
+						+ "/build/hsqltestdb", "juddi");
+			}
+			else if ("com.mysql.jdbc.Driver".equals(mDbDriver))
+			{
+				database = "mysql";
+			} // add and test your own database..
+
+			// Get the registry-schema create scripts
+			String sqlDir = TestEnvironmentUtil.getUserDir("product",
+					"../product")
+					+ "/install/jUDDI-registry/sql/" + database + "/";
+			// Drop what is there now, if exists. We want to start fresh.
+			String sqlDropCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "drop_database.sql"));
+			String sqlCreateCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "create_database.sql"));
+			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir
+					+ "insert_publishers.sql"));
+
+			try
+			{
+				Class.forName(mDbDriver);
+			}
+			catch (Exception e)
+			{
+				log.error("ERROR: failed to load " + database
+						+ " JDBC driver.", e);
+				return;
+			}
+			con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
+			Statement stmnt = con.createStatement();
+			stmnt.execute(sqlDropCmd);
+			stmnt.execute(sqlCreateCmd);
+			stmnt.execute(sqlInsertPubCmd);
+			stmnt.close();
+		}
+		catch (Throwable e)
+		{
+			log.error("We should stop testing, since we don't have a db.", e);
+			assertTrue(false);
+		}
+	}
+
+	protected final void tearDown()
+	{
+		try
+		{
+			Thread.sleep(1000);
+			Statement stmnt = con.createStatement();
+
+			stmnt.execute("SHUTDOWN");
+			stmnt.close();
+
+			con.close();
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+		}
+	}
+
+	public void testInvalidParameters() throws Exception
+	{
+		setup();
+
+		Message message = MessageFactory.getInstance().getMessage();
+
+		try
+		{
+			Invoker.invoke(message, null, null);
+			fail();
+		}
+		catch (RegistryException ex)
+		{
+		}
+
+		try
+		{
+			Invoker.invoke(message, "foo", "bar");
+			fail();
+		}
+		catch (RegistryException ex)
+		{
+		}
+
+		final File tmpDir = new File(System.getProperty("java.io.tmpdir"));
+		final String tmpDirForm = tmpDir.toURL().toExternalForm();
+		FileEpr epr = new FileEpr(tmpDirForm);
+
+		epr.setInputSuffix(".testFile");
+		epr.setPostDelete(true);
+		epr.setPostSuffix(".unitProcessedOK");
+
+		ConfigTree tree = new ConfigTree("test");
+
+		tree.setAttribute(ListenerTagNames.SERVICE_CATEGORY_NAME_TAG,
+				"eprmanager");
+		tree.setAttribute(ListenerTagNames.SERVICE_NAME_TAG, "qwerty");
+
+		RegistryUtil.register(tree, epr);
+
+		try
+		{
+			Invoker.invoke(message, "eprmanager", "qwerty");
+		}
+		catch (Exception ex)
+		{
+			fail();
+		}
+
+		RegistryUtil.unregister("eprmanager", "qwerty", epr);
+		
+		try
+		{
+			Invoker
+					.invokeAndAwaitResponse(message, "eprmanager", "qwerty",
+							100);
+		}
+		catch (Exception ex)
+		{
+		}
+		
+		File[] files = tmpDir.listFiles();
+		
+		for (int i = 0; i < files.length; i++)
+		{
+			if ((files[i].getName().endsWith(".unitProcessedOK")) ||
+					(files[i].getName().equals("qwerty")))
+			{
+				try
+				{
+					files[i].delete();
+				}
+				catch (Exception ex)
+				{
+				}
+			}
+		}
+	}
+
+	private static String mDbDriver;
+
+	private static String mDbUrl;
+
+	private static String mDbUsername;
+
+	private static String mDbPassword;
+
+	private static Connection con;
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapterUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapterUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapterUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,161 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.listeners.message;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.couriers.MockCourier;
-import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
-import org.jboss.internal.soa.esb.services.registry.MockRegistry;
-import org.jboss.soa.esb.actions.ActionUtils;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.MalformedEPRException;
-import org.jboss.soa.esb.couriers.CourierException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.services.registry.RegistryException;
-
-/**
- * Tests for the MessageDeliveryAdapter and UncomposedMessageDeliveryAdapter
- * classes.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MessageDeliveryAdapterUnitTest extends TestCase {
-	private Logger log = Logger
-			.getLogger( MessageDeliveryAdapterUnitTest.class );
-
-    private EPR epr1;
-    private EPR epr2;
-    private EPR epr3;
-    private EPR epr4;
-    private EPR epr5;
-    private MockCourier courier1;
-    private MockCourier courier2;
-    private MockCourier courier3;
-    private MockCourier courier4;
-    private MockCourier courier5;
-    private UncomposedMessageDeliveryAdapter deliveryAdapter;
-    private String payload = "*XX*";
-
-    protected void setUp() throws Exception {
-        MockCourierFactory.install();
-        MockRegistry.install();
-
-        epr1 = new EPR();
-        epr2 = new EPR();
-        epr3 = new EPR();
-        epr4 = new EPR();
-        epr5 = new EPR();
-        courier1 = new MockCourier(false);
-        courier2 = new MockCourier(new CourierException(""));
-        courier3 = new MockCourier(new MalformedEPRException(""));
-        courier4 = new MockCourier(true);
-        courier5 = new MockCourier(true);
-
-        MockRegistry.register("cat", "service", epr1, courier1);
-        MockRegistry.register("cat", "service", epr2, courier2);
-        MockRegistry.register("cat", "service", epr3, courier3);
-        MockRegistry.register("cat", "service", epr4, courier4);
-        MockRegistry.register("cat", "service", epr5, courier5);
-
-        deliveryAdapter = new UncomposedMessageDeliveryAdapter("cat", "service", new MockMessageComposer());
-    }
-
-    protected void tearDown() throws Exception {
-        MockRegistry.uninstall();
-        MockCourierFactory.uninstall();
-    }
-
-    public void test_getCourier_CourierException() throws MessageDeliverException {
-        // Get the courier factory to throw a CourierException
-        MockCourierFactory.courierException = new CourierException("");
-        try {
-        	log.warn( "The following warings are intentional" );
-            deliveryAdapter.deliverAsync(payload);
-            fail("Expected MessageDeliverException");
-        } catch(MessageDeliverException e) {
-            // Expected.
-        }
-        assertNoDeliveryAttempted();
-    }
-
-    public void test_getCourier_MalformedEPRException() throws MessageDeliverException {
-        // Get the courier factory to throw a MalformedEPRException
-        MockCourierFactory.malformedEPRException = new MalformedEPRException("");
-        try {
-        	log.warn( "The following warings are intentional" );
-            deliveryAdapter.deliverAsync(payload);
-            fail("Expected MessageDeliverException");
-        } catch(MessageDeliverException e) {
-            // Expected.
-        }
-        assertNoDeliveryAttempted();
-    }
-
-    public void test_No_EPRs() throws RegistryException, MessageDeliverException {
-        // Make sure there's no attempt to make a delivery when there's no
-        // EPRs for the service.
-        deliveryAdapter = new UncomposedMessageDeliveryAdapter("x", "y", new MockMessageComposer());
-        try {
-            deliveryAdapter.deliverAsync(payload);
-            fail("Expected MessageDeliverException");
-        } catch(MessageDeliverException e) {
-            // Expected.
-        }
-        assertNoDeliveryAttempted();
-    }
-
-    public void test_deliver() throws MessageDeliverException {
-        // Make sure the delivery happens as expected...
-
-        deliveryAdapter.deliverAsync(payload);
-        assertEquals(null, courier1.message);
-        assertEquals(null, courier2.message);
-        assertEquals(null, courier3.message);
-        assertEquals(payload, ActionUtils.getTaskObject(courier4.message));
-        assertEquals(null, courier5.message);
-
-        assertEquals(epr4, deliveryAdapter.getDeliveryAdapter().getLastSuccessfulEPR());
-        String payload2 = "*YYY*";
-        deliveryAdapter.deliverAsync(payload2);
-        assertEquals(payload2, ActionUtils.getTaskObject(courier4.message));
-        assertEquals(epr4, deliveryAdapter.getDeliveryAdapter().getLastSuccessfulEPR());
-    }
-
-    private void assertNoDeliveryAttempted() {
-        if(courier1.deliveryAttempted ||
-           courier2.deliveryAttempted ||
-           courier3.deliveryAttempted ||
-           courier4.deliveryAttempted ||
-           courier5.deliveryAttempted) {
-            fail("A deliverAsync attempt was made on one of the couriers.");
-        }
-    }
-
-    public class MockMessageComposer extends AbstractMessageComposer {
-        public void setConfiguration(ConfigTree config) {
-        }
-        protected void populateMessage(Message message, Object messagePayload) throws MessageDeliverException {
-            ActionUtils.setTaskObject(message, messagePayload);
-        }
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapterUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapterUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapterUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MessageDeliveryAdapterUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,161 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.listeners.message;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.couriers.MockCourier;
+import org.jboss.internal.soa.esb.couriers.MockCourierFactory;
+import org.jboss.internal.soa.esb.services.registry.MockRegistry;
+import org.jboss.soa.esb.actions.ActionUtils;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.MalformedEPRException;
+import org.jboss.soa.esb.couriers.CourierException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.services.registry.RegistryException;
+
+/**
+ * Tests for the MessageDeliveryAdapter and UncomposedMessageDeliveryAdapter
+ * classes.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MessageDeliveryAdapterUnitTest extends TestCase {
+	private Logger log = Logger
+			.getLogger( MessageDeliveryAdapterUnitTest.class );
+
+    private EPR epr1;
+    private EPR epr2;
+    private EPR epr3;
+    private EPR epr4;
+    private EPR epr5;
+    private MockCourier courier1;
+    private MockCourier courier2;
+    private MockCourier courier3;
+    private MockCourier courier4;
+    private MockCourier courier5;
+    private UncomposedMessageDeliveryAdapter deliveryAdapter;
+    private String payload = "*XX*";
+
+    protected void setUp() throws Exception {
+        MockCourierFactory.install();
+        MockRegistry.install();
+
+        epr1 = new EPR();
+        epr2 = new EPR();
+        epr3 = new EPR();
+        epr4 = new EPR();
+        epr5 = new EPR();
+        courier1 = new MockCourier(false);
+        courier2 = new MockCourier(new CourierException(""));
+        courier3 = new MockCourier(new MalformedEPRException(""));
+        courier4 = new MockCourier(true);
+        courier5 = new MockCourier(true);
+
+        MockRegistry.register("cat", "service", epr1, courier1);
+        MockRegistry.register("cat", "service", epr2, courier2);
+        MockRegistry.register("cat", "service", epr3, courier3);
+        MockRegistry.register("cat", "service", epr4, courier4);
+        MockRegistry.register("cat", "service", epr5, courier5);
+
+        deliveryAdapter = new UncomposedMessageDeliveryAdapter("cat", "service", new MockMessageComposer());
+    }
+
+    protected void tearDown() throws Exception {
+        MockRegistry.uninstall();
+        MockCourierFactory.uninstall();
+    }
+
+    public void test_getCourier_CourierException() throws MessageDeliverException {
+        // Get the courier factory to throw a CourierException
+        MockCourierFactory.courierException = new CourierException("");
+        try {
+        	log.warn( "The following warings are intentional" );
+            deliveryAdapter.deliverAsync(payload);
+            fail("Expected MessageDeliverException");
+        } catch(MessageDeliverException e) {
+            // Expected.
+        }
+        assertNoDeliveryAttempted();
+    }
+
+    public void test_getCourier_MalformedEPRException() throws MessageDeliverException {
+        // Get the courier factory to throw a MalformedEPRException
+        MockCourierFactory.malformedEPRException = new MalformedEPRException("");
+        try {
+        	log.warn( "The following warings are intentional" );
+            deliveryAdapter.deliverAsync(payload);
+            fail("Expected MessageDeliverException");
+        } catch(MessageDeliverException e) {
+            // Expected.
+        }
+        assertNoDeliveryAttempted();
+    }
+
+    public void test_No_EPRs() throws RegistryException, MessageDeliverException {
+        // Make sure there's no attempt to make a delivery when there's no
+        // EPRs for the service.
+        deliveryAdapter = new UncomposedMessageDeliveryAdapter("x", "y", new MockMessageComposer());
+        try {
+            deliveryAdapter.deliverAsync(payload);
+            fail("Expected MessageDeliverException");
+        } catch(MessageDeliverException e) {
+            // Expected.
+        }
+        assertNoDeliveryAttempted();
+    }
+
+    public void test_deliver() throws MessageDeliverException {
+        // Make sure the delivery happens as expected...
+
+        deliveryAdapter.deliverAsync(payload);
+        assertEquals(null, courier1.message);
+        assertEquals(null, courier2.message);
+        assertEquals(null, courier3.message);
+        assertEquals(payload, ActionUtils.getTaskObject(courier4.message));
+        assertEquals(null, courier5.message);
+
+        assertEquals(epr4, deliveryAdapter.getDeliveryAdapter().getLastSuccessfulEPR());
+        String payload2 = "*YYY*";
+        deliveryAdapter.deliverAsync(payload2);
+        assertEquals(payload2, ActionUtils.getTaskObject(courier4.message));
+        assertEquals(epr4, deliveryAdapter.getDeliveryAdapter().getLastSuccessfulEPR());
+    }
+
+    private void assertNoDeliveryAttempted() {
+        if(courier1.deliveryAttempted ||
+           courier2.deliveryAttempted ||
+           courier3.deliveryAttempted ||
+           courier4.deliveryAttempted ||
+           courier5.deliveryAttempted) {
+            fail("A deliverAsync attempt was made on one of the couriers.");
+        }
+    }
+
+    public class MockMessageComposer extends AbstractMessageComposer {
+        public void setConfiguration(ConfigTree config) {
+        }
+        protected void populateMessage(Message message, Object messagePayload) throws MessageDeliverException {
+            ActionUtils.setTaskObject(message, messagePayload);
+        }
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionInfo.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionInfo.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionInfo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,101 +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.ArrayList;
-import java.util.List;
-
-class MockActionInfo
-{
-    private static int actionId ;
-    private static List<Integer> initialiseList ;
-    private static List<Integer> processList ;
-    private static List<Integer> successList ;
-    private static List<Integer> exceptionList ;
-    private static List<Integer> destroyList ;
-    
-    static synchronized void reset()
-    {
-        actionId = 0 ;
-        initialiseList = new ArrayList<Integer>() ;
-        processList = new ArrayList<Integer>() ;
-        successList = new ArrayList<Integer>() ;
-        exceptionList = new ArrayList<Integer>() ;
-        destroyList = new ArrayList<Integer>() ;
-    }
-    
-    static synchronized Integer getNextId()
-    {
-        return Integer.valueOf(actionId++) ;
-    }
-    
-    static synchronized void addInitialiseId(final Integer id)
-    {
-        initialiseList.add(id) ;
-    }
-    
-    static synchronized Integer[] getInitialiseList()
-    {
-        return (Integer[])initialiseList.toArray(new Integer[initialiseList.size()]) ;
-    }
-    
-    static synchronized void addProcessId(final Integer id)
-    {
-        processList.add(id) ;
-    }
-    
-    static synchronized Integer[] getProcessList()
-    {
-        return (Integer[])processList.toArray(new Integer[processList.size()]) ;
-    }
-    
-    static synchronized void addSuccessId(final Integer id)
-    {
-        successList.add(id) ;
-    }
-    
-    static synchronized Integer[] getSuccessList()
-    {
-        return (Integer[])successList.toArray(new Integer[successList.size()]) ;
-    }
-    
-    static synchronized void addExceptionId(final Integer id)
-    {
-        exceptionList.add(id) ;
-    }
-    
-    static synchronized Integer[] getExceptionList()
-    {
-        return (Integer[])exceptionList.toArray(new Integer[exceptionList.size()]) ;
-    }
-    
-    static synchronized void addDestroyId(final Integer id)
-    {
-        destroyList.add(id) ;
-    }
-    
-    static synchronized Integer[] getDestroyList()
-    {
-        return (Integer[])destroyList.toArray(new Integer[destroyList.size()]) ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionInfo.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionInfo.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionInfo.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionInfo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,101 @@
+/*
+ * 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.ArrayList;
+import java.util.List;
+
+class MockActionInfo
+{
+    private static int actionId ;
+    private static List<Integer> initialiseList ;
+    private static List<Integer> processList ;
+    private static List<Integer> successList ;
+    private static List<Integer> exceptionList ;
+    private static List<Integer> destroyList ;
+    
+    static synchronized void reset()
+    {
+        actionId = 0 ;
+        initialiseList = new ArrayList<Integer>() ;
+        processList = new ArrayList<Integer>() ;
+        successList = new ArrayList<Integer>() ;
+        exceptionList = new ArrayList<Integer>() ;
+        destroyList = new ArrayList<Integer>() ;
+    }
+    
+    static synchronized Integer getNextId()
+    {
+        return Integer.valueOf(actionId++) ;
+    }
+    
+    static synchronized void addInitialiseId(final Integer id)
+    {
+        initialiseList.add(id) ;
+    }
+    
+    static synchronized Integer[] getInitialiseList()
+    {
+        return (Integer[])initialiseList.toArray(new Integer[initialiseList.size()]) ;
+    }
+    
+    static synchronized void addProcessId(final Integer id)
+    {
+        processList.add(id) ;
+    }
+    
+    static synchronized Integer[] getProcessList()
+    {
+        return (Integer[])processList.toArray(new Integer[processList.size()]) ;
+    }
+    
+    static synchronized void addSuccessId(final Integer id)
+    {
+        successList.add(id) ;
+    }
+    
+    static synchronized Integer[] getSuccessList()
+    {
+        return (Integer[])successList.toArray(new Integer[successList.size()]) ;
+    }
+    
+    static synchronized void addExceptionId(final Integer id)
+    {
+        exceptionList.add(id) ;
+    }
+    
+    static synchronized Integer[] getExceptionList()
+    {
+        return (Integer[])exceptionList.toArray(new Integer[exceptionList.size()]) ;
+    }
+    
+    static synchronized void addDestroyId(final Integer id)
+    {
+        destroyList.add(id) ;
+    }
+    
+    static synchronized Integer[] getDestroyList()
+    {
+        return (Integer[])destroyList.toArray(new Integer[destroyList.size()]) ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,83 +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.actions.ActionLifecycle;
-import org.jboss.soa.esb.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class MockActionLifecycleProcessor implements ActionLifecycle
-{
-    private final Integer id ;
-    private final Integer anotherId ;
-    
-    public MockActionLifecycleProcessor(final ConfigTree tree)
-    {
-        id = MockActionInfo.getNextId() ;
-        anotherId = MockActionInfo.getNextId() ;
-    }
-    
-    public Message process(Message message) throws ActionProcessingException
-    {
-        MockActionInfo.addProcessId(id) ;
-        return message ;
-    }
-    
-    public Message anotherProcess(Message message) throws ActionProcessingException
-    {
-        MockActionInfo.addProcessId(anotherId) ;
-        return message ;
-    }
-    
-    public void processException(Message message, Throwable th)
-    {
-        MockActionInfo.addExceptionId(id) ;
-    }
-
-    public void anotherProcessException(Message message, Throwable th)
-    {
-        MockActionInfo.addExceptionId(anotherId) ;
-    }
-
-    public void processSuccess(Message message)
-    {
-        MockActionInfo.addSuccessId(id) ;
-    }
-
-    public void anotherProcessSuccess(Message message)
-    {
-        MockActionInfo.addSuccessId(anotherId) ;
-    }
-
-    public void destroy() throws ActionLifecycleException
-    {
-        MockActionInfo.addDestroyId(id) ;
-    }
-
-    public void initialise() throws ActionLifecycleException
-    {
-        MockActionInfo.addInitialiseId(id) ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,83 @@
+/*
+ * 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.actions.ActionLifecycle;
+import org.jboss.soa.esb.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MockActionLifecycleProcessor implements ActionLifecycle
+{
+    private final Integer id ;
+    private final Integer anotherId ;
+    
+    public MockActionLifecycleProcessor(final ConfigTree tree)
+    {
+        id = MockActionInfo.getNextId() ;
+        anotherId = MockActionInfo.getNextId() ;
+    }
+    
+    public Message process(Message message) throws ActionProcessingException
+    {
+        MockActionInfo.addProcessId(id) ;
+        return message ;
+    }
+    
+    public Message anotherProcess(Message message) throws ActionProcessingException
+    {
+        MockActionInfo.addProcessId(anotherId) ;
+        return message ;
+    }
+    
+    public void processException(Message message, Throwable th)
+    {
+        MockActionInfo.addExceptionId(id) ;
+    }
+
+    public void anotherProcessException(Message message, Throwable th)
+    {
+        MockActionInfo.addExceptionId(anotherId) ;
+    }
+
+    public void processSuccess(Message message)
+    {
+        MockActionInfo.addSuccessId(id) ;
+    }
+
+    public void anotherProcessSuccess(Message message)
+    {
+        MockActionInfo.addSuccessId(anotherId) ;
+    }
+
+    public void destroy() throws ActionLifecycleException
+    {
+        MockActionInfo.addDestroyId(id) ;
+    }
+
+    public void initialise() throws ActionLifecycleException
+    {
+        MockActionInfo.addInitialiseId(id) ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessorFailure.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessorFailure.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessorFailure.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,42 +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.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class MockActionLifecycleProcessorFailure extends MockActionLifecycleProcessor
-{
-    public MockActionLifecycleProcessorFailure(final ConfigTree tree)
-    {
-        super(tree) ;
-    }
-    
-    @Override
-    public Message process(Message message) throws ActionProcessingException
-    {
-        super.process(message) ;
-        throw new ActionProcessingException("This is a deliberate failure") ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessorFailure.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessorFailure.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessorFailure.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionLifecycleProcessorFailure.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,42 @@
+/*
+ * 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.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MockActionLifecycleProcessorFailure extends MockActionLifecycleProcessor
+{
+    public MockActionLifecycleProcessorFailure(final ConfigTree tree)
+    {
+        super(tree) ;
+    }
+    
+    @Override
+    public Message process(Message message) throws ActionProcessingException
+    {
+        super.process(message) ;
+        throw new ActionProcessingException("This is a deliberate failure") ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,83 +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.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class MockActionPipelineProcessor implements ActionPipelineProcessor
-{
-    private final Integer id ;
-    private final Integer anotherId ;
-    
-    public MockActionPipelineProcessor(final ConfigTree tree)
-    {
-        id = MockActionInfo.getNextId() ;
-        anotherId = MockActionInfo.getNextId() ;
-    }
-    
-    public Message process(Message message) throws ActionProcessingException
-    {
-        MockActionInfo.addProcessId(id) ;
-        return message ;
-    }
-    
-    public Message anotherProcess(Message message) throws ActionProcessingException
-    {
-        MockActionInfo.addProcessId(anotherId) ;
-        return message ;
-    }
-
-    public void processException(Message message, Throwable th)
-    {
-        MockActionInfo.addExceptionId(id) ;
-    }
-
-    public void anotherProcessException(Message message, Throwable th)
-    {
-        MockActionInfo.addExceptionId(anotherId) ;
-    }
-
-    public void processSuccess(Message message)
-    {
-        MockActionInfo.addSuccessId(id) ;
-    }
-
-    public void anotherProcessSuccess(Message message)
-    {
-        MockActionInfo.addSuccessId(anotherId) ;
-    }
-
-    public void destroy() throws ActionLifecycleException
-    {
-        MockActionInfo.addDestroyId(id) ;
-    }
-
-    public void initialise() throws ActionLifecycleException
-    {
-        MockActionInfo.addInitialiseId(id) ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,83 @@
+/*
+ * 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.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MockActionPipelineProcessor implements ActionPipelineProcessor
+{
+    private final Integer id ;
+    private final Integer anotherId ;
+    
+    public MockActionPipelineProcessor(final ConfigTree tree)
+    {
+        id = MockActionInfo.getNextId() ;
+        anotherId = MockActionInfo.getNextId() ;
+    }
+    
+    public Message process(Message message) throws ActionProcessingException
+    {
+        MockActionInfo.addProcessId(id) ;
+        return message ;
+    }
+    
+    public Message anotherProcess(Message message) throws ActionProcessingException
+    {
+        MockActionInfo.addProcessId(anotherId) ;
+        return message ;
+    }
+
+    public void processException(Message message, Throwable th)
+    {
+        MockActionInfo.addExceptionId(id) ;
+    }
+
+    public void anotherProcessException(Message message, Throwable th)
+    {
+        MockActionInfo.addExceptionId(anotherId) ;
+    }
+
+    public void processSuccess(Message message)
+    {
+        MockActionInfo.addSuccessId(id) ;
+    }
+
+    public void anotherProcessSuccess(Message message)
+    {
+        MockActionInfo.addSuccessId(anotherId) ;
+    }
+
+    public void destroy() throws ActionLifecycleException
+    {
+        MockActionInfo.addDestroyId(id) ;
+    }
+
+    public void initialise() throws ActionLifecycleException
+    {
+        MockActionInfo.addInitialiseId(id) ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorConstructorFailure.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorConstructorFailure.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorConstructorFailure.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,65 +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.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class MockActionPipelineProcessorConstructorFailure implements ActionPipelineProcessor
-{
-    private final Integer id ;
-    
-    MockActionPipelineProcessorConstructorFailure(final ConfigTree tree)
-    {
-        id = MockActionInfo.getNextId() ;
-    }
-    
-    public Message process(Message message) throws ActionProcessingException
-    {
-        MockActionInfo.addProcessId(id) ;
-        return message ;
-    }
-
-    public void processException(Message message, Throwable th)
-    {
-        MockActionInfo.addExceptionId(id) ;
-    }
-
-    public void processSuccess(Message message)
-    {
-        MockActionInfo.addSuccessId(id) ;
-    }
-
-    public void destroy() throws ActionLifecycleException
-    {
-        MockActionInfo.addDestroyId(id) ;
-    }
-
-    public void initialise() throws ActionLifecycleException
-    {
-        MockActionInfo.addInitialiseId(id) ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorConstructorFailure.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorConstructorFailure.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorConstructorFailure.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorConstructorFailure.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,65 @@
+/*
+ * 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.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MockActionPipelineProcessorConstructorFailure implements ActionPipelineProcessor
+{
+    private final Integer id ;
+    
+    MockActionPipelineProcessorConstructorFailure(final ConfigTree tree)
+    {
+        id = MockActionInfo.getNextId() ;
+    }
+    
+    public Message process(Message message) throws ActionProcessingException
+    {
+        MockActionInfo.addProcessId(id) ;
+        return message ;
+    }
+
+    public void processException(Message message, Throwable th)
+    {
+        MockActionInfo.addExceptionId(id) ;
+    }
+
+    public void processSuccess(Message message)
+    {
+        MockActionInfo.addSuccessId(id) ;
+    }
+
+    public void destroy() throws ActionLifecycleException
+    {
+        MockActionInfo.addDestroyId(id) ;
+    }
+
+    public void initialise() throws ActionLifecycleException
+    {
+        MockActionInfo.addInitialiseId(id) ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorFailure.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorFailure.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorFailure.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,42 +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.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class MockActionPipelineProcessorFailure extends MockActionPipelineProcessor
-{
-    public MockActionPipelineProcessorFailure(final ConfigTree tree)
-    {
-        super(tree) ;
-    }
-    
-    @Override
-    public Message process(Message message) throws ActionProcessingException
-    {
-        super.process(message) ;
-        throw new ActionProcessingException("This is a deliberate failure") ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorFailure.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorFailure.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorFailure.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionPipelineProcessorFailure.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,42 @@
+/*
+ * 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.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MockActionPipelineProcessorFailure extends MockActionPipelineProcessor
+{
+    public MockActionPipelineProcessorFailure(final ConfigTree tree)
+    {
+        super(tree) ;
+    }
+    
+    @Override
+    public Message process(Message message) throws ActionProcessingException
+    {
+        super.process(message) ;
+        throw new ActionProcessingException("This is a deliberate failure") ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,71 +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.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class MockActionProcessor
-{
-    private final Integer id ;
-    private final Integer anotherId ;
-    
-    public MockActionProcessor(final ConfigTree tree)
-    {
-        id = MockActionInfo.getNextId() ;
-        anotherId = MockActionInfo.getNextId() ;
-    }
-    
-    public Message process(Message message) throws ActionProcessingException
-    {
-        MockActionInfo.addProcessId(id) ;
-        return message ;
-    }
-    
-    public Message anotherProcess(Message message) throws ActionProcessingException
-    {
-        MockActionInfo.addProcessId(anotherId) ;
-        return message ;
-    }
-
-    public void processException(Message message, Throwable th)
-    {
-        MockActionInfo.addExceptionId(id) ;
-    }
-
-    public void anotherProcessException(Message message, Throwable th)
-    {
-        MockActionInfo.addExceptionId(anotherId) ;
-    }
-
-    public void processSuccess(Message message)
-    {
-        MockActionInfo.addSuccessId(id) ;
-    }
-
-    public void anotherProcessSuccess(Message message)
-    {
-        MockActionInfo.addSuccessId(anotherId) ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,71 @@
+/*
+ * 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.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MockActionProcessor
+{
+    private final Integer id ;
+    private final Integer anotherId ;
+    
+    public MockActionProcessor(final ConfigTree tree)
+    {
+        id = MockActionInfo.getNextId() ;
+        anotherId = MockActionInfo.getNextId() ;
+    }
+    
+    public Message process(Message message) throws ActionProcessingException
+    {
+        MockActionInfo.addProcessId(id) ;
+        return message ;
+    }
+    
+    public Message anotherProcess(Message message) throws ActionProcessingException
+    {
+        MockActionInfo.addProcessId(anotherId) ;
+        return message ;
+    }
+
+    public void processException(Message message, Throwable th)
+    {
+        MockActionInfo.addExceptionId(id) ;
+    }
+
+    public void anotherProcessException(Message message, Throwable th)
+    {
+        MockActionInfo.addExceptionId(anotherId) ;
+    }
+
+    public void processSuccess(Message message)
+    {
+        MockActionInfo.addSuccessId(id) ;
+    }
+
+    public void anotherProcessSuccess(Message message)
+    {
+        MockActionInfo.addSuccessId(anotherId) ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessorFailure.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessorFailure.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessorFailure.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,42 +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.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class MockActionProcessorFailure extends MockActionProcessor
-{
-    public MockActionProcessorFailure(final ConfigTree tree)
-    {
-        super(tree) ;
-    }
-    
-    @Override
-    public Message process(Message message) throws ActionProcessingException
-    {
-        super.process(message) ;
-        throw new ActionProcessingException("This is a deliberate failure") ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessorFailure.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessorFailure.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessorFailure.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/MockActionProcessorFailure.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,42 @@
+/*
+ * 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.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class MockActionProcessorFailure extends MockActionProcessor
+{
+    public MockActionProcessorFailure(final ConfigTree tree)
+    {
+        super(tree) ;
+    }
+    
+    @Override
+    public Message process(Message message) throws ActionProcessingException
+    {
+        super.process(message) ;
+        throw new ActionProcessingException("This is a deliberate failure") ;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/NPEActionProcessor.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/NPEActionProcessor.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/NPEActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,81 +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.actions.ActionLifecycleException;
-import org.jboss.soa.esb.actions.ActionPipelineProcessor;
-import org.jboss.soa.esb.actions.ActionProcessingException;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class NPEActionProcessor implements ActionPipelineProcessor
-{
-    private final Integer id ;
-    private final Integer anotherId ;
-    
-    public NPEActionProcessor(final ConfigTree tree)
-    {
-        id = MockActionInfo.getNextId() ;
-        anotherId = MockActionInfo.getNextId() ;
-    }
-    
-    public Message process(Message message) throws ActionProcessingException
-    {
-        throw new NullPointerException();
-    }
-    
-    public Message anotherProcess(Message message) throws ActionProcessingException
-    {
-    	throw new NullPointerException();
-    }
-
-    public void processException(Message message, Throwable th)
-    {
-        MockActionInfo.addExceptionId(id) ;
-    }
-
-    public void anotherProcessException(Message message, Throwable th)
-    {
-        MockActionInfo.addExceptionId(anotherId) ;
-    }
-
-    public void processSuccess(Message message)
-    {
-        MockActionInfo.addSuccessId(id) ;
-    }
-
-    public void anotherProcessSuccess(Message message)
-    {
-        MockActionInfo.addSuccessId(anotherId) ;
-    }
-
-    public void destroy() throws ActionLifecycleException
-    {
-        MockActionInfo.addDestroyId(id) ;
-    }
-
-    public void initialise() throws ActionLifecycleException
-    {
-        MockActionInfo.addInitialiseId(id) ;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/NPEActionProcessor.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/NPEActionProcessor.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/NPEActionProcessor.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/listeners/message/NPEActionProcessor.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,81 @@
+/*
+ * 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.actions.ActionLifecycleException;
+import org.jboss.soa.esb.actions.ActionPipelineProcessor;
+import org.jboss.soa.esb.actions.ActionProcessingException;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class NPEActionProcessor implements ActionPipelineProcessor
+{
+    private final Integer id ;
+    private final Integer anotherId ;
+    
+    public NPEActionProcessor(final ConfigTree tree)
+    {
+        id = MockActionInfo.getNextId() ;
+        anotherId = MockActionInfo.getNextId() ;
+    }
+    
+    public Message process(Message message) throws ActionProcessingException
+    {
+        throw new NullPointerException();
+    }
+    
+    public Message anotherProcess(Message message) throws ActionProcessingException
+    {
+    	throw new NullPointerException();
+    }
+
+    public void processException(Message message, Throwable th)
+    {
+        MockActionInfo.addExceptionId(id) ;
+    }
+
+    public void anotherProcessException(Message message, Throwable th)
+    {
+        MockActionInfo.addExceptionId(anotherId) ;
+    }
+
+    public void processSuccess(Message message)
+    {
+        MockActionInfo.addSuccessId(id) ;
+    }
+
+    public void anotherProcessSuccess(Message message)
+    {
+        MockActionInfo.addSuccessId(anotherId) ;
+    }
+
+    public void destroy() throws ActionLifecycleException
+    {
+        MockActionInfo.addDestroyId(id) ;
+    }
+
+    public void initialise() throws ActionLifecycleException
+    {
+        MockActionInfo.addInitialiseId(id) ;
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format)

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,124 +0,0 @@
-package org.jboss.soa.esb.message.format.tests;
-
-import java.net.URI;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.message.Attachment;
-import org.jboss.soa.esb.message.Body;
-import org.jboss.soa.esb.message.Context;
-import org.jboss.soa.esb.message.Fault;
-import org.jboss.soa.esb.message.Header;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.Properties;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Used to plug in new message formats dynamically. Each plugin is responsible for
- * returning a message implementation that knows how to serialize its state in a
- * specific manner, e.g., XML or ASN.1.
- *  
- * @author Mark Little
- *
- */
-
-public class ExampleMessageImpl implements Message
-{
-	private Logger log = Logger.getLogger( ExampleMessageImpl.class );
-	
-	/**
-     * 
-     */
-    private static final long serialVersionUID = 1L;
-
-    /**
-	 * @return get the header component of the message.
-	 */
-	
-	public Header getHeader ()
-	{
-		return null;
-	}
-
-	/**
-	 * @return get the context component of the message.
-	 */
-	
-	public Context getContext ()
-	{
-		return null;
-	}
-	
-	/**
-	 * @return get the body component of the message.
-	 */
-	
-	public Body getBody ()
-	{
-		return null;
-	}
-
-	/**
-	 * @return get any faults associated with the message. These should not
-	 * be application level faults, but comms level.
-	 */
-	
-	public Fault getFault ()
-	{
-		return null;
-	}
-	
-	/**
-	 * @return get any message attachments.
-	 */
-	
-	public Attachment getAttachment ()
-	{
-		return null;
-	}
-	/**
-	 * @return get any message properties 
-	 */	
-	public Properties getProperties() 
-	{
-		return null;
-	}
-	
-	/**
-	 * @return the type of this message.
-	 */
-	
-	public URI getType ()
-	{
-		try
-		{
-			return new URI(ExampleMessagePlugin.URN);
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			return null;
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessageImpl.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,124 @@
+package org.jboss.soa.esb.message.format.tests;
+
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Attachment;
+import org.jboss.soa.esb.message.Body;
+import org.jboss.soa.esb.message.Context;
+import org.jboss.soa.esb.message.Fault;
+import org.jboss.soa.esb.message.Header;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.Properties;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Used to plug in new message formats dynamically. Each plugin is responsible for
+ * returning a message implementation that knows how to serialize its state in a
+ * specific manner, e.g., XML or ASN.1.
+ *  
+ * @author Mark Little
+ *
+ */
+
+public class ExampleMessageImpl implements Message
+{
+	private Logger log = Logger.getLogger( ExampleMessageImpl.class );
+	
+	/**
+     * 
+     */
+    private static final long serialVersionUID = 1L;
+
+    /**
+	 * @return get the header component of the message.
+	 */
+	
+	public Header getHeader ()
+	{
+		return null;
+	}
+
+	/**
+	 * @return get the context component of the message.
+	 */
+	
+	public Context getContext ()
+	{
+		return null;
+	}
+	
+	/**
+	 * @return get the body component of the message.
+	 */
+	
+	public Body getBody ()
+	{
+		return null;
+	}
+
+	/**
+	 * @return get any faults associated with the message. These should not
+	 * be application level faults, but comms level.
+	 */
+	
+	public Fault getFault ()
+	{
+		return null;
+	}
+	
+	/**
+	 * @return get any message attachments.
+	 */
+	
+	public Attachment getAttachment ()
+	{
+		return null;
+	}
+	/**
+	 * @return get any message properties 
+	 */	
+	public Properties getProperties() 
+	{
+		return null;
+	}
+	
+	/**
+	 * @return the type of this message.
+	 */
+	
+	public URI getType ()
+	{
+		try
+		{
+			return new URI(ExampleMessagePlugin.URN);
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			return null;
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,71 +0,0 @@
-package org.jboss.soa.esb.message.format.tests;
-
-import java.net.URI;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessagePlugin;
-
-/*
- * 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 mark.little at jboss.com
- */
-
-/**
- * Used to plug in new message formats dynamically. Each plugin is responsible for
- * returning a message implementation that knows how to serialize its state in a
- * specific manner, e.g., XML or ASN.1.
- *  
- * @author Mark Little
- *
- */
-
-public class ExampleMessagePlugin implements MessagePlugin
-{
-	private Logger log = Logger.getLogger( ExampleMessagePlugin.class );
-	
-	public static final String URN = "foobar";
-	
-	/**
-	 * @return the message instance.
-	 */
-	
-	public Message getMessage ()
-	{
-		return new ExampleMessageImpl();
-	}
-	
-	/**
-	 * @return the unique identifier for this message plugin.
-	 */
-	
-	public URI getType ()
-	{
-		try
-		{
-			return new URI(URN);
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			return null;
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,71 @@
+package org.jboss.soa.esb.message.format.tests;
+
+import java.net.URI;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessagePlugin;
+
+/*
+ * 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 mark.little at jboss.com
+ */
+
+/**
+ * Used to plug in new message formats dynamically. Each plugin is responsible for
+ * returning a message implementation that knows how to serialize its state in a
+ * specific manner, e.g., XML or ASN.1.
+ *  
+ * @author Mark Little
+ *
+ */
+
+public class ExampleMessagePlugin implements MessagePlugin
+{
+	private Logger log = Logger.getLogger( ExampleMessagePlugin.class );
+	
+	public static final String URN = "foobar";
+	
+	/**
+	 * @return the message instance.
+	 */
+	
+	public Message getMessage ()
+	{
+		return new ExampleMessageImpl();
+	}
+	
+	/**
+	 * @return the unique identifier for this message plugin.
+	 */
+	
+	public URI getType ()
+	{
+		try
+		{
+			return new URI(URN);
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			return null;
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,131 +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.message.format.tests;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessagePlugin;
-import org.jboss.soa.esb.message.format.MessageType;
-
-/**
- * Unit tests for the Class class.
- * 
- * @author Mark Little
- */
-
-public class MessageFactoryUnitTest extends TestCase
-{
-	public void testDefaultMessage ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage();
-		
-		assertEquals((msg != null), true);
-	}
-	
-	public void testURIMessage ()
-	{
-		Message msg1 = MessageFactory.getInstance().getMessage(MessageType.DEFAULT_TYPE);
-		Message msg2 = MessageFactory.getInstance().getMessage();
-		
-		assertEquals(msg1.getType().equals(msg2.getType()), true);
-		
-		Message msg3 = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-		
-		assertEquals(msg1.getType().equals(msg3.getType()), false);
-	}
-	
-	public void testInvalidURIMessage ()
-	{
-		try
-		{
-			Message msg = MessageFactory.getInstance().getMessage(new URI("urn:foo"));
-			
-			assertEquals((msg == null), true);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testNullURIMessage ()
-	{
-		try
-		{
-			@SuppressWarnings("unused")
-			Message msg = MessageFactory.getInstance().getMessage(null);
-			
-			fail();
-		}
-		catch (IllegalArgumentException ex)
-		{
-			// success
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testNullURIConvertMessage ()
-	{
-		try
-		{
-			@SuppressWarnings("unused")
-			Message msg = MessageFactory.getInstance().getMessage(null, null);
-			
-			fail();
-		}
-		catch (IllegalArgumentException ex)
-		{
-			// success
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testPlugin ()
-	{
-		System.setProperty(MessagePlugin.MESSAGE_PLUGIN+"1", ExampleMessagePlugin.class.getName());
-		
-		MessageFactory.getInstance().reset();
-		
-		try
-		{
-			URI uri = new URI(ExampleMessagePlugin.URN);
-			Message msg = MessageFactory.getInstance().getMessage(uri);
-
-			assertEquals(msg.getType().equals(uri), true);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,131 @@
+/*
+ * 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.message.format.tests;
+
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessagePlugin;
+import org.jboss.soa.esb.message.format.MessageType;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class MessageFactoryUnitTest extends TestCase
+{
+	public void testDefaultMessage ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage();
+		
+		assertEquals((msg != null), true);
+	}
+	
+	public void testURIMessage ()
+	{
+		Message msg1 = MessageFactory.getInstance().getMessage(MessageType.DEFAULT_TYPE);
+		Message msg2 = MessageFactory.getInstance().getMessage();
+		
+		assertEquals(msg1.getType().equals(msg2.getType()), true);
+		
+		Message msg3 = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+		
+		assertEquals(msg1.getType().equals(msg3.getType()), false);
+	}
+	
+	public void testInvalidURIMessage ()
+	{
+		try
+		{
+			Message msg = MessageFactory.getInstance().getMessage(new URI("urn:foo"));
+			
+			assertEquals((msg == null), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testNullURIMessage ()
+	{
+		try
+		{
+			@SuppressWarnings("unused")
+			Message msg = MessageFactory.getInstance().getMessage(null);
+			
+			fail();
+		}
+		catch (IllegalArgumentException ex)
+		{
+			// success
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testNullURIConvertMessage ()
+	{
+		try
+		{
+			@SuppressWarnings("unused")
+			Message msg = MessageFactory.getInstance().getMessage(null, null);
+			
+			fail();
+		}
+		catch (IllegalArgumentException ex)
+		{
+			// success
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testPlugin ()
+	{
+		System.setProperty(MessagePlugin.MESSAGE_PLUGIN+"1", ExampleMessagePlugin.class.getName());
+		
+		MessageFactory.getInstance().reset();
+		
+		try
+		{
+			URI uri = new URI(ExampleMessagePlugin.URN);
+			Message msg = MessageFactory.getInstance().getMessage(uri);
+
+			assertEquals(msg.getType().equals(uri), true);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/MessageMapperTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/MessageMapperTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/MessageMapperTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,133 +0,0 @@
-/**
- * 
- */
-package org.jboss.soa.esb.message.mapping;
-
-import static org.junit.Assert.assertTrue;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.junit.Test;
-
-
-/**
- * @author kstam
- *
- */
-public class MessageMapperTest {
-
-    @Test
-    public void property () {
-        ObjectMapper mapper = new ObjectMapper();
-        Message message = MessageFactory.getInstance().getMessage();
-        List<String> variableList = new ArrayList<String>();
-        
-        message.getProperties().setProperty("property1", "some object");
-        variableList.add("property.property1");
-        
-        TestPojo testPojo1 = new TestPojo();
-        testPojo1.setCount(1);
-        testPojo1.setName("test1");
-        TestPojo testPojo2 = new TestPojo();
-        testPojo2.setCount(1);
-        testPojo2.setName("test2");
-        testPojo1.setTestPojo(testPojo2);
-        message.getProperties().setProperty("property2", testPojo1);
-        variableList.add("property.property2.testPojo.testPojo");
-        
-        List<Object> pojos=mapper.createObjectList(message, variableList);
-        
-        Object pojo1 = pojos.get(0);
-        assertTrue("some object".equals(pojo1));
-        
-        Object pojo2 = pojos.get(1);
-        assertTrue(testPojo2.equals(pojo2));
-    }
-    
-    @Test
-    public void attachment_hashmap() {
-        ObjectMapper mapper = new ObjectMapper();
-        Message message = MessageFactory.getInstance().getMessage();
-        List<String> variableList = new ArrayList<String>();
-        
-        message.getAttachment().put("attachment1", "some object");
-        variableList.add("attachment.attachment1");
-        
-        TestPojo testPojo1 = new TestPojo();
-        testPojo1.setCount(1);
-        testPojo1.setName("test1");
-        TestPojo testPojo2 = new TestPojo();
-        testPojo2.setCount(1);
-        testPojo2.setName("test2");
-        testPojo1.setTestPojo(testPojo2);
-        message.getAttachment().put("attachment2", testPojo1);
-        variableList.add("attachment.attachment2.testPojo.testPojo");
-        
-        List<Object> pojos=mapper.createObjectList(message, variableList);
-        
-        Object pojo1 = pojos.get(0);
-        assertTrue("some object".equals(pojo1));
-        
-        Object pojo2 = pojos.get(1);
-        assertTrue(testPojo2.equals(pojo2));  
-    }
-    
-    @Test
-    public void attachment_list() {
-        ObjectMapper mapper = new ObjectMapper();
-        Message message = MessageFactory.getInstance().getMessage();
-        List<String> variableList = new ArrayList<String>();
-        
-        message.getAttachment().addItem("some object");
-        variableList.add("attachment.0");
-        
-        TestPojo testPojo1 = new TestPojo();
-        testPojo1.setCount(1);
-        testPojo1.setName("test1");
-        TestPojo testPojo2 = new TestPojo();
-        testPojo2.setCount(1);
-        testPojo2.setName("test2");
-        testPojo1.setTestPojo(testPojo2);
-        message.getAttachment().addItem(testPojo1);
-        variableList.add("attachment.1.testPojo.testPojo");
-        
-        List<Object> pojos=mapper.createObjectList(message, variableList);
-        
-        Object pojo1 = pojos.get(0);
-        assertTrue("some object".equals(pojo1));
-        
-        Object pojo2 = pojos.get(1);
-        assertTrue(testPojo2.equals(pojo2));
-    }
-    
-    @Test
-    public void body() {
-        ObjectMapper mapper = new ObjectMapper();
-        Message message = MessageFactory.getInstance().getMessage();
-        List<String> variableList = new ArrayList<String>();
-        
-        message.getBody().add("body1", "some object");
-        variableList.add("body.body1");
-        
-        TestPojo testPojo1 = new TestPojo();
-        testPojo1.setCount(1);
-        testPojo1.setName("test1");
-        TestPojo testPojo2 = new TestPojo();
-        testPojo2.setCount(1);
-        testPojo2.setName("test2");
-        testPojo1.setTestPojo(testPojo2);
-        message.getBody().add("body2", testPojo1);
-        variableList.add("body.body2.testPojo.testPojo");
-        
-        List<Object> pojos=mapper.createObjectList(message, variableList);
-        
-        Object pojo1 = pojos.get(0);
-        assertTrue("some object".equals(pojo1));
-        
-        Object pojo2 = pojos.get(1);
-        assertTrue(testPojo2.equals(pojo2));  
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/MessageMapperTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/MessageMapperTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/MessageMapperTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/MessageMapperTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,133 @@
+/**
+ * 
+ */
+package org.jboss.soa.esb.message.mapping;
+
+import static org.junit.Assert.assertTrue;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.junit.Test;
+
+
+/**
+ * @author kstam
+ *
+ */
+public class MessageMapperTest {
+
+    @Test
+    public void property () {
+        ObjectMapper mapper = new ObjectMapper();
+        Message message = MessageFactory.getInstance().getMessage();
+        List<String> variableList = new ArrayList<String>();
+        
+        message.getProperties().setProperty("property1", "some object");
+        variableList.add("property.property1");
+        
+        TestPojo testPojo1 = new TestPojo();
+        testPojo1.setCount(1);
+        testPojo1.setName("test1");
+        TestPojo testPojo2 = new TestPojo();
+        testPojo2.setCount(1);
+        testPojo2.setName("test2");
+        testPojo1.setTestPojo(testPojo2);
+        message.getProperties().setProperty("property2", testPojo1);
+        variableList.add("property.property2.testPojo.testPojo");
+        
+        List<Object> pojos=mapper.createObjectList(message, variableList);
+        
+        Object pojo1 = pojos.get(0);
+        assertTrue("some object".equals(pojo1));
+        
+        Object pojo2 = pojos.get(1);
+        assertTrue(testPojo2.equals(pojo2));
+    }
+    
+    @Test
+    public void attachment_hashmap() {
+        ObjectMapper mapper = new ObjectMapper();
+        Message message = MessageFactory.getInstance().getMessage();
+        List<String> variableList = new ArrayList<String>();
+        
+        message.getAttachment().put("attachment1", "some object");
+        variableList.add("attachment.attachment1");
+        
+        TestPojo testPojo1 = new TestPojo();
+        testPojo1.setCount(1);
+        testPojo1.setName("test1");
+        TestPojo testPojo2 = new TestPojo();
+        testPojo2.setCount(1);
+        testPojo2.setName("test2");
+        testPojo1.setTestPojo(testPojo2);
+        message.getAttachment().put("attachment2", testPojo1);
+        variableList.add("attachment.attachment2.testPojo.testPojo");
+        
+        List<Object> pojos=mapper.createObjectList(message, variableList);
+        
+        Object pojo1 = pojos.get(0);
+        assertTrue("some object".equals(pojo1));
+        
+        Object pojo2 = pojos.get(1);
+        assertTrue(testPojo2.equals(pojo2));  
+    }
+    
+    @Test
+    public void attachment_list() {
+        ObjectMapper mapper = new ObjectMapper();
+        Message message = MessageFactory.getInstance().getMessage();
+        List<String> variableList = new ArrayList<String>();
+        
+        message.getAttachment().addItem("some object");
+        variableList.add("attachment.0");
+        
+        TestPojo testPojo1 = new TestPojo();
+        testPojo1.setCount(1);
+        testPojo1.setName("test1");
+        TestPojo testPojo2 = new TestPojo();
+        testPojo2.setCount(1);
+        testPojo2.setName("test2");
+        testPojo1.setTestPojo(testPojo2);
+        message.getAttachment().addItem(testPojo1);
+        variableList.add("attachment.1.testPojo.testPojo");
+        
+        List<Object> pojos=mapper.createObjectList(message, variableList);
+        
+        Object pojo1 = pojos.get(0);
+        assertTrue("some object".equals(pojo1));
+        
+        Object pojo2 = pojos.get(1);
+        assertTrue(testPojo2.equals(pojo2));
+    }
+    
+    @Test
+    public void body() {
+        ObjectMapper mapper = new ObjectMapper();
+        Message message = MessageFactory.getInstance().getMessage();
+        List<String> variableList = new ArrayList<String>();
+        
+        message.getBody().add("body1", "some object");
+        variableList.add("body.body1");
+        
+        TestPojo testPojo1 = new TestPojo();
+        testPojo1.setCount(1);
+        testPojo1.setName("test1");
+        TestPojo testPojo2 = new TestPojo();
+        testPojo2.setCount(1);
+        testPojo2.setName("test2");
+        testPojo1.setTestPojo(testPojo2);
+        message.getBody().add("body2", testPojo1);
+        variableList.add("body.body2.testPojo.testPojo");
+        
+        List<Object> pojos=mapper.createObjectList(message, variableList);
+        
+        Object pojo1 = pojos.get(0);
+        assertTrue("some object".equals(pojo1));
+        
+        Object pojo2 = pojos.get(1);
+        assertTrue(testPojo2.equals(pojo2));  
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/TestPojo.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/TestPojo.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/TestPojo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,37 +0,0 @@
-/**
- * 
- */
-package org.jboss.soa.esb.message.mapping;
-
-import java.io.Serializable;
-
-/**
- * @author kstam
- *
- */
-public class TestPojo implements Serializable
-{
-    private static final long serialVersionUID = 1L;
-    String name;
-    int count;
-    TestPojo testPojo;
-    
-    public int getCount() {
-        return count;
-    }
-    public void setCount(int count) {
-        this.count = count;
-    }
-    public String getName() {
-        return name;
-    }
-    public void setName(String name) {
-        this.name = name;
-    }
-    public TestPojo getTestPojo() {
-        return testPojo;
-    }
-    public void setTestPojo(TestPojo testPojo) {
-        this.testPojo = testPojo;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/TestPojo.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/TestPojo.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/TestPojo.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/mapping/TestPojo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,37 @@
+/**
+ * 
+ */
+package org.jboss.soa.esb.message.mapping;
+
+import java.io.Serializable;
+
+/**
+ * @author kstam
+ *
+ */
+public class TestPojo implements Serializable
+{
+    private static final long serialVersionUID = 1L;
+    String name;
+    int count;
+    TestPojo testPojo;
+    
+    public int getCount() {
+        return count;
+    }
+    public void setCount(int count) {
+        this.count = count;
+    }
+    public String getName() {
+        return name;
+    }
+    public void setName(String name) {
+        this.name = name;
+    }
+    public TestPojo getTestPojo() {
+        return testPojo;
+    }
+    public void setTestPojo(TestPojo testPojo) {
+        this.testPojo = testPojo;
+    }
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,209 +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.message.tests;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.StringWriter;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
-import org.jboss.soa.esb.message.Attachment;
-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.w3c.dom.Document;
-
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
-/**
- * Unit tests for the Class class.
- * 
- * @author Mark Little
- */
-
-public class AttachmentUnitTest extends TestCase
-{
-	private Logger log = Logger.getLogger( AttachmentUnitTest.class );
-	
-	public void testSerializeAttachment()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-
-		Attachment at = msg.getAttachment();
-
-		assertEquals((msg != null), true);
-
-		at.addItem(new ExampleObject(0)); // un-named
-		at.addItemAt(0, new ExampleObject(0)); // un-named;
-
-		try
-		{
-			at.addItem(new Object());
-
-			fail();
-		}
-		catch (IllegalArgumentException ex)
-		{
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-
-		assertEquals(at.getUnnamedCount(), 2);
-
-		assertEquals(at.get("foo"), null);
-
-		at.put("foobar", new ExampleObject(1));
-
-		assertEquals(at.getNamedCount(), 1);
-
-		at.addItem(new ExampleObject(1));
-		at.addItem(new ExampleObject(2));
-
-		assertEquals((at.getNames() != null), true);
-
-		assertEquals((at.removeItemAt(0) != null), true);
-
-		at.replaceItemAt(0, new ExampleObject(2));
-
-		int count = at.getUnnamedCount();
-
-		try
-		{
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-
-			o.writeObject(msg);
-			o.close();
-
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-
-			assertEquals(nImpl.getAttachment().getUnnamedCount(), count);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-	public void testXMLAttachment()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertEquals((msg != null), true);
-
-		Attachment at = msg.getAttachment();
-
-		assertEquals((msg != null), true);
-
-		at.addItem(new ExampleObject(0)); // un-named
-		at.addItemAt(0, new ExampleObject(0)); // un-named;
-
-		try
-		{
-			at.addItem(new Object());
-
-			fail();
-		}
-		catch (IllegalArgumentException ex)
-		{
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-
-		assertEquals(at.getUnnamedCount(), 2);
-
-		assertEquals(at.get("foo"), null);
-
-		at.put("foobar", new ExampleObject(1));
-
-		assertEquals(at.getNamedCount(), 1);
-
-		at.addItem(new ExampleObject(1));
-		at.addItem(new ExampleObject(2));
-
-		assertEquals((at.getNames() != null), true);
-
-		assertEquals((at.removeItemAt(0) != null), true);
-
-		at.replaceItemAt(0, new ExampleObject(2));
-
-		int count = at.getUnnamedCount();
-
-		try
-		{
-			DocumentBuilderFactory factory = DocumentBuilderFactory
-					.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			Document doc = builder.newDocument();
-			org.jboss.internal.soa.esb.message.format.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg;
-
-			doc = theImpl.toXML(doc);
-
-			StringWriter sWriter = new StringWriter();
-			OutputFormat format = new OutputFormat();
-			format.setIndenting(true);
-
-			XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-
-			xmlS.asDOMSerializer();
-			xmlS.serialize(doc);
-
-			String documentAsString = sWriter.toString();
-
-			log.debug("Message looks like: " + documentAsString);
-
-			org.jboss.internal.soa.esb.message.format.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
-
-			nImpl.fromXML(doc);
-
-			assertEquals(nImpl.getAttachment().getUnnamedCount(), count);
-		}
-		catch (Exception ex)
-		{
-			log.error( ex );
-			
-			fail(ex.toString());
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,209 @@
+/*
+ * 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.message.tests;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
+import org.jboss.soa.esb.message.Attachment;
+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.w3c.dom.Document;
+
+import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class AttachmentUnitTest extends TestCase
+{
+	private Logger log = Logger.getLogger( AttachmentUnitTest.class );
+	
+	public void testSerializeAttachment()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+
+		Attachment at = msg.getAttachment();
+
+		assertEquals((msg != null), true);
+
+		at.addItem(new ExampleObject(0)); // un-named
+		at.addItemAt(0, new ExampleObject(0)); // un-named;
+
+		try
+		{
+			at.addItem(new Object());
+
+			fail();
+		}
+		catch (IllegalArgumentException ex)
+		{
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+
+		assertEquals(at.getUnnamedCount(), 2);
+
+		assertEquals(at.get("foo"), null);
+
+		at.put("foobar", new ExampleObject(1));
+
+		assertEquals(at.getNamedCount(), 1);
+
+		at.addItem(new ExampleObject(1));
+		at.addItem(new ExampleObject(2));
+
+		assertEquals((at.getNames() != null), true);
+
+		assertEquals((at.removeItemAt(0) != null), true);
+
+		at.replaceItemAt(0, new ExampleObject(2));
+
+		int count = at.getUnnamedCount();
+
+		try
+		{
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+
+			o.writeObject(msg);
+			o.close();
+
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+
+			assertEquals(nImpl.getAttachment().getUnnamedCount(), count);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+	public void testXMLAttachment()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertEquals((msg != null), true);
+
+		Attachment at = msg.getAttachment();
+
+		assertEquals((msg != null), true);
+
+		at.addItem(new ExampleObject(0)); // un-named
+		at.addItemAt(0, new ExampleObject(0)); // un-named;
+
+		try
+		{
+			at.addItem(new Object());
+
+			fail();
+		}
+		catch (IllegalArgumentException ex)
+		{
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+
+		assertEquals(at.getUnnamedCount(), 2);
+
+		assertEquals(at.get("foo"), null);
+
+		at.put("foobar", new ExampleObject(1));
+
+		assertEquals(at.getNamedCount(), 1);
+
+		at.addItem(new ExampleObject(1));
+		at.addItem(new ExampleObject(2));
+
+		assertEquals((at.getNames() != null), true);
+
+		assertEquals((at.removeItemAt(0) != null), true);
+
+		at.replaceItemAt(0, new ExampleObject(2));
+
+		int count = at.getUnnamedCount();
+
+		try
+		{
+			DocumentBuilderFactory factory = DocumentBuilderFactory
+					.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			Document doc = builder.newDocument();
+			org.jboss.internal.soa.esb.message.format.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg;
+
+			doc = theImpl.toXML(doc);
+
+			StringWriter sWriter = new StringWriter();
+			OutputFormat format = new OutputFormat();
+			format.setIndenting(true);
+
+			XMLSerializer xmlS = new XMLSerializer(sWriter, format);
+
+			xmlS.asDOMSerializer();
+			xmlS.serialize(doc);
+
+			String documentAsString = sWriter.toString();
+
+			log.debug("Message looks like: " + documentAsString);
+
+			org.jboss.internal.soa.esb.message.format.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
+
+			nImpl.fromXML(doc);
+
+			assertEquals(nImpl.getAttachment().getUnnamedCount(), count);
+		}
+		catch (Exception ex)
+		{
+			log.error( ex );
+			
+			fail(ex.toString());
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,229 +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.message.tests;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.StringWriter;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
-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.w3c.dom.Document;
-
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
-/**
- * Unit tests for the Class class.
- * 
- * @author Mark Little
- */
-
-public class BodyUnitTest extends TestCase
-{
-	private Logger log = Logger.getLogger( BodyUnitTest.class );
-	
-	public void testXMLAddString ()
-	{
-		// get XML message
-
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertEquals((msg != null), true);
-
-		try
-		{
-			msg.getBody().add("foo", "bar");
-			
-			assertEquals(msg.getBody().get("foo"), "bar");
-			
-			DocumentBuilderFactory factory = DocumentBuilderFactory
-					.newInstance();
-			
-			factory.setNamespaceAware(true);
-			
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			Document doc = builder.newDocument();
-			MessageImpl theImpl = (MessageImpl) msg;
-
-			doc = theImpl.toXML(doc);
-
-			StringWriter sWriter = new StringWriter();
-			OutputFormat format = new OutputFormat();
-			format.setIndenting(true);
-
-			XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-
-			xmlS.asDOMSerializer();
-			xmlS.serialize(doc);
-
-			String documentAsString = sWriter.toString();
-
-			MessageImpl nImpl = new MessageImpl();
-
-			log.debug("Document is "+documentAsString);
-			
-			nImpl.fromXML(doc);
-			
-			assertEquals(nImpl.getBody().get("foo"), "bar");
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testXMLAddBoolean ()
-	{
-		// get XML message
-
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertEquals((msg != null), true);
-
-		try
-		{
-			msg.getBody().add("foo", new Boolean(true));
-			
-			assertEquals(msg.getBody().get("foo"), new Boolean(true));
-			
-			DocumentBuilderFactory factory = DocumentBuilderFactory
-					.newInstance();
-			factory.setNamespaceAware(true);
-			
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			Document doc = builder.newDocument();
-			MessageImpl theImpl = (MessageImpl) msg;
-
-			doc = theImpl.toXML(doc);
-
-			StringWriter sWriter = new StringWriter();
-			OutputFormat format = new OutputFormat();
-			format.setIndenting(true);
-
-			XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-
-			xmlS.asDOMSerializer();
-			xmlS.serialize(doc);
-
-			String documentAsString = sWriter.toString();
-
-			MessageImpl nImpl = new MessageImpl();
-
-			log.debug("Document is "+documentAsString);
-			
-			nImpl.fromXML(doc);
-			
-			assertEquals(nImpl.getBody().get("foo"), new Boolean(true));
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSerializedAddString ()
-	{
-		// get XML message
-
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-
-		try
-		{
-			msg.getBody().add("foo", "bar");
-			
-			assertEquals(msg.getBody().get("foo"), "bar");
-			
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-			
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			org.jboss.internal.soa.esb.message.format.serialized.MessageImpl nImpl = (org.jboss.internal.soa.esb.message.format.serialized.MessageImpl) io.readObject();
-			
-			o.close();
-
-			assertEquals(nImpl.getBody().get("foo"), "bar");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSerializedAddBoolean ()
-	{
-		// get XML message
-
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-
-		try
-		{
-			msg.getBody().add("foo", new Boolean(true));
-			
-			assertEquals(msg.getBody().get("foo"), new Boolean(true));
-			
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-			
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			org.jboss.internal.soa.esb.message.format.serialized.MessageImpl nImpl = (org.jboss.internal.soa.esb.message.format.serialized.MessageImpl) io.readObject();
-			
-			assertEquals(nImpl.getBody().get("foo"), new Boolean(true));
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/BodyUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,229 @@
+/*
+ * 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.message.tests;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
+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.w3c.dom.Document;
+
+import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class BodyUnitTest extends TestCase
+{
+	private Logger log = Logger.getLogger( BodyUnitTest.class );
+	
+	public void testXMLAddString ()
+	{
+		// get XML message
+
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertEquals((msg != null), true);
+
+		try
+		{
+			msg.getBody().add("foo", "bar");
+			
+			assertEquals(msg.getBody().get("foo"), "bar");
+			
+			DocumentBuilderFactory factory = DocumentBuilderFactory
+					.newInstance();
+			
+			factory.setNamespaceAware(true);
+			
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			Document doc = builder.newDocument();
+			MessageImpl theImpl = (MessageImpl) msg;
+
+			doc = theImpl.toXML(doc);
+
+			StringWriter sWriter = new StringWriter();
+			OutputFormat format = new OutputFormat();
+			format.setIndenting(true);
+
+			XMLSerializer xmlS = new XMLSerializer(sWriter, format);
+
+			xmlS.asDOMSerializer();
+			xmlS.serialize(doc);
+
+			String documentAsString = sWriter.toString();
+
+			MessageImpl nImpl = new MessageImpl();
+
+			log.debug("Document is "+documentAsString);
+			
+			nImpl.fromXML(doc);
+			
+			assertEquals(nImpl.getBody().get("foo"), "bar");
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testXMLAddBoolean ()
+	{
+		// get XML message
+
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertEquals((msg != null), true);
+
+		try
+		{
+			msg.getBody().add("foo", new Boolean(true));
+			
+			assertEquals(msg.getBody().get("foo"), new Boolean(true));
+			
+			DocumentBuilderFactory factory = DocumentBuilderFactory
+					.newInstance();
+			factory.setNamespaceAware(true);
+			
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			Document doc = builder.newDocument();
+			MessageImpl theImpl = (MessageImpl) msg;
+
+			doc = theImpl.toXML(doc);
+
+			StringWriter sWriter = new StringWriter();
+			OutputFormat format = new OutputFormat();
+			format.setIndenting(true);
+
+			XMLSerializer xmlS = new XMLSerializer(sWriter, format);
+
+			xmlS.asDOMSerializer();
+			xmlS.serialize(doc);
+
+			String documentAsString = sWriter.toString();
+
+			MessageImpl nImpl = new MessageImpl();
+
+			log.debug("Document is "+documentAsString);
+			
+			nImpl.fromXML(doc);
+			
+			assertEquals(nImpl.getBody().get("foo"), new Boolean(true));
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSerializedAddString ()
+	{
+		// get XML message
+
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+
+		try
+		{
+			msg.getBody().add("foo", "bar");
+			
+			assertEquals(msg.getBody().get("foo"), "bar");
+			
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+			
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			org.jboss.internal.soa.esb.message.format.serialized.MessageImpl nImpl = (org.jboss.internal.soa.esb.message.format.serialized.MessageImpl) io.readObject();
+			
+			o.close();
+
+			assertEquals(nImpl.getBody().get("foo"), "bar");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSerializedAddBoolean ()
+	{
+		// get XML message
+
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+
+		try
+		{
+			msg.getBody().add("foo", new Boolean(true));
+			
+			assertEquals(msg.getBody().get("foo"), new Boolean(true));
+			
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+			
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			org.jboss.internal.soa.esb.message.format.serialized.MessageImpl nImpl = (org.jboss.internal.soa.esb.message.format.serialized.MessageImpl) io.readObject();
+			
+			assertEquals(nImpl.getBody().get("foo"), new Boolean(true));
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ExampleObject.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ExampleObject.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ExampleObject.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,49 +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.message.tests;
-
-import java.io.Serializable;
-
-/**
- * Unit tests for the Class class.
- * 
- * @author Mark Little
- */
-
-public class ExampleObject implements Serializable
-{
-	private static final long serialVersionUID = 0x0;
-
-	public ExampleObject (long val)
-	{
-		value = val;
-	}
-	
-	public long getValue ()
-	{
-		return value;
-	}
-	
-	private long value;
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ExampleObject.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ExampleObject.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ExampleObject.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/ExampleObject.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,49 @@
+/*
+ * 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.message.tests;
+
+import java.io.Serializable;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class ExampleObject implements Serializable
+{
+	private static final long serialVersionUID = 0x0;
+
+	public ExampleObject (long val)
+	{
+		value = val;
+	}
+	
+	public long getValue ()
+	{
+		return value;
+	}
+	
+	private long value;
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,145 +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.message.tests;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.io.StringWriter;
-import java.net.URI;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
-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.w3c.dom.Document;
-
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
-/**
- * Unit tests for the Class class.
- * 
- * @author Mark Little
- */
-
-public class FaultUnitTest extends TestCase
-{
-	private Logger log = Logger.getLogger( FaultUnitTest.class );
-	
-	public void testSerializeFault ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-
-		try
-		{
-			URI code = new URI("urn:code");
-		
-			msg.getFault().setCode(code);
-			msg.getFault().setReason("because");
-			
-			assertEquals(msg.getFault().getCode(), code);
-			assertEquals(msg.getFault().getReason(), "because");
-
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-
-			o.writeObject(msg);
-			o.close();
-
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-
-			assertEquals(nImpl.getFault().getReason(), "because");
-			
-			o.close();
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-	public void testXMLFault ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertEquals((msg != null), true);
-
-		try
-		{
-			URI code = new URI("urn:code");
-			
-			msg.getFault().setCode(code);
-			msg.getFault().setReason("because");
-			
-			assertEquals(msg.getFault().getCode(), code);
-			assertEquals(msg.getFault().getReason(), "because");
-		
-			DocumentBuilderFactory factory = DocumentBuilderFactory
-					.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			Document doc = builder.newDocument();
-			org.jboss.internal.soa.esb.message.format.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg;
-
-			doc = theImpl.toXML(doc);
-
-			StringWriter sWriter = new StringWriter();
-			OutputFormat format = new OutputFormat();
-			format.setIndenting(true);
-
-			XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-
-			xmlS.asDOMSerializer();
-			xmlS.serialize(doc);
-
-			String documentAsString = sWriter.toString();
-
-			log.debug("Message looks like: " + documentAsString);
-			
-			org.jboss.internal.soa.esb.message.format.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
-			
-			nImpl.fromXML(doc);
-
-			assertEquals(nImpl.getFault().getReason(), "because");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/FaultUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,145 @@
+/*
+ * 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.message.tests;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.io.StringWriter;
+import java.net.URI;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
+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.w3c.dom.Document;
+
+import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class FaultUnitTest extends TestCase
+{
+	private Logger log = Logger.getLogger( FaultUnitTest.class );
+	
+	public void testSerializeFault ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+
+		try
+		{
+			URI code = new URI("urn:code");
+		
+			msg.getFault().setCode(code);
+			msg.getFault().setReason("because");
+			
+			assertEquals(msg.getFault().getCode(), code);
+			assertEquals(msg.getFault().getReason(), "because");
+
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+
+			o.writeObject(msg);
+			o.close();
+
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+
+			assertEquals(nImpl.getFault().getReason(), "because");
+			
+			o.close();
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+	public void testXMLFault ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertEquals((msg != null), true);
+
+		try
+		{
+			URI code = new URI("urn:code");
+			
+			msg.getFault().setCode(code);
+			msg.getFault().setReason("because");
+			
+			assertEquals(msg.getFault().getCode(), code);
+			assertEquals(msg.getFault().getReason(), "because");
+		
+			DocumentBuilderFactory factory = DocumentBuilderFactory
+					.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			Document doc = builder.newDocument();
+			org.jboss.internal.soa.esb.message.format.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg;
+
+			doc = theImpl.toXML(doc);
+
+			StringWriter sWriter = new StringWriter();
+			OutputFormat format = new OutputFormat();
+			format.setIndenting(true);
+
+			XMLSerializer xmlS = new XMLSerializer(sWriter, format);
+
+			xmlS.asDOMSerializer();
+			xmlS.serialize(doc);
+
+			String documentAsString = sWriter.toString();
+
+			log.debug("Message looks like: " + documentAsString);
+			
+			org.jboss.internal.soa.esb.message.format.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
+			
+			nImpl.fromXML(doc);
+
+			assertEquals(nImpl.getFault().getReason(), "because");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/MessageUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/MessageUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/MessageUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,125 +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.message.tests;
-
-import java.net.URI;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessageType;
-
-/**
- * Unit tests for the Message class.
- * 
- * @author Mark Little
- */
-
-public class MessageUnitTest extends TestCase
-{
-	
-	public void testDefaultMessageFields ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage();
-		
-		assertEquals((msg.getBody() != null), true);
-		assertEquals((msg.getHeader() != null), true);
-		assertEquals((msg.getContext() != null), true);
-		assertEquals((msg.getAttachment() != null), true);
-		assertEquals((msg.getFault() != null), true);
-		assertEquals((msg.getProperties() != null), true);
-	}
-	
-	public void testXMLMessageFields ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-		
-		assertEquals((msg.getBody() != null), true);
-		assertEquals((msg.getHeader() != null), true);
-		assertEquals((msg.getContext() != null), true);
-		assertEquals((msg.getAttachment() != null), true);
-		assertEquals((msg.getFault() != null), true);
-		assertEquals((msg.getProperties() != null), true);
-	}
-	
-	public void testSerializedMessageFields ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-		
-		assertEquals((msg.getBody() != null), true);
-		assertEquals((msg.getHeader() != null), true);
-		assertEquals((msg.getContext() != null), true);
-		assertEquals((msg.getAttachment() != null), true);
-		assertEquals((msg.getFault() != null), true);
-		assertEquals((msg.getProperties() != null), true);
-	}
-	
-	public void testSerializedMessageToString () throws Exception
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-		
-		msg.getHeader().getCall().setAction(new URI("urn:foo"));
-		msg.getHeader().getCall().setFrom(new HTTPEpr("http://foo.bar"));
-		
-		msg.getBody().add("foobar");
-		msg.getBody().add("qwerty", "uiop");
-		msg.getBody().setByteArray("hello world".getBytes());
-		
-		msg.getFault().setCode(new URI("urn:because"));
-		msg.getFault().setReason("something bad happened");
-		
-		msg.getAttachment().addItem("should be unnamed");
-		msg.getAttachment().put("name", "property");
-		
-		msg.getProperties().setProperty("name", "value");
-		msg.getProperties().setProperty("another name", "another value");
-		
-		System.out.println("Message is: "+msg.toString());
-	}
-	
-	public void testXMLMessageToString () throws Exception
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-		
-		msg.getHeader().getCall().setAction(new URI("urn:foo"));
-		msg.getHeader().getCall().setFrom(new HTTPEpr("http://foo.bar"));
-		
-		msg.getBody().add("foobar");
-		msg.getBody().add("qwerty", "uiop");
-		msg.getBody().setByteArray("hello world".getBytes());
-		
-		msg.getFault().setCode(new URI("urn:because"));
-		msg.getFault().setReason("something bad happened");
-		
-		msg.getAttachment().addItem("should be unnamed");
-		msg.getAttachment().put("name", "property");
-		
-		msg.getProperties().setProperty("name", "value");
-		msg.getProperties().setProperty("another name", "another value");
-		
-		System.out.println("Message is: "+msg.toString());
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/MessageUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/MessageUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/MessageUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/MessageUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,125 @@
+/*
+ * 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.message.tests;
+
+import java.net.URI;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+
+/**
+ * Unit tests for the Message class.
+ * 
+ * @author Mark Little
+ */
+
+public class MessageUnitTest extends TestCase
+{
+	
+	public void testDefaultMessageFields ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage();
+		
+		assertEquals((msg.getBody() != null), true);
+		assertEquals((msg.getHeader() != null), true);
+		assertEquals((msg.getContext() != null), true);
+		assertEquals((msg.getAttachment() != null), true);
+		assertEquals((msg.getFault() != null), true);
+		assertEquals((msg.getProperties() != null), true);
+	}
+	
+	public void testXMLMessageFields ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+		
+		assertEquals((msg.getBody() != null), true);
+		assertEquals((msg.getHeader() != null), true);
+		assertEquals((msg.getContext() != null), true);
+		assertEquals((msg.getAttachment() != null), true);
+		assertEquals((msg.getFault() != null), true);
+		assertEquals((msg.getProperties() != null), true);
+	}
+	
+	public void testSerializedMessageFields ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+		
+		assertEquals((msg.getBody() != null), true);
+		assertEquals((msg.getHeader() != null), true);
+		assertEquals((msg.getContext() != null), true);
+		assertEquals((msg.getAttachment() != null), true);
+		assertEquals((msg.getFault() != null), true);
+		assertEquals((msg.getProperties() != null), true);
+	}
+	
+	public void testSerializedMessageToString () throws Exception
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+		
+		msg.getHeader().getCall().setAction(new URI("urn:foo"));
+		msg.getHeader().getCall().setFrom(new HTTPEpr("http://foo.bar"));
+		
+		msg.getBody().add("foobar");
+		msg.getBody().add("qwerty", "uiop");
+		msg.getBody().setByteArray("hello world".getBytes());
+		
+		msg.getFault().setCode(new URI("urn:because"));
+		msg.getFault().setReason("something bad happened");
+		
+		msg.getAttachment().addItem("should be unnamed");
+		msg.getAttachment().put("name", "property");
+		
+		msg.getProperties().setProperty("name", "value");
+		msg.getProperties().setProperty("another name", "another value");
+		
+		System.out.println("Message is: "+msg.toString());
+	}
+	
+	public void testXMLMessageToString () throws Exception
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+		
+		msg.getHeader().getCall().setAction(new URI("urn:foo"));
+		msg.getHeader().getCall().setFrom(new HTTPEpr("http://foo.bar"));
+		
+		msg.getBody().add("foobar");
+		msg.getBody().add("qwerty", "uiop");
+		msg.getBody().setByteArray("hello world".getBytes());
+		
+		msg.getFault().setCode(new URI("urn:because"));
+		msg.getFault().setReason("something bad happened");
+		
+		msg.getAttachment().addItem("should be unnamed");
+		msg.getAttachment().put("name", "property");
+		
+		msg.getProperties().setProperty("name", "value");
+		msg.getProperties().setProperty("another name", "another value");
+		
+		System.out.println("Message is: "+msg.toString());
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,161 +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.message.tests;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
-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.w3c.dom.Document;
-
-/**
- * Unit tests for the Class class.
- * 
- * @author Mark Little
- */
-
-public class PropertiesUnitTest extends TestCase
-{
-
-	public void testSerializeProperties()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-
-		msg.getProperties().setProperty("foo", "bar");
-
-		assertEquals(msg.getProperties().getProperty("foo"), "bar");
-		assertEquals((msg.getProperties().getProperty("foobar") == null), true);
-
-		assertEquals(msg.getProperties().getProperty("foobar", "barfoo"),
-				"barfoo");
-
-		try
-		{
-			msg.getProperties().setProperty("1234", new Object());
-			
-			fail();
-		}
-		catch (IllegalArgumentException ex)
-		{
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-		
-		msg.getProperties().getNames();
-		
-		try
-		{
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-
-			o.writeObject(msg);
-			o.close();
-
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-
-			assertEquals(nImpl.getProperties().getProperty("foo"), "bar");
-
-			o.close();
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-
-		assertEquals(msg.getProperties().remove("foo"), "bar");
-	}
-
-	public void testXMLProperties()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertEquals((msg != null), true);
-
-		msg.getProperties().setProperty("foo", "bar");
-
-		assertEquals(msg.getProperties().getProperty("foo"), "bar");
-		assertEquals((msg.getProperties().getProperty("foobar") == null), true);
-
-		assertEquals(msg.getProperties().getProperty("foobar", "barfoo"),
-				"barfoo");
-
-		try
-		{
-			msg.getProperties().setProperty("1234", new Object());
-			
-			fail();
-		}
-		catch (IllegalArgumentException ex)
-		{
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-		
-		msg.getProperties().getNames();
-		
-		try
-		{
-			DocumentBuilderFactory factory = DocumentBuilderFactory
-					.newInstance();
-			DocumentBuilder builder = factory.newDocumentBuilder();
-			Document doc = builder.newDocument();
-			org.jboss.internal.soa.esb.message.format.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg;
-
-			doc = theImpl.toXML(doc);
-
-			org.jboss.internal.soa.esb.message.format.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
-			
-			nImpl.fromXML(doc);
-
-			assertEquals(nImpl.getProperties().getProperty("foo"), "bar");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-
-		assertEquals(msg.getProperties().remove("foo"), "bar");
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,161 @@
+/*
+ * 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.message.tests;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
+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.w3c.dom.Document;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class PropertiesUnitTest extends TestCase
+{
+
+	public void testSerializeProperties()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+
+		msg.getProperties().setProperty("foo", "bar");
+
+		assertEquals(msg.getProperties().getProperty("foo"), "bar");
+		assertEquals((msg.getProperties().getProperty("foobar") == null), true);
+
+		assertEquals(msg.getProperties().getProperty("foobar", "barfoo"),
+				"barfoo");
+
+		try
+		{
+			msg.getProperties().setProperty("1234", new Object());
+			
+			fail();
+		}
+		catch (IllegalArgumentException ex)
+		{
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+		
+		msg.getProperties().getNames();
+		
+		try
+		{
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+
+			o.writeObject(msg);
+			o.close();
+
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+
+			assertEquals(nImpl.getProperties().getProperty("foo"), "bar");
+
+			o.close();
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+
+		assertEquals(msg.getProperties().remove("foo"), "bar");
+	}
+
+	public void testXMLProperties()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertEquals((msg != null), true);
+
+		msg.getProperties().setProperty("foo", "bar");
+
+		assertEquals(msg.getProperties().getProperty("foo"), "bar");
+		assertEquals((msg.getProperties().getProperty("foobar") == null), true);
+
+		assertEquals(msg.getProperties().getProperty("foobar", "barfoo"),
+				"barfoo");
+
+		try
+		{
+			msg.getProperties().setProperty("1234", new Object());
+			
+			fail();
+		}
+		catch (IllegalArgumentException ex)
+		{
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+		
+		msg.getProperties().getNames();
+		
+		try
+		{
+			DocumentBuilderFactory factory = DocumentBuilderFactory
+					.newInstance();
+			DocumentBuilder builder = factory.newDocumentBuilder();
+			Document doc = builder.newDocument();
+			org.jboss.internal.soa.esb.message.format.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg;
+
+			doc = theImpl.toXML(doc);
+
+			org.jboss.internal.soa.esb.message.format.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
+			
+			nImpl.fromXML(doc);
+
+			assertEquals(nImpl.getProperties().getProperty("foo"), "bar");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+
+		assertEquals(msg.getProperties().remove("foo"), "bar");
+	}
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,670 +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.message.tests;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.ObjectInputStream;
-import java.io.ObjectOutputStream;
-import java.net.URL;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.EmailEpr;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessageType;
-
-/**
- * Unit tests for the Class class.
- * 
- * @author Mark Little
- */
-
-public class SerializedMessageUnitTest extends TestCase
-{
-	private Logger log = Logger.getLogger( SerializedMessageUnitTest.class );
-
-	public void testSerialize()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-
-		try
-		{
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-		
-	}
-
-	public void testDeserialize()
-	{
-		// get XML message
-
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-
-		try
-		{
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-			
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			@SuppressWarnings("unused")
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testHeader ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-
-		Call call = new Call();
-
-		msg.getHeader().setCall(call);
-		
-		call = msg.getHeader().getCall();
-		
-		assertEquals((call != null), true);
-		
-		try
-		{
-			msg.getHeader().setCall(null);
-			
-			fail();
-		}
-		catch (IllegalArgumentException ex)
-		{
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testInvalidAdd ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-		
-		try
-		{
-			msg.getBody().add(null, null);
-			
-			fail();
-		}
-		catch (IllegalArgumentException ex)
-		{
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-	public void testAddBytes ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-		
-		String testString = "test";
-		
-		msg.getBody().setByteArray(testString.getBytes());
-		
-		try
-		{
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-			
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-			
-			String val = new String(nImpl.getBody().getByteArray());
-			
-			assertEquals(val, testString);
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testReplace ()
-	{
-		Message msg1 = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg1 != null), true);
-		
-		String foo = "foo";
-		
-		Message msg2 = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg2 != null), true);
-		
-		String bar = "bar";
-		
-		msg1.getBody().setByteArray(foo.getBytes());
-		msg2.getBody().setByteArray(bar.getBytes());
-		
-		msg1.getBody().replace(msg2.getBody());
-		
-		String foobar = new String(msg1.getBody().getByteArray());
-		
-		assertEquals(foobar.equals("bar"), true);
-	}
-	
-	public void testMerge ()
-	{
-		Message msg1 = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg1 != null), true);
-		
-		String foo = "foo";
-		
-		Message msg2 = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg2 != null), true);
-		
-		String bar = "bar";
-		
-		msg1.getBody().setByteArray(foo.getBytes());
-		msg2.getBody().setByteArray(bar.getBytes());
-		
-		msg1.getBody().merge(msg2.getBody());
-		
-		String foobar = new String(msg1.getBody().getByteArray());
-		
-		assertEquals(foobar, "foobar");
-	}
-	
-	public void testAddObjects ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-		
-		ExampleObject value = new ExampleObject(1234);
-		
-		msg.getBody().add("foo", value);
-		
-		try
-		{
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-			
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-			
-			ExampleObject foo = (ExampleObject) nImpl.getBody().get("foo");
-			
-			assertEquals((foo.getValue() == value.getValue()), true);
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testGetNames ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-		
-		ExampleObject value = new ExampleObject(1234);
-		
-		msg.getBody().add("foo", value);
-		msg.getBody().add("bar", value);
-		
-		String[] names = msg.getBody().getNames();
-		
-		assertNotNull(names);
-		
-		assertEquals(names.length, 2);
-		
-		/*
-		 * The array comes back ordered alphabetically.
-		 */
-		
-		assertEquals(names[0], "bar");
-		assertEquals(names[1], "foo");
-		
-		try
-		{
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-			
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-			
-			ExampleObject foo = (ExampleObject) nImpl.getBody().get("foo");
-			
-			assertEquals((foo.getValue() == value.getValue()), true);
-			
-			names = nImpl.getBody().getNames();
-			
-			assertNotNull(names);
-			
-			assertEquals(names.length, 2);
-			assertEquals(names[0], "foo");
-			assertEquals(names[1], "bar");
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testAddInvalidObject ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-
-		try
-		{
-			msg.getBody().add("foo", new Object());
-			
-			fail();
-		}
-		catch (IllegalArgumentException ex)
-		{
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testRemoveObjects ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JAVA_SERIALIZED);
-
-		assertEquals((msg != null), true);
-		
-		ExampleObject value = new ExampleObject(1234);
-		
-		msg.getBody().add("bar", value);
-		
-		msg.getBody().remove("bar");
-		
-		try
-		{
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-			
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-			
-			ExampleObject foo = (ExampleObject) nImpl.getBody().get("bar");
-			
-			assertEquals((foo == null), true);
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}	
-	}
-	
-	public void testJmsEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-		JMSEpr epr = new JMSEpr(JMSEpr.TOPIC_TYPE, "foo", "bar");
-		
-		msg.getHeader().getCall().setTo(epr);
-		
-		try
-		{
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-		
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-
-			assertEquals(theEpr instanceof JMSEpr, true);
-			
-			assertEquals(((JMSEpr) theEpr).getConnectionFactory(), "bar");
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testHttpEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-
-		try
-		{
-			HTTPEpr epr = new HTTPEpr("http://www.foo.bar");
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-		
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-
-			assertEquals(theEpr instanceof HTTPEpr, true);
-			
-			assertEquals(((HTTPEpr) theEpr).getURL().toString(), "http://www.foo.bar");
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testEmailEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-
-		try
-		{
-			EmailEpr epr = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foo.bar", "25", "me", "password");
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-		
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-
-			assertEquals(theEpr instanceof EmailEpr, true);
-			
-			assertEquals(((EmailEpr) theEpr).getPassword(), "password");
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			ex.printStackTrace();
-			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testFtpEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-
-		try
-		{
-			FTPEpr epr = new FTPEpr("http://www.foo.bar");
-			
-			epr.setPassive(true);
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-		
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-
-			assertEquals(theEpr instanceof FTPEpr, true);
-			
-			assertEquals(((FTPEpr) theEpr).getPassive(), true);
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testJdbcEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-
-		try
-		{
-			JDBCEpr epr = new JDBCEpr("http://www.foo.bar", "SOME FAKE SQL");
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-		
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-
-			assertEquals(theEpr instanceof JDBCEpr, true);
-			
-			assertEquals(((JDBCEpr) theEpr).getSQL(), "SOME FAKE SQL");
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testFileEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-
-		try
-		{
-			FileEpr epr = new FileEpr("file://tmp/bar.txt");
-			
-			epr.setErrorDelete(true);
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-		
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-
-			assertEquals(theEpr instanceof FileEpr, true);
-			
-			assertEquals(((FileEpr) theEpr).getErrorDelete(), true);
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSFtpEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-
-		try
-		{
-			SFTPEpr epr = new SFTPEpr(new URL("http://www.foo.bar"), new URL("http://www.bar.foo"));
-
-			assertEquals(epr.getCertificateURL().toString(), "http://www.bar.foo");
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			ByteArrayOutputStream s = new ByteArrayOutputStream();
-			ObjectOutputStream o = new ObjectOutputStream(s);
-	
-			o.writeObject(msg);
-			o.close();
-		
-			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
-			ObjectInputStream io = new ObjectInputStream(is);
-
-			MessageImpl nImpl = (MessageImpl) io.readObject();
-			
-			o.close();
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-
-			assertEquals(theEpr instanceof SFTPEpr, true);
-			
-			assertEquals(((SFTPEpr) theEpr).getCertificateURL().toString(), "http://www.bar.foo");
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			fail(ex.toString());
-		}
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,670 @@
+/*
+ * 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.message.tests;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.ObjectInputStream;
+import java.io.ObjectOutputStream;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.EmailEpr;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class SerializedMessageUnitTest extends TestCase
+{
+	private Logger log = Logger.getLogger( SerializedMessageUnitTest.class );
+
+	public void testSerialize()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+
+		try
+		{
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+		
+	}
+
+	public void testDeserialize()
+	{
+		// get XML message
+
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+
+		try
+		{
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+			
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			@SuppressWarnings("unused")
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testHeader ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+
+		Call call = new Call();
+
+		msg.getHeader().setCall(call);
+		
+		call = msg.getHeader().getCall();
+		
+		assertEquals((call != null), true);
+		
+		try
+		{
+			msg.getHeader().setCall(null);
+			
+			fail();
+		}
+		catch (IllegalArgumentException ex)
+		{
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testInvalidAdd ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+		
+		try
+		{
+			msg.getBody().add(null, null);
+			
+			fail();
+		}
+		catch (IllegalArgumentException ex)
+		{
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+	public void testAddBytes ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+		
+		String testString = "test";
+		
+		msg.getBody().setByteArray(testString.getBytes());
+		
+		try
+		{
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+			
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+			
+			String val = new String(nImpl.getBody().getByteArray());
+			
+			assertEquals(val, testString);
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testReplace ()
+	{
+		Message msg1 = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg1 != null), true);
+		
+		String foo = "foo";
+		
+		Message msg2 = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg2 != null), true);
+		
+		String bar = "bar";
+		
+		msg1.getBody().setByteArray(foo.getBytes());
+		msg2.getBody().setByteArray(bar.getBytes());
+		
+		msg1.getBody().replace(msg2.getBody());
+		
+		String foobar = new String(msg1.getBody().getByteArray());
+		
+		assertEquals(foobar.equals("bar"), true);
+	}
+	
+	public void testMerge ()
+	{
+		Message msg1 = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg1 != null), true);
+		
+		String foo = "foo";
+		
+		Message msg2 = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg2 != null), true);
+		
+		String bar = "bar";
+		
+		msg1.getBody().setByteArray(foo.getBytes());
+		msg2.getBody().setByteArray(bar.getBytes());
+		
+		msg1.getBody().merge(msg2.getBody());
+		
+		String foobar = new String(msg1.getBody().getByteArray());
+		
+		assertEquals(foobar, "foobar");
+	}
+	
+	public void testAddObjects ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+		
+		ExampleObject value = new ExampleObject(1234);
+		
+		msg.getBody().add("foo", value);
+		
+		try
+		{
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+			
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+			
+			ExampleObject foo = (ExampleObject) nImpl.getBody().get("foo");
+			
+			assertEquals((foo.getValue() == value.getValue()), true);
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testGetNames ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+		
+		ExampleObject value = new ExampleObject(1234);
+		
+		msg.getBody().add("foo", value);
+		msg.getBody().add("bar", value);
+		
+		String[] names = msg.getBody().getNames();
+		
+		assertNotNull(names);
+		
+		assertEquals(names.length, 2);
+		
+		/*
+		 * The array comes back ordered alphabetically.
+		 */
+		
+		assertEquals(names[0], "bar");
+		assertEquals(names[1], "foo");
+		
+		try
+		{
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+			
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+			
+			ExampleObject foo = (ExampleObject) nImpl.getBody().get("foo");
+			
+			assertEquals((foo.getValue() == value.getValue()), true);
+			
+			names = nImpl.getBody().getNames();
+			
+			assertNotNull(names);
+			
+			assertEquals(names.length, 2);
+			assertEquals(names[0], "foo");
+			assertEquals(names[1], "bar");
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testAddInvalidObject ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+
+		try
+		{
+			msg.getBody().add("foo", new Object());
+			
+			fail();
+		}
+		catch (IllegalArgumentException ex)
+		{
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testRemoveObjects ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JAVA_SERIALIZED);
+
+		assertEquals((msg != null), true);
+		
+		ExampleObject value = new ExampleObject(1234);
+		
+		msg.getBody().add("bar", value);
+		
+		msg.getBody().remove("bar");
+		
+		try
+		{
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+			
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+			
+			ExampleObject foo = (ExampleObject) nImpl.getBody().get("bar");
+			
+			assertEquals((foo == null), true);
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}	
+	}
+	
+	public void testJmsEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+		JMSEpr epr = new JMSEpr(JMSEpr.TOPIC_TYPE, "foo", "bar");
+		
+		msg.getHeader().getCall().setTo(epr);
+		
+		try
+		{
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+		
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+
+			assertEquals(theEpr instanceof JMSEpr, true);
+			
+			assertEquals(((JMSEpr) theEpr).getConnectionFactory(), "bar");
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testHttpEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+
+		try
+		{
+			HTTPEpr epr = new HTTPEpr("http://www.foo.bar");
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+		
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+
+			assertEquals(theEpr instanceof HTTPEpr, true);
+			
+			assertEquals(((HTTPEpr) theEpr).getURL().toString(), "http://www.foo.bar");
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testEmailEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+
+		try
+		{
+			EmailEpr epr = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foo.bar", "25", "me", "password");
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+		
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+
+			assertEquals(theEpr instanceof EmailEpr, true);
+			
+			assertEquals(((EmailEpr) theEpr).getPassword(), "password");
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			ex.printStackTrace();
+			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testFtpEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+
+		try
+		{
+			FTPEpr epr = new FTPEpr("http://www.foo.bar");
+			
+			epr.setPassive(true);
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+		
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+
+			assertEquals(theEpr instanceof FTPEpr, true);
+			
+			assertEquals(((FTPEpr) theEpr).getPassive(), true);
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testJdbcEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+
+		try
+		{
+			JDBCEpr epr = new JDBCEpr("http://www.foo.bar", "SOME FAKE SQL");
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+		
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+
+			assertEquals(theEpr instanceof JDBCEpr, true);
+			
+			assertEquals(((JDBCEpr) theEpr).getSQL(), "SOME FAKE SQL");
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testFileEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+
+		try
+		{
+			FileEpr epr = new FileEpr("file://tmp/bar.txt");
+			
+			epr.setErrorDelete(true);
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+		
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+
+			assertEquals(theEpr instanceof FileEpr, true);
+			
+			assertEquals(((FileEpr) theEpr).getErrorDelete(), true);
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSFtpEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+
+		try
+		{
+			SFTPEpr epr = new SFTPEpr(new URL("http://www.foo.bar"), new URL("http://www.bar.foo"));
+
+			assertEquals(epr.getCertificateURL().toString(), "http://www.bar.foo");
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			ByteArrayOutputStream s = new ByteArrayOutputStream();
+			ObjectOutputStream o = new ObjectOutputStream(s);
+	
+			o.writeObject(msg);
+			o.close();
+		
+			ByteArrayInputStream is = new ByteArrayInputStream(s.toByteArray());
+			ObjectInputStream io = new ObjectInputStream(is);
+
+			MessageImpl nImpl = (MessageImpl) io.readObject();
+			
+			o.close();
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+
+			assertEquals(theEpr instanceof SFTPEpr, true);
+			
+			assertEquals(((SFTPEpr) theEpr).getCertificateURL().toString(), "http://www.bar.foo");
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			fail(ex.toString());
+		}
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,592 +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.message.tests;
-
-import java.io.StringReader;
-import java.io.StringWriter;
-import java.net.URL;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
-import org.jboss.soa.esb.addressing.Call;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.addressing.eprs.EmailEpr;
-import org.jboss.soa.esb.addressing.eprs.FTPEpr;
-import org.jboss.soa.esb.addressing.eprs.FileEpr;
-import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
-import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
-import org.jboss.soa.esb.addressing.eprs.JMSEpr;
-import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
-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.w3c.dom.Document;
-import org.xml.sax.InputSource;
-
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
-/**
- * Unit tests for the Class class.
- * 
- * @author Mark Little
- */
-
-public class XMLMessageUnitTest extends TestCase
-{
-	private Logger log = Logger.getLogger( XMLMessageUnitTest.class );
-	
-	public void testToXML()
-	{
-		// get XML message
-
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("created message", msg);
-
-		try
-		{
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-
-			log.debug("Message looks like: " + xmlRepresentation);
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-	public void testFromXML()
-	{
-		// get XML message
-
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("created message", msg);
-
-		try
-		{
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			@SuppressWarnings("unused")
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-	public void testHeader ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("created message", msg);
-
-		Call call = new Call();
-
-		msg.getHeader().setCall(call);
-		
-		call = msg.getHeader().getCall();
-		
-		assertNotNull("message call", call);
-		
-		try
-		{
-			msg.getHeader().setCall(null);
-			
-			fail();
-		}
-		catch (IllegalArgumentException ex)
-		{
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-
-	public void testInvalidAdd ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("created message", msg);
-		
-		try
-		{
-			msg.getBody().add(null, null);
-			
-			fail();
-		}
-		catch (IllegalArgumentException ex)
-		{
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testAddBytes ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("created message", msg);
-		
-		String testString = "test";
-		
-		msg.getBody().setByteArray(testString.getBytes());
-		
-		try
-		{
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			log.debug("Document is "+xmlRepresentation);
-			
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-			
-			String val = new String(nImpl.getBody().getByteArray());
-			
-			assertEquals(val, testString);
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testReplace ()
-	{
-		Message msg1 = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("created message", msg1);
-		
-		String foo = "foo";
-		
-		Message msg2 = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("second created message", msg2);
-		
-		String bar = "bar";
-		
-		msg1.getBody().setByteArray(foo.getBytes());
-		msg2.getBody().setByteArray(bar.getBytes());
-		
-		msg1.getBody().replace(msg2.getBody());
-		
-		String foobar = new String(msg1.getBody().getByteArray());
-		
-		assertEquals(foobar, "bar");
-	}
-	
-	public void testMerge ()
-	{
-		Message msg1 = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("created message", msg1);
-		
-		String foo = "foo";
-		
-		Message msg2 = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("second created message", msg2);
-		
-		String bar = "bar";
-		
-		msg1.getBody().setByteArray(foo.getBytes());
-		msg2.getBody().setByteArray(bar.getBytes());
-		
-		msg1.getBody().merge(msg2.getBody());
-		
-		String foobar = new String(msg1.getBody().getByteArray());
-		
-		assertEquals(foobar, "foobar");
-	}
-	
-	public void testAddObjects ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("created message", msg);
-		
-		ExampleObject value = new ExampleObject(1234);
-		
-		msg.getBody().add("foo", value);
-		
-		try
-		{
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			log.debug("Document is "+xmlRepresentation);
-			
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-			
-			ExampleObject foo = (ExampleObject) nImpl.getBody().get("foo");
-			
-			assertNotNull("deserialised example object", foo) ;
-			
-			assertEquals((foo.getValue() == value.getValue()), true);
-		}
-		catch (Exception ex)
-		{
-			log.error(ex);
-			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testGetNames ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("created message", msg);
-		
-		ExampleObject value = new ExampleObject(1234);
-		
-		msg.getBody().add("foo", value);
-		msg.getBody().add("bar", value);
-		
-		String[] names = msg.getBody().getNames();
-		
-		assertNotNull(names);
-		
-		assertEquals(names.length, 2);
-		
-		/*
-		 * The array comes back ordered alphabetically.
-		 */
-		
-		assertEquals(names[0], "bar");
-		assertEquals(names[1], "foo");
-		
-		try
-		{
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			log.debug("Document is "+xmlRepresentation);
-			
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-			
-			ExampleObject foo = (ExampleObject) nImpl.getBody().get("foo");
-			
-			assertNotNull("deserialised example object", foo) ;
-			
-			assertEquals((foo.getValue() == value.getValue()), true);
-			
-			names = nImpl.getBody().getNames();
-			
-			assertNotNull(names);
-			
-			assertEquals(names.length, 2);	
-			
-			/*
-			 * The array comes back ordered alphabetically.
-			 */
-			
-			assertEquals(names[0], "bar");
-			assertEquals(names[1], "foo");
-		}
-		catch (Exception ex)
-		{
-			fail(ex.toString());
-		}
-	}
-	
-	public void testRemoveObjects ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(
-				MessageType.JBOSS_XML);
-
-		assertNotNull("created message", msg);
-		
-		ExampleObject value = new ExampleObject(1234);
-		
-		msg.getBody().add("bar", value);
-		
-		msg.getBody().remove("bar");
-		
-		try
-		{
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			log.debug("Document is "+xmlRepresentation);
-			
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-			
-			ExampleObject foo = (ExampleObject) nImpl.getBody().get("bar");
-			
-			assertNull("deserialised example object", foo);
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}	
-	}
-	
-	public void testJmsEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-		JMSEpr epr = new JMSEpr(JMSEpr.TOPIC_TYPE, "foo", "bar");
-		
-		msg.getHeader().getCall().setTo(epr);
-		
-		try
-		{
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			log.debug("Document is "+xmlRepresentation);
-			
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-			
-			assertEquals(theEpr instanceof JMSEpr, true);
-			
-			assertEquals(((JMSEpr) theEpr).getConnectionFactory(), "bar");
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testHttpEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-
-		try
-		{
-			HTTPEpr epr = new HTTPEpr("http://www.foo.bar");
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			log.debug("Document is "+xmlRepresentation);
-			
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-			
-			assertEquals(theEpr instanceof HTTPEpr, true);
-			
-			assertEquals(((HTTPEpr) theEpr).getURL().toString(), "http://www.foo.bar");
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testEmailEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-
-		try
-		{
-			EmailEpr epr = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foo.bar", "25", "me", "password");
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			log.debug("Document is "+xmlRepresentation);
-			
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-			
-			assertEquals(theEpr instanceof EmailEpr, true);
-			
-			assertEquals(((EmailEpr) theEpr).getPassword(), "password");
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testFtpEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-
-		try
-		{
-			FTPEpr epr = new FTPEpr("http://www.foo.bar");
-			
-			epr.setPassive(true);
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			log.debug("Document is "+xmlRepresentation);
-			
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-			
-			assertEquals(theEpr instanceof FTPEpr, true);
-			
-			assertEquals(((FTPEpr) theEpr).getPassive(), true);
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testJdbcEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-
-		try
-		{
-			JDBCEpr epr = new JDBCEpr("http://www.foo.bar", "SOME FAKE SQL");
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			log.debug("Document is "+xmlRepresentation);
-			
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-			
-			assertEquals(theEpr instanceof JDBCEpr, true);
-			
-			assertEquals(((JDBCEpr) theEpr).getSQL(), "SOME FAKE SQL");
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testFileEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-
-		try
-		{
-			FileEpr epr = new FileEpr("file://tmp/bar.txt");
-			
-			epr.setErrorDelete(true);
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			log.debug("Document is "+xmlRepresentation);
-			
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-			
-			assertEquals(theEpr instanceof FileEpr, true);
-			
-			assertEquals(((FileEpr) theEpr).getErrorDelete(), true);
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}
-	}
-	
-	public void testSFtpEPRType ()
-	{
-		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-
-		try
-		{
-			SFTPEpr epr = new SFTPEpr(new URL("http://www.foo.bar"), new URL("http://www.bar.foo"));
-
-			assertEquals(epr.getCertificateURL().toString(), "http://www.bar.foo");
-			
-			msg.getHeader().getCall().setTo(epr);
-			
-			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
-			log.debug("Document is "+xmlRepresentation);
-			
-			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
-			
-			EPR theEpr = nImpl.getHeader().getCall().getTo();
-			
-			assertEquals(theEpr instanceof SFTPEpr, true);
-			
-			assertEquals(((SFTPEpr) theEpr).getCertificateURL().toString(), "http://www.bar.foo");
-		}
-		catch (Exception ex)
-		{			
-			fail(ex.toString());
-		}
-	}
-	
-	private String msgToXML(final MessageImpl msg)
-		throws Exception
-	{
-		final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance() ;
-		
-		factory.setNamespaceAware(true);
-		
-		final DocumentBuilder builder = factory.newDocumentBuilder() ;
-		Document doc = builder.newDocument() ;
-		
-		doc = msg.toXML(doc) ;
-		
-		final StringWriter sWriter = new StringWriter() ;
-		final OutputFormat format = new OutputFormat() ;
-		format.setIndenting(true) ;
-
-		final XMLSerializer xmlS = new XMLSerializer(sWriter, format) ;
-
-		xmlS.asDOMSerializer() ;
-		xmlS.serialize(doc) ;
-
-		return sWriter.toString() ;
-	}
-	
-	private MessageImpl msgFromXML(final String xmlRepresentation)
-		throws Exception
-	{
-		final StringReader stringReader = new StringReader(xmlRepresentation) ;
-		final InputSource inputSource = new InputSource(stringReader) ;
-		
-		final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance() ;
-		
-		factory.setNamespaceAware(true);
-		
-		final DocumentBuilder builder = factory.newDocumentBuilder() ;
-		final Document doc = builder.parse(inputSource) ;
-
-		final MessageImpl message = new MessageImpl() ;
-		message.fromXML(doc) ;
-		return message ;
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,592 @@
+/*
+ * 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.message.tests;
+
+import java.io.StringReader;
+import java.io.StringWriter;
+import java.net.URL;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
+import org.jboss.soa.esb.addressing.Call;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.addressing.eprs.EmailEpr;
+import org.jboss.soa.esb.addressing.eprs.FTPEpr;
+import org.jboss.soa.esb.addressing.eprs.FileEpr;
+import org.jboss.soa.esb.addressing.eprs.HTTPEpr;
+import org.jboss.soa.esb.addressing.eprs.JDBCEpr;
+import org.jboss.soa.esb.addressing.eprs.JMSEpr;
+import org.jboss.soa.esb.addressing.eprs.SFTPEpr;
+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.w3c.dom.Document;
+import org.xml.sax.InputSource;
+
+import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+/**
+ * Unit tests for the Class class.
+ * 
+ * @author Mark Little
+ */
+
+public class XMLMessageUnitTest extends TestCase
+{
+	private Logger log = Logger.getLogger( XMLMessageUnitTest.class );
+	
+	public void testToXML()
+	{
+		// get XML message
+
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("created message", msg);
+
+		try
+		{
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+
+			log.debug("Message looks like: " + xmlRepresentation);
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+	public void testFromXML()
+	{
+		// get XML message
+
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("created message", msg);
+
+		try
+		{
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			@SuppressWarnings("unused")
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+	public void testHeader ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("created message", msg);
+
+		Call call = new Call();
+
+		msg.getHeader().setCall(call);
+		
+		call = msg.getHeader().getCall();
+		
+		assertNotNull("message call", call);
+		
+		try
+		{
+			msg.getHeader().setCall(null);
+			
+			fail();
+		}
+		catch (IllegalArgumentException ex)
+		{
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+
+	public void testInvalidAdd ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("created message", msg);
+		
+		try
+		{
+			msg.getBody().add(null, null);
+			
+			fail();
+		}
+		catch (IllegalArgumentException ex)
+		{
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testAddBytes ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("created message", msg);
+		
+		String testString = "test";
+		
+		msg.getBody().setByteArray(testString.getBytes());
+		
+		try
+		{
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			log.debug("Document is "+xmlRepresentation);
+			
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+			
+			String val = new String(nImpl.getBody().getByteArray());
+			
+			assertEquals(val, testString);
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testReplace ()
+	{
+		Message msg1 = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("created message", msg1);
+		
+		String foo = "foo";
+		
+		Message msg2 = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("second created message", msg2);
+		
+		String bar = "bar";
+		
+		msg1.getBody().setByteArray(foo.getBytes());
+		msg2.getBody().setByteArray(bar.getBytes());
+		
+		msg1.getBody().replace(msg2.getBody());
+		
+		String foobar = new String(msg1.getBody().getByteArray());
+		
+		assertEquals(foobar, "bar");
+	}
+	
+	public void testMerge ()
+	{
+		Message msg1 = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("created message", msg1);
+		
+		String foo = "foo";
+		
+		Message msg2 = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("second created message", msg2);
+		
+		String bar = "bar";
+		
+		msg1.getBody().setByteArray(foo.getBytes());
+		msg2.getBody().setByteArray(bar.getBytes());
+		
+		msg1.getBody().merge(msg2.getBody());
+		
+		String foobar = new String(msg1.getBody().getByteArray());
+		
+		assertEquals(foobar, "foobar");
+	}
+	
+	public void testAddObjects ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("created message", msg);
+		
+		ExampleObject value = new ExampleObject(1234);
+		
+		msg.getBody().add("foo", value);
+		
+		try
+		{
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			log.debug("Document is "+xmlRepresentation);
+			
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+			
+			ExampleObject foo = (ExampleObject) nImpl.getBody().get("foo");
+			
+			assertNotNull("deserialised example object", foo) ;
+			
+			assertEquals((foo.getValue() == value.getValue()), true);
+		}
+		catch (Exception ex)
+		{
+			log.error(ex);
+			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testGetNames ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("created message", msg);
+		
+		ExampleObject value = new ExampleObject(1234);
+		
+		msg.getBody().add("foo", value);
+		msg.getBody().add("bar", value);
+		
+		String[] names = msg.getBody().getNames();
+		
+		assertNotNull(names);
+		
+		assertEquals(names.length, 2);
+		
+		/*
+		 * The array comes back ordered alphabetically.
+		 */
+		
+		assertEquals(names[0], "bar");
+		assertEquals(names[1], "foo");
+		
+		try
+		{
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			log.debug("Document is "+xmlRepresentation);
+			
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+			
+			ExampleObject foo = (ExampleObject) nImpl.getBody().get("foo");
+			
+			assertNotNull("deserialised example object", foo) ;
+			
+			assertEquals((foo.getValue() == value.getValue()), true);
+			
+			names = nImpl.getBody().getNames();
+			
+			assertNotNull(names);
+			
+			assertEquals(names.length, 2);	
+			
+			/*
+			 * The array comes back ordered alphabetically.
+			 */
+			
+			assertEquals(names[0], "bar");
+			assertEquals(names[1], "foo");
+		}
+		catch (Exception ex)
+		{
+			fail(ex.toString());
+		}
+	}
+	
+	public void testRemoveObjects ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(
+				MessageType.JBOSS_XML);
+
+		assertNotNull("created message", msg);
+		
+		ExampleObject value = new ExampleObject(1234);
+		
+		msg.getBody().add("bar", value);
+		
+		msg.getBody().remove("bar");
+		
+		try
+		{
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			log.debug("Document is "+xmlRepresentation);
+			
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+			
+			ExampleObject foo = (ExampleObject) nImpl.getBody().get("bar");
+			
+			assertNull("deserialised example object", foo);
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}	
+	}
+	
+	public void testJmsEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+		JMSEpr epr = new JMSEpr(JMSEpr.TOPIC_TYPE, "foo", "bar");
+		
+		msg.getHeader().getCall().setTo(epr);
+		
+		try
+		{
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			log.debug("Document is "+xmlRepresentation);
+			
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+			
+			assertEquals(theEpr instanceof JMSEpr, true);
+			
+			assertEquals(((JMSEpr) theEpr).getConnectionFactory(), "bar");
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testHttpEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+		try
+		{
+			HTTPEpr epr = new HTTPEpr("http://www.foo.bar");
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			log.debug("Document is "+xmlRepresentation);
+			
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+			
+			assertEquals(theEpr instanceof HTTPEpr, true);
+			
+			assertEquals(((HTTPEpr) theEpr).getURL().toString(), "http://www.foo.bar");
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testEmailEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+		try
+		{
+			EmailEpr epr = new EmailEpr(EmailEpr.SMTP_PROTOCOL, "foo.bar", "25", "me", "password");
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			log.debug("Document is "+xmlRepresentation);
+			
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+			
+			assertEquals(theEpr instanceof EmailEpr, true);
+			
+			assertEquals(((EmailEpr) theEpr).getPassword(), "password");
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testFtpEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+		try
+		{
+			FTPEpr epr = new FTPEpr("http://www.foo.bar");
+			
+			epr.setPassive(true);
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			log.debug("Document is "+xmlRepresentation);
+			
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+			
+			assertEquals(theEpr instanceof FTPEpr, true);
+			
+			assertEquals(((FTPEpr) theEpr).getPassive(), true);
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testJdbcEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+		try
+		{
+			JDBCEpr epr = new JDBCEpr("http://www.foo.bar", "SOME FAKE SQL");
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			log.debug("Document is "+xmlRepresentation);
+			
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+			
+			assertEquals(theEpr instanceof JDBCEpr, true);
+			
+			assertEquals(((JDBCEpr) theEpr).getSQL(), "SOME FAKE SQL");
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testFileEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+		try
+		{
+			FileEpr epr = new FileEpr("file://tmp/bar.txt");
+			
+			epr.setErrorDelete(true);
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			log.debug("Document is "+xmlRepresentation);
+			
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+			
+			assertEquals(theEpr instanceof FileEpr, true);
+			
+			assertEquals(((FileEpr) theEpr).getErrorDelete(), true);
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}
+	}
+	
+	public void testSFtpEPRType ()
+	{
+		Message msg = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+
+		try
+		{
+			SFTPEpr epr = new SFTPEpr(new URL("http://www.foo.bar"), new URL("http://www.bar.foo"));
+
+			assertEquals(epr.getCertificateURL().toString(), "http://www.bar.foo");
+			
+			msg.getHeader().getCall().setTo(epr);
+			
+			final String xmlRepresentation = msgToXML((MessageImpl)msg) ;
+			log.debug("Document is "+xmlRepresentation);
+			
+			final MessageImpl nImpl = msgFromXML(xmlRepresentation) ;
+			
+			EPR theEpr = nImpl.getHeader().getCall().getTo();
+			
+			assertEquals(theEpr instanceof SFTPEpr, true);
+			
+			assertEquals(((SFTPEpr) theEpr).getCertificateURL().toString(), "http://www.bar.foo");
+		}
+		catch (Exception ex)
+		{			
+			fail(ex.toString());
+		}
+	}
+	
+	private String msgToXML(final MessageImpl msg)
+		throws Exception
+	{
+		final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance() ;
+		
+		factory.setNamespaceAware(true);
+		
+		final DocumentBuilder builder = factory.newDocumentBuilder() ;
+		Document doc = builder.newDocument() ;
+		
+		doc = msg.toXML(doc) ;
+		
+		final StringWriter sWriter = new StringWriter() ;
+		final OutputFormat format = new OutputFormat() ;
+		format.setIndenting(true) ;
+
+		final XMLSerializer xmlS = new XMLSerializer(sWriter, format) ;
+
+		xmlS.asDOMSerializer() ;
+		xmlS.serialize(doc) ;
+
+		return sWriter.toString() ;
+	}
+	
+	private MessageImpl msgFromXML(final String xmlRepresentation)
+		throws Exception
+	{
+		final StringReader stringReader = new StringReader(xmlRepresentation) ;
+		final InputSource inputSource = new InputSource(stringReader) ;
+		
+		final DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance() ;
+		
+		factory.setNamespaceAware(true);
+		
+		final DocumentBuilder builder = factory.newDocumentBuilder() ;
+		final Document doc = builder.parse(inputSource) ;
+
+		final MessageImpl message = new MessageImpl() ;
+		message.fromXML(doc) ;
+		return message ;
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,53 +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.notification;
-
-import java.util.HashMap;
-
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.notification.MacroExpander;
-import org.jboss.internal.soa.esb.util.StreamUtils;
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-/**
- * MacroExpander unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class MacroExpanderUnitTest extends TestCase {
-
-	public void testReplaceMacros() {
-		ConfigTree rootDomEl = new ConfigTree("rootEl");
-		HashMap<String, String> map = new HashMap<String, String>();
-		
-		ConfigTree childDomEl = new ConfigTree("childEl",rootDomEl);
-		rootDomEl.setAttribute("attrb1", "value1");
-		rootDomEl.setAttribute("attrb2", MacroExpander.CTX_BATCH_NUM + "BatchNumValue");
-		childDomEl.setAttribute("attrb1", MacroExpander.CTX_BATCH_UID + "UIDValue");
-		map.put(MacroExpander.CTX_BATCH_NUM, "ReplacementBNV!");
-		map.put(MacroExpander.CTX_BATCH_UID, "ReplacementUIDV!");
-		
-		MacroExpander.replaceMacros(rootDomEl, map);
-		String expected = new String(StreamUtils.readStream(getClass().getResourceAsStream("MacroExpanderUnitTest_expected1.xml")));
-		assertEquals(expected.trim(), rootDomEl.toString().trim());
-	}	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,53 @@
+/*
+ * 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.notification;
+
+import java.util.HashMap;
+
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.notification.MacroExpander;
+import org.jboss.internal.soa.esb.util.StreamUtils;
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+/**
+ * MacroExpander unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class MacroExpanderUnitTest extends TestCase {
+
+	public void testReplaceMacros() {
+		ConfigTree rootDomEl = new ConfigTree("rootEl");
+		HashMap<String, String> map = new HashMap<String, String>();
+		
+		ConfigTree childDomEl = new ConfigTree("childEl",rootDomEl);
+		rootDomEl.setAttribute("attrb1", "value1");
+		rootDomEl.setAttribute("attrb2", MacroExpander.CTX_BATCH_NUM + "BatchNumValue");
+		childDomEl.setAttribute("attrb1", MacroExpander.CTX_BATCH_UID + "UIDValue");
+		map.put(MacroExpander.CTX_BATCH_NUM, "ReplacementBNV!");
+		map.put(MacroExpander.CTX_BATCH_UID, "ReplacementUIDV!");
+		
+		MacroExpander.replaceMacros(rootDomEl, map);
+		String expected = new String(StreamUtils.readStream(getClass().getResourceAsStream("MacroExpanderUnitTest_expected1.xml")));
+		assertEquals(expected.trim(), rootDomEl.toString().trim());
+	}	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest_expected1.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest_expected1.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest_expected1.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1 +0,0 @@
-<rootEl attrb1="value1" attrb2="ReplacementBNV!BatchNumValue"><childEl attrb1="ReplacementUIDV!UIDValue"/></rootEl>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest_expected1.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest_expected1.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest_expected1.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/MacroExpanderUnitTest_expected1.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1 @@
+<rootEl attrb1="value1" attrb2="ReplacementBNV!BatchNumValue"><childEl attrb1="ReplacementUIDV!UIDValue"/></rootEl>
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,80 +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.notification;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessageType;
-
-/**
- * NotificationList unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class NotificationListUnitTest extends TestCase {
-
-	public void test_NotificationList() throws Exception {
-		ConfigTree domEl = ConfigTree.fromInputStream(getClass().getResourceAsStream("NotificationListUnitTest_testfile1.xml"));
-		NotificationList nList = new NotificationList(domEl);
-		
-		List<String> messageList = new ArrayList<String>();
-		TestNotificationTarget1.messageList = messageList; 
-		TestNotificationTarget2.messageList = messageList;
-		
-        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-        message.getBody().setByteArray("tom".getBytes());
-		nList.sendNotification(message);
-		assertEquals(4, messageList.size());
-		assertEquals("message 1-tom", messageList.get(0));
-		assertEquals("message 2-tom", messageList.get(1));
-		assertEquals("message 3-tom", messageList.get(2));
-		assertEquals("message 4-tom", messageList.get(3));
-	}
-	
-	public void test_assertionMethods() throws Exception {
-		ConfigTree domEl;
-		NotificationList nList;
-		
-		domEl = new ConfigTree("notif");
-		nList = new NotificationList(domEl);
-		assertTrue(nList.isOK());
-		assertTrue(nList.isErr());
-		// REVIEW: Is this behavior OK??  Can be OK and Err at the same time!!
-		
-		domEl = new ConfigTree("notif");
-		domEl.setAttribute(NotificationList.TYPE, "ok");
-		nList = new NotificationList(domEl);
-		assertTrue(nList.isOK());
-		assertTrue(!nList.isErr());
-
-		domEl = new ConfigTree("notif");
-		domEl.setAttribute(NotificationList.TYPE, "err");
-		nList = new NotificationList(domEl);
-		assertTrue(!nList.isOK());
-		assertTrue(nList.isErr());
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,80 @@
+/*
+ * 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.notification;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+
+/**
+ * NotificationList unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NotificationListUnitTest extends TestCase {
+
+	public void test_NotificationList() throws Exception {
+		ConfigTree domEl = ConfigTree.fromInputStream(getClass().getResourceAsStream("NotificationListUnitTest_testfile1.xml"));
+		NotificationList nList = new NotificationList(domEl);
+		
+		List<String> messageList = new ArrayList<String>();
+		TestNotificationTarget1.messageList = messageList; 
+		TestNotificationTarget2.messageList = messageList;
+		
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        message.getBody().setByteArray("tom".getBytes());
+		nList.sendNotification(message);
+		assertEquals(4, messageList.size());
+		assertEquals("message 1-tom", messageList.get(0));
+		assertEquals("message 2-tom", messageList.get(1));
+		assertEquals("message 3-tom", messageList.get(2));
+		assertEquals("message 4-tom", messageList.get(3));
+	}
+	
+	public void test_assertionMethods() throws Exception {
+		ConfigTree domEl;
+		NotificationList nList;
+		
+		domEl = new ConfigTree("notif");
+		nList = new NotificationList(domEl);
+		assertTrue(nList.isOK());
+		assertTrue(nList.isErr());
+		// REVIEW: Is this behavior OK??  Can be OK and Err at the same time!!
+		
+		domEl = new ConfigTree("notif");
+		domEl.setAttribute(NotificationList.TYPE, "ok");
+		nList = new NotificationList(domEl);
+		assertTrue(nList.isOK());
+		assertTrue(!nList.isErr());
+
+		domEl = new ConfigTree("notif");
+		domEl.setAttribute(NotificationList.TYPE, "err");
+		nList = new NotificationList(domEl);
+		assertTrue(!nList.isOK());
+		assertTrue(nList.isErr());
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest_testfile1.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest_testfile1.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest_testfile1.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,6 +0,0 @@
-<notif type="ok">
-	<target class="TestNotificationTarget1" message="message 1" />
-	<target class="TestNotificationTarget1" message="message 2" />
-	<target class="TestNotificationTarget2" message="message 3" />
-	<target class="TestNotificationTarget2" message="message 4" />
-</notif>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest_testfile1.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest_testfile1.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest_testfile1.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotificationListUnitTest_testfile1.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,6 @@
+<notif type="ok">
+	<target class="TestNotificationTarget1" message="message 1" />
+	<target class="TestNotificationTarget1" message="message 2" />
+	<target class="TestNotificationTarget2" message="message 3" />
+	<target class="TestNotificationTarget2" message="message 4" />
+</notif>
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,63 +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.notification;
-
-import javax.mail.MessagingException;
-import javax.mail.internet.AddressException;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.helpers.Email;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessageType;
-
-/**
- * NotifyEmail unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class NotifyEmailUnitTest extends TestCase {
-
-	public void test_NotifyEmail() throws Exception {
-		ConfigTree emailMessageEl = new ConfigTree("email");
-		
-		emailMessageEl.setAttribute(Email.FROM, "a.b at c.com");
-		emailMessageEl.setAttribute(Email.SENDTO, "d.e at f.com");
-		emailMessageEl.setAttribute(Email.COPYTO, "g.h at i.com");
-		emailMessageEl.setAttribute(Email.MESSAGE, "Hi there!!!");
-		
-		NotifyEmail ne = new TestNotifyEmail(emailMessageEl);
-        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-        message.getBody().setByteArray("Hello".getBytes());
-		ne.sendNotification(message);
-	}
-	
-	private class TestNotifyEmail extends NotifyEmail {
-		public TestNotifyEmail(ConfigTree p_oP) throws Exception {
-			super(p_oP);
-		}
-		protected void sendEmailNotification(ConfigTree messageParams) throws AddressException, MessagingException {
-			assertEquals("Hi there!!!\nHello", messageParams.getAttribute(Email.MESSAGE));
-		}		
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyEmailUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,63 @@
+/*
+ * 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.notification;
+
+import javax.mail.MessagingException;
+import javax.mail.internet.AddressException;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.helpers.Email;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+
+/**
+ * NotifyEmail unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NotifyEmailUnitTest extends TestCase {
+
+	public void test_NotifyEmail() throws Exception {
+		ConfigTree emailMessageEl = new ConfigTree("email");
+		
+		emailMessageEl.setAttribute(Email.FROM, "a.b at c.com");
+		emailMessageEl.setAttribute(Email.SENDTO, "d.e at f.com");
+		emailMessageEl.setAttribute(Email.COPYTO, "g.h at i.com");
+		emailMessageEl.setAttribute(Email.MESSAGE, "Hi there!!!");
+		
+		NotifyEmail ne = new TestNotifyEmail(emailMessageEl);
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        message.getBody().setByteArray("Hello".getBytes());
+		ne.sendNotification(message);
+	}
+	
+	private class TestNotifyEmail extends NotifyEmail {
+		public TestNotifyEmail(ConfigTree p_oP) throws Exception {
+			super(p_oP);
+		}
+		protected void sendEmailNotification(ConfigTree messageParams) throws AddressException, MessagingException {
+			assertEquals("Hi there!!!\nHello", messageParams.getAttribute(Email.MESSAGE));
+		}		
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,129 +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.notification;
-
-import java.io.File;
-import java.io.Serializable;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessageType;
-
-/**
- * NotifyFiles unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class NotifyFilesUnitTest extends TestCase {
-	
-	public void test_BadFolderInfo() throws Exception {
-		ConfigTree rootEl = new ConfigTree("notif");
-		ConfigTree fileEl = new ConfigTree("file",rootEl);
-			
-		// No file attribute defined on the ConfigTree
-		try {
-			new NotifyFiles(rootEl);
-			fail("Expected IllegalArgumentException");
-		} catch(IllegalArgumentException e) {
-			// Expected
-		}
-		// File attribute defined on the ConfigTree, but parent folder doesn't exist...
-		fileEl.setAttribute("URI", new File("./").toURI().toString() + "/xyzzyx/a.txt");
-		try {
-			new NotifyFiles(rootEl);
-			fail("Expected IllegalArgumentException");
-		} catch(IllegalArgumentException e) {
-			// Expected
-		}
-	}
-	
-	public void test_StringObj() throws Exception {
-		sendNotification("Hello");
-	}
-
-	public void test_NonStringObj() throws Exception {
-		sendNotification(new Integer(1234));
-	}
-	
-	public void sendNotification(Serializable obj) throws Exception {
-		ConfigTree rootEl = new ConfigTree("notif");
-		NotifyFiles notifyFiles;
-		
-		// Add the file configs to the config DOM for 4 files...
-		addFileConfig(rootEl, "file1.notif", true);
-		addFileConfig(rootEl, "file2.notif", true);
-		addFileConfig(rootEl, "file3.notif", false);
-		addFileConfig(rootEl, "file4.notif", null);
-		
-		// Create the class and call the sendNotification method twice...
-		notifyFiles = new NotifyFiles(rootEl);
-        Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-        message.getBody().setByteArray("object".getBytes());
-		notifyFiles.sendNotification(message);
-		notifyFiles.sendNotification(message);
-
-		// Test the files. Files 1 and 2 should be the same size. Files 3 and 4 should be the
-		// same size. Files 1 and 2 should be twice as big as files 3 and 4 because append was set
-		// "true" on 1 and 2 and sendNotification() was called twice... 
-		File file1Obj = getFileObject("file1.notif");
-		File file2Obj = getFileObject("file2.notif");
-		File file3Obj = getFileObject("file3.notif");
-		File file4Obj = getFileObject("file4.notif");
-		assertEquals(file1Obj.length(), file2Obj.length());
-		assertEquals(file3Obj.length(), file4Obj.length());
-		assertEquals(file1Obj.length(), file3Obj.length() * 2);
-	}
-	
-	private void addFileConfig(ConfigTree rootEl, String file, Boolean append) {
-		File fileObj = getFileObject(file);
-		ConfigTree fileEl = new ConfigTree("file",rootEl);
-		
-		fileEl.setAttribute("URI", fileObj.toURI().toString());
-		fileEl.setAttribute("append", (append != null?append.toString():null));
-		
-		// Also want to delete the file incase the tests are being rerun...
-		fileObj.delete();
-	}
-
-	private File getFileObject(String file) {
-		// TF: Excuse this hack!!!  It's the safest way of calculating a 
-		// relative URI within the test structure.  It will prob cause
-		// Maven some issues i.e. getting it to work for both Ant and Maven :-(
-		// This code assumes that the working dir is the "product" folder.
-		
-		File fileObj = new File("build/tests/" + getPKg() + "/" + file);
-		if(!fileObj.getParentFile().exists()) {
-			// The build folder may not exist e.g. if running this test from
-			// inside your IDE.
-			fileObj.getParentFile().mkdirs();
-		}
-		
-		return fileObj;
-	}
-
-	private String getPKg() {
-		String javaPackage = NotifyFilesUnitTest.class.getPackage().getName();
-		return javaPackage.replace('.', '/');
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyFilesUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,129 @@
+/*
+ * 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.notification;
+
+import java.io.File;
+import java.io.Serializable;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+
+/**
+ * NotifyFiles unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NotifyFilesUnitTest extends TestCase {
+	
+	public void test_BadFolderInfo() throws Exception {
+		ConfigTree rootEl = new ConfigTree("notif");
+		ConfigTree fileEl = new ConfigTree("file",rootEl);
+			
+		// No file attribute defined on the ConfigTree
+		try {
+			new NotifyFiles(rootEl);
+			fail("Expected IllegalArgumentException");
+		} catch(IllegalArgumentException e) {
+			// Expected
+		}
+		// File attribute defined on the ConfigTree, but parent folder doesn't exist...
+		fileEl.setAttribute("URI", new File("./").toURI().toString() + "/xyzzyx/a.txt");
+		try {
+			new NotifyFiles(rootEl);
+			fail("Expected IllegalArgumentException");
+		} catch(IllegalArgumentException e) {
+			// Expected
+		}
+	}
+	
+	public void test_StringObj() throws Exception {
+		sendNotification("Hello");
+	}
+
+	public void test_NonStringObj() throws Exception {
+		sendNotification(new Integer(1234));
+	}
+	
+	public void sendNotification(Serializable obj) throws Exception {
+		ConfigTree rootEl = new ConfigTree("notif");
+		NotifyFiles notifyFiles;
+		
+		// Add the file configs to the config DOM for 4 files...
+		addFileConfig(rootEl, "file1.notif", true);
+		addFileConfig(rootEl, "file2.notif", true);
+		addFileConfig(rootEl, "file3.notif", false);
+		addFileConfig(rootEl, "file4.notif", null);
+		
+		// Create the class and call the sendNotification method twice...
+		notifyFiles = new NotifyFiles(rootEl);
+        Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+        message.getBody().setByteArray("object".getBytes());
+		notifyFiles.sendNotification(message);
+		notifyFiles.sendNotification(message);
+
+		// Test the files. Files 1 and 2 should be the same size. Files 3 and 4 should be the
+		// same size. Files 1 and 2 should be twice as big as files 3 and 4 because append was set
+		// "true" on 1 and 2 and sendNotification() was called twice... 
+		File file1Obj = getFileObject("file1.notif");
+		File file2Obj = getFileObject("file2.notif");
+		File file3Obj = getFileObject("file3.notif");
+		File file4Obj = getFileObject("file4.notif");
+		assertEquals(file1Obj.length(), file2Obj.length());
+		assertEquals(file3Obj.length(), file4Obj.length());
+		assertEquals(file1Obj.length(), file3Obj.length() * 2);
+	}
+	
+	private void addFileConfig(ConfigTree rootEl, String file, Boolean append) {
+		File fileObj = getFileObject(file);
+		ConfigTree fileEl = new ConfigTree("file",rootEl);
+		
+		fileEl.setAttribute("URI", fileObj.toURI().toString());
+		fileEl.setAttribute("append", (append != null?append.toString():null));
+		
+		// Also want to delete the file incase the tests are being rerun...
+		fileObj.delete();
+	}
+
+	private File getFileObject(String file) {
+		// TF: Excuse this hack!!!  It's the safest way of calculating a 
+		// relative URI within the test structure.  It will prob cause
+		// Maven some issues i.e. getting it to work for both Ant and Maven :-(
+		// This code assumes that the working dir is the "product" folder.
+		
+		File fileObj = new File("build/tests/" + getPKg() + "/" + file);
+		if(!fileObj.getParentFile().exists()) {
+			// The build folder may not exist e.g. if running this test from
+			// inside your IDE.
+			fileObj.getParentFile().mkdirs();
+		}
+		
+		return fileObj;
+	}
+
+	private String getPKg() {
+		String javaPackage = NotifyFilesUnitTest.class.getPackage().getName();
+		return javaPackage.replace('.', '/');
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,202 +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.notification;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.nio.ByteBuffer;
-
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-import javax.jms.QueueConnection;
-import javax.jms.TextMessage;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import junit.framework.TestCase;
-
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessageType;
-import org.mockejb.jms.MockQueue;
-import org.mockejb.jms.MockTopic;
-import org.mockejb.jms.QueueConnectionFactoryImpl;
-import org.mockejb.jndi.MockContextFactory;
-
-/**
- * NotifyQueues unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class NotifyQueuesUnitTest extends TestCase {
-	
-	private Logger log = Logger.getLogger( NotifyQueuesUnitTest.class );
-
-	private MockQueue mockQueue1;
-	private MockQueue mockQueue2;
-	private NotifyQueues notifyQueues;
-	
-	protected void setUp() {
-        try {
-    		MockContextFactory.setAsInitial();		
-    		Context ctx = new InitialContext();
-    		ctx.rebind(NotifyQueues.CONNECTION_FACTORY, new MockQueueConnectionFactory());
-    		ctx.close();
-    		ConfigTree rootEl = new ConfigTree("rootEl");
-    
-    		addMessagePropertyConfigs(rootEl);
-    		addQueueConfig(rootEl, "queue1");
-    		addQueueConfig(rootEl, "queue2");
-    		mockQueue1 = createAndBindQueue("queue1");
-    		mockQueue2 = createAndBindQueue("queue2");
-    		
-    		notifyQueues = new NotifyQueues(rootEl);
-        } catch (Exception e) {
-        	log.error(e);
-        }
-	}
-
-	protected void tearDown() throws Exception {
-		notifyQueues.release();
-		MockContextFactory.revertSetAsInitial();		
-	}
-
-	public void test_StringObj() throws Exception {
-        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-        message.getBody().setByteArray("Hello".getBytes());
-		notifyQueues.sendNotification(message);
-		
-		checkQueueTextMessage(mockQueue1, 0, "Hello");
-		checkQueueTextMessage(mockQueue2, 0, "Hello");
-	}
-	
-	public void test_NonStringObj() throws Exception {
-        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-        message.getBody().setByteArray(((new Integer(123).toString().getBytes())));
-		notifyQueues.sendNotification(message);
-		
-		checkQueueObjectMessage(mockQueue1, 0, new Integer(123).toString().getBytes());
-		checkQueueObjectMessage(mockQueue2, 0, new Integer(123).toString().getBytes());
-	}
-
-	private void checkQueueTextMessage(MockQueue mockQueue, int messageIdx, String expectedText) throws JMSException {
-		assertTrue(mockQueue.getMessages().size() > messageIdx);		
-		Message message = mockQueue.getMessageAt(0);
-		assertTrue(message instanceof TextMessage);
-		assertEquals(expectedText, ((TextMessage)message).getText());
-		assertEquals("testpropvalue", message.getStringProperty("testpropname"));
-	}
-
-	private void checkQueueObjectMessage(MockQueue mockQueue, int messageIdx, Object expectedObj) throws JMSException {
-		assertTrue(mockQueue.getMessages().size() > messageIdx);		
-		Message message = mockQueue.getMessageAt(0);
-		assertTrue(message instanceof ObjectMessage);
-        
-        ByteBuffer byteBuffer = ByteBuffer.wrap((byte[]) ((ObjectMessage) message).getObject());
-        ByteBuffer expectedByteBuffer = ByteBuffer.wrap((byte[]) (expectedObj));
-        
-		assertEquals(expectedByteBuffer, byteBuffer);
-		
-		// Note that the property bindings don't seem to work in this test i.e.
-		// it's returning null but should be returning the same as for a 
-		// TextMessage (See above).  This is most likely a mockejb lib issue
-		// and so we're ignoring it :-)
-		assertEquals(null, message.getStringProperty("testpropname"));
-	}
-	
-	private void addMessagePropertyConfigs(ConfigTree rootEl) {
-
-		ConfigTree propEl = new ConfigTree(NotifyQueues.CHILD_MSG_PROP,rootEl);
-		
-		propEl.setAttribute(NotifyJMS.ATT_PROP_NAME, "testpropname");
-		propEl.setAttribute(NotifyJMS.ATT_PROP_VALUE, "testpropvalue");
-	}
-
-	private void addQueueConfig(ConfigTree rootEl, String queueName) {
-		ConfigTree queueEl = new ConfigTree(NotifyQueues.CHILD_QUEUE,rootEl);
-		
-		queueEl.setAttribute(NotifyJMS.ATT_DEST_NAME, queueName);
-	}
-
-	private MockQueue createAndBindQueue(String queueName) throws NamingException {
-		MockQueue mockQueue = new MockQueue(queueName);
-				
-		Context ctx = new InitialContext();
-		ctx.rebind(queueName, mockQueue);
-		ctx.close();
-		return mockQueue;
-	}
-
-	@SuppressWarnings("unused")
-	private MockTopic createAndBindTopic(String topicName) throws NamingException {
-		MockTopic mockTopic = new MockTopic(topicName);
-		
-		Context ctx = new InitialContext();
-		ctx.rebind(topicName, mockTopic);
-		ctx.close();
-		return mockTopic;
-	}
-        
-        private static final class MockQueueConnectionFactory extends QueueConnectionFactoryImpl
-        {
-            @Override
-            public QueueConnection createQueueConnection() throws JMSException
-            {
-                return (QueueConnection)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {QueueConnection.class},
-                        new MockQueueExceptionHandlerInvocationHandler(super.createQueueConnection())) ;
-            }
-        }
-        
-        private static final class MockQueueExceptionHandlerInvocationHandler implements InvocationHandler
-        {
-            private final QueueConnection queueConnection ;
-            private ExceptionListener exceptionListener ;
-            
-            MockQueueExceptionHandlerInvocationHandler(final QueueConnection queueConnection)
-            {
-                this.queueConnection = queueConnection ;
-            }
-            
-            public Object invoke(final Object proxy, final Method method, final Object[] args)
-                throws Throwable
-            {
-                final String methodName = method.getName() ;
-                if ("setExceptionListener".equals(methodName))
-                {
-                    exceptionListener = (ExceptionListener)args[0] ;
-                    return null ;
-                }
-                else if ("getExceptionListener".equals(methodName))
-                {
-                    return exceptionListener ;
-                }
-                else
-                {
-                    return method.invoke(queueConnection, args) ;
-                }
-            }
-        }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyQueuesUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,202 @@
+/*
+ * 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.notification;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.nio.ByteBuffer;
+
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.ObjectMessage;
+import javax.jms.QueueConnection;
+import javax.jms.TextMessage;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import junit.framework.TestCase;
+
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.mockejb.jms.MockQueue;
+import org.mockejb.jms.MockTopic;
+import org.mockejb.jms.QueueConnectionFactoryImpl;
+import org.mockejb.jndi.MockContextFactory;
+
+/**
+ * NotifyQueues unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NotifyQueuesUnitTest extends TestCase {
+	
+	private Logger log = Logger.getLogger( NotifyQueuesUnitTest.class );
+
+	private MockQueue mockQueue1;
+	private MockQueue mockQueue2;
+	private NotifyQueues notifyQueues;
+	
+	protected void setUp() {
+        try {
+    		MockContextFactory.setAsInitial();		
+    		Context ctx = new InitialContext();
+    		ctx.rebind(NotifyQueues.CONNECTION_FACTORY, new MockQueueConnectionFactory());
+    		ctx.close();
+    		ConfigTree rootEl = new ConfigTree("rootEl");
+    
+    		addMessagePropertyConfigs(rootEl);
+    		addQueueConfig(rootEl, "queue1");
+    		addQueueConfig(rootEl, "queue2");
+    		mockQueue1 = createAndBindQueue("queue1");
+    		mockQueue2 = createAndBindQueue("queue2");
+    		
+    		notifyQueues = new NotifyQueues(rootEl);
+        } catch (Exception e) {
+        	log.error(e);
+        }
+	}
+
+	protected void tearDown() throws Exception {
+		notifyQueues.release();
+		MockContextFactory.revertSetAsInitial();		
+	}
+
+	public void test_StringObj() throws Exception {
+        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        message.getBody().setByteArray("Hello".getBytes());
+		notifyQueues.sendNotification(message);
+		
+		checkQueueTextMessage(mockQueue1, 0, "Hello");
+		checkQueueTextMessage(mockQueue2, 0, "Hello");
+	}
+	
+	public void test_NonStringObj() throws Exception {
+        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+        message.getBody().setByteArray(((new Integer(123).toString().getBytes())));
+		notifyQueues.sendNotification(message);
+		
+		checkQueueObjectMessage(mockQueue1, 0, new Integer(123).toString().getBytes());
+		checkQueueObjectMessage(mockQueue2, 0, new Integer(123).toString().getBytes());
+	}
+
+	private void checkQueueTextMessage(MockQueue mockQueue, int messageIdx, String expectedText) throws JMSException {
+		assertTrue(mockQueue.getMessages().size() > messageIdx);		
+		Message message = mockQueue.getMessageAt(0);
+		assertTrue(message instanceof TextMessage);
+		assertEquals(expectedText, ((TextMessage)message).getText());
+		assertEquals("testpropvalue", message.getStringProperty("testpropname"));
+	}
+
+	private void checkQueueObjectMessage(MockQueue mockQueue, int messageIdx, Object expectedObj) throws JMSException {
+		assertTrue(mockQueue.getMessages().size() > messageIdx);		
+		Message message = mockQueue.getMessageAt(0);
+		assertTrue(message instanceof ObjectMessage);
+        
+        ByteBuffer byteBuffer = ByteBuffer.wrap((byte[]) ((ObjectMessage) message).getObject());
+        ByteBuffer expectedByteBuffer = ByteBuffer.wrap((byte[]) (expectedObj));
+        
+		assertEquals(expectedByteBuffer, byteBuffer);
+		
+		// Note that the property bindings don't seem to work in this test i.e.
+		// it's returning null but should be returning the same as for a 
+		// TextMessage (See above).  This is most likely a mockejb lib issue
+		// and so we're ignoring it :-)
+		assertEquals(null, message.getStringProperty("testpropname"));
+	}
+	
+	private void addMessagePropertyConfigs(ConfigTree rootEl) {
+
+		ConfigTree propEl = new ConfigTree(NotifyQueues.CHILD_MSG_PROP,rootEl);
+		
+		propEl.setAttribute(NotifyJMS.ATT_PROP_NAME, "testpropname");
+		propEl.setAttribute(NotifyJMS.ATT_PROP_VALUE, "testpropvalue");
+	}
+
+	private void addQueueConfig(ConfigTree rootEl, String queueName) {
+		ConfigTree queueEl = new ConfigTree(NotifyQueues.CHILD_QUEUE,rootEl);
+		
+		queueEl.setAttribute(NotifyJMS.ATT_DEST_NAME, queueName);
+	}
+
+	private MockQueue createAndBindQueue(String queueName) throws NamingException {
+		MockQueue mockQueue = new MockQueue(queueName);
+				
+		Context ctx = new InitialContext();
+		ctx.rebind(queueName, mockQueue);
+		ctx.close();
+		return mockQueue;
+	}
+
+	@SuppressWarnings("unused")
+	private MockTopic createAndBindTopic(String topicName) throws NamingException {
+		MockTopic mockTopic = new MockTopic(topicName);
+		
+		Context ctx = new InitialContext();
+		ctx.rebind(topicName, mockTopic);
+		ctx.close();
+		return mockTopic;
+	}
+        
+        private static final class MockQueueConnectionFactory extends QueueConnectionFactoryImpl
+        {
+            @Override
+            public QueueConnection createQueueConnection() throws JMSException
+            {
+                return (QueueConnection)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {QueueConnection.class},
+                        new MockQueueExceptionHandlerInvocationHandler(super.createQueueConnection())) ;
+            }
+        }
+        
+        private static final class MockQueueExceptionHandlerInvocationHandler implements InvocationHandler
+        {
+            private final QueueConnection queueConnection ;
+            private ExceptionListener exceptionListener ;
+            
+            MockQueueExceptionHandlerInvocationHandler(final QueueConnection queueConnection)
+            {
+                this.queueConnection = queueConnection ;
+            }
+            
+            public Object invoke(final Object proxy, final Method method, final Object[] args)
+                throws Throwable
+            {
+                final String methodName = method.getName() ;
+                if ("setExceptionListener".equals(methodName))
+                {
+                    exceptionListener = (ExceptionListener)args[0] ;
+                    return null ;
+                }
+                else if ("getExceptionListener".equals(methodName))
+                {
+                    return exceptionListener ;
+                }
+                else
+                {
+                    return method.invoke(queueConnection, args) ;
+                }
+            }
+        }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTableUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTableUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTableUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,52 +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.notification;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-/**
- * NotifySqlTable unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class NotifySqlTableUnitTest extends TestCase {
-
-	public void test_NotifySqlTable() throws Exception {
-		ConfigTree domEl = ConfigTree.fromInputStream(getClass().getResourceAsStream("NotifySqlTable_testfile1.xml"));
-		NotifySqlTable nst = new NotifySqlTable(domEl);
-		
-		assertEquals("driver-class", nst.m_sDriver);
-		assertEquals("connection-url", nst.m_sURL);
-		assertEquals("user-name", nst.m_sUser);
-		assertEquals("password", nst.m_sPwd);
-		assertEquals("table", nst.m_sTable);
-		assertEquals("dataColumn", nst.m_sDataCol);
-		
-		assertEquals(3, nst.m_oCols.size());
-		assertEquals("colvalue1", nst.m_oCols.getProperty("colname1"));
-		assertEquals("colvalue2", nst.m_oCols.getProperty("colname2"));
-		assertEquals("colvalue3", nst.m_oCols.getProperty("colname3"));
-
-		assertEquals("insert into table (\"colname3\",\"colname2\",\"colname1\") values ('colvalue3','colvalue2','colvalue1')", nst.getInsertStmt());
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTableUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTableUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTableUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTableUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,52 @@
+/*
+ * 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.notification;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+/**
+ * NotifySqlTable unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NotifySqlTableUnitTest extends TestCase {
+
+	public void test_NotifySqlTable() throws Exception {
+		ConfigTree domEl = ConfigTree.fromInputStream(getClass().getResourceAsStream("NotifySqlTable_testfile1.xml"));
+		NotifySqlTable nst = new NotifySqlTable(domEl);
+		
+		assertEquals("driver-class", nst.m_sDriver);
+		assertEquals("connection-url", nst.m_sURL);
+		assertEquals("user-name", nst.m_sUser);
+		assertEquals("password", nst.m_sPwd);
+		assertEquals("table", nst.m_sTable);
+		assertEquals("dataColumn", nst.m_sDataCol);
+		
+		assertEquals(3, nst.m_oCols.size());
+		assertEquals("colvalue1", nst.m_oCols.getProperty("colname1"));
+		assertEquals("colvalue2", nst.m_oCols.getProperty("colname2"));
+		assertEquals("colvalue3", nst.m_oCols.getProperty("colname3"));
+
+		assertEquals("insert into table (\"colname3\",\"colname2\",\"colname1\") values ('colvalue3','colvalue2','colvalue1')", nst.getInsertStmt());
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTable_testfile1.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTable_testfile1.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTable_testfile1.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,12 +0,0 @@
-<notif	driver-class="driver-class" 
-		connection-url="connection-url" 
-		user-name="user-name" 
-		password="password" 
-		table="table"
-		dataColumn="dataColumn">
-		
-		<column name="colname1" value="colvalue1"/>
-		<column name="colname2" value="colvalue2"/>
-		<column name="colname3" value="colvalue3"/>
-		
-</notif>
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTable_testfile1.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTable_testfile1.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTable_testfile1.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifySqlTable_testfile1.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,12 @@
+<notif	driver-class="driver-class" 
+		connection-url="connection-url" 
+		user-name="user-name" 
+		password="password" 
+		table="table"
+		dataColumn="dataColumn">
+		
+		<column name="colname1" value="colvalue1"/>
+		<column name="colname2" value="colvalue2"/>
+		<column name="colname3" value="colvalue3"/>
+		
+</notif>
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,181 +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.notification;
-
-import java.lang.reflect.InvocationHandler;
-import java.lang.reflect.Method;
-import java.lang.reflect.Proxy;
-import java.nio.ByteBuffer;
-
-import javax.jms.ExceptionListener;
-import javax.jms.JMSException;
-import javax.jms.Message;
-import javax.jms.ObjectMessage;
-import javax.jms.TextMessage;
-import javax.jms.TopicConnection;
-import javax.naming.Context;
-import javax.naming.InitialContext;
-import javax.naming.NamingException;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.format.MessageFactory;
-import org.jboss.soa.esb.message.format.MessageType;
-import org.mockejb.jms.MockTopic;
-import org.mockejb.jms.TopicConnectionFactoryImpl;
-import org.mockejb.jndi.MockContextFactory;
-
-/**
- * NotifyTopics unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class NotifyTopicsUnitTest extends TestCase {
-
-	private MockTopic mockTopic1;
-	private MockTopic mockTopic2;
-	private NotifyTopics notifyTopics;
-	
-	protected void setUp() throws Exception {
-		MockContextFactory.setAsInitial();		
-		Context ctx = new InitialContext();
-		ctx.rebind(NotifyTopics.CONNECTION_FACTORY, new MockTopicConnectionFactory());
-		ctx.close();
-		ConfigTree rootEl = new ConfigTree("rootEl");
-
-		addMessagePropertyConfigs(rootEl);
-		addTopicConfig(rootEl, "topic1");
-		addTopicConfig(rootEl, "topic2");
-		mockTopic1 = createAndBindTopic("topic1");
-		mockTopic2 = createAndBindTopic("topic2");
-		
-		notifyTopics = new NotifyTopics(rootEl);
-	}
-
-	protected void tearDown() throws Exception {
-		notifyTopics.release();
-		MockContextFactory.revertSetAsInitial();		
-	}
-
-	public void test_StringObj() throws Exception {
-        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
-        message.getBody().setByteArray("Hello".getBytes());
-		notifyTopics.sendNotification(message);
-		
-		checkTopicTextMessage(mockTopic1, 0, "Hello");
-		checkTopicTextMessage(mockTopic2, 0, "Hello");
-	}
-	
-	public void test_NonStringObj() throws Exception {
-        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
-        message.getBody().setByteArray((new Integer(123).toString().getBytes()));
-		notifyTopics.sendNotification(message);
-		
-		checkTopicObjectMessage(mockTopic1, 0, new Integer(123).toString().getBytes());
-		checkTopicObjectMessage(mockTopic2, 0, new Integer(123).toString().getBytes());
-	}
-
-	private void checkTopicTextMessage(MockTopic mockTopic, int messageIdx, String expectedText) throws JMSException {
-		assertTrue(mockTopic.getMessages().size() > messageIdx);		
-		Message message = mockTopic.getMessageAt(0);
-		assertTrue(message instanceof TextMessage);
-		assertEquals(expectedText, ((TextMessage)message).getText());
-		assertEquals("testpropvalue", message.getStringProperty("testpropname"));
-	}
-
-	private void checkTopicObjectMessage(MockTopic mockTopic, int messageIdx, Object expectedObj) throws JMSException {
-		assertTrue(mockTopic.getMessages().size() > messageIdx);		
-		Message message = mockTopic.getMessageAt(0);
-		assertTrue(message instanceof ObjectMessage);
-        ByteBuffer byteBuffer = ByteBuffer.wrap((byte[]) ((ObjectMessage) message).getObject());
-        ByteBuffer expectedByteBuffer = ByteBuffer.wrap((byte[]) (expectedObj));
-		assertEquals(expectedByteBuffer, byteBuffer);
-		
-		// Note that the property bindings don't seem to work in this test i.e.
-		// it's returning null but should be returning the same as for a 
-		// TextMessage (See above).  This is most likely a mockejb lib issue
-		// and so we're ignoring it :-)
-		assertEquals(null, message.getStringProperty("testpropname"));
-	}
-	
-	private void addMessagePropertyConfigs(ConfigTree rootEl) {
-		ConfigTree propEl = new ConfigTree(NotifyTopics.CHILD_MSG_PROP,rootEl);
-		
-		propEl.setAttribute(NotifyJMS.ATT_PROP_NAME, "testpropname");
-		propEl.setAttribute(NotifyJMS.ATT_PROP_VALUE, "testpropvalue");
-	}
-
-	private void addTopicConfig(ConfigTree rootEl, String topicName) {
-		ConfigTree topicEl = new ConfigTree(NotifyTopics.CHILD_TOPIC,rootEl);
-		
-		topicEl.setAttribute(NotifyJMS.ATT_DEST_NAME, topicName);
-	}
-
-	private MockTopic createAndBindTopic(String topicName) throws NamingException {
-		MockTopic mockTopic = new MockTopic(topicName);
-		
-		Context ctx = new InitialContext();
-		ctx.rebind(topicName, mockTopic);
-		ctx.close();
-		return mockTopic;
-	}
-        
-        private static final class MockTopicConnectionFactory extends TopicConnectionFactoryImpl
-        {
-            @Override
-            public TopicConnection createTopicConnection() throws JMSException
-            {
-                return (TopicConnection)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {TopicConnection.class},
-                        new MockTopicExceptionHandlerInvocationHandler(super.createTopicConnection())) ;
-            }
-        }
-        
-        private static final class MockTopicExceptionHandlerInvocationHandler implements InvocationHandler
-        {
-            private final TopicConnection topicConnection ;
-            private ExceptionListener exceptionListener ;
-            
-            MockTopicExceptionHandlerInvocationHandler(final TopicConnection topicConnection)
-            {
-                this.topicConnection = topicConnection ;
-            }
-            
-            public Object invoke(final Object proxy, final Method method, final Object[] args)
-                throws Throwable
-            {
-                final String methodName = method.getName() ;
-                if ("setExceptionListener".equals(methodName))
-                {
-                    exceptionListener = (ExceptionListener)args[0] ;
-                    return null ;
-                }
-                else if ("getExceptionListener".equals(methodName))
-                {
-                    return exceptionListener ;
-                }
-                else
-                {
-                    return method.invoke(topicConnection, args) ;
-                }
-            }
-        }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyTopicsUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,181 @@
+/*
+ * 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.notification;
+
+import java.lang.reflect.InvocationHandler;
+import java.lang.reflect.Method;
+import java.lang.reflect.Proxy;
+import java.nio.ByteBuffer;
+
+import javax.jms.ExceptionListener;
+import javax.jms.JMSException;
+import javax.jms.Message;
+import javax.jms.ObjectMessage;
+import javax.jms.TextMessage;
+import javax.jms.TopicConnection;
+import javax.naming.Context;
+import javax.naming.InitialContext;
+import javax.naming.NamingException;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.format.MessageFactory;
+import org.jboss.soa.esb.message.format.MessageType;
+import org.mockejb.jms.MockTopic;
+import org.mockejb.jms.TopicConnectionFactoryImpl;
+import org.mockejb.jndi.MockContextFactory;
+
+/**
+ * NotifyTopics unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NotifyTopicsUnitTest extends TestCase {
+
+	private MockTopic mockTopic1;
+	private MockTopic mockTopic2;
+	private NotifyTopics notifyTopics;
+	
+	protected void setUp() throws Exception {
+		MockContextFactory.setAsInitial();		
+		Context ctx = new InitialContext();
+		ctx.rebind(NotifyTopics.CONNECTION_FACTORY, new MockTopicConnectionFactory());
+		ctx.close();
+		ConfigTree rootEl = new ConfigTree("rootEl");
+
+		addMessagePropertyConfigs(rootEl);
+		addTopicConfig(rootEl, "topic1");
+		addTopicConfig(rootEl, "topic2");
+		mockTopic1 = createAndBindTopic("topic1");
+		mockTopic2 = createAndBindTopic("topic2");
+		
+		notifyTopics = new NotifyTopics(rootEl);
+	}
+
+	protected void tearDown() throws Exception {
+		notifyTopics.release();
+		MockContextFactory.revertSetAsInitial();		
+	}
+
+	public void test_StringObj() throws Exception {
+        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JBOSS_XML);
+        message.getBody().setByteArray("Hello".getBytes());
+		notifyTopics.sendNotification(message);
+		
+		checkTopicTextMessage(mockTopic1, 0, "Hello");
+		checkTopicTextMessage(mockTopic2, 0, "Hello");
+	}
+	
+	public void test_NonStringObj() throws Exception {
+        org.jboss.soa.esb.message.Message message = MessageFactory.getInstance().getMessage(MessageType.JAVA_SERIALIZED);
+        message.getBody().setByteArray((new Integer(123).toString().getBytes()));
+		notifyTopics.sendNotification(message);
+		
+		checkTopicObjectMessage(mockTopic1, 0, new Integer(123).toString().getBytes());
+		checkTopicObjectMessage(mockTopic2, 0, new Integer(123).toString().getBytes());
+	}
+
+	private void checkTopicTextMessage(MockTopic mockTopic, int messageIdx, String expectedText) throws JMSException {
+		assertTrue(mockTopic.getMessages().size() > messageIdx);		
+		Message message = mockTopic.getMessageAt(0);
+		assertTrue(message instanceof TextMessage);
+		assertEquals(expectedText, ((TextMessage)message).getText());
+		assertEquals("testpropvalue", message.getStringProperty("testpropname"));
+	}
+
+	private void checkTopicObjectMessage(MockTopic mockTopic, int messageIdx, Object expectedObj) throws JMSException {
+		assertTrue(mockTopic.getMessages().size() > messageIdx);		
+		Message message = mockTopic.getMessageAt(0);
+		assertTrue(message instanceof ObjectMessage);
+        ByteBuffer byteBuffer = ByteBuffer.wrap((byte[]) ((ObjectMessage) message).getObject());
+        ByteBuffer expectedByteBuffer = ByteBuffer.wrap((byte[]) (expectedObj));
+		assertEquals(expectedByteBuffer, byteBuffer);
+		
+		// Note that the property bindings don't seem to work in this test i.e.
+		// it's returning null but should be returning the same as for a 
+		// TextMessage (See above).  This is most likely a mockejb lib issue
+		// and so we're ignoring it :-)
+		assertEquals(null, message.getStringProperty("testpropname"));
+	}
+	
+	private void addMessagePropertyConfigs(ConfigTree rootEl) {
+		ConfigTree propEl = new ConfigTree(NotifyTopics.CHILD_MSG_PROP,rootEl);
+		
+		propEl.setAttribute(NotifyJMS.ATT_PROP_NAME, "testpropname");
+		propEl.setAttribute(NotifyJMS.ATT_PROP_VALUE, "testpropvalue");
+	}
+
+	private void addTopicConfig(ConfigTree rootEl, String topicName) {
+		ConfigTree topicEl = new ConfigTree(NotifyTopics.CHILD_TOPIC,rootEl);
+		
+		topicEl.setAttribute(NotifyJMS.ATT_DEST_NAME, topicName);
+	}
+
+	private MockTopic createAndBindTopic(String topicName) throws NamingException {
+		MockTopic mockTopic = new MockTopic(topicName);
+		
+		Context ctx = new InitialContext();
+		ctx.rebind(topicName, mockTopic);
+		ctx.close();
+		return mockTopic;
+	}
+        
+        private static final class MockTopicConnectionFactory extends TopicConnectionFactoryImpl
+        {
+            @Override
+            public TopicConnection createTopicConnection() throws JMSException
+            {
+                return (TopicConnection)Proxy.newProxyInstance(getClass().getClassLoader(), new Class[] {TopicConnection.class},
+                        new MockTopicExceptionHandlerInvocationHandler(super.createTopicConnection())) ;
+            }
+        }
+        
+        private static final class MockTopicExceptionHandlerInvocationHandler implements InvocationHandler
+        {
+            private final TopicConnection topicConnection ;
+            private ExceptionListener exceptionListener ;
+            
+            MockTopicExceptionHandlerInvocationHandler(final TopicConnection topicConnection)
+            {
+                this.topicConnection = topicConnection ;
+            }
+            
+            public Object invoke(final Object proxy, final Method method, final Object[] args)
+                throws Throwable
+            {
+                final String methodName = method.getName() ;
+                if ("setExceptionListener".equals(methodName))
+                {
+                    exceptionListener = (ExceptionListener)args[0] ;
+                    return null ;
+                }
+                else if ("getExceptionListener".equals(methodName))
+                {
+                    return exceptionListener ;
+                }
+                else
+                {
+                    return method.invoke(topicConnection, args) ;
+                }
+            }
+        }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyUtilUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyUtilUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,89 +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.notification;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.services.NotificationManager;
-
-/**
- * NotifyUtil unit tests.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class NotifyUtilUnitTest extends TestCase
-{
-
-	public void test_NotifyUtil ()
-	{
-		ConfigTree rootEl = new ConfigTree("rootEl");
-
-		addNotificationConfig(rootEl, "message1", "ok");
-		addNotificationConfig(rootEl, "message2", "err");
-		addNotificationConfig(rootEl, "message3", "ok");
-		addNotificationConfig(rootEl, "message4", "err");
-
-		TestNotificationHandler handler = new TestNotificationHandler();
-		NotifyUtil.notifyOK(handler, rootEl, "somemessage", new HashMap());
-		assertEquals(2, handler.messages.size());
-		assertEquals("message1 - somemessage", handler.messages.get(0));
-		assertEquals("message3 - somemessage", handler.messages.get(1));
-
-		handler.messages.clear();
-		NotifyUtil.notifyError(handler, rootEl, "somemessage", new HashMap(),
-				new Exception("test"));
-		assertEquals(3, handler.messages.size());
-		assertTrue(handler.messages.get(0).startsWith("somemessage"));
-		assertTrue(handler.messages.get(1).startsWith("message2 - somemessage"));
-		assertTrue(handler.messages.get(2).startsWith("message4 - somemessage"));
-	}
-
-	private void addNotificationConfig (ConfigTree rootEl, String message,
-			String type)
-	{
-		ConfigTree notifEl = new ConfigTree(NotificationList.ELEMENT, rootEl);
-		notifEl.setAttribute("message", message);
-		notifEl.setAttribute(NotificationList.TYPE, type);
-	}
-
-	private class TestNotificationHandler implements NotificationManager
-	{
-		private List<String> messages = new ArrayList<String>();
-
-		public void sendNotifications (ConfigTree p_oP, Serializable p_o)
-				throws NotificationException
-		{
-			messages.add(p_oP.getAttribute("message") + " - " + p_o);
-		}
-
-		public void sendNotifications (Serializable p_o) throws NotificationException
-		{
-			messages.add(p_o.toString());
-		}
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyUtilUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyUtilUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyUtilUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/NotifyUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,89 @@
+/*
+ * 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.notification;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.services.NotificationManager;
+
+/**
+ * NotifyUtil unit tests.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class NotifyUtilUnitTest extends TestCase
+{
+
+	public void test_NotifyUtil ()
+	{
+		ConfigTree rootEl = new ConfigTree("rootEl");
+
+		addNotificationConfig(rootEl, "message1", "ok");
+		addNotificationConfig(rootEl, "message2", "err");
+		addNotificationConfig(rootEl, "message3", "ok");
+		addNotificationConfig(rootEl, "message4", "err");
+
+		TestNotificationHandler handler = new TestNotificationHandler();
+		NotifyUtil.notifyOK(handler, rootEl, "somemessage", new HashMap());
+		assertEquals(2, handler.messages.size());
+		assertEquals("message1 - somemessage", handler.messages.get(0));
+		assertEquals("message3 - somemessage", handler.messages.get(1));
+
+		handler.messages.clear();
+		NotifyUtil.notifyError(handler, rootEl, "somemessage", new HashMap(),
+				new Exception("test"));
+		assertEquals(3, handler.messages.size());
+		assertTrue(handler.messages.get(0).startsWith("somemessage"));
+		assertTrue(handler.messages.get(1).startsWith("message2 - somemessage"));
+		assertTrue(handler.messages.get(2).startsWith("message4 - somemessage"));
+	}
+
+	private void addNotificationConfig (ConfigTree rootEl, String message,
+			String type)
+	{
+		ConfigTree notifEl = new ConfigTree(NotificationList.ELEMENT, rootEl);
+		notifEl.setAttribute("message", message);
+		notifEl.setAttribute(NotificationList.TYPE, type);
+	}
+
+	private class TestNotificationHandler implements NotificationManager
+	{
+		private List<String> messages = new ArrayList<String>();
+
+		public void sendNotifications (ConfigTree p_oP, Serializable p_o)
+				throws NotificationException
+		{
+			messages.add(p_oP.getAttribute("message") + " - " + p_o);
+		}
+
+		public void sendNotifications (Serializable p_o) throws NotificationException
+		{
+			messages.add(p_o.toString());
+		}
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,28 +0,0 @@
-package org.jboss.soa.esb.notification;
-
-import java.util.List;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-
-public class TestNotificationTarget1 extends NotificationTarget
-{
-
-	private ConfigTree config;
-
-	public static List<String> messageList;
-
-	public TestNotificationTarget1 (ConfigTree targetConf)
-	{
-		super(targetConf);
-		config = targetConf;
-	}
-
-	@Override
-	public void sendNotification (Message message)
-			throws NotificationException
-	{
-        String content = new String(message.getBody().getByteArray());
-		messageList.add(config.getAttribute("message") + "-" + content);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget1.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,28 @@
+package org.jboss.soa.esb.notification;
+
+import java.util.List;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+
+public class TestNotificationTarget1 extends NotificationTarget
+{
+
+	private ConfigTree config;
+
+	public static List<String> messageList;
+
+	public TestNotificationTarget1 (ConfigTree targetConf)
+	{
+		super(targetConf);
+		config = targetConf;
+	}
+
+	@Override
+	public void sendNotification (Message message)
+			throws NotificationException
+	{
+        String content = new String(message.getBody().getByteArray());
+		messageList.add(config.getAttribute("message") + "-" + content);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget2.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget2.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget2.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,10 +0,0 @@
-package org.jboss.soa.esb.notification;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-
-public class TestNotificationTarget2 extends TestNotificationTarget1 {
-
-	public TestNotificationTarget2(ConfigTree targetConf) {
-		super(targetConf);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget2.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget2.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget2.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/notification/TestNotificationTarget2.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,10 @@
+package org.jboss.soa.esb.notification;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+
+public class TestNotificationTarget2 extends TestNotificationTarget1 {
+
+	public TestNotificationTarget2(ConfigTree targetConf) {
+		super(targetConf);
+	}
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,53 +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.parameters;
-
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.parameters.ParamFileRepository;
-import org.jboss.soa.esb.common.Environment;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-
-/**
- * ParamRepositoryFactory unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class ParamRepositoryFactoryUnitTest extends TestCase {
-
-	public void test_ParamRepositoryFactory() {
-		ParamRepository repo;
-		
-		repo = ParamRepositoryFactory.getInstance();
-		assertTrue(repo instanceof ParamFileRepository);
-		
-		ParamRepositoryFactory.reset();
-		ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(Environment.PARAMS_REPOS_IMPL_CLASS, TestParamRepo.class.getName());
-		repo = ParamRepositoryFactory.getInstance();
-		assertTrue(repo instanceof TestParamRepo);
-	}
-	
-	public void test_ParamRepositoryException() {
-		// for the coverage results ;-)
-		new ParamRepositoryException("message");
-		new ParamRepositoryException("message", new Exception());
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamRepositoryFactoryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,53 @@
+/*
+ * 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.parameters;
+
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.parameters.ParamFileRepository;
+import org.jboss.soa.esb.common.Environment;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+
+/**
+ * ParamRepositoryFactory unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ParamRepositoryFactoryUnitTest extends TestCase {
+
+	public void test_ParamRepositoryFactory() {
+		ParamRepository repo;
+		
+		repo = ParamRepositoryFactory.getInstance();
+		assertTrue(repo instanceof ParamFileRepository);
+		
+		ParamRepositoryFactory.reset();
+		ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(Environment.PARAMS_REPOS_IMPL_CLASS, TestParamRepo.class.getName());
+		repo = ParamRepositoryFactory.getInstance();
+		assertTrue(repo instanceof TestParamRepo);
+	}
+	
+	public void test_ParamRepositoryException() {
+		// for the coverage results ;-)
+		new ParamRepositoryException("message");
+		new ParamRepositoryException("message", new Exception());
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.parameters;
-
-import java.io.File;
-
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.parameters.ParamFileRepository;
-import org.jboss.soa.esb.common.ModulePropertyManager;
-
-/**
- * ParamFileRepository unit tests.
- * 
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class ParamsFileRepositoryUnitTest extends TestCase
-{
-
-	public void test_ParamsFileRepository() throws Exception
-	{
-		File root;
-		ParamFileRepository fileRepo;
-
-		// Check it defaults to the working dir...
-		root = new File("./");
-		fileRepo = new ParamFileRepository();
-		assertEquals(root, fileRepo.getRoot());
-
-		// Check it can pick up from the System prop...
-		root = new File("build/tests/");
-		ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
-				ParamFileRepository.FILE_PARAMS_REPOS_ROOT, root.getPath());
-		fileRepo = new ParamFileRepository();
-		assertEquals(root, fileRepo.getRoot());
-
-		// Check for error on invalid System prop...
-		ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
-				ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "blah/blah");
-		try
-		{
-			new ParamFileRepository();
-			fail("expected IllegalStateException");
-		} catch (IllegalStateException e)
-		{
-			// expected
-		}
-	}
-
-	public void test_add_get_remove_badargs() throws Exception
-	{
-		ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
-				ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "build/tests/");
-		ParamFileRepository fileRepo = new ParamFileRepository();
-
-		test_add_badargs(fileRepo, null, "val");
-		test_add_badargs(fileRepo, "", "val");
-		test_add_badargs(fileRepo, "", "val");
-		test_add_badargs(fileRepo, "xxx/yyy", null);
-
-		test_get_badargs(fileRepo, null);
-		test_get_badargs(fileRepo, "");
-
-		test_remove_badargs(fileRepo, null);
-		test_remove_badargs(fileRepo, "");
-	}
-
-	private void test_add_badargs(ParamFileRepository fileRepo, String name,
-			String value) throws ParamRepositoryException
-	{
-		try
-		{
-			fileRepo.add(name, value);
-			fail("expected IllegalArgumentException");
-		} catch (IllegalArgumentException e)
-		{
-			// expected
-		}
-	}
-
-	private void test_get_badargs(ParamFileRepository fileRepo, String name)
-			throws ParamRepositoryException
-	{
-		try
-		{
-			fileRepo.get(name);
-			fail("expected IllegalArgumentException");
-		} catch (IllegalArgumentException e)
-		{
-			// expected
-		}
-	}
-
-	private void test_remove_badargs(ParamFileRepository fileRepo, String name)
-	{
-		try
-		{
-			fileRepo.remove(name);
-			fail("expected IllegalArgumentException");
-		} catch (IllegalArgumentException e)
-		{
-			// expected
-		}
-	}
-
-	public void test_add_get_remove() throws Exception
-	{
-		ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
-				ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "build/tests/");
-		ParamFileRepository fileRepo = new ParamFileRepository();
-		String name = "repostests/jboss/testparam";
-
-		// Make sure the parameter doesn't already exist...
-		assertEquals(null, fileRepo.get(name));
-
-		// Now the tests...
-		assertEquals(null, fileRepo.get(name));
-		fileRepo.add(name, "tomtestvalue");
-		assertEquals("tomtestvalue", fileRepo.get(name));
-		fileRepo.remove(name);
-		assertEquals(null, fileRepo.get(name));
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/ParamsFileRepositoryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,142 @@
+/*
+ * 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.parameters;
+
+import java.io.File;
+
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.parameters.ParamFileRepository;
+import org.jboss.soa.esb.common.ModulePropertyManager;
+
+/**
+ * ParamFileRepository unit tests.
+ * 
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ParamsFileRepositoryUnitTest extends TestCase
+{
+
+	public void test_ParamsFileRepository() throws Exception
+	{
+		File root;
+		ParamFileRepository fileRepo;
+
+		// Check it defaults to the working dir...
+		root = new File("./");
+		fileRepo = new ParamFileRepository();
+		assertEquals(root, fileRepo.getRoot());
+
+		// Check it can pick up from the System prop...
+		root = new File("build/tests/");
+		ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
+				ParamFileRepository.FILE_PARAMS_REPOS_ROOT, root.getPath());
+		fileRepo = new ParamFileRepository();
+		assertEquals(root, fileRepo.getRoot());
+
+		// Check for error on invalid System prop...
+		ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
+				ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "blah/blah");
+		try
+		{
+			new ParamFileRepository();
+			fail("expected IllegalStateException");
+		} catch (IllegalStateException e)
+		{
+			// expected
+		}
+	}
+
+	public void test_add_get_remove_badargs() throws Exception
+	{
+		ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
+				ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "build/tests/");
+		ParamFileRepository fileRepo = new ParamFileRepository();
+
+		test_add_badargs(fileRepo, null, "val");
+		test_add_badargs(fileRepo, "", "val");
+		test_add_badargs(fileRepo, "", "val");
+		test_add_badargs(fileRepo, "xxx/yyy", null);
+
+		test_get_badargs(fileRepo, null);
+		test_get_badargs(fileRepo, "");
+
+		test_remove_badargs(fileRepo, null);
+		test_remove_badargs(fileRepo, "");
+	}
+
+	private void test_add_badargs(ParamFileRepository fileRepo, String name,
+			String value) throws ParamRepositoryException
+	{
+		try
+		{
+			fileRepo.add(name, value);
+			fail("expected IllegalArgumentException");
+		} catch (IllegalArgumentException e)
+		{
+			// expected
+		}
+	}
+
+	private void test_get_badargs(ParamFileRepository fileRepo, String name)
+			throws ParamRepositoryException
+	{
+		try
+		{
+			fileRepo.get(name);
+			fail("expected IllegalArgumentException");
+		} catch (IllegalArgumentException e)
+		{
+			// expected
+		}
+	}
+
+	private void test_remove_badargs(ParamFileRepository fileRepo, String name)
+	{
+		try
+		{
+			fileRepo.remove(name);
+			fail("expected IllegalArgumentException");
+		} catch (IllegalArgumentException e)
+		{
+			// expected
+		}
+	}
+
+	public void test_add_get_remove() throws Exception
+	{
+		ModulePropertyManager.getPropertyManager(ModulePropertyManager.CORE_MODULE).setProperty(
+				ParamFileRepository.FILE_PARAMS_REPOS_ROOT, "build/tests/");
+		ParamFileRepository fileRepo = new ParamFileRepository();
+		String name = "repostests/jboss/testparam";
+
+		// Make sure the parameter doesn't already exist...
+		assertEquals(null, fileRepo.get(name));
+
+		// Now the tests...
+		assertEquals(null, fileRepo.get(name));
+		fileRepo.add(name, "tomtestvalue");
+		assertEquals("tomtestvalue", fileRepo.get(name));
+		fileRepo.remove(name);
+		assertEquals(null, fileRepo.get(name));
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/TestParamRepo.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/TestParamRepo.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/TestParamRepo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,26 +0,0 @@
-package org.jboss.soa.esb.parameters;
-
-public class TestParamRepo implements ParamRepository {
-
-	public TestParamRepo() {
-		super();
-		// TODO Auto-generated constructor stub
-	}
-
-	public void add(String name, String value)
-			throws ParamRepositoryException {
-		// TODO Auto-generated method stub
-
-	}
-
-	public String get(String name) throws ParamRepositoryException {
-		// TODO Auto-generated method stub
-		return null;
-	}
-
-	public void remove(String name) throws ParamRepositoryException {
-		// TODO Auto-generated method stub
-
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/TestParamRepo.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/TestParamRepo.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/TestParamRepo.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/parameters/TestParamRepo.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,26 @@
+package org.jboss.soa.esb.parameters;
+
+public class TestParamRepo implements ParamRepository {
+
+	public TestParamRepo() {
+		super();
+		// TODO Auto-generated constructor stub
+	}
+
+	public void add(String name, String value)
+			throws ParamRepositoryException {
+		// TODO Auto-generated method stub
+
+	}
+
+	public String get(String name) throws ParamRepositoryException {
+		// TODO Auto-generated method stub
+		return null;
+	}
+
+	public void remove(String name) throws ParamRepositoryException {
+		// TODO Auto-generated method stub
+
+	}
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/DummyUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/DummyUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/DummyUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -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.services;
-
-import org.jboss.soa.esb.common.tests.BaseTest;
-
-/**
- * Dummy test file.
- *
- * @author <a href="mailto:arvinder.singh at indigo-logic.com">Arvinder Singh</a>
- * @version <tt>$Revision:$</tt>
- * $Id:$
- */
-public class DummyUnitTest extends BaseTest {
-
-    /**
-     * Remove me
-     * @throws Exception
-     */
-   public void testDummyCompileAndInvoke() throws Exception {
-       log.info("****************************************************************");
-       log.info("  Dummy unit test called. Replace this with module level tests");
-       log.info("****************************************************************");
-   }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/DummyUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/DummyUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/DummyUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/DummyUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,45 @@
+/*
+* 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.services;
+
+import org.jboss.soa.esb.common.tests.BaseTest;
+
+/**
+ * Dummy test file.
+ *
+ * @author <a href="mailto:arvinder.singh at indigo-logic.com">Arvinder Singh</a>
+ * @version <tt>$Revision:$</tt>
+ * $Id:$
+ */
+public class DummyUnitTest extends BaseTest {
+
+    /**
+     * Remove me
+     * @throws Exception
+     */
+   public void testDummyCompileAndInvoke() throws Exception {
+       log.info("****************************************************************");
+       log.info("  Dummy unit test called. Replace this with module level tests");
+       log.info("****************************************************************");
+   }
+
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/RegistryUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/RegistryUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/RegistryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,229 +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.services.registry;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.io.File;
-import java.io.InputStream;
-import java.sql.DriverManager;
-import java.sql.Statement;
-import java.util.Collection;
-import java.util.Iterator;
-import java.util.Properties;
-
-import junit.framework.JUnit4TestAdapter;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-import org.jboss.soa.esb.addressing.EPR;
-import org.jboss.soa.esb.testutils.FileUtil;
-import org.jboss.soa.esb.testutils.HsqldbUtil;
-import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
-import org.junit.AfterClass;
-import org.junit.BeforeClass;
-import org.junit.Test;
-/**
- * Testing the registry.
- * 
- * @author kstam
- *
- */
-public class RegistryUnitTest
-{
-    private static String mDbDriver;
-	private static String mDbUrl;
-	private static String mDbUsername;
-	private static String mDbPassword;
-	private static final String SERVICE_NAME = "Kurts Travel Agency";
-	private static final String CATEGORY = "travel";
-	
-	private static Logger logger = Logger.getLogger(RegistryUnitTest.class);
-	
-	/**
-	 * Testing the registering of an EPR.
-	 */
-	@Test
-	public void publishEPR() 
-	{
-		EPR epr = new EPR();
-		try {
-			Registry registry = RegistryFactory.getRegistry();
-			registry.registerEPR(CATEGORY, SERVICE_NAME, "Service for traveling", 
-					epr, "Specific Service Binding for traveling");
-		} catch (RegistryException re) {
-			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
-			assertTrue(false);
-		}
-		try {
-			Registry registry = RegistryFactory.getRegistry();
-			registry.registerEPR(null, SERVICE_NAME, null, 
-					epr, null);
-		} catch (RegistryException re) {
-			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
-			assertTrue(false);
-		}
-		//make sure we can handle some null arguments
-		
-	}
-	/**
-	 * This test will try to find all services in the "travel" category.
-	 */
-	@Test
-	public void findService() 
-	{
-		try {
-			Registry registry = RegistryFactory.getRegistry();
-			Collection<String> services = registry.findServices(CATEGORY);
-			for (Iterator i=services.iterator();i.hasNext();) {
-				String serviceName = (String) i.next();
-				logger.log(Level.INFO, "Found service: " + serviceName);
-				assertEquals(SERVICE_NAME, serviceName);
-			}
-		} catch (RegistryException re) {
-			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
-			assertTrue(false);
-		}
-	}
-	/**
-	 * Find the EPRs for this service.
-	 */
-	@Test
-	public void findEPRs() 
-	{
-		try {
-			Registry registry = RegistryFactory.getRegistry();
-			Collection<EPR> eprs = registry.findEPRs(CATEGORY, SERVICE_NAME);
-			for (Iterator i=eprs.iterator();i.hasNext();) {
-				EPR epr = (EPR) i.next();
-				logger.log(Level.INFO, "Found epr: " + epr);
-			}
-		} catch (RegistryException re) {
-			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
-			assertTrue(false);
-		}
-	}
-	@Test
-	public void unregisterEPR() 
-	{
-		try {
-			Registry registry = RegistryFactory.getRegistry();
-			EPR eprToBeRemoved = new EPR();
-			registry.unRegisterEPR(CATEGORY, SERVICE_NAME, eprToBeRemoved);
-//			Now make sure this EPR is really gone
-			Collection<EPR> eprs = registry.findEPRs(CATEGORY, SERVICE_NAME);
-			logger.log(Level.INFO, "Number of Bindings left should be 0, and is: " + eprs.size());
-			assertEquals(eprs.size(),0);
-		} catch (Exception re) {
-			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
-			assertTrue(false);
-		}
-	}
-	@Test
-	public void unregisterService() 
-	{
-		try {
-			Registry registry = RegistryFactory.getRegistry();
-			registry.unRegisterService(CATEGORY, SERVICE_NAME);
-			registry.unRegisterService(null, SERVICE_NAME);
-			//Make sure it's really gone
-			Collection<String> services = registry.findAllServices();
-			logger.log(Level.INFO, "Number of Services left should be 0, and is: " + services.size());
-			assertEquals(services.size(),0);
-		} catch (Exception re) {
-			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
-			assertTrue(false);
-		}
-	}
-	/**
-	 * Setup the database.
-	 * @throws Exception
-	 */
-	@BeforeClass
-	public static void runBeforeAllTests() {
-		try {
-			TestEnvironmentUtil.setESBPropertiesFileToUse();
-			//Set the juddi properties file in System so juddi will pick it up later and use the test values.
-			String juddiPropertiesFile = "/org/jboss/soa/esb/services/registry/juddi-unittest.properties";
-			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
-			//Read this properties file to get the db connection string
-			Properties props = new Properties();
-			InputStream inStream = Class.class.getResourceAsStream(juddiPropertiesFile);
-			props.load(inStream);
-			mDbDriver    = props.getProperty("juddi.jdbcDriver");
-			mDbUrl       = props.getProperty("juddi.jdbcUrl");
-			mDbUsername  = props.getProperty("juddi.jdbcUsername");
-			mDbPassword  = props.getProperty("juddi.jdbcPassword");
-			
-			String database="not tested yet";
-			if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
-				database = "hsqldb";
-				//Bring up hsql on default port 9001
-				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir() + "build/hsqltestdb", "juddi");
-			} else if ("com.mysql.jdbc.Driver".equals(mDbDriver)) {
-				database = "mysql";
-			} //add and test your own database..
-			
-			//Get the registry-schema create scripts
-			String sqlDir = TestEnvironmentUtil.getUserDir() + "install/jUDDI-registry/sql/" + database + "/";
-			//Drop what is there now, if exists. We want to start fresh.
-			String sqlDropCmd      = FileUtil.readTextFile(new File(sqlDir + "drop_database.sql"));
-			String sqlCreateCmd    = FileUtil.readTextFile(new File(sqlDir + "create_database.sql"));
-			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir + "insert_publishers.sql"));
-			
-			try {
-				Class.forName(mDbDriver);
-			} catch (Exception e) {
-				logger.error("ERROR: failed to load " + database + " JDBC driver.", e);
-				return;
-			}
-			java.sql.Connection con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
-			Statement stmnt = con.createStatement();
-			logger.debug("Dropping the schema if exist");
-			stmnt.execute(sqlDropCmd);
-			logger.debug("Creating the juddi-schema");
-			stmnt.execute(sqlCreateCmd);
-			logger.debug("Adding the jbossesb publisher");
-			stmnt.execute(sqlInsertPubCmd);
-		} catch (Exception e) {
-			logger.error("We should stop testing, since we don't have a db.", e);
-			assertTrue(false);
-		}
-	}
-	/**
-	 * Shutdown the database
-	 * @throws Exception
-	 */
-	@AfterClass
-	public static void runAfterAllTests() throws Exception {
-		if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
-			HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
-		}
-	}
-
-	public static junit.framework.Test suite() {
-		return new JUnit4TestAdapter(RegistryUnitTest.class);
-	}
-
-	}
-	
\ No newline at end of file

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/RegistryUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/RegistryUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/RegistryUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/RegistryUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,229 @@
+/*
+* 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.services.registry;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.File;
+import java.io.InputStream;
+import java.sql.DriverManager;
+import java.sql.Statement;
+import java.util.Collection;
+import java.util.Iterator;
+import java.util.Properties;
+
+import junit.framework.JUnit4TestAdapter;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+import org.jboss.soa.esb.addressing.EPR;
+import org.jboss.soa.esb.testutils.FileUtil;
+import org.jboss.soa.esb.testutils.HsqldbUtil;
+import org.jboss.soa.esb.testutils.TestEnvironmentUtil;
+import org.junit.AfterClass;
+import org.junit.BeforeClass;
+import org.junit.Test;
+/**
+ * Testing the registry.
+ * 
+ * @author kstam
+ *
+ */
+public class RegistryUnitTest
+{
+    private static String mDbDriver;
+	private static String mDbUrl;
+	private static String mDbUsername;
+	private static String mDbPassword;
+	private static final String SERVICE_NAME = "Kurts Travel Agency";
+	private static final String CATEGORY = "travel";
+	
+	private static Logger logger = Logger.getLogger(RegistryUnitTest.class);
+	
+	/**
+	 * Testing the registering of an EPR.
+	 */
+	@Test
+	public void publishEPR() 
+	{
+		EPR epr = new EPR();
+		try {
+			Registry registry = RegistryFactory.getRegistry();
+			registry.registerEPR(CATEGORY, SERVICE_NAME, "Service for traveling", 
+					epr, "Specific Service Binding for traveling");
+		} catch (RegistryException re) {
+			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
+			assertTrue(false);
+		}
+		try {
+			Registry registry = RegistryFactory.getRegistry();
+			registry.registerEPR(null, SERVICE_NAME, null, 
+					epr, null);
+		} catch (RegistryException re) {
+			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
+			assertTrue(false);
+		}
+		//make sure we can handle some null arguments
+		
+	}
+	/**
+	 * This test will try to find all services in the "travel" category.
+	 */
+	@Test
+	public void findService() 
+	{
+		try {
+			Registry registry = RegistryFactory.getRegistry();
+			Collection<String> services = registry.findServices(CATEGORY);
+			for (Iterator i=services.iterator();i.hasNext();) {
+				String serviceName = (String) i.next();
+				logger.log(Level.INFO, "Found service: " + serviceName);
+				assertEquals(SERVICE_NAME, serviceName);
+			}
+		} catch (RegistryException re) {
+			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
+			assertTrue(false);
+		}
+	}
+	/**
+	 * Find the EPRs for this service.
+	 */
+	@Test
+	public void findEPRs() 
+	{
+		try {
+			Registry registry = RegistryFactory.getRegistry();
+			Collection<EPR> eprs = registry.findEPRs(CATEGORY, SERVICE_NAME);
+			for (Iterator i=eprs.iterator();i.hasNext();) {
+				EPR epr = (EPR) i.next();
+				logger.log(Level.INFO, "Found epr: " + epr);
+			}
+		} catch (RegistryException re) {
+			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
+			assertTrue(false);
+		}
+	}
+	@Test
+	public void unregisterEPR() 
+	{
+		try {
+			Registry registry = RegistryFactory.getRegistry();
+			EPR eprToBeRemoved = new EPR();
+			registry.unRegisterEPR(CATEGORY, SERVICE_NAME, eprToBeRemoved);
+//			Now make sure this EPR is really gone
+			Collection<EPR> eprs = registry.findEPRs(CATEGORY, SERVICE_NAME);
+			logger.log(Level.INFO, "Number of Bindings left should be 0, and is: " + eprs.size());
+			assertEquals(eprs.size(),0);
+		} catch (Exception re) {
+			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
+			assertTrue(false);
+		}
+	}
+	@Test
+	public void unregisterService() 
+	{
+		try {
+			Registry registry = RegistryFactory.getRegistry();
+			registry.unRegisterService(CATEGORY, SERVICE_NAME);
+			registry.unRegisterService(null, SERVICE_NAME);
+			//Make sure it's really gone
+			Collection<String> services = registry.findAllServices();
+			logger.log(Level.INFO, "Number of Services left should be 0, and is: " + services.size());
+			assertEquals(services.size(),0);
+		} catch (Exception re) {
+			logger.log(Level.ERROR, re.getLocalizedMessage(), re);
+			assertTrue(false);
+		}
+	}
+	/**
+	 * Setup the database.
+	 * @throws Exception
+	 */
+	@BeforeClass
+	public static void runBeforeAllTests() {
+		try {
+			TestEnvironmentUtil.setESBPropertiesFileToUse();
+			//Set the juddi properties file in System so juddi will pick it up later and use the test values.
+			String juddiPropertiesFile = "/org/jboss/soa/esb/services/registry/juddi-unittest.properties";
+			System.setProperty("juddi.propertiesFile", juddiPropertiesFile);
+			//Read this properties file to get the db connection string
+			Properties props = new Properties();
+			InputStream inStream = Class.class.getResourceAsStream(juddiPropertiesFile);
+			props.load(inStream);
+			mDbDriver    = props.getProperty("juddi.jdbcDriver");
+			mDbUrl       = props.getProperty("juddi.jdbcUrl");
+			mDbUsername  = props.getProperty("juddi.jdbcUsername");
+			mDbPassword  = props.getProperty("juddi.jdbcPassword");
+			
+			String database="not tested yet";
+			if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
+				database = "hsqldb";
+				//Bring up hsql on default port 9001
+				HsqldbUtil.startHsqldb(TestEnvironmentUtil.getUserDir() + "build/hsqltestdb", "juddi");
+			} else if ("com.mysql.jdbc.Driver".equals(mDbDriver)) {
+				database = "mysql";
+			} //add and test your own database..
+			
+			//Get the registry-schema create scripts
+			String sqlDir = TestEnvironmentUtil.getUserDir() + "install/jUDDI-registry/sql/" + database + "/";
+			//Drop what is there now, if exists. We want to start fresh.
+			String sqlDropCmd      = FileUtil.readTextFile(new File(sqlDir + "drop_database.sql"));
+			String sqlCreateCmd    = FileUtil.readTextFile(new File(sqlDir + "create_database.sql"));
+			String sqlInsertPubCmd = FileUtil.readTextFile(new File(sqlDir + "insert_publishers.sql"));
+			
+			try {
+				Class.forName(mDbDriver);
+			} catch (Exception e) {
+				logger.error("ERROR: failed to load " + database + " JDBC driver.", e);
+				return;
+			}
+			java.sql.Connection con = DriverManager.getConnection(mDbUrl, mDbUsername, mDbPassword);
+			Statement stmnt = con.createStatement();
+			logger.debug("Dropping the schema if exist");
+			stmnt.execute(sqlDropCmd);
+			logger.debug("Creating the juddi-schema");
+			stmnt.execute(sqlCreateCmd);
+			logger.debug("Adding the jbossesb publisher");
+			stmnt.execute(sqlInsertPubCmd);
+		} catch (Exception e) {
+			logger.error("We should stop testing, since we don't have a db.", e);
+			assertTrue(false);
+		}
+	}
+	/**
+	 * Shutdown the database
+	 * @throws Exception
+	 */
+	@AfterClass
+	public static void runAfterAllTests() throws Exception {
+		if ("org.hsqldb.jdbcDriver".equals(mDbDriver)) {
+			HsqldbUtil.stopHsqldb(mDbUrl, mDbUsername, mDbPassword);
+		}
+	}
+
+	public static junit.framework.Test suite() {
+		return new JUnit4TestAdapter(RegistryUnitTest.class);
+	}
+
+	}
+	
\ No newline at end of file

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/juddi-unittest.properties
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/juddi-unittest.properties	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/juddi-unittest.properties	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,75 +0,0 @@
-# jUDDI Registry Properties (used by RegistryServer)
-# see http://www.juddi.org for more information
-
-# The UDDI Operator Name
-juddi.operatorName = jUDDI.org
-
-# The i18n locale default codes
-juddi.i18n.languageCode = en
-juddi.i18n.countryCode = US
-
-# The UDDI DiscoveryURL Prefix
-juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
-
-# The UDDI Operator Contact Email Address
-juddi.operatorEmailAddress = admin at juddi.org
-
-# The maximum name size and maximum number
-# of name elements allows in several of the
-# FindXxxx and SaveXxxx UDDI functions.
-juddi.maxNameLength=255
-juddi.maxNameElementsAllowed=5
-
-# The maximum number of UDDI artifacts allowed
-# per publisher. A value of '-1' indicates any 
-# number of artifacts is valid (These values can be
-# overridden at the individual publisher level).
-juddi.maxBusinessesPerPublisher=25
-juddi.maxServicesPerBusiness=20
-juddi.maxBindingsPerService=10
-juddi.maxTModelsPerPublisher=100
-
-# jUDDI Authentication module to use
-juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
-
-# jUDDI DataStore module currently to use
-juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
-
-# use a dataSource (if set to false a direct 
-# jdbc connection will be used.
-juddi.isUseDataSource=false
-juddi.jdbcDriver=org.hsqldb.jdbcDriver
-juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost/juddi
-juddi.jdbcUsername=sa
-juddi.jdbcPassword=
-#For Mysql use:
-#juddi.jdbcDriver=com.mysql.jdbc.Driver
-#juddi.jdbcUrl=jdbc:mysql://localhost/juddi?allowMultiQueries=true
-#juddi.jdbcUsername=root
-#juddi.jdbcPassword=
-
-# jUDDI DataSource to use
-juddi.dataSource=java:comp/env/jdbc/juddiDB
-
-# jUDDI UUIDGen implementation to use
-juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
-
-# jUDDI Cryptor implementation to use
-juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
- 
-# jUDDI Validator to use
-juddi.validator=org.apache.juddi.validator.DefaultValidator
-
-# jUDDI Proxy Properties (used by RegistryProxy)
-juddi.proxy.adminURL = http://localhost:8080/juddi/admin
-juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
-juddi.proxy.publishURL = http://localhost:8080/juddi/publish
-juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
-juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
-juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
-
-# JNDI settings (used by RMITransport)
-java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
-java.naming.provider.url=jnp://localhost:1099
-java.naming.factory.url.pkgs=org.jboss.naming
-  

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/juddi-unittest.properties (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/juddi-unittest.properties)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/juddi-unittest.properties	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/services/registry/juddi-unittest.properties	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,75 @@
+# jUDDI Registry Properties (used by RegistryServer)
+# see http://www.juddi.org for more information
+
+# The UDDI Operator Name
+juddi.operatorName = jUDDI.org
+
+# The i18n locale default codes
+juddi.i18n.languageCode = en
+juddi.i18n.countryCode = US
+
+# The UDDI DiscoveryURL Prefix
+juddi.discoveryURL = http://localhost:8080/juddi/uddiget.jsp?
+
+# The UDDI Operator Contact Email Address
+juddi.operatorEmailAddress = admin at juddi.org
+
+# The maximum name size and maximum number
+# of name elements allows in several of the
+# FindXxxx and SaveXxxx UDDI functions.
+juddi.maxNameLength=255
+juddi.maxNameElementsAllowed=5
+
+# The maximum number of UDDI artifacts allowed
+# per publisher. A value of '-1' indicates any 
+# number of artifacts is valid (These values can be
+# overridden at the individual publisher level).
+juddi.maxBusinessesPerPublisher=25
+juddi.maxServicesPerBusiness=20
+juddi.maxBindingsPerService=10
+juddi.maxTModelsPerPublisher=100
+
+# jUDDI Authentication module to use
+juddi.auth = org.apache.juddi.auth.DefaultAuthenticator
+
+# jUDDI DataStore module currently to use
+juddi.dataStore = org.apache.juddi.datastore.jdbc.JDBCDataStore
+
+# use a dataSource (if set to false a direct 
+# jdbc connection will be used.
+juddi.isUseDataSource=false
+juddi.jdbcDriver=org.hsqldb.jdbcDriver
+juddi.jdbcUrl=jdbc:hsqldb:hsql://localhost/juddi
+juddi.jdbcUsername=sa
+juddi.jdbcPassword=
+#For Mysql use:
+#juddi.jdbcDriver=com.mysql.jdbc.Driver
+#juddi.jdbcUrl=jdbc:mysql://localhost/juddi?allowMultiQueries=true
+#juddi.jdbcUsername=root
+#juddi.jdbcPassword=
+
+# jUDDI DataSource to use
+juddi.dataSource=java:comp/env/jdbc/juddiDB
+
+# jUDDI UUIDGen implementation to use
+juddi.uuidgen = org.apache.juddi.uuidgen.DefaultUUIDGen
+
+# jUDDI Cryptor implementation to use
+juddi.cryptor = org.apache.juddi.cryptor.DefaultCryptor
+ 
+# jUDDI Validator to use
+juddi.validator=org.apache.juddi.validator.DefaultValidator
+
+# jUDDI Proxy Properties (used by RegistryProxy)
+juddi.proxy.adminURL = http://localhost:8080/juddi/admin
+juddi.proxy.inquiryURL = http://localhost:8080/juddi/inquiry
+juddi.proxy.publishURL = http://localhost:8080/juddi/publish
+juddi.proxy.transportClass = org.apache.juddi.proxy.AxisTransport
+juddi.proxy.securityProvider = com.sun.net.ssl.internal.ssl.Provider
+juddi.proxy.protocolHandler = com.sun.net.ssl.internal.www.protocol
+
+# JNDI settings (used by RMITransport)
+java.naming.factory.initial=org.jnp.interfaces.NamingContextFactory
+java.naming.provider.url=jnp://localhost:1099
+java.naming.factory.url.pkgs=org.jboss.naming
+  

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,113 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.testutils;
-
-import java.io.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.InputStream;
-
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.assertion.AssertArgument;
-import org.jboss.soa.esb.dom.YADOMUtil;
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.listeners.config.Generator;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.NodeList;
-
-/**
- * Utility class for working with the ESB configuration.
- *
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class ESBConfigUtil {
-
-    private Document listenerConfig;
-    private Document gatewayConfig;
-
-    public ESBConfigUtil(InputStream esbXsdConfig) {
-        AssertArgument.isNotNull(esbXsdConfig, "esbXsdConfig");
-        ByteArrayOutputStream listenerConfigStream = new ByteArrayOutputStream();
-        ByteArrayOutputStream gatewayConfigStream = new ByteArrayOutputStream();
-        Generator generator = null;
-
-        try {
-            generator = new Generator(esbXsdConfig, listenerConfigStream, gatewayConfigStream);
-            generator.generate();
-            listenerConfig = YADOMUtil.parseStream(new ByteArrayInputStream(listenerConfigStream.toByteArray()), false, false);
-            gatewayConfig = YADOMUtil.parseStream(new ByteArrayInputStream(gatewayConfigStream.toByteArray()), false, false);
-        } catch(Exception e) {
-            e.printStackTrace();
-            TestCase.fail(e.getMessage());
-        }
-    }
-
-    public ConfigTree getListenerConfig(String listenerName) {
-        AssertArgument.isNotNull(listenerName, "listenerName");
-        return ConfigTree.fromElement(getListenerConfig(listenerName, listenerConfig));
-    }
-
-    public ConfigTree getGatewayConfig(String gatewayName) {
-        AssertArgument.isNotNull(gatewayName, "gatewayName");
-        return ConfigTree.fromElement(getListenerConfig(gatewayName, gatewayConfig));
-    }
-
-    private Element getListenerConfig(String name, Document config) {
-        NodeList listenerConfigElements = config.getDocumentElement().getElementsByTagName(name);
-
-        if(listenerConfigElements == null || listenerConfigElements.getLength() == 0) {
-            return null;
-        }
-
-        return (Element) listenerConfigElements.item(0);
-    }
-
-    public ConfigTree getActionConfig(String listenerName, String actionName) {
-        AssertArgument.isNotNull(listenerName, "listenerName");
-        AssertArgument.isNotNull(actionName, "actionName");
-
-        Element listener = getListenerConfig(listenerName, listenerConfig);
-        NodeList actions = listener.getElementsByTagName("action");
-
-        if(actions == null || actions.getLength() == 0) {
-            return null;
-        }
-
-        for(int i = 0; i < actions.getLength(); i++) {
-            Element action = (Element) actions.item(i);
-
-            if(actionName.equals(action.getAttribute("action"))) {
-                return ConfigTree.fromElement(action);
-            }
-        }
-        
-        return null;
-    }
-
-
-    public Document getListenerConfig() {
-        return listenerConfig;
-    }
-
-    public Document getGatewayConfig() {
-        return gatewayConfig;
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/ESBConfigUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,113 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.testutils;
+
+import java.io.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.assertion.AssertArgument;
+import org.jboss.soa.esb.dom.YADOMUtil;
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.listeners.config.Generator;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.NodeList;
+
+/**
+ * Utility class for working with the ESB configuration.
+ *
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ESBConfigUtil {
+
+    private Document listenerConfig;
+    private Document gatewayConfig;
+
+    public ESBConfigUtil(InputStream esbXsdConfig) {
+        AssertArgument.isNotNull(esbXsdConfig, "esbXsdConfig");
+        ByteArrayOutputStream listenerConfigStream = new ByteArrayOutputStream();
+        ByteArrayOutputStream gatewayConfigStream = new ByteArrayOutputStream();
+        Generator generator = null;
+
+        try {
+            generator = new Generator(esbXsdConfig, listenerConfigStream, gatewayConfigStream);
+            generator.generate();
+            listenerConfig = YADOMUtil.parseStream(new ByteArrayInputStream(listenerConfigStream.toByteArray()), false, false);
+            gatewayConfig = YADOMUtil.parseStream(new ByteArrayInputStream(gatewayConfigStream.toByteArray()), false, false);
+        } catch(Exception e) {
+            e.printStackTrace();
+            TestCase.fail(e.getMessage());
+        }
+    }
+
+    public ConfigTree getListenerConfig(String listenerName) {
+        AssertArgument.isNotNull(listenerName, "listenerName");
+        return ConfigTree.fromElement(getListenerConfig(listenerName, listenerConfig));
+    }
+
+    public ConfigTree getGatewayConfig(String gatewayName) {
+        AssertArgument.isNotNull(gatewayName, "gatewayName");
+        return ConfigTree.fromElement(getListenerConfig(gatewayName, gatewayConfig));
+    }
+
+    private Element getListenerConfig(String name, Document config) {
+        NodeList listenerConfigElements = config.getDocumentElement().getElementsByTagName(name);
+
+        if(listenerConfigElements == null || listenerConfigElements.getLength() == 0) {
+            return null;
+        }
+
+        return (Element) listenerConfigElements.item(0);
+    }
+
+    public ConfigTree getActionConfig(String listenerName, String actionName) {
+        AssertArgument.isNotNull(listenerName, "listenerName");
+        AssertArgument.isNotNull(actionName, "actionName");
+
+        Element listener = getListenerConfig(listenerName, listenerConfig);
+        NodeList actions = listener.getElementsByTagName("action");
+
+        if(actions == null || actions.getLength() == 0) {
+            return null;
+        }
+
+        for(int i = 0; i < actions.getLength(); i++) {
+            Element action = (Element) actions.item(i);
+
+            if(actionName.equals(action.getAttribute("action"))) {
+                return ConfigTree.fromElement(action);
+            }
+        }
+        
+        return null;
+    }
+
+
+    public Document getListenerConfig() {
+        return listenerConfig;
+    }
+
+    public Document getGatewayConfig() {
+        return gatewayConfig;
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,83 +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.testutils;
-
-import java.io.BufferedReader;
-import java.io.BufferedWriter;
-import java.io.File;
-import java.io.FileReader;
-import java.io.FileWriter;
-import java.io.IOException;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-/**
- * Utility class for reading a file into a String and back.
- * @author kstam
- */
-public class FileUtil {
-    /**
-     * Read the file into a String.
-     * @param file - the file to be read
-     * @return String with the content of the file
-     * @throws IOException - when we can't read the file
-     */
-    public static String readTextFile(File file) throws IOException 
-    {
-        StringBuffer sb = new StringBuffer(1024);
-        BufferedReader reader = new BufferedReader(new FileReader(file.getPath()));
-        char[] chars = new char[1];
-        while( (reader.read(chars)) > -1){
-            sb.append(String.valueOf(chars)); 
-            chars = new char[1];
-        }
-        reader.close();
-        return sb.toString();
-    }
-    /**
-     * 
-     */
-    public static String readStream(InputStream inputStream) throws IOException
-    {
-    	StringBuffer sb = new StringBuffer(1024);
-        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
-        char[] chars = new char[1];
-        while( (reader.read(chars)) > -1){
-            sb.append(String.valueOf(chars)); 
-            chars = new char[1];
-        }
-        reader.close();
-        return sb.toString();
-    }
-    /**
-     * Write a String into a file.
-     * @param file - File to which we write the String
-     * @param str - string which will be written
-     * @throws IOException - when we can't write to the file
-     */
-    public static void writeTextFile(File file, String str) throws IOException 
-    {
-        BufferedWriter writer = new BufferedWriter(new FileWriter(file.getPath()));
-        writer.write(str);
-        writer.close();
-    }
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/FileUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,83 @@
+/*
+* 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.testutils;
+
+import java.io.BufferedReader;
+import java.io.BufferedWriter;
+import java.io.File;
+import java.io.FileReader;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
+/**
+ * Utility class for reading a file into a String and back.
+ * @author kstam
+ */
+public class FileUtil {
+    /**
+     * Read the file into a String.
+     * @param file - the file to be read
+     * @return String with the content of the file
+     * @throws IOException - when we can't read the file
+     */
+    public static String readTextFile(File file) throws IOException 
+    {
+        StringBuffer sb = new StringBuffer(1024);
+        BufferedReader reader = new BufferedReader(new FileReader(file.getPath()));
+        char[] chars = new char[1];
+        while( (reader.read(chars)) > -1){
+            sb.append(String.valueOf(chars)); 
+            chars = new char[1];
+        }
+        reader.close();
+        return sb.toString();
+    }
+    /**
+     * 
+     */
+    public static String readStream(InputStream inputStream) throws IOException
+    {
+    	StringBuffer sb = new StringBuffer(1024);
+        BufferedReader reader = new BufferedReader(new InputStreamReader(inputStream));
+        char[] chars = new char[1];
+        while( (reader.read(chars)) > -1){
+            sb.append(String.valueOf(chars)); 
+            chars = new char[1];
+        }
+        reader.close();
+        return sb.toString();
+    }
+    /**
+     * Write a String into a file.
+     * @param file - File to which we write the String
+     * @param str - string which will be written
+     * @throws IOException - when we can't write to the file
+     */
+    public static void writeTextFile(File file, String str) throws IOException 
+    {
+        BufferedWriter writer = new BufferedWriter(new FileWriter(file.getPath()));
+        writer.write(str);
+        writer.close();
+    }
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/HsqldbUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/HsqldbUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/HsqldbUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,69 +0,0 @@
-package org.jboss.soa.esb.testutils;
-
-import java.io.PrintWriter;
-import java.sql.DriverManager;
-import java.sql.Statement;
-
-import org.apache.log4j.Logger;
-import org.hsqldb.Server;
-/**
- * Utility to start and stop a hsql Database.
- * 
- * @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
- *
- */
-public class HsqldbUtil 
-{
-	private static Logger log = Logger.getLogger( HsqldbUtil.class );
-	
-	final private static String THREAD_NAME = "hypersonic-unittest";
-	/**
-	 * Starts the hsql database in it's own thread. 
-	 * Don't forget to shut it down when you're done.
-	 * 
-	 * @param databaseFile - i.e. build/hsqltestdb
-	 * @param databaseName - i.e. jbossesb
-	 * @throws Exception
-	 */
-	public static void startHsqldb(final String databaseFile,
-			final String databaseName) throws Exception 
-	{
-		// Start DB in new thread, or else it will block us
-		Thread serverThread = new Thread(THREAD_NAME) {
-			public void run() {
-				try {
-					// Start server
-					Server server = new Server();
-					Logger targetLogger = Logger.getLogger( "org.hsqldb" );
-					server.setLogWriter( new PrintWriter( 
-							new StdOut2Log4jFilter( server.getLogWriter(), log, targetLogger.getEffectiveLevel() )) );
-					server.setDatabasePath( 0, databaseFile );
-					server.setDatabaseName( 0, databaseName );
-					server.setNoSystemExit( true );
-					server.setSilent( true );
-					server.start();
-				} catch (Exception e) {
-					log.error( e );
-				}
-				//log.error("Failed to start database", e);
-			}
-		};
-		serverThread.run();
-	}
-	/**
-	 * 
-	 * @param url
-	 * @param username
-	 * @param password
-	 * @throws Exception
-	 */
-	public static void stopHsqldb(String url, String username, String password) throws Exception {
-		java.sql.Connection connection = DriverManager.getConnection(
-				url, username, password);
-		Statement statement = connection.createStatement();
-		String shutdownCommand = "SHUTDOWN COMPACT";
-		statement.executeQuery(shutdownCommand);
-	}
-
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/HsqldbUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/HsqldbUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/HsqldbUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/HsqldbUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,69 @@
+package org.jboss.soa.esb.testutils;
+
+import java.io.PrintWriter;
+import java.sql.DriverManager;
+import java.sql.Statement;
+
+import org.apache.log4j.Logger;
+import org.hsqldb.Server;
+/**
+ * Utility to start and stop a hsql Database.
+ * 
+ * @author <a href="mailto:kurt.stam at jboss.com">Kurt Stam</a>
+ *
+ */
+public class HsqldbUtil 
+{
+	private static Logger log = Logger.getLogger( HsqldbUtil.class );
+	
+	final private static String THREAD_NAME = "hypersonic-unittest";
+	/**
+	 * Starts the hsql database in it's own thread. 
+	 * Don't forget to shut it down when you're done.
+	 * 
+	 * @param databaseFile - i.e. build/hsqltestdb
+	 * @param databaseName - i.e. jbossesb
+	 * @throws Exception
+	 */
+	public static void startHsqldb(final String databaseFile,
+			final String databaseName) throws Exception 
+	{
+		// Start DB in new thread, or else it will block us
+		Thread serverThread = new Thread(THREAD_NAME) {
+			public void run() {
+				try {
+					// Start server
+					Server server = new Server();
+					Logger targetLogger = Logger.getLogger( "org.hsqldb" );
+					server.setLogWriter( new PrintWriter( 
+							new StdOut2Log4jFilter( server.getLogWriter(), log, targetLogger.getEffectiveLevel() )) );
+					server.setDatabasePath( 0, databaseFile );
+					server.setDatabaseName( 0, databaseName );
+					server.setNoSystemExit( true );
+					server.setSilent( true );
+					server.start();
+				} catch (Exception e) {
+					log.error( e );
+				}
+				//log.error("Failed to start database", e);
+			}
+		};
+		serverThread.run();
+	}
+	/**
+	 * 
+	 * @param url
+	 * @param username
+	 * @param password
+	 * @throws Exception
+	 */
+	public static void stopHsqldb(String url, String username, String password) throws Exception {
+		java.sql.Connection connection = DriverManager.getConnection(
+				url, username, password);
+		Statement statement = connection.createStatement();
+		String shutdownCommand = "SHUTDOWN COMPACT";
+		statement.executeQuery(shutdownCommand);
+	}
+
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StdOut2Log4jFilter.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StdOut2Log4jFilter.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StdOut2Log4jFilter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,143 +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.testutils;
-
-import java.io.FilterWriter;
-import java.io.IOException;
-import java.io.Writer;
-
-import org.apache.log4j.Level;
-import org.apache.log4j.Logger;
-
-/**
- * 
- * @author Daniel Bevenius				
- *
- */
-public class StdOut2Log4jFilter extends FilterWriter
-{
-	/**
-	 * log4j logger to log to
-	 */
-    protected Logger logger; 
-    /**
-     * Level to filter at
-     */
-    protected Level  level; 
-    /**
-     * string "buffer"
-     */
-    protected StringBuilder sb = new StringBuilder(); 
-    /**
-     * Carrage Return
-     */
-    private static final char CR = '\r';
-    /**
-     * Line Feed
-     */
-    private static final char LF = '\n';
-    
-    public StdOut2Log4jFilter( Writer writer )
-    {
-    	super( writer );
-    }
-
-    public StdOut2Log4jFilter( Writer writer, Logger logger, Level level )
-    { 
-		this( writer );
-		
-        this.logger = logger;
-        this.level = level;
-    } 
-
-    public synchronized void write(int c) throws IOException 
-    { 
-        sb.append(c); 
-    } 
-
-    public synchronized void  write(char[] cbuf, int off, int len) throws IOException 
-    { 
-        sb.append( cbuf, off, len ); 
-    } 
-
-    public synchronized void  write(String str, int off, int len) throws IOException 
-    { 
-        sb.append( str.substring( off, off+len )); 
-    } 
-
-    public synchronized void flush() throws IOException 
-    { 
-        log(); 
-    } 
-
-    public synchronized void close() throws IOException 
-    { 
-        if ( sb.length() != 0) 
-        	log(); 
-    } 
-
-    protected void finalize() throws Throwable 
-    { 
-        if ( sb.length() != 0) 
-        { 
-        	log(); 
-    	} 
-        super.finalize(); 
-    } 
-
-    protected void log() 
-    { 
-        stripExtraNewLine();
-        logger.log(level, sb); 
-        sb.delete(0,sb.length()); 
-    } 
-   
-    protected final void stripExtraNewLine() 
-    { 
-        int length = sb.length(); 
-        
-        if ( length == 0 )
-        	return;
-        
-        if ( length == 1 )
-        {
-            char last = sb.charAt(0); 
-            if ( last == CR || last == LF )
-                sb.deleteCharAt(0); 
-        }
-        else
-        {
-        	int lastPosition = length-1;
-        	char secondLast = sb.charAt( lastPosition ); 
-            if ( secondLast == CR ) 
-                sb.deleteCharAt( lastPosition ); 
-            else if ( secondLast == LF ) 
-            { 
-	        	int secondlastPosition = length-2;
-                sb.deleteCharAt( lastPosition ); 
-                if (sb.charAt( secondlastPosition ) == CR ) 
-                    sb.deleteCharAt( secondlastPosition ); 
-            } 
-        }
-    } 
-}
-

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StdOut2Log4jFilter.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StdOut2Log4jFilter.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StdOut2Log4jFilter.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StdOut2Log4jFilter.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,143 @@
+/*
+ * 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.testutils;
+
+import java.io.FilterWriter;
+import java.io.IOException;
+import java.io.Writer;
+
+import org.apache.log4j.Level;
+import org.apache.log4j.Logger;
+
+/**
+ * 
+ * @author Daniel Bevenius				
+ *
+ */
+public class StdOut2Log4jFilter extends FilterWriter
+{
+	/**
+	 * log4j logger to log to
+	 */
+    protected Logger logger; 
+    /**
+     * Level to filter at
+     */
+    protected Level  level; 
+    /**
+     * string "buffer"
+     */
+    protected StringBuilder sb = new StringBuilder(); 
+    /**
+     * Carrage Return
+     */
+    private static final char CR = '\r';
+    /**
+     * Line Feed
+     */
+    private static final char LF = '\n';
+    
+    public StdOut2Log4jFilter( Writer writer )
+    {
+    	super( writer );
+    }
+
+    public StdOut2Log4jFilter( Writer writer, Logger logger, Level level )
+    { 
+		this( writer );
+		
+        this.logger = logger;
+        this.level = level;
+    } 
+
+    public synchronized void write(int c) throws IOException 
+    { 
+        sb.append(c); 
+    } 
+
+    public synchronized void  write(char[] cbuf, int off, int len) throws IOException 
+    { 
+        sb.append( cbuf, off, len ); 
+    } 
+
+    public synchronized void  write(String str, int off, int len) throws IOException 
+    { 
+        sb.append( str.substring( off, off+len )); 
+    } 
+
+    public synchronized void flush() throws IOException 
+    { 
+        log(); 
+    } 
+
+    public synchronized void close() throws IOException 
+    { 
+        if ( sb.length() != 0) 
+        	log(); 
+    } 
+
+    protected void finalize() throws Throwable 
+    { 
+        if ( sb.length() != 0) 
+        { 
+        	log(); 
+    	} 
+        super.finalize(); 
+    } 
+
+    protected void log() 
+    { 
+        stripExtraNewLine();
+        logger.log(level, sb); 
+        sb.delete(0,sb.length()); 
+    } 
+   
+    protected final void stripExtraNewLine() 
+    { 
+        int length = sb.length(); 
+        
+        if ( length == 0 )
+        	return;
+        
+        if ( length == 1 )
+        {
+            char last = sb.charAt(0); 
+            if ( last == CR || last == LF )
+                sb.deleteCharAt(0); 
+        }
+        else
+        {
+        	int lastPosition = length-1;
+        	char secondLast = sb.charAt( lastPosition ); 
+            if ( secondLast == CR ) 
+                sb.deleteCharAt( lastPosition ); 
+            else if ( secondLast == LF ) 
+            { 
+	        	int secondlastPosition = length-2;
+                sb.deleteCharAt( lastPosition ); 
+                if (sb.charAt( secondlastPosition ) == CR ) 
+                    sb.deleteCharAt( secondlastPosition ); 
+            } 
+        }
+    } 
+}
+

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StringUtils.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StringUtils.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StringUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,70 +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.testutils;
-
-/**
- * Utility methods for string manipulation and testing.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class StringUtils {
-
-	/**
-	 * Compare the supplied strings, ignoring line break characters.
-	 * @param string1 The 1st string.
-	 * @param string2 The 2nd string.
-	 * @param ignorecase True if a case insensitive comparison is to
-	 * be performed, otherwise false. 
-	 * @return True if the strings are equal, otherwise false.
-	 */
-	public static boolean equalsIgnoreLinebreaks(String string1, String string2, boolean ignorecase) {
-		string1 = removeChar(string1, '\r');
-		string1 = removeChar(string1, '\n');
-		string2 = removeChar(string2, '\r');
-		string2 = removeChar(string2, '\n');
-
-		if(ignorecase) {
-			return string1.equalsIgnoreCase(string2);
-		} else {
-			return string1.equals(string2);
-		}
-	}
-	
-	/**
-	 * Delete all instances of the specified character from the supplied string.
-	 * @param string The string to be opperated on.
-	 * @param character The character to be removed.
-	 */
-	public static String removeChar(String string, char character) {
-		StringBuffer stringBuf = new StringBuffer(string);
-		int index = 0;
-		
-		while(index < stringBuf.length()) {
-			if(stringBuf.charAt(index) == character) {
-				stringBuf.deleteCharAt(index);
-			} else {
-				index++;
-			}
-		}
-		
-		return stringBuf.toString();
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StringUtils.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StringUtils.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StringUtils.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/StringUtils.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,70 @@
+/*
+ * 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.testutils;
+
+/**
+ * Utility methods for string manipulation and testing.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class StringUtils {
+
+	/**
+	 * Compare the supplied strings, ignoring line break characters.
+	 * @param string1 The 1st string.
+	 * @param string2 The 2nd string.
+	 * @param ignorecase True if a case insensitive comparison is to
+	 * be performed, otherwise false. 
+	 * @return True if the strings are equal, otherwise false.
+	 */
+	public static boolean equalsIgnoreLinebreaks(String string1, String string2, boolean ignorecase) {
+		string1 = removeChar(string1, '\r');
+		string1 = removeChar(string1, '\n');
+		string2 = removeChar(string2, '\r');
+		string2 = removeChar(string2, '\n');
+
+		if(ignorecase) {
+			return string1.equalsIgnoreCase(string2);
+		} else {
+			return string1.equals(string2);
+		}
+	}
+	
+	/**
+	 * Delete all instances of the specified character from the supplied string.
+	 * @param string The string to be opperated on.
+	 * @param character The character to be removed.
+	 */
+	public static String removeChar(String string, char character) {
+		StringBuffer stringBuf = new StringBuffer(string);
+		int index = 0;
+		
+		while(index < stringBuf.length()) {
+			if(stringBuf.charAt(index) == character) {
+				stringBuf.deleteCharAt(index);
+			} else {
+				index++;
+			}
+		}
+		
+		return stringBuf.toString();
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,116 +0,0 @@
-package org.jboss.soa.esb.testutils;
-
-import java.io.BufferedReader;
-import java.io.File;
-import java.io.FileReader;
-import java.io.IOException;
-
-import org.apache.log4j.Logger;
-
-public class TestEnvironmentUtil 
-{
-	private static Logger log = Logger.getLogger(TestEnvironmentUtil.class);
-	
-	public static String getUserDir()
-	{
-		return getUserDir("product");
-	}
-	
-	public static String getBaseDir()
-	{
-		return System.getProperty("user.dir");
-	}
-	
-	/**
-	 * When performing file system interaction, the user.dir may differ (i.e. running the
-	 * tests from within eclipse).
-	 */
-	public static String getUserDir(String dir)
-	{
-		String userDir="";
-		String baseDir = System.getProperty("user.dir");
-		log.debug(baseDir);
-		if (!baseDir.endsWith(dir)) {
-			userDir = dir + "/";
-		}
-		return userDir;
-	}
-	
-	/**
-	 * When performing file system interaction, the user.dir may differ (i.e. running the
-	 * tests from within eclipse).
-	 */
-	public static String getUserDir(String eclipseDir, String antDir)
-	{
-		String userDir="";
-		String baseDir = System.getProperty("user.dir");
-		log.debug(baseDir);
-		if (!baseDir.endsWith(eclipseDir)) {
-			if (baseDir.endsWith("qa")) {
-				userDir = antDir + "/";
-			} else {
-				userDir = eclipseDir + "/";
-			}
-		} else {
-			userDir = antDir;
-		}
-		log.debug(userDir);
-		return userDir;
-	}
-	
-	public static void setESBPropertiesFileToUse()
-	{
-		//Set the jbossesb properties file in System, so we can pick up the one for testing
-		String jbossesbPropertiesFile = getUserDir() + "/etc/test/resources/jbossesb-unittest-properties.xml";
-		System.setProperty("org.jboss.soa.esb.propertyFile", jbossesbPropertiesFile);
-	}
-	/**
-	 * Sets the jbossesb-properties.xml to use for test
-	 */
-	public static void setESBPropertiesFileToUse(String dir)
-	{
-		//Set the jbossesb properties file in System, so we can pick up the one for testing
-		String jbossesbPropertiesFile = getUserDir(dir) + "/etc/test/resources/jbossesb-unittest-properties.xml";
-		System.setProperty("org.jboss.soa.esb.propertyFile", jbossesbPropertiesFile);
-	}
-	
-	/**
-	 * Sets the jbossesb-properties.xml to use for test
-	 */
-	public static void setESBPropertiesFileToUse(String eclipseDir, String antDir)
-	{
-		//Set the jbossesb properties file in System, so we can pick up the one for testing
-		String jbossesbPropertiesFile = getUserDir(eclipseDir, antDir) + "/etc/test/resources/jbossesb-unittest-properties.xml";
-		System.setProperty("org.jboss.soa.esb.propertyFile", jbossesbPropertiesFile);
-	}
-	
-	public static String readTextFile(File file) throws IOException 
-    {
-        StringBuffer sb = new StringBuffer(1024);
-        BufferedReader reader = new BufferedReader(new FileReader(file.getPath()));
-        char[] chars = new char[1];
-        while( (reader.read(chars)) > -1){
-            sb.append(String.valueOf(chars)); 
-            chars = new char[1];
-        }
-        reader.close();
-        return sb.toString();
-    }
-    
-    public static File findResourceDirectory(String dirPath)
-    {
-        String[] dirs = dirPath.split("/");
-        for (int i=1; i<dirs.length; i++) {
-            dirPath = ".";
-            for (int j=i; j<dirs.length; j++) {
-                dirPath += "/" + dirs[j];
-            }
-            File dir = new File(dirPath);
-            if (dir.exists()) {
-                return dir;
-            }
-        }
-        return null;
-    }
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/TestEnvironmentUtil.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,116 @@
+package org.jboss.soa.esb.testutils;
+
+import java.io.BufferedReader;
+import java.io.File;
+import java.io.FileReader;
+import java.io.IOException;
+
+import org.apache.log4j.Logger;
+
+public class TestEnvironmentUtil 
+{
+	private static Logger log = Logger.getLogger(TestEnvironmentUtil.class);
+	
+	public static String getUserDir()
+	{
+		return getUserDir("product");
+	}
+	
+	public static String getBaseDir()
+	{
+		return System.getProperty("user.dir");
+	}
+	
+	/**
+	 * When performing file system interaction, the user.dir may differ (i.e. running the
+	 * tests from within eclipse).
+	 */
+	public static String getUserDir(String dir)
+	{
+		String userDir="";
+		String baseDir = System.getProperty("user.dir");
+		log.debug(baseDir);
+		if (!baseDir.endsWith(dir)) {
+			userDir = dir + "/";
+		}
+		return userDir;
+	}
+	
+	/**
+	 * When performing file system interaction, the user.dir may differ (i.e. running the
+	 * tests from within eclipse).
+	 */
+	public static String getUserDir(String eclipseDir, String antDir)
+	{
+		String userDir="";
+		String baseDir = System.getProperty("user.dir");
+		log.debug(baseDir);
+		if (!baseDir.endsWith(eclipseDir)) {
+			if (baseDir.endsWith("qa")) {
+				userDir = antDir + "/";
+			} else {
+				userDir = eclipseDir + "/";
+			}
+		} else {
+			userDir = antDir;
+		}
+		log.debug(userDir);
+		return userDir;
+	}
+	
+	public static void setESBPropertiesFileToUse()
+	{
+		//Set the jbossesb properties file in System, so we can pick up the one for testing
+		String jbossesbPropertiesFile = getUserDir() + "/etc/test/resources/jbossesb-unittest-properties.xml";
+		System.setProperty("org.jboss.soa.esb.propertyFile", jbossesbPropertiesFile);
+	}
+	/**
+	 * Sets the jbossesb-properties.xml to use for test
+	 */
+	public static void setESBPropertiesFileToUse(String dir)
+	{
+		//Set the jbossesb properties file in System, so we can pick up the one for testing
+		String jbossesbPropertiesFile = getUserDir(dir) + "/etc/test/resources/jbossesb-unittest-properties.xml";
+		System.setProperty("org.jboss.soa.esb.propertyFile", jbossesbPropertiesFile);
+	}
+	
+	/**
+	 * Sets the jbossesb-properties.xml to use for test
+	 */
+	public static void setESBPropertiesFileToUse(String eclipseDir, String antDir)
+	{
+		//Set the jbossesb properties file in System, so we can pick up the one for testing
+		String jbossesbPropertiesFile = getUserDir(eclipseDir, antDir) + "/etc/test/resources/jbossesb-unittest-properties.xml";
+		System.setProperty("org.jboss.soa.esb.propertyFile", jbossesbPropertiesFile);
+	}
+	
+	public static String readTextFile(File file) throws IOException 
+    {
+        StringBuffer sb = new StringBuffer(1024);
+        BufferedReader reader = new BufferedReader(new FileReader(file.getPath()));
+        char[] chars = new char[1];
+        while( (reader.read(chars)) > -1){
+            sb.append(String.valueOf(chars)); 
+            chars = new char[1];
+        }
+        reader.close();
+        return sb.toString();
+    }
+    
+    public static File findResourceDirectory(String dirPath)
+    {
+        String[] dirs = dirPath.split("/");
+        for (int i=1; i<dirs.length; i++) {
+            dirPath = ".";
+            for (int j=i; j<dirs.length; j++) {
+                dirPath += "/" + dirs[j];
+            }
+            File dir = new File(dirPath);
+            if (dir.exists()) {
+                return dir;
+            }
+        }
+        return null;
+    }
+	
+}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,22 +0,0 @@
-package org.jboss.soa.esb.testutils.test;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.ConfigurationException;
-import org.jboss.soa.esb.testutils.ESBConfigUtil;
-
-/**
- * @author
- */
-public class ESBConfigUtilUnitTest extends TestCase {
-
-    public void test() throws ConfigurationException {
-        ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream("jboss-esb.xml"));
-
-        assertTrue(configUtil.getListenerConfig("JMS-ESBListener").toString().startsWith("<JMS-ESBListener listenerClass=\"org.jboss.soa.esb.listeners.message.MessageAwareListener\" maxThreads=\"1\" service-category=\"ABI_OrderManager\" service-description=\"ABI OrderManager Service\" service-name=\"ABI_OrderManager\">"));
-        assertTrue(configUtil.getGatewayConfig("FileGateway").toString().startsWith("<FileGateway"));
-        assertTrue(configUtil.getActionConfig("OrderNotificationService", "print-after-transform").toString().startsWith("<action action=\"print-after-transform\""));
-    }
-
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/ESBConfigUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,22 @@
+package org.jboss.soa.esb.testutils.test;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.ConfigurationException;
+import org.jboss.soa.esb.testutils.ESBConfigUtil;
+
+/**
+ * @author
+ */
+public class ESBConfigUtilUnitTest extends TestCase {
+
+    public void test() throws ConfigurationException {
+        ESBConfigUtil configUtil = new ESBConfigUtil(getClass().getResourceAsStream("jboss-esb.xml"));
+
+        assertTrue(configUtil.getListenerConfig("JMS-ESBListener").toString().startsWith("<JMS-ESBListener listenerClass=\"org.jboss.soa.esb.listeners.message.MessageAwareListener\" maxThreads=\"1\" service-category=\"ABI_OrderManager\" service-description=\"ABI OrderManager Service\" service-name=\"ABI_OrderManager\">"));
+        assertTrue(configUtil.getGatewayConfig("FileGateway").toString().startsWith("<FileGateway"));
+        assertTrue(configUtil.getActionConfig("OrderNotificationService", "print-after-transform").toString().startsWith("<action action=\"print-after-transform\""));
+    }
+
+
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/jboss-esb.xml
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/jboss-esb.xml	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/jboss-esb.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,142 +0,0 @@
-<?xml version = "1.0" encoding = "UTF-8"?>
-<jbossesb
-        xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
-        parameterReloadSecs="5">
-
-    <providers>
-        <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
-                      jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
-                      jndi-URL="localhost">
-
-            <jms-bus busid="OrderManagerGateway">
-                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_bpel_gw"/>
-            </jms-bus>
-            <jms-bus busid="OrderManagerService">
-                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_bpel_esb"
-                                    selector="service='ordermanager'"/>
-            </jms-bus>
-            <jms-bus busid="ShipperService">
-                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_bpel_esb"
-                                    selector="service='shipper'"/>
-            </jms-bus>
-            <jms-bus busid="OrderNotificationService">
-                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_bpel_esb"
-                                    selector="service='orderNotifier'"/>
-            </jms-bus>
-        </jms-provider>
-
-        <jbr-provider name="JBR-Http-1" protocol="http" host="localhost">
-            <jbr-bus busid="Http-1" port="8865"/>
-        </jbr-provider>
-
-        <jbr-provider name="JBR-Http-2" protocol="http" host="localhost">
-            <jbr-bus busid="Http-2" port="8866"/>
-        </jbr-provider>
-
-        <jbr-provider name="JBR-Socket" protocol="socket" host="localhost">
-            <jbr-bus busid="Socket-1" port="8988"/>
-        </jbr-provider>
-
-        <fs-provider name="File Sys Provider">
-            <fs-bus busid="notificationChannel">
-                <fs-message-filter
-                        directory="/ae-demo/orders"
-                        input-suffix=".in.csv"
-                        work-suffix=".esbWorking"
-                        post-delete="false"
-                        post-directory="/ae-demo/orders"
-                        post-suffix=".done.csv"
-                        error-delete="false"
-                        error-directory="/ae-demo/orders"
-                        error-suffix=".IN_ERROR.csv"
-                        />
-            </fs-bus>
-        </fs-provider>
-
-    </providers>
-
-    <services>
-
-        <service category="ABI_OrderManager" name="ABI_OrderManager" description="ABI OrderManager Service">
-
-            <listeners>
-                <jms-listener name="JMS-Gateway" busidref="OrderManagerGateway" is-gateway="true" maxThreads="1"/>
-                <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true" maxThreads="1"/>
-                <jbr-listener name="Socket-Gateway" busidref="Socket-1" is-gateway="true" maxThreads="1"/>
-
-                <jms-listener name="JMS-ESBListener" busidref="OrderManagerService" maxThreads="1"/>
-            </listeners>
-            <actions>
-                <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
-                    <property name="message"
-                              value="[Quickstart_webservice_bpel] Message before invoking 'ABI_OrderManager' endpoint"/>
-                </action>
-                <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.JBossWSAdapter">
-                    <property name="jbossws-endpoint" value="ABI_OrderManager"/>
-                </action>
-                <action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">
-                    <property name="message"
-                              value="[Quickstart_webservice_bpel] Message after invoking 'ABI_OrderManager' endpoint"/>
-                </action>
-            </actions>
-        </service>
-
-        <service category="ABI_Shipper" name="ABI_Shipper" description="ABI Shipper Service">
-
-            <listeners>
-                <jbr-listener name="Http-Gateway" busidref="Http-2" is-gateway="true" maxThreads="1"/>
-
-                <jms-listener name="JMS-ESBListener" busidref="ShipperService" maxThreads="1"/>
-            </listeners>
-            <actions>
-                <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
-                    <property name="message"
-                              value="[Quickstart_webservice_bpel] Message before invoking 'ABI_Shipping' endpoint"/>
-                </action>
-                <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.JBossWSAdapter">
-                    <property name="jbossws-endpoint" value="ABI_Shipping"/>
-                </action>
-                <action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">
-                    <property name="message"
-                              value="[Quickstart_webservice_bpel] Message after invoking 'ABI_Shipping' endpoint"/>
-                </action>
-            </actions>
-        </service>
-
-        <service category="OrderNotificationService" name="OrderNotificationService"
-                 description="Order Notification Service">
-            <listeners>
-                <fs-listener name="FileGateway" busidref="notificationChannel" is-gateway="true"
-                             poll-frequency-seconds="10"/>
-                <jms-listener name="OrderNotificationService" busidref="OrderNotificationService"/>
-            </listeners>
-            <actions>
-                <!-- Transform the incoming CSV order approval record into a populated
-                     com.activebpel.ordermanagement.SalesOrderNotification instance. -->
-                <action name="message-populator" class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
-                    <property name="from" value="OrderManager"/>
-                    <property name="from-type" value="text/csv:orderApproval"/>
-                    <property name="to" value="RetailerCallback"/>
-                    <property name="to-type" value="text/xml:SendSalesOrderNotification"/>
-                </action>
-                <action name="print-after-transform" class="org.jboss.soa.esb.actions.SystemPrintln">
-                    <property name="message" value="[Quickstart_webservice_bpel] Message after transform and before SOAPClient"/>
-                </action>
-                <!-- Inject the com.activebpel.ordermanagement.SalesOrderNotification instance
-                     into the SOAPClient. SOAPClient will use SOAPUI to construct a soap request
-                     template and will then use OGNL to populate the values (from the Smooks 
-                     EXTRACTED_BEANS_HASH) into the soap message. -->
-                <action name="soapui-client" class="org.jboss.soa.esb.actions.soap.SOAPClient">
-                    <property name="wsdl" value="http://localhost:18080/active-bpel/services/RetailerCallback?wsdl"/>
-                    <property name="operation" value="SendSalesOrderNotification"/>
-                    <property name="paramsLocation" value="EXTRACTED_BEANS_HASH"/>
-                    <property name="responseXStreamConfig">
-                        <alias name="customerOrderAck" class="java.lang.Boolean" />
-                    </property>
-                </action>
-            </actions>
-        </service>
-
-    </services>
-
-</jbossesb>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/jboss-esb.xml (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/jboss-esb.xml)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/jboss-esb.xml	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/testutils/test/jboss-esb.xml	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,142 @@
+<?xml version = "1.0" encoding = "UTF-8"?>
+<jbossesb
+        xmlns="http://anonsvn.labs.jboss.com/labs/jbossesb/trunk/product/etc/schemas/xml/jbossesb-1.0.1.xsd"
+        parameterReloadSecs="5">
+
+    <providers>
+        <jms-provider name="JBossMQ" connection-factory="ConnectionFactory"
+                      jndi-context-factory="org.jnp.interfaces.NamingContextFactory"
+                      jndi-URL="localhost">
+
+            <jms-bus busid="OrderManagerGateway">
+                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_bpel_gw"/>
+            </jms-bus>
+            <jms-bus busid="OrderManagerService">
+                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_bpel_esb"
+                                    selector="service='ordermanager'"/>
+            </jms-bus>
+            <jms-bus busid="ShipperService">
+                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_bpel_esb"
+                                    selector="service='shipper'"/>
+            </jms-bus>
+            <jms-bus busid="OrderNotificationService">
+                <jms-message-filter dest-type="QUEUE" dest-name="queue/quickstart_webservice_bpel_esb"
+                                    selector="service='orderNotifier'"/>
+            </jms-bus>
+        </jms-provider>
+
+        <jbr-provider name="JBR-Http-1" protocol="http" host="localhost">
+            <jbr-bus busid="Http-1" port="8865"/>
+        </jbr-provider>
+
+        <jbr-provider name="JBR-Http-2" protocol="http" host="localhost">
+            <jbr-bus busid="Http-2" port="8866"/>
+        </jbr-provider>
+
+        <jbr-provider name="JBR-Socket" protocol="socket" host="localhost">
+            <jbr-bus busid="Socket-1" port="8988"/>
+        </jbr-provider>
+
+        <fs-provider name="File Sys Provider">
+            <fs-bus busid="notificationChannel">
+                <fs-message-filter
+                        directory="/ae-demo/orders"
+                        input-suffix=".in.csv"
+                        work-suffix=".esbWorking"
+                        post-delete="false"
+                        post-directory="/ae-demo/orders"
+                        post-suffix=".done.csv"
+                        error-delete="false"
+                        error-directory="/ae-demo/orders"
+                        error-suffix=".IN_ERROR.csv"
+                        />
+            </fs-bus>
+        </fs-provider>
+
+    </providers>
+
+    <services>
+
+        <service category="ABI_OrderManager" name="ABI_OrderManager" description="ABI OrderManager Service">
+
+            <listeners>
+                <jms-listener name="JMS-Gateway" busidref="OrderManagerGateway" is-gateway="true" maxThreads="1"/>
+                <jbr-listener name="Http-Gateway" busidref="Http-1" is-gateway="true" maxThreads="1"/>
+                <jbr-listener name="Socket-Gateway" busidref="Socket-1" is-gateway="true" maxThreads="1"/>
+
+                <jms-listener name="JMS-ESBListener" busidref="OrderManagerService" maxThreads="1"/>
+            </listeners>
+            <actions>
+                <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
+                    <property name="message"
+                              value="[Quickstart_webservice_bpel] Message before invoking 'ABI_OrderManager' endpoint"/>
+                </action>
+                <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.JBossWSAdapter">
+                    <property name="jbossws-endpoint" value="ABI_OrderManager"/>
+                </action>
+                <action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">
+                    <property name="message"
+                              value="[Quickstart_webservice_bpel] Message after invoking 'ABI_OrderManager' endpoint"/>
+                </action>
+            </actions>
+        </service>
+
+        <service category="ABI_Shipper" name="ABI_Shipper" description="ABI Shipper Service">
+
+            <listeners>
+                <jbr-listener name="Http-Gateway" busidref="Http-2" is-gateway="true" maxThreads="1"/>
+
+                <jms-listener name="JMS-ESBListener" busidref="ShipperService" maxThreads="1"/>
+            </listeners>
+            <actions>
+                <action name="print-before" class="org.jboss.soa.esb.actions.SystemPrintln">
+                    <property name="message"
+                              value="[Quickstart_webservice_bpel] Message before invoking 'ABI_Shipping' endpoint"/>
+                </action>
+                <action name="JBossWSAdapter" class="org.jboss.soa.esb.actions.soap.JBossWSAdapter">
+                    <property name="jbossws-endpoint" value="ABI_Shipping"/>
+                </action>
+                <action name="print-after" class="org.jboss.soa.esb.actions.SystemPrintln">
+                    <property name="message"
+                              value="[Quickstart_webservice_bpel] Message after invoking 'ABI_Shipping' endpoint"/>
+                </action>
+            </actions>
+        </service>
+
+        <service category="OrderNotificationService" name="OrderNotificationService"
+                 description="Order Notification Service">
+            <listeners>
+                <fs-listener name="FileGateway" busidref="notificationChannel" is-gateway="true"
+                             poll-frequency-seconds="10"/>
+                <jms-listener name="OrderNotificationService" busidref="OrderNotificationService"/>
+            </listeners>
+            <actions>
+                <!-- Transform the incoming CSV order approval record into a populated
+                     com.activebpel.ordermanagement.SalesOrderNotification instance. -->
+                <action name="message-populator" class="org.jboss.soa.esb.actions.converters.SmooksTransformer">
+                    <property name="from" value="OrderManager"/>
+                    <property name="from-type" value="text/csv:orderApproval"/>
+                    <property name="to" value="RetailerCallback"/>
+                    <property name="to-type" value="text/xml:SendSalesOrderNotification"/>
+                </action>
+                <action name="print-after-transform" class="org.jboss.soa.esb.actions.SystemPrintln">
+                    <property name="message" value="[Quickstart_webservice_bpel] Message after transform and before SOAPClient"/>
+                </action>
+                <!-- Inject the com.activebpel.ordermanagement.SalesOrderNotification instance
+                     into the SOAPClient. SOAPClient will use SOAPUI to construct a soap request
+                     template and will then use OGNL to populate the values (from the Smooks 
+                     EXTRACTED_BEANS_HASH) into the soap message. -->
+                <action name="soapui-client" class="org.jboss.soa.esb.actions.soap.SOAPClient">
+                    <property name="wsdl" value="http://localhost:18080/active-bpel/services/RetailerCallback?wsdl"/>
+                    <property name="operation" value="SendSalesOrderNotification"/>
+                    <property name="paramsLocation" value="EXTRACTED_BEANS_HASH"/>
+                    <property name="responseXStreamConfig">
+                        <alias name="customerOrderAck" class="java.lang.Boolean" />
+                    </property>
+                </action>
+            </actions>
+        </service>
+
+    </services>
+
+</jbossesb>

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util)

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,85 +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 junit.framework.TestCase;
-
-import org.jboss.soa.esb.message.Message;
-
-/**
- * AbstractCommandVehicle unit tests.
- * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
- */
-public class AbstractCommandVehicleUnitTest extends TestCase {
-	
-	static class MyVehicle extends AbstractCommandVehicle
-	{
-		private static final long serialVersionUID = 1L;
-		@Override
-		public String getCommandOpcodeKey() { return "myCmdOpcodeKey"; }
-		@Override
-		public String getCommandValuesTag() { return "CMD_VALUES_TAG"; }
-		@Override
-		public Operation operatorFromString(String value) {return Operation.valueOf(value); }
-		
-		public static final String VAL1 = "value1_tag";
-
-		public enum Operation
-		{
-			oper1
-			,oper2
-		}
-
-		public MyVehicle(Enum command) 		{ super(command); }
-		public MyVehicle(Message message)	{ super(message); }
-
-		public void 	setVal1(String obj)	{ super.setValue(VAL1, obj); }
-		public String	getVal1()			{ return (String)_values.get(VAL1); }
-	}
-
-	public void test_01() 
-	{
-		String compareValue = "12345";
-		
-		MyVehicle vh1 = new MyVehicle(MyVehicle.Operation.oper1);
-		vh1.setVal1(compareValue);
-		Message msg = vh1.toCommandMessage();
-		
-		MyVehicle newVh = new MyVehicle(msg);
-		assertEquals(MyVehicle.Operation.oper1, newVh.getOperator());
-		assertEquals(compareValue, newVh.getVal1());
-	}
-	
-	public void test_02() 
-	{
-		String compareValue = "ZZZZZZZZZZZZZZ";
-		
-		MyVehicle vh1 = new MyVehicle(MyVehicle.Operation.oper2);
-		vh1.setVal1(compareValue);
-		Message msg = vh1.toCommandMessage();
-		
-		MyVehicle newVh = new MyVehicle(msg);
-		assertEquals(MyVehicle.Operation.oper2, newVh.getOperator());
-		assertEquals(compareValue, newVh.getVal1());
-	}
-	
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/AbstractCommandVehicleUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,85 @@
+/*
+ * 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 junit.framework.TestCase;
+
+import org.jboss.soa.esb.message.Message;
+
+/**
+ * AbstractCommandVehicle unit tests.
+ * @author <a href="mailto:schifest at heuristica.com.ar">Esteban</a>
+ */
+public class AbstractCommandVehicleUnitTest extends TestCase {
+	
+	static class MyVehicle extends AbstractCommandVehicle
+	{
+		private static final long serialVersionUID = 1L;
+		@Override
+		public String getCommandOpcodeKey() { return "myCmdOpcodeKey"; }
+		@Override
+		public String getCommandValuesTag() { return "CMD_VALUES_TAG"; }
+		@Override
+		public Operation operatorFromString(String value) {return Operation.valueOf(value); }
+		
+		public static final String VAL1 = "value1_tag";
+
+		public enum Operation
+		{
+			oper1
+			,oper2
+		}
+
+		public MyVehicle(Enum command) 		{ super(command); }
+		public MyVehicle(Message message)	{ super(message); }
+
+		public void 	setVal1(String obj)	{ super.setValue(VAL1, obj); }
+		public String	getVal1()			{ return (String)_values.get(VAL1); }
+	}
+
+	public void test_01() 
+	{
+		String compareValue = "12345";
+		
+		MyVehicle vh1 = new MyVehicle(MyVehicle.Operation.oper1);
+		vh1.setVal1(compareValue);
+		Message msg = vh1.toCommandMessage();
+		
+		MyVehicle newVh = new MyVehicle(msg);
+		assertEquals(MyVehicle.Operation.oper1, newVh.getOperator());
+		assertEquals(compareValue, newVh.getVal1());
+	}
+	
+	public void test_02() 
+	{
+		String compareValue = "ZZZZZZZZZZZZZZ";
+		
+		MyVehicle vh1 = new MyVehicle(MyVehicle.Operation.oper2);
+		vh1.setVal1(compareValue);
+		Message msg = vh1.toCommandMessage();
+		
+		MyVehicle newVh = new MyVehicle(msg);
+		assertEquals(MyVehicle.Operation.oper2, newVh.getOperator());
+		assertEquals(compareValue, newVh.getVal1());
+	}
+	
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/ClassUtilUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/ClassUtilUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/ClassUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,39 +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, JBoss Inc.
- */
-package org.jboss.soa.esb.util;
-
-import java.util.List;
-
-import junit.framework.TestCase;
-
-/**
- * ClassUtil tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class ClassUtilUnitTest extends TestCase {
-
-    public void test_getResourceList() {
-        List<String> resources;
-
-        resources = ClassUtil.getResourceList("/org/apache/log4j/jdbc/JDBC.*", ClassUtilUnitTest.class);
-        assertEquals(1, resources.size());
-        assertTrue(resources.contains("/org/apache/log4j/jdbc/JDBCAppender.class"));
-    }
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/ClassUtilUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/ClassUtilUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/ClassUtilUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/ClassUtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,39 @@
+/*
+ * 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, JBoss Inc.
+ */
+package org.jboss.soa.esb.util;
+
+import java.util.List;
+
+import junit.framework.TestCase;
+
+/**
+ * ClassUtil tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class ClassUtilUnitTest extends TestCase {
+
+    public void test_getResourceList() {
+        List<String> resources;
+
+        resources = ClassUtil.getResourceList("/org/apache/log4j/jdbc/JDBC.*", ClassUtilUnitTest.class);
+        assertEquals(1, resources.size());
+        assertTrue(resources.contains("/org/apache/log4j/jdbc/JDBCAppender.class"));
+    }
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,82 +0,0 @@
-package org.jboss.soa.esb.util;
-
-import java.io.Serializable;
-import java.util.ArrayList;
-import java.util.Hashtable;
-import java.util.List;
-
-import junit.framework.TestCase;
-
-import org.jboss.soa.esb.helpers.ConfigTree;
-import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.notification.NotificationException;
-import org.jboss.soa.esb.notification.NotificationTarget;
-
-/**
- * Mock NotificationTarget Implementation. <p/> Configured by giving the target
- * output list a 'name'. Notifications are statically accessed via the static
- * {@link #getTargetList(String)} method, supplying the target list name. <p/>
- * Sample config:
- * 
- * <pre>
- *  &lt;NotificationList type=&quot;OK&quot;&gt;
- *  	&lt;target class=&quot;org.jboss.soa.esb.util.MockNotificationTarget&quot; &lt;b&gt;name=&quot;ok-target&quot;&lt;/b&gt; /&gt;
- *  &lt;/NotificationList&gt;
- * </pre>
- * 
- * @author tfennelly
- */
-public class MockNotificationTarget extends NotificationTarget
-{
-
-	private static Hashtable<String, List<Serializable>> targetLists = new Hashtable<String, List<Serializable>>();
-
-	private List<Serializable> targetList;
-
-	public MockNotificationTarget (ConfigTree config)
-	{
-		super(config);
-
-		String name = config.getAttribute("name");
-
-		if (name == null || name.trim().equals(""))
-		{
-			TestCase
-					.fail("Mock NotificationTarget configured incorrectly.  Must specify a 'name' attribute on the NotificationList/target element.");
-		}
-
-		targetList = getTargetList(name);
-	}
-
-	public static List<Serializable> getTargetList (String name)
-	{
-		synchronized (targetLists)
-		{
-			List<Serializable> notificationList = targetLists.get(name);
-
-			// Never return a null list.
-			if (notificationList == null)
-			{
-				notificationList = new ArrayList<Serializable>();
-				targetLists.put(name, notificationList);
-			}
-
-			return notificationList;
-		}
-	}
-
-	public static void clearNotifications ()
-	{
-		synchronized (targetLists)
-		{
-			targetLists.clear();
-		}
-	}
-
-	@Override
-	public void sendNotification (Message notificationObject)
-			throws NotificationException
-	{
-		targetList.add(notificationObject);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/MockNotificationTarget.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,82 @@
+package org.jboss.soa.esb.util;
+
+import java.io.Serializable;
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.List;
+
+import junit.framework.TestCase;
+
+import org.jboss.soa.esb.helpers.ConfigTree;
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.notification.NotificationException;
+import org.jboss.soa.esb.notification.NotificationTarget;
+
+/**
+ * Mock NotificationTarget Implementation. <p/> Configured by giving the target
+ * output list a 'name'. Notifications are statically accessed via the static
+ * {@link #getTargetList(String)} method, supplying the target list name. <p/>
+ * Sample config:
+ * 
+ * <pre>
+ *  &lt;NotificationList type=&quot;OK&quot;&gt;
+ *  	&lt;target class=&quot;org.jboss.soa.esb.util.MockNotificationTarget&quot; &lt;b&gt;name=&quot;ok-target&quot;&lt;/b&gt; /&gt;
+ *  &lt;/NotificationList&gt;
+ * </pre>
+ * 
+ * @author tfennelly
+ */
+public class MockNotificationTarget extends NotificationTarget
+{
+
+	private static Hashtable<String, List<Serializable>> targetLists = new Hashtable<String, List<Serializable>>();
+
+	private List<Serializable> targetList;
+
+	public MockNotificationTarget (ConfigTree config)
+	{
+		super(config);
+
+		String name = config.getAttribute("name");
+
+		if (name == null || name.trim().equals(""))
+		{
+			TestCase
+					.fail("Mock NotificationTarget configured incorrectly.  Must specify a 'name' attribute on the NotificationList/target element.");
+		}
+
+		targetList = getTargetList(name);
+	}
+
+	public static List<Serializable> getTargetList (String name)
+	{
+		synchronized (targetLists)
+		{
+			List<Serializable> notificationList = targetLists.get(name);
+
+			// Never return a null list.
+			if (notificationList == null)
+			{
+				notificationList = new ArrayList<Serializable>();
+				targetLists.put(name, notificationList);
+			}
+
+			return notificationList;
+		}
+	}
+
+	public static void clearNotifications ()
+	{
+		synchronized (targetLists)
+		{
+			targetLists.clear();
+		}
+	}
+
+	@Override
+	public void sendNotification (Message notificationObject)
+			throws NotificationException
+	{
+		targetList.add(notificationObject);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/StreamUtilsUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/StreamUtilsUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/StreamUtilsUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,59 +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.ByteArrayInputStream;
-
-import junit.framework.TestCase;
-
-import org.jboss.internal.soa.esb.util.StreamUtils;
-
-/**
- * StreamUtils unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class StreamUtilsUnitTest extends TestCase {
-
-	public void test_readStream_badargs() {
-		try {
-			StreamUtils.readStream(null);
-			fail("expected IllegalArgumentException");
-		} catch(IllegalArgumentException e) {
-			// expected
-		}
-	}
-	
-	public void test_readStream() {
-		StringBuffer testBuf = new StringBuffer(500);
-		@SuppressWarnings("unused")
-		byte[] resStream;
-		
-		while(testBuf.length() < 500) {
-			testBuf.append("12121212121212121212121212121212121212121212121212");
-		}
-
-		String testString = testBuf.toString();
-		String resString = new String(StreamUtils.readStream(new ByteArrayInputStream(testString.getBytes())));
-		
-		assertEquals(testString, resString);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/StreamUtilsUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/StreamUtilsUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/StreamUtilsUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/StreamUtilsUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,59 @@
+/*
+ * 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.ByteArrayInputStream;
+
+import junit.framework.TestCase;
+
+import org.jboss.internal.soa.esb.util.StreamUtils;
+
+/**
+ * StreamUtils unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class StreamUtilsUnitTest extends TestCase {
+
+	public void test_readStream_badargs() {
+		try {
+			StreamUtils.readStream(null);
+			fail("expected IllegalArgumentException");
+		} catch(IllegalArgumentException e) {
+			// expected
+		}
+	}
+	
+	public void test_readStream() {
+		StringBuffer testBuf = new StringBuffer(500);
+		@SuppressWarnings("unused")
+		byte[] resStream;
+		
+		while(testBuf.length() < 500) {
+			testBuf.append("12121212121212121212121212121212121212121212121212");
+		}
+
+		String testString = testBuf.toString();
+		String resString = new String(StreamUtils.readStream(new ByteArrayInputStream(testString.getBytes())));
+		
+		assertEquals(testString, resString);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/UtilUnitTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/UtilUnitTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/UtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,113 +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.ByteArrayInputStream;
-import java.io.ByteArrayOutputStream;
-import java.io.IOException;
-import java.io.PrintStream;
-import java.util.Properties;
-
-import junit.framework.TestCase;
-
-/**
- * Util unit tests.
- * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
- */
-public class UtilUnitTest extends TestCase {
-
-	public void testDumpSysProps() throws IOException 
-	{
-		ByteArrayOutputStream buf = new ByteArrayOutputStream();
-		
-		Util.dumpSysProps(new PrintStream(buf));
-		
-		Properties props = new Properties();
-		String env = buf.toString();
-		//escape backslashes to fix running under cygwin
-		env = env.replaceAll("\\\\", "\\\\\\\\");
-		props.load(new ByteArrayInputStream(env.getBytes()));
-		
-		// Just make sure that something was dumped to the printstream
-		// by checking for a property we know will be in the System...
-		assertTrue(props.containsKey("file.separator"));
-	}
-
-	public void testIsNullString() {
-		assertTrue(Util.isNullString(null));
-		assertTrue(Util.isNullString(""));
-		assertTrue(Util.isNullString(" "));
-		assertTrue(!Util.isNullString("a"));
-	}
-
-	public void testIsLong() {
-		assertTrue(!Util.isLong(null));
-		assertTrue(!Util.isLong(""));
-		assertTrue(!Util.isLong(" "));
-		assertTrue(!Util.isLong("a"));
-		assertTrue(!Util.isLong(" 1"));
-		assertTrue(!Util.isLong("1 "));
-		assertTrue(!Util.isLong("1.1"));
-		assertTrue(Util.isLong("1"));
-		assertTrue(Util.isLong("-1"));
-	}
-
-	public void testIsPositiveLong() {
-		assertTrue(!Util.isPositiveLong(null));
-		assertTrue(!Util.isPositiveLong(""));
-		assertTrue(!Util.isPositiveLong(" "));
-		assertTrue(!Util.isPositiveLong("a"));
-		assertTrue(!Util.isPositiveLong(" 1"));
-		assertTrue(!Util.isPositiveLong("1 "));
-		assertTrue(!Util.isPositiveLong("1.1"));
-		assertTrue(Util.isPositiveLong("1"));
-		assertTrue(!Util.isPositiveLong("0"));
-		assertTrue(!Util.isPositiveLong("-1"));
-	}
-
-	public void testParseInt() {
-		assertEquals(0, Util.parseInt("a"));
-		assertEquals(0, Util.parseInt(""));
-		assertEquals(0, Util.parseInt(" "));
-		assertEquals(0, Util.parseInt(" 1"));
-		assertEquals(0, Util.parseInt("1 "));
-		assertEquals(0, Util.parseInt("0"));
-		assertEquals(1, Util.parseInt("1"));
-		assertEquals(-1, Util.parseInt("-1"));
-	}
-
-	public void testParseLong() {
-		assertEquals(0L, Util.parseLong("a"));
-		assertEquals(0L, Util.parseLong(""));
-		assertEquals(0L, Util.parseLong(" "));
-		assertEquals(0L, Util.parseLong(" 1"));
-		assertEquals(0L, Util.parseLong("1 "));
-		assertEquals(0L, Util.parseLong("0"));
-		assertEquals(1L, Util.parseLong("1"));
-		assertEquals(-1L, Util.parseLong("-1"));
-	}
-
-	public void testGetDefaultLogger() {
-		// Cheating here - just getting the coverage results up a little more :-)
-		Util.getDefaultLogger(Util.class);
-	}
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/UtilUnitTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/UtilUnitTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/UtilUnitTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/UtilUnitTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,113 @@
+/*
+ * 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.ByteArrayInputStream;
+import java.io.ByteArrayOutputStream;
+import java.io.IOException;
+import java.io.PrintStream;
+import java.util.Properties;
+
+import junit.framework.TestCase;
+
+/**
+ * Util unit tests.
+ * @author <a href="mailto:tom.fennelly at jboss.com">tom.fennelly at jboss.com</a>
+ */
+public class UtilUnitTest extends TestCase {
+
+	public void testDumpSysProps() throws IOException 
+	{
+		ByteArrayOutputStream buf = new ByteArrayOutputStream();
+		
+		Util.dumpSysProps(new PrintStream(buf));
+		
+		Properties props = new Properties();
+		String env = buf.toString();
+		//escape backslashes to fix running under cygwin
+		env = env.replaceAll("\\\\", "\\\\\\\\");
+		props.load(new ByteArrayInputStream(env.getBytes()));
+		
+		// Just make sure that something was dumped to the printstream
+		// by checking for a property we know will be in the System...
+		assertTrue(props.containsKey("file.separator"));
+	}
+
+	public void testIsNullString() {
+		assertTrue(Util.isNullString(null));
+		assertTrue(Util.isNullString(""));
+		assertTrue(Util.isNullString(" "));
+		assertTrue(!Util.isNullString("a"));
+	}
+
+	public void testIsLong() {
+		assertTrue(!Util.isLong(null));
+		assertTrue(!Util.isLong(""));
+		assertTrue(!Util.isLong(" "));
+		assertTrue(!Util.isLong("a"));
+		assertTrue(!Util.isLong(" 1"));
+		assertTrue(!Util.isLong("1 "));
+		assertTrue(!Util.isLong("1.1"));
+		assertTrue(Util.isLong("1"));
+		assertTrue(Util.isLong("-1"));
+	}
+
+	public void testIsPositiveLong() {
+		assertTrue(!Util.isPositiveLong(null));
+		assertTrue(!Util.isPositiveLong(""));
+		assertTrue(!Util.isPositiveLong(" "));
+		assertTrue(!Util.isPositiveLong("a"));
+		assertTrue(!Util.isPositiveLong(" 1"));
+		assertTrue(!Util.isPositiveLong("1 "));
+		assertTrue(!Util.isPositiveLong("1.1"));
+		assertTrue(Util.isPositiveLong("1"));
+		assertTrue(!Util.isPositiveLong("0"));
+		assertTrue(!Util.isPositiveLong("-1"));
+	}
+
+	public void testParseInt() {
+		assertEquals(0, Util.parseInt("a"));
+		assertEquals(0, Util.parseInt(""));
+		assertEquals(0, Util.parseInt(" "));
+		assertEquals(0, Util.parseInt(" 1"));
+		assertEquals(0, Util.parseInt("1 "));
+		assertEquals(0, Util.parseInt("0"));
+		assertEquals(1, Util.parseInt("1"));
+		assertEquals(-1, Util.parseInt("-1"));
+	}
+
+	public void testParseLong() {
+		assertEquals(0L, Util.parseLong("a"));
+		assertEquals(0L, Util.parseLong(""));
+		assertEquals(0L, Util.parseLong(" "));
+		assertEquals(0L, Util.parseLong(" 1"));
+		assertEquals(0L, Util.parseLong("1 "));
+		assertEquals(0L, Util.parseLong("0"));
+		assertEquals(1L, Util.parseLong("1"));
+		assertEquals(-1L, Util.parseLong("-1"));
+	}
+
+	public void testGetDefaultLogger() {
+		// Cheating here - just getting the coverage results up a little more :-)
+		Util.getDefaultLogger(Util.class);
+	}
+}

Deleted: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java
===================================================================
--- labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java	2007-06-21 19:42:49 UTC (rev 12752)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -1,94 +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 static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNotNull;
-
-import java.io.IOException;
-
-import javax.xml.parsers.ParserConfigurationException;
-import javax.xml.xpath.XPathExpressionException;
-
-import org.junit.Test;
-import org.w3c.dom.Document;
-import org.w3c.dom.Element;
-import org.w3c.dom.Node;
-import org.xml.sax.SAXException;
-
-/**
- * Tests the XPathUtil class
- * 
- * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
- * @since 4.2
- *
- */
-public class XPathUtilTest
-{
-	private String xml = "<someNode><childnode><name>Daniel</name></childnode></someNode>";
-	
-	@Test( expected= IllegalArgumentException.class )
-	public void getDocumentNegative() throws SAXException, IOException, ParserConfigurationException
-	{
-		XPathUtil.getDocument( null );
-	}
-	
-	@Test
-	public void getDocument() throws SAXException, IOException, ParserConfigurationException
-	{
-		Document document = XPathUtil.getDocument( xml );
-		assertNotNull( document );
-	}
-	
-	@Test( expected= IllegalArgumentException.class )
-	public void getNodeFromXPathExpressionNegative_null_document( ) throws XPathExpressionException
-	{
-		Document document = null;
-		XPathUtil.getNodeFromXPathExpression( document, "/some/path[0]" );
-	}
-	
-	@Test
-	public void getNodeFromXPathExpression( ) throws SAXException, IOException, ParserConfigurationException, XPathExpressionException
-	{
-		Element node = XPathUtil.getNodeFromXPathExpression( XPathUtil.getDocument( xml ), "/someNode/childnode" );
-		assertEquals( "childnode", node.getNodeName() );
-	}
-	
-	@Test
-	public void getNodeFromXPathExpression_sibling( ) throws SAXException, IOException, ParserConfigurationException, XPathExpressionException
-	{
-		String xml = "<someNode><childnode><name>Daniel</name></childnode><childnode><name>Bevenius</name></childnode></someNode>";
-		Element node = XPathUtil.getNodeFromXPathExpression( XPathUtil.getDocument( xml ), "/someNode/childnode[2]" );
-		assertEquals( "childnode", node.getNodeName() );
-		Node nameNode = node.getElementsByTagName( "name" ).item( 0 );
-		assertNotNull( nameNode );
-		assertEquals( "Bevenius", nameNode.getTextContent() );
-	}
-	
-	@Test
-	public void getNodeFromXPathExpression_StringXml_and_XPathExpression() throws XPathExpressionException, SAXException, IOException, ParserConfigurationException
-	{
-		Element node = XPathUtil.getNodeFromXPathExpression( xml, "/someNode/childnode" );
-		assertEquals( "childnode", node.getNodeName() );
-	}
-
-}

Copied: labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java (from rev 12752, labs/jbossesb/workspace/dbevenius/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java)
===================================================================
--- labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java	                        (rev 0)
+++ labs/jbossesb/trunk/product/rosetta/tests/src/org/jboss/soa/esb/util/XPathUtilTest.java	2007-06-21 21:23:20 UTC (rev 12753)
@@ -0,0 +1,94 @@
+/*
+ * 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 static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import java.io.IOException;
+
+import javax.xml.parsers.ParserConfigurationException;
+import javax.xml.xpath.XPathExpressionException;
+
+import org.junit.Test;
+import org.w3c.dom.Document;
+import org.w3c.dom.Element;
+import org.w3c.dom.Node;
+import org.xml.sax.SAXException;
+
+/**
+ * Tests the XPathUtil class
+ * 
+ * @author <a href="daniel.bevenius at redpill.se">Daniel Bevenius</a>				
+ * @since 4.2
+ *
+ */
+public class XPathUtilTest
+{
+	private String xml = "<someNode><childnode><name>Daniel</name></childnode></someNode>";
+	
+	@Test( expected= IllegalArgumentException.class )
+	public void getDocumentNegative() throws SAXException, IOException, ParserConfigurationException
+	{
+		XPathUtil.getDocument( null );
+	}
+	
+	@Test
+	public void getDocument() throws SAXException, IOException, ParserConfigurationException
+	{
+		Document document = XPathUtil.getDocument( xml );
+		assertNotNull( document );
+	}
+	
+	@Test( expected= IllegalArgumentException.class )
+	public void getNodeFromXPathExpressionNegative_null_document( ) throws XPathExpressionException
+	{
+		Document document = null;
+		XPathUtil.getNodeFromXPathExpression( document, "/some/path[0]" );
+	}
+	
+	@Test
+	public void getNodeFromXPathExpression( ) throws SAXException, IOException, ParserConfigurationException, XPathExpressionException
+	{
+		Element node = XPathUtil.getNodeFromXPathExpression( XPathUtil.getDocument( xml ), "/someNode/childnode" );
+		assertEquals( "childnode", node.getNodeName() );
+	}
+	
+	@Test
+	public void getNodeFromXPathExpression_sibling( ) throws SAXException, IOException, ParserConfigurationException, XPathExpressionException
+	{
+		String xml = "<someNode><childnode><name>Daniel</name></childnode><childnode><name>Bevenius</name></childnode></someNode>";
+		Element node = XPathUtil.getNodeFromXPathExpression( XPathUtil.getDocument( xml ), "/someNode/childnode[2]" );
+		assertEquals( "childnode", node.getNodeName() );
+		Node nameNode = node.getElementsByTagName( "name" ).item( 0 );
+		assertNotNull( nameNode );
+		assertEquals( "Bevenius", nameNode.getTextContent() );
+	}
+	
+	@Test
+	public void getNodeFromXPathExpression_StringXml_and_XPathExpression() throws XPathExpressionException, SAXException, IOException, ParserConfigurationException
+	{
+		Element node = XPathUtil.getNodeFromXPathExpression( xml, "/someNode/childnode" );
+		assertEquals( "childnode", node.getNodeName() );
+	}
+
+}




More information about the jboss-svn-commits mailing list