I have an wildfly with 10 EARs inside /standalone/deployments
.
Each of these EARs has a lib called “my-lib.jar” on the /lib
directory.
This Lib has a class called MyClassUsedForSomethingImportant.java
which has a static variable. The purpose of this static variable is to store an unique ID generated progamatically for each EAR. Its unique per EAR!!!!
My question is: This static variable is shared between ALL EARs or it is contained on the scope of each EAR?
The problem that could occur: If static variables are shared between ALL EARs, then the static variable will be overwritten every time an EAR sets a value to it, and this is a problem.
The goal: Every EAR should have a variable that is not shared between all EARs.