org.jboss.mx.util
Class MBeanTyper

java.lang.Object
  extended byorg.jboss.mx.util.MBeanTyper

public class MBeanTyper
extends java.lang.Object

MBeanTyper is a helper class that creates a typed-object from an MBean ObjectName and a main interface class that the MBean implements. You can then use the returned object (casted to the appropriate main interface class) with the correct typed signatures instead of mbeanserver.invoke(objectname,,etc.).

Example usage:
MyInterfaceMBean mbean=(MyInterfaceMBean)MBeanTyper.typeMBean(server,new ObjectName(":type=MyBean"),MyInterfaceMBean.class); mbean.foobar();

To turn debug on for this package, set the System property vocalos.jmx.mbeantyper.debug to true.


Constructor Summary
MBeanTyper()
           
 
Method Summary
static java.lang.Object typeMBean(MBeanServer (src)  server, ObjectName (src)  mbean, java.lang.Class mainInterface)
          create a typed object from an mbean
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MBeanTyper

public MBeanTyper()
Method Detail

typeMBean

public static final java.lang.Object typeMBean(MBeanServer (src)  server,
                                               ObjectName (src)  mbean,
                                               java.lang.Class mainInterface)
                                        throws java.lang.Exception
create a typed object from an mbean

Throws:
java.lang.Exception