You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by ch...@apache.org on 2006/12/28 22:09:31 UTC

svn commit: r490816 - in /incubator/activemq/site: openwire.html protocols.html

Author: chirino
Date: Thu Dec 28 13:09:30 2006
New Revision: 490816

URL: http://svn.apache.org/viewvc?view=rev&rev=490816
Log:
Latest export from confluence

Modified:
    incubator/activemq/site/openwire.html
    incubator/activemq/site/protocols.html

Modified: incubator/activemq/site/openwire.html
URL: http://svn.apache.org/viewvc/incubator/activemq/site/openwire.html?view=diff&rev=490816&r1=490815&r2=490816
==============================================================================
--- incubator/activemq/site/openwire.html (original)
+++ incubator/activemq/site/openwire.html Thu Dec 28 13:09:30 2006
@@ -286,7 +286,7 @@
 
 <H4><A name="OpenWire-Overview"></A>Overview</H4>
 
-<P>OpenWire is used to marshal objects to byte arrays and back.  We will refer to the marshaled objects as commands.  All data types are encoded in big-endian/network byte order. </P>
+<P>OpenWire is used to marshal objects to byte arrays and back.  We will refer to the marshaled objects as commands.  </P>
 
 <P>A TCP network connection would see multiple commands back to back on the stream.  Commands are not delimited in anyway and are variable sized.</P>
 
@@ -296,6 +296,20 @@
 +---------+  +---------+      +---------+</PRE>
 </DIV></DIV>
 
+<P>All data primitive types used in the encoded commands are encoded in big-endian/network byte order. </P>
+
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">primitive types and encoding:
+             |               |               |               |               |               |               
++----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ 
+| <SPAN class="code-object">byte</SPAN>     | | | <SPAN class="code-object">char</SPAN>      | | | <SPAN class="code-object">short</SPAN>     | | | <SPAN class="code-object">int</SPAN>       | | | <SPAN class="code-object">long</SPAN>      | | | <SPAN class="code-object">float</SPAN>     | | | <SPAN class="code-object">double</SPAN>    | 
++----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ 
+| 1 octect | | | 2 octects | | | 2 octects | | | 4 octects | | | 8 octects | | | 4 octects | | | 8 octects | 
++----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ | +-----------+ 
+             |               |               |               |               |               |</PRE>
+</DIV></DIV>
+
+
 <H4><A name="OpenWire-WireFormatNegotiation"></A>Wire Format Negotiation</H4>
 
 <P>OpenWire is an extensible in that it supports adding new encoding options while still being backward compatible with previous versions of the protocol.  Every OpenWire protocol session initially starts with all encoding options turned off and at version 1 of command marshalers.  An initial WireFormatInfo command is exchanged between the two nodes so that additional encoding features can be enabled.  If both sides request an encoding feature to be enabled then it will be enabled.  The command marshalers used will be the highest version that they both support.</P>
@@ -311,13 +325,14 @@
 <P>Every command is encoded as follows:</P>
 
 <DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">[=If SizePrefixDisabled =] 
+<PRE class="code-java">command encoding:
+[=If SizePrefixDisabled =] 
 [ option is not enabled. ]
-[ +---------+            ] +--------+--------------------------+
-[ | size    |            ] | type   | command-specific-content |
-[ +---------+            ] +--------+--------------------------+
-[ | 4 bytes |            ] | 1 <SPAN class="code-object">byte</SPAN> | (size-1) bytes           |
-[ +---------+            ] +--------+--------------------------+
+[ +------+               ] +------+-------------------------+
+[ | size |               ] | type | command-specific-fields |
+[ +------+               ] +------+-------------------------+
+[ | <SPAN class="code-object">int</SPAN>  |               ] | <SPAN class="code-object">byte</SPAN> | (size-1) bytes          |
+[ +------+               ] +------+-------------------------+
 [========================]</PRE>
 </DIV></DIV>
 
@@ -335,7 +350,7 @@
 <TD class="confluenceTd"> Command type identifier </TD>
 </TR>
 <TR>
