[jboss-cvs] JBoss Messaging SVN: r7199 - in trunk: src/config/common/schema and 12 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 4 15:24:35 EDT 2009


Author: timfox
Date: 2009-06-04 15:24:34 -0400 (Thu, 04 Jun 2009)
New Revision: 7199

Removed:
   trunk/tests/src/org/jboss/messaging/tests/timing/core/remoting/impl/RemotingServiceImplTest.java
Modified:
   trunk/docs/user-manual/en/configuration-index.xml
   trunk/docs/user-manual/en/connection-ttl.xml
   trunk/src/config/common/schema/jbm-configuration.xsd
   trunk/src/main/org/jboss/messaging/core/asyncio/impl/TimedBuffer.java
   trunk/src/main/org/jboss/messaging/core/config/Configuration.java
   trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java
   trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java
   trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java
   trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java
   trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareMessagingServerControlWrapper.java
   trunk/tests/config/ConfigurationTest-full-config.xml
   trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReplicateConnectionFailureTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlUsingCoreTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationImplTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/QueueDeployerTest.java
Log:
fixed deadlock in timedbuffer + removed connectionscanperiod

Modified: trunk/docs/user-manual/en/configuration-index.xml
===================================================================
--- trunk/docs/user-manual/en/configuration-index.xml	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/docs/user-manual/en/configuration-index.xml	2009-06-04 19:24:34 UTC (rev 7199)
@@ -145,14 +145,6 @@
                         </row>
                         <row>
                             <entry><link linkend="dead.connections"
-                                >connection-scan-period</link></entry>
-                            <entry>Long</entry>
-                            <entry>how often (in ms) to scan for failed connections on
-                                the server </entry>
-                            <entry>1000</entry>
-                        </row>
-                        <row>
-                            <entry><link linkend="dead.connections"
                                 >connection-ttl-override</link></entry>
                             <entry>Long</entry>
                             <entry>if set, this will override how long (in ms) to keep a connection alive

Modified: trunk/docs/user-manual/en/connection-ttl.xml
===================================================================
--- trunk/docs/user-manual/en/connection-ttl.xml	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/docs/user-manual/en/connection-ttl.xml	2009-06-04 19:24:34 UTC (rev 7199)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <chapter id="connection-ttl">
-    <title>Dead Connections  and Session Multiplexing</title>
+    <title>Dead Connections and Session Multiplexing</title>
     <para>In this section we will discuss connection time-to-live (TTL) and explain how JBoss
         Messaging deals with crashed clients and clients which have exited without cleanly closing
         their resources. We'll also discuss how JBoss Messaging multiplexes several sessions on a
@@ -58,9 +58,9 @@
 }
         </programlisting>
         <para>Unfortunately users don't always write well behaved applications, and sometimes
-            clients crash so they don't have a chance to clean up their resources!</para>
+            clients just crash so they don't have a chance to clean up their resources!</para>
         <para>If this occurs then it can leave server side resources, like sessions, hanging on the
-            server.  If these were not removed they would cause a resource leak on the server and
+            server. If these were not removed they would cause a resource leak on the server and
             over time this result in the server running out of memory or other resources.</para>
         <para>We have to balance the requirement for cleaning up dead client resources with the fact
             that sometimes the network between the client and the server can fail and then come
@@ -70,28 +70,17 @@
             server.</para>
         <para>JBoss Messaging makes all of this configurable. For each <literal
                 >ClientSessionFactory</literal> we define a <emphasis>connection TTL</emphasis>.
