[jboss-svn-commits] JBL Code SVN: r6490 - labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Sat Sep 30 19:09:24 EDT 2006


Author: mark.little at jboss.com
Date: 2006-09-30 19:09:19 -0400 (Sat, 30 Sep 2006)
New Revision: 6490

Added:
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java
Log:


Added: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java	2006-09-30 23:09:02 UTC (rev 6489)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/AttachmentImpl.java	2006-09-30 23:09:19 UTC (rev 6490)
@@ -0,0 +1,152 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import org.jboss.soa.esb.message.Attachment;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Map;
+import java.io.Serializable;
+
+/**
+ * Messages may contain attachments that do not appear in the main payload body.
+ * For example, binary document formats, zip files etc.
+ * 
+ * @author Mark Little
+ */
+
+public class AttachmentImpl implements Attachment, java.io.Serializable
+{
+	private static final long serialVersionUID = 0x0;
+
+	public Object get(String name)
+	{
+		return _table.get(name);
+	}
+
+	public Object put(String name, Object value) 
+	{
+		if (value instanceof Serializable)
+			return _table.put(name,(Serializable)value);
+		throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public Object remove(String name) 
+	{
+		return _table.remove(name);
+	}
+
+	public String[] getNames() 
+	{
+		return _table.keySet().toArray(new String[_table.size()]);
+	}
+
+	public Object itemAt(int index) throws IndexOutOfBoundsException 
+	{
+		return _list.get(index);
+	}
+
+	public Object removeItemAt(int index) throws IndexOutOfBoundsException 
+	{
+		return _list.remove(index);
+	}
+
+	public Object replaceItemAt(int index, Object value) throws IndexOutOfBoundsException 
+	{
+		if (value instanceof Serializable)
+			return _list.set(index,(Serializable)value);
+		throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public void addItem(Object value) 
+	{
+		if (value instanceof Serializable)
+			_list.add((Serializable)value);
+		else
+			throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public void addItemAt(int index, Object value) throws IndexOutOfBoundsException 
+	{
+		if (value instanceof Serializable)
+			_list.add(index,(Serializable)value);
+		else
+			throw new IllegalArgumentException("value must be Serializable");
+	}
+
+	public int getNamedCount() 
+	{
+		return _table.size();
+	}
+	public int getUnnamedCount() 
+	{
+		return _list.size();
+	}
+	public String toString() 
+	{ return new StringBuilder()
+		.append("Attachment - Named:").append(_table.toString())
+		.append(" Unnamed:").append(_list.toString())
+		.toString();
+	}
+	
+	@Override
+	public boolean equals(Object arg)
+	{
+		if (! (arg instanceof Attachment))
+			return false;
+		Attachment other = (Attachment)arg;
+
+		if (other.getNamedCount() != _table.size())
+			return false;
+		for(Map.Entry<String,Serializable>oCurr : _table.entrySet())
+		{	
+			Object val = other.get(oCurr.getKey());
+			if (null==oCurr.getValue())
+				if (null==val)
+					continue;
+				else
+					return false;
+			if (!oCurr.getValue().equals(val))
+				return false;
+		}
+
+		if (other.getUnnamedCount() != _list.size())
+			return false;
+		int index = 0;
+		for (Serializable oCurr : _list)
+		{
+			Object val = other.itemAt(index++);
+			if (null==oCurr)
+				if (null==val)
+					continue;
+				else
+					return false;
+			if (!oCurr.equals(val))
+				return false;
+		}
+		return true;		
+	}
+
+	ArrayList<Serializable> _list = new ArrayList<Serializable>();
+	Hashtable<String,Serializable> _table = new Hashtable<String,Serializable>();
+}

Added: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java	2006-09-30 23:09:02 UTC (rev 6489)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java	2006-09-30 23:09:19 UTC (rev 6490)
@@ -0,0 +1,125 @@
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import java.io.Serializable;
+import java.lang.IllegalArgumentException;
+import java.util.Hashtable;
+
+import org.jboss.soa.esb.message.Body;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+/*
+ * This implementation requires that all contents are serializable.
+ */
+
+public class BodyImpl implements Body, java.io.Serializable
+{
+	private static final long serialVersionUID = 0x0;
+	
+	public BodyImpl ()
+	{
+		_content = null;
+		_objects = new Hashtable<String, Serializable>();
+	}
+	
+	public void setContents (byte[] content)
+	{
+		_content = content;
+	}
+
+	public byte[] getContents ()
+	{
+		return _content;
+	}
+	
+	public void add (String name, Object value)
+	{
+		if ((name == null) || (value == null))
+			throw new IllegalArgumentException();
+		
+		if (value instanceof Serializable)
+		{
+			synchronized (_objects)
+			{
+				_objects.put(name, (Serializable) value);
+			}
+		}
+		else
+			throw new IllegalArgumentException("Object must be Serializable.");
+	}
+	
+	public Object get (String name)
+	{
+		synchronized (_objects)
+		{
+			return _objects.get(name);
+		}
+	}
+	
+	public Object remove (String name)
+	{
+		synchronized (_objects)
+		{
+			return _objects.remove(name);
+		}
+	}
+	
+	public void replace (Body b)
+	{
+		if (b == null)
+			throw new IllegalArgumentException();
+		
+		setContents(b.getContents());
+		
+		_objects = ((BodyImpl) b)._objects;
+	}
+	
+	public void merge (Body b)
+	{
+		if (b == null)
+			throw new IllegalArgumentException();
+		
+		byte[] toAdd = b.getContents();
+		
+		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;
+			}
+		}
+	}
+	
+	private byte[] _content;
+	private Hashtable<String, Serializable> _objects;
+	
+}
\ No newline at end of file

Added: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java	2006-09-30 23:09:02 UTC (rev 6489)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/ContextImpl.java	2006-09-30 23:09:19 UTC (rev 6490)
@@ -0,0 +1,29 @@
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import org.jboss.soa.esb.message.Context;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+public class ContextImpl implements Context, java.io.Serializable
+{
+	private static final long serialVersionUID = 0x0;
+}
\ No newline at end of file

Added: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java	2006-09-30 23:09:02 UTC (rev 6489)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/FaultImpl.java	2006-09-30 23:09:19 UTC (rev 6490)
@@ -0,0 +1,55 @@
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import java.net.URI;
+
+import org.jboss.soa.esb.message.Fault;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+public class FaultImpl implements Fault, java.io.Serializable
+{
+	private static final long serialVersionUID = 0x0;
+	
+	public URI getCode ()
+	{
+		return _code;
+	}
+	
+	public void setCode (URI code)
+	{
+		_code = code;
+	}
+	
+	public String getReason ()
+	{
+		return _reason;
+	}
+	
+	public void setReason (String reason)
+	{
+		_reason = reason;
+	}
+	
+	private URI _code = null;
+	private String _reason = null;
+	
+}
\ No newline at end of file

Added: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java	2006-09-30 23:09:02 UTC (rev 6489)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/HeaderImpl.java	2006-09-30 23:09:19 UTC (rev 6490)
@@ -0,0 +1,59 @@
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+import java.io.Serializable;
+import java.lang.IllegalArgumentException;
+
+import org.jboss.soa.esb.message.Header;
+import org.jboss.soa.esb.addressing.Call;
+
+/**
+ * The message header. Contains such things as routing information.
+ */
+
+public class HeaderImpl implements Header, Serializable
+{
+	private static final long serialVersionUID = 0x0;
+	
+	public HeaderImpl ()
+	{
+		_call = null;
+	}
+	
+	// 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;
+	}
+
+	private Call _call;
+}
\ No newline at end of file