-<TD class="confluenceTd"> command-specific-content </TD>
+<TD class="confluenceTd"> command-specific-fields</TD>
 <TD class="confluenceTd"> The data for the command. It is encoding depends on the type used </TD>
 </TR>
 </TBODY></TABLE>
@@ -351,69 +366,33 @@
 <UL>
 	<LI>Java primitive types</LI>
 	<LI>String</LI>
+	<LI>byte arrays</LI>
 	<LI>Throwable</LI>
-	<LI>OpenWire commands</LI>
+	<LI>Nested OpenWire commands</LI>
+	<LI>Nested OpenWire command arrays</LI>
+	<LI>Cached Nested OpenWire commands</LI>
 </UL>
 
 
-<P>Notice that OpenWire commands can use other OpenWire commands in it&apos;s fields.  Care must be taken that only acyclic graphs of commands are marshaled.</P>
+<P>Notice that OpenWire commands can nest other OpenWire commands in it&apos;s fields.  Care must be taken that only acyclic graphs of commands are marshaled.</P>
 
 <H5><A name="OpenWire-LooseEncoding"></A>Loose Encoding</H5>
 
 <P>The fields of a command use &quot;loose encoding&quot; by default which encode an object field to a marshaled field of the equivalent size.  Loose encoding is simple to implement does not add much CPU overhead to the marshaling/unmarshaling process.</P>
 
-<H6><A name="OpenWire-PrimitiveTypeEncoding"></A>Primitive Type Encoding</H6>
-
-<P>Table of primitive types and their encoded length:</P>
-<TABLE class="confluenceTable"><TBODY>
-<TR>
-<TH class="confluenceTh"> Primitive Type </TH>
-<TH class="confluenceTh"> Marshalled length </TH>
-</TR>
-<TR>
-<TD class="confluenceTd"> byte </TD>
-<TD class="confluenceTd"> 1 </TD>
-</TR>
-<TR>
-<TD class="confluenceTd"> char </TD>
-<TD class="confluenceTd"> 2 </TD>
-</TR>
-<TR>
-<TD class="confluenceTd"> short </TD>
-<TD class="confluenceTd"> 2 </TD>
-</TR>
-<TR>
-<TD class="confluenceTd"> int </TD>
-<TD class="confluenceTd"> 4 </TD>
-</TR>
-<TR>
-<TD class="confluenceTd"> long </TD>
-<TD class="confluenceTd"> 8 </TD>
-</TR>
-<TR>
-<TD class="confluenceTd"> float </TD>
-<TD class="confluenceTd"> 4 </TD>
-</TR>
-<TR>
-<TD class="confluenceTd"> double </TD>
-<TD class="confluenceTd"> 8 </TD>
-</TR>
-</TBODY></TABLE>
-
 <H6><A name="OpenWire-StringTypeEncoding"></A>String Type Encoding</H6>
 
-<P>Strings fields may be null. If it is null then it encodes to a single &quot;0&quot; byte.<BR>
-If it is not null, then it encodes to:</P>
+<P>Strings fields may be null. If it is null then it encodes to a single &quot;0&quot; byte.</P>
 
 <DIV class="code"><DIV class="codeContent">
-<PRE class="code-java"><SPAN class="code-object">String</SPAN> Encoding:
-             [=If not-<SPAN class="code-keyword">null</SPAN> is 1=============]
-+----------+ [ +---------+----------------+ ]
-| not-<SPAN class="code-keyword">null</SPAN> | [ | size    | encoded-string | ]
-+----------+ [ +---------+----------------+ ]
-| 1 <SPAN class="code-object">byte</SPAN>   | [ | 2 bytes | size bytes     | ]
-+----------+ [ +---------+----------------+ ]
-             [==============================]</PRE>
+<PRE class="code-java">string encoding:
+             [=If not-<SPAN class="code-keyword">null</SPAN> is 1===========]
++----------+ [ +-------+----------------+ ]
+| not-<SPAN class="code-keyword">null</SPAN> | [ | size  | encoded-string | ]
++----------+ [ +-------+----------------+ ]
+| <SPAN class="code-object">byte</SPAN>     | [ | <SPAN class="code-object">short</SPAN> | size bytes     | ]
++----------+ [ +-------+----------------+ ]
+             [============================]</PRE>
 </DIV></DIV>
 
 <TABLE class="confluenceTable"><TBODY>
