From 1bc50475e5a226ca3467882dc50a8264cd376159 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 23 Dec 2016 11:49:39 +0300 Subject: juick-demo -> juick-console --- .../configuration/ConsoleAppConfiguration.java | 34 ++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 juick-console/src/main/java/com/juick/console/configuration/ConsoleAppConfiguration.java (limited to 'juick-console/src/main/java/com/juick/console/configuration') 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); + } +} -- cgit v1.2.3