com.vaadin.flow.internal.
Interface BrowserLiveReload
All Superinterfaces:
All Known Implementing Classes:
Provides a way to reload browser tabs via web socket connection passed as a
AtmosphereResource
.
For internal use only. May be renamed or removed in a future release.
Author:
Vaadin Ltd
-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic enum
Live reload enabling technology detected.
-
Method Summary
Modifier and TypeMethodDescriptionDetects and return enabling live reload backend technology.
boolean
isLiveReload
(org.atmosphere.cpr.AtmosphereResource resource) Returns whether the passed connection is a browser live-reload connection.
void
onConnect
(org.atmosphere.cpr.AtmosphereResource resource) Sets the web socket connection resource when it's established.
void
onDisconnect
(org.atmosphere.cpr.AtmosphereResource resource) Removes the web socket connection resource, not
null
.void
Called when any message is received through the connection.
default void
refresh
(boolean refreshLayouts) Requests a refresh of the current view in the browser, without reloading the whole page.
void
reload()
Requests reload via the resource provided via
onConnect(AtmosphereResource)
call.void
sendHmrEvent
(String event, elemental.json.JsonObject eventData) Send a client side HMR event.
void
setBackend
(BrowserLiveReload.Backend backend) Sets the live reload backend technology explicitly.
void
Request an update of the resource with the given path.
Methods inherited from interface com.vaadin.flow.server.communication.FragmentedMessageHolder
clearFragmentedMessage, getOrCreateFragmentedMessage
-
Method Details
-
getBackend
BrowserLiveReload.Backend getBackend()Detects and return enabling live reload backend technology.
Returns:
enabling technology, or
null
if none -
setBackend
Sets the live reload backend technology explicitly.
Parameters:
backend
- enabling technology, notnull
. -
onConnect
void onConnect(org.atmosphere.cpr.AtmosphereResource resource) Sets the web socket connection resource when it's established.
Parameters:
resource
- a web socket connection resource, notnull
. -
onDisconnect
void onDisconnect(org.atmosphere.cpr.AtmosphereResource resource) Removes the web socket connection resource, not
null
.Parameters:
resource
- a web socket connection resource -
isLiveReload
boolean isLiveReload(org.atmosphere.cpr.AtmosphereResource resource) Returns whether the passed connection is a browser live-reload connection.
Parameters:
resource
- a web socket connection resource, notnull
.Returns:
whether the web socket connection is for live reload
-
reload
void reload()Requests reload via the resource provided via
onConnect(AtmosphereResource)
call. -
refresh
default void refresh(boolean refreshLayouts) Requests a refresh of the current view in the browser, without reloading the whole page.
Parameters:
refreshLayouts
-true
to refresh all layouts in the route chain,false
to only refresh the route component -
update
Request an update of the resource with the given path.
Parameters:
path
- the path of the file to update, relative to the servlet pathcontent
- the new content of the file -
onMessage
Called when any message is received through the connection.
Parameters:
resource
- the atmosphere resource that received the messagemsg
- the received message -
sendHmrEvent
Send a client side HMR event.
Parameters:
event
- the event nameeventData
- the event data
-