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 support for Spring 3 #226

Merged
merged 1 commit into from
Apr 20, 2016
Merged

Add support for Spring 3 #226

merged 1 commit into from
Apr 20, 2016

Conversation

pvorb
Copy link
Contributor

@pvorb pvorb commented Mar 16, 2016

atmosphere-spring brings support for Spring 4.

With the current code, it is almost impossible to integrate atmosphere-spring into a Spring 3 project due to a missing method in BeanFactory (i.e. ApplicationContext) which was added in Spring 4.1: <T> T getBean(Class<T> requiredType, Object... args) throws BeansException;

This PR replaces the use of T getBean(Class<T> requiredType, Object... args) by Object getBean(String name, Object... args), which has been around since Spring 2.5. This way, you can also use atmosphere-spring with older Spring versions.

Changing the property spring-version to 3.2.x is not mandatory but might help to assert future changes won't break compatibility with Spring 3.

@pvorb
Copy link
Contributor Author

pvorb commented Mar 16, 2016

This change should fix issue #187.

@jfarcand
Copy link
Member

@pvorb It would be better if both version are supported. Should be easy to rework your patch to use reflection and detect the version used. So just update and I will merge and release

@pvorb
Copy link
Contributor Author

pvorb commented Apr 20, 2016

@jfarcand With my fix, both Spring 3 and Spring 4+ are supported, since the old method is supported in newer versions. It is not marked as deprecated, so it will stay for a few versions of Spring.

@jfarcand jfarcand merged commit 4e82a15 into Atmosphere:master Apr 20, 2016
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