-
1. Re: MBeanRegistration::preRegister ObjectName change
juha Sep 6, 2002 12:50 PM (in response to tom.elrod)The implementation is correct as per the javadoc specification of the MBeanRegistration interface. If no object name is specified (null) then then MBean may return a default object name.
-- Juha -
2. Re: MBeanRegistration::preRegister ObjectName change
tom.elrod Sep 6, 2002 1:12 PM (in response to tom.elrod)(already replied once, so if 2 show up, sorry. Jive caching is real pain).
Ok. Guess this also implies that if the object name is not null, then MBean may not return a default object name (or at least it will be ignored).
My goal was to be able to have some sort of base MBean class all my other MBeans could extend so that I could append some common information to all the object names of all my MBeans. For example, I might want to append vendor=Acme to all my MBeans. I was hoping to be able to do this in the preRegister() method since it is a central location to do this. You have any other suggestions on another way to do this?
Thanks.
-Tom -
3. Re: MBeanRegistration::preRegister ObjectName change
juha Sep 6, 2002 2:01 PM (in response to tom.elrod)Why do you need to have this information as part of the object name rather than just an attribute of the MBean? Additional benefit of defining an attribute is that you get the query support which object names do not currently have.
-- Juha -
4. Re: MBeanRegistration::preRegister ObjectName change
tom.elrod Sep 6, 2002 2:59 PM (in response to tom.elrod)I think the example of vendor was bad. Vendor would probably be better as an attribute.
Another reason I would want to have ability to change ObjectName in preRegister() is to change the domain of the object name. This will come in handy in the case of remote MBeans, where I only want to see the MBeans for my domain (especially useful during testing). That way my queries could be scoped to only include the MBeans matching my domain. -
5. Re: MBeanRegistration::preRegister ObjectName change
juha Sep 6, 2002 6:25 PM (in response to tom.elrod)Not quite sure I got this second example either... but anyway
If you really want to change the behavior you can always plug in your own registry implementation. Should be a simple matter of "extends" of BMR where you replace the part that deals with ObjectName handling.
(we might want to break that logic down into more methods in future so doing this type of thing becomes easier... IIRC there's a quite a chunk you need to override now.. oh well, copy paste works)
-- Juha -
6. Re: MBeanRegistration::preRegister ObjectName change
jhaynie Sep 13, 2002 11:32 AM (in response to tom.elrod)OK, we extended BasicMBeanRegistry (cut and paste style as suggested) and added the system property jbossmx.mbean.registry.class to the run.bat. I copied the JAR that contains that class in the /lib directory and it can't seem to find my class. Moving the lib under server/lib didn't help either. If I added my jar to the classpath in run.bat (not ideal), it found it, but can't find org/jboss/mx/server/registry/MBeanRegistry now.
Any pointers on where I need to stick my jar? Seems like it ignores it if in /lib. -
7. Re: MBeanRegistration::preRegister ObjectName change
jhaynie Sep 13, 2002 11:35 AM (in response to tom.elrod)(if this is a duplicate post, sorry, jives doesn't seem to be working on my post)
OK, we extended BasicMBeanRegistry (cut and paste style as suggested) and added the system property jbossmx.mbean.registry.class to the run.bat. I copied the JAR that contains that class in the /lib directory and it can't seem to find my class. Moving the lib under server/lib didn't help either. If I added my jar to the classpath in run.bat (not ideal), it found it, but can't find org/jboss/mx/server/registry/MBeanRegistry now.
Any pointers on where I need to stick my jar? Seems like it ignores it if in /lib. -
8. Re: MBeanRegistration::preRegister ObjectName change
jhaynie Sep 13, 2002 1:23 PM (in response to tom.elrod)OK - figured it out using -L
I'm going to refactor to BasicMBeanRegistry to make it subclass friendly.
Juha, is it ok if I have Tom commit that to HEAD once we have it implemented and tested? -
9. Re: MBeanRegistration::preRegister ObjectName change
juha Sep 13, 2002 5:06 PM (in response to tom.elrod)yes it's ok =)
thank you for contributing