-            Each connection also sends a periodic "ping" to the server, when the server receives the
-            "ping" it sends back "pong". Every time the server receives a ping, it marks the time it
-            received that last ping against the connection. If the server hasn't received a ping for
-            the time given by the TTL, then it will be automatically cleaned up and its server side
-            resources removed. Basically, the TTL determines how long the server will keep a
-            connection alive in the absence of a ping. Normally we configure the TTL to be much
-            larger than the connection ping period so we can allow for session reconnections at
-            significant times later.</para>
-        <para>The ping period is defined by the <literal>PingPeriod</literal> attribute on the
-                <literal>ClientSessionFactory</literal> instance.</para>
-        <para>If you're using JMS it's defined by the <literal>PingPeriod</literal> attribute on a
-                <literal>JBossConnectionFactory</literal> instance, or if you're deploying JMS
-            connection factory instances direct into JNDI on the server side, you can specify it in
-            the <literal>jbm-jms.xml </literal> configuration file, using the parameter <literal
-                >ping-period</literal>.</para>
-        <para>The default value for ping period is <literal>5000</literal>ms, i.e. 5 seconds.</para>
-        <para>The connection TTL is defined by the <literal>ConnectionTTL</literal> attribute on the
-                <literal>ClientSessionFactory</literal> instance.</para>
-        <para>If you're using JMS it's defined by the <literal>ConnectionTTL</literal> attribute on
-            a <literal>JBossConnectionFactory</literal> instance, or if you're deploying JMS
-            connection factory instances direct into JNDI on the server side, you can specify it in
-            the xml config, using the parameter <literal>connection-ttl</literal>.</para>
+            Basically, the TTL determines how long the server will keep a connection alive in the
+            absence of any data arriving from the client. If the client is idle it will
+            automatically send "ping" packets periodically to prevent the server from closing it
+            down. If the server doesn't receive any packets on a connection for the connection TTL
+            time, then it will automatically close all the sessions on the server that relate to
+            that connection.</para>
+        <para>If you're using JMS, the connection TTL is defined by the <literal
+                >ConnectionTTL</literal> attribute on a <literal>JBossConnectionFactory</literal>
+            instance, or if you're deploying JMS connection factory instances direct into JNDI on
+            the server side, you can specify it in the xml config, using the parameter <literal
+                >connection-ttl</literal>.</para>
         <para>The default value for connection ttl is <literal>300000</literal>ms, i.e. 5
             minutes.</para>
         <para>If you do not wish clients to be able to specify their own connection TTL, you can
@@ -100,24 +89,30 @@
             configuration. The default value for <literal>connection-ttl-override</literal> is
                 <literal>-1</literal> which means "do not override" (i.e. let clients use their own
             values).</para>
-        <para>There's a thread on the server that periodically checks all the connections to see if
-            they haven't been pinged for time TTL or over. The period between checking connection is
-            determined by the parameter<literal>connection-scan-period</literal> in the file
-                <literal>jbm-configuration.xml</literal>. The default value is <literal
-                >1000</literal>ms.</para>
     </section>
     <section>
         <title>Detecting failure from the client side.</title>
         <para>In the previous section we discussed how the client sends pings to the server and how
             "dead" connection resources are cleaned up by the server. There's also another reason
             for pinging, and that's for the <emphasis>client</emphasis> to be able to detect that
-            the server has failed.</para>
-        <para>Every <literal>ping period</literal> milliseconds a ping is sent to the server, if, by
-            the time the client is ready to send the next ping to the server, the previous pong
-            hasn't arrived then the client will consider the connection failed and will either
-            initiate failover, or call any <literal>FailureListener</literal> instances (or <literal
-                >ExceptionListener</literal> instances if you are using JMS) depending on how it has
-            been configured.</para>
+            the server or network has failed.</para>
+        <para>As long as the client is receiving packets from the server it will consider the
+            connection to be still alive. If the connection is idle the server will periodically
+            send packets to the client to prevent the client from thinking the connection is
+            dead.</para>
+        <para>If the client does not receive any packets for <literal
+                >client-failure-check-period</literal> milliseconds then it will consider the
+            connection failed and will either initiate failover, or call any <literal
+                >FailureListener</literal> instances (or <literal>ExceptionListener</literal>
+            instances if you are using JMS) depending on how it has been configured.</para>
+        <para>If you're using JMS it's defined by the <literal>ClientFailureCheckPeriod</literal>
+            attribute on a <literal>JBossConnectionFactory</literal> instance, or if you're
+            deploying JMS connection factory instances direct into JNDI on the server side, you can
+            specify it in the <literal>jbm-jms.xml </literal> configuration file, using the
+            parameter <literal>client-failure-check-period</literal>.</para>
+        <para>The default value for client failure check period is <literal>5000</literal>ms, i.e. 5
+            seconds. Typically this is much lower than connection TTL to allow clients to reconnect
+            in case of transitory failure.</para>
     </section>
     <section id="connection-ttl.session.multiplexing">
         <title>Session Multiplexing</title>

