From f6e85761d2378f1108d60ba09824a0bc033e07e6 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 29 Apr 2009 14:55:47 -0700 Subject: [PATCH] SigarProxy must implement InvocationHandler --- .../java/src/org/hyperic/sigar/jmx/SigarInvokerJMX.java | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bindings/java/src/org/hyperic/sigar/jmx/SigarInvokerJMX.java b/bindings/java/src/org/hyperic/sigar/jmx/SigarInvokerJMX.java index 22675964..5b426151 100644 --- a/bindings/java/src/org/hyperic/sigar/jmx/SigarInvokerJMX.java +++ b/bindings/java/src/org/hyperic/sigar/jmx/SigarInvokerJMX.java @@ -18,13 +18,16 @@ package org.hyperic.sigar.jmx; +import java.lang.reflect.InvocationHandler; import java.util.Map; import java.util.StringTokenizer; +import org.hyperic.sigar.Sigar; import org.hyperic.sigar.SigarException; import org.hyperic.sigar.SigarInvoker; import org.hyperic.sigar.SigarNotImplementedException; import org.hyperic.sigar.SigarProxy; +import org.hyperic.sigar.SigarProxyCache; import org.hyperic.sigar.util.ReferenceMap; /** @@ -61,6 +64,10 @@ public class SigarInvokerJMX extends SigarInvoker { SigarInvokerJMX invoker; + if (!(proxy instanceof InvocationHandler) && (proxy instanceof Sigar)) { + proxy = SigarProxyCache.newInstance((Sigar)proxy); + } + int ix = name.indexOf(":"); if (ix > 0) { //skip domain name