public class ServerConfigManager extends ConfigManager
Modifier and Type | Class and Description |
---|---|
(package private) static class |
ServerConfigManager.WorkArea
Widget-specific data which needs to survive the context-reset.
|
Modifier and Type | Field and Description |
---|---|
protected static ContextLocal<ServerConfigManager.WorkArea> |
survivals
Context-local state which needs to survive the context reset.
|
activeConfigs, backupConfigs, dirtyConfigs, widgetCfg
Constructor and Description |
---|
ServerConfigManager() |
Modifier and Type | Method and Description |
---|---|
void |
addDirtyConfig(WidgetConfig cfg,
java.lang.String field)
Register the specified field in the configuration for the specified widget ID as being
dirty.
|
protected void |
applyConfigUpdates(GenericWidget widget,
WidgetConfigUpdates cfgUpdate)
Update the local active and backup configurations with the received changes.
|
protected WidgetConfigDef |
getConfigDef(java.lang.Class<? extends WidgetConfig> cls)
Get the
WidgetConfigDef instance associated with the given WidgetConfig
implementation. |
void |
initWidgetConfigurations(java.util.Map<java.lang.String,java.util.List<java.lang.String>> configs)
On server-side, synchronize the field IDs for the server-side widget configurations with
the IDs provided by the associated list.
|
protected boolean |
isRegisteredWidget(WidgetId id)
Check if the given ID is associated with a registered widget.
|
(package private) ConfigOwner<?> |
resolveConfigOwner(WidgetId widgetId)
The method attempts to resolve a
ConfigOwner reference from
the widget widgetId . |
boolean |
trackConfig(WidgetConfig cfg)
Determine if the specified config instance can be tracked.
|
addWidgetConfig, addWidgetConfig, duplicate, getActiveConfig, getBackupConfig, getConfigDef, getConfigUpdates, getDynamicConfig, getInstance, notifyWidgetDestroyed, removeWidgetConfig, replaceConfig, resolveWidgetConfig, resolveWidgetConfig, setDynamicConfig, setTracking, setWidgetConfig, syncConfigChanges
protected static ContextLocal<ServerConfigManager.WorkArea> survivals
public void initWidgetConfigurations(java.util.Map<java.lang.String,java.util.List<java.lang.String>> configs)
configs
- A map of configurations, having as hey a class name and as value a list of field
names (the order in this list gives the field ID).public boolean trackConfig(WidgetConfig cfg)
Sever-side does not track the config changes.
trackConfig
in class ConfigManager
cfg
- The WidgetConfig
instace which needs to be tracked.public void addDirtyConfig(WidgetConfig cfg, java.lang.String field)
Sever-side does not track the config changes, so this is a no-op.
addDirtyConfig
in class ConfigManager
cfg
- The widget config.field
- The changed field.ConfigOwner<?> resolveConfigOwner(WidgetId widgetId)
ConfigOwner
reference from
the widget widgetId
.resolveConfigOwner
in class ConfigManager
widgetId
- Widget Id.ConfigOwner
reference or null
if
such cannot be find.protected boolean isRegisteredWidget(WidgetId id)
isRegisteredWidget
in class ConfigManager
id
- The widget ID.true
if a widget exists in the registry, with the given ID.protected WidgetConfigDef getConfigDef(java.lang.Class<? extends WidgetConfig> cls)
WidgetConfigDef
instance associated with the given WidgetConfig
implementation.getConfigDef
in class ConfigManager
cls
- The widget config class.protected void applyConfigUpdates(GenericWidget widget, WidgetConfigUpdates cfgUpdate)
cfgUpdate
- The container with the config updates for a given widget ID.