summaryrefslogtreecommitdiffstats
path: root/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java
diff options
context:
space:
mode:
Diffstat (limited to 'dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java')
-rw-r--r--dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java10
1 files changed, 6 insertions, 4 deletions
diff --git a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java
index 7cb6ef19..d730eace 100644
--- a/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java
+++ b/dozentenmodulserver/src/main/java/org/openslx/bwlp/sat/thrift/BinaryListener.java
@@ -4,6 +4,7 @@ import java.io.IOException;
import java.net.InetSocketAddress;
import java.net.ServerSocket;
import java.security.NoSuchAlgorithmException;
+import java.util.concurrent.ExecutorService;
import java.util.concurrent.TimeUnit;
import javax.net.ssl.SSLContext;
@@ -38,10 +39,10 @@ public class BinaryListener implements Runnable {
private final TServer server;
- public BinaryListener(int port, boolean secure) throws TTransportException, NoSuchAlgorithmException,
- IOException {
+ public BinaryListener(int port, boolean secure, ExecutorService es)
+ throws TTransportException, NoSuchAlgorithmException, IOException {
if (secure)
- server = initSecure(port);
+ server = initSecure(port, es);
else
server = initNormal(port);
}
@@ -54,7 +55,7 @@ public class BinaryListener implements Runnable {
// TODO: Restart listener; if it fails, quit server so it will be restarted by the OS
}
- private TServer initSecure(int port) throws NoSuchAlgorithmException, TTransportException, IOException {
+ private TServer initSecure(int port, ExecutorService es) throws NoSuchAlgorithmException, TTransportException, IOException {
SSLContext context = Identity.getSSLContext();
if (context == null)
return null;
@@ -73,6 +74,7 @@ public class BinaryListener implements Runnable {
TThreadPoolServer.Args args = new TThreadPoolServer.Args(serverTransport);
args.protocolFactory(protFactory);
args.processor(processor);
+ args.executorService(es);
args.minWorkerThreads(MINWORKERTHREADS).maxWorkerThreads(MAXWORKERTHREADS);
args.stopTimeoutVal(2).stopTimeoutUnit(TimeUnit.MINUTES);
args.transportFactory(new TFastFramedTransport.Factory(MAX_MSG_LEN));