Skip to content
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

Interceptor Redo #6658

Merged
merged 4 commits into from
Apr 21, 2023
Merged

Interceptor Redo #6658

merged 4 commits into from
Apr 21, 2023

Conversation

trentjeff
Copy link
Member

Resolves Issue #6629

@trentjeff trentjeff added the declarative Helidon Declarative label Apr 20, 2023
@trentjeff trentjeff added this to the 4.0.0-M1 milestone Apr 20, 2023
@trentjeff trentjeff self-assigned this Apr 20, 2023
@oracle-contributor-agreement oracle-contributor-agreement bot added the OCA Verified All contributors have signed the Oracle Contributor Agreement. label Apr 20, 2023
Copy link
Member

@tomas-langer tomas-langer left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This PR should also uncomment some sections, and remove @Disable from a test in
InterceptionTest and InterfaceInterceptionTest in helidon-pico-tests-interception

@@ -50,6 +51,7 @@ public interface Interceptor {
*
* @param args the arguments passed
* @return the result of the call
* @throws InvocationException if there is an errors during invocation chain processing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"there is an error during" or "there are errors during"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed

@@ -32,6 +32,7 @@ public interface Interceptor {
* @param args the arguments to the call
* @param <V> the return value type (or {@link Void} for void method elements)
* @return the return value to the caller
* @throws InvocationException if there is an errors during invocation chain processing
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

either is an error or are errors - typo

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pushed

@trentjeff
Copy link
Member Author

My assumptions are a little different from yours.

I expected that once the target of interception was successfully called once, then game over. The target can't be called again. However, If it threw an exception then it can be called again - but if it was completed then game over.

You assume you should be able to call the target an infinite number of times really.

I think both viewpoints have some merit, and perhaps we should make this into a qualifier type annotation on interceptors or something?

@@ -37,6 +37,7 @@ static Invocation lastCall() {
return LAST_CALL.getAndSet(null);
}

@SuppressWarnings("unchecked")
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Curiously the SuppressWarnings("ALL") doesn't catch the unchecked vararg warnings in the generated interceptor - this did the trick though.

@tomas-langer
Copy link
Member

A qualifier such as @Repeatable that could be used on other annotations to mark them as "yes, we may want to invoke interceptor chain more than once" - I do not have problem with that

@trentjeff
Copy link
Member Author

Logged #6664 - Add @repeatable meta annotation qualifier on InterceptorTrigger

@trentjeff trentjeff merged commit 1482b89 into helidon-io:main Apr 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
declarative Helidon Declarative OCA Verified All contributors have signed the Oracle Contributor Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants