Created
July 24, 2017 19:33
-
-
Save ygaller/abadd92d34ac5e8eeadbf7325c568419 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class EmbeddedJettyFactoryConstructor { | |
AbstractNCSARequestLog requestLog; | |
public EmbeddedJettyFactoryConstructor(AbstractNCSARequestLog requestLog) { | |
this.requestLog = requestLog; | |
} | |
EmbeddedJettyFactory create() { | |
return new EmbeddedJettyFactory((maxThreads, minThreads, threadTimeoutMillis) -> { | |
Server server; | |
if (maxThreads > 0) { | |
int max = maxThreads > 0 ? maxThreads : 200; | |
int min = minThreads > 0 ? minThreads : 8; | |
int idleTimeout = threadTimeoutMillis > 0 ? threadTimeoutMillis : '\uea60'; | |
server = new Server(new QueuedThreadPool(max, min, idleTimeout)); | |
} else { | |
server = new Server(); | |
} | |
server.setRequestLog(requestLog); | |
return server; | |
}); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment