diff --git a/bindings/java/src/net/hyperic/sigar/SigarInvoker.java b/bindings/java/src/net/hyperic/sigar/SigarInvoker.java index 7e3cde96..96506e5d 100644 --- a/bindings/java/src/net/hyperic/sigar/SigarInvoker.java +++ b/bindings/java/src/net/hyperic/sigar/SigarInvoker.java @@ -183,7 +183,7 @@ public class SigarInvoker { } public Object invoke(Object arg, String attr) - throws SigarException { + throws SigarException, SigarNotImplementedException { Object[] args = null; @@ -200,7 +200,7 @@ public class SigarInvoker { } public Object invoke(Object[] args, String attr) - throws SigarException { + throws SigarException, SigarNotImplementedException { Method typeGetter, attrGetter; Object typeObject, attrObject; @@ -219,6 +219,9 @@ public class SigarInvoker { String msg = "Failed to invoke " + typeGetter.getName() + parms + ": " + t.getMessage(); + if (t instanceof SigarNotImplementedException) { + throw (SigarNotImplementedException)t; + } throw new SigarException(msg); } diff --git a/bindings/java/src/net/hyperic/sigar/jmx/SigarInvokerJMX.java b/bindings/java/src/net/hyperic/sigar/jmx/SigarInvokerJMX.java index 63d8b20e..2c3ed3e4 100644 --- a/bindings/java/src/net/hyperic/sigar/jmx/SigarInvokerJMX.java +++ b/bindings/java/src/net/hyperic/sigar/jmx/SigarInvokerJMX.java @@ -5,6 +5,7 @@ import java.util.StringTokenizer; import net.hyperic.sigar.SigarException; import net.hyperic.sigar.SigarInvoker; +import net.hyperic.sigar.SigarNotImplementedException; import net.hyperic.sigar.SigarProxy; import net.hyperic.sigar.util.ReferenceMap; @@ -171,7 +172,7 @@ public class SigarInvokerJMX extends SigarInvoker { * @exception SigarException If invocation fails. */ public Object invoke(String attr) - throws SigarException { + throws SigarException, SigarNotImplementedException { return super.invoke(getArg(), attr); }