-
1. Re: JNDI lookup string
adrian.brock Jun 20, 2002 10:10 PM (in response to defender1844)You need to use a connector.
I think these docs are 2.4
http://www.jboss.org/online-manual/HTML/ch13s39.html
and there is a mistake which is corrected in these
forums if you search.
If you are using 3.0 there is also an ejb connector.
The idea behind these are that you lookup a "remote
MBeanServer" from jndi, then you can access the MBean
using that object.
Regards,
Adrian -
2. Re: JNDI lookup string
davidjencks Jun 21, 2002 12:59 AM (in response to defender1844)The only connection between jndi and jmx is that jndi services in jboss are implemented as mbeans. If you want something related to your mbean to be bound in jndi you have to bind it yourself. Consider using the NonSerializableObjectFactory so you get your original mbean back, not a serialized/deserialized copy.
-
3. Re: JNDI lookup string
defender1844 Jun 21, 2002 2:11 AM (in response to defender1844)Well, what we are trying to do is implement a
singleton by making it an MBean. Is there a pattern
that most JBoss developers adhere to to do this?
Is binding my mbean to JNDI myself a commonly
used pattern or am I missing something? -
4. Re: JNDI lookup string
defender1844 Jun 21, 2002 2:13 AM (in response to defender1844)Is there an example of the use of NonSerializedObjectFactory?
-
5. Re: JNDI lookup string
vishalsant Jun 21, 2002 2:46 PM (in response to defender1844)i have a clutch of mbeans i have implemented as singetons.
i think that was feasible because the underlying archtecture of JMX seems to point to an object that
is retained till it is not deregistered .
Am i correct in this assumption?? -
6. Re: JNDI lookup string
davidjencks Jun 22, 2002 9:40 AM (in response to defender1844)MBeans are indeed singletons in the sense that the MBeanServer manages particular object instances. On the other hand there is nothing preventing you from instantiating many mbeans that are instances of the same class, as long as they are identified by different object names.
Personally I tend to prefer to access mbeans by calling them through the mbean server. If I have a particularly heavily used method I usually supply a read-only Instance attribute (in other words a getInstance method in the MBean interface) that returns the instance to get the actual object for use.
For use of JNDI, I should have written NonSerializableFactory. One example is in server/src/main/org/jboss/jms/asf/ServerSessionPoolLoader.java.