I've been trying to find some definitive information about whether or not a sar is, effectively, a singleton object within JBoss. The reason I ask is because I have a sar that loads a configuration file that is queried a lot by some EJBs, WARs, etc. I have exposed a "reload configuration" method that can be invoked from the jmx interface which does just that...blows away the list and reloads it from the file.
But this got me thinking; I don't see, via the log files, the list being populated every time an ejb invokes it, only when I start up JBoss or hit the "reload" button. Even though the ejb connects to the sar and instantiates the class, the config list is always populated.
Does this mean that the class that extends ServiceMBeanSupport is somehow being treated by JBoss as singletons?
Just curious, I wanted to make sure I understand how sars actually work.
Yes, MBeans are singletons.(And remember that it __may__ need to be threadsafe in a multi-threaded environment like JBoss)