KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > bull > eclipse > jonas > utils > xml > ResourceEnvRefDesc


1 /*
2  * JOnAS: Java(TM) Open Application Server
3  * Copyright (C) 1999 Bull S.A.
4  * Contact: jonas-team@objectweb.org
5  *
6  * This library is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU Lesser General Public
8  * License as published by the Free Software Foundation; either
9  * version 2.1 of the License, or 1any later version.
10  *
11  * This library is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14  * Lesser General Public License for more details.
15  *
16  * You should have received a copy of the GNU Lesser General Public
17  * License along with this library; if not, write to the Free Software
18  * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
19  * USA
20  *
21  * Initial developer: Christophe Ney
22  * --------------------------------------------------------------------------
23  * $Id: ResourceEnvRefDesc.java,v 1.1 2003/10/27 14:46:32 benoitf Exp $
24  * --------------------------------------------------------------------------
25  */

26
27 package com.bull.eclipse.jonas.utils.xml;
28
29
30 /**
31  * This class represents the description of a ResourceEnvRef object
32  * @author Christophe Ney
33  * @author Florent Benoit
34  */

35 public class ResourceEnvRefDesc {
36
37     /**
38      * The resource env ref name.
39      */

40     private String JavaDoc name;
41
42     /**
43      * The resource env ref type.
44      */

45     private Class JavaDoc type;
46
47     /**
48      * The resource env ref jndi name.
49      */

50     private String JavaDoc jndiName;
51
52     /**
53      * Construct a descriptor for the resource-env-ref and jonas-resource-env
54      * tags.
55      * @param classLoader the classloader for the classes.
56      * @param res the resource-env-ref resulting of the web.xml parsing.
57      * @param jRes the jonas-resource-env resulting of the jonas-web.xml
58      * parsing.
59      * @throws DeploymentDescException when missing information for
60      * creating the ResourceEnvRefDesc.
61      */

62 // public ResourceEnvRefDesc(ClassLoader classLoader, ResourceEnvRef res,
63
// JonasResourceEnv jRes) throws DeploymentDescException {
64
//
65
// name = res.getResourceEnvRefName();
66
// try {
67
// type = classLoader.loadClass(res.getResourceEnvRefType());
68
// } catch (ClassNotFoundException e) {
69
// throw new DeploymentDescException("resource-env-ref-type class not found for resource-env-ref " + name, e);
70
// }
71
// jndiName = jRes.getJndiName();
72
// }
73

74     /**
75      * Get resource environment ref. name.
76      * @return Name of the resource environment ref.
77      */

78     public String JavaDoc getName() {
79         return name;
80     }
81
82     /**
83      * Get resource environment ref. type.
84      * @return Class of the resource environment ref.
85      */

86     public Class JavaDoc getType() {
87         return type;
88     }
89
90     /**
91      * Get the jndi name of the resource environment ref.
92      * @return String representation of the JNDI name.
93      */

94     public String JavaDoc getJndiName() {
95         return jndiName;
96     }
97     
98     /**
99      * String representation of the object for test purpose.
100      * @return String representation of this object.
101      */

102     public String JavaDoc toString() {
103         StringBuffer JavaDoc ret = new StringBuffer JavaDoc();
104         ret.append("\ngetName()=" + getName());
105         ret.append("\ngetType()=" + getType());
106         ret.append("\ngetJndiName()=" + getJndiName());
107         return ret.toString();
108     }
109     
110 }
111
Popular Tags