yhs0092 commented on a change in pull request #727: [SCB-607] Accesslog support
invocation context item
URL:
https://github.com/apache/incubator-servicecomb-java-chassis/pull/727#discussion_r190829522
##########
File path:
common/common-rest/src/main/java/org/apache/servicecomb/common/rest/AbstractRestInvocation.java
##########
@@ -249,4 +265,21 @@ protected void onExecuteHttpServerFiltersFinish(Response
response, Throwable e)
invocation.onFinish(response);
}
}
+
+ public void setAfterCreateInvocationHandler(
Review comment:
I guess you mean to replace the `AfterCreateInvocationHandler` with the
method `protected void afterCreateInvocation()` ?
But currently we cannot get RoutingContext directly in
`AbstractRestInvocation`, unless we cast the type of
`AbstractRestInvocation.requestEx` and add a getter into
`VertxServerRequestToHttpServletRequest` like below:
```java
protected void afterCreateInvocation() {
if
(!VertxServerRequestToHttpServletRequest.class.isAssignableFrom(this.requestEx.getClass()))
{
return;
}
VertxServerRequestToHttpServletRequest request =
(VertxServerRequestToHttpServletRequest) this.requestEx;
RoutingContext routingContext = request.getContext();
routingContext.put(RestConst.REST_INVOCATION_CONTEXT, this.invocation);
}
```
Am I right?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services