I am using SpringFramework for web server.
Sometimes I need to do asynchronous task to implement certain function.
Usually, I prefer to use
- @Inject @Component(which is implements Runnable) in @Service.
But I am not sure is it OK or not.
So I got a question just like the title.
- '
@Inject thread bean in @Service
'
OR
- '
@Inject service bean in @Component
'
I want to know which way is more frequently uses.
Thanks in advance:D
Have a good Day!