[jboss-cvs] JBoss Messaging SVN: r7197 - in trunk: src/config and 35 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Thu Jun 4 12:45:19 EDT 2009


Author: timfox
Date: 2009-06-04 12:45:19 -0400 (Thu, 04 Jun 2009)
New Revision: 7197

Added:
   trunk/src/main/org/jboss/messaging/core/remoting/impl/Pinger.java
Removed:
   trunk/dotnet/
   trunk/tests/src/org/jboss/messaging/tests/timing/core/remoting/impl/RemotingConnectionImplTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/fakes/FakeCallback.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/management/RoleInfoTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory1.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory2.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory3.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor1.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor2.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor3.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/RemotingConnectionImplTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/RemotingServiceImplTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory1.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory2.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory3.java
   trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory4.java
   trunk/tests/src/org/jboss/messaging/tests/unit/jms/client/JMSMessageListenerWrapperTest.java
Modified:
   trunk/src/config/common/schema/jbm-jms.xsd
   trunk/src/config/ra.xml
   trunk/src/main/org/jboss/messaging/core/client/ClientSessionFactory.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java
   trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManagerImpl.java
   trunk/src/main/org/jboss/messaging/core/remoting/RemotingConnection.java
   trunk/src/main/org/jboss/messaging/core/remoting/impl/RemotingConnectionImpl.java
   trunk/src/main/org/jboss/messaging/core/remoting/impl/wireformat/Ping.java
   trunk/src/main/org/jboss/messaging/core/remoting/server/impl/RemotingServiceImpl.java
   trunk/src/main/org/jboss/messaging/core/server/cluster/impl/BridgeImpl.java
   trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
   trunk/src/main/org/jboss/messaging/jms/client/JBossConnectionFactory.java
   trunk/src/main/org/jboss/messaging/jms/server/JMSServerManager.java
   trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java
   trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerManagerImpl.java
   trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControlMBean.java
   trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java
   trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControl.java
   trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java
   trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareConnectionFactoryControlWrapper.java
   trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java
   trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java
   trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java
   trunk/tests/config/jbm-jms-for-JMSServerDeployerTest.xml
   trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/JMSTestCase.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/message/ObjectMessageTest.java
   trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java
   trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/client/CoreClientTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientCrashTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/CrashClient.java
   trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReplicateConnectionFailureTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/jms/JBossConnectionFactoryTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/JMSFailoverTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/JMSServerDeployerTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
   trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSUtil.java
   trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java
   trunk/tests/src/org/jboss/messaging/tests/stress/remote/PingStressTest.java
   trunk/tests/src/org/jboss/messaging/tests/unit/jms/misc/ManifestTest.java
Log:
pinging temp fix

Modified: trunk/src/config/common/schema/jbm-jms.xsd
===================================================================
--- trunk/src/config/common/schema/jbm-jms.xsd	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/config/common/schema/jbm-jms.xsd	2009-06-04 16:45:19 UTC (rev 7197)
@@ -39,7 +39,7 @@
 		            </xsd:sequence>
 	            </xsd:complexType>
             </xsd:element>
-   			<xsd:element name="ping-period" type="xsd:unsignedLong"
+   			<xsd:element name="client-failure-check-period" type="xsd:unsignedLong"
    				maxOccurs="1" minOccurs="0">
    			</xsd:element>
    			<xsd:element name="connection-ttl" type="xsd:unsignedLong"

Modified: trunk/src/config/ra.xml
===================================================================
--- trunk/src/config/ra.xml	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/config/ra.xml	2009-06-04 16:45:19 UTC (rev 7197)
@@ -115,8 +115,8 @@
         <config-property-value></config-property-value>
       </config-property>
       <config-property>
-        <description>The ping period</description>
-        <config-property-name>PingPeriod</config-property-name>
+        <description>The client failure check period</description>
+        <config-property-name>ClientFailureCheckPeriod</config-property-name>
         <config-property-type>java.lang.Long</config-property-type>
         <config-property-value></config-property-value>
       </config-property>

Modified: trunk/src/main/org/jboss/messaging/core/client/ClientSessionFactory.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/ClientSessionFactory.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/core/client/ClientSessionFactory.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -59,9 +59,9 @@
    
    void setStaticConnectors(List<Pair<TransportConfiguration, TransportConfiguration>> staticConnectors);
    
-   long getPingPeriod();
+   long getClientFailureCheckPeriod();
 
-   void setPingPeriod(long pingPeriod);
+   void setClientFailureCheckPeriod(long clientFailureCheckPeriod);
 
    long getConnectionTTL();
 

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ClientSessionFactoryImpl.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -58,11 +58,11 @@
 
    public static final String DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME = "org.jboss.messaging.core.client.impl.RoundRobinConnectionLoadBalancingPolicy";
 
-   public static final long DEFAULT_PING_PERIOD = 5000;
+   public static final long DEFAULT_CLIENT_FAILURE_CHECK_PERIOD = 5000;
 
    // 5 minutes - normally this should be much higher than ping period, this allows clients to re-attach on live
    // or backup without fear of session having already been closed when connection times out.
-   public static final long DEFAULT_CONNECTION_TTL = 5 * 60000;
+   public static final long DEFAULT_CONNECTION_TTL = 10000;
 
    // Any message beyond this size is considered a large message (to be sent in chunks)
    public static final int DEFAULT_MIN_LARGE_MESSAGE_SIZE = 100 * 1024;
@@ -111,7 +111,7 @@
 
    // Attributes
    // -----------------------------------------------------------------------------------
-
+  
    private final Map<Pair<TransportConfiguration, TransportConfiguration>, ConnectionManager> connectionManagerMap = new LinkedHashMap<Pair<TransportConfiguration, TransportConfiguration>, ConnectionManager>();
 
    private volatile boolean receivedBroadcast = false;
@@ -140,7 +140,7 @@
    
    private long discoveryInitialWaitTimeout;
 
-   private long pingPeriod;
+   private long clientFailureCheckPeriod;
 
    private long connectionTTL;
 
@@ -271,7 +271,7 @@
                                                              failoverOnServerShutdown,
                                                              maxConnections,
                                                              callTimeout,
-                                                             pingPeriod,
+                                                             clientFailureCheckPeriod,
                                                              connectionTTL,
                                                              retryInterval,
                                                              retryIntervalMultiplier,
@@ -300,7 +300,7 @@
    {
       discoveryRefreshTimeout = DEFAULT_DISCOVERY_REFRESH_TIMEOUT;
 
-      pingPeriod = DEFAULT_PING_PERIOD;
+      clientFailureCheckPeriod = DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
 
       connectionTTL = DEFAULT_CONNECTION_TTL;
 
@@ -395,15 +395,15 @@
       this.staticConnectors = staticConnectors;
    }
 
-   public synchronized long getPingPeriod()
+   public synchronized long getClientFailureCheckPeriod()
    {
-      return pingPeriod;
+      return clientFailureCheckPeriod;
    }
 
-   public synchronized void setPingPeriod(long pingPeriod)
+   public synchronized void setClientFailureCheckPeriod(long clientFailureCheckPeriod)
    {
       checkWrite();
-      this.pingPeriod = pingPeriod;
+      this.clientFailureCheckPeriod = clientFailureCheckPeriod;
    }
 
    public synchronized long getConnectionTTL()
@@ -816,7 +816,7 @@
          }
       }
    }
-
+   
    // DiscoveryListener implementation --------------------------------------------------------
 
    public synchronized void connectorsChanged()
@@ -857,7 +857,7 @@
                                                                             failoverOnServerShutdown,
                                                                             maxConnections,
                                                                             callTimeout,
-                                                                            pingPeriod,
+                                                                            clientFailureCheckPeriod,
                                                                             connectionTTL,
                                                                             retryInterval,
                                                                             retryIntervalMultiplier,

Modified: trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManagerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManagerImpl.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/core/client/impl/ConnectionManagerImpl.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -23,6 +23,7 @@
 package org.jboss.messaging.core.client.impl;
 
 import static org.jboss.messaging.core.remoting.impl.wireformat.PacketImpl.EARLY_RESPONSE;
+import static org.jboss.messaging.core.remoting.impl.wireformat.PacketImpl.PING;
 
 import java.util.ArrayList;
 import java.util.Collections;
@@ -35,7 +36,9 @@
 import java.util.Set;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Future;
 import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
 import java.util.concurrent.locks.Lock;
 
 import org.jboss.messaging.core.client.ClientSession;
@@ -48,9 +51,12 @@
 import org.jboss.messaging.core.remoting.Packet;
 import org.jboss.messaging.core.remoting.RemotingConnection;
 import org.jboss.messaging.core.remoting.impl.AbstractBufferHandler;
+import org.jboss.messaging.core.remoting.impl.Pinger;
 import org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl;
 import org.jboss.messaging.core.remoting.impl.wireformat.CreateSessionMessage;
 import org.jboss.messaging.core.remoting.impl.wireformat.CreateSessionResponseMessage;
+import org.jboss.messaging.core.remoting.impl.wireformat.PacketImpl;
+import org.jboss.messaging.core.remoting.impl.wireformat.Ping;
 import org.jboss.messaging.core.remoting.spi.Connection;
 import org.jboss.messaging.core.remoting.spi.ConnectionLifeCycleListener;
 import org.jboss.messaging.core.remoting.spi.Connector;
@@ -99,7 +105,7 @@
 
    private final long callTimeout;
 
-   private final long pingPeriod;
+   private final long clientFailureCheckPeriod;
 
    private final long connectionTTL;
 
@@ -114,9 +120,9 @@
    private final Object failoverLock = new Object();
 
    private final ExecutorFactory orderedExecutorFactory;
-   
+
    private final ExecutorService threadPool;
-   
+
    private final ScheduledExecutorService scheduledThreadPool;
 
    private final Map<Object, ConnectionEntry> connections = Collections.synchronizedMap(new LinkedHashMap<Object, ConnectionEntry>());
@@ -138,7 +144,13 @@
    private volatile boolean closed;
 
    private boolean inFailoverOrReconnect;
+   
+   private Connector connector;
+   
+   private Map<Object, FailedConnectionRunnable> failRunnables = new ConcurrentHashMap<Object, FailedConnectionRunnable>();
 
+   private Map<Object, Pinger> pingRunnables = new ConcurrentHashMap<Object, Pinger>();
+
    // debug
 
    private static Map<TransportConfiguration, Set<RemotingConnection>> debugConns;
@@ -151,7 +163,9 @@
 
       debugConns = new ConcurrentHashMap<TransportConfiguration, Set<RemotingConnection>>();
    }
-
+   
+   public static boolean schedulePingersOneShot = false;
+   
    // Static
    // ---------------------------------------------------------------------------------------
 
@@ -163,7 +177,7 @@
                                 final boolean failoverOnServerShutdown,
                                 final int maxConnections,
                                 final long callTimeout,
-                                final long pingPeriod,
+                                final long clientFailureCheckPeriod,
                                 final long connectionTTL,
                                 final long retryInterval,
                                 final double retryIntervalMultiplier,
@@ -198,7 +212,7 @@
 
       this.callTimeout = callTimeout;
 
-      this.pingPeriod = pingPeriod;
+      this.clientFailureCheckPeriod = clientFailureCheckPeriod;
 
       this.connectionTTL = connectionTTL;
 
@@ -207,14 +221,14 @@
       this.retryIntervalMultiplier = retryIntervalMultiplier;
 
       this.reconnectAttempts = reconnectAttempts;
-      
-      this.scheduledThreadPool = scheduledThreadPool; 
-      
+
+      this.scheduledThreadPool = scheduledThreadPool;
+
       this.threadPool = threadPool;
-      
-      this.orderedExecutorFactory = new OrderedExecutorFactory(threadPool);
+
+      this.orderedExecutorFactory = new OrderedExecutorFactory(threadPool);      
    }
-
+   
    // ConnectionLifeCycleListener implementation --------------------------------------------------
 
    public void connectionCreated(final Connection connection)
@@ -230,7 +244,7 @@
    {
       failConnection(connectionID, me);
    }
-   
+
    // ConnectionManager implementation ------------------------------------------------------------------
 
    public ClientSession createSession(final String username,
@@ -324,7 +338,9 @@
                {
                   CreateSessionResponseMessage response = (CreateSessionResponseMessage)pResponse;
 
-                  Channel sessionChannel = connection.getChannel(sessionChannelID, producerWindowSize, producerWindowSize != -1);
+                  Channel sessionChannel = connection.getChannel(sessionChannelID,
+                                                                 producerWindowSize,
+                                                                 producerWindowSize != -1);
 
                   ClientSessionInternal session = new ClientSessionImpl(this,
                                                                         name,
@@ -505,7 +521,7 @@
          boolean attemptFailover = (backupConnectorFactory) != null && (failoverOnServerShutdown || me.getCode() != MessagingException.DISCONNECTED);
 
          boolean done = false;
-         
+
          if (attemptFailover || reconnectAttempts != 0)
          {
             lockAllChannel1s();
@@ -554,21 +570,23 @@
             {
                oldConnections.add(entry.connection);
             }
-
+                       
+            closeScheduledRunnables();
+            
             connections.clear();
 
             refCount = 0;
 
             mapIterator = null;
-            
+
             try
             {
                connector.close();
             }
             catch (Exception ignore)
-            {               
+            {
             }
-            
+
             connector = null;
 
             if (attemptFailover)
@@ -621,6 +639,28 @@
          return done;
       }
    }
+   
+   private void closeScheduledRunnables()
+   {
+      for (Object id: new HashSet<Object>(connections.keySet()))
+      {
+         connections.remove(id);
+   
+         FailedConnectionRunnable runnable = failRunnables.remove(id);
+   
+         if (runnable != null)
+         {
+            runnable.close();
+         }
+   
+         Pinger pingRunnable = pingRunnables.remove(id);
+   
+         if (pingRunnable != null)
+         {
+            pingRunnable.close();
+         }
+      }
+   }
 
    /*
     * Re-attach sessions all pre-existing sessions to new remoting connections
@@ -767,20 +807,22 @@
       if (refCount == 0)
       {
          // Close connections
-
+         
          Set<ConnectionEntry> copy = new HashSet<ConnectionEntry>(connections.values());
 
+         closeScheduledRunnables();
+         
          connections.clear();
 
          for (ConnectionEntry entry : copy)
-         {           
+         {
             try
-            {              
+            {
                entry.connection.destroy();
             }
             catch (Throwable ignore)
             {
-            }           
+            }
          }
 
          mapIterator = null;
@@ -792,13 +834,11 @@
          catch (Throwable ignore)
          {
          }
-         
+
          connector = null;
       }
    }
 
-   private Connector connector;
-
    private RemotingConnection getConnection(final int initialRefCount)
    {
       RemotingConnection conn;
@@ -806,15 +846,15 @@
       if (connections.size() < maxConnections)
       {
          // Create a new one
-        
+
          Connection tc = null;
 
          try
          {
             if (connector == null)
-            {               
+            {
                DelegatingBufferHandler handler = new DelegatingBufferHandler();
-               
+
                connector = connectorFactory.createConnector(transportParams, handler, this, threadPool);
 
                if (connector != null)
@@ -880,13 +920,50 @@
             return null;
          }
 
-         conn = new RemotingConnectionImpl(tc, callTimeout, pingPeriod, connectionTTL, scheduledThreadPool, threadPool, null);
+         conn = new RemotingConnectionImpl(tc, callTimeout, null);
 
          conn.addFailureListener(new DelegatingFailureListener(conn.getID()));
 
-         connections.put(conn.getID(), new ConnectionEntry(conn, connector));         
+         connections.put(conn.getID(), new ConnectionEntry(conn, connector));
+                  
+         //Send the initial ping, we always do this it contains connectionTTL and clientFailureInterval - 
+         //the server needs this in order to do pinging and failure checking
          
-         conn.startPinger();
+         Ping ping = new Ping(clientFailureCheckPeriod, connectionTTL);
+         
+         Channel channel0 = conn.getChannel(0, -1, false);
+         
+         channel0.setHandler(new Channel0Handler(conn));
+         
+         channel0.send(ping);
+         
+         if (clientFailureCheckPeriod != -1)
+         {
+            Pinger pinger = new Pinger(conn);
+            
+            Future<?> pingerFuture;
+            
+            if (schedulePingersOneShot)
+            {
+               pingerFuture = scheduledThreadPool.schedule(pinger, connectionTTL / 2, TimeUnit.MILLISECONDS);
+            }
+            else
+            {
+               pingerFuture = scheduledThreadPool.scheduleAtFixedRate(pinger, connectionTTL / 2, connectionTTL / 2, TimeUnit.MILLISECONDS);
+            }
+                        
+            pinger.setFuture(pingerFuture);
+            
+            pingRunnables.put(conn.getID(), pinger);
+            
+            FailedConnectionRunnable fcRunnable = new FailedConnectionRunnable(conn);
+            
+            Future<?> fcFuture = scheduledThreadPool.scheduleAtFixedRate(fcRunnable, clientFailureCheckPeriod, clientFailureCheckPeriod, TimeUnit.MILLISECONDS);
+            
+            fcRunnable.setFuture(fcFuture);
+            
+            failRunnables.put(conn.getID(), fcRunnable);            
+         }
 
          if (debug)
          {
@@ -911,7 +988,44 @@
 
       return conn;
    }
+   
+   private class Channel0Handler implements ChannelHandler
+   {
+      private final RemotingConnection conn;
+      
+      private Channel0Handler(final RemotingConnection conn)
+      {
+         this.conn = conn;
+      }
+      
+      public void handlePacket(final Packet packet)
+      {
+         final byte type = packet.getType();
 
+         if (type == PING)
+         {
+            //Do nothing
+         }
+         else if (type == PacketImpl.DISCONNECT)
+         {
+            threadPool.execute(new Runnable()
+            {
+               // Must be executed on new thread since cannot block the netty thread for a long time and fail can
+               // cause reconnect loop
+               public void run()
+               {
+                  conn.fail(new MessagingException(MessagingException.DISCONNECTED,
+                                              "The connection was closed by the server"));
+               }
+            });
+         }
+         else
+         {
+            throw new IllegalArgumentException("Invalid packet: " + packet);
+         }
+      }
+   }
+      
    private void returnConnection(final Object connectionID)
    {
       ConnectionEntry entry = connections.get(connectionID);
@@ -1005,7 +1119,60 @@
          conn.fail(me);
       }
    }
+   
+   private class FailedConnectionRunnable implements Runnable
+   {
+      private boolean closed;
 
+      private RemotingConnection conn;
+
+      private Future<?> future;
+
+      FailedConnectionRunnable(final RemotingConnection conn)
+      {
+         this.conn = conn;
+      }
+
+      public synchronized void setFuture(final Future<?> future)
+      {
+         this.future = future;
+      }
+
+      public synchronized void run()
+      {
+         if (closed)
+         {
+            return;
+         }
+
+         if (!conn.isDataReceived())
+         {
+            final MessagingException me = new MessagingException(MessagingException.CONNECTION_TIMEDOUT,
+                                                           "Did not receive ping on connection. It is likely a client has exited or crashed without " + "closing its connection, or the network between the server and client has failed. The connection will now be closed.");
+
+            threadPool.execute(new Runnable()
+            {
+               //Must be executed on different thread
+               public void run()
+               {
+                  conn.fail(me);
+               }
+            });
+         }
+         else
+         {            
+            conn.clearDataReceived();
+         }
+      }
+
+      public synchronized void close()
+      {
+         future.cancel(false);
+
+         closed = true;
+      }
+   }
+
    private static class ConnectionEntry
    {
       ConnectionEntry(final RemotingConnection connection, final Connector connector)
@@ -1021,13 +1188,13 @@
    }
 
    private class DelegatingBufferHandler extends AbstractBufferHandler
-   {     
+   {
       public void bufferReceived(final Object connectionID, final MessagingBuffer buffer)
       {
          ConnectionEntry entry = connections.get(connectionID);
-         
+
          if (entry != null)
-         {         
+         {
             entry.connection.bufferReceived(connectionID, buffer);
          }
       }

Modified: trunk/src/main/org/jboss/messaging/core/remoting/RemotingConnection.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/RemotingConnection.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/core/remoting/RemotingConnection.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -49,10 +49,6 @@
 
    void destroy();
 
-   boolean isExpired(long now);
-
-   void startPinger();
-
    void syncIDGeneratorSequence(long id);
 
    long getIDGeneratorSequence();
@@ -64,4 +60,12 @@
    Connection getTransportConnection();
 
    void addClosingListener(CloseListener listener);
+      
+   boolean isDataReceived();
+   
+   boolean isDataSent();
+   
+   void clearDataSent();
+   
+   void clearDataReceived();
 }

Added: trunk/src/main/org/jboss/messaging/core/remoting/impl/Pinger.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/impl/Pinger.java	                        (rev 0)
+++ trunk/src/main/org/jboss/messaging/core/remoting/impl/Pinger.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2005-2009, 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.core.remoting.impl;
+
+import java.util.concurrent.Future;
+
+import org.jboss.messaging.core.logging.Logger;
+import org.jboss.messaging.core.remoting.Channel;
+import org.jboss.messaging.core.remoting.RemotingConnection;
+import org.jboss.messaging.core.remoting.impl.wireformat.Ping;
+
+/**
+ * A Pinger
+ *
+ * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
+ *
+ *
+ */
+public class Pinger implements Runnable
+{
+   private static final Logger log = Logger.getLogger(Pinger.class);
+   
+   private boolean closed;
+
+   private RemotingConnection conn;
+
+   private Future<?> future;
+
+   public Pinger(final RemotingConnection conn)
+   {
+      this.conn = conn;
+   }
+
+   public synchronized void setFuture(final Future<?> future)
+   {
+      this.future = future;
+   }
+
+   public synchronized void run()
+   {
+      if (closed)
+      {
+         return;
+      }
+      
+      if (!conn.isDataSent())
+      {
+         // We only send a ping if no data has been sent since last ping
+
+         Ping ping = new Ping();
+
+         Channel channel0 = conn.getChannel(0, -1, false);
+
+         channel0.send(ping);
+      }
+
+      conn.clearDataSent();
+   }
+
+   public synchronized void close()
+   {
+      future.cancel(false);
+
+      closed = true;
+   }
+}

Modified: trunk/src/main/org/jboss/messaging/core/remoting/impl/RemotingConnectionImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/impl/RemotingConnectionImpl.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/core/remoting/impl/RemotingConnectionImpl.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -80,7 +80,6 @@
 import java.util.concurrent.ConcurrentLinkedQueue;
 import java.util.concurrent.CopyOnWriteArrayList;
 import java.util.concurrent.Executor;
-import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.ScheduledFuture;
 import java.util.concurrent.Semaphore;
 import java.util.concurrent.TimeUnit;
@@ -106,7 +105,6 @@
 import org.jboss.messaging.core.remoting.impl.wireformat.PacketImpl;
 import org.jboss.messaging.core.remoting.impl.wireformat.PacketsConfirmedMessage;
 import org.jboss.messaging.core.remoting.impl.wireformat.Ping;
-import org.jboss.messaging.core.remoting.impl.wireformat.Pong;
 import org.jboss.messaging.core.remoting.impl.wireformat.ReattachSessionMessage;
 import org.jboss.messaging.core.remoting.impl.wireformat.ReattachSessionResponseMessage;
 import org.jboss.messaging.core.remoting.impl.wireformat.ReplicateCreateSessionMessage;
@@ -173,11 +171,8 @@
 
    public static RemotingConnection createConnection(final ConnectorFactory connectorFactory,
                                                      final Map<String, Object> params,
-                                                     final long callTimeout,
-                                                     final long pingInterval,
-                                                     final long connectionTTL,
-                                                     final ScheduledExecutorService pingExecutor,
-                                                     final Executor threadPool, 
+                                                     final long callTimeout,                                          
+                                                     final Executor threadPool,
                                                      final ConnectionLifeCycleListener listener)
    {
       DelegatingBufferHandler handler = new DelegatingBufferHandler();
@@ -199,11 +194,7 @@
       }
 
       RemotingConnection connection = new RemotingConnectionImpl(tc,
-                                                                 callTimeout,
-                                                                 pingInterval,
-                                                                 connectionTTL,
-                                                                 pingExecutor,
-                                                                 threadPool,
+                                                                 callTimeout,                                                                                                                     
                                                                  null);
 
       handler.conn = connection;
@@ -234,37 +225,16 @@
 
    private final long blockingCallTimeout;
 
-   private Runnable pinger;
-
    private final List<Interceptor> interceptors;
 
    private ScheduledFuture<?> future;
 
-   private boolean firstTime = true;
-
-   private volatile boolean gotPong;
-
    private volatile boolean destroyed;
 
-   private volatile boolean stopPinging;
-
-   private volatile long expireTime = -1;
-
-   private final Channel pingChannel;
-
    private volatile boolean active;
 
    private final boolean client;
 
-   private final long pingPeriod;
-
-   // How long without a ping before the connection times out
-   private final long connectionTTL;
-
-   private final ScheduledExecutorService pingExecutor;
-   
-   private final Executor threadPool;
-
    // Channels 0-9 are reserved for the system
    // 0 is for pinging
    // 1 is for session creation and attachment
@@ -275,12 +245,14 @@
 
    private final Object transferLock = new Object();
 
-   private final ChannelHandler ppHandler = new PingPongHandler();
-
    private boolean frozen;
 
    private final Object failLock = new Object();
-
+   
+   private volatile boolean dataReceived;
+   
+   private volatile boolean dataSent;
+   
    // debug only stuff
 
    private boolean createdActive;
@@ -292,14 +264,14 @@
     * Create a client side connection
     */
    public RemotingConnectionImpl(final Connection transportConnection,
-                                 final long blockingCallTimeout,
-                                 final long pingPeriod,
-                                 final long connectionTTL,
-                                 final ScheduledExecutorService pingExecutor,
-                                 final Executor threadPool,
+                                 final long blockingCallTimeout,                                                 
                                  final List<Interceptor> interceptors)
    {
-      this(transportConnection, blockingCallTimeout, pingPeriod, connectionTTL, pingExecutor, threadPool, interceptors, true, true);
+      this(transportConnection,
+           blockingCallTimeout,          
+           interceptors,
+           true,
+           true);
    }
 
    /*
@@ -307,20 +279,14 @@
     */
    public RemotingConnectionImpl(final Connection transportConnection,
                                  final List<Interceptor> interceptors,
-                                 final boolean active,
-                                 final long connectionTTL,
-                                 final Executor threadPool)
+                                 final boolean active)
 
    {
-      this(transportConnection, -1, -1, connectionTTL, null, threadPool, interceptors, active, false);
+      this(transportConnection, -1, interceptors, active, false);
    }
 
    private RemotingConnectionImpl(final Connection transportConnection,
-                                  final long blockingCallTimeout,
-                                  final long pingPeriod,
-                                  final long connectionTTL,
-                                  final ScheduledExecutorService pingExecutor,
-                                  final Executor threadPool,
+                                  final long blockingCallTimeout,                                               
                                   final List<Interceptor> interceptors,
                                   final boolean active,
                                   final boolean client)
@@ -334,38 +300,11 @@
 
       this.active = active;
 
-      this.pingPeriod = pingPeriod;
-
-      this.connectionTTL = connectionTTL;
-
-      this.pingExecutor = pingExecutor;
-      
-      this.threadPool = threadPool;
-
-      // Channel zero is reserved for pinging
-      pingChannel = getChannel(0, -1, false);
-
-      pingChannel.setHandler(ppHandler);
-
       this.client = client;
 
       this.createdActive = active;
    }
 
-   public void startPinger()
-   {
-      if (pingPeriod != -1)
-      {
-         pinger = new Pinger();
-
-         future = pingExecutor.scheduleWithFixedDelay(pinger, 0, pingPeriod, TimeUnit.MILLISECONDS);
-      }
-      else
-      {
-         pinger = null;
-      }
-   }
-
    // RemotingConnection implementation
    // ------------------------------------------------------------
 
@@ -495,22 +434,11 @@
       callClosingListeners();
    }
 
-   public boolean isExpired(final long now)
-   {
-      return expireTime != -1 && now >= expireTime;
-   }
-
    public long generateChannelID()
    {
       return idGenerator.generateID();
    }
 
-   /* For testing only */
-   public void stopPingingAfterOne()
-   {
-      stopPinging = true;
-   }
-
    public synchronized void syncIDGeneratorSequence(final long id)
    {
       if (!idGeneratorSynced)
@@ -531,8 +459,10 @@
 
    public void bufferReceived(final Object connectionID, final MessagingBuffer buffer)
    {
-      final Packet packet = decode(buffer);
+      dataReceived = true;
       
+      final Packet packet = decode(buffer);
+
       synchronized (transferLock)
       {
          if (!frozen)
@@ -623,8 +553,6 @@
          future.cancel(false);
       }
 
-      pingChannel.close();
-
       // We close the underlying transport connection
       transportConnection.close();
 
@@ -653,7 +581,7 @@
             break;
          }
          case DISCONNECT:
-         {           
+         {
             packet = new PacketImpl(DISCONNECT);
             break;
          }
@@ -994,7 +922,7 @@
       private int responseActionCount;
 
       private boolean playedResponsesOnFailure;
-
+            
       public void setCommandConfirmationHandler(final CommandConfirmationHandler handler)
       {
          this.commandConfirmationHandler = handler;
@@ -1064,12 +992,12 @@
             lock.unlock();
          }
       }
-      
+
       public void sendAndFlush(final Packet packet)
       {
          send(packet, true);
       }
-      
+
       public void send(final Packet packet)
       {
          send(packet, false);
@@ -1121,8 +1049,10 @@
                }
 
                if (connection.active || packet.isWriteAlways())
-               {                
+               {
                   connection.transportConnection.write(buffer, flush);
+                                 
+                  connection.dataSent = true;
                }
             }
             finally
@@ -1192,7 +1122,8 @@
 
                connection.transportConnection.write(buffer);
                
- 
+               connection.dataSent = true;
+
                long toWait = connection.blockingCallTimeout;
 
                long start = System.currentTimeMillis();
@@ -1200,7 +1131,7 @@
                while (response == null && toWait > 0)
                {
                   try
-                  {                     
+                  {
                      sendCondition.await(toWait, TimeUnit.MILLISECONDS);
                   }
                   catch (InterruptedException e)
@@ -1211,7 +1142,7 @@
                   {
                      break;
                   }
-                  
+
                   final long now = System.currentTimeMillis();
 
                   toWait -= now - start;
@@ -1248,16 +1179,16 @@
       public void replicatePacket(final Packet packet, final long replicatedChannelID, final Runnable action)
       {
          packet.setChannelID(replicatedChannelID);
-         
+
          boolean runItNow = false;
 
          synchronized (replicationLock)
          {
             if (playedResponsesOnFailure && action != null)
-            {               
+            {
                // Already replicating channel failed, so just play the action now
-               
-               runItNow = true;               
+
+               runItNow = true;
             }
             else
             {
@@ -1273,11 +1204,13 @@
                packet.encode(buffer);
 
                connection.transportConnection.write(buffer);
+               
+               connection.dataSent = true;
             }
          }
-         
-         //Execute outside lock
-         
+
+         // Execute outside lock
+
          if (runItNow)
          {
             action.run();
@@ -1300,7 +1233,7 @@
       private void doExecuteOutstandingDelayedResults()
       {
          List<Runnable> toRun = new ArrayList<Runnable>();
-         
+
          synchronized (replicationLock)
          {
             // Execute all the response actions now
@@ -1322,14 +1255,13 @@
             responseActionCount = 0;
 
             playedResponsesOnFailure = true;
-            
-            for (Runnable action: toRun)
+
+            for (Runnable action : toRun)
             {
                action.run();
             }
          }
-         
-         
+
       }
 
       public void setHandler(final ChannelHandler handler)
@@ -1606,7 +1538,7 @@
                confirm(packet);
 
                lock.lock();
-               
+
                try
                {
                   sendCondition.signal();
@@ -1686,84 +1618,23 @@
       }
    }
 
-   private class Pinger implements Runnable
+   public boolean isDataReceived()
    {
-      public synchronized void run()
-      {
-         if (!firstTime && !gotPong)
-         {
-            // Error - didn't get pong back
-            final MessagingException me = new MessagingException(MessagingException.NOT_CONNECTED,
-                                                                 "Did not receive pong from server");
-            future.cancel(true);
-            
-            //Need to call fail on a different thread otherwise can prevent other pings occurring
-            threadPool.execute(new Runnable()
-            {
-               public void run()
-               {
-                  fail(me); 
-               }
-            });                                  
-         }
-         else
-         {
-            gotPong = false;
+      return dataReceived;
+   }
    
-            firstTime = false;
+   public void clearDataReceived()
+   {
+      dataReceived = false;
+   }
    
-            // Send ping
+   public boolean isDataSent()
+   {      
+      return dataSent;
+   }
    
-            final Packet ping = new Ping(connectionTTL);
-   
-            pingChannel.send(ping);
-         }
-      }
+   public void clearDataSent()
+   {     
+      dataSent = false;
    }
-
-   private class PingPongHandler implements ChannelHandler
-   {
-      public void handlePacket(final Packet packet)
-      {
-         final byte type = packet.getType();
-
-         if (type == PONG)
-         {
-            gotPong = true;
-
-            if (stopPinging)
-            {
-               future.cancel(true);
-            }
-         }
-         else if (type == PING)
-         {
-            // connectionTTL if specified on the server overrides any value specified in the ping.
-
-            long connectionTTLToUse = connectionTTL != -1 ? connectionTTL : ((Ping)packet).getExpirePeriod();
-
-            expireTime = System.currentTimeMillis() + connectionTTLToUse;
-
-            // Parameter is placeholder for future
-            final Packet pong = new Pong(-1);
-
-            pingChannel.send(pong);
-         }
-         else if (type == PacketImpl.DISCONNECT)
-         {
-            threadPool.execute(new Runnable()
-            {
-               public void run()
-               {
-                  fail(new MessagingException(MessagingException.DISCONNECTED, "The connection was closed by the server")); 
-               }
-            });     
-            //fail(new MessagingException(MessagingException.DISCONNECTED, "The connection was closed by the server"));
-         }
-         else
-         {
-            throw new IllegalArgumentException("Invalid packet: " + packet);
-         }
-      }
-   }
 }

Modified: trunk/src/main/org/jboss/messaging/core/remoting/impl/wireformat/Ping.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/impl/wireformat/Ping.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/core/remoting/impl/wireformat/Ping.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -18,7 +18,7 @@
  * 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.core.remoting.impl.wireformat;
 
@@ -38,19 +38,23 @@
 
    // Attributes ----------------------------------------------------
 
-   private long expirePeriod;
+   private long connectionTTL;
 
+   private long clientFailureCheckPeriod;
+
    // Static --------------------------------------------------------
 
    // Constructors --------------------------------------------------
 
-   public Ping(final long expirePeriod)
+   public Ping(final long clientFailureCheckPeriod, final long connectionTTL)
    {
       super(PING);
 
-      this.expirePeriod = expirePeriod;
+      this.connectionTTL = connectionTTL;
+
+      this.clientFailureCheckPeriod = clientFailureCheckPeriod;
    }
-   
+
    public Ping()
    {
       super(PING);
@@ -58,48 +62,56 @@
 
    // Public --------------------------------------------------------
 
-   public long getExpirePeriod()
+   public long getConnectionTTL()
    {
-      return expirePeriod;
+      return connectionTTL;
    }
-   
+
+   public long getClientFailureCheckPeriod()
+   {
+      return clientFailureCheckPeriod;
+   }
+
    public int getRequiredBufferSize()
    {
-      return BASIC_PACKET_SIZE + DataConstants.SIZE_LONG;
+      return BASIC_PACKET_SIZE + 2 * DataConstants.SIZE_LONG;
    }
-   
 
    public void encodeBody(final MessagingBuffer buffer)
    {
-      buffer.writeLong(expirePeriod);
+      buffer.writeLong(connectionTTL);
+      buffer.writeLong(clientFailureCheckPeriod);
    }
-   
+
    public void decodeBody(final MessagingBuffer buffer)
    {
-      expirePeriod = buffer.readLong();
+      connectionTTL = buffer.readLong();
+      clientFailureCheckPeriod = buffer.readLong();
    }
 
    @Override
    public String toString()
    {
       StringBuffer buf = new StringBuffer(getParentString());
-      buf.append(", expirePeriod=" + expirePeriod);
+      buf.append(", connectionTTL=" + connectionTTL);
+      buf.append(", clientFailureCheckPeriod=" + clientFailureCheckPeriod);
       buf.append("]");
       return buf.toString();
    }
-   
+
    public boolean equals(Object other)
    {
       if (other instanceof Ping == false)
       {
          return false;
       }
-            
+
       Ping r = (Ping)other;
-      
-      return super.equals(other) && this.expirePeriod == r.expirePeriod;
+
+      return super.equals(other) && this.connectionTTL == r.connectionTTL &&
+             this.clientFailureCheckPeriod == r.clientFailureCheckPeriod;
    }
-   
+
    public final boolean isRequiresConfirmations()
    {
       return false;

Modified: trunk/src/main/org/jboss/messaging/core/remoting/server/impl/RemotingServiceImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/remoting/server/impl/RemotingServiceImpl.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/core/remoting/server/impl/RemotingServiceImpl.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -13,6 +13,7 @@
 package org.jboss.messaging.core.remoting.server.impl;
 
 import static org.jboss.messaging.core.remoting.impl.wireformat.PacketImpl.DISCONNECT;
+import static org.jboss.messaging.core.remoting.impl.wireformat.PacketImpl.PING;
 
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -20,10 +21,11 @@
 import java.util.List;
 import java.util.Map;
 import java.util.Set;
-import java.util.Timer;
-import java.util.TimerTask;
 import java.util.concurrent.ConcurrentHashMap;
 import java.util.concurrent.Executor;
+import java.util.concurrent.Future;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.TimeUnit;
 
 import org.jboss.messaging.core.config.Configuration;
 import org.jboss.messaging.core.config.TransportConfiguration;
@@ -33,11 +35,14 @@
 import org.jboss.messaging.core.remoting.Channel;
 import org.jboss.messaging.core.remoting.ChannelHandler;
 import org.jboss.messaging.core.remoting.Interceptor;
+import org.jboss.messaging.core.remoting.Packet;
 import org.jboss.messaging.core.remoting.RemotingConnection;
 import org.jboss.messaging.core.remoting.impl.AbstractBufferHandler;
+import org.jboss.messaging.core.remoting.impl.Pinger;
 import org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl;
 import org.jboss.messaging.core.remoting.impl.invm.InVMAcceptorFactory;
 import org.jboss.messaging.core.remoting.impl.wireformat.PacketImpl;
+import org.jboss.messaging.core.remoting.impl.wireformat.Ping;
 import org.jboss.messaging.core.remoting.server.RemotingService;
 import org.jboss.messaging.core.remoting.spi.Acceptor;
 import org.jboss.messaging.core.remoting.spi.AcceptorFactory;
@@ -60,6 +65,8 @@
 
    private static final Logger log = Logger.getLogger(RemotingServiceImpl.class);
 
+   private static final long INITIAL_PING_TIMEOUT = 10000;
+
    // Attributes ----------------------------------------------------
 
    private volatile boolean started = false;
@@ -72,28 +79,36 @@
 
    private final Map<Object, RemotingConnection> connections = new ConcurrentHashMap<Object, RemotingConnection>();
 
-   private Timer failedConnectionTimer;
+   private final BufferHandler bufferHandler = new DelegatingBufferHandler();
 
-   private TimerTask failedConnectionsTask;
-
-   private final BufferHandler bufferHandler = new DelegatingBufferHandler();
-   
    private final Configuration config;
 
    private volatile MessagingServer server;
 
    private ManagementService managementService;
-   
+
    private volatile RemotingConnection serverSideReplicatingConnection;
-   
+
    private final Executor threadPool;
-   
+
+   private final ScheduledExecutorService scheduledThreadPool;
+
+   private Map<Object, FailedConnectionRunnable> connectionTTLRunnables = new ConcurrentHashMap<Object, FailedConnectionRunnable>();
+
+   private Map<Object, Pinger> pingRunnables = new ConcurrentHashMap<Object, Pinger>();
+
+   // For debug
+   public static boolean schedulePingersOneShot;
+
    // Static --------------------------------------------------------
 
    // Constructors --------------------------------------------------
 
-   public RemotingServiceImpl(final Configuration config, final MessagingServer server, final ManagementService managementService,
-                              final Executor threadPool)
+   public RemotingServiceImpl(final Configuration config,
+                              final MessagingServer server,
+                              final ManagementService managementService,
+                              final Executor threadPool,
+                              final ScheduledExecutorService scheduledThreadPool)
    {
       transportConfigs = config.getAcceptorConfigurations();
 
@@ -115,6 +130,7 @@
       this.server = server;
       this.managementService = managementService;
       this.threadPool = threadPool;
+      this.scheduledThreadPool = scheduledThreadPool;
    }
 
    // RemotingService implementation -------------------------------
@@ -131,6 +147,7 @@
       if (config.isJMXManagementEnabled())
       {
          boolean invmAcceptorConfigured = false;
+
          for (TransportConfiguration config : transportConfigs)
          {
             if (InVMAcceptorFactory.class.getName().equals(config.getFactoryClassName()))
@@ -138,6 +155,7 @@
                invmAcceptorConfigured = true;
             }
          }
+
          if (!invmAcceptorConfigured)
          {
             transportConfigs.add(new TransportConfiguration(InVMAcceptorFactory.class.getName(),
@@ -155,7 +173,7 @@
             Class<?> clazz = loader.loadClass(info.getFactoryClassName());
 
             AcceptorFactory factory = (AcceptorFactory)clazz.newInstance();
-            
+
             Acceptor acceptor = factory.createAcceptor(info.getParams(), bufferHandler, this, threadPool);
 
             acceptors.add(acceptor);
@@ -176,51 +194,34 @@
          a.start();
       }
 
-      failedConnectionTimer = new Timer(true);
-
-      failedConnectionsTask = new FailedConnectionsTask();
-      
-      failedConnectionTimer.schedule(failedConnectionsTask, config.getConnectionScanPeriod(), config.getConnectionScanPeriod());
-
       started = true;
    }
-   
+
    public synchronized void freeze()
    {
-      //Used in testing - prevents service taking any more connections
-      
+      // Used in testing - prevents service taking any more connections
+
       for (Acceptor acceptor : acceptors)
       {
          acceptor.pause();
       }
    }
-   
+
    public synchronized void stop() throws Exception
    {
       if (!started)
       {
          return;
       }
- 
-      if (failedConnectionTimer != null)
-      {
-         failedConnectionsTask.cancel();
 
-         failedConnectionsTask = null;
-
-         failedConnectionTimer.cancel();
-
-         failedConnectionTimer = null;
-      }
-          
-      //We need to stop them accepting first so no new connections are accepted after we send the disconnect message
+      // We need to stop them accepting first so no new connections are accepted after we send the disconnect message
       for (Acceptor acceptor : acceptors)
       {
          acceptor.pause();
       }
-      
-      for (RemotingConnection connection: connections.values())
-      {     
+
+      for (RemotingConnection connection : connections.values())
+      {
          connection.getChannel(0, -1, false).sendAndFlush(new PacketImpl(DISCONNECT));
       }
 
@@ -231,6 +232,16 @@
 
       acceptors.clear();
 
+      for (FailedConnectionRunnable runnable : connectionTTLRunnables.values())
+      {
+         runnable.close();
+      }
+
+      for (Pinger runnable : pingRunnables.values())
+      {
+         runnable.close();
+      }
+
       connections.clear();
 
       started = false;
@@ -248,21 +259,21 @@
 
    public RemotingConnection removeConnection(final Object remotingConnectionID)
    {
-      return connections.remove(remotingConnectionID);
+      return closeConnection(remotingConnectionID);
    }
-   
+
    public synchronized Set<RemotingConnection> getConnections()
    {
       return new HashSet<RemotingConnection>(connections.values());
    }
-   
+
    public RemotingConnection getServerSideReplicatingConnection()
    {
       return serverSideReplicatingConnection;
    }
 
    // ConnectionLifeCycleListener implementation -----------------------------------
- 
+
    public void connectionCreated(final Connection connection)
    {
       if (server == null)
@@ -270,8 +281,7 @@
          throw new IllegalStateException("Unable to create connection, server hasn't finished starting up");
       }
 
-      RemotingConnection rc = new RemotingConnectionImpl(connection, interceptors, !config.isBackup(), config.getConnectionTTLOverride(),
-                                                         threadPool);
+      RemotingConnection rc = new RemotingConnectionImpl(connection, interceptors, !config.isBackup());
 
       Channel channel1 = rc.getChannel(1, -1, false);
 
@@ -279,10 +289,23 @@
 
       channel1.setHandler(handler);
 
+      Channel channel0 = rc.getChannel(0, -1, false);
+
+      Channel0Handler channel0Handler = new Channel0Handler(rc);
+
+      channel0.setHandler(channel0Handler);
+
       Object id = connection.getID();
 
-      connections.put(id, rc);    
-      
+      connections.put(id, rc);
+
+      InitialPingTimeout runnable = new InitialPingTimeout(rc, channel0Handler);
+
+      // We schedule an initial ping timeout. An inital ping is always sent from the client as the first thing it
+      // does after creating a connection, this contains the ping period and connection TTL, if it doesn't
+      // arrive the connection will get closed
+      scheduledThreadPool.schedule(runnable, INITIAL_PING_TIMEOUT, TimeUnit.MILLISECONDS);
+
       if (config.isBackup())
       {
          serverSideReplicatingConnection = rc;
@@ -290,34 +313,34 @@
    }
 
    public void connectionDestroyed(final Object connectionID)
-   {         
+   {
       RemotingConnection conn = connections.get(connectionID);
-      
+
       if (conn != null)
       {
-         //if the connection has no failure listeners it means the sesssions etc were already closed so this is a clean
-         //shutdown, therefore we can destroy the connection
-         //otherwise client might have crashed/exited without closing connections so we leave them for connection TTL
-         
+         // if the connection has no failure listeners it means the sesssions etc were already closed so this is a clean
+         // shutdown, therefore we can destroy the connection
+         // otherwise client might have crashed/exited without closing connections so we leave them for connection TTL
+
          if (conn.getFailureListeners().isEmpty())
          {
-            connections.remove(connectionID);
-            
+            closeConnection(connectionID);
+
             conn.destroy();
          }
-      } 
+      }
    }
 
    public void connectionException(final Object connectionID, final MessagingException me)
-   {            
-      //We DO NOT call fail on connection exception, otherwise in event of real connection failure, the
-      //connection  will be failed, the session will be closed and won't be able to reconnect
-      
-      //E.g. if live server fails, then this handler wil be called on backup server for the server
-      //side replicating connection.
-      //If the connection fail() is called then the sessions on the backup will get closed.
-      
-      //Connections should only fail when TTL is exceeded
+   {
+      // We DO NOT call fail on connection exception, otherwise in event of real connection failure, the
+      // connection will be failed, the session will be closed and won't be able to reconnect
+
+      // E.g. if live server fails, then this handler wil be called on backup server for the server
+      // side replicating connection.
+      // If the connection fail() is called then the sessions on the backup will get closed.
+
+      // Connections should only fail when TTL is exceeded
    }
 
    public void addInterceptor(final Interceptor interceptor)
@@ -338,56 +361,199 @@
 
    // Private -------------------------------------------------------
 
+   private void setupScheduledRunnables(final RemotingConnection conn,
+                                        final long clientFailureCheckPeriod,
+                                        final long connectionTTL)
+   {
+      if (connectionTTL <= 0 || clientFailureCheckPeriod <= 0)
+      {
+         log.warn("Invalid values of connectionTTL/clientFailureCheckPeriod");
+
+         closeConnection(conn.getID());
+
+         return;
+      }
+
+      long connectionTTLToUse = config.getConnectionTTLOverride() != -1 ? config.getConnectionTTLOverride()
+                                                                       : connectionTTL;
+
+      if (connectionTTLToUse != -1)
+      {
+         FailedConnectionRunnable runnable = new FailedConnectionRunnable(conn);
+
+         Future<?> connectionTTLFuture = scheduledThreadPool.scheduleAtFixedRate(runnable,
+                                                                                 connectionTTLToUse,
+                                                                                 connectionTTLToUse,
+                                                                                 TimeUnit.MILLISECONDS);
+
+         runnable.setFuture(connectionTTLFuture);
+
+         connectionTTLRunnables.put(conn.getID(), runnable);
+      }
+
+      long pingPeriod = clientFailureCheckPeriod == -1 ? -1 : clientFailureCheckPeriod / 2;
+
+      if (pingPeriod != -1)
+      {
+         Pinger pingRunnable = new Pinger(conn);
+
+         Future<?> pingFuture;
+
+         if (schedulePingersOneShot)
+         {
+            pingFuture = scheduledThreadPool.schedule(pingRunnable, 0, TimeUnit.MILLISECONDS);
+         }
+         else
+         {
+            pingFuture = scheduledThreadPool.scheduleAtFixedRate(pingRunnable, 0, pingPeriod, TimeUnit.MILLISECONDS);
+         }
+
+         pingRunnable.setFuture(pingFuture);
+
+         pingRunnables.put(conn.getID(), pingRunnable);
+      }
+   }
+
+   private RemotingConnection closeConnection(final Object connectionID)
+   {
+      RemotingConnection connection = connections.remove(connectionID);
+
+      FailedConnectionRunnable runnable = connectionTTLRunnables.remove(connectionID);
+
+      if (runnable != null)
+      {
+         runnable.close();
+      }
+
+      Pinger pingRunnable = pingRunnables.remove(connectionID);
+
+      if (pingRunnable != null)
+      {
+         pingRunnable.close();
+      }
+
+      return connection;
+   }
+
    // Inner classes -------------------------------------------------
 
-   private class FailedConnectionsTask extends TimerTask
+   private class Channel0Handler implements ChannelHandler
    {
-      private boolean cancelled;
+      private final RemotingConnection conn;
 
-      @Override
-      public synchronized void run()
+      private volatile boolean gotInitialPing;
+
+      private Channel0Handler(final RemotingConnection conn)
       {
-         if (cancelled)
+         this.conn = conn;
+      }
+
+      public void handlePacket(final Packet packet)
+      {
+         final byte type = packet.getType();
+
+         if (type == PING)
          {
-            return;
+            if (!gotInitialPing)
+            {
+               Ping ping = (Ping)packet;
+
+               setupScheduledRunnables(conn, ping.getClientFailureCheckPeriod(), ping.getConnectionTTL());
+
+               gotInitialPing = true;
+            }
          }
+         else
+         {
+            throw new IllegalArgumentException("Invalid packet: " + packet);
+         }
+      }
 
-         Set<RemotingConnection> failedConnections = new HashSet<RemotingConnection>();
+      private boolean isGotInitialPing()
+      {
+         return gotInitialPing;
+      }
+   }
 
-         long now = System.currentTimeMillis();
+   private class InitialPingTimeout implements Runnable
+   {
+      private final RemotingConnection conn;
 
-         for (RemotingConnection conn : connections.values())
+      private final Channel0Handler handler;
+
+      private InitialPingTimeout(final RemotingConnection conn, final Channel0Handler handler)
+      {
+         this.conn = conn;
+
+         this.handler = handler;
+      }
+
+      public void run()
+      {
+         if (!handler.isGotInitialPing())
          {
-            if (conn.isExpired(now))
-            {
-               failedConnections.add(conn);
-            } 
+            // Never received initial ping
+            log.warn("Did not receive initial ping for connection, it will be closed");
+
+            closeConnection(conn);
+
+            conn.destroy();
          }
+      }
+   }
 
-         for (RemotingConnection conn : failedConnections)
+   private class FailedConnectionRunnable implements Runnable
+   {
+      private boolean closed;
+
+      private RemotingConnection conn;
+
+      private Future<?> future;
+
+      FailedConnectionRunnable(final RemotingConnection conn)
+      {
+         this.conn = conn;
+      }
+
+      public synchronized void setFuture(final Future<?> future)
+      {
+         this.future = future;
+      }
+
+      public synchronized void run()
+      {
+         if (closed)
          {
+            return;
+         }
 
-            connections.remove(conn.getID());
+         if (!conn.isDataReceived())
+         {
+            removeConnection(conn.getID());
+
             MessagingException me = new MessagingException(MessagingException.CONNECTION_TIMEDOUT,
                                                            "Did not receive ping on connection. It is likely a client has exited or crashed without " + "closing its connection, or the network between the server and client has failed. The connection will now be closed.");
 
             conn.fail(me);
          }
+         else
+         {           
+            conn.clearDataReceived();
+         }
       }
 
-      @Override
-      public synchronized boolean cancel()
+      public synchronized void close()
       {
-         cancelled = true;
+         future.cancel(false);
 
-         return super.cancel();
+         closed = true;
       }
    }
 
    private class DelegatingBufferHandler extends AbstractBufferHandler
    {
       public void bufferReceived(final Object connectionID, final MessagingBuffer buffer)
-      {         
+      {
          RemotingConnection conn = connections.get(connectionID);
 
          if (conn != null)

Modified: trunk/src/main/org/jboss/messaging/core/server/cluster/impl/BridgeImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/cluster/impl/BridgeImpl.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/core/server/cluster/impl/BridgeImpl.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -22,23 +22,6 @@
 
 package org.jboss.messaging.core.server.cluster.impl;
 
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONSUMER_MAX_RATE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONSUMER_WINDOW_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PING_PERIOD;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_MAX_RATE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_WINDOW_SIZE;
-
 import java.nio.ByteBuffer;
 import java.util.HashSet;
 import java.util.LinkedList;

Modified: trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/core/server/impl/MessagingServerImpl.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -12,6 +12,24 @@
 
 package org.jboss.messaging.core.server.impl;
 
+import java.lang.management.ManagementFactory;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.Map.Entry;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+import java.util.concurrent.ScheduledExecutorService;
+import java.util.concurrent.ScheduledThreadPoolExecutor;
+import java.util.concurrent.ThreadFactory;
+import java.util.concurrent.TimeUnit;
+
+import javax.management.MBeanServer;
+
 import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
 import org.jboss.messaging.core.config.Configuration;
 import org.jboss.messaging.core.config.TransportConfiguration;
@@ -91,24 +109,6 @@
 import org.jboss.messaging.utils.UUIDGenerator;
 import org.jboss.messaging.utils.VersionLoader;
 
-import javax.management.MBeanServer;
-
-import java.lang.management.ManagementFactory;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-import java.util.concurrent.ConcurrentHashMap;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ScheduledExecutorService;
-import java.util.concurrent.ScheduledThreadPoolExecutor;
-import java.util.concurrent.ThreadFactory;
-import java.util.concurrent.TimeUnit;
-
 /**
  * The messaging server implementation
  *
@@ -208,24 +208,22 @@
    {
       this(null, null, null);
    }
-   
+
    public MessagingServerImpl(final Configuration configuration)
    {
       this(configuration, null, null);
    }
-   
-   public MessagingServerImpl(final Configuration configuration,
-                              MBeanServer mbeanServer)
+
+   public MessagingServerImpl(final Configuration configuration, MBeanServer mbeanServer)
    {
       this(configuration, mbeanServer, null);
    }
-   
-   public MessagingServerImpl(final Configuration configuration,                              
-                              final JBMSecurityManager securityManager)
+
+   public MessagingServerImpl(final Configuration configuration, final JBMSecurityManager securityManager)
    {
       this(configuration, null, securityManager);
    }
-   
+
    public MessagingServerImpl(Configuration configuration,
                               MBeanServer mbeanServer,
                               final JBMSecurityManager securityManager)
@@ -237,7 +235,7 @@
 
       if (mbeanServer == null)
       {
-         //Just use JVM mbean server
+         // Just use JVM mbean server
          mbeanServer = ManagementFactory.getPlatformMBeanServer();
       }
 
@@ -265,7 +263,7 @@
       {
          return;
       }
-      
+
       initialisePart1();
 
       if (configuration.isBackup())
@@ -316,7 +314,7 @@
          queueDeployer.stop();
 
          if (securityDeployer != null)
-         {            
+         {
             securityDeployer.stop();
          }
 
@@ -350,14 +348,14 @@
       postOffice.stop();
 
       // Need to shutdown pools before shutting down paging manager to make sure everything is written ok
-     
+
       List<Runnable> tasks = scheduledPool.shutdownNow();
-      
-      for (Runnable task: tasks)
+
+      for (Runnable task : tasks)
       {
          log.debug("Waiting for " + task);
       }
-            
+
       threadPool.shutdown();
       try
       {
@@ -373,7 +371,7 @@
 
       scheduledPool = null;
       threadPool = null;
-      
+
       pagingManager.stop();
 
       pagingManager = null;
@@ -631,9 +629,6 @@
             replicatingConnection = (RemotingConnectionImpl)RemotingConnectionImpl.createConnection(backupConnectorFactory,
                                                                                                     backupConnectorParams,
                                                                                                     ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
-                                                                                                    ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
-                                                                                                    ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
-                                                                                                    scheduledPool,
                                                                                                     threadPool,
                                                                                                     listener);
 
@@ -656,8 +651,6 @@
                }
             });
 
-            replicatingConnection.startPinger();
-
             // First time we get channel we send a message down it informing the backup of our node id -
             // backup and live must have the same node id
 
@@ -748,8 +741,7 @@
       return createQueue(address, queueName, filterString, durable, temporary, false);
    }
 
-   public Queue
-   deployQueue(final SimpleString address,
+   public Queue deployQueue(final SimpleString address,
                             final SimpleString queueName,
                             final SimpleString filterString,
                             final boolean durable,
@@ -925,7 +917,7 @@
 
       managementService = new ManagementServiceImpl(mbeanServer, configuration);
 
-      remotingService = new RemotingServiceImpl(configuration, this, managementService, threadPool);
+      remotingService = new RemotingServiceImpl(configuration, this, managementService, threadPool, scheduledPool);
    }
 
    private void initialisePart2() throws Exception
@@ -1017,13 +1009,13 @@
          basicUserCredentialsDeployer = new BasicUserCredentialsDeployer(deploymentManager, securityManager);
 
          basicUserCredentialsDeployer.start();
-                 
+
          if (securityManager != null)
          {
             securityDeployer = new SecurityDeployer(deploymentManager, securityRepository);
-            
+
             securityDeployer.start();
-         }        
+         }
       }
 
       // Load the journal and populate queues, transactions and caches in memory

Modified: trunk/src/main/org/jboss/messaging/jms/client/JBossConnectionFactory.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/client/JBossConnectionFactory.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/jms/client/JBossConnectionFactory.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -280,14 +280,14 @@
       this.transactionBatchSize = transactionBatchSize;
    }
 
-   public synchronized long getPingPeriod()
+   public synchronized long getClientFailureCheckPeriod()
    {
-      return sessionFactory.getPingPeriod();
+      return sessionFactory.getClientFailureCheckPeriod();
    }
 
-   public synchronized void setPingPeriod(long pingPeriod)
+   public synchronized void setClientFailureCheckPeriod(long clientFailureCheckPeriod)
    {
-      sessionFactory.setPingPeriod(pingPeriod);
+      sessionFactory.setClientFailureCheckPeriod(clientFailureCheckPeriod);
    }
 
    public synchronized long getConnectionTTL()

Modified: trunk/src/main/org/jboss/messaging/jms/server/JMSServerManager.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/JMSServerManager.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/jms/server/JMSServerManager.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -146,7 +146,7 @@
    void createConnectionFactory(String name,
                                 List<Pair<TransportConfiguration, TransportConfiguration>> connectorConfigs,
                                 String clientID,
-                                long pingPeriod,
+                                long clientFailureCheckPeriod,
                                 long connectionTTL,
                                 long callTimeout,
                                 int maxConnections,
@@ -177,7 +177,7 @@
                                 int discoveryPort,
                                 String clientID,
                                 long discoveryRefreshTimeout,
-                                long pingPeriod,
+                                long clientFailureCheckPeriod,
                                 long connectionTTL,
                                 long callTimeout,
                                 int maxConnections,

Modified: trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerDeployer.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -12,6 +12,9 @@
 
 package org.jboss.messaging.jms.server.impl;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
 import org.jboss.messaging.core.config.Configuration;
 import org.jboss.messaging.core.config.TransportConfiguration;
@@ -25,9 +28,6 @@
 import org.w3c.dom.Node;
 import org.w3c.dom.NodeList;
 
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * @author <a href="ataylor at redhat.com">Andy Taylor</a>
  * @author <a href="tim.fox at jboss.com">Tim Fox</a>
@@ -42,7 +42,7 @@
 
    private static final String CLIENTID_ELEMENT = "client-id";
 
-   private static final String PING_PERIOD_ELEMENT = "ping-period";
+   private static final String CLIENT_FAILURE_CHECK_PERIOD = "client-failure-check-period";
 
    private static final String CONNECTION_TTL_ELEMENT = "connection-ttl";
 
@@ -164,7 +164,7 @@
       {
          NodeList children = node.getChildNodes();
 
-         long pingPeriod = ClientSessionFactoryImpl.DEFAULT_PING_PERIOD;
+         long clientFailureCheckPeriod = ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
          long connectionTTL = ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL;
          long callTimeout = ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT;
          String clientID = null;
@@ -199,9 +199,9 @@
          {
             Node child = children.item(j);
 
-            if (PING_PERIOD_ELEMENT.equals(child.getNodeName()))
+            if (CLIENT_FAILURE_CHECK_PERIOD.equals(child.getNodeName()))
             {
-               pingPeriod = org.jboss.messaging.utils.XMLUtil.parseLong(child);
+               clientFailureCheckPeriod = org.jboss.messaging.utils.XMLUtil.parseLong(child);
             }
             else if (CONNECTION_TTL_ELEMENT.equals(child.getNodeName()))
             {
@@ -374,7 +374,7 @@
                                                      discoveryGroupConfiguration.getGroupPort(),
                                                      clientID,
                                                      discoveryGroupConfiguration.getRefreshTimeout(),
-                                                     pingPeriod,
+                                                     clientFailureCheckPeriod,
                                                      connectionTTL,
                                                      callTimeout,
                                                      maxConnections,
@@ -406,7 +406,7 @@
             jmsServerControl.createConnectionFactory(name,
                                                      connectorConfigs,
                                                      clientID,
-                                                     pingPeriod,
+                                                     clientFailureCheckPeriod,
                                                      connectionTTL,
                                                      callTimeout,
                                                      maxConnections,

Modified: trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerManagerImpl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerManagerImpl.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/jms/server/impl/JMSServerManagerImpl.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -315,7 +315,7 @@
    public synchronized void createConnectionFactory(String name,
                                                     List<Pair<TransportConfiguration, TransportConfiguration>> connectorConfigs,
                                                     String clientID,
-                                                    long pingPeriod,
+                                                    long clientFailureCheckPeriod,
                                                     long connectionTTL,
                                                     long callTimeout,
                                                     int maxConnections,
@@ -347,7 +347,7 @@
       {
          cf = new JBossConnectionFactory(connectorConfigs);
          cf.setClientID(clientID);
-         cf.setPingPeriod(pingPeriod);
+         cf.setClientFailureCheckPeriod(clientFailureCheckPeriod);
          cf.setConnectionTTL(connectionTTL);
          cf.setCallTimeout(callTimeout);
          cf.setMaxConnections(maxConnections);
@@ -381,7 +381,7 @@
                                                     int discoveryPort,
                                                     String clientID,
                                                     long discoveryRefreshTimeout,
-                                                    long pingPeriod,
+                                                    long clientFailureCheckPeriod,
                                                     long connectionTTL,
                                                     long callTimeout,
                                                     int maxConnections,
@@ -415,7 +415,7 @@
          cf = new JBossConnectionFactory(discoveryAddress, discoveryPort);
          cf.setClientID(clientID);
          cf.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
-         cf.setPingPeriod(pingPeriod);
+         cf.setClientFailureCheckPeriod(clientFailureCheckPeriod);
          cf.setConnectionTTL(connectionTTL);
          cf.setCallTimeout(callTimeout);
          cf.setMaxConnections(maxConnections);

Modified: trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControlMBean.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/ConnectionFactoryControlMBean.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -39,7 +39,7 @@
 
    String getClientID();
    
-   long getPingPeriod();
+   long getClientFailureCheckPeriod();
    
    long getCallTimeout();
    

Modified: trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/JMSServerControlMBean.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -86,7 +86,7 @@
                                 Object[] backupConnectorsTransportClassNames,
                                 Object[] backupConnectorTransportParams,
                                 String clientID,
-                                long pingPeriod,
+                                long clientFailureCheckPeriod,
                                 long connectionTTL,
                                 long callTimeout,
                                 int maxConnections,
@@ -123,7 +123,7 @@
                                 int discoveryPort,
                                 String clientID,
                                 long discoveryRefreshTimeout,
-                                long pingPeriod,
+                                long clientFailureCheckPeriod,
                                 long connectionTTL,
                                 long callTimeout,
                                 int maxConnections,

Modified: trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControl.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/ConnectionFactoryControl.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -74,9 +74,9 @@
       return cf.getClientID();
    }
 
-   public long getPingPeriod()
+   public long getClientFailureCheckPeriod()
    {
-      return cf.getPingPeriod();
+      return cf.getClientFailureCheckPeriod();
    }
 
    public long getCallTimeout()

Modified: trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/impl/JMSServerControl.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -168,7 +168,7 @@
                                        final Object[] backupConnectorsTransportClassNames,
                                        final Object[] backupConnectorTransportParams,
                                        final String clientID,
-                                       final long pingPeriod,
+                                       final long clientFailureCheckPeriod,
                                        final long connectionTTL,
                                        final long callTimeout,
                                        final int maxConnections,
@@ -204,7 +204,7 @@
       server.createConnectionFactory(name,
                                      pairs,
                                      clientID,
-                                     pingPeriod,
+                                     clientFailureCheckPeriod,
                                      connectionTTL,
                                      callTimeout,
                                      maxConnections,
@@ -251,7 +251,7 @@
                                        final int discoveryPort,
                                        final String clientID,
                                        final long discoveryRefreshTimeout,
-                                       final long pingPeriod,
+                                       final long clientFailureCheckPeriod,
                                        final long connectionTTL,
                                        final long callTimeout,
                                        final int maxConnections,
@@ -285,7 +285,7 @@
                                      discoveryPort,
                                      clientID,
                                      discoveryRefreshTimeout,
-                                     pingPeriod,
+                                     clientFailureCheckPeriod,
                                      connectionTTL,
                                      callTimeout,
                                      maxConnections,

Modified: trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareConnectionFactoryControlWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareConnectionFactoryControlWrapper.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareConnectionFactoryControlWrapper.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -106,9 +106,9 @@
       return localControl.getDupsOKBatchSize();
    }
 
-   public long getPingPeriod()
+   public long getClientFailureCheckPeriod()
    {
-      return localControl.getPingPeriod();
+      return localControl.getClientFailureCheckPeriod();
    }
 
    public boolean isBlockOnAcknowledge()

Modified: trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java
===================================================================
--- trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/jms/server/management/jmx/impl/ReplicationAwareJMSServerControlWrapper.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -72,7 +72,7 @@
                                        final int discoveryPort,
                                        final String clientID,
                                        final long discoveryRefreshTimeout,
-                                       final long pingPeriod,
+                                       final long clientFailureCheckPeriod,
                                        final long connectionTTL,
                                        final long callTimeout,
                                        final int maxConnections,
@@ -104,7 +104,7 @@
                              discoveryAddress,
                              discoveryPort,
                              clientID,
-                             pingPeriod,
+                             clientFailureCheckPeriod,
                              connectionTTL,
                              callTimeout,
                              maxConnections,
@@ -205,7 +205,7 @@
                                        final Object[] backupConnectorsTransportClassNames,
                                        final Object[] backupConnectorTransportParams,
                                        final String clientID,
-                                       final long pingPeriod,
+                                       final long clientFailureCheckPeriod,
                                        final long connectionTTL,
                                        final long callTimeout,
                                        final int maxConnections,
@@ -238,7 +238,7 @@
                              backupConnectorsTransportClassNames,
                              backupConnectorTransportParams,
                              clientID,
-                             pingPeriod,
+                             clientFailureCheckPeriod,
                              connectionTTL,
                              callTimeout,
                              maxConnections,

Modified: trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/ra/JBMRAProperties.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -62,7 +62,7 @@
    private String connectionLoadBalancingPolicyClassName;
 
    /** */
-   private Long pingPeriod;
+   private Long clientFailureCheckPeriod;
 
    /** */
    private Long connectionTTL;
@@ -294,31 +294,31 @@
    }
 
    /**
-    * Get ping period
+    * Get client failure check period
     * @return The value
     */
-   public Long getPingPeriod()
+   public Long getClientFailureCheckPeriod()
    {
       if (trace)
       {
-         log.trace("getPingPeriod()");
+         log.trace("getClientFailureCheckPeriod()");
       }
 
-      return pingPeriod;
+      return clientFailureCheckPeriod;
    }
 
    /**
-    * Set ping period
-    * @param pingPeriod The value
+    * Set client failure check period
+    * @param clientFailureCheckPeriod The value
     */
-   public void setPingPeriod(final Long pingPeriod)
+   public void setClientFailureCheckPeriod(final Long clientFailureCheckPeriod)
    {
       if (trace)
       {
-         log.trace("setPingPeriod(" + pingPeriod + ")");
+         log.trace("setClientFailureCheckPeriod(" + clientFailureCheckPeriod + ")");
       }
 
-      this.pingPeriod = pingPeriod;
+      this.clientFailureCheckPeriod = clientFailureCheckPeriod;
    }
 
    /**
@@ -1010,7 +1010,7 @@
                 Util.compare(discoveryRefreshTimeout, you.getDiscoveryRefreshTimeout()) &&
                 Util.compare(discoveryInitialWaitTimeout, you.getDiscoveryInitialWaitTimeout()) &&
                 Util.compare(connectionLoadBalancingPolicyClassName, you.getConnectionLoadBalancingPolicyClassName()) &&
-                Util.compare(pingPeriod, you.getPingPeriod()) &&
+                Util.compare(clientFailureCheckPeriod, you.getClientFailureCheckPeriod()) &&
                 Util.compare(connectionTTL, you.getConnectionTTL()) &&
                 Util.compare(callTimeout, you.getCallTimeout()) &&
                 Util.compare(dupsOKBatchSize, you.getDupsOKBatchSize()) &&
@@ -1058,7 +1058,7 @@
       hash += 31 * hash + (discoveryRefreshTimeout != null ? discoveryRefreshTimeout.hashCode() : 0);
       hash += 31 * hash + (discoveryInitialWaitTimeout != null ? discoveryInitialWaitTimeout.hashCode() : 0);
       hash += 31 * hash + (connectionLoadBalancingPolicyClassName != null ? connectionLoadBalancingPolicyClassName.hashCode() : 0);
-      hash += 31 * hash + (pingPeriod != null ? pingPeriod.hashCode() : 0);
+      hash += 31 * hash + (clientFailureCheckPeriod != null ? clientFailureCheckPeriod.hashCode() : 0);
       hash += 31 * hash + (connectionTTL != null ? connectionTTL.hashCode() : 0);
       hash += 31 * hash + (callTimeout != null ? callTimeout.hashCode() : 0);
       hash += 31 * hash + (dupsOKBatchSize != null ? dupsOKBatchSize.hashCode() : 0);

Modified: trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java
===================================================================
--- trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/src/main/org/jboss/messaging/ra/JBMResourceAdapter.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -428,33 +428,33 @@
    }
 
    /**
-    * Get ping period
+    * Get client failure check period
     *
     * @return The value
     */
-   public Long getPingPeriod()
+   public Long getClientFailureCheckPeriod()
    {
       if (trace)
       {
-         log.trace("getPingPeriod()");
+         log.trace("getClientFailureCheckPeriod()");
       }
 
-      return raProperties.getPingPeriod();
+      return raProperties.getClientFailureCheckPeriod();
    }
 
    /**
-    * Set ping period
+    * Set client failure check period
     *
-    * @param pingPeriod The value
+    * @param clientFailureCheckPeriod The value
     */
-   public void setPingPeriod(final Long pingPeriod)
+   public void setClientFailureCheckPeriod(final Long clientFailureCheckPeriod)
    {
       if (trace)
       {
-         log.trace("setPingPeriod(" + pingPeriod + ")");
+         log.trace("setClientFailureCheckPeriod(" + clientFailureCheckPeriod + ")");
       }
 
-      raProperties.setPingPeriod(pingPeriod);
+      raProperties.setClientFailureCheckPeriod(clientFailureCheckPeriod);
    }
 
    /**
@@ -1319,9 +1319,9 @@
          cf.setConnectionLoadBalancingPolicyClassName(getLoadBalancingPolicyClassName());
       }
 
-      if (getPingPeriod() != null)
+      if (getClientFailureCheckPeriod() != null)
       {
-         cf.setPingPeriod(getPingPeriod());
+         cf.setClientFailureCheckPeriod(getClientFailureCheckPeriod());
       }
 
       if (getConnectionTTL() != null)

Modified: trunk/tests/config/jbm-jms-for-JMSServerDeployerTest.xml
===================================================================
--- trunk/tests/config/jbm-jms-for-JMSServerDeployerTest.xml	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/config/jbm-jms-for-JMSServerDeployerTest.xml	2009-06-04 16:45:19 UTC (rev 7197)
@@ -10,7 +10,7 @@
          <entry name="java:/connectionfactories/acme/fullConfigurationConnectionFactory"/>
       </entries>
       <connector-ref connector-name="netty"/>
-      <ping-period>1234</ping-period>
+      <client-failure-check-period>1234</client-failure-check-period>
       <call-timeout>5678</call-timeout>
       <consumer-window-size>12345</consumer-window-size>
       <consumer-max-rate>6789</consumer-max-rate>

Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/CTSMiscellaneousTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -24,18 +24,18 @@
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT;
+import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONSUMER_MAX_RATE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONSUMER_WINDOW_SIZE;
+import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PING_PERIOD;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_MAX_RATE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_WINDOW_SIZE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RECONNECT_ATTEMPTS;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE;
@@ -50,7 +50,6 @@
 import javax.jms.MessageProducer;
 import javax.jms.Session;
 
-import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
 import org.jboss.messaging.core.config.TransportConfiguration;
 import org.jboss.messaging.jms.client.JBossConnectionFactory;
 import org.jboss.messaging.utils.Pair;
@@ -98,7 +97,7 @@
          getJmsServerManager().createConnectionFactory("StrictTCKConnectionFactory",
                                                        connectorConfigs,
                                                        null,
-                                                       DEFAULT_PING_PERIOD,
+                                                       DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                                                        DEFAULT_CONNECTION_TTL,
                                                        DEFAULT_CALL_TIMEOUT,
                                                        DEFAULT_MAX_CONNECTIONS,

Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/JMSTestCase.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/JMSTestCase.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/JMSTestCase.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -3,18 +3,18 @@
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT;
+import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONSUMER_MAX_RATE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONSUMER_WINDOW_SIZE;
+import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PING_PERIOD;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_MAX_RATE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_WINDOW_SIZE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RECONNECT_ATTEMPTS;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE;
@@ -26,7 +26,6 @@
 
 import javax.naming.InitialContext;
 
-import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
 import org.jboss.messaging.core.config.TransportConfiguration;
 import org.jboss.messaging.jms.client.JBossConnectionFactory;
 import org.jboss.messaging.utils.Pair;
@@ -73,7 +72,7 @@
       getJmsServerManager().createConnectionFactory("testsuitecf",
                                                     connectorConfigs,
                                                     null,
-                                                    DEFAULT_PING_PERIOD,
+                                                    DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                                                     DEFAULT_CONNECTION_TTL,
                                                     DEFAULT_CALL_TIMEOUT,
                                                     DEFAULT_MAX_CONNECTIONS,

Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/message/ObjectMessageTest.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/message/ObjectMessageTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/jms/message/ObjectMessageTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -222,7 +222,7 @@
       while (tokenString.hasMoreElements())
       {
          String value = tokenString.nextToken();
-         URL itemLocation = new File(value).toURL();
+         URL itemLocation = new File(value).toURI().toURL();
          if (!itemLocation.equals(classLocation) &&
                       itemLocation.toString().indexOf(pathIgnore) >= 0)
          {

Modified: trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java
===================================================================
--- trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/jms-tests/src/org/jboss/test/messaging/tools/container/LocalTestServer.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -21,17 +21,16 @@
 */
 package org.jboss.test.messaging.tools.container;
 
-import org.jboss.kernel.plugins.config.property.PropertyKernelConfig;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT;
+import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONSUMER_MAX_RATE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PING_PERIOD;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_MAX_RATE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_WINDOW_SIZE;
@@ -41,6 +40,21 @@
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_SCHEDULED_THREAD_POOL_MAX_SIZE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_THREAD_POOL_MAX_SIZE;
 import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_USE_GLOBAL_POOLS;
+
+import java.io.File;
+import java.lang.management.ManagementFactory;
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Properties;
+import java.util.Set;
+
+import javax.management.MBeanServerInvocationHandler;
+import javax.management.ObjectName;
+import javax.naming.InitialContext;
+
+import org.jboss.kernel.plugins.config.property.PropertyKernelConfig;
 import org.jboss.messaging.core.config.TransportConfiguration;
 import org.jboss.messaging.core.logging.Logger;
 import org.jboss.messaging.core.management.ObjectNames;
@@ -59,18 +73,6 @@
 import org.jboss.messaging.utils.Pair;
 import org.jboss.messaging.utils.SimpleString;
 
-import javax.management.MBeanServerInvocationHandler;
-import javax.management.ObjectName;
-import javax.naming.InitialContext;
-import java.io.File;
-import java.lang.management.ManagementFactory;
-import java.util.ArrayList;
-import java.util.Collection;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Properties;
-import java.util.Set;
-
 /**
  * @author <a href="mailto:ovidiu at feodorov.com">Ovidiu Feodorov</a>
  * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
@@ -319,7 +321,7 @@
       getJMSServerManager().createConnectionFactory(objectName,
                                                     connectorConfigs,
                                                     clientId,
-                                                    DEFAULT_PING_PERIOD,
+                                                    DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                                                     DEFAULT_CONNECTION_TTL,
                                                     DEFAULT_CALL_TIMEOUT,
                                                     DEFAULT_MAX_CONNECTIONS,

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/client/ClientSessionFactoryTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -77,7 +77,7 @@
                              null,
                              0,
                              ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT,
-                             ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
+                             ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                              ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
                              ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
                              ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
@@ -137,7 +137,7 @@
                              groupAddress,
                              groupPort,
                              ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT,
-                             ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
+                             ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                              ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
                              ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
                              ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
@@ -188,7 +188,7 @@
                              null,
                              0,
                              ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT,
-                             ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
+                             ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                              ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
                              ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
                              ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
@@ -239,7 +239,7 @@
                              null,
                              0,
                              ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT,
-                             ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
+                             ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                              ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
                              ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
                              ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
@@ -290,7 +290,7 @@
                              null,
                              0,
                              ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT,
-                             ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
+                             ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                              ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
                              ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
                              ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
@@ -337,7 +337,7 @@
       String discoveryAddress = randomString();
       int discoveryPort = RandomUtil.randomPositiveInt();
       long discoveryRefreshTimeout = RandomUtil.randomPositiveLong();
-      long pingPeriod = RandomUtil.randomPositiveLong();
+      long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
       long connectionTTL = RandomUtil.randomPositiveLong();
       long callTimeout = RandomUtil.randomPositiveLong();
       int maxConnections = RandomUtil.randomPositiveInt();
@@ -366,7 +366,7 @@
       cf.setDiscoveryAddress(discoveryAddress);
       cf.setDiscoveryPort(discoveryPort);
       cf.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
-      cf.setPingPeriod(pingPeriod);
+      cf.setClientFailureCheckPeriod(clientFailureCheckPeriod);
       cf.setConnectionTTL(connectionTTL);
       cf.setCallTimeout(callTimeout);
       cf.setMaxConnections(maxConnections);
@@ -395,7 +395,7 @@
       assertEquals(discoveryAddress, cf.getDiscoveryAddress());
       assertEquals(discoveryPort, cf.getDiscoveryPort());
       assertEquals(discoveryRefreshTimeout, cf.getDiscoveryRefreshTimeout());
-      assertEquals(pingPeriod, cf.getPingPeriod());
+      assertEquals(clientFailureCheckPeriod, cf.getClientFailureCheckPeriod());
       assertEquals(connectionTTL, cf.getConnectionTTL());
       assertEquals(callTimeout, cf.getCallTimeout());
       assertEquals(maxConnections, cf.getMaxConnections());
@@ -432,7 +432,7 @@
       String discoveryAddress = randomString();
       int discoveryPort = RandomUtil.randomPositiveInt();
       long discoveryRefreshTimeout = RandomUtil.randomPositiveLong();
-      long pingPeriod = RandomUtil.randomPositiveLong();
+      long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
       long connectionTTL = RandomUtil.randomPositiveLong();
       long callTimeout = RandomUtil.randomPositiveLong();
       int maxConnections = RandomUtil.randomPositiveInt();
@@ -495,7 +495,7 @@
       }
       try
       {
-         cf.setPingPeriod(pingPeriod);
+         cf.setClientFailureCheckPeriod(clientFailureCheckPeriod);
          fail("Should throw exception");
       }
       catch (IllegalStateException e)
@@ -714,7 +714,7 @@
       cf.getDiscoveryAddress();
       cf.getDiscoveryPort();
       cf.getDiscoveryRefreshTimeout();
-      cf.getPingPeriod();
+      cf.getClientFailureCheckPeriod();
       cf.getConnectionTTL();
       cf.getCallTimeout();
       cf.getMaxConnections();
@@ -746,7 +746,7 @@
                                     String discoveryAddress,
                                     int discoveryPort,
                                     long discoveryRefreshTimeout,
-                                    long pingPeriod,
+                                    long clientFailureCheckPeriod,
                                     long connectionTTL,
                                     long callTimeout,
                                     int maxConnections,
@@ -788,7 +788,7 @@
       assertEquals(cf.getDiscoveryAddress(), discoveryAddress);
       assertEquals(cf.getDiscoveryPort(), discoveryPort);
       assertEquals(cf.getDiscoveryRefreshTimeout(), discoveryRefreshTimeout);
-      assertEquals(cf.getPingPeriod(), pingPeriod);
+      assertEquals(cf.getClientFailureCheckPeriod(), clientFailureCheckPeriod);
       assertEquals(cf.getConnectionTTL(), connectionTTL);
       assertEquals(cf.getCallTimeout(), callTimeout);
       assertEquals(cf.getMaxConnections(), maxConnections);

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/client/CoreClientTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/client/CoreClientTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/client/CoreClientTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -80,13 +80,14 @@
       server.start();
       
       ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration(connectorFactoryClassName));
+      sf.setConsumerWindowSize(0);
 
       ClientSession session = sf.createSession(false, true, true);
       
       session.createQueue(QUEUE, QUEUE, null, false);
       
       ClientProducer producer = session.createProducer(QUEUE);     
-      
+       
       final int numMessages = 10000;
       
       for (int i = 0; i < numMessages; i++)

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientCrashTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientCrashTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/ClientCrashTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -132,7 +132,7 @@
 
       sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.integration.transports.netty.NettyConnectorFactory"));
       
-      sf.setPingPeriod(PING_PERIOD);
+      sf.setClientFailureCheckPeriod(PING_PERIOD);
       sf.setConnectionTTL(CONNECTION_TTL);
    }
 

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/CrashClient.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/CrashClient.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/clientcrash/CrashClient.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -61,7 +61,7 @@
 
          ClientSessionFactory sf = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.integration.transports.netty.NettyConnectorFactory"));
 
-         sf.setPingPeriod(ClientCrashTest.PING_PERIOD);
+         sf.setClientFailureCheckPeriod(ClientCrashTest.PING_PERIOD);
          sf.setConnectionTTL(ClientCrashTest.CONNECTION_TTL);
 
          ClientSession session = sf.createSession(false, true, true);

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 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/cluster/failover/ReplicateConnectionFailureTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -74,12 +74,12 @@
 
    public void testFailConnection() throws Exception
    {
-      final long pingPeriod = 500;
+      final long clientFailureCheckPeriod = 500;
 
       ClientSessionFactoryInternal sf1 = new ClientSessionFactoryImpl(new TransportConfiguration("org.jboss.messaging.core.remoting.impl.invm.InVMConnectorFactory"));
                                                                       
-      sf1.setPingPeriod(pingPeriod);
-      sf1.setConnectionTTL((long)(pingPeriod * 1.5));      
+      sf1.setClientFailureCheckPeriod(clientFailureCheckPeriod);
+      sf1.setConnectionTTL((long)(clientFailureCheckPeriod * 1.5));      
       sf1.setProducerWindowSize(32 * 1024);
 
       assertEquals(0, liveServer.getRemotingService().getConnections().size());
@@ -106,9 +106,9 @@
 
       final RemotingConnectionImpl conn1 = (RemotingConnectionImpl)((ClientSessionImpl)session1).getConnection();
 
-      conn1.stopPingingAfterOne();
+      //conn1.stopPingingAfterOne();
 
-      Thread.sleep(3 * pingPeriod);
+      Thread.sleep(3 * clientFailureCheckPeriod);
 
       assertEquals(0, liveServer.getRemotingService().getConnections().size());
 

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/JBossConnectionFactoryTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/JBossConnectionFactoryTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/JBossConnectionFactoryTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -88,7 +88,7 @@
                           0,
                           ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT,
                           null,
-                          ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
+                          ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                           ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
                           ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
                           ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
@@ -155,7 +155,7 @@
                           groupPort,
                           ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT,
                           null,
-                          ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
+                          ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                           ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
                           ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
                           ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
@@ -203,7 +203,7 @@
                           0,
                           ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT,
                           null,
-                          ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
+                          ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                           ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
                           ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
                           ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
@@ -252,7 +252,7 @@
                           0,
                           ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT,
                           null,
-                          ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
+                          ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                           ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
                           ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
                           ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
@@ -301,7 +301,7 @@
                           0,
                           ClientSessionFactoryImpl.DEFAULT_DISCOVERY_REFRESH_TIMEOUT,
                           null,
-                          ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
+                          ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                           ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
                           ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
                           ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
@@ -347,7 +347,7 @@
       String discoveryAddress = randomString();
       int discoveryPort = RandomUtil.randomPositiveInt();
       long discoveryRefreshTimeout = RandomUtil.randomPositiveLong();
-      long pingPeriod = RandomUtil.randomPositiveLong();
+      long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
       long connectionTTL = RandomUtil.randomPositiveLong();
       long callTimeout = RandomUtil.randomPositiveLong();
       int maxConnections = RandomUtil.randomPositiveInt();
@@ -376,7 +376,7 @@
       cf.setDiscoveryAddress(discoveryAddress);
       cf.setDiscoveryPort(discoveryPort);
       cf.setDiscoveryRefreshTimeout(discoveryRefreshTimeout);
-      cf.setPingPeriod(pingPeriod);
+      cf.setClientFailureCheckPeriod(clientFailureCheckPeriod);
       cf.setConnectionTTL(connectionTTL);
       cf.setCallTimeout(callTimeout);
       cf.setMaxConnections(maxConnections);
@@ -405,7 +405,7 @@
       assertEquals(discoveryAddress, cf.getDiscoveryAddress());
       assertEquals(discoveryPort, cf.getDiscoveryPort());
       assertEquals(discoveryRefreshTimeout, cf.getDiscoveryRefreshTimeout());
-      assertEquals(pingPeriod, cf.getPingPeriod());
+      assertEquals(clientFailureCheckPeriod, cf.getClientFailureCheckPeriod());
       assertEquals(connectionTTL, cf.getConnectionTTL());
       assertEquals(callTimeout, cf.getCallTimeout());
       assertEquals(maxConnections, cf.getMaxConnections());
@@ -443,7 +443,7 @@
       int discoveryPort = RandomUtil.randomPositiveInt();
       long discoveryRefreshTimeout = RandomUtil.randomPositiveLong();
       String clientID = RandomUtil.randomString();
-      long pingPeriod = RandomUtil.randomPositiveLong();
+      long clientFailureCheckPeriod = RandomUtil.randomPositiveLong();
       long connectionTTL = RandomUtil.randomPositiveLong();
       long callTimeout = RandomUtil.randomPositiveLong();
       int maxConnections = RandomUtil.randomPositiveInt();
@@ -516,7 +516,7 @@
       }
       try
       {
-         cf.setPingPeriod(pingPeriod);
+         cf.setClientFailureCheckPeriod(clientFailureCheckPeriod);
          fail("Should throw exception");
       }
       catch (IllegalStateException e)
@@ -745,7 +745,7 @@
       cf.getDiscoveryPort();
       cf.getDiscoveryRefreshTimeout();
       cf.getClientID();
-      cf.getPingPeriod();
+      cf.getClientFailureCheckPeriod();
       cf.getConnectionTTL();
       cf.getCallTimeout();
       cf.getMaxConnections();
@@ -779,7 +779,7 @@
                                     int discoveryPort,
                                     long discoveryRefreshTimeout,
                                     String clientID,
-                                    long pingPeriod,
+                                    long clientFailureCheckPeriod,
                                     long connectionTTL,
                                     long callTimeout,
                                     int maxConnections,
@@ -823,7 +823,7 @@
       assertEquals(cf.getDiscoveryPort(), discoveryPort);
       assertEquals(cf.getDiscoveryRefreshTimeout(), discoveryRefreshTimeout);
       assertEquals(cf.getClientID(), clientID);
-      assertEquals(cf.getPingPeriod(), pingPeriod);
+      assertEquals(cf.getClientFailureCheckPeriod(), clientFailureCheckPeriod);
       assertEquals(cf.getConnectionTTL(), connectionTTL);
       assertEquals(cf.getCallTimeout(), callTimeout);
       assertEquals(cf.getMaxConnections(), maxConnections);

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/JMSFailoverTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/JMSFailoverTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/cluster/JMSFailoverTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -22,26 +22,6 @@
 
 package org.jboss.messaging.tests.integration.jms.cluster;
 
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RECONNECT_ATTEMPTS;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONSUMER_MAX_RATE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONSUMER_WINDOW_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PING_PERIOD;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_MAX_RATE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_WINDOW_SIZE;
-
 import java.util.HashMap;
 import java.util.Map;
 

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/JMSServerDeployerTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/JMSServerDeployerTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/JMSServerDeployerTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -198,7 +198,7 @@
       {
          JBossConnectionFactory cf = (JBossConnectionFactory)context.lookup(binding);
          assertNotNull(cf);
-         assertEquals(1234, cf.getPingPeriod());
+         assertEquals(1234, cf.getClientFailureCheckPeriod());
          assertEquals(5678, cf.getCallTimeout());
          assertEquals(12345, cf.getConsumerWindowSize());
          assertEquals(6789, cf.getConsumerMaxRate());

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -170,7 +170,7 @@
             TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
 
             control.createConnectionFactory(cfName, tcLive.getFactoryClassName(), tcLive.getParams(), bindings);
-         }         
+         }
       });
    }
 
@@ -184,8 +184,12 @@
             String clientID = randomString();
             TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
 
-            control.createConnectionFactory(cfName, tcLive.getFactoryClassName(), tcLive.getParams(), clientID, bindings);
-         }         
+            control.createConnectionFactory(cfName,
+                                            tcLive.getFactoryClassName(),
+                                            tcLive.getParams(),
+                                            clientID,
+                                            bindings);
+         }
       });
    }
 
@@ -199,16 +203,16 @@
             TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
             TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
 
-            control.createConnectionFactory(cfName, 
+            control.createConnectionFactory(cfName,
                                             tcLive.getFactoryClassName(),
                                             tcLive.getParams(),
                                             tcBackup.getFactoryClassName(),
                                             tcBackup.getParams(),
                                             bindings);
-         }         
+         }
       });
    }
-   
+
    public void testCreateConnectionFactory_4() throws Exception
    {
       doCreateConnectionFactory(new ConnectionFactoryCreator()
@@ -220,17 +224,17 @@
             TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
             TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
 
-            control.createConnectionFactory(cfName, 
+            control.createConnectionFactory(cfName,
                                             tcLive.getFactoryClassName(),
                                             tcLive.getParams(),
                                             tcBackup.getFactoryClassName(),
                                             tcBackup.getParams(),
                                             clientID,
                                             bindings);
-         }         
+         }
       });
    }
-   
+
    public void testCreateConnectionFactory_5() throws Exception
    {
       doCreateConnectionFactory(new ConnectionFactoryCreator()
@@ -241,16 +245,16 @@
             TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
             TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
 
-            control.createConnectionFactory(cfName, 
-                                            new Object[] {tcLive.getFactoryClassName()},
-                                            new Object[] {tcLive.getParams()},
-                                            new Object[] {tcBackup.getFactoryClassName()},
-                                            new Object[] {tcBackup.getParams()},
+            control.createConnectionFactory(cfName,
+                                            new Object[] { tcLive.getFactoryClassName() },
+                                            new Object[] { tcLive.getParams() },
+                                            new Object[] { tcBackup.getFactoryClassName() },
+                                            new Object[] { tcBackup.getParams() },
                                             bindings);
-         }         
+         }
       });
    }
-      
+
    public void testCreateConnectionFactory_6() throws Exception
    {
       doCreateConnectionFactory(new ConnectionFactoryCreator()
@@ -262,17 +266,17 @@
             TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
             TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
 
-            control.createConnectionFactory(cfName, 
-                                            new Object[] {tcLive.getFactoryClassName()},
-                                            new Object[] {tcLive.getParams()},
-                                            new Object[] {tcBackup.getFactoryClassName()},
-                                            new Map[] {tcBackup.getParams()},
+            control.createConnectionFactory(cfName,
+                                            new Object[] { tcLive.getFactoryClassName() },
+                                            new Object[] { tcLive.getParams() },
+                                            new Object[] { tcBackup.getFactoryClassName() },
+                                            new Map[] { tcBackup.getParams() },
                                             clientID,
                                             bindings);
-         }         
+         }
       });
    }
-   
+
    public void testCreateConnectionFactory_7() throws Exception
    {
       doCreateConnectionFactory(new ConnectionFactoryCreator()
@@ -284,13 +288,13 @@
             TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
             TransportConfiguration tcBackup = new TransportConfiguration(InVMConnectorFactory.class.getName());
 
-            control.createConnectionFactory(cfName, 
-                                            new Object[] {tcLive.getFactoryClassName()},
-                                            new Object[] {tcLive.getParams()},
-                                            new Object[] {tcBackup.getFactoryClassName()},
-                                            new Object[] {tcBackup.getParams()},
+            control.createConnectionFactory(cfName,
+                                            new Object[] { tcLive.getFactoryClassName() },
+                                            new Object[] { tcLive.getParams() },
+                                            new Object[] { tcBackup.getFactoryClassName() },
+                                            new Object[] { tcBackup.getParams() },
                                             clientID,
-                                            ClientSessionFactoryImpl.DEFAULT_PING_PERIOD,
+                                            ClientSessionFactoryImpl.DEFAULT_CLIENT_FAILURE_CHECK_PERIOD,
                                             ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL,
                                             ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT,
                                             ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS,
@@ -315,13 +319,13 @@
                                             ClientSessionFactoryImpl.DEFAULT_RECONNECT_ATTEMPTS,
                                             ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN,
                                             bindings);
-         }         
+         }
       });
    }
 
    public void _testCreateConnectionFactoryWithDiscoveryGroup() throws Exception
    {
-      String[] cfJNDIBindings = new String[] {randomString(), randomString(), randomString()};
+      String[] cfJNDIBindings = new String[] { randomString(), randomString(), randomString() };
       String cfName = randomString();
       String clientID = randomString();
 
@@ -331,16 +335,12 @@
 
       for (String cfJNDIBinding : cfJNDIBindings)
       {
-         checkNoBinding(context, cfJNDIBinding);            
+         checkNoBinding(context, cfJNDIBinding);
       }
 
       JMSServerControlMBean control = createManagementControl();
 
-      control.createConnectionFactory(cfName, 
-                                      "231.7.7.7",
-                                      8765,
-                                      clientID,
-                                      cfJNDIBindings);
+      control.createConnectionFactory(cfName, "231.7.7.7", 8765, clientID, cfJNDIBindings);
 
       for (String cfJNDIBinding : cfJNDIBindings)
       {
@@ -351,15 +351,15 @@
          connection.close();
       }
    }
-   
+
    public void testDestroyConnectionFactory() throws Exception
    {
-      String[] cfJNDIBindings = new String[] {randomString(), randomString(), randomString()};
+      String[] cfJNDIBindings = new String[] { randomString(), randomString(), randomString() };
       String cfName = randomString();
 
       for (String cfJNDIBinding : cfJNDIBindings)
       {
-         checkNoBinding(context, cfJNDIBinding);            
+         checkNoBinding(context, cfJNDIBinding);
       }
 
       JMSServerControlMBean control = createManagementControl();
@@ -376,12 +376,12 @@
          Connection connection = cf.createConnection();
          connection.close();
       }
-      
+
       control.destroyConnectionFactory(cfName);
-      
+
       for (String cfJNDIBinding : cfJNDIBindings)
       {
-         checkNoBinding(context, cfJNDIBinding);            
+         checkNoBinding(context, cfJNDIBinding);
       }
 
    }
@@ -399,10 +399,10 @@
       conf.setSecurityEnabled(false);
       conf.setJMXManagementEnabled(true);
       conf.getAcceptorConfigurations().add(new TransportConfiguration(InVMAcceptorFactory.class.getName()));
-      MessagingServer server = Messaging.newMessagingServer(conf, mbeanServer, false);      
+      MessagingServer server = Messaging.newMessagingServer(conf, mbeanServer, false);
 
       context = new InVMContext();
-      serverManager = new JMSServerManagerImpl(server);      
+      serverManager = new JMSServerManagerImpl(server);
       serverManager.setContext(context);
       serverManager.start();
       serverManager.activated();
@@ -426,7 +426,7 @@
    private void doCreateConnectionFactory(ConnectionFactoryCreator creator) throws Exception
    {
       Object[] cfJNDIBindings = new Object[] { randomString(), randomString(), randomString() };
-            
+
       String cfName = randomString();
 
       for (Object cfJNDIBinding : cfJNDIBindings)
@@ -436,10 +436,10 @@
       checkNoResource(ObjectNames.getConnectionFactoryObjectName(cfName));
 
       JMSServerControlMBean control = createManagementControl();
-     creator.createConnectionFactory(control, cfJNDIBindings);
-      
+      creator.createConnectionFactory(control, cfJNDIBindings);
+
       TransportConfiguration tcLive = new TransportConfiguration(InVMConnectorFactory.class.getName());
-      
+
       control.createConnectionFactory(cfName, tcLive.getFactoryClassName(), tcLive.getParams(), cfJNDIBindings);
 
       for (Object cfJNDIBinding : cfJNDIBindings)
@@ -465,7 +465,7 @@
                                                discoveryPort,
                                                ConfigurationImpl.DEFAULT_BROADCAST_REFRESH_TIMEOUT));
       MessagingServer server = Messaging.newMessagingServer(conf, mbeanServer, false);
-      
+
       context = new InVMContext();
       JMSServerManagerImpl serverManager = new JMSServerManagerImpl(server);
       serverManager.setContext(context);
@@ -474,13 +474,12 @@
 
       return serverManager;
    }
-   
+
    // Inner classes -------------------------------------------------
 
-   interface ConnectionFactoryCreator{
+   interface ConnectionFactoryCreator
+   {
       void createConnectionFactory(JMSServerControlMBean control, Object[] bindings) throws Exception;
    }
-   
 
-
 }
\ No newline at end of file

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSServerControlUsingJMSTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -92,7 +92,7 @@
                                              int discoveryPort,
                                              String clientID,
                                              long discoveryRefreshTimeout,
-                                             long pingPeriod,
+                                             long clientFailureCheckPeriod,
                                              long connectionTTL,
                                              long callTimeout,
                                              int maxConnections,
@@ -124,7 +124,7 @@
                                   discoveryAddress,
                                   discoveryPort,
                                   clientID,
-                                  pingPeriod,
+                                  clientFailureCheckPeriod,
                                   connectionTTL,
                                   callTimeout,
                                   maxConnections,
@@ -232,7 +232,7 @@
                                              Object[] backupConnectorsTransportClassNames,
                                              Object[] backupConnectorTransportParams,
                                              String clientID,
-                                             long pingPeriod,
+                                             long clientFailureCheckPeriod,
                                              long connectionTTL,
                                              long callTimeout,
                                              int maxConnections,
@@ -265,7 +265,7 @@
                                   backupConnectorsTransportClassNames,
                                   backupConnectorTransportParams,
                                   clientID,
-                                  pingPeriod,
+                                  clientFailureCheckPeriod,
                                   connectionTTL,
                                   callTimeout,
                                   maxConnections,

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSUtil.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSUtil.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/jms/server/management/JMSUtil.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -70,7 +70,7 @@
       return cf.createConnection();
    }
    
-   public static Connection createConnection(String connectorFactory, long connectionTTL, long pingPeriod) throws JMSException
+   public static Connection createConnection(String connectorFactory, long connectionTTL, long clientFailureCheckPeriod) throws JMSException
    {
       JBossConnectionFactory cf = new JBossConnectionFactory(new TransportConfiguration(connectorFactory));
       
@@ -78,7 +78,7 @@
       cf.setBlockOnPersistentSend(true);
       cf.setBlockOnAcknowledge(true);
       cf.setConnectionTTL(connectionTTL);
-      cf.setPingPeriod(pingPeriod);
+      cf.setClientFailureCheckPeriod(clientFailureCheckPeriod);
 
       return cf.createConnection();
    }

Modified: trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/integration/remoting/PingTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -22,25 +22,7 @@
 
 package org.jboss.messaging.tests.integration.remoting;
 
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_ACK_BATCH_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_AUTO_GROUP;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_ACKNOWLEDGE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_NON_PERSISTENT_SEND;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_BLOCK_ON_PERSISTENT_SEND;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CALL_TIMEOUT;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_LOAD_BALANCING_POLICY_CLASS_NAME;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONNECTION_TTL;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RECONNECT_ATTEMPTS;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONSUMER_MAX_RATE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_CONSUMER_WINDOW_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_FAILOVER_ON_SERVER_SHUTDOWN;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MAX_CONNECTIONS;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_MIN_LARGE_MESSAGE_SIZE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRE_ACKNOWLEDGE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_MAX_RATE;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_RETRY_INTERVAL_MULTIPLIER;
-import static org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl.DEFAULT_PRODUCER_WINDOW_SIZE;
+import static org.jboss.messaging.core.remoting.server.impl.RemotingServiceImpl.schedulePingersOneShot;
 
 import java.util.Set;
 
@@ -48,7 +30,7 @@
 import org.jboss.messaging.core.client.ClientSessionFactory;
 import org.jboss.messaging.core.client.impl.ClientSessionFactoryImpl;
 import org.jboss.messaging.core.client.impl.ClientSessionFactoryInternal;
-import org.jboss.messaging.core.client.impl.ClientSessionInternal;
+import org.jboss.messaging.core.client.impl.ConnectionManagerImpl;
 import org.jboss.messaging.core.config.Configuration;
 import org.jboss.messaging.core.config.TransportConfiguration;
 import org.jboss.messaging.core.exception.MessagingException;
@@ -57,8 +39,8 @@
 import org.jboss.messaging.core.remoting.Interceptor;
 import org.jboss.messaging.core.remoting.Packet;
 import org.jboss.messaging.core.remoting.RemotingConnection;
-import org.jboss.messaging.core.remoting.impl.RemotingConnectionImpl;
 import org.jboss.messaging.core.remoting.impl.wireformat.PacketImpl;
+import org.jboss.messaging.core.remoting.server.impl.RemotingServiceImpl;
 import org.jboss.messaging.core.server.MessagingServer;
 import org.jboss.messaging.tests.util.ServiceTestBase;
 
@@ -129,7 +111,7 @@
 
       ClientSessionFactory csf = new ClientSessionFactoryImpl(transportConfig);
       
-      csf.setPingPeriod(PING_INTERVAL);
+      csf.setClientFailureCheckPeriod(PING_INTERVAL);
       
       ClientSession session = csf.createSession(false, true, true);
 
@@ -185,7 +167,7 @@
 
       ClientSessionFactory csf = new ClientSessionFactoryImpl(transportConfig);
       
-      csf.setPingPeriod(PING_INTERVAL);
+      csf.setClientFailureCheckPeriod(PING_INTERVAL);
 
       ClientSession session = csf.createSession(false, true, true);
 
@@ -239,9 +221,12 @@
    {
       TransportConfiguration transportConfig = new TransportConfiguration("org.jboss.messaging.integration.transports.netty.NettyConnectorFactory");
 
-      ClientSessionFactory csf = new ClientSessionFactoryImpl(transportConfig);
+      ClientSessionFactoryImpl csf = new ClientSessionFactoryImpl(transportConfig);
       
-      csf.setPingPeriod(PING_INTERVAL);
+      //We want to make sure only ping is sent
+      ConnectionManagerImpl.schedulePingersOneShot = true;
+      
+      csf.setClientFailureCheckPeriod(PING_INTERVAL);
       csf.setConnectionTTL((long)(PING_INTERVAL * 1.5));
       
       Listener clientListener = new Listener();
@@ -252,11 +237,6 @@
 
       session.addFailureListener(clientListener);
 
-      RemotingConnectionImpl conn = (RemotingConnectionImpl)((ClientSessionInternal)session).getConnection();
-
-      // We need to get it to send one ping then stop
-      conn.stopPingingAfterOne();
-
       RemotingConnection serverConn = null;
 
       while (serverConn == null)
@@ -301,12 +281,14 @@
       assertNotNull(serverListener.getException());
 
       session.close();
+      
+      ConnectionManagerImpl.schedulePingersOneShot = false;
    }
 
    /*
    * Test the client triggering failure due to no pong received in time
    */
-   public void testClientFailureNoPong() throws Exception
+   public void testClientFailureNoServerPing() throws Exception
    {
       Interceptor noPongInterceptor = new Interceptor()
       {
@@ -342,7 +324,10 @@
 
       ClientSessionFactory csf = new ClientSessionFactoryImpl(transportConfig);
       
-      csf.setPingPeriod(PING_INTERVAL);
+      //We want to make sure only one server->client ping is sent
+      RemotingServiceImpl.schedulePingersOneShot = true;
+      
+      csf.setClientFailureCheckPeriod(PING_INTERVAL);
       csf.setConnectionTTL((long)(PING_INTERVAL * 1.5));
 
       ClientSession session = csf.createSession(false, true, true);
@@ -385,6 +370,8 @@
       server.getRemotingService().removeInterceptor(noPongInterceptor);
 
       session.close();
+      
+      RemotingServiceImpl.schedulePingersOneShot = false;
    }
 
    // Package protected ---------------------------------------------

Modified: trunk/tests/src/org/jboss/messaging/tests/stress/remote/PingStressTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/stress/remote/PingStressTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/stress/remote/PingStressTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -131,7 +131,7 @@
 
       final ClientSessionFactory csf1 = new ClientSessionFactoryImpl(transportConfig);
       
-      csf1.setPingPeriod(PING_INTERVAL);
+      csf1.setClientFailureCheckPeriod(PING_INTERVAL);
       csf1.setConnectionTTL((long)(PING_INTERVAL * 1.5));
       csf1.setCallTimeout(PING_INTERVAL * 10);
       
@@ -162,7 +162,7 @@
 
                final ClientSessionFactory csf2 = new ClientSessionFactoryImpl(transportConfig);
                
-               csf2.setPingPeriod(PING_INTERVAL);
+               csf2.setClientFailureCheckPeriod(PING_INTERVAL);
                csf2.setConnectionTTL((long)(PING_INTERVAL * 1.5));
                csf2.setCallTimeout(PING_INTERVAL * 10);
 

Deleted: trunk/tests/src/org/jboss/messaging/tests/timing/core/remoting/impl/RemotingConnectionImplTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/timing/core/remoting/impl/RemotingConnectionImplTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/timing/core/remoting/impl/RemotingConnectionImplTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,431 +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.core.logging.Logger;
-import org.jboss.messaging.tests.util.UnitTestCase;
-
-/**
- * 
- * A RemotingConnectionImplTest
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class RemotingConnectionImplTest extends UnitTestCase
-{
-   private static final Logger log = Logger.getLogger(RemotingConnectionImplTest.class);
-
-   public void testDummy()
-   {      
-   }
-   
-//   public void testPingPongOK() throws Exception
-//   {     
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//      ScheduledExecutorService ex = new ScheduledThreadPoolExecutor(1);
-//      
-//      final long id = 128712;
-//      EasyMock.expect(dispatcher.generateID()).andReturn(id);
-//      
-//      class Answer implements IAnswer<Object>
-//      {
-//         private volatile PacketHandler handler;
-//
-//         public PacketHandler getHandler()
-//         {
-//            return handler;
-//         }
-//         public Object answer() throws Throwable
-//         {
-//            handler = (PacketHandler) getCurrentArguments()[0];            
-//            return null;
-//         }
-//      }
-//      
-//      final Answer answer = new Answer();
-//      
-//      dispatcher.register(EasyMock.isA(PacketHandler.class));
-//      EasyMock.expectLastCall().andAnswer(answer);
-//      
-//      MessagingBuffer buff = new ByteBufferWrapper(ByteBuffer.allocate(1024));
-//      EasyMock.expect(connection.createBuffer(PacketImpl.INITIAL_BUFFER_SIZE)).andStubReturn(buff);
-//           
-//      final AtomicInteger pongs = new AtomicInteger(0);
-//      
-//      final Executor queuedEx = Executors.newSingleThreadExecutor();
-//      
-//      connection.write(buff);
-//      EasyMock.expectLastCall().andStubAnswer(
-//            new IAnswer<Object>()
-//            {
-//               public Object answer() throws Throwable
-//               {
-//                  //Send pong back on different thread
-//                  queuedEx.execute(new Runnable()
-//                  {
-//                     public void run()
-//                     {
-//                        Packet pong = new PacketImpl(PacketImpl.PONG);     
-//                        answer.getHandler().handle(1243, pong);
-//                        pongs.incrementAndGet();
-//                     }
-//                  });
-//                  
-//                  return null;
-//               }
-//            });
-//
-//      final long pingPeriod = 100;
-//      
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000L, pingPeriod, ex);
-//            
-//      class Listener implements FailureListener
-//      {
-//         volatile MessagingException me;
-//         public void connectionFailed(MessagingException me)
-//         {
-//            this.me = me;
-//         }
-//      }
-//      
-//      Listener listener = new Listener();
-//      
-//      rc.addFailureListener(listener);
-//      
-//      Thread.sleep((long)(10 * pingPeriod + 1.5 * pingPeriod));
-//      
-//      EasyMock.verify(connection, dispatcher);
-//      
-//      assertTrue(pongs.get() >= 10);
-//      
-//      assertNull(listener.me);
-//      
-//   }
-//   
-//   public void testPingNoPong() throws Exception
-//   {     
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//      ScheduledExecutorService ex = new ScheduledThreadPoolExecutor(1);
-//      
-//      final long id = 128712;
-//      EasyMock.expect(dispatcher.generateID()).andReturn(id);
-//      
-//      dispatcher.register(EasyMock.isA(PacketHandler.class));
-//      
-//      MessagingBuffer buff = new ByteBufferWrapper(ByteBuffer.allocate(1024));
-//      EasyMock.expect(connection.createBuffer(PacketImpl.INITIAL_BUFFER_SIZE)).andStubReturn(buff);
-//                 
-//      connection.write(buff);
-//      EasyMock.expectLastCall().anyTimes();
-//      
-//      dispatcher.unregister(id);
-//      
-//      connection.close();
-//
-//      final long pingPeriod = 100;
-//      
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000L, pingPeriod, ex);
-//            
-//      class Listener implements FailureListener
-//      {
-//         volatile MessagingException me;
-//         public void connectionFailed(MessagingException me)
-//         {
-//            this.me = me;
-//         }
-//      }
-//      
-//      Listener listener = new Listener();
-//      
-//      rc.addFailureListener(listener);
-//      
-//      Thread.sleep((long)(2.5 * pingPeriod));
-//      
-//      EasyMock.verify(connection, dispatcher);
-//            
-//      assertNotNull(listener.me);
-//      
-//   }
-//   
-//   
-//   public void testPingLatePong() throws Exception
-//   {     
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//      ScheduledExecutorService ex = new ScheduledThreadPoolExecutor(1);
-//      
-//      final long id = 128712;
-//      EasyMock.expect(dispatcher.generateID()).andReturn(id);
-//      
-//      class Answer implements IAnswer<Object>
-//      {
-//         private volatile PacketHandler handler;
-//
-//         public PacketHandler getHandler()
-//         {
-//            return handler;
-//         }
-//         public Object answer() throws Throwable
-//         {
-//            handler = (PacketHandler) getCurrentArguments()[0];            
-//            return null;
-//         }
-//      }
-//      
-//      final Answer answer = new Answer();
-//      
-//      dispatcher.register(EasyMock.isA(PacketHandler.class));
-//      EasyMock.expectLastCall().andAnswer(answer);
-//      
-//      MessagingBuffer buff = new ByteBufferWrapper(ByteBuffer.allocate(1024));
-//      EasyMock.expect(connection.createBuffer(PacketImpl.INITIAL_BUFFER_SIZE)).andStubReturn(buff);
-//           
-//      final Executor queuedEx = Executors.newSingleThreadExecutor();
-//      
-//      final long pingPeriod = 100;      
-//      
-//      connection.write(buff);
-//      EasyMock.expectLastCall().andStubAnswer(
-//            new IAnswer<Object>()
-//            {
-//               public Object answer() throws Throwable
-//               {
-//                  //Send pong back on different thread
-//                  queuedEx.execute(new Runnable()
-//                  {
-//                     public void run()
-//                     {
-//                        try
-//                        {
-//                           Thread.sleep((long)(1.5 * pingPeriod));
-//                        }
-//                        catch (Exception e)
-//                        {                           
-//                        }
-//                        Packet pong = new PacketImpl(PacketImpl.PONG);     
-//                        answer.getHandler().handle(1243, pong);                     
-//                     }
-//                  });
-//                  
-//                  return null;
-//               }
-//            });
-//
-//      
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000L, pingPeriod, ex);
-//            
-//      class Listener implements FailureListener
-//      {
-//         volatile MessagingException me;
-//         public void connectionFailed(MessagingException me)
-//         {
-//            this.me = me;
-//         }
-//      }
-//      
-//      Listener listener = new Listener();
-//      
-//      rc.addFailureListener(listener);
-//      
-//      Thread.sleep(3 * pingPeriod);
-//      
-//      EasyMock.verify(connection, dispatcher);
-//      
-//      assertNull(listener.me);
-//      
-//   }
-//   
-//   public void testSendBlockingNoResponse() throws Exception
-//   {     
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//
-//      final long id = 128712;
-//      EasyMock.expect(dispatcher.generateID()).andReturn(id);
-//      
-//      dispatcher.register(EasyMock.isA(PacketHandler.class));
-//      
-//      MessagingBuffer buff = new ByteBufferWrapper(ByteBuffer.allocate(1024));
-//      EasyMock.expect(connection.createBuffer(PacketImpl.INITIAL_BUFFER_SIZE)).andStubReturn(buff);
-//             
-//      connection.write(buff);
-//      
-//      connection.close();
-//          
-//      dispatcher.unregister(id);
-//
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      final long callTimeout = 100;
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, callTimeout);
-//            
-//      class Listener implements FailureListener
-//      {
-//         volatile MessagingException me;
-//         public void connectionFailed(MessagingException me)
-//         {
-//            this.me = me;
-//         }
-//      }
-//      
-//      Listener listener = new Listener();
-//      
-//      rc.addFailureListener(listener);
-//      
-//      Packet request = new PacketImpl(PacketImpl.CREATESESSION);
-//      
-//      long start = System.currentTimeMillis();
-//      try
-//      {
-//         rc.sendBlocking(request, null);
-//         fail("Should throw exception");
-//      }
-//      catch (MessagingException me)
-//      {
-//         assertEquals(MessagingException.CONNECTION_TIMEDOUT, me.getCode());
-//      }
-//      long end = System.currentTimeMillis();
-//      
-//      assertTrue((end - start) >= callTimeout && (end - start) <= 1.5 * callTimeout);
-//                              
-//      EasyMock.verify(connection, dispatcher);
-//                  
-//      assertNotNull(listener.me);  
-//      
-//      assertEquals(MessagingException.CONNECTION_TIMEDOUT, listener.me.getCode());
-//   }
-//   
-//   
-//   public void testSendBlockingLateResponse() throws Exception
-//   {     
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//
-//      final long id = 128712;
-//      EasyMock.expect(dispatcher.generateID()).andReturn(id);
-//      
-//      class Answer implements IAnswer<Object>
-//      {
-//         private volatile PacketHandler handler;
-//
-//         public PacketHandler getHandler()
-//         {
-//            return handler;
-//         }
-//         public Object answer() throws Throwable
-//         {
-//            handler = (PacketHandler) getCurrentArguments()[0];            
-//            return null;
-//         }
-//      }
-//      
-//      final Answer answer = new Answer();
-//      
-//      dispatcher.register(EasyMock.isA(PacketHandler.class));
-//      EasyMock.expectLastCall().andAnswer(answer);
-//      
-//      MessagingBuffer buff = new ByteBufferWrapper(ByteBuffer.allocate(1024));
-//      EasyMock.expect(connection.createBuffer(PacketImpl.INITIAL_BUFFER_SIZE)).andStubReturn(buff);
-//           
-//      final Executor queuedEx = Executors.newSingleThreadExecutor();
-//      
-//      final long callTimeout = 100;
-//      
-//      connection.write(buff);
-//      EasyMock.expectLastCall().andStubAnswer(
-//            new IAnswer<Object>()
-//            {
-//               public Object answer() throws Throwable
-//               {
-//                  //Send pong back on different thread
-//                  queuedEx.execute(new Runnable()
-//                  {
-//                     public void run()
-//                     {
-//                        try
-//                        {
-//                           Thread.sleep((long)(1.5 * callTimeout));
-//                        }
-//                        catch (Exception e)
-//                        {                           
-//                        }
-//                        Packet returned = new PacketImpl(PacketImpl.NULL);     
-//                        answer.getHandler().handle(1243, returned);
-//                     }
-//                  });
-//                  
-//                  return null;
-//               }
-//            });
-//      
-//      connection.close();
-//      
-//      dispatcher.unregister(id);
-//
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, callTimeout);
-//            
-//      class Listener implements FailureListener
-//      {
-//         volatile MessagingException me;
-//         public void connectionFailed(MessagingException me)
-//         {
-//            this.me = me;
-//         }
-//      }
-//      
-//      Listener listener = new Listener();
-//      
-//      rc.addFailureListener(listener);
-//      
-//      Packet request = new PacketImpl(PacketImpl.CREATESESSION);
-//      
-//      try
-//      {
-//         rc.sendBlocking(request, null);
-//         fail("Should throw exception");      
-//      }
-//      catch (MessagingException me)
-//      {
-//         assertEquals(MessagingException.CONNECTION_TIMEDOUT, me.getCode());
-//      }
-//                             
-//      EasyMock.verify(connection, dispatcher);
-//                  
-//      assertNotNull(listener.me);
-//      
-//      assertEquals(MessagingException.CONNECTION_TIMEDOUT, listener.me.getCode());
-//      
-//   }
-  
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/fakes/FakeCallback.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/fakes/FakeCallback.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/journal/impl/fakes/FakeCallback.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,70 +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.unit.core.journal.impl.fakes;
-
-import java.util.concurrent.CountDownLatch;
-
-import org.jboss.messaging.core.journal.IOCallback;
-
-/**
- * 
- * @author <a href="mailto:clebert.suconic at jboss.com">Clebert Suconic</a>
- *
- */
-public class FakeCallback implements IOCallback
-{
-   volatile String msg;
-
-   final CountDownLatch latch;
-
-   public FakeCallback(final CountDownLatch latch)
-   {
-      this.latch = latch;
-   }
-
-   public FakeCallback()
-   {
-      latch = new CountDownLatch(1);
-   }
-
-   public void done()
-   {
-      latch.countDown();
-   }
-
-   public void onError(final int errorCode, final String errorMessage)
-   {
-      latch.countDown();
-      msg = errorMessage;
-   }
-
-   public void waitComplete() throws Exception
-   {
-      latch.await();
-   }
-
-   public void waitCompletion() throws Exception
-   {
-   }
-
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/management/RoleInfoTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/management/RoleInfoTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/management/RoleInfoTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,98 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.unit.core.management;
-
-import org.jboss.messaging.tests.util.UnitTestCase;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- * 
- * @version <tt>$Revision$</tt>
- * 
- */
-public class RoleInfoTest extends UnitTestCase
-{
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   /*private static void assertEquals(RoleInfo expected, CompositeData actual)
-   {
-      assertTrue(actual.getCompositeType().equals(RoleInfo.TYPE));
-
-      assertEquals(expected.getName(), actual.get("name"));
-      assertEquals(expected.isCreate(), actual.get("create"));
-      assertEquals(expected.isRead(), actual.get("read"));
-      assertEquals(expected.isWrite(), actual.get("write"));
-   }
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-   **/
-   public void testToCompositeData() throws Exception
-   {
-     /* String name = randomString();
-      boolean create = randomBoolean();
-      boolean read = randomBoolean();
-      boolean write = randomBoolean();
-
-      RoleInfo info = new RoleInfo(name, create, read, write, deleteDurableQueue, createTempQueue, deleteTempQueue);
-      CompositeData data = info.toCompositeData();
-
-      assertEquals(info, data);*/
-   }
-   /**
-   public void testToTabularData() throws Exception
-   {
-      RoleInfo info_1 = new RoleInfo(randomString(), randomBoolean(),
-            randomBoolean(), randomBoolean(), deleteDurableQueue, createTempQueue, deleteTempQueue);
-      RoleInfo info_2 = new RoleInfo(randomString(), randomBoolean(),
-            randomBoolean(), randomBoolean(), deleteDurableQueue, createTempQueue, deleteTempQueue);
-      RoleInfo[] roles = new RoleInfo[] { info_1, info_2 };
-
-      TabularData data = RoleInfo.toTabularData(roles);
-      assertEquals(2, data.size());
-      CompositeData data_1 = data.get(new String[] { info_1.getName() });
-      CompositeData data_2 = data.get(new String[] { info_2.getName() });
-
-      assertEquals(info_1, data_1);
-      assertEquals(info_2, data_2);
-   }
-
-   public void testToTabularDataWithEmptyRoles() throws Exception
-   {
-      TabularData data = RoleInfo.toTabularData(new RoleInfo[0]);
-      assertEquals(0, data.size());
-   }*/
-
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory1.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory1.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory1.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,73 +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.unit.core.remoting.impl;
-
-import java.util.Map;
-import java.util.concurrent.Executor;
-
-import org.jboss.messaging.core.remoting.spi.Acceptor;
-import org.jboss.messaging.core.remoting.spi.AcceptorFactory;
-import org.jboss.messaging.core.remoting.spi.BufferHandler;
-import org.jboss.messaging.core.remoting.spi.ConnectionLifeCycleListener;
-
-/**
- * 
- * A AcceptorFactory1
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class AcceptorFactory1 implements AcceptorFactory
-{
-
-   public Acceptor createAcceptor(Map<String, Object> params,
-         BufferHandler handler, ConnectionLifeCycleListener listener, Executor threadPool)
-   {
-      return new Acceptor1();
-   }
-
-   public class Acceptor1 implements Acceptor
-   {
-
-      public void start() throws Exception
-      {
-      }
-
-      public void stop()
-      {  
-      }
-      
-      public void pause()
-      {         
-      }    
-      
-      public void resume()
-      {         
-      }
-      
-      public boolean isStarted()
-      {
-         return false;
-      }      
-   }
-   
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory2.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory2.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory2.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,75 +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.unit.core.remoting.impl;
-
-import java.util.Map;
-import java.util.concurrent.Executor;
-
-import org.jboss.messaging.core.remoting.spi.Acceptor;
-import org.jboss.messaging.core.remoting.spi.AcceptorFactory;
-import org.jboss.messaging.core.remoting.spi.BufferHandler;
-import org.jboss.messaging.core.remoting.spi.ConnectionLifeCycleListener;
-
-/**
- * 
- * A AcceptorFactory2
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class AcceptorFactory2 implements AcceptorFactory
-{
-
-   public Acceptor createAcceptor(Map<String, Object> params,
-         BufferHandler handler, ConnectionLifeCycleListener listener, Executor threadPool)
-   {
-      return new Acceptor2();
-   }
-
-   public class Acceptor2 implements Acceptor
-   {
-
-      public void start() throws Exception
-      {
-      }
-
-      public void stop()
-      {  
-      }
-      
-      public void pause()
-      {         
-      }   
-      
-      public void resume()
-      {         
-      }
-      
-      public boolean isStarted()
-      {
-         return false;
-      }
-
-   }
-   
-}
-

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory3.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory3.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/AcceptorFactory3.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,75 +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.unit.core.remoting.impl;
-
-import java.util.Map;
-import java.util.concurrent.Executor;
-
-import org.jboss.messaging.core.remoting.spi.Acceptor;
-import org.jboss.messaging.core.remoting.spi.AcceptorFactory;
-import org.jboss.messaging.core.remoting.spi.BufferHandler;
-import org.jboss.messaging.core.remoting.spi.ConnectionLifeCycleListener;
-
-/**
- * 
- * A AcceptorFactory3
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class AcceptorFactory3 implements AcceptorFactory
-{
-
-   public Acceptor createAcceptor(Map<String, Object> params,
-         BufferHandler handler, ConnectionLifeCycleListener listener, Executor threadPool)
-   {
-      return new Acceptor3();
-   }
-
-   public class Acceptor3 implements Acceptor
-   {
-
-      public void start() throws Exception
-      {
-      }
-
-      public void stop()
-      {  
-      }
-      
-      public void pause()
-      {         
-      }   
-      
-      public void resume()
-      {         
-      }
-      
-      public boolean isStarted()
-      {
-         return false;
-      }
-
-   }
-   
-}
-

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor1.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor1.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor1.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,42 +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.unit.core.remoting.impl;
-
-import org.jboss.messaging.core.exception.MessagingException;
-import org.jboss.messaging.core.remoting.Interceptor;
-import org.jboss.messaging.core.remoting.Packet;
-import org.jboss.messaging.core.remoting.RemotingConnection;
-
-/**
- * 
- * A Interceptor1
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class Interceptor1 implements Interceptor
-{
-   public boolean intercept(Packet packet, RemotingConnection conn) throws MessagingException
-   {
-      return false;
-   }
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor2.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor2.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor2.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,42 +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.unit.core.remoting.impl;
-
-import org.jboss.messaging.core.exception.MessagingException;
-import org.jboss.messaging.core.remoting.Interceptor;
-import org.jboss.messaging.core.remoting.Packet;
-import org.jboss.messaging.core.remoting.RemotingConnection;
-
-/**
- * 
- * A Interceptor2
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class Interceptor2 implements Interceptor
-{
-   public boolean intercept(Packet packet, RemotingConnection conn) throws MessagingException
-   {
-      return false;
-   }
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor3.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor3.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/Interceptor3.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,42 +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.unit.core.remoting.impl;
-
-import org.jboss.messaging.core.exception.MessagingException;
-import org.jboss.messaging.core.remoting.Interceptor;
-import org.jboss.messaging.core.remoting.Packet;
-import org.jboss.messaging.core.remoting.RemotingConnection;
-
-/**
- * 
- * A Interceptor3
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class Interceptor3 implements Interceptor
-{
-   public boolean intercept(Packet packet, RemotingConnection conn) throws MessagingException
-   {
-      return false;
-   }
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/RemotingConnectionImplTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/RemotingConnectionImplTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/RemotingConnectionImplTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,485 +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.unit.core.remoting.impl;
-
-import org.jboss.messaging.tests.util.UnitTestCase;
-
-/**
- * 
- * A RemotingConnectionImplTest
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class RemotingConnectionImplTest extends UnitTestCase
-{
-   public void testDummy()
-   {
-      
-   }
-//   public void testGetID() throws Exception
-//   {
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//   
-//      final long id = 12123;
-//      EasyMock.expect(connection.getID()).andReturn(id);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000);
-//      
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      assertEquals(id, rc.getID());
-//      
-//      EasyMock.verify(connection, dispatcher);     
-//   }
-//   
-//   public void testSendOneWay1() throws Exception
-//   {
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);   
-//      Packet packet = EasyMock.createStrictMock(Packet.class);
-//      
-//      final long targetID = 12908783;
-//      final long executorID = 36464;
-//      packet.setTargetID(targetID);
-//      packet.setExecutorID(executorID);
-//      
-//      MessagingBuffer buff = EasyMock.createMock(MessagingBuffer.class);
-//      
-//      EasyMock.expect(connection.createBuffer(PacketImpl.INITIAL_BUFFER_SIZE)).andReturn(buff);
-//      
-//      packet.encode(buff);
-//      
-//      connection.write(buff);
-//            
-//      EasyMock.replay(connection, dispatcher, packet, buff);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000);
-//      
-//      rc.sendOneWay(targetID, executorID, packet);
-//      
-//      EasyMock.verify(connection, dispatcher, packet, buff);     
-//   }
-//   
-//   public void testSendOneWay2() throws Exception
-//   {
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);    
-//      Packet packet = EasyMock.createStrictMock(Packet.class);
-//            
-//      MessagingBuffer buff = EasyMock.createMock(MessagingBuffer.class);
-//      
-//      EasyMock.expect(connection.createBuffer(PacketImpl.INITIAL_BUFFER_SIZE)).andReturn(buff);
-//      
-//      packet.encode(buff);
-//      
-//      connection.write(buff);
-//            
-//      EasyMock.replay(connection, dispatcher, packet, buff);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000);
-//      
-//      rc.sendOneWay(packet);
-//      
-//      EasyMock.verify(connection, dispatcher, packet, buff);     
-//   }
-//   
-//   public void testFailureListeners() throws Exception
-//   {
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//            
-//      connection.close();
-//      
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000);
-//      
-//      class Listener implements FailureListener
-//      {
-//         volatile MessagingException me;
-//         public void connectionFailed(MessagingException me)
-//         {
-//            this.me = me;
-//         }
-//      }
-//      
-//      Listener listener1 = new Listener();
-//      Listener listener2 = new Listener();
-//      Listener listener3 = new Listener();
-//      
-//      rc.addFailureListener(listener1);
-//      rc.addFailureListener(listener2);
-//      rc.addFailureListener(listener3);
-//      
-//      MessagingException me = new MessagingException(123213, "bjasajs");
-//      
-//      rc.fail(me);
-//      
-//      assertTrue(listener1.me == me);
-//      assertTrue(listener2.me == me);
-//      assertTrue(listener3.me == me);
-//      
-//      rc.removeFailureListener(listener2);
-//      
-//      MessagingException me2 = new MessagingException(2828, "uhuhuihuh");
-//      
-//      rc.fail(me2);
-//      
-//      assertTrue(listener1.me == me2);
-//      assertFalse(listener2.me == me2);
-//      assertTrue(listener3.me == me2);
-//                        
-//      EasyMock.verify(connection, dispatcher);  
-//      
-//      rc.removeFailureListener(listener1);
-//      rc.removeFailureListener(listener3);
-//      
-//      MessagingException me3 = new MessagingException(239565, "uhuhuihsdfsdfuh");
-//      
-//      rc.fail(me3);
-//      
-//      assertFalse(listener1.me == me3);
-//      assertFalse(listener2.me == me3);
-//      assertFalse(listener3.me == me3);
-//      
-//   }
-//   
-//   /*
-//    * Throwing exception from inside listener shouldn't prevent others from being run
-//    */
-//   public void testThrowExceptionFromFailureListener() throws Exception
-//   {
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//        
-//      connection.close();
-//      
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000);
-//      
-//      class Listener implements FailureListener
-//      {
-//         volatile MessagingException me;
-//         public void connectionFailed(MessagingException me)
-//         {
-//            this.me = me;
-//            throw new RuntimeException();
-//         }
-//      }
-//      
-//      Listener listener1 = new Listener();
-//      Listener listener2 = new Listener();
-//      Listener listener3 = new Listener();
-//      
-//      rc.addFailureListener(listener1);
-//      rc.addFailureListener(listener2);
-//      rc.addFailureListener(listener3);
-//      
-//      MessagingException me = new MessagingException(123213, "bjasajs");
-//      
-//      rc.fail(me);
-//      
-//      assertTrue(listener1.me == me);
-//      assertTrue(listener2.me == me);
-//      assertTrue(listener3.me == me);  
-//   }
-//   
-//   public void testCreateBuffer() throws Exception
-//   {
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//
-//      MessagingBuffer buff = EasyMock.createMock(MessagingBuffer.class);
-//      
-//      final int size = 1234;
-//            
-//      EasyMock.expect(connection.createBuffer(size)).andReturn(buff);
-//      
-//      EasyMock.replay(connection, dispatcher, buff);      
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000);
-//      
-//      MessagingBuffer buff2 = rc.createBuffer(size);
-//      
-//      assertTrue(buff == buff2);       
-//   }
-//   
-//   public void testGetPacketDispatcher() throws Exception
-//   {
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000);
-//      
-//      assertTrue(dispatcher == rc.getPacketDispatcher());       
-//   }
-//   
-//   public void testDestroy() throws Exception
-//   {
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//      
-//      connection.close();
-//      
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000);
-//      
-//      rc.destroy();
-//      
-//      EasyMock.verify(connection, dispatcher);
-//      
-//      EasyMock.reset(connection, dispatcher);
-//      
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      rc.destroy();
-//      
-//      EasyMock.verify(connection, dispatcher);
-//   }
-//   
-//   public void testCreateAndDestroyWithPinger() throws Exception
-//   {
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);      
-//      ScheduledExecutorService ex = EasyMock.createStrictMock(ScheduledExecutorService.class);
-//      
-//      final long id = 128712;
-//      EasyMock.expect(dispatcher.generateID()).andReturn(id);
-//      
-//      dispatcher.register(EasyMock.isA(PacketHandler.class));
-//      
-//      final long pingPeriod = 1234;
-//      
-//      ScheduledFuture future = EasyMock.createStrictMock(ScheduledFuture.class);
-//      
-//      EasyMock.expect(ex.scheduleWithFixedDelay(EasyMock.isA(Runnable.class), EasyMock.eq(pingPeriod), EasyMock.eq(pingPeriod),
-//            EasyMock.eq(TimeUnit.MILLISECONDS))).andReturn(future);
-//      
-//      EasyMock.expect(future.cancel(false)).andReturn(true);
-//      
-//      dispatcher.unregister(id);
-//      
-//      connection.close();
-//      
-//      EasyMock.replay(connection, dispatcher, ex);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, pingPeriod, pingPeriod, ex);
-//      
-//      rc.destroy();
-//      
-//      EasyMock.verify(connection, dispatcher, ex);
-//      
-//      EasyMock.reset(connection, dispatcher, ex);
-//      
-//      EasyMock.replay(connection, dispatcher, ex);
-//      
-//      rc.destroy();
-//      
-//      EasyMock.verify(connection, dispatcher, ex);
-//   }
-//   
-//   public void testSendBlockingOK1() throws Exception
-//   {     
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-//
-//      final long id = 128712;
-//      EasyMock.expect(dispatcher.generateID()).andReturn(id);
-//      
-//      class Answer implements IAnswer<Object>
-//      {
-//         private volatile PacketHandler handler;
-//
-//         public PacketHandler getHandler()
-//         {
-//            return handler;
-//         }
-//         public Object answer() throws Throwable
-//         {
-//            handler = (PacketHandler) getCurrentArguments()[0];            
-//            return null;
-//         }
-//      }
-//      
-//      final Answer answer = new Answer();
-//      
-//      dispatcher.register(EasyMock.isA(PacketHandler.class));
-//      EasyMock.expectLastCall().andAnswer(answer);
-//      
-//      MessagingBuffer buff = new ByteBufferWrapper(ByteBuffer.allocate(1024));
-//      EasyMock.expect(connection.createBuffer(PacketImpl.INITIAL_BUFFER_SIZE)).andStubReturn(buff);
-//           
-//      final Executor queuedEx = Executors.newSingleThreadExecutor();
-//      
-//      connection.write(buff);
-//      EasyMock.expectLastCall().andStubAnswer(
-//            new IAnswer<Object>()
-//            {
-//               public Object answer() throws Throwable
-//               {
-//                  //Send pong back on different thread
-//                  queuedEx.execute(new Runnable()
-//                  {
-//                     public void run()
-//                     {
-//                        Packet returned = new PacketImpl(PacketImpl.NULL);     
-//                        answer.getHandler().handle(1243, returned);
-//                     }
-//                  });
-//                  
-//                  return null;
-//               }
-//            });
-//      
-//      dispatcher.unregister(id);
-//
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000L);
-//            
-//      class Listener implements FailureListener
-//      {
-//         volatile MessagingException me;
-//         public void connectionFailed(MessagingException me)
-//         {
-//            this.me = me;
-//         }
-//      }
-//      
-//      Listener listener = new Listener();
-//      
-//      rc.addFailureListener(listener);
-//      
-//      Packet request = new PacketImpl(PacketImpl.CREATESESSION);
-//      
-//      Packet response = rc.sendBlocking(request, null);
-//      
-//      assertNotNull(response);
-//      
-//      assertEquals(PacketImpl.NULL, response.getType());
-//                  
-//      EasyMock.verify(connection, dispatcher);
-//                  
-//      assertNull(listener.me);
-//      
-//   }
-//   
-//   public void testSendBlockingOK2() throws Exception
-//   {     
-//      Connection connection = EasyMock.createStrictMock(Connection.class);
-//      PacketDispatcher dispatcher = EasyMock.createStrictMock(PacketDispatcher.class);
-// 
-//      final long id = 128712;
-//      EasyMock.expect(dispatcher.generateID()).andReturn(id);
-//      
-//      class Answer implements IAnswer<Object>
-//      {
-//         private volatile PacketHandler handler;
-//
-//         public PacketHandler getHandler()
-//         {
-//            return handler;
-//         }
-//         public Object answer() throws Throwable
-//         {
-//            handler = (PacketHandler) getCurrentArguments()[0];            
-//            return null;
-//         }
-//      }
-//      
-//      final Answer answer = new Answer();
-//      
-//      dispatcher.register(EasyMock.isA(PacketHandler.class));
-//      EasyMock.expectLastCall().andAnswer(answer);
-//      
-//      MessagingBuffer buff = new ByteBufferWrapper(ByteBuffer.allocate(1024));
-//      EasyMock.expect(connection.createBuffer(PacketImpl.INITIAL_BUFFER_SIZE)).andStubReturn(buff);
-//           
-//      final Executor queuedEx = Executors.newSingleThreadExecutor();
-//      
-//      Packet packet = EasyMock.createStrictMock(Packet.class);
-//      
-//      final long targetID = 139848;
-//      final long executorID = 3747;
-//      packet.setTargetID(targetID);
-//      packet.setExecutorID(executorID);
-//      
-//      connection.write(buff);
-//      EasyMock.expectLastCall().andStubAnswer(
-//            new IAnswer<Object>()
-//            {
-//               public Object answer() throws Throwable
-//               {
-//                  //Send pong back on different thread
-//                  queuedEx.execute(new Runnable()
-//                  {
-//                     public void run()
-//                     {
-//                        Packet returned = new PacketImpl(PacketImpl.NULL);     
-//                        answer.getHandler().handle(1243, returned);
-//                     }
-//                  });
-//                  
-//                  return null;
-//               }
-//            });
-//      
-//      dispatcher.unregister(id);
-//
-//      EasyMock.replay(connection, dispatcher);
-//      
-//      RemotingConnection rc = new RemotingConnectionImpl(connection, dispatcher, 1000L);
-//            
-//      class Listener implements FailureListener
-//      {
-//         volatile MessagingException me;
-//         public void connectionFailed(MessagingException me)
-//         {
-//            this.me = me;
-//         }
-//      }
-//      
-//      Listener listener = new Listener();
-//      
-//      rc.addFailureListener(listener);
-//      
-//      Packet request = new PacketImpl(PacketImpl.CREATESESSION);
-//      
-//      Packet response = rc.sendBlocking(targetID, executorID, request, null);
-//      
-//      assertNotNull(response);
-//      
-//      assertEquals(PacketImpl.NULL, response.getType());
-//                  
-//      EasyMock.verify(connection, dispatcher);
-//                  
-//      assertNull(listener.me);
-//      
-//   }
-   
-   
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/RemotingServiceImplTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/RemotingServiceImplTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/RemotingServiceImplTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,332 +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.unit.core.remoting.impl;
-
-import org.jboss.messaging.tests.util.UnitTestCase;
-
-/**
- * @author <a href="ataylor at redhat.com">Andy Taylor</a>
- * @author <a href="tim.fox at jboss.com">Tim Fox</a>
- */
-public class RemotingServiceImplTest extends UnitTestCase
-{
-   public void testDummy()
-   {
-      
-   }
-   
-//   public void testSingleAcceptorStarted() throws Exception
-//   {
-//      final Acceptor acceptor = EasyMock.createStrictMock(Acceptor.class);
-//      ConfigurationImpl config = new ConfigurationImpl();      
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory1"));
-//      TestAcceptorFactory1.acceptor = acceptor;
-//      RemotingServiceImpl remotingService = new RemotingServiceImpl(config);
-//                  
-//      acceptor.start();
-//      EasyMock.replay(acceptor);
-//      remotingService.start();
-//      EasyMock.verify(acceptor);
-//      assertEquals(1, remotingService.getAcceptors().size());      
-//      assertTrue(remotingService.getAcceptors().contains(acceptor));   
-//      assertTrue(remotingService.isStarted());
-//   }
-//
-//   public void testSingleAcceptorStartedTwiceIsIgnored() throws Exception
-//   {
-//      final Acceptor acceptor = EasyMock.createStrictMock(Acceptor.class);
-//      ConfigurationImpl config = new ConfigurationImpl();
-//      RemotingServiceImpl remotingService = new RemotingServiceImpl(config);
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory1"));
-//      TestAcceptorFactory1.acceptor = acceptor;
-//      acceptor.start();
-//      EasyMock.replay(acceptor);
-//      remotingService.start();
-//      remotingService.start();
-//      EasyMock.verify(acceptor);
-//      assertEquals(1, remotingService.getAcceptors().size());      
-//      assertTrue(remotingService.getAcceptors().contains(acceptor));
-//      assertTrue(remotingService.isStarted());
-//   }
-//
-//   public void testSingleAcceptorStartedAndStopped() throws Exception
-//   {
-//      final Acceptor acceptor = EasyMock.createStrictMock(Acceptor.class);
-//      ConfigurationImpl config = new ConfigurationImpl();
-//      RemotingServiceImpl remotingService = new RemotingServiceImpl(config);
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory1"));
-//      TestAcceptorFactory1.acceptor = acceptor;
-//      acceptor.start();
-//      acceptor.stop();
-//      EasyMock.replay(acceptor);
-//      remotingService.start();
-//      remotingService.stop();
-//      EasyMock.verify(acceptor);
-//      assertEquals(1, remotingService.getAcceptors().size());      
-//      assertTrue(remotingService.getAcceptors().contains(acceptor)); 
-//      assertFalse(remotingService.isStarted());
-//   }
-//
-//   public void testMultipleAcceptorsStarted() throws Exception
-//   {
-//      final Acceptor acceptor1 = EasyMock.createStrictMock(Acceptor.class);
-//      final Acceptor acceptor2 = EasyMock.createStrictMock(Acceptor.class);
-//      final Acceptor acceptor3 = EasyMock.createStrictMock(Acceptor.class);
-//      ConfigurationImpl config = new ConfigurationImpl();
-//      RemotingServiceImpl remotingService = new RemotingServiceImpl(config);
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory1"));
-//      TestAcceptorFactory1.acceptor = acceptor1;
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory2"));
-//      TestAcceptorFactory2.acceptor = acceptor2;
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory3"));
-//      TestAcceptorFactory3.acceptor = acceptor3;
-//            
-//      acceptor1.start();
-//      acceptor2.start();
-//      acceptor3.start();
-//      EasyMock.replay(acceptor1, acceptor2, acceptor3);
-//      remotingService.start();
-//      EasyMock.verify(acceptor1, acceptor2, acceptor3);
-//      assertEquals(3, remotingService.getAcceptors().size());   
-//      assertTrue(remotingService.getAcceptors().contains(acceptor1));
-//      assertTrue(remotingService.getAcceptors().contains(acceptor2));
-//      assertTrue(remotingService.getAcceptors().contains(acceptor3));
-//      assertTrue(remotingService.isStarted());
-//   }
-//
-//   public void testMultipleAcceptorsStartedAndStopped() throws Exception
-//   {
-//      final Acceptor acceptor1 = EasyMock.createStrictMock(Acceptor.class);
-//      final Acceptor acceptor2 = EasyMock.createStrictMock(Acceptor.class);
-//      final Acceptor acceptor3 = EasyMock.createStrictMock(Acceptor.class);
-//      ConfigurationImpl config = new ConfigurationImpl();
-//      RemotingServiceImpl remotingService = new RemotingServiceImpl(config);
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory1"));
-//      TestAcceptorFactory1.acceptor = acceptor1;
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory2"));
-//      TestAcceptorFactory2.acceptor = acceptor2;
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory3"));
-//      TestAcceptorFactory3.acceptor = acceptor3;
-//      acceptor1.start();
-//      acceptor2.start();
-//      acceptor3.start();
-//      acceptor1.stop();
-//      acceptor2.stop();
-//      acceptor3.stop();
-//      EasyMock.replay(acceptor1, acceptor2, acceptor3);
-//      remotingService.start();
-//      remotingService.stop();
-//      EasyMock.verify(acceptor1, acceptor2, acceptor3);
-//      assertEquals(3, remotingService.getAcceptors().size());   
-//      assertTrue(remotingService.getAcceptors().contains(acceptor1));
-//      assertTrue(remotingService.getAcceptors().contains(acceptor2));
-//      assertTrue(remotingService.getAcceptors().contains(acceptor3));
-//      assertFalse(remotingService.isStarted());
-//   }
-//   
-//   public void testMultipleAcceptorsStartedAndStoppedAddedAnotherAcceptorThenStarted() throws Exception
-//   {
-//      final Acceptor acceptor1 = EasyMock.createStrictMock(Acceptor.class);
-//      final Acceptor acceptor2 = EasyMock.createStrictMock(Acceptor.class);
-//      final Acceptor acceptor3 = EasyMock.createStrictMock(Acceptor.class);
-//      final Acceptor acceptor4 = EasyMock.createStrictMock(Acceptor.class);
-//      ConfigurationImpl config = new ConfigurationImpl();
-//      RemotingServiceImpl remotingService = new RemotingServiceImpl(config);
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory1"));
-//      TestAcceptorFactory1.acceptor = acceptor1;
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory2"));
-//      TestAcceptorFactory2.acceptor = acceptor2;
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory3"));
-//      TestAcceptorFactory3.acceptor = acceptor3;
-//      acceptor1.start();
-//      acceptor2.start();
-//      acceptor3.start();
-//      acceptor1.stop();
-//      acceptor2.stop();
-//      acceptor3.stop();
-//      EasyMock.replay(acceptor1, acceptor2, acceptor3);
-//      remotingService.start();
-//      remotingService.stop();
-//      
-//      EasyMock.verify(acceptor1, acceptor2, acceptor3);
-//      assertEquals(3, remotingService.getAcceptors().size());   
-//      assertTrue(remotingService.getAcceptors().contains(acceptor1));
-//      assertTrue(remotingService.getAcceptors().contains(acceptor2));
-//      assertTrue(remotingService.getAcceptors().contains(acceptor3));
-//      assertFalse(remotingService.isStarted());
-//      
-//      EasyMock.reset(acceptor1, acceptor2, acceptor3);
-//      config.getAcceptorConfigurations().add(new TransportConfiguration("org.jboss.messaging.tests.unit.core.remoting.impl.TestAcceptorFactory4"));
-//      TestAcceptorFactory4.acceptor = acceptor4;
-//      acceptor1.start();
-//      acceptor2.start();
-//      acceptor3.start();
-//      acceptor4.start();
-//      acceptor1.stop();
-//      acceptor2.stop();
-//      acceptor3.stop();
-//      acceptor4.stop();
-//      EasyMock.replay(acceptor1, acceptor2, acceptor3, acceptor4);
-//      remotingService.start();
-//      remotingService.stop();
-//
-//      EasyMock.verify(acceptor1, acceptor2, acceptor3, acceptor4);
-//      assertEquals(4, remotingService.getAcceptors().size());   
-//      assertTrue(remotingService.getAcceptors().contains(acceptor1));
-//      assertTrue(remotingService.getAcceptors().contains(acceptor2));
-//      assertTrue(remotingService.getAcceptors().contains(acceptor3));
-//      assertTrue(remotingService.getAcceptors().contains(acceptor4));
-//      assertFalse(remotingService.isStarted());
-//   }
-//   
-//   public void testDispatcherNotNull() throws Exception
-//   {
-//      ConfigurationImpl config = new ConfigurationImpl();
-//      RemotingServiceImpl remotingService = new RemotingServiceImpl(config);
-//      assertNotNull(remotingService.getDispatcher());
-//      remotingService = new RemotingServiceImpl(config);
-//      assertNotNull(remotingService.getDispatcher());
-//   }
-//
-//   public void testInterceptorsAddedToDispatcher() throws Exception
-//   {
-//      ConfigurationImpl config = new ConfigurationImpl();
-//
-//      config.getInterceptorClassNames().add("org.jboss.messaging.tests.unit.core.remoting.impl.Interceptor1");
-//      config.getInterceptorClassNames().add("org.jboss.messaging.tests.unit.core.remoting.impl.Interceptor2");
-//      config.getInterceptorClassNames().add("org.jboss.messaging.tests.unit.core.remoting.impl.Interceptor3");
-//      
-//      RemotingServiceImpl remotingService = new RemotingServiceImpl(config);     
-//      assertNotNull(remotingService.getDispatcher());
-//
-//      List<Interceptor> interceptors = remotingService.getDispatcher().getInterceptors();
-//      assertEquals(3, interceptors.size());
-//      assertTrue(interceptors.get(0) instanceof Interceptor1);
-//      assertTrue(interceptors.get(1) instanceof Interceptor2);
-//      assertTrue(interceptors.get(2) instanceof Interceptor3);
-//   }
-//   
-//   
-//   public void testCreateGetDestroyConnection() throws Exception
-//   {
-//      ConfigurationImpl config = new ConfigurationImpl();
-//      RemotingServiceImpl remotingService = new RemotingServiceImpl(config);
-//      remotingService.start();
-//      
-//      assertEquals(0, remotingService.getConnections().size());
-//      Connection connection1 = EasyMock.createStrictMock(Connection.class);
-//      EasyMock.expect(connection1.getID()).andStubReturn(1);
-//      
-//      Connection connection2 = EasyMock.createStrictMock(Connection.class);
-//      EasyMock.expect(connection2.getID()).andStubReturn(2);
-//
-//      Connection connection3 = EasyMock.createStrictMock(Connection.class);
-//      EasyMock.expect(connection3.getID()).andStubReturn(3);
-//
-//      EasyMock.replay(connection1, connection2, connection3);
-//      
-//      remotingService.connectionCreated(connection1);
-//      remotingService.connectionCreated(connection2);
-//      remotingService.connectionCreated(connection3);
-//      
-//      EasyMock.verify(connection1, connection2, connection3);
-//      
-//      assertEquals(3, remotingService.getConnections().size());
-//      
-//      RemotingConnection rc1 = remotingService.getConnection(1);
-//      assertNotNull(rc1);
-//      RemotingConnection rc2 = remotingService.getConnection(2);
-//      assertNotNull(rc2);
-//      RemotingConnection rc3 = remotingService.getConnection(3);
-//      assertNotNull(rc3);
-//      
-//      assertEquals(1, rc1.getID());
-//      assertEquals(2, rc2.getID());
-//      assertEquals(3, rc3.getID());
-//   
-//      EasyMock.reset(connection1, connection2, connection3);
-//      
-//      EasyMock.replay(connection1, connection2, connection3);
-//      
-//      remotingService.connectionDestroyed(1);
-//      remotingService.connectionDestroyed(2);
-//      remotingService.connectionDestroyed(3);
-//      
-//      EasyMock.verify(connection1, connection2, connection3);
-//      
-//      assertEquals(0, remotingService.getConnections().size());
-//      
-//      rc1 = remotingService.getConnection(1);
-//      assertNull(rc1);
-//      rc2 = remotingService.getConnection(2);
-//      assertNull(rc2);
-//      rc3 = remotingService.getConnection(3);
-//      assertNull(rc3);
-//   }
-//   
-//   public void testConnectionException() throws Exception
-//   {
-//      ConfigurationImpl config = new ConfigurationImpl();
-//      RemotingServiceImpl remotingService = new RemotingServiceImpl(config);
-//      remotingService.start();
-//      
-//      final long id = 1212;
-//      
-//      assertEquals(0, remotingService.getConnections().size());
-//      Connection connection1 = EasyMock.createStrictMock(Connection.class);
-//      EasyMock.expect(connection1.getID()).andStubReturn(id);      
-//      connection1.close();
-//      
-//      EasyMock.replay(connection1);
-//      
-//      remotingService.connectionCreated(connection1);
-//            
-//      RemotingConnection rc1 = remotingService.getConnection(id);
-//      assertNotNull(rc1);
-//      
-//      class Listener implements FailureListener
-//      {
-//         volatile MessagingException me;
-//         public void connectionFailed(MessagingException me)
-//         {
-//            this.me = me;
-//         }
-//      }
-//      
-//      Listener listener = new Listener();
-//      rc1.addFailureListener(listener);
-//      
-//      MessagingException me2 = new MessagingException(1212, "askjaksj");
-//      
-//      remotingService.connectionException(id, me2);
-//      
-//      assertNotNull(listener.me);
-//      assertTrue(listener.me == me2);
-//      
-//      EasyMock.verify(connection1);       
-//   }
-//   
-   
-
-
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory1.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory1.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory1.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,48 +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.messaging.tests.unit.core.remoting.impl;
-
-import java.util.Map;
-import java.util.concurrent.Executor;
-
-import org.jboss.messaging.core.remoting.spi.Acceptor;
-import org.jboss.messaging.core.remoting.spi.AcceptorFactory;
-import org.jboss.messaging.core.remoting.spi.BufferHandler;
-import org.jboss.messaging.core.remoting.spi.ConnectionLifeCycleListener;
-
-/**
- * A TestAcceptorFactory1
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class TestAcceptorFactory1 implements AcceptorFactory
-{
-   public static volatile Acceptor acceptor;
-
-   public Acceptor createAcceptor(Map<String, Object> configuration,
-            BufferHandler handler, ConnectionLifeCycleListener listener, Executor threadPool)
-   {
-      return acceptor;
-   }
-
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory2.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory2.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory2.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,48 +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.messaging.tests.unit.core.remoting.impl;
-
-import java.util.Map;
-import java.util.concurrent.Executor;
-
-import org.jboss.messaging.core.remoting.spi.Acceptor;
-import org.jboss.messaging.core.remoting.spi.AcceptorFactory;
-import org.jboss.messaging.core.remoting.spi.BufferHandler;
-import org.jboss.messaging.core.remoting.spi.ConnectionLifeCycleListener;
-
-/**
- * A TestAcceptorFactory2
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class TestAcceptorFactory2 implements AcceptorFactory
-{
-   public static volatile Acceptor acceptor;
-
-   public Acceptor createAcceptor(Map<String, Object> configuration,
-            BufferHandler handler, ConnectionLifeCycleListener listener, Executor threadPool)
-   {
-      return acceptor;
-   }
-
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory3.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory3.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory3.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,48 +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.messaging.tests.unit.core.remoting.impl;
-
-import java.util.Map;
-import java.util.concurrent.Executor;
-
-import org.jboss.messaging.core.remoting.spi.Acceptor;
-import org.jboss.messaging.core.remoting.spi.AcceptorFactory;
-import org.jboss.messaging.core.remoting.spi.BufferHandler;
-import org.jboss.messaging.core.remoting.spi.ConnectionLifeCycleListener;
-
-/**
- * A TestAcceptorFactory3
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class TestAcceptorFactory3 implements AcceptorFactory
-{
-   public static volatile Acceptor acceptor;
-
-   public Acceptor createAcceptor(Map<String, Object> configuration,
-            BufferHandler handler, ConnectionLifeCycleListener listener, Executor threadPool)
-   {
-      return acceptor;
-   }
-
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory4.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory4.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/core/remoting/impl/TestAcceptorFactory4.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,48 +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.messaging.tests.unit.core.remoting.impl;
-
-import java.util.Map;
-import java.util.concurrent.Executor;
-
-import org.jboss.messaging.core.remoting.spi.Acceptor;
-import org.jboss.messaging.core.remoting.spi.AcceptorFactory;
-import org.jboss.messaging.core.remoting.spi.BufferHandler;
-import org.jboss.messaging.core.remoting.spi.ConnectionLifeCycleListener;
-
-/**
- * A TestAcceptorFactory4
- * 
- * @author <a href="mailto:tim.fox at jboss.com">Tim Fox</a>
- *
- */
-public class TestAcceptorFactory4 implements AcceptorFactory
-{
-   public static volatile Acceptor acceptor;
-
-   public Acceptor createAcceptor(Map<String, Object> configuration,
-            BufferHandler handler, ConnectionLifeCycleListener listener, Executor threadPool)
-   {
-      return acceptor;
-   }
-
-}

Deleted: trunk/tests/src/org/jboss/messaging/tests/unit/jms/client/JMSMessageListenerWrapperTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/jms/client/JMSMessageListenerWrapperTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/jms/client/JMSMessageListenerWrapperTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -1,120 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 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.unit.jms.client;
-
-import org.jboss.messaging.tests.util.UnitTestCase;
-
-/**
- * @author <a href="mailto:jmesnil at redhat.com">Jeff Mesnil</a>
- *
- * @version <tt>$Revision$</tt>
- *
- */
-public class JMSMessageListenerWrapperTest extends UnitTestCase
-{
-   // Constants -----------------------------------------------------
-
-   // Attributes ----------------------------------------------------
-
-   // Static --------------------------------------------------------
-
-   // Constructors --------------------------------------------------
-
-   // Public --------------------------------------------------------
-
-   public void testDummy()
-   {      
-   }
-   
-//   public void testOnMessage() throws Exception
-//   {
-//      ClientSession clientSession = createStrictMock(ClientSession.class);
-//      expect(clientSession.isClosed()).andReturn(false);
-//      JBossSession session = createStrictMock(JBossSession.class);
-//      expect(session.getCoreSession()).andStubReturn(clientSession);
-//      expect(session.isRecoverCalled()).andReturn(false);
-//      session.setRecoverCalled(false);
-//      MessageListener listener = createStrictMock(MessageListener.class);
-//      listener.onMessage(isA(Message.class));
-//      ClientMessage clientMessage = createNiceMock(ClientMessage.class);
-//      
-//      replay(clientSession, session, listener, clientMessage);
-//      
-//      JMSMessageListenerWrapper wrapper = new JMSMessageListenerWrapper(session, listener , Session.AUTO_ACKNOWLEDGE);
-//      wrapper.onMessage(clientMessage);
-//      
-//      verify(clientSession, session, listener, clientMessage);
-//   }
-//   
-//   public void testOnMessageWithSessionTransacted() throws Exception
-//   {
-//      ClientSession clientSession = createStrictMock(ClientSession.class);
-//      JBossSession session = createStrictMock(JBossSession.class);
-//      expect(session.getCoreSession()).andStubReturn(clientSession);
-//      expect(clientSession.isClosed()).andStubReturn(false);
-//      expect(session.isRecoverCalled()).andReturn(false);
-//      
-//      session.setRecoverCalled(false);
-//      MessageListener listener = createStrictMock(MessageListener.class);
-//      listener.onMessage(isA(Message.class));
-//      ClientMessage clientMessage = createNiceMock(ClientMessage.class);
-//      
-//      replay(clientSession, session, listener, clientMessage);
-//      
-//      JMSMessageListenerWrapper wrapper = new JMSMessageListenerWrapper(session, listener , Session.SESSION_TRANSACTED);
-//      wrapper.onMessage(clientMessage);
-//      
-//      verify(clientSession, session, listener, clientMessage);
-//   }
-//   
-//   public void testOnMessageThrowsAndException() throws Exception
-//   {
-//      ClientSession clientSession = createStrictMock(ClientSession.class);
-//      clientSession.rollback();
-//      JBossSession session = createStrictMock(JBossSession.class);
-//      expect(session.getCoreSession()).andStubReturn(clientSession);
-//      session.setRecoverCalled(true);
-//      expect(session.isRecoverCalled()).andReturn(true);
-//      session.setRecoverCalled(false);
-//      MessageListener listener = createStrictMock(MessageListener.class);
-//      listener.onMessage(isA(Message.class));
-//      expectLastCall().andThrow(new RuntimeException());
-//      
-//      ClientMessage clientMessage = createNiceMock(ClientMessage.class);
-//      
-//      replay(clientSession, session, listener, clientMessage);
-//      
-//      JMSMessageListenerWrapper wrapper = new JMSMessageListenerWrapper(session, listener , Session.AUTO_ACKNOWLEDGE);
-//      wrapper.onMessage(clientMessage);
-//      
-//      verify(clientSession, session, listener, clientMessage);
-//   }
-   
-   // Package protected ---------------------------------------------
-
-   // Protected -----------------------------------------------------
-
-   // Private -------------------------------------------------------
-
-   // Inner classes -------------------------------------------------
-}

Modified: trunk/tests/src/org/jboss/messaging/tests/unit/jms/misc/ManifestTest.java
===================================================================
--- trunk/tests/src/org/jboss/messaging/tests/unit/jms/misc/ManifestTest.java	2009-06-04 11:33:41 UTC (rev 7196)
+++ trunk/tests/src/org/jboss/messaging/tests/unit/jms/misc/ManifestTest.java	2009-06-04 16:45:19 UTC (rev 7197)
@@ -18,7 +18,7 @@
  * 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.unit.jms.misc;
 
@@ -43,8 +43,9 @@
  */
 public class ManifestTest extends UnitTestCase
 {
-      // Constants -----------------------------------------------------
-    Logger log = Logger.getLogger(ManifestTest.class);
+   // Constants -----------------------------------------------------
+   Logger log = Logger.getLogger(ManifestTest.class);
+
    // Static --------------------------------------------------------
 
    // Attributes ----------------------------------------------------
@@ -75,20 +76,20 @@
       {
          MessagingServer server = Messaging.newMessagingServer(new ConfigurationImpl());
 
-	      ConnectionMetaData meta = new JBossConnectionMetaData(server.getVersion());
+         ConnectionMetaData meta = new JBossConnectionMetaData(server.getVersion());
 
-	      // Compare the value from ConnectionMetaData and MANIFEST.MF
-	      Attributes attrs = manifest.getMainAttributes();
+         // Compare the value from ConnectionMetaData and MANIFEST.MF
+         Attributes attrs = manifest.getMainAttributes();
 
-	      assertEquals(meta.getProviderVersion(), attrs.getValue("JBossMessaging-Version"));
-	      assertEquals("https://svn.jboss.org/repos/messaging/trunk", attrs.getValue("JBossMessaging-SVN-URL"));
+         assertEquals(meta.getProviderVersion(), attrs.getValue("JBossMessaging-Version"));
+         assertEquals("https://svn.jboss.org/repos/messaging/trunk", attrs.getValue("JBossMessaging-SVN-URL"));
       }
       finally
       {
-      	if (conn != null)
-      	{
-      		conn.close();
-      	}
+         if (conn != null)
+         {
+            conn.close();
+         }
       }
    }
 




More information about the jboss-cvs-commits mailing list