Package limn.backend
Class Crashes
java.lang.Object
limn.backend.Crashes
Crash containment registry: one process-wide
CrashHandler (default:
log and continue) that the toolkit and backend notify whenever application
code throws inside the event loop. Install/uninstall follows the same
static-registry pattern as Sounds/Images.
Containment map (an exception in application code never kills the event loop outright anymore):
FRAME:Scene.renderFramecatches (and pauses ticking + self-retries after a few consecutive failures, so a deterministic crash cannot spin the CPU; input still retries); deferred GPU disposals are contained per runnable. Both honor the handler's verdict.EVENT_POLL/INPUT/FRAME/WINDOW_CLOSE: the backend loop and window teardown catch per site, keep the other windows alive, honor the verdict, and give up (rethrow) only after many consecutive crashed iterations.INPUT/TASK/TICKER/WINDOW_CLOSE(scene side): contained per event/task/ticker/close-callback; theyreport(limn.backend.CrashPhase, java.lang.Throwable)here for observability and ignore the verdict; seeCrashHandler.crashed(limn.backend.CrashPhase, java.lang.Throwable)for the honored-vs-ignored map.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classUnwinds the event loop when aCrashHandlerreturnedfalse; containment sites let it pass through instead of re-dispatching, so the handler sees each crash once. -
Method Summary
Modifier and TypeMethodDescriptionstatic booleandispatch(CrashPhase phase, Throwable error) Dispatches a crash caught at a site where it would otherwise have been fatal.static voidinstall(CrashHandler crashHandler) Installs the process-wide handler (replacing the log-and-continue default).static voidreport(CrashPhase phase, Throwable error) Notifies the handler of a crash at a site that already contains and logs it locally (input/task/ticker).static Crashes.ShutdownRequestedshutdownRequested(Throwable cause) The exception a containment site throws afterdispatch(limn.backend.CrashPhase, java.lang.Throwable)returnedfalse.static voiduninstall(CrashHandler crashHandler) UninstallscrashHandlerif it is the current one, restoring the default.
-
Method Details
-
install
Installs the process-wide handler (replacing the log-and-continue default). -
uninstall
UninstallscrashHandlerif it is the current one, restoring the default. -
dispatch
Dispatches a crash caught at a site where it would otherwise have been fatal. A throwing handler is contained and treated as "continue".- Returns:
trueto keep running,falsewhen the handler requested shutdown (the caller should throwshutdownRequested(java.lang.Throwable))
-
report
Notifies the handler of a crash at a site that already contains and logs it locally (input/task/ticker). No-op with the default handler (the site's own log line already tells the story), and the return value is ignored. -
shutdownRequested
The exception a containment site throws afterdispatch(limn.backend.CrashPhase, java.lang.Throwable)returnedfalse.
-