當前位置: 首頁>>代碼示例>>Java>>正文


Java StompEndpointRegistry類代碼示例

本文整理匯總了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("*");
}
 
開發者ID:langtianya,項目名稱:spring4-understanding,代碼行數:9,代碼來源:WebSocketStompClientIntegrationTests.java

示例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);
}
 
開發者ID:alex-bretet,項目名稱:cloudstreetmarket.com,代碼行數:17,代碼來源:WebSocketConfig.java

示例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());
}
 
開發者ID:dzhw,項目名稱:metadatamanagement,代碼行數:9,代碼來源:WebSocketConfig.java

示例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());
}
 
開發者ID:xm-online,項目名稱:xm-gate,代碼行數:10,代碼來源:WebsocketConfiguration.java

示例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支持
}
 
開發者ID:yujunhao8831,項目名稱:spring-boot-start-current,代碼行數:14,代碼來源:WebSocketConfig.java

示例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();
}
 
開發者ID:Coding,項目名稱:WebIDE-Backend,代碼行數:8,代碼來源:WebSocketConfig.java

示例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()
	//
	;
}
 
開發者ID:metasfresh,項目名稱:metasfresh-webui-api,代碼行數:12,代碼來源:WebSocketConfig.java

示例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();
}
 
開發者ID:luxons,項目名稱:seven-wonders,代碼行數:8,代碼來源:WebSocketConfig.java

示例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();

}
 
開發者ID:capside,項目名稱:aws-kinesis-zombies,代碼行數:9,代碼來源:WebSocketConfig.java

示例11: registerStompEndpoints

import org.springframework.web.socket.config.annotation.StompEndpointRegistry; //導入依賴的package包/類
@Override
public void registerStompEndpoints(StompEndpointRegistry registry) {
    registry
        .addEndpoint("/stomp")
        .setAllowedOrigins("*")
        .withSockJS()
    ;
}
 
開發者ID:Vidada-Project,項目名稱:vidada-server,代碼行數:9,代碼來源:WebSocketConfig.java

示例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);
}
 
開發者ID:esacinc,項目名稱:sdcct,代碼行數:9,代碼來源:SdcctWebSocketMessageBrokerConfiguration.java

示例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();
}
 
開發者ID:the-james-burton,項目名稱:the-turbine,代碼行數:11,代碼來源:WebSocketConfig.java

示例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));
    }
}
 
開發者ID:Appverse,項目名稱:appverse-server,代碼行數:15,代碼來源:FrontFacadeWebSocketSecurityAutoConfiguration.java

示例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


注:本文中的org.springframework.web.socket.config.annotation.StompEndpointRegistry類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。