KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > com > sun > enterprise > deployment > node > runtime > MailConfigurationNode


1 /*
2  * The contents of this file are subject to the terms
3  * of the Common Development and Distribution License
4  * (the License). You may not use this file except in
5  * compliance with the License.
6  *
7  * You can obtain a copy of the license at
8  * https://glassfish.dev.java.net/public/CDDLv1.0.html or
9  * glassfish/bootstrap/legal/CDDLv1.0.txt.
10  * See the License for the specific language governing
11  * permissions and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL
14  * Header Notice in each file and include the License file
15  * at glassfish/bootstrap/legal/CDDLv1.0.txt.
16  * If applicable, add the following below the CDDL Header,
17  * with the fields enclosed by brackets [] replaced by
18  * you own identifying information:
19  * "Portions Copyrighted [year] [name of copyright owner]"
20  *
21  * Copyright 2006 Sun Microsystems, Inc. All rights reserved.
22  */

23
24 package com.sun.enterprise.deployment.node.runtime;
25
26 import com.sun.enterprise.deployment.node.XMLElement;
27 import com.sun.enterprise.deployment.ResourceReferenceDescriptor;
28 import com.sun.enterprise.deployment.node.DeploymentDescriptorNode;
29 import com.sun.enterprise.deployment.xml.RuntimeTagNames;
30
31 import com.sun.enterprise.deployment.MailConfiguration;
32
33 /**
34  * This node handles the runtime deployment descriptor tag
35  * default-resource-principal
36  *
37  * @author Jerome Dochez
38  * @version
39  */

40 public class MailConfigurationNode extends DeploymentDescriptorNode {
41
42     private String JavaDoc name = null;
43     private String JavaDoc mail_from = null;
44     private String JavaDoc mail_host = null;
45     
46     /**
47      * receives notification of the value for a particular tag
48      *
49      * @param element the xml element
50      * @param value it's associated value
51      */

52     public void setElementValue(XMLElement element, String JavaDoc value) {
53         if (RuntimeTagNames.NAME.equals(element.getQName())) {
54             name = value;
55         } else if (RuntimeTagNames.MAIL_FROM.equals(element.getQName())) {
56             mail_from = value;
57         } else if (RuntimeTagNames.MAIL_HOST.equals(element.getQName())) {
58             mail_host = value;
59         }
60     }
61         
62     /**
63      * notification of the end of XML parsing for this node
64      */

65     public void postParsing() {
66         getParentNode().addDescriptor(new MailConfiguration(name, mail_from, mail_host));
67     }
68 }
Popular Tags