-
Notifications
You must be signed in to change notification settings - Fork 151
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
Improve Spring integration #1
Conversation
I have added the missing properties. Regarding the potential race condition: synchronization is indeed taken care of by Spring, although this is not very cleanly documented. |
Could you please create a new maven module (like the Jetty / Tomcat lifecycles) instead of adding this to the core module? |
Ok, I'm satisfied that the factory method is properly synchronized at the Spring library level. |
Marcus, thanks for the changes. They look good, and you did a nice job keeping inline with the btm coding style. The last change before we pull code I think would be Lorban's suggestion of creating the new integration as a module along the lines of jetty/tomcat (maybe btm-spring-lifecycle). Thanks again for the nice work. |
Okay, I can do that. However, are you sure that's what you want for just these two classes? Since the new Spring dependencies are declared as optional, they won't interfere with projects using BTM (that is, they are not transitive dependencies). Let me know. |
Yes, I'm quite sure. If you look at the Tomcat and Jetty modules you'll notice that they also contain very minimal code, so don't worry if there isn't much in your module. It is just to keep a clear separation between the core BTM dependencies and the optional modules. By the way, naming it 'btm-spring' sounds better as the '-lifecycle' suffix really is specific to the servlet container world. Thanks! |
Ok, will do. |
- Added unit test. - Replaced usage of copySettingsTo with get+setProperties.
Done |
Pull request reviewed and merged into master. |
Spring beans needed for BTM can be configured as follows:
The PoolingDataSourceFactoryBean correctly works together with Spring's lifecycle management.