[jboss-svn-commits] JBL Code SVN: r14389 - in labs/jbossesb/workspace/rearch2/core/src: main/java/org/jboss/internal/soa/esb/api/remoting and 15 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Mon Aug 20 11:25:09 EDT 2007


Author: mark.little at jboss.com
Date: 2007-08-20 11:25:08 -0400 (Mon, 20 Aug 2007)
New Revision: 14389

Added:
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/BodyImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/ContextImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/FaultImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/HeaderImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/MessageImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/XMLMessagePlugin.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/XMLUtil.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalManager.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalPlugin.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/SerializedMarshalUnmarshalPlugin.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/MarshalPlugin.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/UnMarshalPlugin.java
Removed:
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/serialized/
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/marshal/
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/remoting/
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalManager.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalPlugin.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/SerializedMarshalUnmarshalPlugin.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/MarshalPlugin.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/UnMarshalPlugin.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/soa/esb/message/externalization/
Modified:
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/local/SenderImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/local/TwoWaySenderImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/remoting/SenderImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/remoting/TwoWaySenderImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/local/ReceiverImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/local/TwoWayReceiverImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/remoting/ReceiverImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/remoting/TwoWayReceiverImpl.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/soa/esb/message/Body.java
   labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/soa/esb/message/Fault.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/infrastructure/tests/DispatcherUnitTest.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/BodyUnitTest.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/FaultUnitTest.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/MessageUnitTest.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/oneway/TcpClient.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/oneway/TcpService.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/twoway/TcpClient.java
   labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/twoway/TcpService.java
Log:


Modified: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/local/SenderImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/local/SenderImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/local/SenderImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -21,9 +21,9 @@
  * @author mark.little at jboss.com
  */
 
-import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.MarshalPlugin;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.UnMarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.MarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.UnMarshalPlugin;
 import org.jboss.remoting.Client;
 import org.jboss.remoting.InvokerLocator;
 import org.jboss.remoting.marshal.MarshalFactory;

Modified: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/local/TwoWaySenderImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/local/TwoWaySenderImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/local/TwoWaySenderImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -21,9 +21,9 @@
  * @author mark.little at jboss.com
  */
 
-import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.MarshalPlugin;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.UnMarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.MarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.UnMarshalPlugin;
 import org.jboss.remoting.Client;
 import org.jboss.remoting.InvokerLocator;
 import org.jboss.remoting.marshal.MarshalFactory;

Modified: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/remoting/SenderImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/remoting/SenderImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/remoting/SenderImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -21,9 +21,9 @@
  * @author mark.little at jboss.com
  */
 
-import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.MarshalPlugin;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.UnMarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.MarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.UnMarshalPlugin;
 import org.jboss.soa.esb.ProtocolNotSupportedException;
 import org.jboss.soa.esb.SendFailedException;
 import org.jboss.soa.esb.api.Sender;

Modified: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/remoting/TwoWaySenderImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/remoting/TwoWaySenderImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/api/remoting/TwoWaySenderImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -21,9 +21,9 @@
  * @author mark.little at jboss.com
  */
 
-import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.MarshalPlugin;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.UnMarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.MarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.UnMarshalPlugin;
 import org.jboss.remoting.Client;
 import org.jboss.remoting.InvokerLocator;
 import org.jboss.remoting.marshal.MarshalFactory;

Deleted: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/MessageFactoryImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -1,136 +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.externalization.MessageFactory;
-import org.jboss.soa.esb.message.externalization.MessagePlugin;
-import org.jboss.soa.esb.message.externalization.ExternalizationType;
-
-/*
- * 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 = Thread.currentThread().getContextClassLoader().loadClass(pluginName);	
-						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(ExternalizationType.JBOSS_XML, new XMLMessagePlugin());
-		messageFormats.put(ExternalizationType.JAVA_SERIALIZED, new SerializedMessagePlugin());
-	}
-	
-	public Message getMessage() // returns some default implementation.
-	{
-		return ((MessagePlugin) messageFormats.get(ExternalizationType.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>();
-
-}

Deleted: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/AttachmentImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -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 extends Attachment implements 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("Attachment - 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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -1,284 +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.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.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 extends 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(String name, Object value)
-	{
-		if ((name == null) || (value == null))
-			throw new IllegalArgumentException();
-
-		synchronized (_objects)
-		{
-			_objects.put(name, value);
-		}
-	}
-
-	public Object get(String 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 addBytes(byte[] content)
-	{
-		_content = content;
-	}
-
-	public byte[] getBytes()
-	{
-		return _content;
-	}
-
-	public void replace(Body b)
-	{
-		if (b == null)
-			throw new IllegalArgumentException();
-
-		addBytes(b.getBytes());
-
-		_objects = ((BodyImpl) b)._objects;
-	}
-
-	public void merge(Body b)
-	{
-		if (b == null)
-			throw new IllegalArgumentException();
-
-		byte[] toAdd = b.getBytes();
-
-		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);
-	}
-
-	private byte[] _content;
-
-	private Hashtable<String, Object> _objects;
-
-}
\ No newline at end of file

Deleted: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -1,47 +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 extends Context
-{
-    public static final String CONTEXT_TAG = "Context";
-    
-	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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -1,136 +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.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 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++)
-				{
-					Element child = (Element) children.item(j);
-
-					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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -1,103 +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.HeaderHelper;
-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 extends 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 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 HeaderHelper.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 = HeaderHelper.fromXML(headerElement);
-	}
-	
-	private Call _call;
-}
\ No newline at end of file

Deleted: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -1,210 +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.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.externalization.ExternalizationType;
-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 ExternalizationType.JBOSS_XML;
-	}
-	/**
-	 * getProperties()
-	 * @return org.jboss.soa.esb.message.Properties - any message properties.
-	 */
-	public Properties getProperties() 
-	{
-		return _theProperties;
-	}
-	
-	// 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)
-		{
-			ex.printStackTrace();
-			
-			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)
-		{
-			ex.printStackTrace();
-			
-			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();
-}

