I'm wrong about:
cache = Collections.synchronizedMap(new HashMap());
would make it a singleton.
In the book J2EE Core
Patterns, the say that it is implemented as a singleton. But how do you achieve this?
Is it because you cant say: ServiceLocator sl = new ServiceLocator();
You can only say: ServiceLocator sl = ServiceLocator.getInstance();
Althought they also say that the J2EE container has multiple class loaders, thereby it can't be a singleton.
Why i think it should be a singleton? If it's a singleton, there would be only one instance, so only one cache to be maintained.
If it isn't a singleton, there can be more than one instance, so also more than one cache which needs to be filled up with EJB Home objects,...