aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/server/configuration
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/configuration')
-rw-r--r--juick-server/src/main/java/com/juick/server/configuration/XMPPConfig.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/configuration/XMPPConfig.java b/juick-server/src/main/java/com/juick/server/configuration/XMPPConfig.java
new file mode 100644
index 000000000..e1115c7e5
--- /dev/null
+++ b/juick-server/src/main/java/com/juick/server/configuration/XMPPConfig.java
@@ -0,0 +1,27 @@
+package com.juick.server.configuration;
+
+import com.juick.server.XMPPConnection;
+import com.juick.server.XMPPServer;
+import com.juick.server.xmpp.router.XMPPRouter;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.DependsOn;
+
+@Configuration
+@ConditionalOnProperty("xmppbot_jid")
+public class XMPPConfig {
+ @Bean
+ public XMPPServer xmppServer() {
+ return new XMPPServer();
+ }
+ @Bean
+ public XMPPRouter xmppRouter() {
+ return new XMPPRouter();
+ }
+ @Bean
+ @DependsOn("xmppRouter")
+ public XMPPConnection xmppConnection() {
+ return new XMPPConnection();
+ }
+}