Interface AutoReloadService
-
public interface AutoReloadService
Automatically reloads the current page in connected browsers. If auto-reload is disabled, nothing happens whenbroadcastPageReload()
is called.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
broadcastPageReload()
Reloads the current page in all connected browsers.String
getJavaScript(String contextPath)
boolean
isEnabled()
void
setEnabled(boolean isEnabled)
Enables or disabled auto-reload.
-
-
-
Method Detail
-
isEnabled
boolean isEnabled()
- Returns:
- true if auto-reload is enabled, false otherwise.
-
setEnabled
void setEnabled(boolean isEnabled)
Enables or disabled auto-reload.- Parameters:
isEnabled
- true when auto-reload should be enabled, false when it should be disabled.
-
getJavaScript
String getJavaScript(String contextPath)
- Parameters:
contextPath
- the current context path of the page in which the JavaScript will be included. The context path can be an empty string when the page is served at URL path '/' (e.g. when the web application is deployed as ROOT.war). When the context path is not empty, it must start with a slash, followed by the context path string. The context path must not end with a slash. For example, valid context paths are "/site", "/intranet" and "".- Returns:
- the JavaScript to include in a browser that handles the auto-reloading.
- Throws:
IllegalArgumentException
- if the context path is not well-formed.
-
broadcastPageReload
void broadcastPageReload()
Reloads the current page in all connected browsers. If auto-reload is disabled, nothing happens.
-
-