use of com.easy.cloud.core.reptile.engine.pojo.dto.EcReptileEngineBeanClassDTO in project dq-easy-cloud by dq-open-cloud.
the class EcReptileDynamicBeanServiceImpl method reptileData.
@Override
public EcBaseServiceResult reptileData(EcReptileDataDTO reptileDataDTO) {
EcReptileEngineBeanClassDTO reptileEngineBeanClassDTOFromCache = EcReptileConfig.getReptileEngineBeanClassDTO();
EcAssert.verifyObjNull(reptileEngineBeanClassDTOFromCache, "缓存reptileEngineBeanClassDTOFromCache");
EcReptileDynamicBeanDTO dynamicBeanDTO = reptileEngineBeanClassDTOFromCache.getReptileDynamicBeanDTO();
// 获取爬虫引擎
GeccoEngine geccoEngine = reptileEngineBeanClassDTOFromCache.getGeccoEngine();
EcAssert.verifyDataNotExistent(geccoEngine, "缓存中geccoEngine");
EcReptileUtils.intoScheduler(geccoEngine, dynamicBeanDTO, reptileDataDTO);
return EcBaseServiceResult.newInstanceOfSuccess();
}
use of com.easy.cloud.core.reptile.engine.pojo.dto.EcReptileEngineBeanClassDTO in project dq-easy-cloud by dq-open-cloud.
the class EcReptileConfig method loadReptileEngineBeanClassDTO.
/**
* <p>
* 将EcReptileEngineBeanClassDTO对象add到缓存
* </p>
*
* @param reptileDynamicBeanDTO
* @param geccoEngine
* @author daiqi
* @创建时间 2018年6月11日 上午10:24:09
*/
public static synchronized void loadReptileEngineBeanClassDTO(EcReptileDynamicBeanDTO reptileDynamicBeanDTO, GeccoEngine geccoEngine) {
EcAssert.verifyObjNull(reptileDynamicBeanDTO, "reptileDynamicBeanDTO");
EcAssert.verifyObjNull(geccoEngine, "geccoEngine");
EcReptileEngineBeanClassDTO reptileEngineBeanClassDTO = EcReptileEngineBeanClassDTO.getInstance();
reptileEngineBeanClassDTO.setReptileDynamicBeanDTO(reptileDynamicBeanDTO);
reptileEngineBeanClassDTO.setGeccoEngine(geccoEngine);
}
use of com.easy.cloud.core.reptile.engine.pojo.dto.EcReptileEngineBeanClassDTO in project dq-easy-cloud by dq-open-cloud.
the class EcReptileUtils method unLoadReptileRuleClass.
/**
* <p>
* 从引擎中下线相关规则
* </p>
*
* @return void
* @author daiqi
* @date 2018/6/12 17:04
*/
public static synchronized void unLoadReptileRuleClass() {
EcReptileEngineBeanClassDTO reptileEngineBeanClassDTO = EcReptileConfig.getReptileEngineBeanClassDTO();
for (JavassistDynamicBean javassistDynamicBean : reptileEngineBeanClassDTO.getJavassistDynamicBeans()) {
javassistDynamicBean.unloadClass();
}
reptileEngineBeanClassDTO.clearJavassistDynamicBeans();
reptileEngineBeanClassDTO.clearRuleBeanClazzs();
}
Aggregations