[jboss-cvs] JBoss Messaging SVN: r2590 - in trunk: src/main/org/jboss/jms/server/connectionmanager and 3 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Thu Apr 19 11:19:00 EDT 2007
Author: timfox
Date: 2007-04-19 11:19:00 -0400 (Thu, 19 Apr 2007)
New Revision: 2590
Removed:
trunk/tests/src/org/jboss/test/messaging/jms/crash/CallbackFailureTest.java
Modified:
trunk/build-thirdparty.xml
trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java
trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
trunk/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java
Log:
Updated remoting dependency and http://jira.jboss.org/jira/browse/JBMESSAGING-929
Modified: trunk/build-thirdparty.xml
===================================================================
--- trunk/build-thirdparty.xml 2007-04-19 11:14:03 UTC (rev 2589)
+++ trunk/build-thirdparty.xml 2007-04-19 15:19:00 UTC (rev 2590)
@@ -92,7 +92,7 @@
<componentref name="jboss/common-logging-spi" version="2.0.2.GA"/>
<componentref name="jboss/aop" version="1.5.5.GA"/>
<componentref name="jboss/serialization" version="1.0.3.GA"/>
- <componentref name="jboss/remoting" version="2.2.0.GA"/>
+ <componentref name="jboss/remoting" version="2.2.0.SP1"/>
<componentref name="jboss/jbossts14" version="4.2.3.GA"/>
<componentref name="jboss/test14" version="1.0.0.GA"/>
<componentref name="jboss/jbossretro-rt" version="1.0.4.GA"/>
Modified: trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java 2007-04-19 11:14:03 UTC (rev 2589)
+++ trunk/src/main/org/jboss/jms/server/connectionmanager/SimpleConnectionManager.java 2007-04-19 15:19:00 UTC (rev 2590)
@@ -131,6 +131,16 @@
return null;
}
+
+
+ public synchronized List getActiveConnections()
+ {
+ // I will make a copy to avoid ConcurrentModification
+ ArrayList list = new ArrayList();
+ list.addAll(activeConnectionEndpoints);
+ return list;
+ }
+
public synchronized void handleClientFailure(String remotingSessionID, boolean clientToServer)
{
String jmsClientID = (String)remotingSessions.get(remotingSessionID);
@@ -190,14 +200,6 @@
}
}
- public synchronized List getActiveConnections()
- {
- // I will make a copy to avoid ConcurrentModification
- ArrayList list = new ArrayList();
- list.addAll(activeConnectionEndpoints);
- return list;
- }
-
// ConnectionListener implementation ------------------------------------------------------------
/**
@@ -267,7 +269,9 @@
// Protected ------------------------------------------------------------------------------------
// Private --------------------------------------------------------------------------------------
+
+
// Inner classes --------------------------------------------------------------------------------
}
Modified: trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2007-04-19 11:14:03 UTC (rev 2589)
+++ trunk/src/main/org/jboss/jms/server/endpoint/ServerConsumerEndpoint.java 2007-04-19 15:19:00 UTC (rev 2590)
@@ -28,7 +28,6 @@
import org.jboss.jms.destination.JBossDestination;
import org.jboss.jms.message.JBossMessage;
import org.jboss.jms.selector.Selector;
-import org.jboss.jms.server.ConnectionManager;
import org.jboss.jms.server.destination.TopicService;
import org.jboss.jms.server.messagecounter.MessageCounter;
import org.jboss.jms.util.ExceptionUtil;
@@ -305,26 +304,9 @@
// I need to do my own cleanup at ConnectionManager level.
log.debug(this + " failed to handle callback", e);
+
+ //We stop the consumer - some time later the lease will expire and the connection will be closed
- /*
-
- TODO: http://jira.jboss.org/jira/browse/JBMESSAGING-928
- We need to fix the lock condition caused by handleClientFailure (the promotion of the readLock to writeLock,
- cause a infinite wait on read locks that will need synchronized methods...
- We will relay on Lease until we can fix this.
-
- due to a time constraint to fix a production issue on an user, I have removed this condition until we can
- perform this condition without a risk while we will create a testcase for this condition.
-
-
-
- ServerConnectionEndpoint sce = sessionEndpoint.getConnectionEndpoint();
- ConnectionManager cm = sce.getServerPeer().getConnectionManager();
-
- cm.handleClientFailure(sce.getRemotingClientSessionID(), false); */
-
- // we're practically cut, from connection down
-
return null;
}
Modified: trunk/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java
===================================================================
--- trunk/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java 2007-04-19 11:14:03 UTC (rev 2589)
+++ trunk/src/main/org/jboss/jms/server/remoting/JMSServerInvocationHandler.java 2007-04-19 15:19:00 UTC (rev 2590)
@@ -106,7 +106,7 @@
{
if (closed)
{
- throw new MessagingJMSException("Cannot handle invocation since server is not active (it is either starting up or shutting down)");
+ throw new MessagingJMSException("Cannot handle invocation since messaging server is not active (it is either starting up or shutting down)");
}
RequestSupport request = (RequestSupport)invocation.getParameter();
@@ -210,10 +210,5 @@
// Private --------------------------------------------------------------------------------------
- private synchronized void doSetClosed(boolean closed)
- {
- this.closed = true;
- }
-
// Inner classes --------------------------------------------------------------------------------
}
Deleted: trunk/tests/src/org/jboss/test/messaging/jms/crash/CallbackFailureTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/crash/CallbackFailureTest.java 2007-04-19 11:14:03 UTC (rev 2589)
+++ trunk/tests/src/org/jboss/test/messaging/jms/crash/CallbackFailureTest.java 2007-04-19 15:19:00 UTC (rev 2590)
@@ -1,164 +0,0 @@
-/*
- * 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.test.messaging.jms.crash;
-
-import javax.jms.*;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-import org.jboss.jms.server.ConnectionManager;
-import org.jboss.test.messaging.MessagingTestCase;
-import org.jboss.test.messaging.tools.ServerManagement;
-import org.jboss.test.messaging.tools.jmx.ServiceContainer;
-import org.jboss.test.messaging.tools.jmx.rmi.LocalTestServer;
-import org.jboss.test.messaging.tools.jmx.rmi.Server;
-import org.jboss.test.messaging.tools.jndi.InVMInitialContextFactory;
-
-/**
- * @author <a href="tim.fox at jboss.com">Tim Fox</a>
- * @version <tt>$Revision$</tt>
- *
- * $Id$
- */
-public class CallbackFailureTest extends MessagingTestCase
-{
- // Constants ------------------------------------------------------------------------------------
-
- // Static ---------------------------------------------------------------------------------------
-
- // Attributes -----------------------------------------------------------------------------------
-
- protected Server localServer;
- protected Server remoteServer;
-
- // Constructors ---------------------------------------------------------------------------------
-
- public CallbackFailureTest(String name)
- {
- super(name);
- }
-
- // Public ---------------------------------------------------------------------------------------
-
- public void setUp() throws Exception
- {
- super.setUp();
-
- // Start the local server
- localServer = new LocalTestServer();
-
- // Start all the services locally
- localServer.start("all", true);
-
- localServer.deployQueue("Queue", null, false);
-
- // Connect to the remote server, but don't start a servicecontainer on it. We are only using
- // the remote server to open a client connection to the local server.
- ServerManagement.create();
-
- remoteServer = ServerManagement.getServer();
- }
-
- public void tearDown() throws Exception
- {
- localServer.stop();
- }
-
- /*
- * Test that when a client callback fails, server side resources for connections are cleaned-up.
- */
- public void testCallbackFailure() throws Exception
- {
- if (!ServerManagement.isRemote())
- {
- fail("this test should be run in a remote configuration");
- }
-
- // we need to disable exception listener otherwise it will clear up the connection itself
-
- ObjectName remoteConnectorName = ServiceContainer.REMOTING_OBJECT_NAME;
-
- ConnectionManager cm = localServer.getServerPeer().getConnectionManager();
-
- localServer.getServerPeer().getServer().
- invoke(remoteConnectorName,
- "removeConnectionListener",
- new Object[] {cm},
- new String[] {"org.jboss.remoting.ConnectionListener"});
-
- InitialContext ic = new InitialContext(InVMInitialContextFactory.getJNDIEnvironment());
-
- ConnectionFactory cf = (ConnectionFactory)ic.lookup("/ConnectionFactory");
-
- Queue queue = (Queue)ic.lookup("/queue/Queue");
-
- CreateHangingConsumerCommand command = new CreateHangingConsumerCommand(cf, queue);
-
- String remotingSessionId = (String)remoteServer.executeCommand(command);
-
- remoteServer.kill();
-
- // we have removed the exception listener so the server side resouces shouldn't be cleared up
-
- log.info("sleeping for 1 min ...");
- Thread.sleep(60000);
-
- assertTrue(cm.containsRemotingSession(remotingSessionId));
-
- // Now we send a message which should prompt delivery to the dead consumer causing
- // an exception which should cause connection cleanup
-
- Connection conn = cf.createConnection();
-
- Session sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
-
- MessageProducer prod = sess.createProducer(queue);
-
- // sending just one message should be enough to trigger the failure and client smacking
- prod.send(sess.createMessage());
-
- log.info("sleeping for 45 secs ...");
- Thread.sleep(45000);
-
- assertFalse(cm.containsRemotingSession(remotingSessionId));
-
- // make sure the message is still in queue
-
- conn = cf.createConnection();
- conn.start();
- sess = conn.createSession(false, Session.AUTO_ACKNOWLEDGE);
- MessageConsumer cons = sess.createConsumer(queue);
- Message m = cons.receive(1000);
- assertNotNull(m);
-
- cons.close();
-
- }
-
- // Package protected ----------------------------------------------------------------------------
-
- // Protected ------------------------------------------------------------------------------------
-
- // Private --------------------------------------------------------------------------------------
-
- // Inner classes --------------------------------------------------------------------------------
-
-}
More information about the jboss-cvs-commits
mailing list