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

ArC - enable implementing all types of interception with single method #15633

Merged
merged 1 commit into from
Mar 12, 2021

Conversation

mkouba
Copy link
Contributor

@mkouba mkouba commented Mar 11, 2021

@quarkus-bot quarkus-bot bot added the area/arc Issue related to ARC (dependency injection) label Mar 11, 2021
@mkouba mkouba requested a review from manovotn March 11, 2021 13:07
@@ -103,6 +91,22 @@
}
}

private MethodInfo validateSignature(MethodInfo method) {
List<Type> parameters = method.parameters();
if (parameters.size() != 1 || !parameters.get(0).name().equals(DotNames.INVOCATION_CONTEXT)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Shouldn't we also allow ArcInvocationContext?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's a good point but I don't think it would work right now... let me check.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hm, this would actually require some more work, because we also generate the interceptor beans that implement javax.enterprise.inject.spi.Interceptor.intercept(InterceptionType, T, InvocationContext) etc. We can create a feature request though. Currently, you would need to cast the InvocationContext inside the interceptor method. @manovotn WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

Fair enough, it just occurred to me when I saw the code :)

Copy link
Contributor

Choose a reason for hiding this comment

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

Created #15660

@mkouba mkouba merged commit 3baa471 into quarkusio:master Mar 12, 2021
@quarkus-bot quarkus-bot bot added this to the 1.13 - master milestone Mar 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/arc Issue related to ARC (dependency injection)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

@PostConstruct interceptor method returning Object works only if it's private
2 participants