On Jul 14, 2004, at 4:47 AM, Gianny Damour wrote:

On 14/07/2004 12:09 PM, Dain Sundstrom wrote:


On 14/07/2004 9:17 AM, Gianny Damour wrote:

I have just updated the way GBean attribute names are derived:
When GBeans are proxied via RawGBeanInvokers, attribute names may start with an upper-case letter. For instance, if a GBean has a method "getFoo", then the implementation tries to find an attribute having the name "Foo". This was the behavior before my updates and I have restored it. Now, if such an attribute is not defined, then the implementation tries to find an attribute having the name "foo".


When GBeans are proxied via JMXGBeanInvokers, attribute names are derived based on the "exact" name embedded in the method name. For instance, if a GBean has a method "getfoo", then the implementation tries to find an attribute having the name "foo". This was the behavior before my updates and I have restored it.


Uh, I think you lost me. I suggest we first try an exact match using JMX standard MBean rules (getFoo looks for a method Foo) and if that fails we do a case insensitive match. What ever we do, it must be consistent between the GBeanInvokers, since the programmer has not input into the invoker type the container chooses.

Sorry; indeed, this is perhaps not the right approach. However, I was pretty confident that this new behavior was more correct:
As far as I understand, the JMX GBeanInvokers are used only when the "framework" mounts a reference, which does not have an attribute named GBeanMBean.RAW_INVOKER. Most of the time, this means that the reference is an "home-made" MBean (an MBean, which is not a GBeanMBean). So, I thought that we could safely say that programmers have applied the JMX standards. In other words, if the attribute is named "serverVersion", then the getter must be "getserverVersion".

When you want to interact with a GBean over a remote MBean server (JSR 160), you will use the JMXGBeanInvokers. Also, this is an attempt to make our interactions through JMX easier. Having to name methods getfoo, just to get a lowercase attribute name is one of the bad side effects of the JMX standard mbean model.


Having said that, the RawGBeanInvokers are used, most of the time, when the reference is a GBeanMBean. Based on the naming conventions of the attribute names (lower-case for the first character), I saw two approaches:
- renaming of the getters and setters of the various GBeans in order to be aligned with the JMX standards; or
- update of the way methods and attribute names were matched.


The second approach has been implemented. This means that from a method getFoo, the implementation will look for Foo. In case of failure, it will then look for foo.
I am happy to make this second look-up case insensitive. Yet, I am not sure that JMX GBeanInvokers should mirror this behavior.


In other words, and as far as I understand, programmers know the invoker type, which will be used by the container:
- if they use a GBean, it will be the Raw type;
- if they implement an MBean having an attribute GBeanMBean.RAW_INVOKER, then it will also be the Raw type; otherwise
- it will be the JMX type. In this specific case, one could assume that the JMX naming conventions have been applied.

I definitely think the two should work exactly the same and the programmer should not know which one is being used (other then the JMX one is way slower). My biggest reason to have these work the same is the person using the GBeanInvoker is caller, and the caller would have to know how the target GBean was implemented in order to get the calling code correct.


-dain



Reply via email to