I am having a kind of ‘Task’ class that contains a spring injected bean. ( will set via setter method)
this Task class will be initiated as a new object and will pass in to the theradpool.
so every task class has that injected bean in it.
when i use a method in that bean class will it be thread safe? ( since the bean is a singleton)
also please note that there are no class level variables defined in that bean class.
Appreciate your help..
A stateless object is always inherently thread-safe. Since it uses only local variables, there is no way for one thread to corrupt the state used by another concurrent thread.