[jboss-svn-commits] JBL Code SVN: r11353 - in labs/jbossesb/trunk/product/core/rosetta/src/org/jboss: internal/soa/esb/message/format/xml and 1 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Apr 26 09:38:06 EDT 2007
Author: mark.little at jboss.com
Date: 2007-04-26 09:38:05 -0400 (Thu, 26 Apr 2007)
New Revision: 11353
Modified:
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/xml/BodyImpl.java
labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/message/Body.java
Log:
added default set/get
Modified: 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 2007-04-26 13:08:21 UTC (rev 11352)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/serialized/BodyImpl.java 2007-04-26 13:38:05 UTC (rev 11353)
@@ -51,6 +51,11 @@
return _content;
}
+ public void add (Object value)
+ {
+ add(Body.DEFAULT_LOCATION, value);
+ }
+
public void add (String name, Object value)
{
if ((name == null) || (value == null))
@@ -67,6 +72,11 @@
throw new IllegalArgumentException("Object must be Serializable.");
}
+ public Object get ()
+ {
+ return get(Body.DEFAULT_LOCATION);
+ }
+
public Object get (String name)
{
synchronized (_objects)
Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java 2007-04-26 13:08:21 UTC (rev 11352)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/internal/soa/esb/message/format/xml/BodyImpl.java 2007-04-26 13:38:05 UTC (rev 11353)
@@ -57,6 +57,11 @@
_objects = new Hashtable<String, Object>();
}
+ public void add (Object value)
+ {
+ add(Body.DEFAULT_LOCATION, value);
+ }
+
public void add(String name, Object value)
{
if ((name == null) || (value == null))
@@ -68,6 +73,11 @@
}
}
+ public Object get ()
+ {
+ return get(Body.DEFAULT_LOCATION);
+ }
+
public Object get(String name)
{
synchronized (_objects)
Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/message/Body.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/message/Body.java 2007-04-26 13:08:21 UTC (rev 11352)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/message/Body.java 2007-04-26 13:38:05 UTC (rev 11353)
@@ -38,9 +38,19 @@
public interface Body
{
- // TODO error handling exceptions
+ public static final String DEFAULT_LOCATION = "org.jboss.soa.esb.message.defaultEntry";
/**
+ * Add the specified Object at the default location within the message.
+ * If the default location is already used then the contents will be
+ * overwritten.
+ *
+ * @param value
+ */
+
+ public void add (Object value);
+
+ /**
* Add the specified Object to the body.
*
* @param name the name of the object. MUST be unique within this body.
@@ -50,6 +60,15 @@
public void add (String name, Object value);
/**
+ * Get the Object at the default location in the message, or <code>null</code>
+ * otherwise.
+ *
+ * @return the object.
+ */
+
+ public Object get ();
+
+ /**
* Get the specified Object, or <code>null</code> if not present.
*
* @param name the name of the Object to retrieve.
@@ -68,7 +87,8 @@
public Object remove (String name);
/**
- * Set the byte content of the body.
+ * Set the byte content of the body. This does not
+ * affect any of the named objects or attachments.
*
* @param content the message bytes
*/
More information about the jboss-svn-commits
mailing list