本文整理汇总了Java中org.springframework.web.socket.config.annotation.StompEndpointRegistry.addEndpoint方法的典型用法代码示例。如果您正苦于以下问题:Java StompEndpointRegistry.addEndpoint方法的具体用法?Java StompEndpointRegistry.addEndpoint怎么用?Java StompEndpointRegistry.addEndpoint使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.springframework.web.socket.config.annotation.StompEndpointRegistry
的用法示例。
在下文中一共展示了StompEndpointRegistry.addEndpoint方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入方法依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/hello");
}
示例2: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入方法依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
logger.info("Initializing websocket standard on path:'{}' ...", defaultWebsocketEndpointPath);
StompWebSocketEndpointRegistration webSockedEndpoint = stompEndpointRegistry.addEndpoint(defaultWebsocketEndpointPath);
logger.info("Initializing websocket sockJs on path:'{}' ...", defaultSockJsEndpointPath);
StompWebSocketEndpointRegistration sockJsEndpoint = stompEndpointRegistry.addEndpoint(defaultSockJsEndpointPath);
sockJsEndpoint.withSockJS();
if (Boolean.valueOf(corsEnabled)){
logger.info("Initializing cors on websockets");
webSockedEndpoint.setAllowedOrigins(StringUtils.commaDelimitedListToStringArray(allowedOrigins));
sockJsEndpoint.setAllowedOrigins(StringUtils.commaDelimitedListToStringArray(allowedOrigins));
}
}
示例3: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入方法依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/socket");
registry.addEndpoint("/socket").withSockJS();
}
示例4: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入方法依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
//register chat endpoint and enable SockJS
registry.addEndpoint("/websocket/chat");
registry.addEndpoint("/websocket/chat").withSockJS();
}
示例5: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入方法依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
stompEndpointRegistry.addEndpoint("/test");
}
示例6: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入方法依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/echo");
}
示例7: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入方法依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/stomp");
registry.addEndpoint("/sockjs").withSockJS();
}
示例8: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入方法依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
// Register a pure WebSocket endpoint (ws://myserver.com/ws/rest/messages)
registry.addEndpoint("/messages");
// Register additional fallback handling using sock-js (http://myserver.com/ws/rest/messages)
registry.addEndpoint("/messages").withSockJS();
}