aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/configuration/EmbeddedXMPPConfig.java
blob: a54b76a15ae0cc2d2571c86d780a163a8b341bd7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
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();
    }
}