[jboss-cvs] JBoss Messaging SVN: r8141 - in branches/Branch_1_4: src/main/org/jboss/jms/client/container and 7 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Dec 1 01:17:40 EST 2010
Author: gaohoward
Date: 2010-12-01 01:17:39 -0500 (Wed, 01 Dec 2010)
New Revision: 8141
Added:
branches/Branch_1_4/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest2.java
Modified:
branches/Branch_1_4/src/main/org/jboss/jms/client/JBossConnection.java
branches/Branch_1_4/src/main/org/jboss/jms/client/container/StateCreationAspect.java
branches/Branch_1_4/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java
branches/Branch_1_4/src/main/org/jboss/jms/delegate/ConnectionEndpoint.java
branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/advised/ConnectionAdvised.java
branches/Branch_1_4/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest.java
branches/Branch_1_4/src/main/org/jboss/jms/wireformat/PacketSupport.java
branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/ConnectionConsumerTest.java
branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/WireFormatTest.java
branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/connectionmanager/SimpleConnectionManagerTest.java
Log:
JBMESSAGING-1831
fix backward compatibility issue
Modified: branches/Branch_1_4/src/main/org/jboss/jms/client/JBossConnection.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/client/JBossConnection.java 2010-11-29 22:32:17 UTC (rev 8140)
+++ branches/Branch_1_4/src/main/org/jboss/jms/client/JBossConnection.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -267,7 +267,7 @@
}
SessionDelegate sessionDelegate =
- delegate.createSessionDelegate(transacted, acknowledgeMode, isXA, false);
+ delegate.createSessionDelegate(transacted, acknowledgeMode, isXA);
return new JBossSession(sessionDelegate, type);
}
Modified: branches/Branch_1_4/src/main/org/jboss/jms/client/container/StateCreationAspect.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/client/container/StateCreationAspect.java 2010-11-29 22:32:17 UTC (rev 8140)
+++ branches/Branch_1_4/src/main/org/jboss/jms/client/container/StateCreationAspect.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -121,8 +121,13 @@
boolean transacted = ((Boolean)mi.getArguments()[0]).booleanValue();
int ackMode = ((Integer)mi.getArguments()[1]).intValue();
boolean xa = ((Boolean)mi.getArguments()[2]).booleanValue();
- boolean isCC = ((Boolean)mi.getArguments()[3]).booleanValue();
+ boolean isCC = false;
+ if (mi.getArguments().length >= 4)
+ {
+ isCC = ((Boolean)mi.getArguments()[3]).booleanValue();
+ }
+
SessionState sessionState =
new SessionState(connectionState, sessionDelegate, transacted,
ackMode, xa, sessionDelegate.getDupsOKBatchSize(),
Modified: branches/Branch_1_4/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java 2010-11-29 22:32:17 UTC (rev 8140)
+++ branches/Branch_1_4/src/main/org/jboss/jms/client/delegate/ClientConnectionDelegate.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -44,6 +44,7 @@
import org.jboss.jms.wireformat.CloseRequest;
import org.jboss.jms.wireformat.ClosingRequest;
import org.jboss.jms.wireformat.ConnectionCreateSessionDelegateRequest;
+import org.jboss.jms.wireformat.ConnectionCreateSessionDelegateRequest2;
import org.jboss.jms.wireformat.ConnectionGetClientIDRequest;
import org.jboss.jms.wireformat.ConnectionGetIDBlockRequest;
import org.jboss.jms.wireformat.ConnectionGetPreparedTransactionsRequest;
@@ -179,12 +180,21 @@
throw new IllegalStateException("This invocation should not be handled here!");
}
+ public SessionDelegate createSessionDelegate(boolean transacted, int acknowledgmentMode, boolean isXA) throws JMSException
+ {
+ RequestSupport req =
+ new ConnectionCreateSessionDelegateRequest(id, version, transacted,
+ acknowledgmentMode, isXA);
+
+ return (SessionDelegate)doInvoke(client, req);
+ }
+
public SessionDelegate createSessionDelegate(boolean transacted,
int acknowledgmentMode,
boolean isXA, boolean isCC) throws JMSException
{
RequestSupport req =
- new ConnectionCreateSessionDelegateRequest(id, version, transacted,
+ new ConnectionCreateSessionDelegateRequest2(id, version, transacted,
acknowledgmentMode, isXA, isCC);
return (SessionDelegate)doInvoke(client, req);
Modified: branches/Branch_1_4/src/main/org/jboss/jms/delegate/ConnectionEndpoint.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/delegate/ConnectionEndpoint.java 2010-11-29 22:32:17 UTC (rev 8140)
+++ branches/Branch_1_4/src/main/org/jboss/jms/delegate/ConnectionEndpoint.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -41,6 +41,10 @@
{
SessionDelegate createSessionDelegate(boolean transacted,
int acknowledgmentMode,
+ boolean isXA) throws JMSException;
+
+ SessionDelegate createSessionDelegate(boolean transacted,
+ int acknowledgmentMode,
boolean isXA, boolean isCC) throws JMSException;
String getClientID() throws JMSException;
Modified: branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java 2010-11-29 22:32:17 UTC (rev 8140)
+++ branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/ServerConnectionEndpoint.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -224,6 +224,11 @@
// ConnectionDelegate implementation ------------------------------------------------------------
+ public SessionDelegate createSessionDelegate(boolean transacted, int acknowledgmentMode, boolean isXA) throws JMSException
+ {
+ return createSessionDelegate(transacted, acknowledgmentMode, isXA, false);
+ }
+
public SessionDelegate createSessionDelegate(boolean transacted,
int acknowledgmentMode,
boolean isXA, boolean isCC)
Modified: branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/advised/ConnectionAdvised.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/advised/ConnectionAdvised.java 2010-11-29 22:32:17 UTC (rev 8140)
+++ branches/Branch_1_4/src/main/org/jboss/jms/server/endpoint/advised/ConnectionAdvised.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -68,6 +68,11 @@
return endpoint.closing(sequence);
}
+ public SessionDelegate createSessionDelegate(boolean transacted, int acknowledgmentMode, boolean isXA) throws JMSException
+ {
+ return endpoint.createSessionDelegate(transacted, acknowledgmentMode, isXA);
+ }
+
public SessionDelegate createSessionDelegate(boolean transacted,
int acknowledgmentMode,
boolean isXA, boolean isCC) throws JMSException
Modified: branches/Branch_1_4/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest.java 2010-11-29 22:32:17 UTC (rev 8140)
+++ branches/Branch_1_4/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -45,8 +45,6 @@
private boolean xa;
- private boolean isCC;
-
public ConnectionCreateSessionDelegateRequest()
{
}
@@ -54,7 +52,7 @@
public ConnectionCreateSessionDelegateRequest(String objectId,
byte version,
boolean transacted, int ackMode,
- boolean xa, boolean isCC)
+ boolean xa)
{
super(objectId, PacketSupport.REQ_CONNECTION_CREATESESSIONDELEGATE, version);
@@ -63,8 +61,6 @@
this.acknowledgmentMode = ackMode;
this.xa = xa;
-
- this.isCC = isCC;
}
public void read(DataInputStream is) throws Exception
@@ -76,8 +72,6 @@
acknowledgmentMode = is.readInt();
xa = is.readBoolean();
-
- isCC = is.readBoolean();
}
public ResponseSupport serverInvoke() throws Exception
@@ -90,7 +84,7 @@
throw new IllegalStateException("Cannot find object in dispatcher with id " + objectId);
}
- return new ConnectionCreateSessionDelegateResponse((ClientSessionDelegate)endpoint.createSessionDelegate(transacted, acknowledgmentMode, xa, isCC));
+ return new ConnectionCreateSessionDelegateResponse((ClientSessionDelegate)endpoint.createSessionDelegate(transacted, acknowledgmentMode, xa));
}
public void write(DataOutputStream os) throws Exception
@@ -105,8 +99,6 @@
os.writeBoolean(xa);
- os.writeBoolean(isCC);
-
os.flush();
}
Added: branches/Branch_1_4/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest2.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest2.java (rev 0)
+++ branches/Branch_1_4/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest2.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -0,0 +1,115 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2010, Red Hat Middleware LLC, and individual contributors
+ * by the @authors tag. See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+
+
+package org.jboss.jms.wireformat;
+
+import java.io.DataInputStream;
+import java.io.DataOutputStream;
+
+import org.jboss.jms.client.delegate.ClientSessionDelegate;
+import org.jboss.jms.delegate.ConnectionEndpoint;
+
+/**
+ * A ConnectionCreateSessionDelegateRequest2
+ *
+ * @author howard
+ *
+ * Created Dec 1, 2010 12:41:35 PM
+ *
+ *
+ */
+public class ConnectionCreateSessionDelegateRequest2 extends RequestSupport
+{
+ private boolean transacted;
+
+ private int acknowledgmentMode;
+
+ private boolean xa;
+
+ private boolean isCC;
+
+ public ConnectionCreateSessionDelegateRequest2()
+ {
+ }
+
+ public ConnectionCreateSessionDelegateRequest2(String objectId,
+ byte version,
+ boolean transacted, int ackMode,
+ boolean xa, boolean isCC)
+ {
+ super(objectId, PacketSupport.REQ_CONNECTION_CREATESESSIONDELEGATE2, version);
+
+ this.transacted = transacted;
+
+ this.acknowledgmentMode = ackMode;
+
+ this.xa = xa;
+
+ this.isCC = isCC;
+ }
+
+ public void read(DataInputStream is) throws Exception
+ {
+ super.read(is);
+
+ transacted = is.readBoolean();
+
+ acknowledgmentMode = is.readInt();
+
+ xa = is.readBoolean();
+
+ isCC = is.readBoolean();
+ }
+
+ public ResponseSupport serverInvoke() throws Exception
+ {
+ ConnectionEndpoint endpoint =
+ (ConnectionEndpoint)Dispatcher.instance.getTarget(objectId);
+
+ if (endpoint == null)
+ {
+ throw new IllegalStateException("Cannot find object in dispatcher with id " + objectId);
+ }
+
+ return new ConnectionCreateSessionDelegateResponse((ClientSessionDelegate)endpoint.createSessionDelegate(transacted, acknowledgmentMode, xa, isCC));
+ }
+
+ public void write(DataOutputStream os) throws Exception
+ {
+ super.write(os);
+
+ //Write the args
+
+ os.writeBoolean(transacted);
+
+ os.writeInt(acknowledgmentMode);
+
+ os.writeBoolean(xa);
+
+ os.writeBoolean(isCC);
+
+ os.flush();
+ }
+
+}
+
Modified: branches/Branch_1_4/src/main/org/jboss/jms/wireformat/PacketSupport.java
===================================================================
--- branches/Branch_1_4/src/main/org/jboss/jms/wireformat/PacketSupport.java 2010-11-29 22:32:17 UTC (rev 8140)
+++ branches/Branch_1_4/src/main/org/jboss/jms/wireformat/PacketSupport.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -91,6 +91,7 @@
public static final int REQ_CONNECTION_STOP = 205;
public static final int REQ_CONNECTION_SENDTRANSACTION = 206;
public static final int REQ_CONNECTION_GETPREPAREDTRANSACTIONS = 207;
+ public static final int REQ_CONNECTION_CREATESESSIONDELEGATE2 = 208;
// Session
// -------
@@ -226,6 +227,9 @@
case REQ_CONNECTION_CREATESESSIONDELEGATE:
packet = new ConnectionCreateSessionDelegateRequest();
break;
+ case REQ_CONNECTION_CREATESESSIONDELEGATE2:
+ packet = new ConnectionCreateSessionDelegateRequest2();
+ break;
case REQ_CONNECTION_GETCLIENTID:
packet = new ConnectionGetClientIDRequest();
break;
Modified: branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/ConnectionConsumerTest.java
===================================================================
--- branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/ConnectionConsumerTest.java 2010-11-29 22:32:17 UTC (rev 8140)
+++ branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/ConnectionConsumerTest.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -176,7 +176,7 @@
}
}
-
+ //https://jira.jboss.org/browse/JBMESSAGING-1831
public void testWaitForDeliveryFinish() throws Exception
{
if (ServerManagement.isRemote()) return;
Modified: branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/WireFormatTest.java
===================================================================
--- branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/WireFormatTest.java 2010-11-29 22:32:17 UTC (rev 8140)
+++ branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/WireFormatTest.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -57,6 +57,7 @@
import org.jboss.jms.wireformat.ClosingRequest;
import org.jboss.jms.wireformat.ClosingResponse;
import org.jboss.jms.wireformat.ConnectionCreateSessionDelegateRequest;
+import org.jboss.jms.wireformat.ConnectionCreateSessionDelegateRequest2;
import org.jboss.jms.wireformat.ConnectionCreateSessionDelegateResponse;
import org.jboss.jms.wireformat.ConnectionFactoryAddCallbackRequest;
import org.jboss.jms.wireformat.ConnectionFactoryCreateConnectionDelegateRequest;
@@ -166,6 +167,11 @@
wf.testConnectionCreateSessionDelegateRequest();
}
+ public void testConnectionCreateSessionDelegateRequest2() throws Exception
+ {
+ wf.testConnectionCreateSessionDelegateRequest2();
+ }
+
public void testConnectionGetClientIDRequest() throws Exception
{
wf.testConnectionGetClientIDRequest();
@@ -503,11 +509,19 @@
public void testConnectionCreateSessionDelegateRequest() throws Exception
{
RequestSupport req =
- new ConnectionCreateSessionDelegateRequest("23", (byte)77, true, 23, true, false);
+ new ConnectionCreateSessionDelegateRequest("23", (byte)77, true, 23, true);
testPacket(req, PacketSupport.REQ_CONNECTION_CREATESESSIONDELEGATE);
}
+ public void testConnectionCreateSessionDelegateRequest2() throws Exception
+ {
+ RequestSupport req =
+ new ConnectionCreateSessionDelegateRequest2("23", (byte)77, true, 23, true, false);
+
+ testPacket(req, PacketSupport.REQ_CONNECTION_CREATESESSIONDELEGATE);
+ }
+
public void testConnectionGetClientIDRequest() throws Exception
{
RequestSupport req =
Modified: branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/connectionmanager/SimpleConnectionManagerTest.java
===================================================================
--- branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/connectionmanager/SimpleConnectionManagerTest.java 2010-11-29 22:32:17 UTC (rev 8140)
+++ branches/Branch_1_4/tests/src/org/jboss/test/messaging/jms/server/connectionmanager/SimpleConnectionManagerTest.java 2010-12-01 06:17:39 UTC (rev 8141)
@@ -334,6 +334,11 @@
return null;
}
+ public SessionDelegate createSessionDelegate(boolean transacted, int acknowledgmentMode, boolean isXA) throws JMSException
+ {
+ return null;
+ }
+
public String getClientID() throws JMSException
{
return null;
@@ -376,6 +381,7 @@
{
return null;
}
+
}
}
More information about the jboss-cvs-commits
mailing list