@ -1,5 +1,5 @@
@@ -1,5 +1,5 @@
/ *
* Copyright 2002 - 2022 the original author or authors .
* Copyright 2002 - 2023 the original author or authors .
*
* Licensed under the Apache License , Version 2 . 0 ( the "License" ) ;
* you may not use this file except in compliance with the License .
@ -27,7 +27,9 @@ import org.springframework.lang.Nullable;
@@ -27,7 +27,9 @@ import org.springframework.lang.Nullable;
/ * *
* Context that holds information for metadata collection regarding
* { @link ServerHttpObservationDocumentation # HTTP_REACTIVE_SERVER_REQUESTS reactive HTTP requests } observations .
* { @link ServerHttpObservationDocumentation # HTTP_REACTIVE_SERVER_REQUESTS reactive HTTP requests }
* observations .
*
* < p > This context also extends { @link RequestReplyReceiverContext } for propagating
* tracing information during HTTP request processing .
*
@ -43,13 +45,23 @@ public class ServerRequestObservationContext extends RequestReplyReceiverContext
@@ -43,13 +45,23 @@ public class ServerRequestObservationContext extends RequestReplyReceiverContext
private boolean connectionAborted ;
public ServerRequestObservationContext ( ServerHttpRequest request , ServerHttpResponse response , Map < String , Object > attributes ) {
/ * *
* Create a new { @code ServerRequestObservationContext } instance .
* @param request the current request
* @param response the current response
* @param attributes the current attributes
* /
public ServerRequestObservationContext (
ServerHttpRequest request , ServerHttpResponse response , Map < String , Object > attributes ) {
super ( ( req , key ) - > req . getHeaders ( ) . getFirst ( key ) ) ;
setCarrier ( request ) ;
setResponse ( response ) ;
this . attributes = Collections . unmodifiableMap ( attributes ) ;
}
/ * *
* Return an immutable map of the current request attributes .
* /
@ -78,8 +90,8 @@ public class ServerRequestObservationContext extends RequestReplyReceiverContext
@@ -78,8 +90,8 @@ public class ServerRequestObservationContext extends RequestReplyReceiverContext
}
/ * *
* Whether the current connection was aborted by the client , resulting
* in a { @link reactor . core . publisher . SignalType # CANCEL cancel signal } on the reactive chain ,
* Whether the current connection was aborted by the client , resulting in a
* { @link reactor . core . publisher . SignalType # CANCEL cancel signal } on the reactive chain ,
* or an { @code AbortedException } when reading the request .
* @return if the connection has been aborted
* /
@ -88,8 +100,8 @@ public class ServerRequestObservationContext extends RequestReplyReceiverContext
@@ -88,8 +100,8 @@ public class ServerRequestObservationContext extends RequestReplyReceiverContext
}
/ * *
* Set whether the current connection was aborted by the client , resulting
* in a { @link reactor . core . publisher . SignalType # CANCEL cancel signal } on the reactive chain ,
* Set whether the current connection was aborted by the client , resulting in a
* { @link reactor . core . publisher . SignalType # CANCEL cancel signal } on the reactive chain ,
* or an { @code AbortedException } when reading the request .
* @param connectionAborted if the connection has been aborted
* /