@@ -36,29 +36,41 @@ public class WebSocketUpgradeHandler implements AsyncHandler<NettyWebSocket> {
36
36
public WebSocketUpgradeHandler (List <WebSocketListener > listeners ) {
37
37
this .listeners = listeners ;
38
38
}
39
+
40
+ protected void onStatusReceived0 (HttpResponseStatus responseStatus ) throws Exception {}
41
+ protected void onHeadersReceived0 (HttpHeaders headers ) throws Exception {}
42
+ protected void onBodyPartReceived0 (HttpResponseBodyPart bodyPart ) throws Exception {}
43
+ protected void onCompleted0 () throws Exception {}
44
+ protected void onThrowable0 (Throwable t ) {}
45
+ protected void onOpen0 () {}
39
46
40
47
@ Override
41
48
public final State onStatusReceived (HttpResponseStatus responseStatus ) throws Exception {
49
+ onStatusReceived0 (responseStatus );
42
50
return responseStatus .getStatusCode () == SWITCHING_PROTOCOLS ? State .CONTINUE : State .ABORT ;
43
51
}
44
52
45
53
@ Override
46
54
public final State onHeadersReceived (HttpHeaders headers ) throws Exception {
55
+ onHeadersReceived0 (headers );
47
56
return State .CONTINUE ;
48
57
}
49
58
50
59
@ Override
51
60
public final State onBodyPartReceived (HttpResponseBodyPart bodyPart ) throws Exception {
61
+ onBodyPartReceived0 (bodyPart );
52
62
return State .CONTINUE ;
53
63
}
54
64
55
65
@ Override
56
66
public final NettyWebSocket onCompleted () throws Exception {
67
+ onCompleted0 ();
57
68
return webSocket ;
58
69
}
59
70
60
71
@ Override
61
72
public final void onThrowable (Throwable t ) {
73
+ onThrowable0 (t );
62
74
for (WebSocketListener listener : listeners ) {
63
75
if (webSocket != null ) {
64
76
webSocket .addWebSocketListener (listener );
@@ -72,6 +84,7 @@ public final void setWebSocket(NettyWebSocket webSocket) {
72
84
}
73
85
74
86
public final void onOpen () {
87
+ onOpen0 ();
75
88
for (WebSocketListener listener : listeners ) {
76
89
webSocket .addWebSocketListener (listener );
77
90
listener .onOpen (webSocket );
0 commit comments