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

Add Configurer#registerHandlerEnhancerDefinition #2545

Merged
merged 2 commits into from Jan 5, 2023

Conversation

smcvb
Copy link
Member

@smcvb smcvb commented Jan 3, 2023

This pull request introduces a method to the Configurer to register HandlerEnhancerDefinitions.
The DefaultConfigurer#defaultHandlerDefinition operation is adjusted to combine all HandlerEnhancerDefinitions registered through the Configurer with enhancer definitions originating from the ServiceLoader mechanism.

It does so through construction of the default HandlerDefinition through the ClasspathHandlerDefinition.
This implementation in turn uses the ClasspathHandlerEnhancerDefinition to retrieve enhancers through the ServiceLoader mechanism.

The service-loaded instances and registered instances are flattened into a single collection and given to a new `MultiHandlerDefinition.

Lastly, this PR validates this behavior to work for non-Spring and Spring environments.

Add a method to register HandlerEnhancerDefinitions through the
Configurer. The Configurer should receive a default implementation doing
 nothing to support users using a custom Configurer instance. The
DefaultConfigurer should adjust the defaultHandlerDefinition() operation
 such that registered HandlerEnhancerDefinitions are added and combined
 with enhancers originating from the default HandlerDefinition itself,
 if this is a MultiHandlerDefinition. All enhancers should be flattened
into one big collection for the final HandlerDefinition. Lastly, tests
should show this behavior to work for non-Spring and Spring environments

#feature/handler-enhancer-configuration
@smcvb smcvb added Type: Feature Use to signal an issue is completely new to the project. Priority 3: Could Low priority. Issues that are nice to have but have a straightforward workaround. Status: In Progress Use to signal this issue is actively worked on. labels Jan 3, 2023
@smcvb smcvb added this to the Release 4.7.0 milestone Jan 3, 2023
@smcvb smcvb requested review from abuijze and a team January 3, 2023 15:53
@smcvb smcvb self-assigned this Jan 3, 2023
@smcvb smcvb requested review from gklijs and CodeDrivenMitch and removed request for a team January 3, 2023 15:53
Copy link
Member

@CodeDrivenMitch CodeDrivenMitch left a comment

Choose a reason for hiding this comment

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

image

Copy link
Member

@abuijze abuijze left a comment

Choose a reason for hiding this comment

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

Very small change request

@smcvb smcvb requested a review from abuijze January 4, 2023 13:39
Remove default implementation, as we expect a concrete implementation at
 all times. Furthermore, the chances are slim users implement their own
 Configurer from scratch. Thus, users wouldn't hit a breaking changes
 through this non-default interface method.

#2545
@sonarcloud
Copy link

sonarcloud bot commented Jan 4, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

95.0% 95.0% Coverage
0.0% 0.0% Duplication

@smcvb smcvb merged commit 52df7a3 into master Jan 5, 2023
@smcvb smcvb deleted the feature/handler-enhancer-configuration branch January 5, 2023 13:47
@smcvb smcvb added Status: Resolved Use to signal that work on this issue is done. and removed Status: In Progress Use to signal this issue is actively worked on. labels Jan 5, 2023
smcvb added a commit to AxonIQ/reference-guide that referenced this pull request Jan 23, 2023
The Handler Enhancers section contains some minor inconsistency that
should be resolved. Like, usage of the `annotationAttributes` method,
which is deprecated. Furthermore, the configuration section shouldn't
point to HandlerDefinition configuration at all, as that should be a
separate section. Lasty, we can add the new
registerHandlerEnhancerDefinition method of the Configurer, following PR
 AxonFramework/AxonFramework#2545

#enhancement/af-4.7-adjustments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Priority 3: Could Low priority. Issues that are nice to have but have a straightforward workaround. Status: Resolved Use to signal that work on this issue is done. Type: Feature Use to signal an issue is completely new to the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants