You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2007/03/22 14:15:14 UTC

svn commit: r521253 [10/10] - in /incubator/qpid/branches/java.multi_version: ./ gentools/src/org/apache/qpid/gentools/ gentools/templ.cpp/ gentools/templ.cpp/class/ gentools/templ.cpp/field/ gentools/templ.cpp/method/ gentools/templ.cpp/model/ gentool...

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/PeerHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/PeerHandler.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/PeerHandler.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/PeerHandler.java Thu Mar 22 06:14:42 2007
@@ -21,12 +21,8 @@
 package org.apache.qpid.server.cluster.handler;
 
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.cluster.ClusteredProtocolSession;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.state.AMQStateManager;
 import org.apache.qpid.server.state.StateAwareMethodListener;
 
@@ -36,7 +32,7 @@
  * application).
  *
  */
-public class PeerHandler<A extends AMQMethodBody> extends ClusterMethodHandler<A>
+public class PeerHandler<A extends AMQMethodBodyImpl> extends ClusterMethodHandler<A>
 {
     private final StateAwareMethodListener<A> _peer;
     private final StateAwareMethodListener<A> _client;

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingHandler.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingHandler.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingHandler.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/ReplicatingHandler.java Thu Mar 22 06:14:42 2007
@@ -22,7 +22,7 @@
 
 import org.apache.log4j.Logger;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 import org.apache.qpid.server.cluster.util.LogMessage;
 import org.apache.qpid.server.cluster.*;
 import org.apache.qpid.server.cluster.policy.StandardPolicies;
@@ -41,7 +41,7 @@
  * processed locally after 'completion' of this broadcast.
  *
  */
-class ReplicatingHandler<A extends AMQMethodBody> extends ClusterMethodHandler<A> implements StandardPolicies
+class ReplicatingHandler<A extends AMQMethodBodyImpl> extends ClusterMethodHandler<A> implements StandardPolicies
 {
     protected static final Logger _logger = Logger.getLogger(ReplicatingHandler.class);
 
@@ -109,7 +109,7 @@
             _evt = evt;
         }
 
-        public void response(List<AMQMethodBody> responses, List<Member> members)
+        public void response(List<AMQMethodBodyImpl> responses, List<Member> members)
         {
             try
             {

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappedListener.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappedListener.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappedListener.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappedListener.java Thu Mar 22 06:14:42 2007
@@ -21,15 +21,12 @@
 package org.apache.qpid.server.cluster.handler;
 
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.state.AMQStateManager;
 import org.apache.qpid.server.state.StateAwareMethodListener;
 
-public class WrappedListener<T extends AMQMethodBody> implements StateAwareMethodListener<T>
+public class WrappedListener<T extends AMQMethodBodyImpl> implements StateAwareMethodListener<T>
 {
     private final StateAwareMethodListener<T> _primary;
     private final StateAwareMethodListener _post;
@@ -49,7 +46,7 @@
         _post.methodReceived(stateMgr, evt);
     }
 
-    private static <T extends AMQMethodBody> StateAwareMethodListener<T> check(StateAwareMethodListener<T> in)
+    private static <T extends AMQMethodBodyImpl> StateAwareMethodListener<T> check(StateAwareMethodListener<T> in)
     {
         return in == null ? new NullListener<T>() : in;
     }

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappingMethodHandlerFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappingMethodHandlerFactory.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappingMethodHandlerFactory.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/handler/WrappingMethodHandlerFactory.java Thu Mar 22 06:14:42 2007
@@ -20,7 +20,7 @@
  */
 package org.apache.qpid.server.cluster.handler;
 
-import org.apache.qpid.framing.AMQMethodBody;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 import org.apache.qpid.server.cluster.MethodHandlerFactory;
 import org.apache.qpid.server.cluster.MethodHandlerRegistry;
 import org.apache.qpid.server.state.AMQState;
@@ -66,12 +66,12 @@
         return registry;
     }
 
-    private <A extends AMQMethodBody, B extends Class<A>> void wrap(MethodHandlerRegistry r, B type, A frame)
+    private <A extends AMQMethodBodyImpl, B extends Class<A>> void wrap(MethodHandlerRegistry r, B type, A frame)
     {
         r.addHandler(type, new WrappedListener<A>(r.getHandler(frame), _pre, _post));
     }
 
-    protected static class FrameDescriptor<A extends AMQMethodBody, B extends Class<A>>
+    protected static class FrameDescriptor<A extends AMQMethodBodyImpl, B extends Class<A>>
     {
         protected final A instance;
         protected final B type;

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ChainedMethodRecorder.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ChainedMethodRecorder.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ChainedMethodRecorder.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ChainedMethodRecorder.java Thu Mar 22 06:14:42 2007
@@ -20,9 +20,9 @@
  */
 package org.apache.qpid.server.cluster.replay;
 
-import org.apache.qpid.framing.AMQMethodBody;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 
-abstract class ChainedMethodRecorder <T extends AMQMethodBody> implements MethodRecorder<T>
+abstract class ChainedMethodRecorder <T extends AMQMethodBodyImpl> implements MethodRecorder<T>
 {
     private final MethodRecorder<T> _recorder;
 

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ConsumerCounts.java Thu Mar 22 06:14:42 2007
@@ -20,7 +20,7 @@
  */
 package org.apache.qpid.server.cluster.replay;
 
-import org.apache.qpid.framing.AMQMethodBody;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 import org.apache.qpid.framing.BasicConsumeBody;
 import org.apache.qpid.framing.AMQShortString;
 
@@ -48,7 +48,7 @@
         return count == null ? 0 : count;
     }
 
-    synchronized void replay(List<AMQMethodBody> messages)
+    synchronized void replay(List<AMQMethodBodyImpl> messages)
     {
         for(AMQShortString queue : _counts.keySet())
         {
@@ -72,7 +72,7 @@
         }
     }
 
-    private void replay(BasicConsumeBody msg, List<AMQMethodBody> messages)
+    private void replay(BasicConsumeBody msg, List<AMQMethodBodyImpl> messages)
     {
         int count = _counts.get(msg.queue);
         for(int i = 0; i < count; i++)

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/MethodRecorder.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/MethodRecorder.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/MethodRecorder.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/MethodRecorder.java Thu Mar 22 06:14:42 2007
@@ -20,13 +20,13 @@
  */
 package org.apache.qpid.server.cluster.replay;
 
-import org.apache.qpid.framing.AMQMethodBody;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 
 /**
  * Abstraction through which a method can be recorded for replay
  *
  */
-interface MethodRecorder<T extends AMQMethodBody>
+interface MethodRecorder<T extends AMQMethodBodyImpl>
 {
     public void record(T method);
 }

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/RecordingMethodHandlerFactory.java Thu Mar 22 06:14:42 2007
@@ -20,8 +20,6 @@
  */
 package org.apache.qpid.server.cluster.replay;
 
-import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQMethodBody;
 import org.apache.qpid.framing.BasicCancelBody;
 import org.apache.qpid.framing.BasicConsumeBody;
 import org.apache.qpid.framing.ExchangeDeclareBody;
@@ -30,15 +28,8 @@
 import org.apache.qpid.framing.QueueDeclareBody;
 import org.apache.qpid.framing.QueueDeleteBody;
 import org.apache.qpid.server.cluster.MethodHandlerFactory;
-import org.apache.qpid.server.cluster.MethodHandlerRegistry;
 import org.apache.qpid.server.cluster.handler.WrappingMethodHandlerFactory;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
-import org.apache.qpid.protocol.AMQMethodEvent;
-import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.state.AMQState;
-import org.apache.qpid.server.state.AMQStateManager;
-import org.apache.qpid.server.state.StateAwareMethodListener;
 
 import java.util.Arrays;
 

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayManager.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayManager.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayManager.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayManager.java Thu Mar 22 06:14:42 2007
@@ -20,9 +20,7 @@
  */
 package org.apache.qpid.server.cluster.replay;
 
-import org.apache.qpid.server.cluster.Sendable;
-import org.apache.qpid.framing.AMQDataBlock;
-import org.apache.qpid.framing.AMQMethodBody;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 
 import java.util.List;
 
@@ -33,5 +31,5 @@
  */
 public interface ReplayManager
 {
-    public List<AMQMethodBody> replay(boolean isLeader);
+    public List<AMQMethodBodyImpl> replay(boolean isLeader);
 }

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/main/java/org/apache/qpid/server/cluster/replay/ReplayStore.java Thu Mar 22 06:14:42 2007
@@ -26,10 +26,8 @@
 import org.apache.qpid.server.cluster.ClusteredProtocolSession;
 import org.apache.qpid.server.cluster.util.LogMessage;
 import org.apache.qpid.server.cluster.util.Bindings;
-import org.apache.qpid.server.exchange.ExchangeRegistry;
 import org.apache.qpid.protocol.AMQMethodEvent;
 import org.apache.qpid.server.protocol.AMQProtocolSession;
-import org.apache.qpid.server.queue.QueueRegistry;
 import org.apache.qpid.server.state.AMQStateManager;
 import org.apache.qpid.server.state.StateAwareMethodListener;
 import org.apache.qpid.server.virtualhost.VirtualHost;
@@ -48,8 +46,8 @@
 {
     private static final Logger _logger = Logger.getLogger(ReplayStore.class);
 
-    private final Map<Class<? extends AMQMethodBody>, MethodRecorder> _globalRecorders = new HashMap<Class<? extends AMQMethodBody>, MethodRecorder>();
-    private final Map<Class<? extends AMQMethodBody>, MethodRecorder> _localRecorders = new HashMap<Class<? extends AMQMethodBody>, MethodRecorder>();
+    private final Map<Class<? extends AMQMethodBodyImpl>, MethodRecorder> _globalRecorders = new HashMap<Class<? extends AMQMethodBodyImpl>, MethodRecorder>();
+    private final Map<Class<? extends AMQMethodBodyImpl>, MethodRecorder> _localRecorders = new HashMap<Class<? extends AMQMethodBodyImpl>, MethodRecorder>();
     private final Map<AMQShortString, QueueDeclareBody> _sharedQueues = new ConcurrentHashMap<AMQShortString, QueueDeclareBody>();
     private final Map<AMQShortString, QueueDeclareBody> _privateQueues = new ConcurrentHashMap<AMQShortString, QueueDeclareBody>();
     private final Bindings<AMQShortString, AMQShortString, QueueBindBody> _sharedBindings = new Bindings<AMQShortString, AMQShortString, QueueBindBody>();
@@ -80,7 +78,7 @@
         VirtualHost virtualHost = session.getVirtualHost();
 
         _logger.debug(new LogMessage("Replay store received {0}", evt.getMethod()));
-        AMQMethodBody request = evt.getMethod();
+        AMQMethodBodyImpl request = evt.getMethod();
 
         //allow any (relevant) recorder registered for this type of request to record it:
         MethodRecorder recorder = getRecorders(session).get(request.getClass());
@@ -90,7 +88,7 @@
         }
     }
 
-    private Map<Class<? extends AMQMethodBody>, MethodRecorder> getRecorders(AMQProtocolSession session)
+    private Map<Class<? extends AMQMethodBodyImpl>, MethodRecorder> getRecorders(AMQProtocolSession session)
     {
         if (ClusteredProtocolSession.isPeerSession(session))
         {
@@ -102,9 +100,9 @@
         }
     }
 
-    public List<AMQMethodBody> replay(boolean isLeader)
+    public List<AMQMethodBodyImpl> replay(boolean isLeader)
     {
-        List<AMQMethodBody> methods = new ArrayList<AMQMethodBody>();
+        List<AMQMethodBodyImpl> methods = new ArrayList<AMQMethodBodyImpl>();
         methods.addAll(_exchanges.values());
         methods.addAll(_privateQueues.values());
         synchronized(_privateBindings)

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/BrokerTest.java Thu Mar 22 06:14:42 2007
@@ -23,11 +23,11 @@
 import junit.framework.TestCase;
 import org.apache.mina.common.ByteBuffer;
 import org.apache.qpid.AMQException;
-import org.apache.qpid.framing.AMQBody;
+import org.apache.qpid.framing.AMQBodyImpl;
 import org.apache.qpid.framing.AMQDataBlock;
 import org.apache.qpid.framing.AMQFrame;
 import org.apache.qpid.framing.AMQFrameDecodingException;
-import org.apache.qpid.framing.AMQMethodBody;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 import org.apache.qpid.server.cluster.policy.StandardPolicies;
 
 import java.util.ArrayList;
@@ -91,13 +91,13 @@
     //simple send (no response)
     public void testSend_noResponse() throws AMQException
     {
-        AMQBody[] msgs = new AMQBody[]{
+        AMQBodyImpl[] msgs = new AMQBodyImpl[]{
                 new TestMethod("A"),
                 new TestMethod("B"),
                 new TestMethod("C")
         };
         RecordingBroker broker = new RecordingBroker("myhost", 1);
-        for (AMQBody msg : msgs)
+        for (AMQBodyImpl msg : msgs)
         {
             broker.send(new SimpleBodySendable(msg), null);
         }
@@ -142,7 +142,7 @@
         assertTrue(handler.failed());
     }
 
-    private static class TestMethod extends AMQMethodBody
+    private static class TestMethod extends AMQMethodBodyImpl
     {
         private final Object id;
 
@@ -209,19 +209,19 @@
 
     private static class GroupResponseValidator implements GroupResponseHandler
     {
-        private final AMQMethodBody _response;
+        private final AMQMethodBodyImpl _response;
         private final List<Member> _members;
         private boolean _completed = false;
 
-        GroupResponseValidator(AMQMethodBody response, List<Member> members)
+        GroupResponseValidator(AMQMethodBodyImpl response, List<Member> members)
         {
             _response = response;
             _members = members;
         }
 
-        public void response(List<AMQMethodBody> responses, List<Member> members)
+        public void response(List<AMQMethodBodyImpl> responses, List<Member> members)
         {
-            for (AMQMethodBody r : responses)
+            for (AMQMethodBodyImpl r : responses)
             {
                 assertEquals(_response, r);
             }

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBroker.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBroker.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBroker.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestBroker.java Thu Mar 22 06:14:42 2007
@@ -23,7 +23,7 @@
 import org.apache.qpid.AMQException;
 import org.apache.qpid.framing.AMQDataBlock;
 import org.apache.qpid.framing.AMQFrame;
-import org.apache.qpid.framing.AMQMethodBody;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 
 import java.io.IOException;
 
@@ -39,16 +39,16 @@
         return true;
     }
 
-    void connectAsynch(Iterable<AMQMethodBody> msgs)
+    void connectAsynch(Iterable<AMQMethodBodyImpl> msgs)
     {
         replay(msgs);
     }
 
-    void replay(Iterable<AMQMethodBody> msgs)
+    void replay(Iterable<AMQMethodBodyImpl> msgs)
     {
         try
         {
-            for (AMQMethodBody b : msgs)
+            for (AMQMethodBodyImpl b : msgs)
             {
                 send(new AMQFrame(0, b));
             }

Modified: incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestReplayManager.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestReplayManager.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestReplayManager.java (original)
+++ incubator/qpid/branches/java.multi_version/java/cluster/src/test/java/org/apache/qpid/server/cluster/TestReplayManager.java Thu Mar 22 06:14:42 2007
@@ -20,7 +20,7 @@
  */
 package org.apache.qpid.server.cluster;
 
-import org.apache.qpid.framing.AMQMethodBody;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 import org.apache.qpid.server.cluster.replay.ReplayManager;
 
 import java.util.ArrayList;
@@ -28,19 +28,19 @@
 
 class TestReplayManager implements ReplayManager
 {
-    private final List<AMQMethodBody> _msgs;
+    private final List<AMQMethodBodyImpl> _msgs;
 
     TestReplayManager()
     {
-        this(new ArrayList<AMQMethodBody>());
+        this(new ArrayList<AMQMethodBodyImpl>());
     }
 
-    TestReplayManager(List<AMQMethodBody> msgs)
+    TestReplayManager(List<AMQMethodBodyImpl> msgs)
     {
         _msgs = msgs;
     }
 
-    public List<AMQMethodBody> replay(boolean isLeader)
+    public List<AMQMethodBodyImpl> replay(boolean isLeader)
     {
         return _msgs;
     }

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/AMQChannelException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/AMQChannelException.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/AMQChannelException.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/AMQChannelException.java Thu Mar 22 06:14:42 2007
@@ -23,6 +23,8 @@
 import org.apache.qpid.framing.AMQFrame;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.ChannelCloseBody;
+import org.apache.qpid.framing.amqp_8_0.ConnectionCloseBodyImpl;
+import org.apache.qpid.framing.amqp_8_0.ChannelCloseBodyImpl;
 import org.apache.qpid.protocol.AMQConstant;
 
 public class AMQChannelException extends AMQException
@@ -53,6 +55,6 @@
 
     public AMQFrame getCloseFrame(int channel)
     {
-        return ChannelCloseBody.createAMQFrame(channel, major, minor, _classId, _methodId, getErrorCode().getCode(), new AMQShortString(getMessage()));
+        return new AMQFrame(channel, new ChannelCloseBodyImpl(getErrorCode().getCode(), new AMQShortString(getMessage()),0,0));        
     }
 }

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/AMQConnectionException.java Thu Mar 22 06:14:42 2007
@@ -24,6 +24,7 @@
 import org.apache.qpid.framing.AMQFrame;
 import org.apache.qpid.framing.AMQShortString;
 import org.apache.qpid.framing.ConnectionCloseBody;
+import org.apache.qpid.framing.amqp_8_0.ConnectionCloseBodyImpl;
 import org.apache.qpid.protocol.AMQConstant;
 
 public class AMQConnectionException extends AMQException
@@ -57,7 +58,7 @@
 
     public AMQFrame getCloseFrame(int channel)
     {
-        return ConnectionCloseBody.createAMQFrame(channel, major, minor, _classId, _methodId, getErrorCode().getCode(), new AMQShortString(getMessage()));
+        return new AMQFrame(channel, new ConnectionCloseBodyImpl(getErrorCode().getCode(), new AMQShortString(getMessage()),_classId,_methodId));        
     }
 
 

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/codec/AMQDecoder.java Thu Mar 22 06:14:42 2007
@@ -48,13 +48,21 @@
 
     protected boolean doDecode(IoSession session, ByteBuffer in, ProtocolDecoderOutput out) throws Exception
     {
-        if (_expectProtocolInitiation)
+        try
         {
-            return doDecodePI(session, in, out);
+            if (_expectProtocolInitiation)
+            {
+                return doDecodePI(session, in, out);
+            }
+            else
+            {
+                return doDecodeDataBlock(session, in, out);
+            }
         }
-        else
+        catch (Exception e)
         {
-            return doDecodeDataBlock(session, in, out);
+            e.printStackTrace();
+            throw e;
         }
     }
 

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/common/ClientProperties.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/common/ClientProperties.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/common/ClientProperties.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/common/ClientProperties.java Thu Mar 22 06:14:42 2007
@@ -20,10 +20,28 @@
  */
 package org.apache.qpid.common;
 
+import org.apache.qpid.framing.AMQShortString;
+
 public enum ClientProperties
 {
+
+
     instance,
     product,
     version,
-    platform
+    platform;
+
+
+    private final AMQShortString _name;
+
+    private ClientProperties()
+    {
+        _name = new AMQShortString(toString());
+    }
+
+    public AMQShortString getName()
+    {
+        return _name;
+    }
+
 }

Added: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java?view=auto&rev=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java (added)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java Thu Mar 22 06:14:42 2007
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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.
+ *
+ */
+package org.apache.qpid.framing;
+
+import org.apache.mina.common.ByteBuffer;
+
+public interface AMQBody
+{
+    byte getFrameType();
+
+    /**
+     * Get the size of the body
+     * @return unsigned short
+     */
+    int getSize();
+
+    void writePayload(ByteBuffer buffer);
+}

Copied: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQBodyImpl.java (from r511387, incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQBodyImpl.java?view=diff&rev=521253&p1=incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java&r1=511387&p2=incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQBodyImpl.java&r2=521253
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQBody.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQBodyImpl.java Thu Mar 22 06:14:42 2007
@@ -20,20 +20,8 @@
  */
 package org.apache.qpid.framing;
 
-import org.apache.mina.common.ByteBuffer;
 
-public abstract class AMQBody
+public abstract class AMQBodyImpl implements AMQBody
 {
-    public abstract byte getFrameType();
-    
-    /** 
-     * Get the size of the body
-     * @return unsigned short
-     */
-    protected abstract int getSize();
-    
-    protected abstract void writePayload(ByteBuffer buffer);
-    
-    protected abstract void populateFromBuffer(ByteBuffer buffer, long size)
-        throws AMQFrameDecodingException, AMQProtocolVersionException;        
+
 }

Propchange: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQBodyImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQBodyImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQDataBlockDecoder.java Thu Mar 22 06:14:42 2007
@@ -72,7 +72,7 @@
         final byte type = in.get();
 
         BodyFactory bodyFactory;
-        if(type == AMQMethodBody.TYPE)
+        if(type == AMQMethodBodyImpl.TYPE)
         {
             bodyFactory = (BodyFactory) session.getAttribute(SESSION_METHOD_BODY_FACTORY);
             if(bodyFactory == null)

Added: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java?view=auto&rev=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java (added)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java Thu Mar 22 06:14:42 2007
@@ -0,0 +1,25 @@
+package org.apache.qpid.framing;
+
+import org.apache.qpid.AMQChannelException;
+import org.apache.qpid.AMQConnectionException;
+import org.apache.qpid.protocol.AMQConstant;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: U146758
+ * Date: 08-Mar-2007
+ * Time: 11:30:28
+ * To change this template use File | Settings | File Templates.
+ */
+public interface AMQMethodBody extends AMQBody
+{
+    AMQChannelException getChannelNotFoundException(int channelId);
+
+    AMQChannelException getChannelException(AMQConstant code, String message);
+
+    AMQChannelException getChannelException(AMQConstant code, String message, Throwable cause);
+
+    AMQConnectionException getConnectionException(AMQConstant code, String message);
+
+    AMQConnectionException getConnectionException(AMQConstant code, String message, Throwable cause);
+}

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyFactory.java Thu Mar 22 06:14:42 2007
@@ -37,6 +37,6 @@
 
     public AMQBody createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
     {
-        return _protocolSession.getRegistry().get((short)in.getUnsignedShort(), (short)in.getUnsignedShort(), in, bodySize);
+        return _protocolSession.getRegistry().convertToBody(in, bodySize);
     }
 }

Copied: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyImpl.java (from r511389, incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java)
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyImpl.java?view=diff&rev=521253&p1=incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java&r1=511389&p2=incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyImpl.java&r2=521253
==============================================================================
--- incubator/qpid/trunk/qpid/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBody.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyImpl.java Thu Mar 22 06:14:42 2007
@@ -25,29 +25,13 @@
 import org.apache.qpid.AMQConnectionException;
 import org.apache.qpid.protocol.AMQConstant;
 
-public abstract class AMQMethodBody extends AMQBody
+public abstract class AMQMethodBodyImpl extends AMQBodyImpl implements AMQMethodBody
 {
     public static final byte TYPE = 1;
 
-    /** AMQP version */
-    protected byte major;
-    protected byte minor;
 
-    public byte getMajor()
-    {
-        return major;
-    }
-
-    public byte getMinor()
-    {
-        return minor;
-    }
-
-    public AMQMethodBody(byte major, byte minor)
-    {
-        this.major = major;
-        this.minor = minor;
-    }
+    public abstract byte getMajor();
+    public abstract byte getMinor();
 
     /** unsigned short */
     protected abstract int getBodySize();
@@ -65,32 +49,18 @@
         return TYPE;
     }
 
-    protected int getSize()
+    public int getSize()
     {
         return 2 + 2 + getBodySize();
     }
 
-    protected void writePayload(ByteBuffer buffer)
+    public void writePayload(ByteBuffer buffer)
     {
         EncodingUtils.writeUnsignedShort(buffer, getClazz());
         EncodingUtils.writeUnsignedShort(buffer, getMethod());
         writeMethodPayload(buffer);
     }
 
-    protected abstract void populateMethodBodyFromBuffer(ByteBuffer buffer) throws AMQFrameDecodingException;
-
-    protected void populateFromBuffer(ByteBuffer buffer, long size) throws AMQFrameDecodingException
-    {
-        populateMethodBodyFromBuffer(buffer);
-    }
-
-    public String toString()
-    {
-        StringBuffer buf = new StringBuffer(getClass().getName());
-        buf.append("[ Class: ").append(getClazz());
-        buf.append(" Method: ").append(getMethod()).append(']');
-        return buf.toString();
-    }
 
     /**
      * Creates an AMQChannelException for the corresponding body type (a channel exception should include the class and
@@ -111,22 +81,22 @@
 
     public AMQChannelException getChannelException(AMQConstant code, String message)
     {
-        return new AMQChannelException(code, message, getClazz(), getMethod(), major, minor);
+        return new AMQChannelException(code, message, getClazz(), getMethod(), getMajor(), getMinor());
     }
 
     public AMQChannelException getChannelException(AMQConstant code, String message, Throwable cause)
     {
-        return new AMQChannelException(code, message, getClazz(), getMethod(), major, minor, cause);
+        return new AMQChannelException(code, message, getClazz(), getMethod(), getMajor(), getMinor(), cause);
     }
 
     public AMQConnectionException getConnectionException(AMQConstant code, String message)
     {
-        return new AMQConnectionException(code, message, getClazz(), getMethod(), major, minor);
+        return new AMQConnectionException(code, message, getClazz(), getMethod(), getMajor(), getMinor());
     }
 
     public AMQConnectionException getConnectionException(AMQConstant code, String message, Throwable cause)
     {
-        return new AMQConnectionException(code, message, getClazz(), getMethod(), major, minor, cause);
+        return new AMQConnectionException(code, message, getClazz(), getMethod(), getMajor(), getMinor(), cause);
     }
 
 }

Propchange: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodBodyInstanceFactory.java Thu Mar 22 06:14:42 2007
@@ -5,6 +5,5 @@
 
 public abstract interface AMQMethodBodyInstanceFactory
 {
-    public AMQMethodBody newInstance(byte major, byte minor, ByteBuffer buffer, long size) throws AMQFrameDecodingException;
-    public AMQMethodBody newInstance(byte major, byte minor, int clazzID, int methodID, ByteBuffer buffer, long size) throws AMQFrameDecodingException;
+    public AMQMethodBody newInstance(ByteBuffer buffer, long size) throws AMQFrameDecodingException;
 }

Added: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodFactory.java?view=auto&rev=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodFactory.java (added)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/AMQMethodFactory.java Thu Mar 22 06:14:42 2007
@@ -0,0 +1,90 @@
+/*
+ *
+ * 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.
+ *
+ */
+package org.apache.qpid.framing;
+
+import org.apache.mina.common.ByteBuffer;
+
+
+public interface AMQMethodFactory
+{
+
+    // Connection Methods
+
+    ConnectionCloseBody createConnectionClose();
+
+    // Access Methods
+
+    AccessRequestBody createAccessRequest(boolean active, boolean exclusive, boolean passive, boolean read, AMQShortString realm, boolean write);
+
+
+    // Tx Methods
+
+    TxSelectBody createTxSelect();
+
+    TxCommitBody createTxCommit();
+
+    TxRollbackBody createTxRollback();
+
+    // Channel Methods
+
+    ChannelOpenBody createChannelOpen();
+
+    ChannelCloseBody createChannelClose(int replyCode, AMQShortString replyText);
+
+    ChannelFlowBody createChannelFlow(boolean active);
+
+
+    // Exchange Methods
+
+
+    ExchangeBoundBody createExchangeBound(AMQShortString exchangeName,
+                                          AMQShortString queueName,
+                                          AMQShortString routingKey);
+
+    ExchangeDeclareBody createExchangeDeclare(AMQShortString name, AMQShortString type, int ticket);        
+
+
+    // Queue Methods
+
+    QueueDeclareBody createQueueDeclare(AMQShortString name, FieldTable arguments, boolean autoDelete, boolean durable, boolean exclusive, boolean passive, int ticket);
+
+    QueueBindBody createQueueBind(AMQShortString queueName, AMQShortString exchangeName, AMQShortString routingKey, FieldTable arguments, int ticket);
+
+    QueueDeleteBody createQueueDelete(AMQShortString queueName, boolean ifEmpty, boolean ifUnused, int ticket);
+
+
+    // Message Methods
+
+    // In different versions of the protocol we change the class used for message transfer
+    // abstract this out so the appropriate methods are created
+    AMQMethodBody createRecover(boolean requeue);
+
+    AMQMethodBody createConsumer(AMQShortString tag, AMQShortString queueName, FieldTable arguments, boolean noAck, boolean exclusive, boolean noLocal, int ticket);
+
+    AMQMethodBody createConsumerCancel(AMQShortString consumerTag);
+
+    AMQMethodBody createAcknowledge(long deliveryTag, boolean multiple);
+
+    AMQMethodBody createRejectBody(long deliveryTag, boolean requeue);
+
+    AMQMethodBody createMessageQos(int prefetchCount, int prefetchSize);
+ 
+}

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentBody.java Thu Mar 22 06:14:42 2007
@@ -22,7 +22,7 @@
 
 import org.apache.mina.common.ByteBuffer;
 
-public class ContentBody extends AMQBody
+public class ContentBody extends AMQBodyImpl
 {
     public static final byte TYPE = 3;
 

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentBodyFactory.java Thu Mar 22 06:14:42 2007
@@ -39,7 +39,7 @@
         _log.debug("Creating content body factory");
     }
 
-    public AMQBody createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
+    public AMQBodyImpl createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
     {
         return new ContentBody(in, bodySize);
     }

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBody.java Thu Mar 22 06:14:42 2007
@@ -22,7 +22,7 @@
 
 import org.apache.mina.common.ByteBuffer;
 
-public class ContentHeaderBody extends AMQBody
+public class ContentHeaderBody extends AMQBodyImpl
 {
     public static final byte TYPE = 2;
 
@@ -110,7 +110,7 @@
         properties.writePropertyListPayload(buffer);
     }
 
-    public static AMQFrame createAMQFrame(int channelId, int classId, int weight, BasicContentHeaderProperties properties,
+    public static AMQFrame createAMQFrame(int channelId, int classId, int weight, CommonContentHeaderProperties properties,
                                           long bodySize)
     {
         return new AMQFrame(channelId, new ContentHeaderBody(classId, weight, properties, bodySize));

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderBodyFactory.java Thu Mar 22 06:14:42 2007
@@ -39,7 +39,7 @@
         _log.debug("Creating content header body factory");
     }
 
-    public AMQBody createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
+    public AMQBodyImpl createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
     {
         // all content headers are the same - it is only the properties that differ.
         // the content header body further delegates construction of properties

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/ContentHeaderPropertiesFactory.java Thu Mar 22 06:14:42 2007
@@ -20,6 +20,8 @@
  */
 package org.apache.qpid.framing;
 
+import org.apache.qpid.framing.amqp_8_0.BasicConsumeBodyImpl;
+
 import org.apache.mina.common.ByteBuffer;
 
 public class ContentHeaderPropertiesFactory
@@ -43,7 +45,7 @@
         // AMQP version change: "Hardwired" version to major=8, minor=0
         // TODO: Change so that the actual version is obtained from
         // the ProtocolInitiation object for this session.
-        if (classId == BasicConsumeBody.getClazz((byte)8, (byte)0))
+        if (classId == BasicConsumeBodyImpl.CLASS_ID)
         {
         	properties = new BasicContentHeaderProperties();
         }

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBody.java Thu Mar 22 06:14:42 2007
@@ -22,7 +22,7 @@
 
 import org.apache.mina.common.ByteBuffer;
 
-public class HeartbeatBody extends AMQBody
+public class HeartbeatBody extends AMQBodyImpl
 {
     public static final byte TYPE = 8;
     public static AMQFrame FRAME = new HeartbeatBody().toFrame();
@@ -46,12 +46,12 @@
         return TYPE;
     }
 
-    protected int getSize()
+    public int getSize()
     {
         return 0;//heartbeats we generate have no payload
     }
 
-    protected void writePayload(ByteBuffer buffer)
+    public void writePayload(ByteBuffer buffer)
     {
     }
 

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBodyFactory.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBodyFactory.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBodyFactory.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/HeartbeatBodyFactory.java Thu Mar 22 06:14:42 2007
@@ -24,7 +24,7 @@
 
 public class HeartbeatBodyFactory implements BodyFactory
 {
-    public AMQBody createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
+    public AMQBodyImpl createBody(ByteBuffer in, long bodySize) throws AMQFrameDecodingException
     {
         return new HeartbeatBody();
     }

Added: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/MainRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/MainRegistry.java?view=auto&rev=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/MainRegistry.java (added)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/MainRegistry.java Thu Mar 22 06:14:42 2007
@@ -0,0 +1,35 @@
+/*
+ *
+ * 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.
+ *
+ */
+package org.apache.qpid.framing;
+
+public class MainRegistry
+{
+
+    public static VersionSpecificRegistry getVersionSpecificRegistry(byte versionMajor, byte versionMinor)
+    {
+        return null;  //To change body of created methods use File | Settings | File Templates.
+    }
+
+    public static VersionSpecificRegistry getVersionSpecificRegistry(ProtocolVersion pv)
+    {
+        return null;  //To change body of created methods use File | Settings | File Templates.
+    }
+}

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/MethodConverter_8_0.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/MethodConverter_8_0.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/MethodConverter_8_0.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/MethodConverter_8_0.java Thu Mar 22 06:14:42 2007
@@ -4,6 +4,7 @@
 import org.apache.qpid.framing.abstraction.ContentChunk;
 import org.apache.qpid.framing.abstraction.MessagePublishInfo;
 import org.apache.qpid.framing.abstraction.AbstractMethodConverter;
+import org.apache.qpid.framing.amqp_8_0.BasicPublishBodyImpl;
 
 import org.apache.mina.common.ByteBuffer;
 
@@ -19,7 +20,7 @@
 
     }
 
-    public AMQBody convertToBody(ContentChunk contentChunk)
+    public AMQBodyImpl convertToBody(ContentChunk contentChunk)
     {
         return new ContentBody(contentChunk.getData());
     }
@@ -52,8 +53,8 @@
     public void configure()
     {
 
-        _basicPublishClassId = BasicPublishBody.getClazz(getProtocolMajorVersion(),getProtocolMinorVersion());
-        _basicPublishMethodId = BasicPublishBody.getMethod(getProtocolMajorVersion(),getProtocolMinorVersion());
+        _basicPublishClassId = BasicPublishBodyImpl.CLASS_ID;
+        _basicPublishMethodId = BasicPublishBodyImpl.METHOD_ID;
                 
     }
 
@@ -87,18 +88,15 @@
 
     }
 
-    public AMQMethodBody convertToBody(MessagePublishInfo info)
+    public AMQMethodBodyImpl convertToBody(MessagePublishInfo info)
     {
 
-        return new BasicPublishBody(getProtocolMajorVersion(),
-                                    getProtocolMinorVersion(),
-                                    _basicPublishClassId,
-                                    _basicPublishMethodId,
-                                    info.getExchange(),
-                                    info.isImmediate(),
+        return new BasicPublishBodyImpl(0, // ticket
+                                        info.getExchange(),
+                                        info.getRoutingKey(),
                                     info.isMandatory(),
-                                    info.getRoutingKey(),
-                                    0) ; // ticket
+                                    info.isImmediate()
+                                    ) ;
 
     }
 }

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/VersionSpecificRegistry.java Thu Mar 22 06:14:42 2007
@@ -179,7 +179,7 @@
         }
 
 
-        return bodyFactory.newInstance(_protocolMajorVersion, _protocolMinorVersion, classID, methodID, in, size);
+        return bodyFactory.newInstance(in, size);
 
 
     }

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/abstraction/MessagePublishInfoConverter.java Thu Mar 22 06:14:42 2007
@@ -18,12 +18,13 @@
 
 package org.apache.qpid.framing.abstraction;
 
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 import org.apache.qpid.framing.AMQMethodBody;
 
 
 public interface MessagePublishInfoConverter
 {
     public MessagePublishInfo convertToInfo(AMQMethodBody body);
-    public AMQMethodBody convertToBody(MessagePublishInfo info);
+    public AMQMethodBodyImpl convertToBody(MessagePublishInfo info);
 
 }

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/abstraction/ProtocolVersionMethodConverter.java Thu Mar 22 06:14:42 2007
@@ -18,11 +18,12 @@
 
 package org.apache.qpid.framing.abstraction;
 
+import org.apache.qpid.framing.AMQBodyImpl;
 import org.apache.qpid.framing.AMQBody;
 
 public interface ProtocolVersionMethodConverter extends MessagePublishInfoConverter
 {
-    AMQBody convertToBody(ContentChunk contentBody);
+    AMQBodyImpl convertToBody(ContentChunk contentBody);
     ContentChunk convertToContentChunk(AMQBody body);
 
     void configure();

Added: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java?view=auto&rev=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java (added)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodBody_8_0.java Thu Mar 22 06:14:42 2007
@@ -0,0 +1,160 @@
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.framing.EncodingUtils;
+import org.apache.qpid.framing.AMQFrameDecodingException;
+import org.apache.qpid.framing.AMQShortString;
+import org.apache.qpid.framing.FieldTable;
+
+import org.apache.mina.common.ByteBuffer;
+
+public abstract class AMQMethodBody_8_0 extends org.apache.qpid.framing.AMQMethodBodyImpl
+{
+
+    public byte getMajor()
+    {
+        return 8;
+    }
+
+    public byte getMinor()
+    {
+        return 0;
+    }
+
+    public int getSize()
+    {
+        return 2 + 2 + getBodySize();
+    }
+
+    public void writePayload(ByteBuffer buffer)
+    {
+        EncodingUtils.writeUnsignedShort(buffer, getClazz());
+        EncodingUtils.writeUnsignedShort(buffer, getMethod());
+        writeMethodPayload(buffer);
+    }
+
+
+    protected byte readByte(ByteBuffer buffer)
+    {
+        return buffer.get();
+    }
+
+    protected AMQShortString readAMQShortString(ByteBuffer buffer)
+    {
+        return EncodingUtils.readAMQShortString(buffer);
+    }
+
+    protected int getSizeOf(AMQShortString string)
+    {
+        return EncodingUtils.encodedShortStringLength(string);
+    }
+
+    protected void writeByte(ByteBuffer buffer, byte b)
+    {
+        buffer.put(b);
+    }
+
+    protected void writeAMQShortString(ByteBuffer buffer, AMQShortString string)
+    {
+        EncodingUtils.writeShortStringBytes(buffer, string);
+    }
+
+    protected int readInt(ByteBuffer buffer)
+    {
+        return buffer.getInt();
+    }
+
+    protected void writeInt(ByteBuffer buffer, int i)
+    {
+        buffer.putInt(i);
+    }
+
+    protected FieldTable readFieldTable(ByteBuffer buffer) throws AMQFrameDecodingException
+    {
+        return EncodingUtils.readFieldTable(buffer);
+    }
+
+    protected int getSizeOf(FieldTable table)
+    {
+        return EncodingUtils.encodedFieldTableLength(table);  //To change body of created methods use File | Settings | File Templates.
+    }
+
+    protected void writeFieldTable(ByteBuffer buffer, FieldTable table)
+    {
+        EncodingUtils.writeFieldTableBytes(buffer, table);
+    }
+
+    protected long readLong(ByteBuffer buffer)
+    {
+        return buffer.getLong();
+    }
+
+    protected void writeLong(ByteBuffer buffer, long l)
+    {
+        buffer.putLong(l);
+    }
+
+    protected int getSizeOf(byte[] response)
+    {
+        return response.length;  //To change body of created methods use File | Settings | File Templates.
+    }
+
+    protected void writeBytes(ByteBuffer buffer, byte[] data)
+    {
+        EncodingUtils.writeLongstr(buffer,data);
+    }
+
+    protected byte[] readBytes(ByteBuffer buffer)
+    {
+        return EncodingUtils.readLongstr(buffer);
+    }
+
+    protected short readShort(ByteBuffer buffer)
+    {
+        return EncodingUtils.readShort(buffer);
+    }
+
+    protected void writeShort(ByteBuffer buffer, short s)
+    {
+        EncodingUtils.writeShort(buffer, s);
+    }
+
+    protected short readUnsignedByte(ByteBuffer buffer)
+    {
+        return buffer.getUnsigned();
+    }
+
+    protected void writeUnsignedByte(ByteBuffer buffer, short unsignedByte)
+    {
+        EncodingUtils.writeUnsignedByte(buffer, unsignedByte);
+    }
+
+    protected byte readBitfield(ByteBuffer buffer)
+    {
+        return readByte(buffer);
+    }
+
+    protected int readUnsignedShort(ByteBuffer buffer)
+    {
+        return buffer.getUnsignedShort();
+    }
+
+    protected void writeBitfield(ByteBuffer buffer, byte bitfield0)
+    {
+        buffer.put(bitfield0);
+    }
+
+    protected void writeUnsignedShort(ByteBuffer buffer, int s)
+    {
+        EncodingUtils.writeUnsignedShort(buffer, s);
+    }
+
+    protected long readUnsignedInteger(ByteBuffer buffer)
+    {
+        return buffer.getUnsignedInt();
+    }
+    protected void writeUnsignedInteger(ByteBuffer buffer, long i)
+    {
+        EncodingUtils.writeUnsignedInteger(buffer, i);
+    }
+
+}

Added: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodFactory_8_0.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodFactory_8_0.java?view=auto&rev=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodFactory_8_0.java (added)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/framing/amqp_8_0/AMQMethodFactory_8_0.java Thu Mar 22 06:14:42 2007
@@ -0,0 +1,117 @@
+package org.apache.qpid.framing.amqp_8_0;
+
+import org.apache.qpid.framing.*;
+import org.apache.qpid.protocol.AMQConstant;
+
+import org.apache.mina.common.ByteBuffer;
+
+
+public class AMQMethodFactory_8_0 implements AMQMethodFactory
+{
+    private static final AMQShortString CLIENT_INITIATED_CONNECTION_CLOSE =
+            new AMQShortString("Client initiated connection close");
+
+    public ConnectionCloseBody createConnectionClose()
+    {
+        return new ConnectionCloseBodyImpl(AMQConstant.REPLY_SUCCESS.getCode(),
+                                           CLIENT_INITIATED_CONNECTION_CLOSE,
+                                           0,
+                                           0);
+    }
+
+    public AccessRequestBody createAccessRequest(boolean active, boolean exclusive, boolean passive, boolean read, AMQShortString realm, boolean write)
+    {
+        return new AccessRequestBodyImpl(realm,exclusive,passive,active,write,read);
+    }
+
+    public TxSelectBody createTxSelect()
+    {
+        return new TxSelectBodyImpl();
+    }
+
+    public TxCommitBody createTxCommit()
+    {
+        return new TxCommitBodyImpl();
+    }
+
+    public TxRollbackBody createTxRollback()
+    {
+        return new TxRollbackBodyImpl();
+    }
+
+    public ChannelOpenBody createChannelOpen()
+    {
+        return new ChannelOpenBodyImpl((AMQShortString)null);
+    }
+
+    public ChannelCloseBody createChannelClose(int replyCode, AMQShortString replyText)
+    {
+        return new ChannelCloseBodyImpl(replyCode, replyText, 0, 0);
+    }
+
+    public ExchangeDeclareBody createExchangeDeclare(AMQShortString name, AMQShortString type, int ticket)
+    {
+        return new ExchangeDeclareBodyImpl(ticket,name,type,false,false,false,false,false,null);  
+    }
+
+    public ExchangeBoundBody createExchangeBound(AMQShortString exchangeName, AMQShortString queueName, AMQShortString routingKey)
+    {
+        return new ExchangeBoundBodyImpl(exchangeName,routingKey,queueName);
+    }
+
+    public QueueDeclareBody createQueueDeclare(AMQShortString name, FieldTable arguments, boolean autoDelete, boolean durable, boolean exclusive, boolean passive, int ticket)
+    {
+        return new QueueDeclareBodyImpl(ticket,name,passive,durable,exclusive,autoDelete,false,arguments);
+    }
+
+    public QueueBindBody createQueueBind(AMQShortString queueName, AMQShortString exchangeName, AMQShortString routingKey, FieldTable arguments, int ticket)
+    {
+        return new QueueBindBodyImpl(ticket,queueName,exchangeName,routingKey,false,arguments);
+    }
+
+    public QueueDeleteBody createQueueDelete(AMQShortString queueName, boolean ifEmpty, boolean ifUnused, int ticket)
+    {
+        return new QueueDeleteBodyImpl(ticket,queueName,ifUnused,ifEmpty,false);
+    }
+
+    public ChannelFlowBody createChannelFlow(boolean active)
+    {
+        return new ChannelFlowBodyImpl(active);
+    }
+
+
+    // In different versions of the protocol we change the class used for message transfer
+    // abstract this out so the appropriate methods are created
+    public AMQMethodBody createRecover(boolean requeue)
+    {
+        return new BasicRecoverBodyImpl(requeue);
+    }
+
+    public AMQMethodBody createConsumer(AMQShortString tag, AMQShortString queueName, FieldTable arguments, boolean noAck, boolean exclusive, boolean noLocal, int ticket)
+    {
+        return new BasicConsumeBodyImpl(ticket,queueName,tag,noLocal,noAck,exclusive,false,arguments);
+    }
+
+    public AMQMethodBody createConsumerCancel(AMQShortString consumerTag)
+    {
+        return new BasicCancelBodyImpl(consumerTag, false);
+    }
+
+    public AMQMethodBody createAcknowledge(long deliveryTag, boolean multiple)
+    {
+        return new BasicAckBodyImpl(deliveryTag,multiple);
+    }
+
+    public AMQMethodBody createRejectBody(long deliveryTag, boolean requeue)
+    {
+        return new BasicRejectBodyImpl(deliveryTag, requeue);
+    }
+
+    public AMQMethodBody createMessageQos(int prefetchCount, int prefetchSize)
+    {
+        return new BasicQosBodyImpl(prefetchSize, prefetchCount, false);
+    }
+
+
+
+}

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/pool/PoolingFilter.java Thu Mar 22 06:14:42 2007
@@ -136,6 +136,7 @@
     public void exceptionCaught(final NextFilter nextFilter, final IoSession session,
                                 final Throwable cause) throws Exception
     {
+        cause.printStackTrace();
             nextFilter.exceptionCaught(session,cause);
     }
 

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodEvent.java Thu Mar 22 06:14:42 2007
@@ -20,6 +20,7 @@
  */
 package org.apache.qpid.protocol;
 
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 import org.apache.qpid.framing.AMQMethodBody;
 
 /**

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQMethodListener.java Thu Mar 22 06:14:42 2007
@@ -21,6 +21,7 @@
 package org.apache.qpid.protocol;
 
 import org.apache.qpid.AMQException;
+import org.apache.qpid.framing.AMQMethodBodyImpl;
 import org.apache.qpid.framing.AMQMethodBody;
 
 /**
@@ -32,7 +33,6 @@
     /**
      * Invoked when a method frame has been received
      * @param evt the event that contains the method and channel
-     * @param protocolSession the protocol session associated with the event
      * @return true if the handler has processed the method frame, false otherwise. Note
      * that this does not prohibit the method event being delivered to subsequent listeners
      * but can be used to determine if nobody has dealt with an incoming method frame.
@@ -40,7 +40,7 @@
      * to all registered listeners using the error() method (see below) allowing them to
      * perform cleanup if necessary.
      */
-    <B extends AMQMethodBody> boolean methodReceived(AMQMethodEvent<B> evt) throws Exception;
+    <B extends AMQMethodBody> boolean methodReceived(AMQMethodEvent<B> evt) throws AMQException;
 
     /**
      * Callback when an error has occurred. Allows listeners to clean up.

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/AMQVersionAwareProtocolSession.java Thu Mar 22 06:14:42 2007
@@ -20,9 +20,9 @@
  */
 package org.apache.qpid.protocol;
 
-import org.apache.qpid.framing.VersionSpecificRegistry;
+import org.apache.qpid.framing.MethodRegistry;
 
 public interface AMQVersionAwareProtocolSession extends AMQProtocolWriter, ProtocolVersionAware
 {
-    public VersionSpecificRegistry getRegistry();
+    public MethodRegistry getRegistry();
 }

Modified: incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java
URL: http://svn.apache.org/viewvc/incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java?view=diff&rev=521253&r1=511387&r2=521253
==============================================================================
--- incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java (original)
+++ incubator/qpid/branches/java.multi_version/java/common/src/main/java/org/apache/qpid/protocol/ProtocolVersionAware.java Thu Mar 22 06:14:42 2007
@@ -20,9 +20,10 @@
  */
 package org.apache.qpid.protocol;
 
+import org.apache.qpid.framing.ProtocolVersion;
+
 public interface ProtocolVersionAware
 {
-    public byte getProtocolMinorVersion();
+    public ProtocolVersion getProtocolVersion();
 
-    public byte getProtocolMajorVersion();
 }