I have multiple wars deployed in jetty. Initially I had a singleton class but the problem was it was initialized in both the wars. So I'm trying by making the singleton as enum. Is there a way to make a JVM wide singleton ?
You can't really enforce this. Your singletons will be classloader-specific, and since your apps can define multiple classloaders, you're going to be frustrated.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With