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)
Deprecated.
Since 3.0, this API is deprecated in favor ofaddIndexHtmlRequestListener(com.vaadin.flow.server.communication.IndexHtmlRequestListener)
when using client-side bootstrappingvoid
addDependencyFilter(DependencyFilter dependencyFilter)
Adds a new dependency filter that will be used by this service.
void
addIndexHtmlRequestListener(IndexHtmlRequestListener indexHtmlRequestListener)
Adds a new Index HTML request listener 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()
Deprecated.
Since 3.0, this API is deprecated in favor ofgetAddedIndexHtmlRequestListeners()
when using client-side bootstrappingStream<DependencyFilter>
getAddedDependencyFilters()
Gets a stream of all dependency filters that have been added for the service.
Stream<IndexHtmlRequestListener>
getAddedIndexHtmlRequestListeners()
Gets a stream of all Index HTML request listeners 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
@Deprecated public void addBootstrapListener(BootstrapListener bootstrapListener)
Deprecated. Since 3.0, this API is deprecated in favor of
addIndexHtmlRequestListener(com.vaadin.flow.server.communication.IndexHtmlRequestListener)
when using client-side bootstrappingAdds 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
-
addIndexHtmlRequestListener
public void addIndexHtmlRequestListener(IndexHtmlRequestListener indexHtmlRequestListener)
Adds a new Index HTML request listener that will be used by this service. The ordering of multiple added bootstrap listeners is not guaranteed.
Parameters:
indexHtmlRequestListener
- the Index HTML request listener to be added.
-
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
@Deprecated public Stream<BootstrapListener> getAddedBootstrapListeners()
Deprecated. Since 3.0, this API is deprecated in favor of
getAddedIndexHtmlRequestListeners()
when using client-side bootstrappingGets a stream of all bootstrap listeners that have been added for the service.
Returns:
the stream of added bootstrap listeners
-
getAddedIndexHtmlRequestListeners
public Stream<IndexHtmlRequestListener> getAddedIndexHtmlRequestListeners()
Gets a stream of all Index HTML request listeners that have been added for the service.
Returns:
the stream of added Index HTML request 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
-
-