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() {
128
128
return SUB_PROTOCOL_LIST ;
129
129
}
130
130
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
+
131
142
/**
132
143
* Return a {@link WebSocketHttpRequestHandler} that uses this instance as
133
144
* its {@link WebGraphQlHandler} and adds a {@link HandshakeInterceptor} to
134
145
* 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)}
136
147
*/
137
148
@ Deprecated
138
149
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 );
142
151
}
143
152
144
153
You can’t perform that action at this time.
0 commit comments