From 2c7f23f793f7daa44db506baad05a9f2f22bbe6e Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Tue, 10 May 2005 21:29:29 +0000 Subject: [PATCH] declare SigarNotImplementedException --- bindings/java/src/net/hyperic/sigar/SigarInvoker.java | 7 +++++-- .../java/src/net/hyperic/sigar/jmx/SigarInvokerJMX.java | 3 ++- 2 files changed, 7 insertions(+), 3 deletions(-) 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); }