diff options
author | Vitaly Takmazov | 2016-12-23 11:49:39 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2016-12-23 11:59:43 +0300 |
commit | 1bc50475e5a226ca3467882dc50a8264cd376159 (patch) | |
tree | dbc8a83462d83b6735ee15d9b915082b84815685 /juick-console/src/main/java/com/juick/console/configuration | |
parent | 97f993fad0dea34b25cb5da932920971627fd972 (diff) |
juick-demo -> juick-console
Diffstat (limited to 'juick-console/src/main/java/com/juick/console/configuration')
-rw-r--r-- | juick-console/src/main/java/com/juick/console/configuration/ConsoleAppConfiguration.java | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/juick-console/src/main/java/com/juick/console/configuration/ConsoleAppConfiguration.java b/juick-console/src/main/java/com/juick/console/configuration/ConsoleAppConfiguration.java new file mode 100644 index 00000000..11e2609e --- /dev/null +++ b/juick-console/src/main/java/com/juick/console/configuration/ConsoleAppConfiguration.java @@ -0,0 +1,34 @@ +package com.juick.console.configuration; + +import com.juick.configuration.DataConfiguration; +import com.juick.console.ConsoleApp; +import com.juick.server.protocol.JuickProtocol; +import org.springframework.beans.BeansException; +import org.springframework.context.ApplicationContext; +import org.springframework.context.ApplicationContextAware; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.ComponentScan; +import org.springframework.context.annotation.Configuration; +import org.springframework.context.annotation.Import; + +/** + * Created by vitalyster on 19.12.2016. + */ +@Configuration +@ComponentScan(basePackages = {"com.juick.console", "com.juick.service", "com.juick.server.protocol"}) +@Import(DataConfiguration.class) +public class ConsoleAppConfiguration implements ApplicationContextAware { + private ApplicationContext applicationContext; + @Override + public void setApplicationContext(ApplicationContext applicationContext) throws BeansException { + this.applicationContext = applicationContext; + } + @Bean + public JuickProtocol juickProtocol() { + return new JuickProtocol("https://juick.com/"); + } + @Bean + public ConsoleApp app() { + return new ConsoleApp(applicationContext); + } +} |