[jboss-svn-commits] JBL Code SVN: r11910 - in labs/jbossesb/trunk/product: docs and 1 other directory.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu May 17 11:52:56 EDT 2007


Author: mark.little at jboss.com
Date: 2007-05-17 11:52:56 -0400 (Thu, 17 May 2007)
New Revision: 11910

Modified:
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/message/Attachment.java
   labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/message/Body.java
   labs/jbossesb/trunk/product/docs/ProgrammersGuide.odt
Log:
Added more text around objects, bytes and attachments.

Modified: labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/message/Attachment.java
===================================================================
--- labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/message/Attachment.java	2007-05-17 15:05:52 UTC (rev 11909)
+++ labs/jbossesb/trunk/product/core/rosetta/src/org/jboss/soa/esb/message/Attachment.java	2007-05-17 15:52:56 UTC (rev 11910)
@@ -26,6 +26,9 @@
  * For example, binary document formats, zip files etc.
  * <br/>Handles both 'named' attachment and a list of 'unnamed' attachments
  * 
+ * Eventually attachments will be allowed to have difference encoding properties
+ * as they can in the SOAP/Attachments standard.
+ * 
  * @author Mark Little
  */
 

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

Modified: labs/jbossesb/trunk/product/docs/ProgrammersGuide.odt
===================================================================
(Binary files differ)




More information about the jboss-svn-commits mailing list