[JBoss-dev] CVS update: jboss/src/main/org/jboss/util MBeanProxy.java

2002-02-14 Thread Jason Dillon

  User: user57  
  Date: 02/02/14 17:17:35

  Modified:src/main/org/jboss/util MBeanProxy.java
  Log:
   o MBeanProxy does not use org.jboss.proxy.compiler anymore, just plain
 old JDK1.3 Dymanic Proxy API will work just fine here (since we don't
 support 1.2 anymore).
  
  Revision  ChangesPath
  1.10  +4 -4  jboss/src/main/org/jboss/util/MBeanProxy.java
  
  Index: MBeanProxy.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/MBeanProxy.java,v
  retrieving revision 1.9
  retrieving revision 1.10
  diff -u -r1.9 -r1.10
  --- MBeanProxy.java   13 Feb 2002 04:26:40 -  1.9
  +++ MBeanProxy.java   15 Feb 2002 01:17:35 -  1.10
  @@ -4,9 +4,12 @@
* Distributable under LGPL license.
* See terms of license at gnu.org.
*/
  +
   package org.jboss.util;
   
   import java.lang.reflect.Method;
  +import java.lang.reflect.Proxy;
  +import java.lang.reflect.InvocationHandler;
   
   import javax.management.MBeanServer;
   import javax.management.ObjectName;
  @@ -17,15 +20,12 @@
   import javax.management.RuntimeMBeanException;
   import javax.management.RuntimeErrorException;
   
  -import org.jboss.proxy.compiler.Proxy;
  -import org.jboss.proxy.compiler.InvocationHandler;
  -
   /**
* A factory for producing MBean proxies.
*  
* @author a href=mailto:[EMAIL PROTECTED];Rickard Öberg/a.
* @author a href=mailto:[EMAIL PROTECTED];Jason Dillon/a
  - * @version $Revision: 1.9 $
  + * @version $Revision: 1.10 $
*/
   public class MBeanProxy
  implements InvocationHandler
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/util MBeanProxy.java

2001-12-07 Thread marc fleury

  User: mnf999  
  Date: 01/12/07 09:53:39

  Modified:src/main/org/jboss/util MBeanProxy.java
  Log:
  import statements
  
  Revision  ChangesPath
  1.8   +3 -3  jboss/src/main/org/jboss/util/MBeanProxy.java
  
  Index: MBeanProxy.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/MBeanProxy.java,v
  retrieving revision 1.7
  retrieving revision 1.8
  diff -u -r1.7 -r1.8
  --- MBeanProxy.java   2001/08/03 17:15:57 1.7
  +++ MBeanProxy.java   2001/12/07 17:53:39 1.8
  @@ -18,15 +18,15 @@
   import javax.management.RuntimeMBeanException;
   import javax.management.RuntimeErrorException;
   
  -import org.jboss.proxy.Proxy;
  -import org.jboss.proxy.InvocationHandler;
  +import org.jboss.proxy.compiler.Proxy;
  +import org.jboss.proxy.compiler.InvocationHandler;
   
   /**
* A factory for producing MBean proxies.
*  
* @author a href=mailto:[EMAIL PROTECTED];Rickard Öberg/a.
* @author a href=mailto:[EMAIL PROTECTED];Jason Dillon/a
  - * @version $Revision: 1.7 $
  + * @version $Revision: 1.8 $
*/
   public class MBeanProxy
  implements InvocationHandler
  
  
  

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



[JBoss-dev] CVS update: jboss/src/main/org/jboss/util MBeanProxy.java

2001-07-19 Thread Jason Dillon

  User: user57  
  Date: 01/07/19 22:08:56

  Modified:src/main/org/jboss/util MBeanProxy.java
  Log:
   o cleaned up  added javadoc
   o added methods that take a MBeanServer
   o decoding a few more jmx exceptions
  
  Revision  ChangesPath
  1.6   +131 -36   jboss/src/main/org/jboss/util/MBeanProxy.java
  
  Index: MBeanProxy.java
  ===
  RCS file: /cvsroot/jboss/jboss/src/main/org/jboss/util/MBeanProxy.java,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- MBeanProxy.java   2001/06/18 20:01:28 1.5
  +++ MBeanProxy.java   2001/07/20 05:08:56 1.6
  @@ -6,23 +6,27 @@
