All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.geccocrawler.gecco.spring.SpringGeccoEngine Maven / Gradle / Ivy

There is a newer version: 1.3.0
Show newest version
package com.geccocrawler.gecco.spring;

import javax.annotation.Resource;

import org.springframework.context.ApplicationListener;
import org.springframework.context.event.ContextRefreshedEvent;

import com.geccocrawler.gecco.pipeline.PipelineFactory;

public abstract class SpringGeccoEngine implements ApplicationListener {

	@Resource
	protected PipelineFactory springPipelineFactory;
	
	@Override
	public void onApplicationEvent(ContextRefreshedEvent event) {
		if(event.getApplicationContext().getParent() == null) {
			init();
		}
	}

	/**
	 * spring下启动gecco的初始化方法,spring下必须要用非阻塞方式start()运行GeccoEngine
	 */
	public abstract void init();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy