diff options
author | 2018-04-03 12:47:29 +0300 | |
---|---|---|
committer | 2018-04-03 12:47:29 +0300 | |
commit | d2af7ac0bbdde07e0f0f8b68c56f370ed3c06fe6 (patch) | |
tree | 9a8673c44f97e98b60b48c0c956b87ddc835e90b /juick-www/src/main/java/com/juick/www/configuration/EmbeddedXMPPConfig.java | |
parent | ed3af3b4a2722d352f5e9cfaf54fb44fa6af8295 (diff) |
boot: reuse single xmpp connection when possible
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/configuration/EmbeddedXMPPConfig.java')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/configuration/EmbeddedXMPPConfig.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/juick-www/src/main/java/com/juick/www/configuration/EmbeddedXMPPConfig.java b/juick-www/src/main/java/com/juick/www/configuration/EmbeddedXMPPConfig.java index 35377dcd..a54b76a1 100644 --- a/juick-www/src/main/java/com/juick/www/configuration/EmbeddedXMPPConfig.java +++ b/juick-www/src/main/java/com/juick/www/configuration/EmbeddedXMPPConfig.java @@ -1,11 +1,22 @@ package com.juick.www.configuration; +import com.juick.server.XMPPConnection; import org.springframework.boot.autoconfigure.condition.ConditionalOnClass; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.ComponentScan; import org.springframework.context.annotation.Configuration; +import rocks.xmpp.extensions.component.accept.ExternalComponent; + +import javax.inject.Inject; @Configuration @ConditionalOnClass(name = "com.juick.server.xmpp.router.XMPPRouter") @ComponentScan(basePackages = "com.juick.server") public class EmbeddedXMPPConfig { + @Inject + private XMPPConnection xmppConnection; + @Bean + public ExternalComponent xmpp() { + return xmppConnection.getRouter(); + } } |