Modified: trunk/src/config/common/schema/jbm-configuration.xsd
===================================================================
--- trunk/src/config/common/schema/jbm-configuration.xsd	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/src/config/common/schema/jbm-configuration.xsd	2009-06-04 19:24:34 UTC (rev 7199)
@@ -57,15 +57,12 @@
 				<xsd:element name="message-counter-enabled"
 					type="xsd:boolean" maxOccurs="1" minOccurs="0">
 				</xsd:element>
-                <xsd:element name="message-counter-sample-period"
-                    type="xsd:unsignedLong" maxOccurs="1" minOccurs="0">
-                </xsd:element>
-                <xsd:element name="message-counter-max-day-history"
-                    type="xsd:positiveInteger" maxOccurs="1" minOccurs="0">
-                </xsd:element>
-				<xsd:element name="connection-scan-period"
-					type="xsd:unsignedLong" maxOccurs="1" minOccurs="0">
-				</xsd:element>
+            <xsd:element name="message-counter-sample-period"
+                 type="xsd:unsignedLong" maxOccurs="1" minOccurs="0">
+            </xsd:element>
+             xsd:element name="message-counter-max-day-history"
+                 type="xsd:positiveInteger" maxOccurs="1" minOccurs="0">
+            </xsd:element>			
 				<xsd:element name="connection-ttl-override"
 					type="xsd:long" maxOccurs="1" minOccurs="0">
 				</xsd:element>

Modified: trunk/src/main/org/jboss/messaging/core/asyncio/impl/TimedBuffer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/asyncio/impl/TimedBuffer.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/src/main/org/jboss/messaging/core/asyncio/impl/TimedBuffer.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -74,7 +74,7 @@
 
    private Thread timerThread;
    
-   private boolean started;
+   private volatile boolean started;
    
    private final boolean flushOnSync;
 
@@ -111,8 +111,8 @@
       started = true;
    }
 
