diff options
author | 2016-11-12 01:34:07 +0700 | |
---|---|---|
committer | 2016-11-12 11:14:56 +0300 | |
commit | 194a9a763c6b11d207e682b2f93de94475c473b4 (patch) | |
tree | 196317662017b716066eadfa413ecbdc7532c52d /juick-xmpp-ft/src/main/java/com/juick/components/configuration/FileTransferAppConfiguration.java | |
parent | 7d86347a351aa5263c19cd03aa0bda4650c8bfca (diff) |
extracted application configuration from Mvc configuration with application specific beans;
extracted bean initialization from constructor;
force using properties;
Diffstat (limited to 'juick-xmpp-ft/src/main/java/com/juick/components/configuration/FileTransferAppConfiguration.java')
-rw-r--r-- | juick-xmpp-ft/src/main/java/com/juick/components/configuration/FileTransferAppConfiguration.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/juick-xmpp-ft/src/main/java/com/juick/components/configuration/FileTransferAppConfiguration.java b/juick-xmpp-ft/src/main/java/com/juick/components/configuration/FileTransferAppConfiguration.java new file mode 100644 index 00000000..88579328 --- /dev/null +++ b/juick-xmpp-ft/src/main/java/com/juick/components/configuration/FileTransferAppConfiguration.java @@ -0,0 +1,38 @@ +package com.juick.components.configuration; + +import com.juick.components.XMPPFTServer; +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 FileTransferAppConfiguration { + @Inject + private Environment env; + @Inject + private JdbcTemplate jdbc; + + @Bean + public XMPPFTServer xmpp() { + return new XMPPFTServer(env); + } + + @Bean + public ExecutorService service() { + return Executors.newCachedThreadPool(); + } + +} |