Record Class InvocationContext
- Record Components:
security- caller security contextapplication- application contextcorrelationId- correlation idcontrol- host-owned invocation controls; unavailable outside managed dispatch
The record is immutable and thread-safe. It is installed by managed
dispatch for the lifetime of one invocation and is cleared when dispatch
completes. Cleanup is required for platform threads and virtual thread
dispatch paths that use the internal scoped J7mContext. Application
code must not retain the context as a long-lived authority token.
The context carries safe security, application, and correlation data. It does not expose credentials, raw transport internals, mutable runtime maps, or unredacted status data. Missing caller data is represented by an anonymous principal and empty correlation id rather than a null context. The control is a local host capability, not transport data: neither it nor this record is a wire DTO or a bearer token. Keeping this immutable record does not extend the control's invocation lifetime.
-
Constructor Summary
ConstructorsConstructorDescriptionInvocationContext(InvocationSecurityContext security, InvocationApplicationContext application, String correlationId) Creates the compatible context without an active work-submission capability.InvocationContext(InvocationSecurityContext security, InvocationApplicationContext application, String correlationId, InvocationControl control) Creates immutable context data. -
Method Summary
Modifier and TypeMethodDescriptionReturns the value of theapplicationrecord component.control()Returns the value of thecontrolrecord component.Returns the value of thecorrelationIdrecord component.static InvocationContextempty()Creates an empty safe context for code running outside middleware dispatch.final booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.security()Returns the value of thesecurityrecord component.final StringtoString()Returns a string representation of this record class.
-
Constructor Details
-
InvocationContext
public InvocationContext(InvocationSecurityContext security, InvocationApplicationContext application, String correlationId, InvocationControl control) Creates immutable context data. -
InvocationContext
public InvocationContext(InvocationSecurityContext security, InvocationApplicationContext application, String correlationId) Creates the compatible context without an active work-submission capability. Existing callers retain the original three-argument constructor; a managed host supplies the four-argument constructor when it installs its actual invocation lifetime.- Parameters:
security- caller security context, or null for anonymous dataapplication- application context, or null for an empty contextcorrelationId- correlation id, or null for an empty identifier
-
-
Method Details
-
empty
Creates an empty safe context for code running outside middleware dispatch.- Returns:
- empty safe context
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
security
-
application
Returns the value of theapplicationrecord component.- Returns:
- the value of the
applicationrecord component
-
correlationId
Returns the value of thecorrelationIdrecord component.- Returns:
- the value of the
correlationIdrecord component
-
control
-