@@ -36,29 +36,41 @@ public class WebSocketUpgradeHandler implements AsyncHandler<NettyWebSocket> {
3636 public WebSocketUpgradeHandler (List <WebSocketListener > listeners ) {
3737 this .listeners = listeners ;
3838 }
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 () {}
3946
4047 @ Override
4148 public final State onStatusReceived (HttpResponseStatus responseStatus ) throws Exception {
49+ onStatusReceived0 (responseStatus );
4250 return responseStatus .getStatusCode () == SWITCHING_PROTOCOLS ? State .CONTINUE : State .ABORT ;
4351 }
4452
4553 @ Override
4654 public final State onHeadersReceived (HttpHeaders headers ) throws Exception {
55+ onHeadersReceived0 (headers );
4756 return State .CONTINUE ;
4857 }
4958
5059 @ Override
5160 public final State onBodyPartReceived (HttpResponseBodyPart bodyPart ) throws Exception {
61+ onBodyPartReceived0 (bodyPart );
5262 return State .CONTINUE ;
5363 }
5464
5565 @ Override
5666 public final NettyWebSocket onCompleted () throws Exception {
67+ onCompleted0 ();
5768 return webSocket ;
5869 }
5970
6071 @ Override
6172 public final void onThrowable (Throwable t ) {
73+ onThrowable0 (t );
6274 for (WebSocketListener listener : listeners ) {
6375 if (webSocket != null ) {
6476 webSocket .addWebSocketListener (listener );
@@ -72,6 +84,7 @@ public final void setWebSocket(NettyWebSocket webSocket) {
7284 }
7385
7486 public final void onOpen () {
87+ onOpen0 ();
7588 for (WebSocketListener listener : listeners ) {
7689 webSocket .addWebSocketListener (listener );
7790 listener .onOpen (webSocket );
0 commit comments