Multi-Tenancy and Lifecycle
A NetBeans Platform application is built for a single user on a desktop. SwingBridge runs one independent instance — a tenant — per Vaadin session, so that many browser users can use the application at once without sharing state.
Per-Session Isolation
Each Vaadin session that mounts the bridge runs the platform in its own isolated environment, stacking four layers on top of SwingBridge’s standard per-session isolation:
| Layer | What it isolates |
|---|---|
AWT | All |
Thread group | The platform’s |
Classloader | Class identity for the platform’s statics — |
System properties | Process-singleton properties the platform derives per-process state from, most importantly the NetBeans user directory, so a later tenant’s boot can’t poison an earlier tenant’s directory. |
On top of these, each tenant boots into its own user directory, so two users never share platform preferences, caches, or window layout.
Boot and Teardown
The platform boots in-process the first time a session mounts the bridge: the bridge discovers the distribution, builds the per-tenant environment, and starts the platform, which is rendered into the canvas once its main window appears. Within a session, the platform boots only once — additional bridges reuse the running tenant (see One Platform per Session).
Two events end a tenant cleanly, neither of which affects the host JVM or other tenants:
-
File > Exitfrom the NetBeans menu disposes that tenant’s windows and releases its resources — without callingSystem.exit, so the host keeps running. -
Vaadin session destroy (timeout, browser close, or logout) runs an ordered teardown that stops the tenant’s platform, releases its
AppContextand in-memory state, and reclaims its user directory on disk — on all operating systems.
Cold-Start Performance
Booting a NetBeans Platform in-process takes roughly 5–8 seconds per tenant. This cost is paid once per session, on the first mount; re-attaching within a live session reuses the running tenant and is near-instant.
First-time boots are serialized across tenants. If two sessions mount the bridge cold at the same time, the second waits for the first to finish booting, so its user-visible latency is roughly 10–16 seconds. This suits the target use case — long-lived sessions rather than page-by-page navigation — and there is no contention once a tenant is warm.
Known Limitations
| Limitation | Detail |
|---|---|
Pre-built distribution required | You must supply a pre-built NetBeans Platform distribution directory. Bare |
JDK 21 | NetBeans Platform 25’s |
Native libraries are single-tenant | A native library ( |
Platform types can’t cross the interop bridge | Types under |
Direct | The platform’s own exit path is neutralized, but a direct |
No deep-link to an unopened TopComponent | A |
Troubleshooting
| Symptom | Likely cause and fix |
|---|---|
Startup fails with a message naming | No valid distribution was found at any discovery source. Confirm the directory (not its JARs) is in |
Platform startup fails referencing | The |
Platform fails to boot referencing a |
|
The single- | The |
The whole shell is blank after switching one view to a single | A full-shell bridge and a single- |
For SwingBridge failures that aren’t specific to NetBeans (missing patch-module flags, headless errors, an empty view from missing push, missing fonts, or license problems), see Troubleshooting.