Class BridgedPreferences


public final class BridgedPreferences extends AbstractPreferences
A localStorage-backed 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.