KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jfox > ejb > meta > EJBReferenceDescriptor


1 /* JFox, the OpenSource J2EE Application Server
2  *
3  * Distributable under GNU LGPL license by gun.org
4  * more details please visit http://www.huihoo.org/jfox
5  */

6 package org.jfox.ejb.meta;
7
8 import org.jfox.ioc.util.XMLUtils;
9 import org.w3c.dom.Node JavaDoc;
10
11 /**
12  * @author <a HREF="mailto:young_yy@hotmail.com">Young Yang</a>
13  */

14
15 public class EJBReferenceDescriptor extends EJBDescriptorBase {
16     private String JavaDoc type;
17     private String JavaDoc refName;
18
19     public EJBReferenceDescriptor() {
20
21     }
22
23     public void processXML(Node JavaDoc node) throws EJBDescriptionException {
24         super.processXML(node);
25         setRefName(XMLUtils.getChildNodeValueOf(node, "ejb-ref-name"));
26         setType(XMLUtils.getChildNodeValueOf(node, "ejb-ref-type"));
27         setHomeClassName(XMLUtils.getChildNodeValueOf(node, "home"));
28         setRemoteClassName(XMLUtils.getChildNodeValueOf(node, "remote"));
29         //ejb-link is the link ejb name, not the link ejb jndi name
30
setEjbName(XMLUtils.getChildNodeValueOf(node, "ejb-link"));
31     }
32
33     public String JavaDoc getType() {
34         return type;
35     }
36
37     public void setType(String JavaDoc type) {
38         this.type = type;
39     }
40
41     public String JavaDoc getRefName() {
42         return refName;
43     }
44
45     public void setRefName(String JavaDoc refName) {
46         this.refName = refName;
47     }
48
49     public void setLinkName(String JavaDoc linkedEjbName) {
50         setJndiName(linkedEjbName);
51     }
52
53     public String JavaDoc getLinkName() {
54         return getJndiName();
55     }
56
57     public boolean isResolved() {
58         return !getJndiName().equals("");
59     }
60
61     public boolean equals(Object JavaDoc obj) {
62         if(obj instanceof EJBReferenceDescriptor)
63             return refName.equals(((EJBReferenceDescriptor) obj).refName);
64         else
65             return false;
66     }
67
68     public int hashCode() {
69         return refName.hashCode();
70     }
71
72     public static void main(String JavaDoc[] args) {
73
74     }
75 }
76
77
Popular Tags