There seems to be some misconception about MBeanProxy, Java interfaces 
and JMX with respect to coupling and flexibility.

MBeanProxy + Java inteface are client-side tools which make using JMX 
easier to use.  This is because the proxy will perform the required type 
casting and will handle the signature specification for the operation 
being called.  It will also handle translating JMX exceptions back into 
application exceptions.

There is NO requirement that the target MBean implement that Java 
interface.  The target MBean must provide methods that match the Java 
interface for the component to function correctly.  It can implement the 
Java interface to catch non-conformince errors durring compile time, but 
it doesn't have too... exceptions will be thrown for any non-conforming 
MBean.

There is absolutly NO coupling when using a Java interface and 
MBeanProxy to invoke operations on a target MBean, as there is no 
requirement that the target MBean implement that interface.  At runtime 
the interface only plays a role on the client side.  BUT durring compile 
time, it plays a role on both, assuming that the target implements the 
Java interface.

In a closed system it seems like a logical choice to make use of a Java 
interface on the client and target MBean sides of JMX, as it will allow 
for more error detection durring compile time.  This DOES NOT mean that 
external/thirdparty components will not work because they do not 
implement the Java interface, becase that is just not true.  Any object 
which provides the appropriate methods will function, regaurdless of the 
Java classes it extends or interfaces it implements.

By making use of Java interfaces with JMX it allows us:

 o to simplify client code, as it no longer has to deal with the details 
of the MBeanServer.
 o to catch JMX interfacing / typeing errors introduces when the system 
changes at COMPILE TIME.
 o a mechansim for documenting the methods required for a target MBean 
to function correctly.

* * *

JMX allows greater flexibilty with respect to external/thirdparty 
component vendors and compatiblity with JBoss at the cost of detyping 
method calls.  MBeanProxy resolves the type issue and client side 
simplification and ease of use.  It does NOT introduce any additional 
coupling.

--jason


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

Reply via email to