1
1
/*
2
- * Copyright 2002-2023 the original author or authors.
2
+ * Copyright 2002-2024 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -372,7 +372,7 @@ protected StompHeaders processConnectHeaders(@Nullable StompHeaders connectHeade
372
372
private class WebSocketTcpConnectionHandlerAdapter implements BiConsumer <WebSocketSession , Throwable >,
373
373
WebSocketHandler , TcpConnection <byte []> {
374
374
375
- private final TcpConnectionHandler <byte []> connectionHandler ;
375
+ private final TcpConnectionHandler <byte []> stompSession ;
376
376
377
377
private final StompWebSocketMessageCodec codec = new StompWebSocketMessageCodec (getInboundMessageSizeLimit ());
378
378
@@ -385,17 +385,17 @@ private class WebSocketTcpConnectionHandlerAdapter implements BiConsumer<WebSock
385
385
386
386
private final List <ScheduledFuture <?>> inactivityTasks = new ArrayList <>(2 );
387
387
388
- public WebSocketTcpConnectionHandlerAdapter (TcpConnectionHandler <byte []> connectionHandler ) {
389
- Assert .notNull (connectionHandler , "TcpConnectionHandler must not be null" );
390
- this .connectionHandler = connectionHandler ;
388
+ public WebSocketTcpConnectionHandlerAdapter (TcpConnectionHandler <byte []> stompSession ) {
389
+ Assert .notNull (stompSession , "TcpConnectionHandler must not be null" );
390
+ this .stompSession = stompSession ;
391
391
}
392
392
393
393
// CompletableFuture callback implementation: handshake outcome
394
394
395
395
@ Override
396
396
public void accept (@ Nullable WebSocketSession webSocketSession , @ Nullable Throwable throwable ) {
397
397
if (throwable != null ) {
398
- this .connectionHandler .afterConnectFailure (throwable );
398
+ this .stompSession .afterConnectFailure (throwable );
399
399
}
400
400
}
401
401
@@ -404,7 +404,7 @@ public void accept(@Nullable WebSocketSession webSocketSession, @Nullable Throwa
404
404
@ Override
405
405
public void afterConnectionEstablished (WebSocketSession session ) {
406
406
this .session = session ;
407
- this .connectionHandler .afterConnected (this );
407
+ this .stompSession .afterConnected (this );
408
408
}
409
409
410
410
@ Override
@@ -415,23 +415,23 @@ public void handleMessage(WebSocketSession session, WebSocketMessage<?> webSocke
415
415
messages = this .codec .decode (webSocketMessage );
416
416
}
417
417
catch (Throwable ex ) {
418
- this .connectionHandler .handleFailure (ex );
418
+ this .stompSession .handleFailure (ex );
419
419
return ;
420
420
}
421
421
for (Message <byte []> message : messages ) {
422
- this .connectionHandler .handleMessage (message );
422
+ this .stompSession .handleMessage (message );
423
423
}
424
424
}
425
425
426
426
@ Override
427
- public void handleTransportError (WebSocketSession session , Throwable ex ) throws Exception {
428
- this .connectionHandler .handleFailure (ex );
427
+ public void handleTransportError (WebSocketSession session , Throwable ex ) {
428
+ this .stompSession .handleFailure (ex );
429
429
}
430
430
431
431
@ Override
432
- public void afterConnectionClosed (WebSocketSession session , CloseStatus closeStatus ) throws Exception {
432
+ public void afterConnectionClosed (WebSocketSession session , CloseStatus closeStatus ) {
433
433
cancelInactivityTasks ();
434
- this .connectionHandler .afterConnectionClosed ();
434
+ this .stompSession .afterConnectionClosed ();
435
435
}
436
436
437
437
private void cancelInactivityTasks () {
0 commit comments