You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ra...@apache.org on 2013/07/19 20:44:24 UTC

svn commit: r1504961 [7/11] - in /activemq/activemq-blaze/trunk: ./ src/main/java/org/apache/activeblaze/ src/main/java/org/apache/activeblaze/cluster/ src/main/java/org/apache/activeblaze/group/ src/main/java/org/apache/activeblaze/impl/destination/ s...

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/LRUCache.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/LRUCache.java?rev=1504961&r1=1504960&r2=1504961&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/LRUCache.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/LRUCache.java Fri Jul 19 18:44:21 2013
@@ -21,10 +21,8 @@ import java.util.Map;
 
 /**
  * A Simple LRU Cache
- * 
+ *
  * @version $Revision$
- * @param <K>
- * @param <V>
  */
 
 public class LRUCache<K, V> extends LinkedHashMap<K, V> {
@@ -35,13 +33,11 @@ public class LRUCache<K, V> extends Link
      * Default constructor for an LRU Cache The default capacity is 10000
      */
     public LRUCache() {
-        this(0,10000, 0.75f, true);
+        this(0, 10000, 0.75f, true);
     }
 
     /**
      * Constructs a LRUCache with a maximum capacity
-     * 
-     * @param maximumCacheSize
      */
     public LRUCache(int maximumCacheSize) {
         this(0, maximumCacheSize, 0.75f, true);
@@ -50,14 +46,13 @@ public class LRUCache<K, V> extends Link
     /**
      * Constructs an empty <tt>LRUCache</tt> instance with the specified
      * initial capacity, maximumCacheSize,load factor and ordering mode.
-     * 
+     *
      * @param initialCapacity the initial capacity.
-     * @param maximumCacheSize
-     * @param loadFactor the load factor.
-     * @param accessOrder the ordering mode - <tt>true</tt> for access-order,
-     *                <tt>false</tt> for insertion-order.
+     * @param loadFactor      the load factor.
+     * @param accessOrder     the ordering mode - <tt>true</tt> for access-order,
+     *                        <tt>false</tt> for insertion-order.
      * @throws IllegalArgumentException if the initial capacity is negative or
-     *                 the load factor is non-positive.
+     *                                  the load factor is non-positive.
      */
 
     public LRUCache(int initialCapacity, int maximumCacheSize, float loadFactor, boolean accessOrder) {
@@ -79,7 +74,7 @@ public class LRUCache<K, V> extends Link
         this.maxCacheSize = maxCacheSize;
     }
 
-    protected boolean removeEldestEntry(Map.Entry<K,V> eldest) {
+    protected boolean removeEldestEntry(Map.Entry<K, V> eldest) {
         return size() > this.maxCacheSize;
     }
 }

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/LinkedNode.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/LinkedNode.java?rev=1504961&r1=1504960&r2=1504961&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/LinkedNode.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/LinkedNode.java Fri Jul 19 18:44:21 2013
@@ -19,7 +19,7 @@ package org.apache.activeblaze.util;
 /**
  * Provides a base class for you to extend when you want object to maintain a
  * doubly linked list to other objects without using a collection class.
- * 
+ *
  * @author chirino
  */
 public class LinkedNode {
@@ -103,7 +103,6 @@ public class LinkedNode {
 
     /**
      * @param leftHead the node to link after this node.
-     * @return
      * @return this
      */
     public LinkedNode linkBefore(LinkedNode leftHead) {
@@ -148,7 +147,7 @@ public class LinkedNode {
         // Update our links..
         reset();
     }
-    
+
     public void reset() {
         next = this;
         prev = this;

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/ObjectFinder.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/ObjectFinder.java?rev=1504961&r1=1504960&r2=1504961&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/ObjectFinder.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/ObjectFinder.java Fri Jul 19 18:44:21 2013
@@ -25,7 +25,6 @@ import java.util.concurrent.ConcurrentHa
 
 /**
  * Find and build an object from a location
- *
  */
 public class ObjectFinder {
 
@@ -34,7 +33,6 @@ public class ObjectFinder {
 
     /**
      * Constructor
-     * @param path
      */
     public ObjectFinder(String path) {
         this.path = path;
@@ -42,11 +40,10 @@ public class ObjectFinder {
 
     /**
      * Creates a new instance of the given key
-     * 
+     *
      * @param key is the key to add to the path to find a text file containing
-     *                the factory name
+     *            the factory name
      * @return a newly created instance
-     * @throws Exception 
      */
     public Object newInstance(String key) throws Exception {
         return newInstance(key, null);

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/PropertyUtil.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/PropertyUtil.java?rev=1504961&r1=1504960&r2=1504961&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/PropertyUtil.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/PropertyUtil.java Fri Jul 19 18:44:21 2013
@@ -26,20 +26,17 @@ import java.net.URI;
 import java.net.URLDecoder;
 import java.util.Collections;
 import java.util.HashMap;
+import java.util.LinkedHashMap;
 import java.util.Map;
 
 /**
  * Utilities for properties
- * 
  */
 public class PropertyUtil {
     /**
      * Get properties from a URI
-     * 
-     * @param uri
+     *
      * @return <Code>Map</Code> of properties
-     * @throws Exception
-     * 
      */
     public static Map<String, String> parseParameters(URI uri) throws Exception {
         return uri.getQuery() == null ? Collections.EMPTY_MAP : parseQuery(stripPrefix(uri.getQuery(), "?"));
@@ -47,11 +44,8 @@ public class PropertyUtil {
 
     /**
      * Parse properties from a named resource -eg. a URI or a simple name e.g. foo?name="fred"&size=2
-     * 
-     * @param uri
+     *
      * @return <Code>Map</Code> of properties
-     * @throws Exception
-     * 
      */
     public static Map<String, String> parseParameters(String uri) throws Exception {
         return uri == null ? Collections.EMPTY_MAP : parseQuery(stripUpto(uri, '?'));
@@ -59,14 +53,12 @@ public class PropertyUtil {
 
     /**
      * Get properties from a uri
-     * 
-     * @param uri
+     *
      * @return <Code>Map</Code> of properties
-     * @throws Exception
      */
     public static Map<String, String> parseQuery(String uri) throws Exception {
         if (uri != null) {
-            Map<String, String> rc = new HashMap<String, String>();
+            Map<String, String> rc = new LinkedHashMap<String, String>();
             if (uri != null) {
                 String[] parameters = uri.split("&");
                 for (int i = 0; i < parameters.length; i++) {
@@ -87,11 +79,8 @@ public class PropertyUtil {
 
     /**
      * Add bean properties to a URI
-     * 
-     * @param uri
-     * @param bean
+     *
      * @return <Code>Map</Code> of properties
-     * @throws Exception
      */
     public static String addPropertiesToURIFromBean(String uri, Object bean) throws Exception {
         Map<String, String> props = PropertyUtil.getProperties(bean);
@@ -100,12 +89,8 @@ public class PropertyUtil {
 
     /**
      * Add properties to a URI
-     * 
-     * @param uri
-     * @param props
+     *
      * @return uri with properties on
-     * @throws Exception
-     * 
      */
     public static String addPropertiesToURI(String uri, Map<String, String> props) throws Exception {
         String result = uri;
@@ -118,12 +103,12 @@ public class PropertyUtil {
             if (!map.isEmpty()) {
                 base.append('?');
                 boolean first = true;
-                for (Map.Entry<String, String> entry : map.entrySet()) {
+                for (String key : map.keySet()) {
                     if (!first) {
                         base.append('&');
                     }
                     first = false;
-                    base.append(entry.getKey()).append("=").append(entry.getValue());
+                    base.append(key).append("=").append(map.get(key));
                 }
                 result = base.toString();
             }
@@ -133,9 +118,6 @@ public class PropertyUtil {
 
     /**
      * Set properties on an object
-     * 
-     * @param target
-     * @param props
      */
     public static void setProperties(Object target, Map<String, String> props) {
         if (target == null) {
@@ -152,10 +134,8 @@ public class PropertyUtil {
 
     /**
      * Get properties from an object
-     * 
-     * @param object
+     *
      * @return <Code>Map</Code> of properties
-     * @throws Exception
      */
     public static Map<String, String> getProperties(Object object) throws Exception {
         Map<String, String> props = new HashMap<String, String>();
@@ -175,10 +155,7 @@ public class PropertyUtil {
 
     /**
      * Set a property
-     * 
-     * @param target
-     * @param name
-     * @param value
+     *
      * @return true if set
      */
     public static boolean setProperty(Object target, String name, Object value) {
@@ -191,10 +168,10 @@ public class PropertyUtil {
             // If the type is null or it matches the needed type, just use the
             // value directly
             if (value == null || value.getClass() == setter.getParameterTypes()[0]) {
-                setter.invoke(target, new Object[] { value });
+                setter.invoke(target, new Object[]{value});
             } else {
                 // We need to convert it
-                setter.invoke(target, new Object[] { convert(value, setter.getParameterTypes()[0]) });
+                setter.invoke(target, new Object[]{convert(value, setter.getParameterTypes()[0])});
             }
             return true;
         } catch (Throwable ignore) {
@@ -204,9 +181,7 @@ public class PropertyUtil {
 
     /**
      * Return a String past a prefix
-     * 
-     * @param value
-     * @param prefix
+     *
      * @return stripped
      */
     public static String stripPrefix(String value, String prefix) {
@@ -218,9 +193,7 @@ public class PropertyUtil {
 
     /**
      * Return a String from to a character
-     * 
-     * @param value
-     * @param c
+     *
      * @return stripped
      */
     public static String stripUpto(String value, char c) {
@@ -234,9 +207,7 @@ public class PropertyUtil {
 
     /**
      * Return a String up to and including character
-     * 
-     * @param value
-     * @param c
+     *
      * @return stripped
      */
     public static String stripBefore(String value, char c) {

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/RequestCallback.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/RequestCallback.java?rev=1504961&r1=1504960&r2=1504961&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/RequestCallback.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/RequestCallback.java Fri Jul 19 18:44:21 2013
@@ -16,16 +16,13 @@
  */
 package org.apache.activeblaze.util;
 
-import org.apache.activemq.protobuf.Buffer;
 
 /**
  * request callback
- *
  */
 public interface RequestCallback {
     /**
      * Optionally called when a request is finished
-     * @param id
      */
-    void finished(Buffer id);
+    void finished(String id);
 }

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/SendRequest.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/SendRequest.java?rev=1504961&r1=1504960&r2=1504961&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/SendRequest.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/SendRequest.java Fri Jul 19 18:44:21 2013
@@ -18,34 +18,33 @@ package org.apache.activeblaze.util;
 
 import java.util.concurrent.atomic.AtomicBoolean;
 
-import org.apache.activemq.protobuf.Buffer;
+import org.apache.activeblaze.wire.Packet;
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
 /**
  * state on a request
- *
  */
-public class SendRequest<R> {
+public class SendRequest {
     private static final Log LOG = LogFactory.getLog(SendRequest.class);
     private final AtomicBoolean done = new AtomicBoolean();
-    private R response;
+    private Packet response;
     private RequestCallback callback;
 
-    public R get(long timeout) {
+    public Packet get(long timeout) {
         synchronized (this.done) {
             if (this.done.get() == false && this.response == null) {
                 try {
                     this.done.wait(timeout);
                 } catch (InterruptedException e) {
-                    LOG.warn("Interrupted in  get("+timeout+")",e);
+                    LOG.warn("Interrupted in  get(" + timeout + ")", e);
                 }
             }
         }
         return this.response;
     }
 
-    public void put(Buffer id, R response) {
+    public void put(String id, Packet response) {
         this.response = response;
         cancel();
         RequestCallback callback = this.callback;
@@ -60,8 +59,8 @@ public class SendRequest<R> {
             this.done.notifyAll();
         }
     }
-    
-     void setCallback(RequestCallback callback) {
-        this.callback=callback;
+
+    void setCallback(RequestCallback callback) {
+        this.callback = callback;
     }
 }

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/URISupport.java
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/URISupport.java?rev=1504961&r1=1504960&r2=1504961&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/URISupport.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/URISupport.java Fri Jul 19 18:44:21 2013
@@ -119,7 +119,7 @@ public class URISupport {
             }
             return rc;
         } catch (UnsupportedEncodingException e) {
-            throw (URISyntaxException)new URISyntaxException(e.toString(), "Invalid encoding").initCause(e);
+            throw (URISyntaxException) new URISyntaxException(e.toString(), "Invalid encoding").initCause(e);
         }
     }
 
@@ -144,7 +144,7 @@ public class URISupport {
      */
     public static URI createURIWithQuery(URI uri, String query) throws URISyntaxException {
         return new URI(uri.getScheme(), uri.getUserInfo(), uri.getHost(), uri.getPort(), uri.getPath(),
-                       query, uri.getFragment());
+                query, uri.getFragment());
     }
 
     public static CompositeData parseComposite(URI uri) throws URISyntaxException {
@@ -224,20 +224,20 @@ public class URISupport {
         char chars[] = str.toCharArray();
         for (int i = 0; i < chars.length; i++) {
             switch (chars[i]) {
-            case '(':
-                depth++;
-                break;
-            case ')':
-                depth--;
-                break;
-            case ',':
-                if (depth == 0) {
-                    String s = str.substring(last, i);
-                    l.add(s);
-                    last = i + 1;
-                }
-                break;
-            default:
+                case '(':
+                    depth++;
+                    break;
+                case ')':
+                    depth--;
+                    break;
+                case ',':
+                    if (depth == 0) {
+                        String s = str.substring(last, i);
+                        l.add(s);
+                        last = i + 1;
+                    }
+                    break;
+                default:
             }
         }
 
@@ -267,14 +267,14 @@ public class URISupport {
             if (options.size() > 0) {
                 StringBuffer rc = new StringBuffer();
                 boolean first = true;
-                for (Iterator iter = options.keySet().iterator(); iter.hasNext();) {
+                for (Iterator iter = options.keySet().iterator(); iter.hasNext(); ) {
                     if (first) {
                         first = false;
                     } else {
                         rc.append("&");
                     }
-                    String key = (String)iter.next();
-                    String value = (String)options.get(key);
+                    String key = (String) iter.next();
+                    String value = (String) options.get(key);
                     rc.append(URLEncoder.encode(key, "UTF-8"));
                     rc.append("=");
                     rc.append(URLEncoder.encode(value, "UTF-8"));
@@ -284,14 +284,12 @@ public class URISupport {
                 return "";
             }
         } catch (UnsupportedEncodingException e) {
-            throw (URISyntaxException)new URISyntaxException(e.toString(), "Invalid encoding").initCause(e);
+            throw (URISyntaxException) new URISyntaxException(e.toString(), "Invalid encoding").initCause(e);
         }
     }
 
     /**
      * Creates a URI from the original URI and the remaining paramaters
-     * 
-     * @throws URISyntaxException
      */
     public static URI createRemainingURI(URI originalURI, Map params) throws URISyntaxException {
         String s = createQueryString(params);
@@ -303,7 +301,7 @@ public class URISupport {
 
     public static URI changeScheme(URI bindAddr, String scheme) throws URISyntaxException {
         return new URI(scheme, bindAddr.getUserInfo(), bindAddr.getHost(), bindAddr.getPort(), bindAddr
-            .getPath(), bindAddr.getQuery(), bindAddr.getFragment());
+                .getPath(), bindAddr.getQuery(), bindAddr.getFragment());
     }
 
     public static boolean checkParenthesis(String str) {

Modified: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/package.html
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/package.html?rev=1504961&r1=1504960&r2=1504961&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/package.html (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/util/package.html Fri Jul 19 18:44:21 2013
@@ -1,18 +1,18 @@
 !--
-    Licensed to the Apache Software Foundation (ASF) under one or more
-    contributor license agreements.  See the NOTICE file distributed with
-    this work for additional information regarding copyright ownership.
-    The ASF licenses this file to You under the Apache License, Version 2.0
-    (the "License"); you may not use this file except in compliance with
-    the License.  You may obtain a copy of the License at
-   
-    http://www.apache.org/licenses/LICENSE-2.0
-   
-    Unless required by applicable law or agreed to in writing, software
-    distributed under the License is distributed on an "AS IS" BASIS,
-    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-    See the License for the specific language governing permissions and
-    limitations under the License.
+Licensed to the Apache Software Foundation (ASF) under one or more
+contributor license agreements.  See the NOTICE file distributed with
+this work for additional information regarding copyright ownership.
+The ASF licenses this file to You under the Apache License, Version 2.0
+(the "License"); you may not use this file except in compliance with
+the License.  You may obtain a copy of the License at
+
+http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing, software
+distributed under the License is distributed on an "AS IS" BASIS,
+WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+See the License for the specific language governing permissions and
+limitations under the License.
 -->
 <html>
 <head>

Copied: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/wire/BlazeJmsBytesMessage.java (from r755483, activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/message/BlazeJmsBytesMessage.java)
URL: http://svn.apache.org/viewvc/activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/wire/BlazeJmsBytesMessage.java?p2=activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/wire/BlazeJmsBytesMessage.java&p1=activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/message/BlazeJmsBytesMessage.java&r1=755483&r2=1504961&rev=1504961&view=diff
==============================================================================
--- activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/jms/message/BlazeJmsBytesMessage.java (original)
+++ activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/wire/BlazeJmsBytesMessage.java Fri Jul 19 18:44:21 2013
@@ -14,60 +14,66 @@
  * See the License for the specific language governing permissions and
  * limitations under the License.
  */
-package org.apache.activeblaze.jms.message;
-
-import org.apache.activeblaze.BlazeException;
-import org.apache.activeblaze.BlazeRuntimeException;
-import org.apache.activeblaze.jms.BlazeJmsExceptionSupport;
-import org.apache.activeblaze.util.BufferOutputStream;
-import org.apache.activeblaze.wire.BlazeData;
-import org.apache.activeblaze.wire.BlazeData.BlazeDataBean;
-import org.apache.activemq.protobuf.Buffer;
-import org.apache.activemq.protobuf.BufferInputStream;
+package org.apache.activeblaze.wire;
 
 import java.io.DataInputStream;
 import java.io.DataOutputStream;
 import java.io.EOFException;
 import java.io.IOException;
+
 import javax.jms.BytesMessage;
 import javax.jms.JMSException;
 import javax.jms.MessageEOFException;
 import javax.jms.MessageFormatException;
 import javax.jms.MessageNotReadableException;
 import javax.jms.MessageNotWriteableException;
+import org.apache.activeblaze.BlazeException;
+import org.apache.activeblaze.BlazeRuntimeException;
+import org.apache.activeblaze.jms.BlazeJmsExceptionSupport;
 
 /**
- * A <CODE>BytesMessage</CODE> object is used to send a message containing a stream of uninterpreted bytes. It
- * inherits from the <CODE>Message</CODE> interface and adds a bytes message body. The receiver of the message
- * supplies the interpretation of the bytes.
- * <P>
- * The <CODE>BytesMessage</CODE> methods are based largely on those found in <CODE>java.io.DataInputStream</CODE>
- * and <CODE>java.io.DataOutputStream</CODE>.
- * <P>
- * This message type is for client encoding of existing message formats. If possible, one of the other self-defining
- * message types should be used instead.
- * <P>
- * Although the JMS API allows the use of message properties with byte messages, they are typically not used, since the
- * inclusion of properties may affect the format.
- * <P>
- * The primitive types can be written explicitly using methods for each type. They may also be written generically as
- * objects. For instance, a call to <CODE>BytesMessage.writeInt(6)</CODE> is equivalent to
- * <CODE> BytesMessage.writeObject(new Integer(6))</CODE>. Both forms are provided, because the explicit form is
- * convenient for static programming, and the object form is needed when types are not known at compile time.
- * <P>
- * When the message is first created, and when <CODE>clearBody</CODE> is called, the body of the message is in
- * write-only mode. After the first call to <CODE>reset</CODE> has been made, the message body is in read-only mode.
- * After a message has been sent, the client that sent it can retain and modify it without affecting the message that
- * has been sent. The same message object can be sent multiple times. When a message has been received, the provider has
- * called <CODE>reset</CODE> so that the message body is in read-only mode for the client.
- * <P>
- * If <CODE>clearBody</CODE> is called on a message in read-only mode, the message body is cleared and the message is
- * in write-only mode.
- * <P>
- * If a client attempts to read a message in write-only mode, a <CODE>MessageNotReadableException</CODE> is thrown.
- * <P>
- * If a client attempts to write a message in read-only mode, a <CODE>MessageNotWriteableException</CODE> is thrown.
- * 
+ * A <CODE>BytesMessage</CODE> object is used to send a message containing a
+ * stream of uninterpreted bytes. It inherits from the <CODE>Message</CODE>
+ * interface and adds a bytes message body. The receiver of the message supplies
+ * the interpretation of the bytes.
+ * <p/>
+ * The <CODE>BytesMessage</CODE> methods are based largely on those found in
+ * <CODE>java.io.DataInputStream</CODE> and
+ * <CODE>java.io.DataOutputStream</CODE>.
+ * <p/>
+ * This message type is for client encoding of existing message formats. If
+ * possible, one of the other self-defining message types should be used
+ * instead.
+ * <p/>
+ * Although the JMS API allows the use of message properties with byte messages,
+ * they are typically not used, since the inclusion of properties may affect the
+ * format.
+ * <p/>
+ * The primitive types can be written explicitly using methods for each type.
+ * They may also be written generically as objects. For instance, a call to
+ * <CODE>BytesMessage.writeInt(6)</CODE> is equivalent to
+ * <CODE> BytesMessage.writeObject(new Integer(6))</CODE>. Both forms are
+ * provided, because the explicit form is convenient for static programming, and
+ * the object form is needed when types are not known at compile time.
+ * <p/>
+ * When the message is first created, and when <CODE>clearBody</CODE> is called,
+ * the body of the message is in write-only mode. After the first call to
+ * <CODE>reset</CODE> has been made, the message body is in read-only mode.
+ * After a message has been sent, the client that sent it can retain and modify
+ * it without affecting the message that has been sent. The same message object
+ * can be sent multiple times. When a message has been received, the provider
+ * has called <CODE>reset</CODE> so that the message body is in read-only mode
+ * for the client.
+ * <p/>
+ * If <CODE>clearBody</CODE> is called on a message in read-only mode, the
+ * message body is cleared and the message is in write-only mode.
+ * <p/>
+ * If a client attempts to read a message in write-only mode, a
+ * <CODE>MessageNotReadableException</CODE> is thrown.
+ * <p/>
+ * If a client attempts to write a message in read-only mode, a
+ * <CODE>MessageNotWriteableException</CODE> is thrown.
+ *
  * @see javax.jms.Session#createBytesMessage()
  * @see javax.jms.MapMessage
  * @see javax.jms.Message
@@ -81,11 +87,20 @@ public class BlazeJmsBytesMessage extend
     protected transient DataInputStream dataIn;
     protected transient int length;
 
+    /**
+     * Get the packetType
+     *
+     * @return the packetType
+     */
+    public int getPacketType() {
+        return PacketType.JMS_BYTES.getNumber();
+    }
+
     public BlazeJmsBytesMessage clone() {
         BlazeJmsBytesMessage copy = new BlazeJmsBytesMessage();
         try {
             copy(copy);
-        } catch (BlazeException e) {
+        } catch (Exception e) {
             throw new BlazeRuntimeException(e);
         }
         return copy;
@@ -94,30 +109,32 @@ public class BlazeJmsBytesMessage extend
     /**
      * @param copy
      * @throws BlazeException
+     * @throws IOException
+     * @throws BlazeException
      */
-    protected void copy(BlazeJmsBytesMessage copy) throws BlazeException {
+    protected void copy(BlazeJmsBytesMessage copy) throws IOException {
         storeContent();
         super.copy(copy);
         copy.dataOut = null;
         copy.bytesOut = null;
         copy.dataIn = null;
     }
-    
-    /** 
+
+    /**
      * @return the type
      * @see org.apache.activeblaze.BlazeMessage#getType()
      */
-    public int getType(){
+    public int getType() {
         return JmsMessageType.BYTES.ordinal();
     }
 
-    public void storeContent() {
+    protected void storeContent() throws IOException {
         super.storeContent();
         try {
             if (this.dataOut != null) {
                 this.dataOut.close();
                 Buffer bs = this.bytesOut.toBuffer();
-                ((BlazeDataBean)getContent()).setPayload(bs);
+                this.payload = bs;
                 this.bytesOut = null;
                 this.dataOut = null;
             }
@@ -126,33 +143,16 @@ public class BlazeJmsBytesMessage extend
         }
     }
 
-    protected void loadContent() {
-        super.loadContent();
-        if (this.dataIn == null) {
-            Buffer data = null;
-            if (getContent() == null || getContent().getPayload() == null) {
-                data = getContent().getPayload();
-                if (data == null) {
-                    data = new Buffer(new byte[0]);
-                }
-            }
-            if (data == null) {
-                data = getContent().getPayload();
-            }
-            this.length = data.getLength();
-            BufferInputStream is = new BufferInputStream(data);
-            this.dataIn = new DataInputStream(is);
-        }
-    }
-
     /**
-     * Clears out the message body. Clearing a message's body does not clear its header values or property entries.
-     * <P>
-     * If this message body was read-only, calling this method leaves the message body in the same state as an empty
-     * body in a newly created message.
-     * 
-     * @throws JMSException
-     *             if the JMS provider fails to clear the message body due to some internal error.
+     * Clears out the message body. Clearing a message's body does not clear its
+     * header values or property entries.
+     * <p/>
+     * If this message body was read-only, calling this method leaves the
+     * message body in the same state as an empty body in a newly created
+     * message.
+     *
+     * @throws JMSException if the JMS provider fails to clear the message body due to
+     *                      some internal error.
      */
     public void clearBody() throws JMSException {
         super.clearBody();
@@ -162,10 +162,11 @@ public class BlazeJmsBytesMessage extend
     }
 
     /**
-     * Gets the number of bytes of the message body when the message is in read-only mode. The value returned can be
-     * used to allocate a byte array. The value returned is the entire length of the message body, regardless of where
-     * the pointer for reading the message is currently located.
-     * 
+     * Gets the number of bytes of the message body when the message is in
+     * read-only mode. The value returned can be used to allocate a byte array.
+     * The value returned is the entire length of the message body, regardless
+     * of where the pointer for reading the message is currently located.
+     *
      * @return number of bytes in the message
      * @since 1.1
      */
@@ -176,14 +177,12 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads a <code>boolean</code> from the bytes message stream.
-     * 
+     *
      * @return the <code>boolean</code> value read
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageEOFException
-     *             if unexpected end of bytes stream has been reached.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public boolean readBoolean() throws JMSException {
         initializeReading();
@@ -198,14 +197,13 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads a signed 8-bit value from the bytes message stream.
-     * 
-     * @return the next byte from the bytes message stream as a signed 8-bit <code>byte</code>
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageEOFException
-     *             if unexpected end of bytes stream has been reached.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     *
+     * @return the next byte from the bytes message stream as a signed 8-bit
+     *         <code>byte</code>
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public byte readByte() throws JMSException {
         initializeReading();
@@ -220,14 +218,13 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads an unsigned 8-bit number from the bytes message stream.
-     * 
-     * @return the next byte from the bytes message stream, interpreted as an unsigned 8-bit number
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageEOFException
-     *             if unexpected end of bytes stream has been reached.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     *
+     * @return the next byte from the bytes message stream, interpreted as an
+     *         unsigned 8-bit number
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public int readUnsignedByte() throws JMSException {
         initializeReading();
@@ -242,14 +239,13 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads a signed 16-bit number from the bytes message stream.
-     * 
-     * @return the next two bytes from the bytes message stream, interpreted as a signed 16-bit number
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageEOFException
-     *             if unexpected end of bytes stream has been reached.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     *
+     * @return the next two bytes from the bytes message stream, interpreted as
+     *         a signed 16-bit number
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public short readShort() throws JMSException {
         initializeReading();
@@ -264,14 +260,13 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads an unsigned 16-bit number from the bytes message stream.
-     * 
-     * @return the next two bytes from the bytes message stream, interpreted as an unsigned 16-bit integer
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageEOFException
-     *             if unexpected end of bytes stream has been reached.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     *
+     * @return the next two bytes from the bytes message stream, interpreted as
+     *         an unsigned 16-bit integer
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public int readUnsignedShort() throws JMSException {
         initializeReading();
@@ -286,14 +281,13 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads a Unicode character value from the bytes message stream.
-     * 
-     * @return the next two bytes from the bytes message stream as a Unicode character
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageEOFException
-     *             if unexpected end of bytes stream has been reached.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     *
+     * @return the next two bytes from the bytes message stream as a Unicode
+     *         character
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public char readChar() throws JMSException {
         initializeReading();
@@ -308,14 +302,13 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads a signed 32-bit integer from the bytes message stream.
-     * 
-     * @return the next four bytes from the bytes message stream, interpreted as an <code>int</code>
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageEOFException
-     *             if unexpected end of bytes stream has been reached.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     *
+     * @return the next four bytes from the bytes message stream, interpreted as
+     *         an <code>int</code>
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public int readInt() throws JMSException {
         initializeReading();
@@ -330,14 +323,13 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads a signed 64-bit integer from the bytes message stream.
-     * 
-     * @return the next eight bytes from the bytes message stream, interpreted as a <code>long</code>
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageEOFException
-     *             if unexpected end of bytes stream has been reached.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     *
+     * @return the next eight bytes from the bytes message stream, interpreted
+     *         as a <code>long</code>
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public long readLong() throws JMSException {
         initializeReading();
@@ -352,14 +344,13 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads a <code>float</code> from the bytes message stream.
-     * 
-     * @return the next four bytes from the bytes message stream, interpreted as a <code>float</code>
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageEOFException
-     *             if unexpected end of bytes stream has been reached.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     *
+     * @return the next four bytes from the bytes message stream, interpreted as
+     *         a <code>float</code>
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public float readFloat() throws JMSException {
         initializeReading();
@@ -374,14 +365,13 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads a <code>double</code> from the bytes message stream.
-     * 
-     * @return the next eight bytes from the bytes message stream, interpreted as a <code>double</code>
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageEOFException
-     *             if unexpected end of bytes stream has been reached.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     *
+     * @return the next eight bytes from the bytes message stream, interpreted
+     *         as a <code>double</code>
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public double readDouble() throws JMSException {
         initializeReading();
@@ -395,19 +385,19 @@ public class BlazeJmsBytesMessage extend
     }
 
     /**
-     * Reads a string that has been encoded using a modified UTF-8 format from the bytes message stream.
-     * <P>
-     * For more information on the UTF-8 format, see "File System Safe UCS Transformation Format (FSS_UTF)", X/Open
-     * Preliminary Specification, X/Open Company Ltd., Document Number: P316. This information also appears in ISO/IEC
-     * 10646, Annex P.
-     * 
+     * Reads a string that has been encoded using a modified UTF-8 format from
+     * the bytes message stream.
+     * <p/>
+     * For more information on the UTF-8 format, see
+     * "File System Safe UCS Transformation Format (FSS_UTF)", X/Open
+     * Preliminary Specification, X/Open Company Ltd., Document Number: P316.
+     * This information also appears in ISO/IEC 10646, Annex P.
+     *
      * @return a Unicode string from the bytes message stream
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageEOFException
-     *             if unexpected end of bytes stream has been reached.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageEOFException         if unexpected end of bytes stream has been reached.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public String readUTF() throws JMSException {
         initializeReading();
@@ -422,23 +412,23 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads a byte array from the bytes message stream.
-     * <P>
-     * If the length of array <code>value</code> is less than the number of bytes remaining to be read from the
-     * stream, the array should be filled. A subsequent call reads the next increment, and so on.
-     * <P>
-     * If the number of bytes remaining in the stream is less than the length of array <code>value</code>, the bytes
-     * should be read into the array. The return value of the total number of bytes read will be less than the length of
-     * the array, indicating that there are no more bytes left to be read from the stream. The next read of the stream
-     * returns -1.
-     * 
-     * @param value
-     *            the buffer into which the data is read
-     * @return the total number of bytes read into the buffer, or -1 if there is no more data because the end of the
-     *         stream has been reached
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     * <p/>
+     * If the length of array <code>value</code> is less than the number of
+     * bytes remaining to be read from the stream, the array should be filled. A
+     * subsequent call reads the next increment, and so on.
+     * <p/>
+     * If the number of bytes remaining in the stream is less than the length of
+     * array <code>value</code>, the bytes should be read into the array. The
+     * return value of the total number of bytes read will be less than the
+     * length of the array, indicating that there are no more bytes left to be
+     * read from the stream. The next read of the stream returns -1.
+     *
+     * @param value the buffer into which the data is read
+     * @return the total number of bytes read into the buffer, or -1 if there is
+     *         no more data because the end of the stream has been reached
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public int readBytes(byte[] value) throws JMSException {
         return readBytes(value, value.length);
@@ -446,27 +436,30 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Reads a portion of the bytes message stream.
-     * <P>
-     * If the length of array <code>value</code> is less than the number of bytes remaining to be read from the
-     * stream, the array should be filled. A subsequent call reads the next increment, and so on.
-     * <P>
-     * If the number of bytes remaining in the stream is less than the length of array <code>value</code>, the bytes
-     * should be read into the array. The return value of the total number of bytes read will be less than the length of
-     * the array, indicating that there are no more bytes left to be read from the stream. The next read of the stream
-     * returns -1. <p/> If <code>length</code> is negative, or <code>length</code> is greater than the length of the
-     * array <code>value</code>, then an <code>IndexOutOfBoundsException</code> is thrown. No bytes will be read
+     * <p/>
+     * If the length of array <code>value</code> is less than the number of
+     * bytes remaining to be read from the stream, the array should be filled. A
+     * subsequent call reads the next increment, and so on.
+     * <p/>
+     * If the number of bytes remaining in the stream is less than the length of
+     * array <code>value</code>, the bytes should be read into the array. The
+     * return value of the total number of bytes read will be less than the
+     * length of the array, indicating that there are no more bytes left to be
+     * read from the stream. The next read of the stream returns -1.
+     * <p/>
+     * If <code>length</code> is negative, or <code>length</code> is greater
+     * than the length of the array <code>value</code>, then an
+     * <code>IndexOutOfBoundsException</code> is thrown. No bytes will be read
      * from the stream for this exception case.
-     * 
-     * @param value
-     *            the buffer into which the data is read
-     * @param length
-     *            the number of bytes to read; must be less than or equal to <code>value.length</code>
-     * @return the total number of bytes read into the buffer, or -1 if there is no more data because the end of the
-     *         stream has been reached
-     * @throws JMSException
-     *             if the JMS provider fails to read the message due to some internal error.
-     * @throws MessageNotReadableException
-     *             if the message is in write-only mode.
+     *
+     * @param value  the buffer into which the data is read
+     * @param length the number of bytes to read; must be less than or equal to
+     *               <code>value.length</code>
+     * @return the total number of bytes read into the buffer, or -1 if there is
+     *         no more data because the end of the stream has been reached
+     * @throws JMSException                if the JMS provider fails to read the message due to some
+     *                                     internal error.
+     * @throws MessageNotReadableException if the message is in write-only mode.
      */
     public int readBytes(byte[] value, int length) throws JMSException {
         initializeReading();
@@ -491,16 +484,15 @@ public class BlazeJmsBytesMessage extend
     }
 
     /**
-     * Writes a <code>boolean</code> to the bytes message stream as a 1-byte value. The value <code>true</code> is
-     * written as the value <code>(byte)1</code>; the value <code>false</code> is written as the value
-     * <code>(byte)0</code>.
-     * 
-     * @param value
-     *            the <code>boolean</code> value to be written
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
+     * Writes a <code>boolean</code> to the bytes message stream as a 1-byte
+     * value. The value <code>true</code> is written as the value
+     * <code>(byte)1</code>; the value <code>false</code> is written as the
+     * value <code>(byte)0</code>.
+     *
+     * @param value the <code>boolean</code> value to be written
+     * @throws JMSException                 if the JMS provider fails to write the message due to some
+     *                                      internal error.
+     * @throws MessageNotWriteableException if the message is in read-only mode.
      */
     public void writeBoolean(boolean value) throws JMSException {
         initializeWriting();
@@ -513,13 +505,11 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Writes a <code>byte</code> to the bytes message stream as a 1-byte value.
-     * 
-     * @param value
-     *            the <code>byte</code> value to be written
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
+     *
+     * @param value the <code>byte</code> value to be written
+     * @throws JMSException                 if the JMS provider fails to write the message due to some
+     *                                      internal error.
+     * @throws MessageNotWriteableException if the message is in read-only mode.
      */
     public void writeByte(byte value) throws JMSException {
         initializeWriting();
@@ -531,14 +521,13 @@ public class BlazeJmsBytesMessage extend
     }
 
     /**
-     * Writes a <code>short</code> to the bytes message stream as two bytes, high byte first.
-     * 
-     * @param value
-     *            the <code>short</code> to be written
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
+     * Writes a <code>short</code> to the bytes message stream as two bytes,
+     * high byte first.
+     *
+     * @param value the <code>short</code> to be written
+     * @throws JMSException                 if the JMS provider fails to write the message due to some
+     *                                      internal error.
+     * @throws MessageNotWriteableException if the message is in read-only mode.
      */
     public void writeShort(short value) throws JMSException {
         initializeWriting();
@@ -550,14 +539,13 @@ public class BlazeJmsBytesMessage extend
     }
 
     /**
-     * Writes a <code>char</code> to the bytes message stream as a 2-byte value, high byte first.
-     * 
-     * @param value
-     *            the <code>char</code> value to be written
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
+     * Writes a <code>char</code> to the bytes message stream as a 2-byte value,
+     * high byte first.
+     *
+     * @param value the <code>char</code> value to be written
+     * @throws JMSException                 if the JMS provider fails to write the message due to some
+     *                                      internal error.
+     * @throws MessageNotWriteableException if the message is in read-only mode.
      */
     public void writeChar(char value) throws JMSException {
         initializeWriting();
@@ -569,14 +557,13 @@ public class BlazeJmsBytesMessage extend
     }
 
     /**
-     * Writes an <code>int</code> to the bytes message stream as four bytes, high byte first.
-     * 
-     * @param value
-     *            the <code>int</code> to be written
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
+     * Writes an <code>int</code> to the bytes message stream as four bytes,
+     * high byte first.
+     *
+     * @param value the <code>int</code> to be written
+     * @throws JMSException                 if the JMS provider fails to write the message due to some
+     *                                      internal error.
+     * @throws MessageNotWriteableException if the message is in read-only mode.
      */
     public void writeInt(int value) throws JMSException {
         initializeWriting();
@@ -588,14 +575,13 @@ public class BlazeJmsBytesMessage extend
     }
 
     /**
-     * Writes a <code>long</code> to the bytes message stream as eight bytes, high byte first.
-     * 
-     * @param value
-     *            the <code>long</code> to be written
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
+     * Writes a <code>long</code> to the bytes message stream as eight bytes,
+     * high byte first.
+     *
+     * @param value the <code>long</code> to be written
+     * @throws JMSException                 if the JMS provider fails to write the message due to some
+     *                                      internal error.
+     * @throws MessageNotWriteableException if the message is in read-only mode.
      */
     public void writeLong(long value) throws JMSException {
         initializeWriting();
@@ -607,16 +593,15 @@ public class BlazeJmsBytesMessage extend
     }
 
     /**
-     * Converts the <code>float</code> argument to an <code>int</code> using the <code>floatToIntBits</code>
-     * method in class <code>Float</code>, and then writes that <code>int</code> value to the bytes message stream
-     * as a 4-byte quantity, high byte first.
-     * 
-     * @param value
-     *            the <code>float</code> value to be written
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
+     * Converts the <code>float</code> argument to an <code>int</code> using the
+     * <code>floatToIntBits</code> method in class <code>Float</code>, and then
+     * writes that <code>int</code> value to the bytes message stream as a
+     * 4-byte quantity, high byte first.
+     *
+     * @param value the <code>float</code> value to be written
+     * @throws JMSException                 if the JMS provider fails to write the message due to some
+     *                                      internal error.
+     * @throws MessageNotWriteableException if the message is in read-only mode.
      */
     public void writeFloat(float value) throws JMSException {
         initializeWriting();
@@ -628,16 +613,15 @@ public class BlazeJmsBytesMessage extend
     }
 
     /**
-     * Converts the <code>double</code> argument to a <code>long</code> using the <code>doubleToLongBits</code>
-     * method in class <code>Double</code>, and then writes that <code>long</code> value to the bytes message
-     * stream as an 8-byte quantity, high byte first.
-     * 
-     * @param value
-     *            the <code>double</code> value to be written
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
+     * Converts the <code>double</code> argument to a <code>long</code> using
+     * the <code>doubleToLongBits</code> method in class <code>Double</code>,
+     * and then writes that <code>long</code> value to the bytes message stream
+     * as an 8-byte quantity, high byte first.
+     *
+     * @param value the <code>double</code> value to be written
+     * @throws JMSException                 if the JMS provider fails to write the message due to some
+     *                                      internal error.
+     * @throws MessageNotWriteableException if the message is in read-only mode.
      */
     public void writeDouble(double value) throws JMSException {
         initializeWriting();
@@ -649,18 +633,18 @@ public class BlazeJmsBytesMessage extend
     }
 
     /**
-     * Writes a string to the bytes message stream using UTF-8 encoding in a machine-independent manner.
-     * <P>
-     * For more information on the UTF-8 format, see "File System Safe UCS Transformation Format (FSS_UTF)", X/Open
-     * Preliminary Specification, X/Open Company Ltd., Document Number: P316. This information also appears in ISO/IEC
-     * 10646, Annex P.
-     * 
-     * @param value
-     *            the <code>String</code> value to be written
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
+     * Writes a string to the bytes message stream using UTF-8 encoding in a
+     * machine-independent manner.
+     * <p/>
+     * For more information on the UTF-8 format, see
+     * "File System Safe UCS Transformation Format (FSS_UTF)", X/Open
+     * Preliminary Specification, X/Open Company Ltd., Document Number: P316.
+     * This information also appears in ISO/IEC 10646, Annex P.
+     *
+     * @param value the <code>String</code> value to be written
+     * @throws JMSException                 if the JMS provider fails to write the message due to some
+     *                                      internal error.
+     * @throws MessageNotWriteableException if the message is in read-only mode.
      */
     public void writeUTF(String value) throws JMSException {
         initializeWriting();
@@ -673,13 +657,11 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Writes a byte array to the bytes message stream.
-     * 
-     * @param value
-     *            the byte array to be written
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
+     *
+     * @param value the byte array to be written
+     * @throws JMSException                 if the JMS provider fails to write the message due to some
+     *                                      internal error.
+     * @throws MessageNotWriteableException if the message is in read-only mode.
      */
     public void writeBytes(byte[] value) throws JMSException {
         initializeWriting();
@@ -692,17 +674,13 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Writes a portion of a byte array to the bytes message stream.
-     * 
-     * @param value
-     *            the byte array value to be written
-     * @param offset
-     *            the initial offset within the byte array
-     * @param length
-     *            the number of bytes to use
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
+     *
+     * @param value  the byte array value to be written
+     * @param offset the initial offset within the byte array
+     * @param length the number of bytes to use
+     * @throws JMSException                 if the JMS provider fails to write the message due to some
+     *                                      internal error.
+     * @throws MessageNotWriteableException if the message is in read-only mode.
      */
     public void writeBytes(byte[] value, int offset, int length) throws JMSException {
         initializeWriting();
@@ -715,20 +693,18 @@ public class BlazeJmsBytesMessage extend
 
     /**
      * Writes an object to the bytes message stream.
-     * <P>
-     * This method works only for the objectified primitive object types (<code>Integer</code>,<code>Double</code>,
-     * <code>Long</code> &nbsp;...), <code>String</code> objects, and byte arrays.
-     * 
-     * @param value
-     *            the object in the Java programming language ("Java object") to be written; it must not be null
-     * @throws JMSException
-     *             if the JMS provider fails to write the message due to some internal error.
-     * @throws MessageFormatException
-     *             if the object is of an invalid type.
-     * @throws MessageNotWriteableException
-     *             if the message is in read-only mode.
-     * @throws java.lang.NullPointerException
-     *             if the parameter <code>value</code> is null.
+     * <p/>
+     * This method works only for the objectified primitive object types (
+     * <code>Integer</code>,<code>Double</code>, <code>Long</code> &nbsp;...),
+     * <code>String</code> objects, and byte arrays.
+     *
+     * @param value the object in the Java programming language ("Java object") to
+     *              be written; it must not be null
+     * @throws JMSException                   if the JMS provider fails to write the message due to some
+     *                                        internal error.
+     * @throws MessageFormatException         if the object is of an invalid type.
+     * @throws MessageNotWriteableException   if the message is in read-only mode.
+     * @throws java.lang.NullPointerException if the parameter <code>value</code> is null.
      */
     public void writeObject(Object value) throws JMSException {
         if (value == null) {
@@ -761,10 +737,18 @@ public class BlazeJmsBytesMessage extend
     }
 
     /**
-     * Puts the message body in read-only mode and repositions the stream of bytes to the beginning.
+     * Puts the message body in read-only mode and repositions the stream of
+     * bytes to the beginning.
      */
-    public void reset() {
-        storeContent();
+    public void reset() throws JMSException {
+        try {
+            storeContent();
+        } catch (Exception e) {
+            JMSException ex = new JMSException(e.getMessage());
+            ex.initCause(e);
+            ex.setLinkedException(e);
+            throw ex;
+        }
         this.bytesOut = null;
         this.dataIn = null;
         this.dataOut = null;
@@ -773,7 +757,7 @@ public class BlazeJmsBytesMessage extend
     protected void initializeWriting() {
         super.initializeWriting();
         if (this.dataOut == null) {
-            this.bytesOut = new BufferOutputStream(32);
+            this.bytesOut = new BufferOutputStream(64);
             this.dataOut = new DataOutputStream(this.bytesOut);
         }
     }
@@ -781,15 +765,8 @@ public class BlazeJmsBytesMessage extend
     protected void initializeReading() {
         super.initializeReading();
         if (this.dataIn == null) {
-            BlazeData bd = getContent();
-            Buffer data = null;
-            if (bd != null && bd.getPayload() != null) {
-                data = bd.getPayload();
-            } else {
-                data = new Buffer(new byte[0]);
-            }
-            BufferInputStream is = new BufferInputStream(data);
-            this.length = data.getLength();
+            BufferInputStream is = new BufferInputStream(this.payload);
+            this.length = this.payload.getLength();
             this.dataIn = new DataInputStream(is);
         }
     }

Propchange: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/wire/BlazeJmsBytesMessage.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: activemq/activemq-blaze/trunk/src/main/java/org/apache/activeblaze/wire/BlazeJmsBytesMessage.java
------------------------------------------------------------------------------
    svn:executable = *