File tree Expand file tree Collapse file tree 1 file changed +13
-4
lines changed
spring-graphql/src/main/java/org/springframework/graphql/server/webmvc Expand file tree Collapse file tree 1 file changed +13
-4
lines changed Original file line number Diff line number Diff line change @@ -128,17 +128,26 @@ public List<String> getSubProtocols() {
128128 return SUB_PROTOCOL_LIST ;
129129 }
130130
131+ /**
132+ * Initialize a {@link WebSocketHttpRequestHandler} that wraps this instance
133+ * and also inserts a {@link HandshakeInterceptor} for context propagation.
134+ * @since 1.1.0
135+ */
136+ public WebSocketHttpRequestHandler initWebSocketHttpRequestHandler (HandshakeHandler handshakeHandler ) {
137+ WebSocketHttpRequestHandler handler = new WebSocketHttpRequestHandler (this , handshakeHandler );
138+ handler .setHandshakeInterceptors (Collections .singletonList (this .contextHandshakeInterceptor ));
139+ return handler ;
140+ }
141+
131142 /**
132143 * Return a {@link WebSocketHttpRequestHandler} that uses this instance as
133144 * its {@link WebGraphQlHandler} and adds a {@link HandshakeInterceptor} to
134145 * propagate context.
135- * @deprecated as of 1.1.0 without a replacement, there should be no need for it
146+ * @deprecated as of 1.1.0 in favor of {@link #initWebSocketHttpRequestHandler(HandshakeHandler)}
136147 */
137148 @ Deprecated
138149 public WebSocketHttpRequestHandler asWebSocketHttpRequestHandler (HandshakeHandler handshakeHandler ) {
139- WebSocketHttpRequestHandler handler = new WebSocketHttpRequestHandler (this , handshakeHandler );
140- handler .setHandshakeInterceptors (Collections .singletonList (this .contextHandshakeInterceptor ));
141- return handler ;
150+ return initWebSocketHttpRequestHandler (handshakeHandler );
142151 }
143152
144153
You can’t perform that action at this time.
0 commit comments