package com.juick.components.configuration; import com.juick.components.Crosspost; import com.juick.configuration.DataConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.Import; import org.springframework.context.annotation.PropertySource; import org.springframework.core.env.Environment; import org.springframework.jdbc.core.JdbcTemplate; import javax.inject.Inject; import java.util.concurrent.ExecutorService; import java.util.concurrent.Executors; /** * Created by aalexeev on 11/12/16. */ @Configuration @PropertySource("classpath:juick.conf") @Import(DataConfiguration.class) public class CrosspostAppConfiguration { @Inject private Environment env; @Inject private JdbcTemplate jdbcTemplate; @Bean public Crosspost crosspost() { return new Crosspost(env, service(), jdbcTemplate); } @Bean public ExecutorService service() { return Executors.newCachedThreadPool(); } }