Class RpcInvocationEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.server.communication.RpcInvocationEvent
- All Implemented Interfaces:
Serializable
Event fired to
RpcInvocationListeners around the server-side handling
of a single client-to-server RPC invocation (a DOM event, a
@ClientCallable/template event handler, a server-side navigation, a
return channel message, and so on).
A client request can carry several invocations; one event is fired per
invocation. The RpcInvocationListener.invocationStarted(com.vaadin.flow.server.communication.RpcInvocationEvent), (optional)
RpcInvocationListener.invocationFailed(com.vaadin.flow.server.communication.RpcInvocationEvent, java.lang.Throwable) and
RpcInvocationListener.invocationEnded(com.vaadin.flow.server.communication.RpcInvocationEvent) callbacks for a single
invocation are delivered on the same thread, so timing state can be kept in a
thread local.
- Since:
- 25.2
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionRpcInvocationEvent(UI ui, String type, int nodeId, String name) Creates a new RPC invocation event. -
Method Summary
Modifier and TypeMethodDescriptiongetName()Gets a human-readable identifier for the invocation, such as the DOM event name, the invoked@ClientCallable/template method name, or the navigation location.intGets the id of theStateNodethe invocation targets.getType()Gets the protocol-level invocation type, for exampleevent,publishedEventHandler,navigationorchannel.getUI()Gets the UI the invocation is handled against.Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
RpcInvocationEvent
Creates a new RPC invocation event.- Parameters:
ui- the UI the invocation is handled against, notnulltype- the protocol-level invocation type (for exampleevent,publishedEventHandler,navigation,channel), notnullnodeId- the id of the targetedStateNode, or-1if the invocation does not target a nodename- a human-readable identifier for the invocation (the DOM event name, the invoked method name, the navigation location, ...), ornullif none applies
-
-
Method Details
-
getUI
Gets the UI the invocation is handled against.- Returns:
- the UI, not
null
-
getType
Gets the protocol-level invocation type, for exampleevent,publishedEventHandler,navigationorchannel.- Returns:
- the invocation type, not
null
-
getNodeId
public int getNodeId()Gets the id of theStateNodethe invocation targets.- Returns:
- the node id, or
-1if the invocation does not target a node
-
getName
Gets a human-readable identifier for the invocation, such as the DOM event name, the invoked@ClientCallable/template method name, or the navigation location.- Returns:
- the invocation name, or
nullif none applies
-