[Jboss-cvs] JBossAS SVN: r56464 - in branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq: . il/uil2 server
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Aug 30 19:11:53 EDT 2006
Author: ryan.campbell at jboss.com
Date: 2006-08-30 19:11:51 -0400 (Wed, 30 Aug 2006)
New Revision: 56464
Modified:
branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/Connection.java
branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/SocketManager.java
branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/UILClientILService.java
branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/UILServerIL.java
branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/Receivers.java
branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImpl.java
branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImplArrayList.java
branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImplLinkedList.java
Log:
Merged JBAS-2479: Support patch for JBAS-2476, JBAS-2472 and JBAS-2490
Modified: branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/Connection.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/Connection.java 2006-08-30 19:58:17 UTC (rev 56463)
+++ branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/Connection.java 2006-08-30 23:11:51 UTC (rev 56464)
@@ -1361,7 +1361,7 @@
{
try
{
- synchronized (el)
+ synchronized (elLock)
{
el.onException(excep);
}
Modified: branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/SocketManager.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/SocketManager.java 2006-08-30 19:58:17 UTC (rev 56463)
+++ branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/SocketManager.java 2006-08-30 23:11:51 UTC (rev 56464)
@@ -211,18 +211,28 @@
throw msg.error;
}
}
- /** Send a one-way message. Typically this is a reply message, but it
- * could be an asynchronous msg that does not need a reply as it true
- * for ping msgs.
+
+ /** Send a reply message.
*
- * @param msg
- * @throws Exception
+ * @param msg the message
+ * @throws Exception for any error
*/
public void sendReply(BaseMsg msg) throws Exception
{
msg.trimReply();
internalSendMessage(msg, false);
}
+
+ /** Send a one-way message.
+ *
+ * @param msg the message
+ * @throws Exception for any error
+ */
+ public void sendOneWay(BaseMsg msg) throws Exception
+ {
+ msg.getMsgID();
+ internalSendMessage(msg, false);
+ }
/** This places the msg into the sendQueue and returns if waitOnReply
* is false, or enques the msg to the sendQueue, places the msg
Modified: branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/UILClientILService.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/UILClientILService.java 2006-08-30 19:58:17 UTC (rev 56463)
+++ branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/UILClientILService.java 2006-08-30 23:11:51 UTC (rev 56464)
@@ -94,6 +94,9 @@
log.trace("Begin handleMsg, msgType: " + msgType);
switch( msgType )
{
+ case m_acknowledge:
+ // ignore replies to one-way nacks
+ break;
case m_receiveRequest:
ReceiveRequestMsg rmsg = (ReceiveRequestMsg) msg;
ReceiveRequest[] messages = rmsg.getMessages();
Modified: branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/UILServerIL.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/UILServerIL.java 2006-08-30 19:58:17 UTC (rev 56463)
+++ branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/il/uil2/UILServerIL.java 2006-08-30 23:11:51 UTC (rev 56464)
@@ -258,7 +258,10 @@
throws JMSException, Exception
{
AcknowledgementRequestMsg msg = new AcknowledgementRequestMsg(item);
- getSocketMgr().sendMessage(msg);
+ if (item.isAck)
+ getSocketMgr().sendMessage(msg);
+ else
+ getSocketMgr().sendOneWay(msg);
}
/**
Modified: branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/Receivers.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/Receivers.java 2006-08-30 19:58:17 UTC (rev 56463)
+++ branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/Receivers.java 2006-08-30 23:11:51 UTC (rev 56464)
@@ -1,9 +1,24 @@
/*
- * JBossMQ, the OpenSource JMS implementation
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* 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.mq.server;
import java.util.ArrayList;
@@ -13,19 +28,22 @@
/**
* Interface to be implemented by a receivers implementation.
- * The implementation should also have a default constructor.
+ * The implementation should also have a default constructor.<p>
+ *
* NOTE: There is no need to internally synchronize the caller
- * handles that.
+ * handles that.<p>
+ *
+ * NOTE: This datastructure should have Set semantics.
+ * i.e. attempts to add a subscriber that is already
+ * present should be ignored. Or more explicitly
+ * a subscriber should present zero or once.
*
* @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
* @version $Revision$
*/
public interface Receivers
{
- // Constants -----------------------------------------------------
- // Public --------------------------------------------------------
-
/**
* @return Get the number of receivers
*/
@@ -39,7 +57,7 @@
/**
- * Add a receiver
+ * Add a receiver, ignored if the receiver is already present.
*
* @param sub the receiver to add
*/
@@ -58,6 +76,4 @@
* @return the iterator
*/
Iterator iterator();
-
- // Inner classes -------------------------------------------------
}
Modified: branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImpl.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImpl.java 2006-08-30 19:58:17 UTC (rev 56463)
+++ branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImpl.java 2006-08-30 23:11:51 UTC (rev 56464)
@@ -1,9 +1,24 @@
/*
- * JBossMQ, the OpenSource JMS implementation
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* 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.mq.server;
import java.util.ArrayList;
Modified: branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImplArrayList.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImplArrayList.java 2006-08-30 19:58:17 UTC (rev 56463)
+++ branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImplArrayList.java 2006-08-30 23:11:51 UTC (rev 56464)
@@ -1,9 +1,24 @@
/*
- * JBossMQ, the OpenSource JMS implementation
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* 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.mq.server;
import java.util.ArrayList;
@@ -12,30 +27,19 @@
import org.jboss.mq.Subscription;
/**
- * The default implementation of the Receivers interface.
+ * The ArrayList implementation of the Receivers interface.
*
* @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
* @version $Revision$
*/
public class ReceiversImplArrayList implements Receivers
{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
/** The receivers */
ArrayList receivers = new ArrayList();
-
- // Static --------------------------------------------------------
-
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Receivers implementation --------------------------------------
-
public void add(Subscription sub)
{
+ if (receivers.contains(sub))
+ return;
receivers.add(sub);
}
@@ -58,12 +62,4 @@
{
return receivers.size();
}
-
- // Protected -----------------------------------------------------
-
- // Package Private -----------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
}
Modified: branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImplLinkedList.java
===================================================================
--- branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImplLinkedList.java 2006-08-30 19:58:17 UTC (rev 56463)
+++ branches/JBoss_4_0_3_SP1_CP/messaging/src/main/org/jboss/mq/server/ReceiversImplLinkedList.java 2006-08-30 23:11:51 UTC (rev 56464)
@@ -1,9 +1,24 @@
/*
- * JBossMQ, the OpenSource JMS implementation
- *
- * Distributable under LGPL license.
- * See terms of license at gnu.org.
- */
+* JBoss, Home of Professional Open Source
+* Copyright 2005, JBoss Inc., and individual contributors as indicated
+* 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.mq.server;
import java.util.ArrayList;
@@ -13,30 +28,20 @@
import org.jboss.mq.Subscription;
/**
- * The default implementation of the Receivers interface.
+ * The LinkedList implementation of the Receivers interface.
*
* @author <a href="mailto:adrian at jboss.com">Adrian Brock</a>
* @version $Revision$
*/
public class ReceiversImplLinkedList implements Receivers
{
- // Constants -----------------------------------------------------
-
- // Attributes ----------------------------------------------------
-
/** The receivers */
LinkedList receivers = new LinkedList();
-
- // Static --------------------------------------------------------
- // Constructors --------------------------------------------------
-
- // Public --------------------------------------------------------
-
- // Receivers implementation --------------------------------------
-
public void add(Subscription sub)
{
+ if (receivers.contains(sub))
+ return;
receivers.add(sub);
}
@@ -59,12 +64,4 @@
{
return receivers.size();
}
-
- // Protected -----------------------------------------------------
-
- // Package Private -----------------------------------------------
-
- // Private -------------------------------------------------------
-
- // Inner classes -------------------------------------------------
}
More information about the jboss-cvs-commits
mailing list