@@ -441,18 +420,18 @@
 
 
 <DIV class="code"><DIV class="codeContent">
-<PRE class="code-java">Throwable Encoding:
-             [=If not-<SPAN class="code-keyword">null</SPAN> is 1=============================================================================]
-             [                               [=If StackTraceEnabled option is enabled.====================] ]
-             [                               [             [=Repeated size times========================] ] ]
-+----------+ [ +----------------+---------+  [ +---------+ [ +--------+--------+--------+-------------+ ] ] ]
-| not-<SPAN class="code-keyword">null</SPAN> | [ | exception-name | message |  [ | size    | [ | class  | method | file   | line-number | ] ] ]
-+----------+ [ +----------------+---------+  [ +---------+ [ +--------+--------+--------+-------------+ ] ] ]
-| 1 <SPAN class="code-object">byte</SPAN>   | [ | string         | string  |  [ | 2 bytes | [ | string | string | string | 4 bytes     | ] ] ]
-+----------+ [ +----------------+---------+  [ +---------+ [ +--------+--------+--------+-------------+ ] ] ]
-             [                               [             [============================================] ] ]
-             [                               [============================================================] ]
-             [==============================================================================================]</PRE>
+<PRE class="code-java">throwable encoding:
+             [=If not-<SPAN class="code-keyword">null</SPAN> is 1===========================================================================]
+             [                               [=If StackTraceEnabled option is enabled.==================] ]
+             [                               [             [=Repeated size times======================] ] ]
++----------+ [ +----------------+---------+  [ +-------+ [ +--------+--------+--------+-------------+ ] ] ]
+| not-<SPAN class="code-keyword">null</SPAN> | [ | exception-name | message |  [ | size  | [ | class  | method | file   | line-number | ] ] ]
++----------+ [ +----------------+---------+  [ +-------+ [ +--------+--------+--------+-------------+ ] ] ]
+| <SPAN class="code-object">byte</SPAN>     | [ | string         | string  |  [ | <SPAN class="code-object">short</SPAN> | [ | string | string | string | <SPAN class="code-object">int</SPAN>         | ] ] ]
++----------+ [ +----------------+---------+  [ +-------+ [ +--------+--------+--------+-------------+ ] ] ]
+             [                               [           [============================================] ] ]
+             [                               [==========================================================] ]
+             [============================================================================================]</PRE>
 </DIV></DIV>
 
 <TABLE class="confluenceTable"><TBODY>
@@ -496,12 +475,83 @@
 
 <P>If the StackTraceEnabled encoding option is enabled after the exchange of WireFormatInfo packets, then every Throwable filed will have stack trace data appended to it.</P>
 
+<H6><A name="OpenWire-NestedCommandTypeEncoding"></A>Nested Command Type Encoding</H6>
 
-<H5><A name="OpenWire-TightEncoding"></A>Tight Encoding</H5>
+<P>Nested command fields may be null. If it is null then it encodes to a single &quot;0&quot; byte.</P>
 
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">nested-object encoding:
+             [=If not-<SPAN class="code-keyword">null</SPAN> is 1===================]
++----------+ [ +------+-------------------------+ ]
+| not-<SPAN class="code-keyword">null</SPAN> | [ | type | command-specific-fields | ]
++----------+ [ +------+-------------------------+ ]
+| <SPAN class="code-object">byte</SPAN>     | [ | <SPAN class="code-object">byte</SPAN> | variable sized          | ]
++----------+ [ +------+-------------------------+ ]
+             [====================================]</PRE>
+</DIV></DIV>
 
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Field </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> not-null </TD>
+<TD class="confluenceTd"> 1 if the Throwable not null, 0 if the Throwable is null </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> type </TD>
+<TD class="confluenceTd"> Command type identifier </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> command-specific-fields</TD>
+<TD class="confluenceTd"> The data for the command. It is encoding depends on the type used </TD>
+</TR>
+</TBODY></TABLE>
+
+<H6><A name="OpenWire-CachedNestedCommandTypeEncoding"></A>Cached Nested Command Type Encoding</H6>
+
+<P>Nested Command types can be cached so that subsequent marshaling operations of the same object result in a smaller on the wire size.  By default the CacheEnabled option is not enabled and therefore standard nested-object encoding is used.</P>
 
