In memory compiler 로 변경, 기동시 스크립트 로딩 추가
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.eactive.httpmockserver;
|
||||
|
||||
import com.eactive.httpmockserver.script.ScriptInfoService;
|
||||
import com.eactive.httpmockserver.script.ScriptLoader;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.PostConstruct;
|
||||
|
||||
@Component
|
||||
public class PostConstructBean {
|
||||
private final Logger logger = LoggerFactory.getLogger(this.getClass());
|
||||
|
||||
@Autowired
|
||||
public ScriptInfoService scriptInfoService;
|
||||
|
||||
@PostConstruct
|
||||
public void init() {
|
||||
logger.info("init scripts");
|
||||
try {
|
||||
ScriptLoader.getInstance().init(scriptInfoService);
|
||||
} catch (Exception e) {
|
||||
logger.error("init scripts failed", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user