1 17 18 package org.apache.geronimo.interceptor; 19 20 import java.io.Serializable ; 21 22 import org.apache.geronimo.interceptor.InvocationResult; 23 24 30 public class SimpleInvocationResult implements InvocationResult, Serializable { 31 private final Object result; 32 private final boolean normal; 33 34 39 public SimpleInvocationResult(boolean normal, Object result) { 40 assert (normal || result instanceof Throwable ) : "Result must be normal or a Throwable"; 41 this.normal = normal; 42 this.result = result; 43 } 44 45 public boolean isNormal() { 46 return normal; 47 } 48 49 public boolean isException() { 50 return !normal; 51 } 52 53 public Object getResult() { 54 assert (normal == true); 55 return result; 56 } 57 58 public Exception getException() { 59 assert (normal == false); 60 return (Exception ) result; 61 } 62 } 63 | Popular Tags |