RefreshEngine
cdf.dashboard. RefreshEngine
Class that manages the periodic refresh of components.
AMD Module
require(["cdf/dashboard/RefreshEngine"], function(RefreshEngine) { /* code goes here */ });
Constructor
new RefreshEngine(dashboard)
Class that manages the periodic refresh of components.
Methods
dispose()
Clears resources associated with the refresh engine.
fireGlobalRefresh()
Updates all components that do not have a valid refresh period.
fireRefresh()
Pops up due items from the queue, refreshes components and sets the next timeout.
getRefreshPeriod(component) : number
Gets the refresh period for a component.
processComponent(component) : boolean
Removes and adds the given component into the refresh queue restarting the timer if it is the first in the queue.
processComponents() : boolean
Clears the queue, adds all the dashboard components into the queue, and restarts the timer.
registerComponent(component, refreshPeriod) : boolean
Sets a components refresh period and clears it from the queue.
setGlobalRefresh(refreshPeriod)
Sets the global refresh period.
unregisterComponent(component)
Removes the component registration from the refresh engine queue.
Constructor Details
new RefreshEngine(dashboard)
Builds a new refresh engine for the provided dashboard.
**Source:**dashboard/RefreshEngine.js, line 18
dashboard : cdf.dashboard.Dashboard
The dashboard instance to be managed by the refresh engine.
Name
Default Value
Summary
dashboard : cdf.dashboard.Dashboard
The dashboard instance to be managed by the refresh engine.
## Methods Details
dispose()
Clears resources associated with the refresh engine.
**Source:**dashboard/RefreshEngine.js, line 462
fireGlobalRefresh()
Called when a valid globalRefreshPeriod
exists. It updates all components that do not have a valid refresh period.
**Source:**dashboard/RefreshEngine.js, line 421
fireRefresh()
Pops up due items from the queue, refreshes components and sets the next timeout.
**Source:**dashboard/RefreshEngine.js, line 393
getRefreshPeriod(component) : number
Gets the refresh period for a component.
**Source:**dashboard/RefreshEngine.js, line 350
component : cdf.components.BaseComponent
The target component.
number
The components refresh period value or the value of NO_REFRESH
.
Name
Default Value
Summary
component : cdf.components.BaseComponent
The target component.
Name
Description
number
The components refresh period value or the value of NO_REFRESH
.
processComponent(component) : boolean
Removes and adds the given component into the refresh queue. If the component is the first in the sorted queue, {cdf.dashboard.RefreshEngine.restartTimer|restartTimer} is executed.
**Source:**dashboard/RefreshEngine.js, line 366
component : cdf.components.BaseComponent
The component to process.
boolean
true
after the component was correctly processed.
Name
Default Value
Summary
component : cdf.components.BaseComponent
The component to process.
Name
Description
boolean
true
after the component was correctly processed.
processComponents() : boolean
Clears the queue, adds all the dashboard components into the queue, and restarts the timer.
**Source:**dashboard/RefreshEngine.js, line 380
boolean
true
after the components are processed.
Name
Description
boolean
true
after the components are processed.
registerComponent(component, refreshPeriod) : boolean
Sets a components refresh period and clears it from the queue. processComponent
must be called to activate the refresh timer for the component.
**Source:**dashboard/RefreshEngine.js, line 321
component : cdf.components.BaseComponent
The component to register.
refreshPeriod : number
The associated refresh period.
boolean
true
if registration succeeds, false
otherwise.
Name
Default Value
Summary
component : cdf.components.BaseComponent
The component to register.
refreshPeriod : number
The associated refresh period.
Name
Description
boolean
true
if registration succeeds, false
otherwise.
setGlobalRefresh(refreshPeriod)
Sets the global refresh period.
**Source:**dashboard/RefreshEngine.js, line 438
refreshPeriod : number
Refresh period to set.
Name
Default Value
Summary
refreshPeriod : number
Refresh period to set.
unregisterComponent(component)
Removes the component registration from the refresh engine queue.
**Source:**dashboard/RefreshEngine.js, line 336
component :
the component to unregister.
Name
Default Value
Summary
component :
the component to unregister.
Last updated
Was this helpful?