本文整理匯總了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