Package com.vaadin.flow.internal
Interface BrowserLiveReload
- All Known Implementing Classes:
DebugWindowConnection
public interface BrowserLiveReload
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
Modifier 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, notnull
.void
Called when any message is received through the connection.void
reload()
Requests reload via the resource provided viaonConnect(AtmosphereResource)
call.void
setBackend
(BrowserLiveReload.Backend backend) Sets the live reload backend technology explicitly.
-
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, notnull
.- 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 viaonConnect(AtmosphereResource)
call. -
onMessage
Called when any message is received through the connection.- Parameters:
resource
- the atmosphere resource that received the messagemsg
- the received message
-