You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by bi...@apache.org on 2020/04/16 15:14:58 UTC

[axis-axis2-java-transports] 13/46: register mbean and initialize pool only if it has not initailed, since axis2 call twice this method

This is an automated email from the ASF dual-hosted git repository.

billblough pushed a commit to branch transport
in repository https://gitbox.apache.org/repos/asf/axis-axis2-java-transports.git

commit f3e4a73b96a7f597d9e7d47932263dafeff57d64
Author: Amila Chinthaka Suriarachchi <am...@apache.org>
AuthorDate: Tue Nov 17 11:54:27 2009 +0000

    register mbean and initialize pool only if it has not initailed, since axis2 call twice this method
---
 .../transport/base/AbstractTransportListener.java  | 24 ++++++++++++++--------
 1 file changed, 15 insertions(+), 9 deletions(-)

diff --git a/1.0.0/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java b/1.0.0/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java
index f542bc2..012872a 100644
--- a/1.0.0/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java
+++ b/1.0.0/modules/base/src/main/java/org/apache/axis2/transport/base/AbstractTransportListener.java
@@ -100,13 +100,16 @@ public abstract class AbstractTransportListener implements TransportListener {
             //this.workerPool = cfgCtx.getThreadPool(); not yet implemented
             throw new AxisFault("Unsupported thread pool for task execution - Axis2 thread pool");
         } else {
-            this.workerPool = WorkerPoolFactory.getWorkerPool(
-                    config.getServerCoreThreads(),
-                    config.getServerMaxThreads(),
-                    config.getServerKeepalive(),
-                    config.getServerQueueLen(),
-                    getTransportName() + "Server Worker thread group",
-                    getTransportName() + "-Worker");
+            if (this.workerPool == null) { // FIXME <-- workaround for AXIS2-4552
+                this.workerPool = WorkerPoolFactory.getWorkerPool(
+                        config.getServerCoreThreads(),
+                        config.getServerMaxThreads(),
+                        config.getServerKeepalive(),
+                        config.getServerQueueLen(),
+                        getTransportName() + "Server Worker thread group",
+                        getTransportName() + "-Worker");
+            }
+
         }
 
         // register to receive updates on services for lifetime management
@@ -129,8 +132,11 @@ public abstract class AbstractTransportListener implements TransportListener {
                 });
 
         // register with JMX
-        mbeanSupport = new TransportMBeanSupport(this, getTransportName());
-        mbeanSupport.register();
+        if (mbeanSupport == null) { // FIXME <-- workaround for AXIS2-4552
+            mbeanSupport = new TransportMBeanSupport(this, getTransportName());
+            mbeanSupport.register();
+        }
+
     }
 
     public void destroy() {