Skip to content

Commit 9a12063

Browse files
committed
升级jetty 到最新版本0.9.2
1 parent 7e421ba commit 9a12063

File tree

3 files changed

+48
-22
lines changed

3 files changed

+48
-22
lines changed

config/application.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -125,5 +125,5 @@ qps:
125125
qpslimit:
126126
enable: true
127127
dubbo:
128-
disable: false
128+
disable: true
129129
server: true

pom.xml

+36-13
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
<modelVersion>4.0.0</modelVersion>
55
<groupId>net.csdn</groupId>
66
<artifactId>ServiceFramework</artifactId>
7-
<version>1.3.1-SNAPSHOT</version>
7+
<version>1.3.2-SNAPSHOT-9.2.16</version>
88

99
<licenses>
1010
<license>
@@ -14,6 +14,13 @@
1414
</license>
1515
</licenses>
1616

17+
<properties>
18+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
19+
<scala.version>2.10.3</scala.version>
20+
<!--9.2.16.v20160414/7.2.2.v20101205/8.0.4.v20111024-->
21+
<jetty.version>9.2.16.v20160414</jetty.version>
22+
</properties>
23+
1724

1825
<dependencies>
1926
<dependency>
@@ -45,29 +52,37 @@
4552
<dependency>
4653
<groupId>org.eclipse.jetty</groupId>
4754
<artifactId>jetty-server</artifactId>
48-
<version>7.2.2.v20101205</version>
55+
<version>${jetty.version}</version>
4956
</dependency>
5057
<dependency>
5158
<groupId>org.eclipse.jetty</groupId>
5259
<artifactId>jetty-continuation</artifactId>
53-
<version>7.2.2.v20101205</version>
60+
<version>${jetty.version}</version>
5461
</dependency>
5562

5663
<dependency>
5764
<groupId>org.eclipse.jetty</groupId>
5865
<artifactId>jetty-io</artifactId>
59-
<version>7.2.2.v20101205</version>
66+
<version>${jetty.version}</version>
6067
</dependency>
6168
<dependency>
6269
<groupId>org.eclipse.jetty</groupId>
6370
<artifactId>jetty-http</artifactId>
64-
<version>7.2.2.v20101205</version>
71+
<version>${jetty.version}</version>
6572
</dependency>
6673
<dependency>
6774
<groupId>org.eclipse.jetty</groupId>
6875
<artifactId>jetty-util</artifactId>
69-
<version>7.2.2.v20101205</version>
76+
<version>${jetty.version}</version>
77+
</dependency>
78+
79+
<dependency>
80+
<groupId>org.eclipse.jetty</groupId>
81+
<artifactId>jetty-servlet</artifactId>
82+
<version>${jetty.version}</version>
7083
</dependency>
84+
85+
7186
<dependency>
7287
<groupId>org.apache.velocity</groupId>
7388
<artifactId>velocity</artifactId>
@@ -101,7 +116,7 @@
101116
<dependency>
102117
<groupId>org.scala-lang</groupId>
103118
<artifactId>jline</artifactId>
104-
<version>2.10.3</version>
119+
<version>${scala.version}</version>
105120
</dependency>
106121

107122
<dependency>
@@ -114,12 +129,9 @@
114129
<groupId>com.101tec</groupId>
115130
<artifactId>zkclient</artifactId>
116131
<version>0.5</version>
132+
<scope>provided</scope>
117133
</dependency>
118-
<dependency>
119-
<groupId>org.eclipse.jetty</groupId>
120-
<artifactId>jetty-servlet</artifactId>
121-
<version>9.2.8.v20150217</version>
122-
</dependency>
134+
123135

124136
</dependencies>
125137

@@ -145,7 +157,7 @@
145157
<target>1.6</target>
146158
<compilerArgument>-g</compilerArgument>
147159
<verbose>true</verbose>
148-
<encoding>UTF-8</encoding>
160+
<encoding>UTF-8</encoding>
149161
</configuration>
150162

151163
</plugin>
@@ -196,5 +208,16 @@
196208
</plugin>
197209
</plugins>
198210
</build>
211+
<distributionManagement>
212+
<repository>
213+
<id>releases</id>
214+
<name>releases</name>
215+
<url>http://mvn.letv.com/nexus/content/repositories/releases/</url>
216+
</repository>
217+
<snapshotRepository>
218+
<id>snapshots</id>
219+
<url>http://mvn.letv.com/nexus/content/repositories/snapshots</url>
220+
</snapshotRepository>
221+
</distributionManagement>
199222

200223
</project>

src/main/java/net/csdn/modules/http/HttpServer.java

+11-8
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,10 @@
2222
import net.csdn.modules.http.processor.impl.TraceHttpStartProcessor;
2323
import net.csdn.modules.http.support.HttpHolder;
2424
import net.csdn.modules.log.SystemLogger;
25-
import org.eclipse.jetty.server.Handler;
26-
import org.eclipse.jetty.server.Request;
27-
import org.eclipse.jetty.server.Server;
28-
import org.eclipse.jetty.server.SessionManager;
25+
import org.eclipse.jetty.server.*;
2926
import org.eclipse.jetty.server.handler.AbstractHandler;
3027
import org.eclipse.jetty.server.handler.HandlerList;
3128
import org.eclipse.jetty.server.handler.ResourceHandler;
32-
import org.eclipse.jetty.server.nio.SelectChannelConnector;
3329
import org.eclipse.jetty.server.session.HashSessionManager;
3430
import org.eclipse.jetty.server.session.SessionHandler;
3531
import org.eclipse.jetty.util.resource.Resource;
@@ -95,12 +91,19 @@ public HttpServer(Settings settings, SystemLogger systemLogger, RestController r
9591

9692
Environment environment = new Environment(settings);
9793
disableMysql = settings.getAsBoolean(ServiceFramwork.mode + ".datasources.mysql.disable", false);
98-
server = new Server();
99-
SelectChannelConnector connector = new SelectChannelConnector();
94+
10095
QueuedThreadPool threadPool = new QueuedThreadPool();
10196
threadPool.setMinThreads(settings.getAsInt("http.threads.min", 100));
10297
threadPool.setMaxThreads(settings.getAsInt("http.threads.max", 1000));
103-
connector.setThreadPool(threadPool);
98+
99+
server = new Server(threadPool);
100+
101+
HttpConfiguration httpConfig = new HttpConfiguration();
102+
103+
ServerConnector connector = new ServerConnector(server,
104+
new HttpConnectionFactory(httpConfig));
105+
106+
104107
httpPort = settings.getAsInt("http.port", generateHttpPort());
105108
connector.setPort(httpPort);
106109

0 commit comments

Comments
 (0)