Class HttpTransportAttachmentContext

java.lang.Object
com.soklet.HttpTransportAttachmentContext

Framework-owned HTTP attachment capability borrowed by one HttpServer.attach(HttpTransportAttachmentContext, StartupContext) invocation. The context itself must not be retained after that invocation returns. Delegate attachment is unary, same-thread, and valid only during the dynamic extent of the enclosing call.

The type is thread-safe so its immutable values can be read safely, but that does not relax the thread confinement or lifetime of the delegate-attachment methods. The request handler and termination signal obtained from this context may be retained for the attached runtime according to their individual contracts.

Author:
Mark Allen
  • Method Details

    • getSokletConfig

      Returns:
      the configuration that owns this transport graph; the stable reference may be retained by the attached runtime
    • getAdmissionFencedRequestHandler

      Returns the framework admission-fenced request handler. The attached runtime may retain and invoke it for that runtime's lifetime. While admission is open it dispatches to the application; before admission opens and after it is sealed, it completes the supplied result callback with a framework-marshaled HTTP 503 response instead of silently dropping the request.
      Returns:
      the framework admission-fenced request handler
    • getTransportTerminationSignal

      Acquires this transport member's framework-owned termination capability. The attached runtime may retain the signal after attach(...) returns and must use it to report honest failure and termination evidence.
      Returns:
      this member's termination signal
    • attachTransparentDelegate

      @CheckReturnValue public @NonNull TransportRuntime attachTransparentDelegate(@NonNull HttpServer delegate, @NonNull HttpServer.RequestHandler delegateRequestHandler)
      Attaches one transparent delegate using this member's identity and exact termination signal. The delegate does not receive an independently terminating child member. The enclosing transport must return the delegate's runtime and must not drive a separate runtime or signal termination itself; the transparent delegate owns the shared member's lifecycle and signal.
      Parameters:
      delegate - delegate transport
      delegateRequestHandler - handler supplied to the delegate
      Returns:
      the exact runtime returned by the delegate
    • attachTerminationOwningDelegate

      Attaches one independently terminating delegate child. Soklet owns the child's completion state; the enclosing transport may observe the returned stage but cannot complete or otherwise mutate it.
      Parameters:
      delegate - delegate transport
      delegateRequestHandler - handler supplied to the delegate
      Returns:
      the child runtime and commit-gated subtree proof