-
Notifications
You must be signed in to change notification settings - Fork 311
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Observation implementation #1438
base: main
Are you sure you want to change the base?
Conversation
Ping @corneil |
@johkin Thanks for this great contribution. |
...java/org/springframework/ws/client/core/observation/DefaultWebServiceTemplateConvention.java
Show resolved
Hide resolved
...java/org/springframework/ws/client/core/observation/DefaultWebServiceTemplateConvention.java
Outdated
Show resolved
Hide resolved
...g/springframework/ws/client/core/observation/WebServiceTemplateObservationDocumentation.java
Show resolved
Hide resolved
...g/springframework/ws/client/core/observation/WebServiceTemplateObservationDocumentation.java
Outdated
Show resolved
Hide resolved
.../org/springframework/ws/server/endpoint/observation/DefaultWebServiceEndpointConvention.java
Show resolved
Hide resolved
.../org/springframework/ws/server/endpoint/observation/DefaultWebServiceEndpointConvention.java
Outdated
Show resolved
Hide resolved
...ava/org/springframework/ws/server/endpoint/observation/EndpointObservationDocumentation.java
Show resolved
Hide resolved
...ava/org/springframework/ws/server/endpoint/observation/EndpointObservationDocumentation.java
Outdated
Show resolved
Hide resolved
...ava/org/springframework/ws/server/endpoint/observation/EndpointObservationDocumentation.java
Show resolved
Hide resolved
Changed name of key "localname" to "localpart" Removed superfluos method implementations Modified implementation of ContextualName spring-projects#1094
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the work on this. It's a very complete pull request. I left some feedback for consideration.
...ava/org/springframework/ws/client/core/observation/WebServiceTemplateObservationContext.java
Outdated
Show resolved
Hide resolved
...g/springframework/ws/client/core/observation/WebServiceTemplateObservationDocumentation.java
Outdated
Show resolved
Hide resolved
...ava/org/springframework/ws/server/endpoint/observation/EndpointObservationDocumentation.java
Outdated
Show resolved
Hide resolved
.../main/java/org/springframework/ws/server/endpoint/observation/WebServiceEndpointContext.java
Outdated
Show resolved
Hide resolved
...-core/src/test/java/org/springframework/ws/server/endpoint/observation/WebServiceConfig.java
Outdated
Show resolved
Hide resolved
...springframework/ws/client/core/observation/WebServiceTemplateObservationIntegrationTest.java
Show resolved
Hide resolved
...in/java/org/springframework/ws/client/core/observation/WebServiceObservationInterceptor.java
Outdated
Show resolved
Hide resolved
...in/java/org/springframework/ws/client/core/observation/WebServiceObservationInterceptor.java
Outdated
Show resolved
Hide resolved
...in/java/org/springframework/ws/client/core/observation/WebServiceObservationInterceptor.java
Outdated
Show resolved
Hide resolved
...in/java/org/springframework/ws/client/core/observation/WebServiceObservationInterceptor.java
Outdated
Show resolved
Hide resolved
...in/java/org/springframework/ws/client/core/observation/WebServiceObservationInterceptor.java
Outdated
Show resolved
Hide resolved
...in/java/org/springframework/ws/client/core/observation/WebServiceObservationInterceptor.java
Show resolved
Hide resolved
...src/main/java/org/springframework/ws/server/endpoint/observation/ObservationInterceptor.java
Outdated
Show resolved
Hide resolved
...rg/springframework/ws/server/endpoint/observation/ObservationInterceptorIntegrationTest.java
Show resolved
Hide resolved
I did some minor restructuring of the code to improve readability and error-handling/logging. The method used to find the root element is identical in both interceptors, could be and improvement to refactor this to a helper-class? On the other hand, this requires the helper to be injected in the interceptors and creates another dependency. |
* DefaultHandler that extracts the root elements namespace and name. | ||
* @author Johan Kindgren | ||
*/ | ||
public class RootElementSAXHandler extends DefaultHandler { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be public or can it be package-private?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops. I was looking at old commits.
|
||
private final SAXParser saxParser; | ||
|
||
public ObservationHelper() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to have multiple instances of this class? Could it be a singleton utility class instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or alternatively, could the public method be static and it not have a public constructor?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It could certainly be a singleton, is something like this what you had in mind:
`java
private static ObservationHelper INSTANCE;
public static ObservationHelper getInstance() {
if (INSTANCE == null) {
INSTANCE = new ObservationHelper();
}
return INSTANCE;
}
private ObservationHelper() {
`
Also noted that a minor bug slipped through the tests, I have a fix in place locally.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, that would be one option. I'll leave it up to @corneil to advise on what makes most sense given existing patterns used in this codebase.
@johkin when I checkout the PR and run
|
Yes, I noticed the test-failures yesterday. I've updated the code to handle the issue correctly. |
Initial implementation of observation for spring-ws.
Please feel free to comment and provide feedback.
#1094