package sagan; import com.fasterxml.jackson.databind.ObjectMapper; import com.fasterxml.jackson.dataformat.xml.XmlMapper; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.autoconfigure.social.SocialWebAutoConfiguration; import org.springframework.boot.orm.jpa.EntityScan; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Primary; import org.springframework.core.io.support.ResourcePatternResolver; import org.springframework.data.jpa.repository.config.EnableJpaRepositories; import org.springframework.scheduling.TaskScheduler; import org.springframework.scheduling.annotation.EnableScheduling; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; import org.springframework.web.client.RestTemplate; import sagan.support.StaticPagePathFinder; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; @SpringBootApplication(exclude = SocialWebAutoConfiguration.class) @EnableScheduling @EntityScan @EnableJpaRepositories public class IndexerApplication { public static void main(String[] args) { new SaganApplication(IndexerApplication.class).run(args); } @Bean public TaskScheduler scheduler() { ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); scheduler.setPoolSize(10); return scheduler; } @Bean public ExecutorService executorService() { return Executors.newFixedThreadPool(10); } @Bean public StaticPagePathFinder staticPageMapper(ResourcePatternResolver resourceResolver) { return new StaticPagePathFinder(resourceResolver); } @Bean public RestTemplate restTemplate() { return new RestTemplate(); } @Bean @Primary public ObjectMapper objectMapper() { return new ObjectMapper(); } @Bean public XmlMapper xmlMapper() { return new XmlMapper(); } }