Interface RpcInvocationListener
- All Superinterfaces:
Serializable
@ClientCallable method is consuming the time spent holding the
session lock while processing a request).
A single client request typically carries several invocations; the listener
is notified once per invocation. invocationStarted(com.vaadin.flow.server.communication.RpcInvocationEvent),
invocationFailed(com.vaadin.flow.server.communication.RpcInvocationEvent, java.lang.Throwable) (only when the handler threw) and
invocationEnded(com.vaadin.flow.server.communication.RpcInvocationEvent) for one invocation are delivered on the same thread,
in that order, with invocationEnded always delivered after
invocationStarted regardless of outcome, so a listener may keep
timing state in a ThreadLocal.
Implementations must be fast and non-blocking: callbacks run on the request thread directly around invocation handling. Exceptions thrown from a callback are logged and suppressed so they cannot disrupt RPC processing.
Register via
VaadinService.addRpcInvocationListener(RpcInvocationListener),
typically from a VaadinServiceInitListener.
- Since:
- 25.2
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidInvoked on the request thread once an RPC invocation has been handled, whether it completed normally or threw.default voidinvocationFailed(RpcInvocationEvent event, Throwable error) Invoked on the request thread when handling an invocation threw, beforeinvocationEnded(com.vaadin.flow.server.communication.RpcInvocationEvent).default voidInvoked on the request thread immediately before an RPC invocation is handled.
-
Method Details
-
invocationStarted
Invoked on the request thread immediately before an RPC invocation is handled.- Parameters:
event- the invocation event
-
invocationFailed
Invoked on the request thread when handling an invocation threw, beforeinvocationEnded(com.vaadin.flow.server.communication.RpcInvocationEvent). The framework routes the throwable to the session error handler independently of this callback.- Parameters:
event- the invocation eventerror- the throwable raised by the invocation handler
-
invocationEnded
Invoked on the request thread once an RPC invocation has been handled, whether it completed normally or threw.- Parameters:
event- the invocation event
-