本文整理汇总了Java中org.springframework.web.socket.messaging.SubProtocolHandler类的典型用法代码示例。如果您正苦于以下问题:Java SubProtocolHandler类的具体用法?Java SubProtocolHandler怎么用?Java SubProtocolHandler使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
SubProtocolHandler类属于org.springframework.web.socket.messaging包,在下文中一共展示了SubProtocolHandler类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: initStompSubProtocolHandler
import org.springframework.web.socket.messaging.SubProtocolHandler; //导入依赖的package包/类
private StompSubProtocolHandler initStompSubProtocolHandler() {
for (SubProtocolHandler handler : this.webSocketHandler.getProtocolHandlers()) {
if (handler instanceof StompSubProtocolHandler) {
return (StompSubProtocolHandler) handler;
}
}
SubProtocolHandler defaultHandler = this.webSocketHandler.getDefaultProtocolHandler();
if (defaultHandler != null && defaultHandler instanceof StompSubProtocolHandler) {
return (StompSubProtocolHandler) defaultHandler;
}
return null;
}
示例2: webSocketHandler
import org.springframework.web.socket.messaging.SubProtocolHandler; //导入依赖的package包/类
@Test
public void webSocketHandler() {
ApplicationContext config = createConfig(TestChannelConfig.class, TestConfigurer.class);
SubProtocolWebSocketHandler subWsHandler = config.getBean(SubProtocolWebSocketHandler.class);
assertEquals(1024 * 1024, subWsHandler.getSendBufferSizeLimit());
assertEquals(25 * 1000, subWsHandler.getSendTimeLimit());
Map<String, SubProtocolHandler> handlerMap = subWsHandler.getProtocolHandlerMap();
StompSubProtocolHandler protocolHandler = (StompSubProtocolHandler) handlerMap.get("v12.stomp");
assertEquals(128 * 1024, protocolHandler.getMessageSizeLimit());
}
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:13,代码来源:WebSocketMessageBrokerConfigurationSupportTests.java
示例3: stompProtocolHandler
import org.springframework.web.socket.messaging.SubProtocolHandler; //导入依赖的package包/类
@Test
public void stompProtocolHandler() {
this.endpointRegistry.addEndpoint("/stomp");
Map<String, SubProtocolHandler> protocolHandlers = webSocketHandler.getProtocolHandlerMap();
assertEquals(3, protocolHandlers.size());
assertNotNull(protocolHandlers.get("v10.stomp"));
assertNotNull(protocolHandlers.get("v11.stomp"));
assertNotNull(protocolHandlers.get("v12.stomp"));
}