Added: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java	2006-09-30 23:09:02 UTC (rev 6489)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/MessageImpl.java	2006-09-30 23:09:19 UTC (rev 6490)
@@ -0,0 +1,129 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import 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.format.MessageType;
+import org.jboss.soa.esb.message.Properties;
+
+import java.net.URI;
+import java.io.Serializable;
+
+
+/**
+ * This is the basic internal core message abstraction. A message consists of the following
+ * components:
+ * 
+ * Header: the header information contains information such as the destination EPR, the
+ * sender EPR, where the reply goes etc, i.e., general message-level functional information.
+ * Context: additional information to contextualise the message; for example, transaction or
+ * security data, the identity of the ultimate receiver, or HTTP-cookie like information.
+ * Body: the actual payload of the message.
+ * Fault: any fault information associated with the message.
+ * Attachment: any attachments associated with the message.
+ * 
+ * Each message, once created, has a corresponding element for these 5 components. That element
+ * may be empty (<b>NOT NULL</b>). The object representing the element can then be used to act
+ * on the corresponding data item in the message.
+ * 
+ * @author Mark Little
+ *
+ */
+
+public class MessageImpl implements Message, Serializable
+{
+	private static final long serialVersionUID = 0x0;
+	
+	/**
+	 * @return get the header component of the message.
+	 */
+	
+	public Header getHeader ()
+	{
+		return _theHeader;
+	}
+	
+	/**
+	 * @return get the context component of the message.
+	 */
+	
+	public Context getContext ()
+	{
+		return _theContext;
+	}
+	
+	/**
+	 * @return get the body component of the message.
+	 */
+	
+	public Body getBody ()
+	{
+		return _theBody;
+	}
+	
+	/**
+	 * @return get any faults associated with the message. These should not
+	 * be application level faults, but comms level.
+	 */
+	
+	public Fault getFault ()
+	{
+		return _theFault;
+	}
+	
+	/**
+	 * @return get any message attachments.
+	 */
+	
+	public Attachment getAttachment ()
+	{
+		return _theAttachment;
+	}
+	
+	/**
+	 * @return the type of this message format.
+	 */
+	
+	public URI getType ()
+	{
+		return MessageType.JAVA_SERIALIZED;
+	}
+
+	/**
+	 * @return Map&lt;String,Object&gt; - any message properties.
+	 */
+	public Properties getProperties() 
+	{
+		return _properties;
+	}
+
+	private HeaderImpl _theHeader = new HeaderImpl();
+	private ContextImpl _theContext = new ContextImpl();
+	private BodyImpl _theBody = new BodyImpl();
+	private FaultImpl _theFault = new FaultImpl();
+	private AttachmentImpl _theAttachment = new AttachmentImpl();
+	private Properties _properties = new PropertiesImpl();
+}

