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

Provide a custom Spring instantiator #2596

Closed
denis-anisimov opened this issue Oct 5, 2017 · 0 comments
Closed

Provide a custom Spring instantiator #2596

denis-anisimov opened this issue Oct 5, 2017 · 0 comments
Assignees
Labels
Milestone

Comments

@denis-anisimov
Copy link
Contributor

The Instantiator class is used as SPI.
It makes possible to register custom classes to use them inside Flow.
E.g. VaadinServiceInitListener should be registered in a specific way (not via API) (see docs about the way).
Normally the standard Java SPI mechanism is used for this.
It's possible to use another way to register SPI in Spring (DI : asking beans from application context/autowiring ).

We should extend the way for Spring to register those classes.
Default behavior should be kept since it's still possible to use this way. But it also should be possible to register a bean (e.g. via @Component annotation) and extends VaadinServiceInitListener.
Then such class becomes available for DI and it should be registered as a listener.

Please note that Instantiator itself is registered via standard Java SPI. It's an open question: should we extend VaadinServletService in our Spring add-on to load the instantiator via Spring mechanisms or should we keep standard Java SPI mechanism in this case.

@denis-anisimov denis-anisimov self-assigned this Oct 5, 2017
denis-anisimov pushed a commit that referenced this issue Oct 6, 2017
Also extract all UI and IT test classes into a separate module (test-jar) and use it in both WAR and Spring Boot application projects tpo avoid code duplication.

Fixes #2596
@pleku pleku added the 0-team label Oct 9, 2017
denis-anisimov pushed a commit that referenced this issue Oct 10, 2017
…2626)

* Add Spring vaadin servlet, service and implement Spring instantiator

Also extract all UI and IT test classes into a separate module (test-jar) and use it in both WAR and Spring Boot application projects tpo avoid code duplication.

Fixes #2596

* Correct @route classes instantiation.
IT test for Spring managed routing.

* JUnit tests for autoconfiguration: instantiator and vaadin servlet service.

* Trying to understand the build failure.

* Javadoc corrections

* Revert failing test back

* Add javadoc to bean production method

* -

* -

* Code review corrections

* Merge branch 'master' into 2596-spring-instantiator

* Merge branch 'master' into 2596-spring-instantiator
@ZheSun88 ZheSun88 added this to the 1.0.0.alpha5 milestone Oct 12, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants