aboutsummaryrefslogblamecommitdiff
path: root/juick-xmpp-bot/src/main/java/com/juick/components/configuration/BotAppConfiguration.java
blob: 8eb4517079beffc8ab20919fc0ef014e54cd61a5 (plain) (tree)




































                                                             
package com.juick.components.configuration;

import com.juick.components.XMPPBot;
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 BotAppConfiguration {
    @Inject
    private Environment env;
    @Inject
    private JdbcTemplate jdbc;

    @Bean
    public XMPPBot xmpp() {
        return new XMPPBot(env);
    }

    @Bean
    public ExecutorService service() {
        return Executors.newCachedThreadPool();
    }

}