mx4j.util
Class StandardMBeanProxy

java.lang.Object
  |
  +--mx4j.util.StandardMBeanProxy

public class StandardMBeanProxy
extends java.lang.Object

A proxy for invocation on standard MBeans (does not work for DynamicMBeans).

Usage example:

 public interface MyServiceMBean {...}
 public class MyService implements MyServiceMBean {...}
 pulic class Main
 {
    public static void main(String[] args) throws Exception
    {
       MBeanServer server = ...;
       ObjectName myServiceObjectName = ...;

       MyServiceMBean mbean = (MyServiceMBean)StandardMBeanProxy.create(MyServiceMBean.class, server, myServiceObjectName);

       ...
    }
 }
 

Version:
$Revision: 1.3 $
Author:
Simone Bordet

Constructor Summary
StandardMBeanProxy()
           
 
Method Summary
static java.lang.Object create(java.lang.Class mbeanInterface, MBeanServer server, ObjectName name)
          Creates a proxy with the given MBean interface for an MBean with the specified name living in the specified MBeanServer.
static java.lang.Object create(java.lang.Class mbeanInterface, ObjectName name)
          Creates a proxy with the given MBean interface for an MBean with the specified name living in the MBeanServer returned by MBeanServerFactory.findMBeanServer(null).get(0).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StandardMBeanProxy

public StandardMBeanProxy()
Method Detail

create

public static java.lang.Object create(java.lang.Class mbeanInterface,
                                      ObjectName name)
Creates a proxy with the given MBean interface for an MBean with the specified name living in the MBeanServer returned by MBeanServerFactory.findMBeanServer(null).get(0).

create

public static java.lang.Object create(java.lang.Class mbeanInterface,
                                      MBeanServer server,
                                      ObjectName name)
Creates a proxy with the given MBean interface for an MBean with the specified name living in the specified MBeanServer.