[jboss-cvs] JBoss Messaging SVN: r8315 - branches/JBossMessaging_1_4_6_GA_JBPAPP-6386/src/main/org/jboss/jms/wireformat.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri May 27 11:18:16 EDT 2011


Author: bershath27
Date: 2011-05-27 11:18:16 -0400 (Fri, 27 May 2011)
New Revision: 8315

Added:
   branches/JBossMessaging_1_4_6_GA_JBPAPP-6386/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest2.java
Log:

JBPAPP-6386


Added: branches/JBossMessaging_1_4_6_GA_JBPAPP-6386/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest2.java
===================================================================
--- branches/JBossMessaging_1_4_6_GA_JBPAPP-6386/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest2.java	                        (rev 0)
+++ branches/JBossMessaging_1_4_6_GA_JBPAPP-6386/src/main/org/jboss/jms/wireformat/ConnectionCreateSessionDelegateRequest2.java	2011-05-27 15:18:16 UTC (rev 8315)
@@ -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();
+   }
+
+}
+



More information about the jboss-cvs-commits mailing list