1 7 8 package javax.naming; 9 10 52 53 57 58 public class LinkRef extends Reference { 59 60 static final String linkClassName = LinkRef .class.getName(); 61 static final String linkAddrType = "LinkAddress"; 62 63 67 public LinkRef(Name linkName) { 68 super(linkClassName, new StringRefAddr (linkAddrType, linkName.toString())); 69 } 70 71 75 public LinkRef(String linkName) { 76 super(linkClassName, new StringRefAddr (linkAddrType, linkName)); 77 } 78 79 86 public String getLinkName() throws NamingException { 87 if (className != null && className.equals(linkClassName)) { 88 RefAddr addr = get(linkAddrType); 89 if (addr != null && addr instanceof StringRefAddr ) { 90 return (String )((StringRefAddr )addr).getContent(); 91 } 92 } 93 throw new MalformedLinkException (); 94 } 95 98 private static final long serialVersionUID = -5386290613498931298L; 99 } 100 | Popular Tags |