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

Can not Inject atmosphere component when using spring injection #245

Open
chuongnv2019 opened this issue Jan 20, 2020 · 0 comments
Open

Comments

@chuongnv2019
Copy link

chuongnv2019 commented Jan 20, 2020

Dear atmosphere team,

Today, I integrate Spring Boot into atmosphere framework,
I'm want to Use Spring DI to manage beans in my application so I have used atmosphere-spring extension.

  1. I have setting Init param for servlet:
    registration.addInitParameter("org.atmosphere.cpr.objectFactory","org.atmosphere.spring.SpringWebObjectFactory");

  2. My chat service, I want to inject some componenents:

`
@AtmosphereHandlerService(path = "/chat", interceptors=
{AtmosphereResourceLifecycleInterceptor.class,
BroadcastOnPostAtmosphereInterceptor.class})
public class ChatSimple extends OnMessage {

@Inject
private Comp comp; //This component is instantiated By Spring DI

@Inject
private BroadcasterFactory broadcasterFactory; 

`

I can not receive correct value of broadcasterFactory object.

Btw, I see we only use one ObjectFactory in the application .
Is there any way to combine bold org.atmosphere.inject.InjectableObjectFactory and org.atmosphere.spring.SpringWebObjectFactory ?

regards

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

No branches or pull requests

1 participant