1 7 package org.ejtools.jndi.browser.model; 8 9 import javax.naming.Context ; 10 11 12 34 public class JNDIEnvEntry extends JNDIContext 35 { 36 37 protected Object value = null; 38 39 40 47 public JNDIEnvEntry(Context context, String jndiName) 48 throws Exception  49 { 50 Object o = context.lookup(jndiName); 51 52 Class clazz = o.getClass(); 53 if (clazz.getName().startsWith("java.lang.")) 54 { 55 this.value = o; 56 } 57 if (clazz.equals(java.net.URL .class)) 58 { 59 this.value = o; 60 } 61 if (this.value == null) 62 { 63 throw new Exception ("This object is not a valid environment entry"); 64 } 65 this.setName(jndiName); 66 this.setClassName(clazz.getName()); 67 } 68 69 70 75 public String getValue() 76 { 77 return this.value.toString(); 78 } 79 } 80 | Popular Tags |