Package com.vaadin.flow.server
Class RequestStartedEvent
java.lang.Object
java.util.EventObject
com.vaadin.flow.server.RequestStartedEvent
- All Implemented Interfaces:
Serializable
Event fired through the
service event bus
when the framework starts handling a request, on the request thread and after
the request interceptors have
run.
A message that a client sends through a push connection is reported as a
request of its own, without a response. The daily active user tracking that
runs for some requests before they reach Flow also reports them without a
response in the RequestEndedEvent, although this event has one, so a
missing response does not by itself mean a push message.
Every started event is followed by a RequestEndedEvent for the same
request on the same thread, so a listener may keep timing state in a
ThreadLocal. Requests are handled concurrently, so listeners must
expect several requests to be in flight on several threads at once.
- Since:
- 25.4
- See Also:
-
Field Summary
Fields inherited from class java.util.EventObject
source -
Constructor Summary
ConstructorsConstructorDescriptionRequestStartedEvent(VaadinService service, VaadinRequest request, VaadinResponse response) Creates a new event. -
Method Summary
Modifier and TypeMethodDescriptionGets the request.Gets the response.Gets the service handling the request.Methods inherited from class java.util.EventObject
getSource, toString
-
Constructor Details
-
RequestStartedEvent
Creates a new event.- Parameters:
service- the service handling the request, notnullrequest- the request, notnullresponse- the response, ornullfor a push message
-
-
Method Details
-
getService
Gets the service handling the request.- Returns:
- the service, not
null
-
getRequest
Gets the request.- Returns:
- the request, not
null
-
getResponse
Gets the response.- Returns:
- the response, or an empty optional for a push message
-