*/
   package org.jboss.util;
   
  -import java.io.*;
  -import java.net.*;
   import java.lang.reflect.Method;
   
  -import javax.management.*;
  -import javax.management.loading.MLet;
  +import javax.management.MBeanServer;
  +import javax.management.MBeanServerFactory;
  +import javax.management.ObjectName;
  +import javax.management.MalformedObjectNameException;
  +import javax.management.MBeanException;
  +import javax.management.ReflectionException;
  +import javax.management.RuntimeOperationsException;
  +import javax.management.RuntimeMBeanException;
  +import javax.management.RuntimeErrorException;
   
  -import org.jboss.logging.Log;
   import org.jboss.proxy.Proxy;
   import org.jboss.proxy.InvocationHandler;
   
   /**
  - *   description 
  + * A factory for producing MBean proxies.
*  
  - *   @see related
  - *   @author a href=mailto:[EMAIL PROTECTED];Rickard Öberg/a.
  - *   @version $Revision: 1.5 $
  + * @author a href=mailto:[EMAIL PROTECTED];Rickard Öberg/a.
  + * @author a href=mailto:[EMAIL PROTECTED];Jason Dillon/a
  + * @version $Revision: 1.6 $
*/
   public class MBeanProxy
  implements InvocationHandler
  @@ -30,60 +34,151 @@
  // Constants -
   
  // Attributes 
  -   ObjectName name;
  -   MBeanServer server;
  +
  +   /** The server to proxy invoke calls to. */
  +   private final MBeanServer server;
  +
  +   /** The name of the object to invoke. */
  +   private final ObjectName name;
  
  // Static 
  -   public static Object create(Class intf, String name)
  +
  +   /**
  +* Create an MBean proxy.
  +*
  +* @param intfThe interface which the proxy will implement.
  +* @param nameA string used to construct the ObjectName of the
  +*MBean to proxy to.
  +* @returnA MBean proxy.
  +*
  +* @throws MalformedObjectNameExceptionInvalid object name.
  +*/
  +   public static Object create(final Class intf, final String name)
  +  throws MalformedObjectNameException
  +   {
  +  return Proxy.newProxyInstance(intf.getClassLoader(),
  +new Class[] { intf },
  +new MBeanProxy(new ObjectName(name)));
  +   }
  +
  +   /**
  +* Create an MBean proxy.
  +*
  +* @param intf  The interface which the proxy will implement.
  +* @param name  A string used to construct the ObjectName of the
  +*  MBean to proxy to.
  +* @param serverThe MBeanServer that contains the MBean to proxy to.
  +* @return  A MBean proxy.
  +*
  +* @throws MalformedObjectNameExceptionInvalid object name.
  +*/
  +   public static Object create(final Class intf,
  +   final String name,
  +   final MBeanServer server)
 throws MalformedObjectNameException
  {
  +  return Proxy.newProxyInstance
  + (intf.getClassLoader(),
  +  new Class[] { intf },
  +  new MBeanProxy(new ObjectName(name), server));
  +   }
  +   
  +   /**
  +* Create an MBean proxy.
  +*
  +* @param intfThe interface which the proxy will implement.
  +* @param nameThe name of the MBean to proxy invocations to.
  +* @returnA MBean proxy.
  +*/
  +   public static Object create(final Class intf, final ObjectName name)
  +   {
 return Proxy.newProxyInstance(intf.getClassLoader(),
  -  new Class[] { intf },
  -  new MBeanProxy(name));
  +new Class[] { intf },
  +new MBeanProxy(name));
  }
   
  -   public static Object create(Class intf, ObjectName name)
  +   /**
  +* Create an MBean proxy.
  +*
  +* @param intf  The interface which the proxy will implement.
  +* @param name  The name of the MBean to proxy invocations to.
  +* @param serverThe MBeanServer that contains the MBean to proxy to.
  +* @return  A