本文整理汇总了Java中org.springframework.web.socket.config.annotation.StompEndpointRegistry类的典型用法代码示例。如果您正苦于以下问题:Java StompEndpointRegistry类的具体用法?Java StompEndpointRegistry怎么用?Java StompEndpointRegistry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
StompEndpointRegistry类属于org.springframework.web.socket.config.annotation包,在下文中一共展示了StompEndpointRegistry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
protected void registerStompEndpoints(StompEndpointRegistry registry) {
// Can't rely on classpath detection
RequestUpgradeStrategy upgradeStrategy = new TomcatRequestUpgradeStrategy();
registry.addEndpoint("/stomp")
.setHandshakeHandler(new DefaultHandshakeHandler(upgradeStrategy))
.setAllowedOrigins("*");
}
示例2: configureStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
protected void configureStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint(ACTIVITY_FEED_ENDPOINT)
.setAllowedOrigins(protocol.concat(realmName))
.withSockJS()
.setStreamBytesLimit(512 * 1024)
.setHttpMessageCacheSize(1000)
.setDisconnectDelay(30 * 1000);
registry.addEndpoint(PRIVATE_STOCKS_ENDPOINT)
.setAllowedOrigins(protocol.concat(realmName))
.withSockJS()
.setStreamBytesLimit(512 * 1024)
.setHttpMessageCacheSize(1000)
.setDisconnectDelay(30 * 1000);
}
示例3: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/websocket").setAllowedOrigins(
properties.getWebsockets().getAllowedOrigins().toArray(new String[0])).withSockJS()
.setSessionCookieNeeded(false)
.setClientLibraryUrl("/bower_components/sockjs-client/dist/sockjs.min.js")
.setInterceptors(websocketHandshakeInterceptor());
}
示例4: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
String[] allowedOrigins = Optional.ofNullable(jHipsterProperties.getCors().getAllowedOrigins()).map(origins -> origins.toArray(new String[0])).orElse(new String[0]);
registry.addEndpoint("/websocket/tracker")
.setHandshakeHandler(defaultHandshakeHandler())
.setAllowedOrigins(allowedOrigins)
.withSockJS()
.setInterceptors(httpSessionHandshakeInterceptor());
}
示例5: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
/**
* 配置端点注册中心,接收客户端的连接
*
* @param registry 端点注册中心
*/
@Override
public void registerStompEndpoints ( StompEndpointRegistry registry ) {
/* 在指定的映射路径上为Web套接字端点注册一个STOMP. */
// 表示添加了一个 /aidijing 端点,客户端就可以通过这个端点来进行连接.
// aidijing
registry.addEndpoint( stompEndpointsPaths )
.withSockJS(); // 开启SockJS支持
}
示例6: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
boolean wsEnabled = false;
for (Map.Entry<String, ZuulWebSocketProperties.WsBrokerage> entry : zuulWebSocketProperties
.getBrokerages().entrySet()) {
ZuulWebSocketProperties.WsBrokerage wsBrokerage = entry.getValue();
if (wsBrokerage.isEnabled()) {
this.addStompEndpoint(registry, wsBrokerage.getEndPoints());
wsEnabled = true;
}
}
if (!wsEnabled)
this.addStompEndpoint(registry, UUID.randomUUID().toString());
}
开发者ID:mthizo247,项目名称:spring-cloud-netflix-zuul-websocket,代码行数:16,代码来源:ZuulWebSocketConfiguration.java
示例7: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/sockjs")
.addInterceptors(new SpaceKeyHandshakeInterceptor())
.setAllowedOrigins(allowedOrigins)
.withSockJS();
}
示例8: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
public void registerStompEndpoints(final StompEndpointRegistry registry)
{
// the endpoint for websocket connections
registry.addEndpoint(ENDPOINT)
.setAllowedOrigins("*") // FIXME: for now we allow any origin
.addInterceptors(new WebSocketHandshakeInterceptor())
.withSockJS()
//
;
}
示例9: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry.addEndpoint("/seven-wonders-websocket")
.setHandshakeHandler(handshakeHandler())
.setAllowedOrigins("http://localhost:3000") // to allow frontend server proxy requests in dev mode
.withSockJS();
}
示例10: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
// Utiliza este endpoint para connectar desde el navegador
registry
.setErrorHandler(new ErrorHandler())
.addEndpoint("/stomp").withSockJS();
}
示例11: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
registry
.addEndpoint("/stomp")
.setAllowedOrigins("*")
.withSockJS()
;
}
示例12: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
protected void registerStompEndpoints(StompEndpointRegistry stompEndpointRegistry) {
stompEndpointRegistry.addEndpoint(SdcctWebSocketPaths.TESTCASES_IHE_RESULTS)
.setHandshakeHandler(new DefaultHandshakeHandler(new TomcatRequestUpgradeStrategy())).addInterceptors(new HttpSessionHandshakeInterceptor())
.withSockJS().setClientLibraryUrl(this.sockJsClientLibUrl).setDisconnectDelay(this.sockJsDisconnectDelay).setHeartbeatTime(this.sockJsHeartbeatTime)
.setHttpMessageCacheSize(this.sockJsHttpMsgCacheSize).setMessageCodec(new Jackson2SockJsMessageCodec(this.objMapper))
.setStreamBytesLimit(this.sockJsStreamLimit);
}
示例13: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
public void registerStompEndpoints(final StompEndpointRegistry registry) {
this.registry = registry;
String atacamaInGulpServeMode = "http://localhost:3000";
String inProcessWebsite = "http://localhost:48002";
registry.addEndpoint("/reply").setAllowedOrigins(atacamaInGulpServeMode, inProcessWebsite).withSockJS();
registry.addEndpoint("/request").setAllowedOrigins(atacamaInGulpServeMode, inProcessWebsite).withSockJS();
registry.addEndpoint("/ping").setAllowedOrigins(atacamaInGulpServeMode, inProcessWebsite).withSockJS();
registry.addEndpoint("/ticks").setAllowedOrigins(atacamaInGulpServeMode, inProcessWebsite).withSockJS();
}
示例14: 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));
}
}
示例15: registerStompEndpoints
import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //导入依赖的package包/类
@Override
public final void registerStompEndpoints(StompEndpointRegistry registry) {
if (registry instanceof WebMvcStompEndpointRegistry) {
WebMvcStompEndpointRegistry mvcRegistry = (WebMvcStompEndpointRegistry) registry;
configureStompEndpoints(new SessionStompEndpointRegistry(mvcRegistry,
sessionRepositoryInterceptor()));
}
}
开发者ID:spring-projects,项目名称:spring-session,代码行数:9,代码来源:AbstractSessionWebSocketMessageBrokerConfigurer.java