-   public synchronized void stop()
-   {
+   public void stop()
+   {      
       if (!started)
       {
          return;

Modified: trunk/src/main/org/jboss/messaging/core/config/Configuration.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/Configuration.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/src/main/org/jboss/messaging/core/config/Configuration.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -100,10 +100,6 @@
 
    void setInterceptorClassNames(List<String> interceptors);
 
-   long getConnectionScanPeriod();
-
-   void setConnectionScanPeriod(long scanPeriod);
-
    long getConnectionTTLOverride();
 
    void setConnectionTTLOverride(long ttl);

Modified: trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/src/main/org/jboss/messaging/core/config/impl/ConfigurationImpl.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -65,8 +65,6 @@
 
    public static final boolean DEFAULT_JMX_MANAGEMENT_ENABLED = true;
 
-   public static final long DEFAULT_CONNECTION_SCAN_PERIOD = 1000;
-
    public static final long DEFAULT_CONNECTION_TTL_OVERRIDE = -1;
 
    public static final String DEFAULT_BINDINGS_DIRECTORY = "data/bindings";
@@ -175,8 +173,6 @@
 
    protected boolean jmxManagementEnabled = DEFAULT_JMX_MANAGEMENT_ENABLED;
 
-   protected long connectionScanPeriod = DEFAULT_CONNECTION_SCAN_PERIOD;
-
    protected long connectionTTLOverride = DEFAULT_CONNECTION_TTL_OVERRIDE;
 
    protected long messageExpiryScanPeriod = DEFAULT_MESSAGE_EXPIRY_SCAN_PERIOD;
@@ -388,16 +384,6 @@
       securityInvalidationInterval = interval;
    }
 
-   public long getConnectionScanPeriod()
-   {
-      return connectionScanPeriod;
-   }
-
-   public void setConnectionScanPeriod(final long scanPeriod)
-   {
-      connectionScanPeriod = scanPeriod;
-   }
-
    public long getConnectionTTLOverride()
    {
       return connectionTTLOverride;

Modified: trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/src/main/org/jboss/messaging/core/config/impl/FileConfiguration.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -117,8 +117,6 @@
 
       securityInvalidationInterval = getLong(e, "security-invalidation-interval", securityInvalidationInterval);
 
-      connectionScanPeriod = getLong(e, "connection-scan-period", connectionScanPeriod);
-
       connectionTTLOverride = getLong(e, "connection-ttl-override", connectionTTLOverride);
 
       transactionTimeout = getLong(e, "transaction-timeout", transactionTimeout);

Modified: trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/src/main/org/jboss/messaging/core/management/MessagingServerControlMBean.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -88,8 +88,6 @@
 
    public boolean isBackup();
 
-   public long getConnectionScanPeriod();
-   
    int getAIOBufferSize();
    
    int getAIOBufferTimeout();

Modified: trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/src/main/org/jboss/messaging/core/management/impl/MessagingServerControl.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -147,11 +147,6 @@
       return configuration.getBindingsDirectory();
    }
 
-   public long getConnectionScanPeriod()
-   {
-      return configuration.getConnectionScanPeriod();
-   }
-
    public String[] getInterceptorClassNames()
    {
       return configuration.getInterceptorClassNames().toArray(new String[configuration.getInterceptorClassNames().size()]);

Modified: trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareMessagingServerControlWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareMessagingServerControlWrapper.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/src/main/org/jboss/messaging/core/management/jmx/impl/ReplicationAwareMessagingServerControlWrapper.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -81,11 +81,6 @@
       return localControl.getConnectionCount();
    }
 
-   public long getConnectionScanPeriod()
-   {
-      return localControl.getConnectionScanPeriod();
-   }
-
    public String[] getInterceptorClassNames()
    {
       return localControl.getInterceptorClassNames();

Modified: trunk/tests/config/ConfigurationTest-full-config.xml
===================================================================
--- trunk/tests/config/ConfigurationTest-full-config.xml	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/tests/config/ConfigurationTest-full-config.xml	2009-06-04 19:24:34 UTC (rev 7199)
@@ -17,8 +17,7 @@
       <jmx-management-enabled>false</jmx-management-enabled>
       <message-counter-enabled>true</message-counter-enabled>
       <message-counter-max-day-history>5</message-counter-max-day-history>
-      <message-counter-sample-period>123456</message-counter-sample-period>
-      <connection-scan-period>6543</connection-scan-period>
+      <message-counter-sample-period>123456</message-counter-sample-period>      
       <connection-ttl-override>12345</connection-ttl-override>
       <transaction-timeout>98765</transaction-timeout>
       <transaction-timeout-scan-period>56789</transaction-timeout-scan-period>

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReplicateConnectionFailureTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReplicateConnectionFailureTest.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReplicateConnectionFailureTest.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -131,8 +131,7 @@
    {
       super.setUp();
       
-      Configuration backupConf = new ConfigurationImpl();
-      backupConf.setConnectionScanPeriod(100);
+      Configuration backupConf = new ConfigurationImpl();     
       backupConf.setSecurityEnabled(false);
       backupParams.put(TransportConstants.SERVER_ID_PROP_NAME, 1);
       backupConf.getAcceptorConfigurations()
@@ -142,8 +141,7 @@
       backupServer = Messaging.newMessagingServer(backupConf, false);
       backupServer.start();
 
-      Configuration liveConf = new ConfigurationImpl();
-      liveConf.setConnectionScanPeriod(100);
+      Configuration liveConf = new ConfigurationImpl();    
       liveConf.setSecurityEnabled(false);
       liveConf.getAcceptorConfigurations()
               .add(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory"));

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlTest.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -81,8 +81,7 @@
       assertEquals(conf.getThreadPoolMaxSize(), serverControl.getThreadPoolMaxSize());
       assertEquals(conf.getSecurityInvalidationInterval(), serverControl.getSecurityInvalidationInterval());
       assertEquals(conf.isSecurityEnabled(), serverControl.isSecurityEnabled());
-      assertEquals(conf.getInterceptorClassNames().size(), serverControl.getInterceptorClassNames().length);
-      assertEquals(conf.getConnectionScanPeriod(), serverControl.getConnectionScanPeriod());
+      assertEquals(conf.getInterceptorClassNames().size(), serverControl.getInterceptorClassNames().length);     
       assertEquals(conf.getConnectionTTLOverride(), serverControl.getConnectionTTLOverride());
       assertEquals(conf.getBackupConnectorName(), serverControl.getBackupConnectorName());
       assertEquals(conf.getManagementAddress().toString(), serverControl.getManagementAddress());

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlUsingCoreTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlUsingCoreTest.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/management/MessagingServerControlUsingCoreTest.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -146,11 +146,6 @@
             return (Integer)proxy.retrieveAttributeValue("ConnectionCount");
          }
 
-         public long getConnectionScanPeriod()
-         {
-            return (Long)proxy.retrieveAttributeValue("ConnectionScanPeriod", Long.class);
-         }
-
          public long getConnectionTTLOverride()
          {
             return (Long)proxy.retrieveAttributeValue("ConnectionTTLOverride", Long.class);

Deleted: trunk/tests/src/org/jboss/messaging/tests/timing/core/remoting/impl/RemotingServiceImplTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/timing/core/remoting/impl/RemotingServiceImplTest.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/tests/src/org/jboss/messaging/tests/timing/core/remoting/impl/RemotingServiceImplTest.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -1,133 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2005-2008, 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.messaging.tests.timing.core.remoting.impl;
-
-import org.jboss.messaging.tests.util.UnitTestCase;
-
-/**
- *
- * A RemotingServiceImplTest
- *
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class RemotingServiceImplTest extends UnitTestCase
-{
-   public void testDummy()
-   {      
-   }
-   
-//    public void testScanForFailedConnectionsNonefailed() throws Exception
-//    {
-//       ConfigurationImpl config = new ConfigurationImpl();
-//       final long interval = 100;
-//       config.setConnectionScanPeriod(interval);
-//       RemotingServiceImpl remotingService = new RemotingServiceImpl(config);
-//
-//       RemotingHandler handler = EasyMock.createStrictMock(RemotingHandler.class);
-//       remotingService.setHandler(handler);
-//
-//       Set<Object> failed = new HashSet<Object>();
-//
-//       EasyMock.expect(handler.scanForFailedConnections()).andReturn(failed);
-//
-//       EasyMock.replay(handler);
-//
-//       remotingService.start();
-//
-//       Thread.sleep(interval * 2);
-//
-//       EasyMock.verify(handler);
-//
-//    }
-//
-//    public void testScanForFailedConnectionsFailed() throws Exception
-//    {
-//       ConfigurationImpl config = new ConfigurationImpl();
-//       final long interval = 100;
-//       config.setConnectionScanPeriod(interval);
-//       RemotingServiceImpl remotingService = new RemotingServiceImpl(config);
-//
-//       RemotingHandler handler = EasyMock.createStrictMock(RemotingHandler.class);
-//       remotingService.setHandler(handler);
-//
-//       Set<Object> failed = new HashSet<Object>();
-//       failed.add(2L);
-//       failed.add(3L);
-//
-//       EasyMock.expect(handler.scanForFailedConnections()).andStubReturn(failed);
-//
-//       Connection conn1 = EasyMock.createStrictMock(Connection.class);
-//       Connection conn2 = EasyMock.createStrictMock(Connection.class);
-//       Connection conn3 = EasyMock.createStrictMock(Connection.class);
-//
-//       EasyMock.expect(conn1.getID()).andStubReturn(1l);
-//       EasyMock.expect(conn2.getID()).andStubReturn(2l);
-//       EasyMock.expect(conn3.getID()).andStubReturn(3l);
-//
-//       conn2.close();
-//       conn3.close();
-//
-//       class Listener implements FailureListener
-//       {
-//          volatile MessagingException me;
-//          public void connectionFailed(MessagingException me)
-//          {
-//             this.me = me;
-//          }
-//       }
-//
-//       EasyMock.replay(handler, conn1, conn2, conn3);
-//
-//       remotingService.start();
-//
-//       remotingService.connectionCreated(conn1);
-//       remotingService.connectionCreated(conn2);
-//       remotingService.connectionCreated(conn3);
-//
-//       RemotingConnection rc1 = remotingService.getConnection(1l);
-//       RemotingConnection rc2 = remotingService.getConnection(2l);
-//       RemotingConnection rc3 = remotingService.getConnection(3l);
-//
-//       Listener listener1 = new Listener();
-//       rc1.addFailureListener(listener1);
-//
-//       Listener listener2 = new Listener();
-//       rc2.addFailureListener(listener2);
-//
-//       Listener listener3 = new Listener();
-//       rc3.addFailureListener(listener3);
-//
-//       Thread.sleep(interval * 2);
-//
-//       EasyMock.verify(handler, conn1, conn2, conn3);
-//
-//       assertNull(listener1.me);
-//       assertNotNull(listener2.me);
-//       assertNotNull(listener3.me);
-//
-//       assertEquals(MessagingException.CONNECTION_TIMEDOUT, listener2.me.getCode());
-//       assertEquals(MessagingException.CONNECTION_TIMEDOUT, listener3.me.getCode());
-//
-//    }
-
-}

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationImplTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationImplTest.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/ConfigurationImplTest.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -56,8 +56,7 @@
       assertEquals(ConfigurationImpl.DEFAULT_QUEUE_ACTIVATION_TIMEOUT, conf.getQueueActivationTimeout());
       assertEquals(ConfigurationImpl.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE, conf.getScheduledThreadPoolMaxSize());
       assertEquals(ConfigurationImpl.DEFAULT_SECURITY_INVALIDATION_INTERVAL, conf.getSecurityInvalidationInterval());
-      assertEquals(ConfigurationImpl.DEFAULT_SECURITY_ENABLED, conf.isSecurityEnabled());
-      assertEquals(ConfigurationImpl.DEFAULT_CONNECTION_SCAN_PERIOD, conf.getConnectionScanPeriod());
+      assertEquals(ConfigurationImpl.DEFAULT_SECURITY_ENABLED, conf.isSecurityEnabled());     
       assertEquals(ConfigurationImpl.DEFAULT_BINDINGS_DIRECTORY, conf.getBindingsDirectory());
       assertEquals(ConfigurationImpl.DEFAULT_CREATE_BINDINGS_DIR, conf.isCreateBindingsDir());
       assertEquals(ConfigurationImpl.DEFAULT_JOURNAL_DIR, conf.getJournalDirectory());
@@ -105,11 +104,7 @@
          b = randomBoolean();
          conf.setSecurityEnabled(b);
          assertEquals(b, conf.isSecurityEnabled());
-    
-         l = randomLong();
-         conf.setConnectionScanPeriod(l);
-         assertEquals(l, conf.getConnectionScanPeriod());
-                  
+     
          String s = randomString();
          conf.setBindingsDirectory(s);
          assertEquals(s, conf.getBindingsDirectory());
@@ -200,9 +195,6 @@
       b = randomBoolean();
       conf.setSecurityEnabled(b);
         
-      l = randomLong();
-      conf.setConnectionScanPeriod(l);
-      
       String s = randomString();
       conf.setBindingsDirectory(s);
 

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/DefaultsFileConfigurationTest.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -59,9 +59,7 @@
       assertEquals(ConfigurationImpl.DEFAULT_JMX_MANAGEMENT_ENABLED, conf.isJMXManagementEnabled());
 
       assertEquals(0, conf.getInterceptorClassNames().size());
-
-      assertEquals(ConfigurationImpl.DEFAULT_CONNECTION_SCAN_PERIOD, conf.getConnectionScanPeriod());
-      
+  
       assertEquals(ConfigurationImpl.DEFAULT_CONNECTION_TTL_OVERRIDE, conf.getConnectionTTLOverride());
 
       assertEquals(0, conf.getAcceptorConfigurations().size());

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/config/impl/FileConfigurationTest.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -60,7 +60,6 @@
       assertEquals(true, conf.isMessageCounterEnabled());
       assertEquals(5, conf.getMessageCounterMaxDayHistory());
       assertEquals(123456, conf.getMessageCounterSamplePeriod());
-      assertEquals(6543, conf.getConnectionScanPeriod());
       assertEquals(12345, conf.getConnectionTTLOverride());
       assertEquals(98765, conf.getTransactionTimeout());
       assertEquals(56789, conf.getTransactionTimeoutScanPeriod());

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/QueueDeployerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/QueueDeployerTest.java	2009-06-04 18:04:04 UTC (rev 7198)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/deployers/impl/QueueDeployerTest.java	2009-06-04 19:24:34 UTC (rev 7199)
@@ -219,12 +219,6 @@
          return 0;
       }
 
-      public long getConnectionScanPeriod()
-      {
-
-         return 0;
-      }
-
       public long getConnectionTTLOverride()
       {
 




More information about the jboss-cvs-commits mailing list