Deleted: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -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.externalization.MessagePlugin;
-import org.jboss.soa.esb.message.externalization.ExternalizationType;
-
-/*
- * 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 ExternalizationType.JBOSS_XML;
-	}
-}

Deleted: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/BodyImpl.java (from rev 14386, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/BodyImpl.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/BodyImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -0,0 +1,284 @@
+package org.jboss.internal.soa.esb.message.normalized.xml;
+
+import java.util.Enumeration;
+import java.util.Hashtable;
+import java.util.Set;
+
+import org.jboss.internal.soa.esb.message.normalized.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.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 extends 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(String name, Object value)
+	{
+		if ((name == null) || (value == null))
+			throw new IllegalArgumentException();
+
+		synchronized (_objects)
+		{
+			_objects.put(name, value);
+		}
+	}
+
+	public Object get(String 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 addBytes(byte[] content)
+	{
+		_content = content;
+	}
+
+	public byte[] getBytes()
+	{
+		return _content;
+	}
+
+	public void replace(Body b)
+	{
+		if (b == null)
+			throw new IllegalArgumentException();
+
+		addBytes(b.getBytes());
+
+		_objects = ((BodyImpl) b)._objects;
+	}
+
+	public void merge(Body b)
+	{
+		if (b == null)
+			throw new IllegalArgumentException();
+
+		byte[] toAdd = b.getBytes();
+
+		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);
+	}
+
+	private byte[] _content;
+
+	private Hashtable<String, Object> _objects;
+
+}
\ No newline at end of file

Copied: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/ContextImpl.java (from rev 14386, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/ContextImpl.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/ContextImpl.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/ContextImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -0,0 +1,47 @@
+package org.jboss.internal.soa.esb.message.normalized.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 extends Context
+{
+    public static final String CONTEXT_TAG = "Context";
+    
+	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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/FaultImpl.java (from rev 14386, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/FaultImpl.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/FaultImpl.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/FaultImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -0,0 +1,136 @@
+package org.jboss.internal.soa.esb.message.normalized.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.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 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++)
+				{
+					Element child = (Element) children.item(j);
+
+					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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/HeaderImpl.java (from rev 14387, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/HeaderImpl.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/HeaderImpl.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/HeaderImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -0,0 +1,103 @@
+package org.jboss.internal.soa.esb.message.normalized.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.HeaderHelper;
+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 extends 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 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 HeaderHelper.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 = HeaderHelper.fromXML(headerElement);
+	}
+	
+	private Call _call;
+}
\ No newline at end of file

Copied: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/MessageImpl.java (from rev 14387, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/MessageImpl.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/MessageImpl.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/MessageImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -0,0 +1,188 @@
+/*
+ * 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.normalized.xml;
+
+import java.io.Serializable;
+import java.net.URI;
+
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+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.externalization.ExternalizationType;
+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";
+    
+    public MessageImpl ()
+    {
+    }
+    
+	/**
+	 * @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 the type of this message format.
+	 */
+	
+	public URI getType ()
+	{
+		return ExternalizationType.JBOSS_XML;
+	}
+	
+	// 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);
+			
+			return doc;
+		}
+		catch (MarshalException ex)
+		{
+			throw ex;
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+			
+			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);
+		}
+		catch (UnmarshalException ex)
+		{
+			throw ex;
+		}
+		catch (Exception ex)
+		{
+			ex.printStackTrace();
+			
+			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();
+}

