@@ -48,30 +48,32 @@ public void bufferFrame(Runnable bufferedFrame) {
48
48
bufferedFrames .add (bufferedFrame );
49
49
}
50
50
51
- @ Override
52
- public final void onThrowable (Throwable t ) {
53
- onFailure (t );
54
- }
51
+ protected void onStatusReceived0 (HttpResponseStatus responseStatus ) throws Exception {}
55
52
56
- public boolean touchSuccess () {
57
- boolean prev = onSuccessCalled ;
58
- onSuccessCalled = true ;
59
- return prev ;
60
- }
53
+ protected void onHeadersReceived0 (HttpResponseHeaders headers ) throws Exception {}
61
54
62
- @ Override
63
- public final State onBodyPartReceived (HttpResponseBodyPart bodyPart ) throws Exception {
64
- return State .CONTINUE ;
65
- }
55
+ protected void onBodyPartReceived0 (HttpResponseBodyPart bodyPart ) throws Exception {}
56
+
57
+ protected void onCompleted0 () throws Exception {}
58
+
59
+ protected void onThrowable0 (Throwable t ) {}
66
60
67
61
@ Override
68
62
public final State onStatusReceived (HttpResponseStatus responseStatus ) throws Exception {
63
+ onStatusReceived0 (responseStatus );
69
64
status = responseStatus .getStatusCode ();
70
65
return status == SWITCHING_PROTOCOLS ? State .UPGRADE : State .ABORT ;
71
66
}
72
67
73
68
@ Override
74
69
public final State onHeadersReceived (HttpResponseHeaders headers ) throws Exception {
70
+ onHeadersReceived0 (headers );
71
+ return State .CONTINUE ;
72
+ }
73
+
74
+ @ Override
75
+ public final State onBodyPartReceived (HttpResponseBodyPart bodyPart ) throws Exception {
76
+ onBodyPartReceived0 (bodyPart );
75
77
return State .CONTINUE ;
76
78
}
77
79
@@ -85,9 +87,22 @@ public final WebSocket onCompleted() throws Exception {
85
87
throw e ;
86
88
}
87
89
90
+ onCompleted0 ();
88
91
return webSocket ;
89
92
}
90
93
94
+ @ Override
95
+ public final void onThrowable (Throwable t ) {
96
+ onThrowable0 (t );
97
+ onFailure (t );
98
+ }
99
+
100
+ public boolean touchSuccess () {
101
+ boolean prev = onSuccessCalled ;
102
+ onSuccessCalled = true ;
103
+ return prev ;
104
+ }
105
+
91
106
@ Override
92
107
public final void onSuccess (WebSocket webSocket ) {
93
108
this .webSocket = webSocket ;
0 commit comments