declare SigarNotImplementedException

This commit is contained in:
Doug MacEachern 2005-05-10 21:29:29 +00:00
parent 58318b381d
commit 2c7f23f793
2 changed files with 7 additions and 3 deletions

View File

@ -183,7 +183,7 @@ public class SigarInvoker {
} }
public Object invoke(Object arg, String attr) public Object invoke(Object arg, String attr)
throws SigarException { throws SigarException, SigarNotImplementedException {
Object[] args = null; Object[] args = null;
@ -200,7 +200,7 @@ public class SigarInvoker {
} }
public Object invoke(Object[] args, String attr) public Object invoke(Object[] args, String attr)
throws SigarException { throws SigarException, SigarNotImplementedException {
Method typeGetter, attrGetter; Method typeGetter, attrGetter;
Object typeObject, attrObject; Object typeObject, attrObject;
@ -219,6 +219,9 @@ public class SigarInvoker {
String msg = "Failed to invoke " + String msg = "Failed to invoke " +
typeGetter.getName() + parms + typeGetter.getName() + parms +
": " + t.getMessage(); ": " + t.getMessage();
if (t instanceof SigarNotImplementedException) {
throw (SigarNotImplementedException)t;
}
throw new SigarException(msg); throw new SigarException(msg);
} }

View File

@ -5,6 +5,7 @@ import java.util.StringTokenizer;
import net.hyperic.sigar.SigarException; import net.hyperic.sigar.SigarException;
import net.hyperic.sigar.SigarInvoker; import net.hyperic.sigar.SigarInvoker;
import net.hyperic.sigar.SigarNotImplementedException;
import net.hyperic.sigar.SigarProxy; import net.hyperic.sigar.SigarProxy;
import net.hyperic.sigar.util.ReferenceMap; import net.hyperic.sigar.util.ReferenceMap;
@ -171,7 +172,7 @@ public class SigarInvokerJMX extends SigarInvoker {
* @exception SigarException If invocation fails. * @exception SigarException If invocation fails.
*/ */
public Object invoke(String attr) public Object invoke(String attr)
throws SigarException { throws SigarException, SigarNotImplementedException {
return super.invoke(getArg(), attr); return super.invoke(getArg(), attr);
} }