You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@james.apache.org by bt...@apache.org on 2022/03/22 02:01:34 UTC

[james-project] 03/29: JAMES-3715 Remove no longer use methods

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

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 130c5481f05b88375adae6f9dcdb6191318e7ee5
Author: Benoit Tellier <bt...@linagora.com>
AuthorDate: Sun Feb 27 20:27:50 2022 +0700

    JAMES-3715 Remove no longer use methods
    
    Netty 4 no longer allows setting internal threads and instead relies
    on event loop groups.
    
    Removing unused methods...
---
 .../james/protocols/netty/AbstractAsyncServer.java | 22 ----------------------
 .../lib/netty/AbstractConfigurableAsyncServer.java | 15 ---------------
 2 files changed, 37 deletions(-)

diff --git a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
index d0997cc..52371d8 100644
--- a/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
+++ b/protocols/netty/src/main/java/org/apache/james/protocols/netty/AbstractAsyncServer.java
@@ -21,12 +21,8 @@ package org.apache.james.protocols.netty;
 import java.net.InetSocketAddress;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.concurrent.Executor;
-import java.util.concurrent.Executors;
-import java.util.concurrent.ThreadFactory;
 
 import org.apache.james.protocols.api.ProtocolServer;
-import org.apache.james.util.concurrent.NamedThreadFactory;
 
 import com.google.common.collect.ImmutableList;
 
@@ -191,24 +187,6 @@ public abstract class AbstractAsyncServer implements ProtocolServer {
     public int getTimeout() {
         return timeout;
     }
-    
-    /**
-     * Create a new {@link Executor} used for dispatch messages to the workers. One Thread will be used per port which is bound.
-     * This can get overridden if needed, by default it use a {@link Executors#newCachedThreadPool()}
-     */
-    protected Executor createBossExecutor() {
-        ThreadFactory threadFactory = NamedThreadFactory.withClassName(getClass());
-        return Executors.newCachedThreadPool(threadFactory);
-    }
-
-    /**
-     * Create a new {@link Executor} used for workers. This can get overridden if needed, by default it use a {@link Executors#newCachedThreadPool()}
-     */
-    protected Executor createWorkerExecutor() {
-        ThreadFactory threadFactory = NamedThreadFactory.withClassName(getClass());
-        return Executors.newCachedThreadPool(threadFactory);
-    }
-    
 
     @Override
     public boolean isBound() {
diff --git a/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java b/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
index 5d5df1a..c85cf5d 100644
--- a/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
+++ b/server/protocols/protocols-library/src/main/java/org/apache/james/protocols/lib/netty/AbstractConfigurableAsyncServer.java
@@ -26,7 +26,6 @@ import java.net.UnknownHostException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Optional;
-import java.util.concurrent.Executor;
 
 import javax.annotation.PostConstruct;
 import javax.annotation.PreDestroy;
@@ -49,7 +48,6 @@ import org.apache.james.protocols.lib.jmx.ServerMBean;
 import org.apache.james.protocols.netty.AbstractAsyncServer;
 import org.apache.james.protocols.netty.AbstractChannelPipelineFactory;
 import org.apache.james.protocols.netty.ChannelHandlerFactory;
-import org.apache.james.util.concurrent.JMXEnabledThreadPoolExecutor;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -484,19 +482,6 @@ public abstract class AbstractConfigurableAsyncServer extends AbstractAsyncServe
         return connectionLimit;
     }
 
-    protected String getThreadPoolJMXPath() {
-        return "org.apache.james:type=server,name=" + jmxName + ",sub-type=threadpool";
-    }
-    
-    @Override
-    protected Executor createBossExecutor() {
-        return JMXEnabledThreadPoolExecutor.newCachedThreadPool(getThreadPoolJMXPath(), getDefaultJMXName() + "-boss");
-    }
-
-    @Override
-    protected Executor createWorkerExecutor() {
-        return JMXEnabledThreadPoolExecutor.newCachedThreadPool(getThreadPoolJMXPath(), getDefaultJMXName() + "-worker");
-    }
 
     /**
      * Return the default name of the the server in JMX if none is configured

---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@james.apache.org
For additional commands, e-mail: notifications-help@james.apache.org