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

RepositoryConfigurationDelegate should use ResourceLoader provided by the infrastructure [DATACMNS-591] #1057

Closed
spring-projects-issues opened this issue Nov 12, 2014 · 8 comments

Comments

@spring-projects-issues
Copy link

@spring-projects-issues spring-projects-issues commented Nov 12, 2014

Elryk opened DATACMNS-591 and commented

In order to extend the RepositoryConfigurationDelegate, I would like to choose the ClassPathScanningCandidateComponentProvider implementation used by the multipleStoresDetected() method.
In an inherited ClassPathScanningCandidateComponentProvider, I would like to use the Vfs2PathMatchingResourcePatternResolver class (see this class on GitHub).
Overriding the multipleStoresDetected() could be a solution.

As explained in the SPR-12423, the ClassPathScanningCandidateComponentProvider allows to customize the ResourcePatternResolver implementation by calling the setResourceLoader method.
SPR-12423


Affects: 1.9.1 (Evans SR1)

Issue Links:

  • DATAJPA-631 ClasspathScanningPersistenceUnitPostProcessor should forward ResourceLoader configured to the ClassPathScanningCandidateComponentProvider used for the entity type scanning

  • SPR-12423 ClassPathScanningCandidateComponentProvider customisation

Referenced from: pull request #102, and commits spring-projects/spring-data-jpa@aeab939, spring-projects/spring-data-jpa@a3d1562, spring-projects/spring-data-jpa@6677b6d

Backported to: 1.9.2 (Evans SR2)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 13, 2014

Oliver Drotbohm commented

Wouldn't it rather make sense to implement a custom ResourceLoader as this is the primary API that gets handed around to eventually be responsible for interaction around resource lookups. We already are set up to basically use the one that get's globally configured on the ApplicationContext, although multipleStoresDetected() currently doesn't set it on the CPSCCP (which would need to be fixed)

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 14, 2014

Elryk commented

Is-it possible for multipleStoresDetected() to use the getResourcePatternResolver() method defined into the AbstractApplicationContext class?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 14, 2014

Oliver Drotbohm commented

We don't have access to an ApplicationContext while RepositoryConfigurationDelegate is used. What about my question on the ResourceLoader?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 14, 2014

Elryk commented

I'm not sure to understand your question. Do you mean to let developer to choose a custom ResourceLoader? If true, it will make a sense for my requirements.

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Nov 24, 2014

Oliver Drotbohm commented

We now pip the Environment and ResourceLoader picked up from the infrastructure in the ClassPathScanningCandidateComponentProvider to detect multiple store modules. Global customize to the ResourceLoader should now be reflected in the detection as well

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Dec 5, 2014

Elryk commented

Thanks Oliver, it's working with Spring Data Commons 1.10 M1 and Spring Data Jpa 1.8.0.M1 without I need to change anything to my Spring configuration

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Dec 8, 2014

Oliver Drotbohm commented

Not sure I get you. Are you saying it works for you?

@spring-projects-issues
Copy link
Author

@spring-projects-issues spring-projects-issues commented Dec 8, 2014

Elryk commented

Yes, it works for me. Thanks for the change

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

Successfully merging a pull request may close this issue.

None yet
2 participants