[hornetq-commits] JBoss hornetq SVN: r8654 - in trunk: tests/src/org/hornetq/tests/integration/largemessage/mock and 1 other directory.

do-not-reply at jboss.org do-not-reply at jboss.org
Wed Dec 9 15:37:28 EST 2009


Author: timfox
Date: 2009-12-09 15:37:28 -0500 (Wed, 09 Dec 2009)
New Revision: 8654

Modified:
   trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java
   trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMConnectorFactory.java
   trunk/tests/src/org/hornetq/tests/integration/largemessage/mock/MockConnector.java
Log:
use closeexecutor on invm connector too

Modified: trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java	2009-12-09 20:35:20 UTC (rev 8653)
+++ trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMConnector.java	2009-12-09 20:37:28 UTC (rev 8654)
@@ -73,10 +73,13 @@
    private volatile boolean started;
 
    protected final OrderedExecutorFactory executorFactory;
+   
+   private final Executor closeExecutor;
 
    public InVMConnector(final Map<String, Object> configuration,
                         final BufferHandler handler,
                         final ConnectionLifeCycleListener listener,
+                        final Executor closeExecutor,
                         final Executor threadPool)
    {
       this.listener = listener;
@@ -84,6 +87,8 @@
       id = ConfigurationHelper.getIntProperty(TransportConstants.SERVER_ID_PROP_NAME, 0, configuration);
 
       this.handler = handler;
+      
+      this.closeExecutor = closeExecutor;
 
       executorFactory = new OrderedExecutorFactory(threadPool);
 
@@ -187,28 +192,26 @@
             acceptor.disconnect((String)connectionID);
 
             // Execute on different thread to avoid deadlocks
-            new Thread()
+            closeExecutor.execute(new Runnable()
             {
-               @Override
                public void run()
                {
                   listener.connectionDestroyed(connectionID);
-               }
-            }.start();
+               }            
+            });
          }
       }
 
       public void connectionException(final Object connectionID, final HornetQException me)
       {
          // Execute on different thread to avoid deadlocks
-         new Thread()
+         closeExecutor.execute(new Runnable()
          {
-            @Override
             public void run()
             {
                listener.connectionException(connectionID, me);
-            }
-         }.start();
+            }            
+         });
       }
 
    }

Modified: trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMConnectorFactory.java
===================================================================
--- trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMConnectorFactory.java	2009-12-09 20:35:20 UTC (rev 8653)
+++ trunk/src/main/org/hornetq/core/remoting/impl/invm/InVMConnectorFactory.java	2009-12-09 20:37:28 UTC (rev 8654)
@@ -33,11 +33,11 @@
    public Connector createConnector(final Map<String, Object> configuration,
                                     final BufferHandler handler,
                                     final ConnectionLifeCycleListener listener,
-                                    final Executor closExecutor,
+                                    final Executor closeExecutor,
                                     final Executor threadPool,
                                     final ScheduledExecutorService scheduledThreadPool)
    {
-      InVMConnector connector = new InVMConnector(configuration, handler, listener, threadPool);
+      InVMConnector connector = new InVMConnector(configuration, handler, listener, closeExecutor, threadPool);
 
       if (connector.getAcceptor() == null)
       {

Modified: trunk/tests/src/org/hornetq/tests/integration/largemessage/mock/MockConnector.java
===================================================================
--- trunk/tests/src/org/hornetq/tests/integration/largemessage/mock/MockConnector.java	2009-12-09 20:35:20 UTC (rev 8653)
+++ trunk/tests/src/org/hornetq/tests/integration/largemessage/mock/MockConnector.java	2009-12-09 20:37:28 UTC (rev 8654)
@@ -46,7 +46,7 @@
                         final BufferHandler handler,
                         final ConnectionLifeCycleListener listener)
    {
-      super(configuration, handler, listener, Executors.newCachedThreadPool());
+      super(configuration, handler, listener, Executors.newSingleThreadExecutor(), Executors.newCachedThreadPool());
       callback = (MockCallback)configuration.get("callback");
    }
 



More information about the hornetq-commits mailing list