@@ -28,13 +28,13 @@ final class DefaultGracefulShutdown implements GracefulShutdown {
28
28
29
29
private final Duration quietPeriod ;
30
30
private final Duration timeout ;
31
- private final BiFunction <ServiceRequestContext , HttpRequest , Throwable > errorFunction ;
31
+ private final BiFunction <ServiceRequestContext , HttpRequest , Throwable > toExceptionFunction ;
32
32
33
33
DefaultGracefulShutdown (Duration quietPeriod , Duration timeout ,
34
- BiFunction <ServiceRequestContext , HttpRequest , Throwable > errorFunction ) {
34
+ BiFunction <ServiceRequestContext , HttpRequest , Throwable > toExceptionFunction ) {
35
35
this .quietPeriod = quietPeriod ;
36
36
this .timeout = timeout ;
37
- this .errorFunction = errorFunction ;
37
+ this .toExceptionFunction = toExceptionFunction ;
38
38
}
39
39
40
40
@ Override
@@ -48,8 +48,8 @@ public Duration timeout() {
48
48
}
49
49
50
50
@ Override
51
- public Throwable shutdownError (ServiceRequestContext ctx , HttpRequest request ) {
52
- return errorFunction .apply (ctx , request );
51
+ public Throwable toException (ServiceRequestContext ctx , HttpRequest request ) {
52
+ return toExceptionFunction .apply (ctx , request );
53
53
}
54
54
55
55
@ Override
@@ -63,20 +63,20 @@ public boolean equals(Object o) {
63
63
final DefaultGracefulShutdown that = (DefaultGracefulShutdown ) o ;
64
64
return quietPeriod .equals (that .quietPeriod ) &&
65
65
timeout .equals (that .timeout ) &&
66
- errorFunction .equals (that .errorFunction );
66
+ toExceptionFunction .equals (that .toExceptionFunction );
67
67
}
68
68
69
69
@ Override
70
70
public int hashCode () {
71
- return Objects .hash (quietPeriod , timeout , errorFunction );
71
+ return Objects .hash (quietPeriod , timeout , toExceptionFunction );
72
72
}
73
73
74
74
@ Override
75
75
public String toString () {
76
76
return MoreObjects .toStringHelper (this )
77
77
.add ("quietPeriod" , quietPeriod )
78
78
.add ("timeout" , timeout )
79
- .add ("errorFunction " , errorFunction )
79
+ .add ("toExceptionFunction " , toExceptionFunction )
80
80
.toString ();
81
81
}
82
82
}
0 commit comments