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

Constructor autowiring (#56) #87

Merged
merged 2 commits into from
Oct 23, 2020

Conversation

bjansen
Copy link
Contributor

@bjansen bjansen commented Oct 1, 2020

The main change is that endpoints are instantiated using applicationContext.getAutowireCapableBeanFactory().createBean(clazz) rather than using reflection directly.

Actual autowiring is tested in WeatherServiceEndpointSystemTest.java.

Note that endpoints don't necessarily need the @Autowired annotation, Spring will also manage non-annotated constructors as long as the dependencies exist.

@marcopaga marcopaga merged commit 0e580bc into codecentric:master Oct 23, 2020
@marcopaga
Copy link
Contributor

Thank you @bjansen. This make instatiating cleaner. Cool, that you brought this up and implemented it 👍

@bjansen
Copy link
Contributor Author

bjansen commented Oct 23, 2020

My pleasure!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants