1 22 23 package org.jboss.aop.util.reference; 24 25 import java.lang.reflect.Method ; 26 27 32 public class MethodPersistentReference extends ArgumentPersistentReference 33 { 34 public MethodPersistentReference (Method method, int referenceType) 35 { 36 super(method!=null?method.getDeclaringClass():null,method,referenceType); 37 if (method!=null) 38 { 39 this.name=method.getName(); 40 setArguments(method.getParameterTypes()); 41 } 42 } 43 String name; 44 45 46 public synchronized Object rebuildReference() throws Exception 47 { 48 Object returnValue=null; 50 if ((returnValue=internalGet())!=null) return returnValue; 51 52 Method aMethod = getMappedClass().getDeclaredMethod(name,getArguments()); 53 aMethod.setAccessible(true); 54 buildReference(aMethod); 55 return aMethod; 56 } 57 58 public Method getMethod() 59 { 60 return (Method ) get(); 61 } 62 63 } 64 65 | Popular Tags |