-
1. Re: Object instance in a MBean
genman Oct 31, 2003 4:56 PM (in response to sugramoin)
You can do that. When you return an object from an MBean method, the same object instance is passed to the caller. It isn't serialized.
Aside from concurrency issues, it's legitimate practice.
It is sometimes better to pass read-only structures or (shallow/deep) copies, so "clients" who use the structure aren't astonished by ConcurrentModifcationException-s. -
2. Re: Object instance in a MBean
sugramoin Nov 10, 2003 1:10 PM (in response to sugramoin)Is there any pattern for using singelton in MBeans,
or some advices which are provided by any jini.
i would love to go through some of those.
TIA
Moin -
3. Re: Object instance in a MBean
genman Nov 10, 2003 6:46 PM (in response to sugramoin)
The free documentation shows you how to bind a JMX service to a JNDI name. There's typically no reason to do that because you can easily return objects via the MBeanServer.
Download and take a look at the JBoss source and take a look at a few MBeans that are provided. Or, buy the documentation and write a few MBeans yourself.