Added: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java	2006-09-30 23:09:02 UTC (rev 6489)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/PropertiesImpl.java	2006-09-30 23:09:19 UTC (rev 6490)
@@ -0,0 +1,92 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author schifest at heuristica.com.ar
+ */
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import org.jboss.soa.esb.message.Properties;
+
+import java.util.Hashtable;
+import java.util.Map;
+import java.io.Serializable;
+
+public class PropertiesImpl implements Properties, Serializable
+{
+	private static final long serialVersionUID = 0x0;
+
+	public Object getProperty(String name)
+	{
+		return _table.get(name);
+	}
+
+	public Object getProperty(String name, Object defaultVal)
+	{
+		Object oRet = getProperty(name);
+		return (null == oRet) ? defaultVal : oRet;
+	}
+
+	public Object setProperty(String name, Object value)
+	{
+		if (value instanceof Serializable)
+			return _table.put(name, (Serializable) value);
+		else
+			throw new IllegalArgumentException("Value must be serializable");
+	}
+
+	public Object remove(String name)
+	{
+		return _table.remove(name);
+	}
+	
+	public int size() {return _table.size(); } 
+
+	public String[] getNames()
+	{
+		return _table.keySet().toArray(new String[_table.size()]);
+	}
+
+	public String toString()
+	{
+		return _table.toString();
+	}
+
+	@Override
+	public boolean equals(Object arg)
+	{
+		if (! (arg instanceof Properties))
+			return false;
+		Properties other = (Properties)arg;
+		if (other.size() != _table.size())
+			return false;
+		for(Map.Entry<String,Serializable>oCurr : _table.entrySet())
+		{	
+			Object val = other.getProperty(oCurr.getKey());
+			if (null==oCurr.getValue())
+				if (null==val)
+					continue;
+				else
+					return false;
+			if (!oCurr.getValue().equals(val))
+				return false;
+		}
+		return true;
+	}
+
+	Hashtable<String, Serializable> _table = new Hashtable<String, Serializable>();
+}

Added: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java	2006-09-30 23:09:02 UTC (rev 6489)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/SerializedMessagePlugin.java	2006-09-30 23:09:19 UTC (rev 6490)
@@ -0,0 +1,49 @@
+package org.jboss.internal.soa.esb.message.format.serialized;
+
+import org.jboss.soa.esb.message.Message;
+
+import org.jboss.soa.esb.message.format.MessagePlugin;
+import org.jboss.soa.esb.message.format.MessageType;
+
+import java.net.URI;
+
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, JBoss Inc., and others contributors as indicated 
+ * by the @authors tag. All rights reserved. 
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors. 
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A 
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A 
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author mark.little at jboss.com
+ */
+
+/**
+ * Used to plug in new message formats dynamically.
+ *  
+ * @author Mark Little
+ *
+ */
+
+public class SerializedMessagePlugin implements MessagePlugin
+{
+	public Message getMessage ()
+	{
+		return new MessageImpl();
+	}
+	
+	public URI getType ()
+	{
+		return MessageType.JAVA_SERIALIZED;
+	}
+}




More information about the jboss-svn-commits mailing list