-<P>By default </P></DIV>
+<DIV class="code"><DIV class="codeContent">
+<PRE class="code-java">cached-object-encoding:
+[=If CacheEnabled option is enabled=====================]
+[                       [=If <SPAN class="code-keyword">new</SPAN>-value is 1===========] ]
+[ +-----------+-------+ [ +-------------------------+ ] ]
+[ | <SPAN class="code-keyword">new</SPAN>-value | key   | [ | command-specific-fields | ] ]
+[ +-----------+-------+ [ +-------------------------+ ] ]
+[ | <SPAN class="code-object">byte</SPAN>      | <SPAN class="code-object">short</SPAN> | [ | nested-object           | ] ]
+[ +-----------+-------+ [ +-------------------------+ ] ]
+[                       [=============================] ]
+[=====================================================] ]
+
+[=If CacheEnabled option is disabled =]
+[ +-------------------------+         ]
+[ | command-specific-fields |         ]
+[ +-------------------------+         ]
+[ | nested-object           |         ]
+[ +-------------------------+         ]
+[=====================================]</PRE>
+</DIV></DIV>
+
+<TABLE class="confluenceTable"><TBODY>
+<TR>
+<TH class="confluenceTh"> Field </TH>
+<TH class="confluenceTh"> Description </TH>
+</TR>
+<TR>
+<TD class="confluenceTd"> new-value </TD>
+<TD class="confluenceTd"> 1 if the value is not in the cache, 0 if it already is in the cache </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> key </TD>
+<TD class="confluenceTd"> Key used to identify the value in the cache </TD>
+</TR>
+<TR>
+<TD class="confluenceTd"> command-specific-fields</TD>
+<TD class="confluenceTd"> The data for the command. It is encoding depends on the type used </TD>
+</TR>
+</TBODY></TABLE></DIV>
           
                   </DIV>
         </TD>
@@ -512,7 +562,7 @@
     <DIV id="site-footer">
           Added by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=jstrachan">James Strachan</A>,
     last edited by     <A href="http://goopen.org/confluence/users/viewuserprofile.action?username=chirino">Hiram Chirino</A> on Dec 29, 2006
-                  &nbsp;(<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=101&originalId=15218">view change</A>)
+                  &nbsp;(<A href="http://goopen.org/confluence/pages/diffpages.action?pageId=101&originalId=15219">view change</A>)
               
       (<A href="http://goopen.org/confluence/pages/editpage.action?pageId=101">edit page</A>)
     </DIV>

Modified: incubator/activemq/site/protocols.html
URL: http://svn.apache.org/viewvc/incubator/activemq/site/protocols.html?view=diff&rev=490816&r1=490815&r2=490816
==============================================================================
--- incubator/activemq/site/protocols.html (original)
+++ incubator/activemq/site/protocols.html Thu Dec 28 13:09:30 2006
@@ -279,13 +279,13 @@
                           <a href="http://goopen.org/confluence/display/ACTIVEMQ/REST" title="REST">REST</a>
               <span class="smalltext">(ActiveMQ)</span>
               <br>
-                          <a href="http://goopen.org/confluence/display/ACTIVEMQ/OpenWire" title="OpenWire">OpenWire</a>
-              <span class="smalltext">(ActiveMQ)</span>
-              <br>
                           <a href="http://goopen.org/confluence/display/ACTIVEMQ/AMQP" title="AMQP">AMQP</a>
               <span class="smalltext">(ActiveMQ)</span>
               <br>
                           <a href="http://goopen.org/confluence/display/ACTIVEMQ/XMPP" title="XMPP">XMPP</a>
+              <span class="smalltext">(ActiveMQ)</span>
+              <br>
+                          <a href="http://goopen.org/confluence/display/ACTIVEMQ/OpenWire" title="OpenWire">OpenWire</a>
               <span class="smalltext">(ActiveMQ)</span>
               <br>
                       </div>