1 16 17 package org.apache.axis.utils.cache; 18 19 import java.lang.reflect.Method ; 20 import java.util.Hashtable ; 21 import java.io.Serializable ; 22 23 28 public class JavaClass implements Serializable { 29 30 private static Hashtable classes = new Hashtable (); 31 private Hashtable methods = new Hashtable (); 32 33 private Class jc; 34 35 39 public static synchronized JavaClass find(Class jc) { 40 JavaClass result = (JavaClass) classes.get(jc); 41 42 if (result == null) { 43 result = new JavaClass(jc); 44 classes.put(jc, result); 45 } 46 47 return result; 48 } 49 50 53 public JavaClass(Class jc) { 54 this.jc = jc; 55 classes.put(jc, this); 56 } 57 58 61 public Class getJavaClass() { 62 return jc; 63 } 64 65 70 public Method [] getMethod(String name) { 71 JavaMethod jm = (JavaMethod) methods.get(name); 72 73 if (jm == null) { 74 methods.put(name, jm=new JavaMethod(jc, name)); 75 } 76 77 return jm.getMethod(); 78 } 79 }; 80 | Popular Tags |