com.vaadin.base.devserver.
Class DebugWindowConnection
All Implemented Interfaces:
BrowserLiveReload
implementation class.
For internal use only. May be renamed or removed in a future release.
Author:
Vaadin Ltd
See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
Implementation of the development tools interface.
Nested classes/interfaces inherited from interface com.vaadin.flow.internal.BrowserLiveReload
BrowserLiveReload.Backend
-
Method Summary
Modifier and TypeMethodDescriptionvoid
broadcast
(elemental.json.JsonObject msg) Broadcasts the given message to all connected clients.
void
clearFragmentedMessage
(org.atmosphere.cpr.AtmosphereResource resource) Clears the partial message that is currently being received.
Detects and return enabling live reload backend technology.
protected DevToolsInterface
getDevToolsInterface
(org.atmosphere.cpr.AtmosphereResource resource) getOrCreateFragmentedMessage
(org.atmosphere.cpr.AtmosphereResource resource) Gets the partial message that is currently being received, if any.
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.
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
BrowserLiveReload.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.
-
Method Details
-
getBackend
Description copied from interface:
BrowserLiveReload
Detects and return enabling live reload backend technology.
Specified by:
getBackend
in interfaceBrowserLiveReload
Returns:
enabling technology, or
null
if none -
setBackend
Description copied from interface:
BrowserLiveReload
Sets the live reload backend technology explicitly.
Specified by:
setBackend
in interfaceBrowserLiveReload
Parameters:
backend
- enabling technology, notnull
. -
getDevToolsInterface
-
onConnect
public void onConnect(org.atmosphere.cpr.AtmosphereResource resource) Description copied from interface:
BrowserLiveReload
Sets the web socket connection resource when it's established.
Specified by:
onConnect
in interfaceBrowserLiveReload
Parameters:
resource
- a web socket connection resource, notnull
. -
onDisconnect
public void onDisconnect(org.atmosphere.cpr.AtmosphereResource resource) Description copied from interface:
BrowserLiveReload
Removes the web socket connection resource, not
null
.Specified by:
onDisconnect
in interfaceBrowserLiveReload
Parameters:
resource
- a web socket connection resource -
isLiveReload
public boolean isLiveReload(org.atmosphere.cpr.AtmosphereResource resource) Description copied from interface:
BrowserLiveReload
Returns whether the passed connection is a browser live-reload connection.
Specified by:
isLiveReload
in interfaceBrowserLiveReload
Parameters:
resource
- a web socket connection resource, notnull
.Returns:
whether the web socket connection is for live reload
-
broadcast
public void broadcast(elemental.json.JsonObject msg) Broadcasts the given message to all connected clients.
Parameters:
msg
- the message to broadcast -
reload
public void reload()Description copied from interface:
BrowserLiveReload
Requests reload via the resource provided via
BrowserLiveReload.onConnect(AtmosphereResource)
call.Specified by:
reload
in interfaceBrowserLiveReload
-
refresh
public void refresh(boolean refreshLayouts) Description copied from interface:
BrowserLiveReload
Requests a refresh of the current view in the browser, without reloading the whole page.
Specified by:
refresh
in interfaceBrowserLiveReload
Parameters:
refreshLayouts
-true
to refresh all layouts in the route chain,false
to only refresh the route component -
update
Description copied from interface:
BrowserLiveReload
Request an update of the resource with the given path.
Specified by:
update
in interfaceBrowserLiveReload
Parameters:
path
- the path of the file to update, relative to the servlet pathcontent
- the new content of the file -
onMessage
Description copied from interface:
BrowserLiveReload
Called when any message is received through the connection.
Specified by:
onMessage
in interfaceBrowserLiveReload
Parameters:
resource
- the atmosphere resource that received the messagemessage
- the received message -
getOrCreateFragmentedMessage
public AtmospherePushConnection.FragmentedMessage getOrCreateFragmentedMessage(org.atmosphere.cpr.AtmosphereResource resource) Description copied from interface:
FragmentedMessageHolder
Gets the partial message that is currently being received, if any.
Specified by:
getOrCreateFragmentedMessage
in interfaceFragmentedMessageHolder
Parameters:
resource
- the resource to get the partial message fromReturns:
the fragmented message being received or a new empty instance
-
clearFragmentedMessage
public void clearFragmentedMessage(org.atmosphere.cpr.AtmosphereResource resource) Description copied from interface:
FragmentedMessageHolder
Clears the partial message that is currently being received. Should be called when the whole message has been received.
Specified by:
clearFragmentedMessage
in interfaceFragmentedMessageHolder
Parameters:
resource
- the related resource -
sendHmrEvent
Description copied from interface:
BrowserLiveReload
Send a client side HMR event.
Specified by:
sendHmrEvent
in interfaceBrowserLiveReload
Parameters:
event
- the event nameeventData
- the event data
-