Package com.vaadin.base.devserver
Class DebugWindowConnection
java.lang.Object
com.vaadin.base.devserver.DebugWindowConnection
- All Implemented Interfaces:
BrowserLiveReload,FragmentedMessageHolder,Serializable
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 classImplementation of the development tools interface.Nested classes/interfaces inherited from interface com.vaadin.flow.internal.BrowserLiveReload
BrowserLiveReload.Backend -
Method Summary
Modifier and TypeMethodDescriptionvoidbroadcast(tools.jackson.databind.node.ObjectNode msg) Broadcasts the given message to all connected clients.voidclearFragmentedMessage(org.atmosphere.cpr.AtmosphereResource resource) Clears the partial message that is currently being received.Detects and return enabling live reload backend technology.protected DevToolsInterfacegetDevToolsInterface(org.atmosphere.cpr.AtmosphereResource resource) getOrCreateFragmentedMessage(org.atmosphere.cpr.AtmosphereResource resource) Gets the partial message that is currently being received, if any.booleanisLiveReload(org.atmosphere.cpr.AtmosphereResource resource) Returns whether the passed connection is a browser live-reload connection.voidonConnect(org.atmosphere.cpr.AtmosphereResource resource) Sets the web socket connection resource when it's established.voidonDisconnect(org.atmosphere.cpr.AtmosphereResource resource) Removes the web socket connection resource, notnull.voidCalled when any message is received through the connection.voidrefresh(boolean refreshLayouts) Requests a refresh of the current view in the browser, without reloading the whole page.voidreload()Requests reload via the resource provided viaBrowserLiveReload.onConnect(AtmosphereResource)call.voidsendHmrEvent(String event, tools.jackson.databind.JsonNode eventData) Send a client side HMR event.voidsetBackend(BrowserLiveReload.Backend backend) Sets the live reload backend technology explicitly.voidRequest an update of the resource with the given path.
-
Method Details
-
getBackend
Description copied from interface:BrowserLiveReloadDetects and return enabling live reload backend technology.- Specified by:
getBackendin interfaceBrowserLiveReload- Returns:
- enabling technology, or
nullif none
-
setBackend
Description copied from interface:BrowserLiveReloadSets the live reload backend technology explicitly.- Specified by:
setBackendin interfaceBrowserLiveReload- Parameters:
backend- enabling technology, notnull.
-
getDevToolsInterface
-
onConnect
public void onConnect(org.atmosphere.cpr.AtmosphereResource resource) Description copied from interface:BrowserLiveReloadSets the web socket connection resource when it's established.- Specified by:
onConnectin interfaceBrowserLiveReload- Parameters:
resource- a web socket connection resource, notnull.
-
onDisconnect
public void onDisconnect(org.atmosphere.cpr.AtmosphereResource resource) Description copied from interface:BrowserLiveReloadRemoves the web socket connection resource, notnull.- Specified by:
onDisconnectin interfaceBrowserLiveReload- Parameters:
resource- a web socket connection resource
-
isLiveReload
public boolean isLiveReload(org.atmosphere.cpr.AtmosphereResource resource) Description copied from interface:BrowserLiveReloadReturns whether the passed connection is a browser live-reload connection.- Specified by:
isLiveReloadin interfaceBrowserLiveReload- Parameters:
resource- a web socket connection resource, notnull.- Returns:
- whether the web socket connection is for live reload
-
broadcast
public void broadcast(tools.jackson.databind.node.ObjectNode msg) Broadcasts the given message to all connected clients.- Parameters:
msg- the message to broadcast
-
reload
public void reload()Description copied from interface:BrowserLiveReloadRequests reload via the resource provided viaBrowserLiveReload.onConnect(AtmosphereResource)call.- Specified by:
reloadin interfaceBrowserLiveReload
-
refresh
public void refresh(boolean refreshLayouts) Description copied from interface:BrowserLiveReloadRequests a refresh of the current view in the browser, without reloading the whole page.- Specified by:
refreshin interfaceBrowserLiveReload- Parameters:
refreshLayouts-trueto refresh all layouts in the route chain,falseto only refresh the route component
-
update
Description copied from interface:BrowserLiveReloadRequest an update of the resource with the given path.- Specified by:
updatein 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:BrowserLiveReloadCalled when any message is received through the connection.- Specified by:
onMessagein 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:FragmentedMessageHolderGets the partial message that is currently being received, if any.- Specified by:
getOrCreateFragmentedMessagein interfaceFragmentedMessageHolder- Parameters:
resource- the resource to get the partial message from- Returns:
- the fragmented message being received or a new empty instance
-
clearFragmentedMessage
public void clearFragmentedMessage(org.atmosphere.cpr.AtmosphereResource resource) Description copied from interface:FragmentedMessageHolderClears the partial message that is currently being received. Should be called when the whole message has been received.- Specified by:
clearFragmentedMessagein interfaceFragmentedMessageHolder- Parameters:
resource- the related resource
-
sendHmrEvent
Description copied from interface:BrowserLiveReloadSend a client side HMR event.- Specified by:
sendHmrEventin interfaceBrowserLiveReload- Parameters:
event- the event nameeventData- the event data
-