[jboss-cvs] JBoss Messaging SVN: r2245 - trunk/src/main/org/jboss/jms/wireformat.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Fri Feb 9 14:24:25 EST 2007
Author: clebert.suconic at jboss.com
Date: 2007-02-09 14:24:25 -0500 (Fri, 09 Feb 2007)
New Revision: 2245
Modified:
trunk/src/main/org/jboss/jms/wireformat/PolledCallbacksDelivery.java
Log:
http://jira.jboss.org/jira/browse/JBMESSAGING-820 - fix
Modified: trunk/src/main/org/jboss/jms/wireformat/PolledCallbacksDelivery.java
===================================================================
--- trunk/src/main/org/jboss/jms/wireformat/PolledCallbacksDelivery.java 2007-02-09 17:36:42 UTC (rev 2244)
+++ trunk/src/main/org/jboss/jms/wireformat/PolledCallbacksDelivery.java 2007-02-09 19:24:25 UTC (rev 2245)
@@ -73,13 +73,26 @@
for (int i = 0; i < len; i++)
{
//Read the method id int - we just throw it away
- is.readInt();
+ CallbackSupport cs;
+
+ int id = is.readInt();
+
+ switch (id)
+ {
+ case PacketSupport.CLIENT_DELIVERY:
+ cs = new ClientDelivery();
+ break;
+ case PacketSupport.CONNECTIONFACTORY_UPDATE:
+ cs = new ConnectionFactoryUpdate();
+ break;
+ default:
+ // sanity check.. it shouldn't happen
+ throw new IllegalStateException(("Can't deal with methodId=" + id));
+ }
- ClientDelivery delivery = new ClientDelivery();
+ cs.read(is);
- delivery.read(is);
-
- Callback cb = new Callback(delivery);
+ Callback cb = new Callback(cs);
callbacks.add(cb);
}
@@ -98,10 +111,10 @@
while (iter.hasNext())
{
Callback cb = (Callback)iter.next();
+
+ CallbackSupport cs = (CallbackSupport) cb.getParameter();
- ClientDelivery cd = (ClientDelivery)cb.getParameter();
-
- cd.write(os);
+ cs.write(os);
}
os.flush();
More information about the jboss-cvs-commits
mailing list