本文整理匯總了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"));
}