Copied: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/XMLMessagePlugin.java (from rev 14387, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/XMLMessagePlugin.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/XMLMessagePlugin.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/XMLMessagePlugin.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -0,0 +1,48 @@
+package org.jboss.internal.soa.esb.message.normalized.xml;
+
+import java.net.URI;
+
+import org.jboss.soa.esb.message.Message;
+import org.jboss.soa.esb.message.externalization.ExternalizationPlugin;
+import org.jboss.soa.esb.message.externalization.ExternalizationType;
+
+/*
+ * 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 ExternalizationPlugin
+{
+	public Message getMessage ()
+	{
+		return new MessageImpl();
+	}
+	
+	public URI getType ()
+	{
+		return ExternalizationType.JBOSS_XML;
+	}
+}

Copied: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/XMLUtil.java (from rev 14386, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/XMLUtil.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/XMLUtil.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/XMLUtil.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -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.normalized.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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal (from rev 14386, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/marshal)

Deleted: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalManager.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java	2007-08-20 07:49:40 UTC (rev 14386)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalManager.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -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.w3c.dom.Element;
-import org.w3c.dom.Node;
-
-/*
- * 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 = Thread.currentThread().getContextClassLoader().loadClass(pluginName);					
-						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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalManager.java (from rev 14388, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalManager.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalManager.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalManager.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -0,0 +1,162 @@
+package org.jboss.internal.soa.esb.message.normalized.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.w3c.dom.Element;
+import org.w3c.dom.Node;
+
+/*
+ * 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 = Thread.currentThread().getContextClassLoader().loadClass(pluginName);					
+						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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalPlugin.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java	2007-08-20 07:49:40 UTC (rev 14386)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalPlugin.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalPlugin.java (from rev 14388, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/marshal/MarshalUnmarshalPlugin.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalPlugin.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/MarshalUnmarshalPlugin.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -0,0 +1,76 @@
+package org.jboss.internal.soa.esb.message.normalized.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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/SerializedMarshalUnmarshalPlugin.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java	2007-08-20 07:49:40 UTC (rev 14386)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/SerializedMarshalUnmarshalPlugin.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/SerializedMarshalUnmarshalPlugin.java (from rev 14388, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/marshal/SerializedMarshalUnmarshalPlugin.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/SerializedMarshalUnmarshalPlugin.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/marshal/SerializedMarshalUnmarshalPlugin.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -0,0 +1,175 @@
+package org.jboss.internal.soa.esb.message.normalized.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/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting (from rev 14386, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/remoting)

Deleted: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/MarshalPlugin.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/remoting/MarshalPlugin.java	2007-08-20 07:49:40 UTC (rev 14386)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/MarshalPlugin.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -1,150 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.xml.remoting;
-
-import java.io.IOException;
-import java.io.StringWriter;
-
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.InvocationResponse;
-import org.jboss.remoting.invocation.OnewayInvocation;
-import org.jboss.remoting.marshal.Marshaller;
-import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
-import org.jboss.soa.esb.MarshalException;
-import org.w3c.dom.Document;
-
-import com.sun.org.apache.xml.internal.serialize.OutputFormat;
-import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
-
-/*
- * 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 MarshalPlugin extends SerializableMarshaller //implements Marshaller
-{
-	private static final long serialVersionUID = 0xdeadbeef;
-
-	public static final MarshalPlugin getInstance ()
-	{
-		return _instance;
-	}
-	
-	public Marshaller cloneMarshaller ()
-	{
-		return getInstance();
-	}
-
-	/**
-	 * 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 void write (Object dataObject, java.io.OutputStream output) throws IOException
-	{
-		if ((dataObject instanceof InvocationRequest) || (dataObject instanceof InvocationResponse))
-		{
-			Object invocationMsg = null;
-			
-			if (dataObject instanceof InvocationRequest)
-				invocationMsg = ((InvocationRequest) dataObject).getParameter();
-			else
-				invocationMsg = ((InvocationResponse) dataObject).getResult();
-
-			if (invocationMsg instanceof OnewayInvocation)
-			{
-				OnewayInvocation oneWay = (OnewayInvocation) invocationMsg;
-				
-				invocationMsg = oneWay.getParameters()[0];
-			}
-		
-			if (invocationMsg instanceof org.jboss.internal.soa.esb.message.format.xml.MessageImpl)
-			{	
-				try
-				{
-					DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
-					
-					factory.setNamespaceAware(true);
-					
-					Document doc = factory.newDocumentBuilder().newDocument();
-					((org.jboss.internal.soa.esb.message.format.xml.MessageImpl) invocationMsg).toXML(doc);
-					StringWriter sWriter = new StringWriter();
-					OutputFormat format = new OutputFormat();
-					format.setIndenting(true);
-					XMLSerializer xmlS = new XMLSerializer(sWriter, format);
-					xmlS.asDOMSerializer();
-					xmlS.serialize(doc);
-
-					if (dataObject instanceof InvocationRequest)
-						((InvocationRequest) dataObject).setParameter(sWriter.toString());
-					else
-					{
-						InvocationResponse response = (InvocationResponse) dataObject;
-					
-						InvocationResponse modifiedResponse = new InvocationResponse(response.getSessionId(), sWriter.toString(),
-																	response.isException(), response.getPayload());
-						
-						dataObject = modifiedResponse;
-					}
-					
-					super.write(dataObject, output);
-				}
-				catch (ParserConfigurationException ex)
-				{
-					throw new IOException(ex.toString());
-				}
-				catch (MarshalException ex)
-				{
-					throw new IOException(ex.toString());
-				}
-			}
-			else
-				super.write(dataObject, output);
-		}
-		else
-			super.write(dataObject, output);
-	}
-	
-	private MarshalPlugin ()
-	{	
-	}
-	
-	private static final MarshalPlugin _instance = new MarshalPlugin();
-}

Copied: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/MarshalPlugin.java (from rev 14388, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/remoting/MarshalPlugin.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/MarshalPlugin.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/MarshalPlugin.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -0,0 +1,150 @@
+package org.jboss.internal.soa.esb.message.normalized.xml.remoting;
+
+import java.io.IOException;
+import java.io.StringWriter;
+
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.InvocationResponse;
+import org.jboss.remoting.invocation.OnewayInvocation;
+import org.jboss.remoting.marshal.Marshaller;
+import org.jboss.remoting.marshal.serializable.SerializableMarshaller;
+import org.jboss.soa.esb.MarshalException;
+import org.w3c.dom.Document;
+
+import com.sun.org.apache.xml.internal.serialize.OutputFormat;
+import com.sun.org.apache.xml.internal.serialize.XMLSerializer;
+
+/*
+ * 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 MarshalPlugin extends SerializableMarshaller //implements Marshaller
+{
+	private static final long serialVersionUID = 0xdeadbeef;
+
+	public static final MarshalPlugin getInstance ()
+	{
+		return _instance;
+	}
+	
+	public Marshaller cloneMarshaller ()
+	{
+		return getInstance();
+	}
+
+	/**
+	 * 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 void write (Object dataObject, java.io.OutputStream output) throws IOException
+	{
+		if ((dataObject instanceof InvocationRequest) || (dataObject instanceof InvocationResponse))
+		{
+			Object invocationMsg = null;
+			
+			if (dataObject instanceof InvocationRequest)
+				invocationMsg = ((InvocationRequest) dataObject).getParameter();
+			else
+				invocationMsg = ((InvocationResponse) dataObject).getResult();
+
+			if (invocationMsg instanceof OnewayInvocation)
+			{
+				OnewayInvocation oneWay = (OnewayInvocation) invocationMsg;
+				
+				invocationMsg = oneWay.getParameters()[0];
+			}
+		
+			if (invocationMsg instanceof org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl)
+			{	
+				try
+				{
+					DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+					
+					factory.setNamespaceAware(true);
+					
+					Document doc = factory.newDocumentBuilder().newDocument();
+					((org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl) invocationMsg).toXML(doc);
+					StringWriter sWriter = new StringWriter();
+					OutputFormat format = new OutputFormat();
+					format.setIndenting(true);
+					XMLSerializer xmlS = new XMLSerializer(sWriter, format);
+					xmlS.asDOMSerializer();
+					xmlS.serialize(doc);
+
+					if (dataObject instanceof InvocationRequest)
+						((InvocationRequest) dataObject).setParameter(sWriter.toString());
+					else
+					{
+						InvocationResponse response = (InvocationResponse) dataObject;
+					
+						InvocationResponse modifiedResponse = new InvocationResponse(response.getSessionId(), sWriter.toString(),
+																	response.isException(), response.getPayload());
+						
+						dataObject = modifiedResponse;
+					}
+					
+					super.write(dataObject, output);
+				}
+				catch (ParserConfigurationException ex)
+				{
+					throw new IOException(ex.toString());
+				}
+				catch (MarshalException ex)
+				{
+					throw new IOException(ex.toString());
+				}
+			}
+			else
+				super.write(dataObject, output);
+		}
+		else
+			super.write(dataObject, output);
+	}
+	
+	private MarshalPlugin ()
+	{	
+	}
+	
+	private static final MarshalPlugin _instance = new MarshalPlugin();
+}

Deleted: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/UnMarshalPlugin.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/remoting/UnMarshalPlugin.java	2007-08-20 07:49:40 UTC (rev 14386)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/UnMarshalPlugin.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -1,160 +0,0 @@
-package org.jboss.internal.soa.esb.message.format.xml.remoting;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import javax.xml.parsers.DocumentBuilder;
-import javax.xml.parsers.DocumentBuilderFactory;
-import javax.xml.parsers.ParserConfigurationException;
-
-import org.jboss.remoting.InvocationRequest;
-import org.jboss.remoting.InvocationResponse;
-import org.jboss.remoting.marshal.UnMarshaller;
-import org.jboss.remoting.marshal.serializable.SerializableUnMarshaller;
-import org.jboss.soa.esb.MarshalException;
-import org.jboss.soa.esb.UnmarshalException;
-import org.w3c.dom.Document;
-import org.xml.sax.SAXException;
-
-/*
- * 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 UnMarshalPlugin extends SerializableUnMarshaller //implements UnMarshaller
-{
-	private static final long serialVersionUID = 0xdeadbeef;
-
-	public static final UnMarshalPlugin getInstance ()
-	{
-		return _instance;
-	}
-	
-	public UnMarshaller cloneUnMarshaller ()
-	{
-		return getInstance();
-	}
-
-	public void setClassLoader (java.lang.ClassLoader classloader)
-	{
-		super.setClassLoader(classloader);
-	}
-
-	/**
-	 * 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 Object read (java.io.InputStream inputStream, java.util.Map metadata) throws IOException, ClassNotFoundException
-	{
-		try
-		{
-			Object invocationMsg = super.read(inputStream, metadata);
-			
-			if ((invocationMsg instanceof InvocationRequest) || (invocationMsg instanceof InvocationResponse))
-			{
-				String serial;
-				InvocationRequest request = null;
-				InvocationResponse response = null;
-				
-				if (invocationMsg instanceof InvocationRequest)
-				{
-					request = (InvocationRequest) invocationMsg;
-					serial = (String) request.getParameter();
-				}
-				else
-				{
-					response = (InvocationResponse) invocationMsg;
-					
-					serial = (String) response.getResult();
-				}
-				
-				if (serial == null) // probably a one-way
-					return null;
-				
-				// MessageType.JBOSS_XML
-				InputStream inStream = new ByteArrayInputStream((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);
-				
-				if (request != null)
-				{
-					request.setParameter(message);
-				
-					return request;
-				}
-				else
-				{
-					InvocationResponse modifiedResponse = new InvocationResponse(response.getSessionId(), message,
-															response.isException(), response.getPayload());
-					
-					return modifiedResponse;
-				}
-			}
-			else
-				return invocationMsg;
-		}
-		catch (SAXException ex)
-		{
-			throw new IOException(ex.toString());
-		}
-		catch (ParserConfigurationException ex)
-		{
-			throw new IOException(ex.toString());
-		}
-		catch (UnmarshalException ex)
-		{
-			throw new IOException(ex.toString());
-		}
-	}
-	
-	private UnMarshalPlugin ()
-	{
-	}
-	
-	private static final UnMarshalPlugin _instance = new UnMarshalPlugin();
-	
-}

Copied: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/UnMarshalPlugin.java (from rev 14388, labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/format/xml/remoting/UnMarshalPlugin.java)
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/UnMarshalPlugin.java	                        (rev 0)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/message/normalized/xml/remoting/UnMarshalPlugin.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -0,0 +1,160 @@
+package org.jboss.internal.soa.esb.message.normalized.xml.remoting;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import javax.xml.parsers.DocumentBuilder;
+import javax.xml.parsers.DocumentBuilderFactory;
+import javax.xml.parsers.ParserConfigurationException;
+
+import org.jboss.remoting.InvocationRequest;
+import org.jboss.remoting.InvocationResponse;
+import org.jboss.remoting.marshal.UnMarshaller;
+import org.jboss.remoting.marshal.serializable.SerializableUnMarshaller;
+import org.jboss.soa.esb.MarshalException;
+import org.jboss.soa.esb.UnmarshalException;
+import org.w3c.dom.Document;
+import org.xml.sax.SAXException;
+
+/*
+ * 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 UnMarshalPlugin extends SerializableUnMarshaller //implements UnMarshaller
+{
+	private static final long serialVersionUID = 0xdeadbeef;
+
+	public static final UnMarshalPlugin getInstance ()
+	{
+		return _instance;
+	}
+	
+	public UnMarshaller cloneUnMarshaller ()
+	{
+		return getInstance();
+	}
+
+	public void setClassLoader (java.lang.ClassLoader classloader)
+	{
+		super.setClassLoader(classloader);
+	}
+
+	/**
+	 * 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 Object read (java.io.InputStream inputStream, java.util.Map metadata) throws IOException, ClassNotFoundException
+	{
+		try
+		{
+			Object invocationMsg = super.read(inputStream, metadata);
+			
+			if ((invocationMsg instanceof InvocationRequest) || (invocationMsg instanceof InvocationResponse))
+			{
+				String serial;
+				InvocationRequest request = null;
+				InvocationResponse response = null;
+				
+				if (invocationMsg instanceof InvocationRequest)
+				{
+					request = (InvocationRequest) invocationMsg;
+					serial = (String) request.getParameter();
+				}
+				else
+				{
+					response = (InvocationResponse) invocationMsg;
+					
+					serial = (String) response.getResult();
+				}
+				
+				if (serial == null) // probably a one-way
+					return null;
+				
+				// MessageType.JBOSS_XML
+				InputStream inStream = new ByteArrayInputStream((serial).getBytes());
+				DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance();
+				factory.setNamespaceAware(true);
+				
+				DocumentBuilder builder = factory.newDocumentBuilder();
+				Document doc = builder.parse(inStream);
+		
+				org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl message = new org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl();
+				message.fromXML(doc);
+				
+				if (request != null)
+				{
+					request.setParameter(message);
+				
+					return request;
+				}
+				else
+				{
+					InvocationResponse modifiedResponse = new InvocationResponse(response.getSessionId(), message,
+															response.isException(), response.getPayload());
+					
+					return modifiedResponse;
+				}
+			}
+			else
+				return invocationMsg;
+		}
+		catch (SAXException ex)
+		{
+			throw new IOException(ex.toString());
+		}
+		catch (ParserConfigurationException ex)
+		{
+			throw new IOException(ex.toString());
+		}
+		catch (UnmarshalException ex)
+		{
+			throw new IOException(ex.toString());
+		}
+	}
+	
+	private UnMarshalPlugin ()
+	{
+	}
+	
+	private static final UnMarshalPlugin _instance = new UnMarshalPlugin();
+	
+}

Modified: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/local/ReceiverImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/local/ReceiverImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/local/ReceiverImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -2,8 +2,8 @@
 
 import javax.management.MBeanServer;
 
-import org.jboss.internal.soa.esb.message.format.xml.remoting.MarshalPlugin;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.UnMarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.MarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.UnMarshalPlugin;
 import org.jboss.remoting.InvocationRequest;
 import org.jboss.remoting.InvokerLocator;
 import org.jboss.remoting.ServerInvocationHandler;

Modified: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/local/TwoWayReceiverImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/local/TwoWayReceiverImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/local/TwoWayReceiverImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -2,8 +2,8 @@
 
 import javax.management.MBeanServer;
 
-import org.jboss.internal.soa.esb.message.format.xml.remoting.MarshalPlugin;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.UnMarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.MarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.UnMarshalPlugin;
 import org.jboss.remoting.InvocationRequest;
 import org.jboss.remoting.InvokerLocator;
 import org.jboss.remoting.ServerInvocationHandler;

Modified: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/remoting/ReceiverImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/remoting/ReceiverImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/remoting/ReceiverImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -2,8 +2,8 @@
 
 import javax.management.MBeanServer;
 
-import org.jboss.internal.soa.esb.message.format.xml.remoting.MarshalPlugin;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.UnMarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.MarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.UnMarshalPlugin;
 import org.jboss.remoting.InvocationRequest;
 import org.jboss.remoting.InvokerLocator;
 import org.jboss.remoting.ServerInvocationHandler;

Modified: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/remoting/TwoWayReceiverImpl.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/remoting/TwoWayReceiverImpl.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/internal/soa/esb/spi/remoting/TwoWayReceiverImpl.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -2,8 +2,8 @@
 
 import javax.management.MBeanServer;
 
-import org.jboss.internal.soa.esb.message.format.xml.remoting.MarshalPlugin;
-import org.jboss.internal.soa.esb.message.format.xml.remoting.UnMarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.MarshalPlugin;
+import org.jboss.internal.soa.esb.message.normalized.xml.remoting.UnMarshalPlugin;
 import org.jboss.remoting.InvocationRequest;
 import org.jboss.remoting.InvokerLocator;
 import org.jboss.remoting.ServerInvocationHandler;

Modified: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/soa/esb/message/Body.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/soa/esb/message/Body.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/soa/esb/message/Body.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -27,17 +27,10 @@
 
 /**
  * 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
+ * payload as far as clients and services are concerned. A body may contain
+ * 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.
+ * Object type.
  */
 
 public abstract class Body

Modified: labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/soa/esb/message/Fault.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/soa/esb/message/Fault.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/main/java/org/jboss/soa/esb/message/Fault.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -28,6 +28,9 @@
  * A fault consists of a unique code (MANDATORY) and a reason string (OPTIONAL).
  */
 
+
+// TODO make class
+
 public interface Fault
 {
 	/**

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/infrastructure/tests/DispatcherUnitTest.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/infrastructure/tests/DispatcherUnitTest.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/infrastructure/tests/DispatcherUnitTest.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -33,7 +33,7 @@
 import org.jboss.soa.esb.infrastructure.NullReceiverDispatcherPlugin;
 import org.jboss.soa.esb.infrastructure.NullSenderDispatcherPlugin;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 
 /**
  * Unit tests for the Dispatchers.
@@ -112,7 +112,7 @@
 			
 			Dispatcher root = DispatcherFactory.getFactory().getDispatcherHierarchy(theContract.getRootContract());
 			
-			Message msg = MessageFactory.getInstance().getMessage();
+			Message msg = ExternalizationFactory.getInstance().getMessage();
 			
 			msg.getBody().add("foo", "bar");
 			

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/format/tests/ExampleMessagePlugin.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -3,7 +3,7 @@
 import java.net.URI;
 
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.externalization.MessagePlugin;
+import org.jboss.soa.esb.message.externalization.ExternalizationPlugin;
 
 /*
  * JBoss, Home of Professional Open Source
@@ -35,7 +35,7 @@
  *
  */
 
-public class ExampleMessagePlugin implements MessagePlugin
+public class ExampleMessagePlugin implements ExternalizationPlugin
 {
 	
 	public static final String URN = "foobar";

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/format/tests/MessageFactoryUnitTest.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -27,8 +27,8 @@
 import junit.framework.TestCase;
 
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.externalization.MessageFactory;
-import org.jboss.soa.esb.message.externalization.MessagePlugin;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationPlugin;
 import org.jboss.soa.esb.message.externalization.ExternalizationType;
 
 /**
@@ -41,19 +41,19 @@
 {
 	public void testDefaultMessage ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage();
+		Message msg = ExternalizationFactory.getInstance().getMessage();
 		
 		assertEquals((msg != null), true);
 	}
 	
 	public void testURIMessage ()
 	{
-		Message msg1 = MessageFactory.getInstance().getMessage(ExternalizationType.DEFAULT_TYPE);
-		Message msg2 = MessageFactory.getInstance().getMessage();
+		Message msg1 = ExternalizationFactory.getInstance().getMessage(ExternalizationType.DEFAULT_TYPE);
+		Message msg2 = ExternalizationFactory.getInstance().getMessage();
 		
 		assertEquals(msg1.getType().equals(msg2.getType()), true);
 		
-		Message msg3 = MessageFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
+		Message msg3 = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
 		
 		assertEquals(msg1.getType().equals(msg3.getType()), false);
 	}
@@ -62,7 +62,7 @@
 	{
 		try
 		{
-			Message msg = MessageFactory.getInstance().getMessage(new URI("urn:foo"));
+			Message msg = ExternalizationFactory.getInstance().getMessage(new URI("urn:foo"));
 			
 			assertEquals((msg == null), true);
 		}
@@ -77,7 +77,7 @@
 		try
 		{
 			@SuppressWarnings("unused")
-			Message msg = MessageFactory.getInstance().getMessage(null);
+			Message msg = ExternalizationFactory.getInstance().getMessage(null);
 			
 			fail();
 		}
@@ -96,7 +96,7 @@
 		try
 		{
 			@SuppressWarnings("unused")
-			Message msg = MessageFactory.getInstance().getMessage(null, null);
+			Message msg = ExternalizationFactory.getInstance().getMessage(null, null);
 			
 			fail();
 		}
@@ -112,14 +112,14 @@
 	
 	public void testPlugin ()
 	{
-		System.setProperty(MessagePlugin.MESSAGE_PLUGIN+"1", ExampleMessagePlugin.class.getName());
+		System.setProperty(ExternalizationPlugin.MESSAGE_PLUGIN+"1", ExampleMessagePlugin.class.getName());
 		
-		MessageFactory.getInstance().reset();
+		ExternalizationFactory.getInstance().reset();
 		
 		try
 		{
 			URI uri = new URI(ExampleMessagePlugin.URN);
-			Message msg = MessageFactory.getInstance().getMessage(uri);
+			Message msg = ExternalizationFactory.getInstance().getMessage(uri);
 
 			assertEquals(msg.getType().equals(uri), true);
 		}

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/AttachmentUnitTest.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -36,7 +36,7 @@
 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.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 import org.jboss.soa.esb.message.externalization.ExternalizationType;
 import org.w3c.dom.Document;
 
@@ -54,7 +54,7 @@
 
 	public void testSerializeAttachment()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -122,7 +122,7 @@
 
 	public void testXMLAttachment()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertEquals((msg != null), true);
@@ -173,7 +173,7 @@
 					.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;
+			org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl) msg;
 
 			doc = theImpl.toXML(doc);
 
@@ -190,7 +190,7 @@
 
 			System.err.println("Message looks like: " + documentAsString);
 
-			org.jboss.internal.soa.esb.message.format.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
+			org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl();
 
 			nImpl.fromXML(doc);
 

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/BodyUnitTest.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/BodyUnitTest.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/BodyUnitTest.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -33,9 +33,9 @@
 
 import junit.framework.TestCase;
 
-import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
+import org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 import org.jboss.soa.esb.message.externalization.ExternalizationType;
 import org.w3c.dom.Document;
 
@@ -55,7 +55,7 @@
 	{
 		// get XML message
 
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertEquals((msg != null), true);
@@ -108,7 +108,7 @@
 	{
 		// get XML message
 
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertEquals((msg != null), true);
@@ -158,7 +158,7 @@
 	{
 		// get XML message
 
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -194,7 +194,7 @@
 	{
 		// get XML message
 
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/FaultUnitTest.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/FaultUnitTest.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/FaultUnitTest.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -36,7 +36,7 @@
 
 import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 import org.jboss.soa.esb.message.externalization.ExternalizationType;
 import org.w3c.dom.Document;
 
@@ -54,7 +54,7 @@
 
 	public void testSerializeFault ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -92,7 +92,7 @@
 
 	public void testXMLFault ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertEquals((msg != null), true);
@@ -111,7 +111,7 @@
 					.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;
+			org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl) msg;
 
 			doc = theImpl.toXML(doc);
 
@@ -128,7 +128,7 @@
 
 			System.err.println("Message looks like: " + documentAsString);
 			
-			org.jboss.internal.soa.esb.message.format.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.format.xml.MessageImpl();
+			org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl();
 			
 			nImpl.fromXML(doc);
 

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/MessageUnitTest.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/MessageUnitTest.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/MessageUnitTest.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -25,7 +25,7 @@
 import junit.framework.TestCase;
 
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 import org.jboss.soa.esb.message.externalization.ExternalizationType;
 
 /**
@@ -39,7 +39,7 @@
 	
 	public void testDefaultMessageFields ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage();
+		Message msg = ExternalizationFactory.getInstance().getMessage();
 		
 		assertEquals((msg.getBody() != null), true);
 		assertEquals((msg.getHeader() != null), true);
@@ -51,7 +51,7 @@
 	
 	public void testXMLMessageFields ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
 		
 		assertEquals((msg.getBody() != null), true);
 		assertEquals((msg.getHeader() != null), true);
@@ -63,7 +63,7 @@
 	
 	public void testSerializedMessageFields ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
 		
 		assertEquals((msg.getBody() != null), true);
 		assertEquals((msg.getHeader() != null), true);

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/PropertiesUnitTest.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -34,7 +34,7 @@
 
 import org.jboss.internal.soa.esb.message.format.serialized.MessageImpl;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 import org.jboss.soa.esb.message.externalization.ExternalizationType;
 import org.w3c.dom.Document;
 
@@ -49,7 +49,7 @@
 
 	public void testSerializeProperties()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -105,7 +105,7 @@
 
 	public void testXMLProperties()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertEquals((msg != null), true);
@@ -140,11 +140,11 @@
 					.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;
+			org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl theImpl = (org.jboss.internal.soa.esb.message.normalized.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();
+			org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl nImpl = new org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl();
 			
 			nImpl.fromXML(doc);
 

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/SerializedMessageUnitTest.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -41,7 +41,7 @@
 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.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 import org.jboss.soa.esb.message.externalization.ExternalizationType;
 
 /**
@@ -55,7 +55,7 @@
 
 	public void testSerialize()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -79,7 +79,7 @@
 	{
 		// get XML message
 
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -108,7 +108,7 @@
 	
 	public void testHeader ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -138,7 +138,7 @@
 	
 	public void testInvalidAdd ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -160,7 +160,7 @@
 
 	public void testAddBytes ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -196,14 +196,14 @@
 	
 	public void testReplace ()
 	{
-		Message msg1 = MessageFactory.getInstance().getMessage(
+		Message msg1 = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg1 != null), true);
 		
 		String foo = "foo";
 		
-		Message msg2 = MessageFactory.getInstance().getMessage(
+		Message msg2 = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg2 != null), true);
@@ -222,14 +222,14 @@
 	
 	public void testMerge ()
 	{
-		Message msg1 = MessageFactory.getInstance().getMessage(
+		Message msg1 = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg1 != null), true);
 		
 		String foo = "foo";
 		
-		Message msg2 = MessageFactory.getInstance().getMessage(
+		Message msg2 = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg2 != null), true);
@@ -248,7 +248,7 @@
 	
 	public void testAddObjects ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -284,7 +284,7 @@
 	
 	public void testGetNames ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -342,7 +342,7 @@
 	
 	public void testAddInvalidObject ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -364,7 +364,7 @@
 	
 	public void testRemoveObjects ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JAVA_SERIALIZED);
 
 		assertEquals((msg != null), true);
@@ -402,7 +402,7 @@
 	
 	public void testJmsEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
 		JMSEpr epr = new JMSEpr(JMSEpr.TOPIC_TYPE, "foo", "bar");
 		
 		msg.getHeader().getCall().setTo(epr);
@@ -438,7 +438,7 @@
 	
 	public void testHttpEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
 
 		try
 		{
@@ -475,7 +475,7 @@
 	
 	public void testEmailEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
 
 		try
 		{
@@ -512,7 +512,7 @@
 	
 	public void testFtpEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
 
 		try
 		{
@@ -551,7 +551,7 @@
 	
 	public void testJdbcEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
 
 		try
 		{
@@ -588,7 +588,7 @@
 	
 	public void testFileEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
 
 		try
 		{
@@ -627,7 +627,7 @@
 	
 	public void testSFtpEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JAVA_SERIALIZED);
 
 		try
 		{

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/message/tests/XMLMessageUnitTest.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -31,7 +31,7 @@
 
 import junit.framework.TestCase;
 
-import org.jboss.internal.soa.esb.message.format.xml.MessageImpl;
+import org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl;
 import org.jboss.soa.esb.addressing.Call;
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.addressing.eprs.EmailEpr;
@@ -42,7 +42,7 @@
 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.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 import org.jboss.soa.esb.message.externalization.ExternalizationType;
 import org.w3c.dom.Document;
 import org.xml.sax.InputSource;
@@ -63,7 +63,7 @@
 	{
 		// get XML message
 
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("created message", msg);
@@ -84,7 +84,7 @@
 	{
 		// get XML message
 
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("created message", msg);
@@ -103,7 +103,7 @@
 
 	public void testHeader ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("created message", msg);
@@ -133,7 +133,7 @@
 
 	public void testInvalidAdd ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("created message", msg);
@@ -155,7 +155,7 @@
 	
 	public void testAddBytes ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("created message", msg);
@@ -183,14 +183,14 @@
 	
 	public void testReplace ()
 	{
-		Message msg1 = MessageFactory.getInstance().getMessage(
+		Message msg1 = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("created message", msg1);
 		
 		String foo = "foo";
 		
-		Message msg2 = MessageFactory.getInstance().getMessage(
+		Message msg2 = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("second created message", msg2);
@@ -209,14 +209,14 @@
 	
 	public void testMerge ()
 	{
-		Message msg1 = MessageFactory.getInstance().getMessage(
+		Message msg1 = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("created message", msg1);
 		
 		String foo = "foo";
 		
-		Message msg2 = MessageFactory.getInstance().getMessage(
+		Message msg2 = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("second created message", msg2);
@@ -235,7 +235,7 @@
 	
 	public void testAddObjects ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("created message", msg);
@@ -267,7 +267,7 @@
 	
 	public void testGetNames ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("created message", msg);
@@ -324,7 +324,7 @@
 	
 	public void testRemoveObjects ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(
+		Message msg = ExternalizationFactory.getInstance().getMessage(
 				ExternalizationType.JBOSS_XML);
 
 		assertNotNull("created message", msg);
@@ -354,7 +354,7 @@
 	
 	public void testJmsEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
 		JMSEpr epr = new JMSEpr(JMSEpr.TOPIC_TYPE, "foo", "bar");
 		
 		msg.getHeader().getCall().setTo(epr);
@@ -380,7 +380,7 @@
 	
 	public void testHttpEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
 
 		try
 		{
@@ -407,7 +407,7 @@
 	
 	public void testEmailEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
 
 		try
 		{
@@ -434,7 +434,7 @@
 	
 	public void testFtpEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
 
 		try
 		{
@@ -463,7 +463,7 @@
 	
 	public void testJdbcEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
 
 		try
 		{
@@ -490,7 +490,7 @@
 	
 	public void testFileEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
 
 		try
 		{
@@ -519,7 +519,7 @@
 	
 	public void testSFtpEPRType ()
 	{
-		Message msg = MessageFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
+		Message msg = ExternalizationFactory.getInstance().getMessage(ExternalizationType.JBOSS_XML);
 
 		try
 		{

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/oneway/TcpClient.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/oneway/TcpClient.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/oneway/TcpClient.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -11,7 +11,7 @@
 import org.jboss.soa.esb.api.SenderFactory;
 import org.jboss.soa.esb.message.Body;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 import org.jboss.soa.esb.spi.Receiver;
 import org.jboss.soa.esb.spi.ReceiverFactory;
 import org.jboss.soa.esb.spi.Service;
@@ -54,7 +54,7 @@
 				factory.setNamespaceAware(true);
 				
 				Document doc = factory.newDocumentBuilder().newDocument();
-				((org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg).toXML(doc);
+				((org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl) msg).toXML(doc);
 				StringWriter sWriter = new StringWriter();
 				OutputFormat format = new OutputFormat();
 				format.setIndenting(true);
@@ -127,7 +127,7 @@
 		 * Create the message payload.
 		 */
 		
-		Message msg = MessageFactory.getInstance().getMessage();
+		Message msg = ExternalizationFactory.getInstance().getMessage();
 		Body payload = msg.getBody();
 		
 		String message = "Hello World";

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/oneway/TcpService.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/oneway/TcpService.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/oneway/TcpService.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -11,7 +11,7 @@
 import org.jboss.soa.esb.api.SenderFactory;
 import org.jboss.soa.esb.message.Body;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 import org.jboss.soa.esb.spi.Receiver;
 import org.jboss.soa.esb.spi.ReceiverFactory;
 import org.jboss.soa.esb.spi.Service;
@@ -54,7 +54,7 @@
 				factory.setNamespaceAware(true);
 				
 				Document doc = factory.newDocumentBuilder().newDocument();
-				((org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg).toXML(doc);
+				((org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl) msg).toXML(doc);
 				StringWriter sWriter = new StringWriter();
 				OutputFormat format = new OutputFormat();
 				format.setIndenting(true);
@@ -72,7 +72,7 @@
 			{
 				Sender tcpClientPlugin = SenderFactory.getInstance().getSender(msg.getHeader().getCall().getReplyTo());
 				
-				Message response = MessageFactory.getInstance().getMessage();
+				Message response = ExternalizationFactory.getInstance().getMessage();
 				response.getHeader().setCall(new Call(msg.getHeader().getCall().getReplyTo()));
 				
 				Body payload = response.getBody();

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/twoway/TcpClient.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/twoway/TcpClient.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/twoway/TcpClient.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -11,7 +11,7 @@
 import org.jboss.soa.esb.api.TwoWaySender;
 import org.jboss.soa.esb.message.Body;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 import org.w3c.dom.Document;
 
 import com.sun.org.apache.xml.internal.serialize.OutputFormat;
@@ -94,7 +94,7 @@
 		 * Create the message payload.
 		 */
 		
-		Message msg = MessageFactory.getInstance().getMessage();
+		Message msg = ExternalizationFactory.getInstance().getMessage();
 		Body payload = msg.getBody();
 		
 		String message = "Hello World";
@@ -118,7 +118,7 @@
 				factory.setNamespaceAware(true);
 				
 				Document doc = factory.newDocumentBuilder().newDocument();
-				((org.jboss.internal.soa.esb.message.format.xml.MessageImpl) response).toXML(doc);
+				((org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl) response).toXML(doc);
 				StringWriter sWriter = new StringWriter();
 				OutputFormat format = new OutputFormat();
 				format.setIndenting(true);

Modified: labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/twoway/TcpService.java
===================================================================
--- labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/twoway/TcpService.java	2007-08-20 14:38:31 UTC (rev 14388)
+++ labs/jbossesb/workspace/rearch2/core/src/test/java/org/jboss/soa/esb/remoting/twoway/TcpService.java	2007-08-20 15:25:08 UTC (rev 14389)
@@ -8,7 +8,7 @@
 import org.jboss.soa.esb.addressing.EPR;
 import org.jboss.soa.esb.message.Body;
 import org.jboss.soa.esb.message.Message;
-import org.jboss.soa.esb.message.externalization.MessageFactory;
+import org.jboss.soa.esb.message.externalization.ExternalizationFactory;
 import org.jboss.soa.esb.spi.Receiver;
 import org.jboss.soa.esb.spi.ReceiverFactory;
 import org.jboss.soa.esb.spi.Service;
@@ -51,7 +51,7 @@
 				factory.setNamespaceAware(true);
 				
 				Document doc = factory.newDocumentBuilder().newDocument();
-				((org.jboss.internal.soa.esb.message.format.xml.MessageImpl) msg).toXML(doc);
+				((org.jboss.internal.soa.esb.message.normalized.xml.MessageImpl) msg).toXML(doc);
 				StringWriter sWriter = new StringWriter();
 				OutputFormat format = new OutputFormat();
 				format.setIndenting(true);
@@ -69,7 +69,7 @@
 			 * How do we get the implicit ReplyTo address?
 			 */
 			
-			Message response = MessageFactory.getInstance().getMessage();
+			Message response = ExternalizationFactory.getInstance().getMessage();
 			Body payload = response.getBody();
 			
 			String message = "Echo echo echo echo";




More information about the jboss-svn-commits mailing list