I meet a problem in static field. I think the root cause must be the scope of the static field.
The project is based on Apache servicemix and consists of many sub-projects.
In sub-project 'A', I defined a static list field 'reg' in class 'Registration' and some static method to operate the field like 'add' and 'getAll'. Once the sub-projectA is deployed, the name of the project 'A' will be added into the static list for registration.
The problem is when it comes to sub-project 'B', when the sub-project 'B' is deployed, I want its name would be added into the exactly same static list for registration. But when I call static method getAll or add on 'Registration', it seems that the 'reg' in sub-projectB is totally different from the one in sub-projectA. So the registration function doesn't work.
So I want to ask one basic question, what's the scope of a static field? Is it valid in a JVM or some other things?
Thanks for your help