I use jboss 7.1 CR1b and i've annotated a class as singleton assuming that it will be active on only one machine when depolyed in domain mode. But i see that it gets active in both of the machines that i've started. It can get invoked on both as well. i mean depending on the machine IP i give. Am i doing anything stupid here?
Moreover, if i have a singleton bean deployed anyway. Which method should I use to invoke the bean. ( the bean could get invoked from any other bean across the cluster, all the calls should end up executing the singleton bean). Will the usual JNDI lookup do?
The EJB spec says:
A Singleton session bean is a session bean component that is instantiated once per application. In cases where the container is distributed over many virtual machines, each application will have one bean instance of the Singleton for each JVM