Hallo Java experts,
I am new to Java and I am not sure if there are issues relating to singleton classes in servlets/beans especially in a clustered environment.
Here is a simple example of a hashmap in a singleton class called GlobalModuleInfoList and both a servlet and a bean registers themselves and access it.
My question is therefore if it is an issue if the bean access a global singleton class (as per this example).
I could of course put the hashmap directly in the bean and allow multiple servlets access to it, but I have non Java EE code that also need access to a global registered module list.
I am new to Java and I am not sure if there are issues relating to singleton classes in servlets/beans especially in a clustered environment.
Here is a simple example of a hashmap in a singleton class called GlobalModuleInfoList and both a servlet and a bean registers themselves and access it.
My question is therefore if it is an issue if the bean access a global singleton class (as per this example).
I could of course put the hashmap directly in the bean and allow multiple servlets access to it, but I have non Java EE code that also need access to a global registered module list.