org.springframework.web.socket.client.WebSocketConnectionManager Java Examples

The following examples show how to use org.springframework.web.socket.client.WebSocketConnectionManager. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: SpringBootWebSocketApplicationTests.java    From spring-boot-tutorial with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
@Bean
public WebSocketConnectionManager wsConnectionManager() {

    WebSocketConnectionManager manager = new WebSocketConnectionManager(client(), handler(), this.webSocketUri);
    manager.setAutoStartup(true);

    return manager;
}
 
Example #2
Source File: CustomContainerWebSocketsApplicationTests.java    From spring-boot-tutorial with Creative Commons Attribution Share Alike 4.0 International 5 votes vote down vote up
@Bean
public WebSocketConnectionManager wsConnectionManager() {

    WebSocketConnectionManager manager = new WebSocketConnectionManager(client(), handler(), this.webSocketUri);
    manager.setAutoStartup(true);

    return manager;
}
 
Example #3
Source File: NodeServiceImpl.java    From java-trader with Apache License 2.0 5 votes vote down vote up
private WebSocketConnectionManager createWsConnectionManager(String url){
    String wsUrl = url;

    SslContextFactory sslContextFactory = new SslContextFactory(true);
    WebSocketClient jettyWsClient = new WebSocketClient(sslContextFactory); //SystemUtil.asyncExecutor
    jettyWsClient.getPolicy().setIdleTimeout(10*60*1000);
    JettyWebSocketClient wsClient = new JettyWebSocketClient(jettyWsClient);
    return new WebSocketConnectionManager(wsClient, this, wsUrl);
}
 
Example #4
Source File: Bot.java    From jbot with GNU General Public License v3.0 5 votes vote down vote up
/**
 * Entry point where the web socket connection starts
 * and after which your bot becomes live.
 */
@PostConstruct
protected void startRTMAndWebSocketConnection() {
    slackService.connectRTM(getSlackToken());
    if (slackService.getWebSocketUrl() != null) {
        webSocketManager = new WebSocketConnectionManager(client(), handler(), slackService.getWebSocketUrl());
        webSocketManager.start();
    } else {
        logger.error("No web socket url returned by Slack.");
    }
}