KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > tools > ant > types > optional > ContextType


1 package org.apache.tools.ant.types.optional;
2
3 /*
4  * ============================================================================
5  * The Apache Software License, Version 1.1
6  * ============================================================================
7  *
8  * Copyright (C) 2000-2002 The Apache Software Foundation. All
9  * rights reserved.
10  *
11  * Redistribution and use in source and binary forms, with or without modifica-
12  * tion, are permitted provided that the following conditions are met:
13  *
14  * 1. Redistributions of source code must retain the above copyright notice,
15  * this list of conditions and the following disclaimer.
16  *
17  * 2. Redistributions in binary form must reproduce the above copyright notice,
18  * this list of conditions and the following disclaimer in the documentation
19  * and/or other materials provided with the distribution.
20  *
21  * 3. The end-user documentation included with the redistribution, if any, must
22  * include the following acknowledgment: "This product includes software
23  * developed by the Apache Software Foundation (http://www.apache.org/)."
24  * Alternately, this acknowledgment may appear in the software itself, if
25  * and wherever such third-party acknowledgments normally appear.
26  *
27  * 4. The names "Ant" and "Apache Software Foundation" must not be used to
28  * endorse or promote products derived from this software without prior
29  * written permission. For written permission, please contact
30  * apache@apache.org.
31  *
32  * 5. Products derived from this software may not be called "Apache", nor may
33  * "Apache" appear in their name, without prior written permission of the
34  * Apache Software Foundation.
35  *
36  * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,
37  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
38  * FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
39  * APACHE SOFTWARE FOUNDATION OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
40  * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLU-
41  * DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
42  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
43  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
44  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
45  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
46  *
47  * This software consists of voluntary contributions made by many individuals
48  * on behalf of the Apache Software Foundation. For more information on the
49  * Apache Software Foundation, please see <http://www.apache.org/>.
50  *
51  */

52
53 /**
54  * This is an Ant type that represents a JNDI context, and optionally can
55  * carry the name of a specific entry within a JNDI tree.
56  *
57  * @author <a HREF="mailto:b_dueck@hotmail.com">Brian Dueck</a>
58  * @version $Version$
59  *
60  */

61 public class ContextType extends org.apache.tools.ant.types.DataType implements Cloneable JavaDoc {
62     
63     public static final String JavaDoc DATA_TYPE_NAME = "context";
64     
65     private String JavaDoc serverType = null;
66     private String JavaDoc providerUrl = null;
67     private String JavaDoc user = null;
68     private String JavaDoc password = null;
69     private String JavaDoc jndiName = null;
70     
71     public ContextType() {
72     }
73     
74     /** Getter for property serverType.
75      * @return Value of property serverType.
76      *
77      */

78     public java.lang.String JavaDoc getServerType() {
79         return serverType;
80     }
81     
82     /**
83      * The type of server involved. Supported values are
84      * <code>weblogic</code> or <code>jboss</code>. The setting of this value
85      * determines the default value for the <code><a HREF="#jndiName">jndiName</a></code> and
86      * <code><a HREF="#providerUrl">providerUrl</a></code> attributes.
87      * </br></br>
88      * <strong>NOTE:</strong>If this value is other than <code>weblogic</code> or
89      * <code>jboss</code>, then it is assumed to be a fully qualified class name
90      * that implements
91      * <code>org.apache.tools.ant.taskdefs.optional.jmx.connector.JMXConnector</code>.
92      * This is used to support additional types of servers without modifying
93      * the Ant task classes.
94      *
95      * @see org.apache.tools.ant.taskdefs.optional.jmx.connector.JMXConnector
96      */

97     public void setServerType(java.lang.String JavaDoc serverType) {
98         this.serverType = serverType;
99     }
100     
101     /** Getter for property providerUrl.
102      * @return Value of property providerUrl.
103      *
104      */

105     public java.lang.String JavaDoc getProviderUrl() {
106         return providerUrl;
107     }
108     
109     /**
110      * Sets the <code>providerUrl</code> attribute for the JNDI provider.
111      *
112      * If serverType is set to <code>weblogic</code>, the default value is <code>t3://localhost:7001</code>.
113      * If serverType is set to <code>jboss</code>, the default value is <code>jnp://localhost:1099</code>.
114      *
115      * e.g. The default value for BEA WebLogic Server is
116      * <code>t3://localhost:7001</code>.
117      *
118      * @param providerUrl The providerUrl of the JNDI provder.
119      *
120      */

121     public void setProviderUrl(java.lang.String JavaDoc providerUrl) {
122         this.providerUrl = providerUrl;
123     }
124     
125     /** Getter for property user.
126      * @return Value of property user.
127      *
128      */

129     public java.lang.String JavaDoc getUser() {
130         return user;
131     }
132     
133     /**
134      * Sets the <code>user</code> attribute to use for authentication with the JMX server.
135      *
136      * @param user The user-id to use for authentication with the JMX server.
137      */

138     public void setUser(java.lang.String JavaDoc user) {
139         this.user = user;
140     }
141     
142     /** Getter for property password.
143      * @return Value of property password.
144      *
145      */

146     public java.lang.String JavaDoc getPassword() {
147         return password;
148     }
149     
150     /**
151      * Sets the <code>password</code> attribute to use for authentication with the JMX server.
152      *
153      * @param password The password to use
154      */

155     public void setPassword(java.lang.String JavaDoc password) {
156         this.password = password;
157     }
158     
159     
160     /** Getter for property jndiName.
161      * @return Value of property jndiName.
162      *
163      */

164     public java.lang.String JavaDoc getJndiName() {
165         return jndiName;
166     }
167     
168     /**
169      * Sets the <code>jndiName</code> attribute for the JNDI object.
170      *
171      * @param jndiName The jndi name of the JNDI object.
172      * e.g. The default value for BEA JMX Admin home is
173      * <code>weblogic.management.adminhome</code>.
174      */

175     public void setJndiName(java.lang.String JavaDoc jndiName) {
176         this.jndiName = jndiName;
177     }
178     
179 }
180
Popular Tags