Package com.ultikits.ultitools.websocket
Class PanelResponderRegistry.Invocation
java.lang.Object
com.ultikits.ultitools.websocket.PanelResponderRegistry.Invocation
- All Implemented Interfaces:
Runnable
- Enclosing class:
PanelResponderRegistry
One admitted request: the responder entry captured at admission, its deadline and its
outcome. Runs on a worker; every settlement goes through
settle(com.google.gson.JsonObject, java.lang.Throwable).-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate final ClassLoaderThe admitting thread's context class loader, installed for the call.private final UltiToolsPluginThis registry's registration scope on the admitting thread, possiblynull.private final com.google.gson.JsonObjectprivate ScheduledFuture<?> private final PanelResponderRegistry.ResponderEntryprivate final Stringprivate final CompletableFuture<com.google.gson.JsonObject> -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivateInvocation(String messageType, PanelResponderRegistry.ResponderEntry entry, com.google.gson.JsonObject data, CompletableFuture<com.google.gson.JsonObject> outcome) -
Method Summary
Modifier and TypeMethodDescriptionprivate CompletableFuture<com.google.gson.JsonObject> Calls the responder at the framework's boundary to module code: whatever the call throws becomes this request's outcome instead of being lost in the worker.private voidexpire()The deadline action: take a not-yet-started invocation back, then fail the outcome.private voidinstallScope(UltiToolsPlugin scope) Sets this registry's registration scope on the current thread;nullremoves it.private RejectedExecutionExceptionrefusal()private voidrelease()The completion hook: frees the queue slot and the deadline, and stops tracking.voidrun()private voidThe one settle path.private RejectedExecutionException
-
Field Details
-
messageType
-
entry
-
data
private final com.google.gson.JsonObject data -
outcome
-
admittingLoader
The admitting thread's context class loader, installed for the call. -
admittingScope
This registry's registration scope on the admitting thread, possiblynull. -
deadline
-
-
Constructor Details
-
Invocation
private Invocation(String messageType, PanelResponderRegistry.ResponderEntry entry, com.google.gson.JsonObject data, CompletableFuture<com.google.gson.JsonObject> outcome)
-
-
Method Details
-
run
public void run() -
callResponder
Calls the responder at the framework's boundary to module code: whatever the call throws becomes this request's outcome instead of being lost in the worker. Returnsnullwhen the outcome is already settled here. -
installScope
Sets this registry's registration scope on the current thread;nullremoves it. -
release
private void release()The completion hook: frees the queue slot and the deadline, and stops tracking. -
refusal
-
shutDownFailure
-
expire
private void expire()The deadline action: take a not-yet-started invocation back, then fail the outcome. -
settle
The one settle path. Cancels the deadline before completing the outcome: aCompletableFutureruns later-registered dependents first, so a caller waiting on the outcome must find the deadline already gone. A second settlement is a no-op.
-