public SpiderBeanFactory(String classPath, PipelineFactory pipelineFactory) { if (StringUtils.isNotEmpty(classPath)) { reflections = new Reflections( ConfigurationBuilder.build("com.geccocrawler.gecco", classPath, GeccoClassLoader.get()) .setMetadataAdapter(new GeccoJavaReflectionAdapter()) .setExpandSuperTypes(false)); // reflections = new Reflections("com.geccocrawler.gecco", classPath); } else { reflections = new Reflections(ConfigurationBuilder.build("com.geccocrawler.gecco", GeccoClassLoader.get()) .setMetadataAdapter(new GeccoJavaReflectionAdapter()) .setExpandSuperTypes(false)); // reflections = new Reflections("com.geccocrawler.gecco"); } dynamic(); this.downloaderFactory = new MonitorDownloaderFactory(reflections); this.downloaderAOPFactory = new DownloaderAOPFactory(reflections); this.renderFactory = new MonitorRenderFactory(reflections); if (pipelineFactory != null) { this.pipelineFactory = pipelineFactory; } else { this.pipelineFactory = new DefaultPipelineFactory(reflections); } this.spiderBeans = new ConcurrentHashMap<String, Class<? extends SpiderBean>>(); this.spiderBeanContexts = new ConcurrentHashMap<String, SpiderBeanContext>(); loadSpiderBean(reflections); }
.setMetadataAdapter(METADATA_ADAPTER) // Scanners depend on this .filterInputsBy(filter) .setScanners(annotationScanner, subTypesScanner);
.setMetadataAdapter(METADATA_ADAPTER) // Scanners depend on this .filterInputsBy(filter) .setScanners(annotationScanner, subTypesScanner);
.setMetadataAdapter(METADATA_ADAPTER) // Scanners depend on this .filterInputsBy(filter) .setScanners(annotationScanner, subTypesScanner);