Interface StateTrackingHandler.Listener
- All Superinterfaces:
EventListener
- Enclosing class:
- StateTrackingHandler
Listener of events emitted by StateTrackingHandler
.
The methods of this interface are named after the wrong API usages
tracked by StateTrackingHandler
.
-
Method Summary
Modifier and TypeMethodDescriptiondefault void
onDemandCallbackBlocked
(Request request, StateTrackingHandler.ThreadInfo demandThreadInfo, StateTrackingHandler.ThreadInfo runThreadInfo) Invoked when therequest demand callback
run()
method blocks for longer than the timeout specified withStateTrackingHandler.getDemandCallbackTimeout()
.default void
onHandlerCallbackNotCompleted
(Request request, StateTrackingHandler.ThreadInfo handlerThreadInfo) Invoked when theHandler
callback is not completed within the timeout specified withStateTrackingHandler.getHandlerCallbackTimeout()
.default void
onHandlerException
(Request request, Throwable failure, StateTrackingHandler.ThreadInfo completionThreadInfo) Invoked when theHandler
chain throws an exception from theRequest.Handler.handle(Request, Response, Callback)
method.default void
onInvalidHandlerReturnValue
(Request request, StateTrackingHandler.ThreadInfo completionThreadInfo) Invoked when theHandler
chain returnsfalse
, but the handler callback has been completed.default void
onWriteBlocked
(Request request, StateTrackingHandler.ThreadInfo writeThreadInfo, StateTrackingHandler.ThreadInfo writingThreadInfo) Invoked when theResponse.write(boolean, ByteBuffer, Callback)
call blocks for longer than the timeout specified withStateTrackingHandler.getWriteTimeout()
.default void
onWriteCallbackBlocked
(Request request, Throwable writeFailure, StateTrackingHandler.ThreadInfo writeThreadInfo, StateTrackingHandler.ThreadInfo callbackThreadInfo) Invoked when the write callback passed toResponse.write(boolean, ByteBuffer, Callback)
blocks for longer than the timeout specified withStateTrackingHandler.getWriteCallbackTimeout()
.default void
onWriteCallbackNotCompleted
(Request request, Throwable writeFailure, StateTrackingHandler.ThreadInfo writeThreadInfo) Invoked when the write callback passed toResponse.write(boolean, ByteBuffer, Callback)
is not completed for longer than the timeout specified withStateTrackingHandler.getWriteTimeout()
.
-
Method Details
-
onInvalidHandlerReturnValue
default void onInvalidHandlerReturnValue(Request request, StateTrackingHandler.ThreadInfo completionThreadInfo) Invoked when the
Handler
chain returnsfalse
, but the handler callback has been completed.This event is always enabled.
- Parameters:
request
- the current requestcompletionThreadInfo
- theStateTrackingHandler.ThreadInfo
of the thread that completed the handler callback
-
onHandlerException
default void onHandlerException(Request request, Throwable failure, StateTrackingHandler.ThreadInfo completionThreadInfo) Invoked when the
Handler
chain throws an exception from theRequest.Handler.handle(Request, Response, Callback)
method.This event is always enabled.
- Parameters:
request
- the current requestfailure
- the exception throwncompletionThreadInfo
- theStateTrackingHandler.ThreadInfo
of the thread that completed the handler callback, ornull
if the handler callback has not been completed
-
onHandlerCallbackNotCompleted
default void onHandlerCallbackNotCompleted(Request request, StateTrackingHandler.ThreadInfo handlerThreadInfo) Invoked when the
Handler
callback is not completed within the timeout specified withStateTrackingHandler.getHandlerCallbackTimeout()
.This event is enabled only when
StateTrackingHandler.getHandlerCallbackTimeout()
is non-null
.When handler thread has already returned from the handler chain, the thread info parameter is
null
. Otherwise, the handler thread has not returned yet and may be blocked, and the thread info parameter is notnull
.Note: when present, the thread info stack trace may not be accurate, as the thread blockage might have resolved just before the thread info was taken.
- Parameters:
request
- the current requesthandlerThreadInfo
- the handler thread info, ornull
if the handler thread already returned from the handler chain
-
onDemandCallbackBlocked
default void onDemandCallbackBlocked(Request request, StateTrackingHandler.ThreadInfo demandThreadInfo, StateTrackingHandler.ThreadInfo runThreadInfo) Invoked when the
request demand callback
run()
method blocks for longer than the timeout specified withStateTrackingHandler.getDemandCallbackTimeout()
.This event is enabled only when
StateTrackingHandler.getDemandCallbackTimeout()
is non-null
.Note: the thread info stack trace of the thread that is running the demand callback may not be accurate, as the thread blockage might have resolved just before the thread info was taken.
- Parameters:
request
- the current requestdemandThreadInfo
- the thread info of the thread that calledRequest.demand(Runnable)
runThreadInfo
- the thread info of the thread running the demand callback
-
onWriteBlocked
default void onWriteBlocked(Request request, StateTrackingHandler.ThreadInfo writeThreadInfo, StateTrackingHandler.ThreadInfo writingThreadInfo) Invoked when the
Response.write(boolean, ByteBuffer, Callback)
call blocks for longer than the timeout specified withStateTrackingHandler.getWriteTimeout()
.This event is enabled only when
StateTrackingHandler.getWriteTimeout()
is non-null
.Note: the thread info stack trace of the thread that is writing may not be accurate, as the thread blockage might have resolved just before the thread info was taken.
- Parameters:
request
- the current requestwriteThreadInfo
- the thread info of the thread that calledResponse.write(boolean, ByteBuffer, Callback)
writingThreadInfo
- the thread info of the thread tht is writing
-
onWriteCallbackNotCompleted
default void onWriteCallbackNotCompleted(Request request, Throwable writeFailure, StateTrackingHandler.ThreadInfo writeThreadInfo) Invoked when the write callback passed to
Response.write(boolean, ByteBuffer, Callback)
is not completed for longer than the timeout specified withStateTrackingHandler.getWriteTimeout()
.This event is enabled only when
StateTrackingHandler.getWriteTimeout()
is non-null
.Note that the write might have been fully performed, but since the callback is not completed, this case is indistinguishable from the case where the callback is not complete because the write has not been fully performed.
- Parameters:
request
- the current requestwriteFailure
- the write failure, ornull
if the write succeededwriteThreadInfo
- the thread info of the thread that calledResponse.write(boolean, ByteBuffer, Callback)
-
onWriteCallbackBlocked
default void onWriteCallbackBlocked(Request request, Throwable writeFailure, StateTrackingHandler.ThreadInfo writeThreadInfo, StateTrackingHandler.ThreadInfo callbackThreadInfo) Invoked when the write callback passed to
Response.write(boolean, ByteBuffer, Callback)
blocks for longer than the timeout specified withStateTrackingHandler.getWriteCallbackTimeout()
.This event is enabled only when
StateTrackingHandler.getWriteCallbackTimeout()
is non-null
.Note: the thread info stack trace of the thread that is running the write callback may not be accurate, as the thread blockage might have resolved just before the thread info was taken.
- Parameters:
request
- the current requestwriteFailure
- the write failure, ornull
if the write succeededwriteThreadInfo
- the thread info of the thread that calledResponse.write(boolean, ByteBuffer, Callback)
callbackThreadInfo
- the thread info of the thread invoking the write callback
-