1 7 package org.ejtools.jndi.browser.model; 8 9 import javax.naming.Context ; 10 11 12 35 public class Proxy extends JNDIEntry 36 { 37 38 protected Object proxy = null; 39 40 41 48 public Proxy(Context context, String jndiName) 49 throws Exception 50 { 51 Object o = context.lookup(jndiName); 52 Class clazz = o.getClass(); 53 54 if (java.lang.reflect.Proxy.isProxyClass(clazz)) 55 { 56 proxy = o; 57 } 58 else 59 { 60 if (clazz.getName().startsWith("$Proxy")) 61 { 62 proxy = o; 63 } 64 } 65 66 if (proxy == null) 67 { 68 throw new Exception ("This object is not a proxy"); 69 } 70 71 this.setName(jndiName); 72 this.setClassName(clazz.getName()); 73 } 74 75 76 81 public Class [] getInterfaces() 82 { 83 return proxy.getClass().getInterfaces(); 84 } 85 } 86 | Popular Tags |