44import org .slf4j .LoggerFactory ;
55
66import com .litongjava .tio .http .common .HttpConfig ;
7- import com .litongjava .tio .http .common .handler .HttpRequestHandler ;
7+ import com .litongjava .tio .http .common .handler .ITioHttpRequestHandler ;
88import com .litongjava .tio .http .server .config .EhCachePluginConfig ;
99import com .litongjava .tio .http .server .config .EnjoyEngineConfig ;
1010import com .litongjava .tio .http .server .config .MysqlDbConfig ;
1111import com .litongjava .tio .http .server .controller .CacheController ;
1212import com .litongjava .tio .http .server .controller .DbController ;
1313import com .litongjava .tio .http .server .controller .IndexController ;
14- import com .litongjava .tio .http .server .handler .SimpleHttpDispatcherHandler ;
15- import com .litongjava .tio .http .server .router .DefaultHttpReqeustSimpleHandlerRoute ;
16- import com .litongjava .tio .http .server .router .HttpReqeustSimpleHandlerRoute ;
14+ import com .litongjava .tio .http .server .handler .DefaultHttpRequestDispatcher ;
15+ import com .litongjava .tio .http .server .router .DefaultHttpReqeustRouter ;
16+ import com .litongjava .tio .http .server .router .HttpRequestRouter ;
1717import com .litongjava .tio .server .ServerTioConfig ;
1818import com .litongjava .tio .utils .environment .EnvUtils ;
1919
@@ -26,7 +26,7 @@ public static void main(String[] args) {
2626 // add route
2727 IndexController controller = new IndexController ();
2828
29- HttpReqeustSimpleHandlerRoute simpleHttpRoutes = new DefaultHttpReqeustSimpleHandlerRoute ();
29+ HttpRequestRouter simpleHttpRoutes = new DefaultHttpReqeustRouter ();
3030 simpleHttpRoutes .add ("/" , controller ::index );
3131 simpleHttpRoutes .add ("/plaintext" , controller ::plaintext );
3232 simpleHttpRoutes .add ("/json" , controller ::json );
@@ -47,7 +47,7 @@ public static void main(String[] args) {
4747 httpConfig .setCheckHost (false );
4848 httpConfig .setCompatible1_0 (false );
4949
50- HttpRequestHandler requestHandler = new SimpleHttpDispatcherHandler (httpConfig , simpleHttpRoutes );
50+ ITioHttpRequestHandler requestHandler = new DefaultHttpRequestDispatcher (httpConfig , simpleHttpRoutes );
5151 HttpServerStarter httpServerStarter = new HttpServerStarter (httpConfig , requestHandler );
5252 ServerTioConfig serverTioConfig = httpServerStarter .getServerTioConfig ();
5353 // close Heartbeat
@@ -56,7 +56,7 @@ public static void main(String[] args) {
5656 // start server
5757 try {
5858 httpServerStarter .start ();
59- if (! EnvUtils .getBoolean ("native" )) {
59+ if (EnvUtils .getBoolean ("native" , false )) {
6060 new MysqlDbConfig ().init ();
6161 new EnjoyEngineConfig ().engine ();
6262 new EhCachePluginConfig ().ehCachePlugin ();
0 commit comments