当前位置: 首页>>代码示例>>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;未经允许,请勿转载。