com.vaadin.flow.server.
Class ServiceInitEvent
- java.lang.Object
-
- java.util.EventObject
-
- com.vaadin.flow.server.ServiceInitEvent
-
All Implemented Interfaces:
public class ServiceInitEvent extends EventObject
Event fired to
VaadinServiceInitListener
when aVaadinService
is being initialized.This event can also be used to add
RequestHandler
s that will be used by theVaadinService
for handling all requests.BootstrapListener
s can also be registered, that are used to modify the initial HTML of the application.Since:
1.0
Author:
Vaadin Ltd
See Also:
-
-
Field Summary
-
Fields inherited from class java.util.EventObject
source
-
-
Constructor Summary
Constructors Constructor and Description ServiceInitEvent(VaadinService service)
Creates a new service init event for a given
VaadinService
and theRequestHandler
that will be used by the service.
-
Method Summary
All Methods Modifier and Type Method and Description void
addBootstrapListener(BootstrapListener bootstrapListener)
Adds a new bootstrap listener that will be used by this service.
void
addDependencyFilter(DependencyFilter dependencyFilter)
Adds a new dependency filter that will be used by this service.
void
addRequestHandler(RequestHandler requestHandler)
Adds a new request handler that will be used by this service.
Stream<BootstrapListener>
getAddedBootstrapListeners()
Gets a stream of all bootstrap listeners that have been added for the service.
Stream<DependencyFilter>
getAddedDependencyFilters()
Gets a stream of all dependency filters that have been added for the service.
Stream<RequestHandler>
getAddedRequestHandlers()
Gets a stream of all custom request handlers that have been added for the service.
VaadinService
getSource()
-
Methods inherited from class java.util.EventObject
toString
-
-
-
-
Constructor Detail
-
ServiceInitEvent
public ServiceInitEvent(VaadinService service)
Creates a new service init event for a given
VaadinService
and theRequestHandler
that will be used by the service.Parameters:
service
- the Vaadin service of this request
-
-
Method Detail
-
addRequestHandler
public void addRequestHandler(RequestHandler requestHandler)
Adds a new request handler that will be used by this service. The added handler will be run before any of the framework's own request handlers, but the ordering relative to other custom handlers is not guaranteed.
Parameters:
requestHandler
- the request handler to add, notnull
-
addBootstrapListener
public void addBootstrapListener(BootstrapListener bootstrapListener)
Adds a new bootstrap listener that will be used by this service. The ordering of multiple added bootstrap listeners is not guaranteed.
Parameters:
bootstrapListener
- the bootstrap listener to add, notnull
-
addDependencyFilter
public void addDependencyFilter(DependencyFilter dependencyFilter)
Adds a new dependency filter that will be used by this service.
Parameters:
dependencyFilter
- the dependency filter to add, notnull
-
getAddedRequestHandlers
public Stream<RequestHandler> getAddedRequestHandlers()
Gets a stream of all custom request handlers that have been added for the service.
Returns:
the stream of added request handlers
-
getAddedBootstrapListeners
public Stream<BootstrapListener> getAddedBootstrapListeners()
Gets a stream of all bootstrap listeners that have been added for the service.
Returns:
the stream of added bootstrap listeners
-
getAddedDependencyFilters
public Stream<DependencyFilter> getAddedDependencyFilters()
Gets a stream of all dependency filters that have been added for the service.
Returns:
the stream of added dependency filters
-
getSource
public VaadinService getSource()
Overrides:
getSource
in classEventObject
-
-