本文整理了Java中org.springframework.web.socket.handler.WebSocketHandlerDecorator.unwrap()
方法的一些代码示例,展示了WebSocketHandlerDecorator.unwrap()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。WebSocketHandlerDecorator.unwrap()
方法的具体详情如下:
包路径:org.springframework.web.socket.handler.WebSocketHandlerDecorator
类名称:WebSocketHandlerDecorator
方法名:unwrap
暂无
代码示例来源:origin: spring-projects/spring-framework
private static SubProtocolWebSocketHandler unwrapSubProtocolWebSocketHandler(WebSocketHandler handler) {
WebSocketHandler actual = WebSocketHandlerDecorator.unwrap(handler);
if (!(actual instanceof SubProtocolWebSocketHandler)) {
throw new IllegalArgumentException("No SubProtocolWebSocketHandler in " + handler);
}
return (SubProtocolWebSocketHandler) actual;
}
代码示例来源:origin: spring-projects/spring-framework
public SockJsWebSocketHandler(SockJsServiceConfig serviceConfig, WebSocketHandler webSocketHandler,
WebSocketServerSockJsSession sockJsSession) {
Assert.notNull(serviceConfig, "serviceConfig must not be null");
Assert.notNull(webSocketHandler, "webSocketHandler must not be null");
Assert.notNull(sockJsSession, "session must not be null");
this.sockJsServiceConfig = serviceConfig;
this.sockJsSession = sockJsSession;
webSocketHandler = WebSocketHandlerDecorator.unwrap(webSocketHandler);
this.subProtocols = ((webSocketHandler instanceof SubProtocolCapable) ?
new ArrayList<>(((SubProtocolCapable) webSocketHandler).getSubProtocols()) : Collections.emptyList());
}
代码示例来源:origin: spring-projects/spring-framework
/**
* Determine the sub-protocols supported by the given WebSocketHandler by
* checking whether it is an instance of {@link SubProtocolCapable}.
* @param handler the handler to check
* @return a list of supported protocols, or an empty list if none available
*/
protected final List<String> determineHandlerSupportedProtocols(WebSocketHandler handler) {
WebSocketHandler handlerToCheck = WebSocketHandlerDecorator.unwrap(handler);
List<String> subProtocols = null;
if (handlerToCheck instanceof SubProtocolCapable) {
subProtocols = ((SubProtocolCapable) handlerToCheck).getSubProtocols();
}
return (subProtocols != null ? subProtocols : Collections.emptyList());
}
代码示例来源:origin: org.springframework/spring-websocket
private static SubProtocolWebSocketHandler unwrapSubProtocolWebSocketHandler(WebSocketHandler handler) {
WebSocketHandler actual = WebSocketHandlerDecorator.unwrap(handler);
if (!(actual instanceof SubProtocolWebSocketHandler)) {
throw new IllegalArgumentException("No SubProtocolWebSocketHandler in " + handler);
}
return (SubProtocolWebSocketHandler) actual;
}
代码示例来源:origin: ch.rasc/wampspring
private static SubProtocolWebSocketHandler unwrapSubProtocolWebSocketHandler(
WebSocketHandler wsHandler) {
WebSocketHandler actual = WebSocketHandlerDecorator.unwrap(wsHandler);
Assert.isInstanceOf(SubProtocolWebSocketHandler.class, actual,
"No SubProtocolWebSocketHandler in " + wsHandler);
return (SubProtocolWebSocketHandler) actual;
}
代码示例来源:origin: apache/servicemix-bundles
private static SubProtocolWebSocketHandler unwrapSubProtocolWebSocketHandler(WebSocketHandler handler) {
WebSocketHandler actual = WebSocketHandlerDecorator.unwrap(handler);
if (!(actual instanceof SubProtocolWebSocketHandler)) {
throw new IllegalArgumentException("No SubProtocolWebSocketHandler in " + handler);
}
return (SubProtocolWebSocketHandler) actual;
}
代码示例来源:origin: org.springframework/spring-websocket
public SockJsWebSocketHandler(SockJsServiceConfig serviceConfig, WebSocketHandler webSocketHandler,
WebSocketServerSockJsSession sockJsSession) {
Assert.notNull(serviceConfig, "serviceConfig must not be null");
Assert.notNull(webSocketHandler, "webSocketHandler must not be null");
Assert.notNull(sockJsSession, "session must not be null");
this.sockJsServiceConfig = serviceConfig;
this.sockJsSession = sockJsSession;
webSocketHandler = WebSocketHandlerDecorator.unwrap(webSocketHandler);
this.subProtocols = ((webSocketHandler instanceof SubProtocolCapable) ?
new ArrayList<>(((SubProtocolCapable) webSocketHandler).getSubProtocols()) : Collections.emptyList());
}
代码示例来源:origin: apache/servicemix-bundles
public SockJsWebSocketHandler(SockJsServiceConfig serviceConfig, WebSocketHandler webSocketHandler,
WebSocketServerSockJsSession sockJsSession) {
Assert.notNull(serviceConfig, "serviceConfig must not be null");
Assert.notNull(webSocketHandler, "webSocketHandler must not be null");
Assert.notNull(sockJsSession, "session must not be null");
this.sockJsServiceConfig = serviceConfig;
this.sockJsSession = sockJsSession;
webSocketHandler = WebSocketHandlerDecorator.unwrap(webSocketHandler);
this.subProtocols = ((webSocketHandler instanceof SubProtocolCapable) ?
new ArrayList<>(((SubProtocolCapable) webSocketHandler).getSubProtocols()) : Collections.emptyList());
}
代码示例来源:origin: org.springframework/spring-websocket
/**
* Determine the sub-protocols supported by the given WebSocketHandler by
* checking whether it is an instance of {@link SubProtocolCapable}.
* @param handler the handler to check
* @return a list of supported protocols, or an empty list if none available
*/
protected final List<String> determineHandlerSupportedProtocols(WebSocketHandler handler) {
WebSocketHandler handlerToCheck = WebSocketHandlerDecorator.unwrap(handler);
List<String> subProtocols = null;
if (handlerToCheck instanceof SubProtocolCapable) {
subProtocols = ((SubProtocolCapable) handlerToCheck).getSubProtocols();
}
return (subProtocols != null ? subProtocols : Collections.emptyList());
}
代码示例来源:origin: apache/servicemix-bundles
/**
* Determine the sub-protocols supported by the given WebSocketHandler by
* checking whether it is an instance of {@link SubProtocolCapable}.
* @param handler the handler to check
* @return a list of supported protocols, or an empty list if none available
*/
protected final List<String> determineHandlerSupportedProtocols(WebSocketHandler handler) {
WebSocketHandler handlerToCheck = WebSocketHandlerDecorator.unwrap(handler);
List<String> subProtocols = null;
if (handlerToCheck instanceof SubProtocolCapable) {
subProtocols = ((SubProtocolCapable) handlerToCheck).getSubProtocols();
}
return (subProtocols != null ? subProtocols : Collections.emptyList());
}
内容来源于网络,如有侵权,请联系作者删除!