mirror of
https://github.com/wahyd4/Martian.git
synced 2026-08-09 05:16:21 +10:00
去除tomcat,不再使用第三方容器,而是直接采用jdk自带的HttpServer来做http服务
This commit is contained in:
@@ -18,9 +18,9 @@ public class MarsConstant {
|
||||
*/
|
||||
public static final String HAS_START="hasStart";
|
||||
/**
|
||||
* 记录netty是否已经启动了
|
||||
* 记录服务是否已经启动了
|
||||
*/
|
||||
public static final String HAS_NETTY_START="hasNettyStart";
|
||||
public static final String HAS_SERVER_START ="hasNettyStart";
|
||||
/**
|
||||
* 记录是否已经启动过单测了
|
||||
*/
|
||||
|
||||
@@ -60,7 +60,7 @@ public class ExecuteMarsTimer {
|
||||
*/
|
||||
private static void executeTimer(MarsTimerModel marsTimerModel){
|
||||
try {
|
||||
Object hasNettyStart = constants.getAttr(MarsConstant.HAS_NETTY_START);
|
||||
Object hasNettyStart = constants.getAttr(MarsConstant.HAS_SERVER_START);
|
||||
if(hasNettyStart != null){
|
||||
Object beanObject = marsTimerModel.getObj();
|
||||
Method method = marsTimerModel.getMethod();
|
||||
|
||||
@@ -38,8 +38,8 @@ public class MarsServer {
|
||||
//设置服务器的线程池对象
|
||||
httpServer.setExecutor(ThreadPool.getThreadPoolExecutor());
|
||||
|
||||
/* 标识tomcat是否已经启动 */
|
||||
MarsSpace.getEasySpace().setAttr(MarsConstant.HAS_NETTY_START,"yes");
|
||||
/* 标识服务是否已经启动 */
|
||||
MarsSpace.getEasySpace().setAttr(MarsConstant.HAS_SERVER_START,"yes");
|
||||
log.info("启动成功");
|
||||
|
||||
//启动服务器
|
||||
|
||||
@@ -48,7 +48,7 @@ public class MarsJunitStart {
|
||||
autoWrite(obj);
|
||||
|
||||
/* 标识是否已经启动 */
|
||||
constants.setAttr(MarsConstant.HAS_NETTY_START,"yes");
|
||||
constants.setAttr(MarsConstant.HAS_SERVER_START,"yes");
|
||||
|
||||
log.info("开始执行单测......");
|
||||
} catch (Exception e) {
|
||||
|
||||
Reference in New Issue
Block a user