> 
> I would have to check, but I think the MBeanProxy impl in the JBoss/JMX module will 
>propertly treat
> set/get calls as attributes and not operations.

It does (or should, I don't test my code all that much ;)

But this only works reliably on standard MBeans. It relies part of the attribute 
identification to set/getAttribute naming convention. If you agree to follow the same 
convention for your resource object (for model mbean) or in your dynamic mbean 
operation/attribute mapping then it might work as well (haven't tried).

The problem with dynamic mbeans is that if your attribute setter is named foo() and 
you expose the management attribute as "Bar" there is no way for the proxy to know 
whether Proxy.foo() should map to server.setAttribute("Bar") or server.invoke("foo");

For model mbeans it might be possible to solve this by creating some smart descriptor 
mapping in the mbean's metadata (as the proxy retrieves and parses the metadata at 
creation time before invocations are allowed).

As for whether or not the proxy should be used in the first place: I think it is 
ultimately the developer's choice of trade-offs. There is an increased type-safety and 
the general ease of use when proxy is used. On the other hand you lose some of the 
flexibility provided by the JMX and you need to, at least on some level, be aware of 
the mbean type (standard or dynamic), which the agent should hide, to be sure the 
proxy works (dynamic mbean being the odd one and occasionally failing).

Personally I don't see a problem using the proxy with somewhat standardized mbean 
interfaces, for example if you need to play with the standard agent service mbeans. 
Those interfaces won't be changing that often and it makes sense to use the proxy in 
that case for type safety.

my 2 cents

-- Juha 


_________________________________________________________
View thread online: http://main.jboss.org/thread.jsp?forum=66&thread=10323

_______________________________________________
Jboss-development mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-development

Reply via email to