File tree Expand file tree Collapse file tree
src/main/java/com/baeldung/jetty Expand file tree Collapse file tree Original file line number Diff line number Diff line change 117117 <artifactId >commons-io</artifactId >
118118 <version >${commons.io.version} </version >
119119 </dependency >
120+ <dependency >
121+ <groupId >org.eclipse.jetty</groupId >
122+ <artifactId >jetty-server</artifactId >
123+ <version >${jetty.version} </version >
124+ </dependency >
125+ <dependency >
126+ <groupId >org.eclipse.jetty</groupId >
127+ <artifactId >jetty-servlet</artifactId >
128+ <version >${jetty.version} </version >
129+ </dependency >
130+ <dependency >
131+ <groupId >org.apache.httpcomponents</groupId >
132+ <artifactId >httpclient</artifactId >
133+ <version >${httpclient.version} </version >
134+ </dependency >
135+ <dependency >
136+ <groupId >commons-io</groupId >
137+ <artifactId >commons-io</artifactId >
138+ <version >${commons.io.version} </version >
139+ </dependency >
120140 <dependency >
121141 <groupId >org.apache.flink</groupId >
122142 <artifactId >flink-core</artifactId >
144164 <assertj .version>3.6.2</assertj .version>
145165 <jsonassert .version>1.5.0</jsonassert .version>
146166 <javers .version>3.1.0</javers .version>
167+ <jetty .version>9.4.3.v20170317</jetty .version>
168+ <httpclient .version>4.5.3</httpclient .version>
169+ <commons .io.version>2.5</commons .io.version>
147170 <jetty .version>9.4.2.v20170220</jetty .version>
148171 <httpclient .version>4.5.3</httpclient .version>
149172 <commons .io.version>2.5</commons .io.version>
Original file line number Diff line number Diff line change 44import org .eclipse .jetty .server .Server ;
55import org .eclipse .jetty .server .ServerConnector ;
66import org .eclipse .jetty .servlet .ServletHandler ;
7+ import org .eclipse .jetty .util .thread .QueuedThreadPool ;
78
89public class JettyServer {
910
1011 private Server server ;
1112
1213 public void start () throws Exception {
1314
14- server = new Server ();
15+ int maxThreads = 100 ;
16+ int minThreads = 10 ;
17+ int idleTimeout = 120 ;
18+
19+ QueuedThreadPool threadPool = new QueuedThreadPool (maxThreads , minThreads , idleTimeout );
20+
21+ server = new Server (threadPool );
1522 ServerConnector connector = new ServerConnector (server );
1623 connector .setPort (8090 );
1724 server .setConnectors (new Connector []{connector });
You can’t perform that action at this time.
0 commit comments