1 21 22 package org.apache.derby.impl.services.reflect; 23 24 import org.apache.derby.iapi.services.loader.GeneratedMethod; 25 26 import org.apache.derby.iapi.error.StandardException; 27 28 import java.lang.reflect.Method ; 29 import java.lang.reflect.InvocationTargetException ; 30 31 class ReflectMethod implements GeneratedMethod { 32 33 private final Method realMethod; 34 35 ReflectMethod(Method m) { 36 super(); 37 realMethod = m; 38 } 39 40 public Object invoke(Object ref) 41 throws StandardException { 42 43 Throwable t; 44 45 try { 46 return realMethod.invoke(ref, null); 47 48 } catch (IllegalAccessException iae) { 49 50 t = iae; 51 52 } catch (IllegalArgumentException iae2) { 53 54 t = iae2; 55 56 } catch (InvocationTargetException ite) { 57 58 t = ite.getTargetException(); 59 if (t instanceof StandardException) 60 throw (StandardException) t; 61 } 62 63 throw StandardException.unexpectedUserException(t); 64 } 65 66 67 } 68 | Popular Tags |