Class BridgedPreferences
Preferences node reachable from a
background thread — a SwingWorker.doInBackground() that reads
or writes app preferences (D_prefs_scope_split). It is the sibling of VaadinPreferences
for the case where there is no current UI/lock on the calling thread but the
thread carries the owning VaadinSession via a propagated
vaadinx.EmulatorContext.
Each *Spi op runs its PrefsCache body inside
EHelper.callOnLiveUISync(VaadinSession, Supplier) — which resolves the session's single live
UI, acquires the lock, hops onto the loom carrier (so the first read can park
on the executeJs localStorage round-trip), and returns the value to
the worker thread. So the migrator's ordinary synchronous
Preferences.userRoot()...get(...) call in doInBackground just
works. If no single live UI is reachable (tab/session closed, or genuine
multi-tab) the bridge throws — surfacing as the worker's
ExecutionException rather than silently returning stale values (D_prefs_scope_split).
Unlike VaadinPreferences, this holds no PrefsCache field:
the cache is per-UI and can only be obtained inside the bridge (where a UI is
current), so each op resolves PrefsCache.current() within
callOnLiveUISync.
-
Field Summary
Fields inherited from class AbstractPreferences
lock, newNodeFields inherited from class Preferences
MAX_KEY_LENGTH, MAX_NAME_LENGTH, MAX_VALUE_LENGTH -
Method Summary
Modifier and TypeMethodDescriptionprotected String[]protected AbstractPreferencesprotected voidflushSpi()Writes are eager (eachput/removeflushes to localStorage).protected Stringprotected String[]keysSpi()protected voidprotected voidprotected voidprotected voidsyncSpi()localStorage is the store; nothing to reconcile server-side.Methods inherited from class AbstractPreferences
absolutePath, addNodeChangeListener, addPreferenceChangeListener, cachedChildren, childrenNames, clear, exportNode, exportSubtree, flush, get, getBoolean, getByteArray, getChild, getDouble, getFloat, getInt, getLong, isRemoved, isUserNode, keys, name, node, nodeExists, parent, put, putBoolean, putByteArray, putDouble, putFloat, putInt, putLong, remove, removeNode, removeNodeChangeListener, removePreferenceChangeListener, sync, toStringMethods inherited from class Preferences
importPreferences, systemNodeForPackage, systemRoot, userNodeForPackage, userRoot
-
Method Details
-
getSpi
- Specified by:
getSpiin classAbstractPreferences
-
putSpi
- Specified by:
putSpiin classAbstractPreferences
-
removeSpi
- Specified by:
removeSpiin classAbstractPreferences
-
keysSpi
- Specified by:
keysSpiin classAbstractPreferences
-
childrenNamesSpi
- Specified by:
childrenNamesSpiin classAbstractPreferences
-
removeNodeSpi
protected void removeNodeSpi()- Specified by:
removeNodeSpiin classAbstractPreferences
-
childSpi
- Specified by:
childSpiin classAbstractPreferences
-
flushSpi
protected void flushSpi()Writes are eager (eachput/removeflushes to localStorage).- Specified by:
flushSpiin classAbstractPreferences
-
syncSpi
protected void syncSpi()localStorage is the store; nothing to reconcile server-side.- Specified by:
syncSpiin classAbstractPreferences
-