当前位置: 首页>>代码示例>>Java>>正文


Java ConcurrentWebSocketSessionDecorator类代码示例

本文整理汇总了Java中org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator的典型用法代码示例。如果您正苦于以下问题:Java ConcurrentWebSocketSessionDecorator类的具体用法?Java ConcurrentWebSocketSessionDecorator怎么用?Java ConcurrentWebSocketSessionDecorator使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。


ConcurrentWebSocketSessionDecorator类属于org.springframework.web.socket.handler包,在下文中一共展示了ConcurrentWebSocketSessionDecorator类的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: afterConnectionEstablished

import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator; //导入依赖的package包/类
@Override
public void afterConnectionEstablished(WebSocketSession session) throws Exception {
    ConcurrentWebSocketSessionDecorator decorator =
            new ConcurrentWebSocketSessionDecorator(session, sendTimeLimit, bufferSizeLimit);

    sessions.put(session.getId(), decorator);
    this.onOpen(decorator);
}
 
开发者ID:RWTH-i5-IDSG,项目名称:BikeMan,代码行数:9,代码来源:ConcurrentTextWebSocketHandler.java

示例2: subProtocolMatch

import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator; //导入依赖的package包/类
@Test
public void subProtocolMatch() throws Exception {
	this.webSocketHandler.setProtocolHandlers(Arrays.asList(stompHandler, mqttHandler));
	this.session.setAcceptedProtocol("v12.sToMp");
	this.webSocketHandler.afterConnectionEstablished(session);

	verify(this.stompHandler).afterSessionStarted(
			isA(ConcurrentWebSocketSessionDecorator.class), eq(this.inClientChannel));
	verify(this.mqttHandler, times(0)).afterSessionStarted(session, this.inClientChannel);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:SubProtocolWebSocketHandlerTests.java

示例3: subProtocolDefaultHandlerOnly

import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator; //导入依赖的package包/类
@Test
public void subProtocolDefaultHandlerOnly() throws Exception {
	this.webSocketHandler.setDefaultProtocolHandler(stompHandler);
	this.session.setAcceptedProtocol("v12.sToMp");
	this.webSocketHandler.afterConnectionEstablished(session);

	verify(this.stompHandler).afterSessionStarted(
			isA(ConcurrentWebSocketSessionDecorator.class), eq(this.inClientChannel));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:10,代码来源:SubProtocolWebSocketHandlerTests.java

示例4: nullSubProtocol

import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator; //导入依赖的package包/类
@Test
public void nullSubProtocol() throws Exception {
	this.webSocketHandler.setDefaultProtocolHandler(defaultHandler);
	this.webSocketHandler.afterConnectionEstablished(session);

	verify(this.defaultHandler).afterSessionStarted(
			isA(ConcurrentWebSocketSessionDecorator.class), eq(this.inClientChannel));
	verify(this.stompHandler, times(0)).afterSessionStarted(session, this.inClientChannel);
	verify(this.mqttHandler, times(0)).afterSessionStarted(session, this.inClientChannel);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:11,代码来源:SubProtocolWebSocketHandlerTests.java

示例5: emptySubProtocol

import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator; //导入依赖的package包/类
@Test
public void emptySubProtocol() throws Exception {
	this.session.setAcceptedProtocol("");
	this.webSocketHandler.setDefaultProtocolHandler(this.defaultHandler);
	this.webSocketHandler.afterConnectionEstablished(session);

	verify(this.defaultHandler).afterSessionStarted(
			isA(ConcurrentWebSocketSessionDecorator.class), eq(this.inClientChannel));
	verify(this.stompHandler, times(0)).afterSessionStarted(session, this.inClientChannel);
	verify(this.mqttHandler, times(0)).afterSessionStarted(session, this.inClientChannel);
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:12,代码来源:SubProtocolWebSocketHandlerTests.java

示例6: noSubProtocolOneHandler

import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator; //导入依赖的package包/类
@Test
public void noSubProtocolOneHandler() throws Exception {
	this.webSocketHandler.setProtocolHandlers(Arrays.asList(stompHandler));
	this.webSocketHandler.afterConnectionEstablished(session);

	verify(this.stompHandler).afterSessionStarted(
			isA(ConcurrentWebSocketSessionDecorator.class), eq(this.inClientChannel));
}
 
开发者ID:langtianya,项目名称:spring4-understanding,代码行数:9,代码来源:SubProtocolWebSocketHandlerTests.java

示例7: internalGet

import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator; //导入依赖的package包/类
private ConcurrentWebSocketSessionDecorator internalGet(WebSocketSession session) {
    ConcurrentWebSocketSessionDecorator decorator = sessions.get(session.getId());
    if (decorator == null) {
        throw new NoSuchElementException();
    }
    return decorator;
}
 
开发者ID:RWTH-i5-IDSG,项目名称:BikeMan,代码行数:8,代码来源:ConcurrentTextWebSocketHandler.java

示例8: afterConnectionClosed

import org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator; //导入依赖的package包/类
@Override
public void afterConnectionClosed(WebSocketSession session, CloseStatus closeStatus) throws Exception {
    ConcurrentWebSocketSessionDecorator decorator = sessions.remove(session.getId());
    this.onClose(decorator, closeStatus);
}
 
开发者ID:RWTH-i5-IDSG,项目名称:BikeMan,代码行数:6,代码来源:ConcurrentTextWebSocketHandler.java


注:本文中的org.springframework.web.socket.handler.ConcurrentWebSocketSessionDecorator类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。