1 23 24 29 30 31 package com.sun.cli.jmx.support; 32 33 import java.io.Serializable ; 34 35 36 import javax.management.ObjectName ; 37 38 39 public final class InvokeResult implements Serializable  40 { 41 public final ObjectName mObjectName; 42 public Object mResult; 43 public Throwable mThrowable; 44 45 public static final class ResultType 46 { 47 final int mResultType; 48 private 49 ResultType( int value ) 50 { 51 mResultType = value; 52 } 53 } 54 55 public final static ResultType SUCCESS = new ResultType( 0 ); 56 public final static ResultType FAILURE = new ResultType( 1 ); 57 public final static ResultType NOT_FOUND = new ResultType( 2 ); 58 59 public 60 InvokeResult( ObjectName name, Object result, Throwable t ) 61 { 62 mObjectName = name; 63 mResult = result; 64 mThrowable = t; 65 } 66 67 public ResultType 68 getResultType() 69 { 70 ResultType result = NOT_FOUND; 71 72 if ( mThrowable == null ) 73 { 74 result = SUCCESS; 75 } 76 else 77 { 78 if ( mThrowable instanceof java.lang.NoSuchMethodException ) 79 { 80 result = NOT_FOUND; 81 } 82 else 83 { 84 result = FAILURE; 85 } 86 } 87 88 return( result ); 89 } 90 } | Popular Tags |