Skip to content

Commit 6d8d882

Browse files
author
litongjava
committed
remove native support
1 parent 65a78e4 commit 6d8d882

File tree

4 files changed

+27
-11
lines changed

4 files changed

+27
-11
lines changed

frameworks/Java/tio-http-server/pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@
2727
<version>${jfinal-plugins.version}</version>
2828
</dependency>
2929

30+
<dependency>
31+
<groupId>junit</groupId>
32+
<artifactId>junit</artifactId>
33+
<version>4.12</version>
34+
<scope>test</scope>
35+
</dependency>
36+
37+
3038
<!-- https://mvnrepository.com/artifact/com.jfinal/activerecord -->
3139
<!--
3240
<dependency>

frameworks/Java/tio-http-server/src/main/java/com/litongjava/tio/http/server/MainApp.java

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
package com.litongjava.tio.http.server;
22

3-
import org.slf4j.Logger;
4-
import org.slf4j.LoggerFactory;
5-
63
import com.litongjava.tio.http.common.HttpConfig;
74
import com.litongjava.tio.http.common.handler.ITioHttpRequestHandler;
85
import com.litongjava.tio.http.server.config.EhCachePluginConfig;
@@ -20,7 +17,6 @@
2017
public class MainApp {
2118

2219
public static void main(String[] args) {
23-
Logger log = LoggerFactory.getLogger(MainApp.class);
2420
long start = System.currentTimeMillis();
2521
EnvUtils.load();
2622
// add route
@@ -55,14 +51,10 @@ public static void main(String[] args) {
5551
serverTioConfig.statOn = false;
5652
// start server
5753
try {
54+
new MysqlDbConfig().init();
55+
new EnjoyEngineConfig().engine();
56+
new EhCachePluginConfig().ehCachePlugin();
5857
httpServerStarter.start();
59-
if (EnvUtils.getBoolean("native", false)) {
60-
new MysqlDbConfig().init();
61-
new EnjoyEngineConfig().engine();
62-
new EhCachePluginConfig().ehCachePlugin();
63-
} else {
64-
log.info("native mode,only start server");
65-
}
6658
long end = System.currentTimeMillis();
6759
System.out.println((end - start) + "ms");
6860
} catch (Exception e) {

frameworks/Java/tio-http-server/src/main/resources/app.properties

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
http.response.addServerHead=true
2+
http.response.header.showServer=true
23

34
#JDBC_URL=jdbc:mysql://192.168.1.2/hello_world?useSSL=false&allowPublicKeyRetrieval=true
45
#JDBC_USER=root
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package com.litongjava.tio.http.server;
2+
3+
import org.junit.Test;
4+
5+
import com.litongjava.tio.utils.environment.EnvUtils;
6+
7+
public class MainAppTest {
8+
9+
@Test
10+
public void test() {
11+
boolean boolean1 = EnvUtils.getBoolean("native", false);
12+
System.out.println(boolean1);
13+
}
14+
15+
}

0 commit comments

Comments
 (0)