Consider this 'pattern' I encounter in a application I inherited:
public class BusinessUtil{
public static void doBusiness(IService myService, String arg1, int arg2){
//something something
myService.doStuff(arg1, arg2);
}
}
The myService bean is a springBean (=singleton). It is actually a cxf-client (=generated webservice-client)
This is in a webapplication, so the static doBusiness() method is called from different concurrent threads. Is this method thread-safe?
Before you ask: I know this is a weird 'pattern'. I know the doBusiness() method is quite redundant since we can call myService.doStuff() directly instead of passing it into a static method, where it is called. As I said, I inherited an application where this 'pattern' is all over the place. I do not know why. The application has (sometimes) some strange behaviour and I'm trying to locate the source of the problem.