KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > ejtools > jndi > browser > model > JNDILinkRef


1 /*
2  * EJTools, the Enterprise Java Tools
3  *
4  * Distributable under LGPL license.
5  * See terms of license at www.gnu.org.
6  */

7 package org.ejtools.jndi.browser.model;
8
9 import javax.naming.Context JavaDoc;
10 import javax.naming.LinkRef JavaDoc;
11
12
13 /**
14  * Describe a simple JNDI Link Reference.
15  *
16  * @author letiemble
17  * @created 13 décembre 2001
18  * @version $Revision: 1.2 $
19  * @todo Javadoc to complete
20  * @javabean:class displayName="JNDI LinkRef"
21  * shortDescription="JNDI Link Reference"
22  * @javabean:icons color16="/toolbarButtonGraphics/general/File16.gif"
23  * @javabean:property name="name"
24  * class="java.lang.String"
25  * displayName="Name"
26  * shortDescription="Name of the entry"
27  * @javabean:property name="className"
28  * class="java.lang.String"
29  * displayName="Class"
30  * shortDescription="Class of the entry"
31  * @javabean:property name="linkName"
32  * class="java.lang.String"
33  * displayName="Link Reference"
34  * shortDescription="Link Reference"
35  */

36 public class JNDILinkRef extends JNDIEntry
37 {
38    /** Class name of the context */
39    protected String JavaDoc linkName = "";
40    /** Description of the Field */
41    protected LinkRef JavaDoc ref;
42
43
44    /**
45     * Constructor for the JNDILinkRef object
46     *
47     * @param context Description of the Parameter
48     * @param jndiName Description of the Parameter
49     * @exception Exception Description of the Exception
50     */

51    public JNDILinkRef(Context JavaDoc context, String JavaDoc jndiName)
52       throws Exception JavaDoc
53    {
54       this.setName(jndiName);
55
56       Object JavaDoc o = context.lookupLink(jndiName);
57       this.setClassName(o.getClass().getName());
58
59       ref = (LinkRef JavaDoc) o;
60       this.setLinkName(ref.getLinkName());
61    }
62
63
64    /**
65     * Gets the linkName attribute of the JNDILinkRef object
66     *
67     * @return The linkName value
68     */

69    public String JavaDoc getLinkName()
70    {
71       return this.linkName;
72    }
73
74
75    /**
76     * Sets the linkName attribute of the JNDILinkRef object
77     *
78     * @param linkName The new linkName value
79     */

80    protected void setLinkName(String JavaDoc linkName)
81    {
82       this.linkName = linkName;
83    }
84 }
85
Popular Tags