KickJava   Java API By Example, From Geeks To Geeks.

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


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 java.util.Iterator JavaDoc;
27 import org.w3c.dom.Node JavaDoc;
28
29 import com.sun.enterprise.deployment.Descriptor;
30 import com.sun.enterprise.deployment.BundleDescriptor;
31 import com.sun.enterprise.deployment.MessageDestinationDescriptor;
32 import com.sun.enterprise.deployment.node.XMLElement;
33 import com.sun.enterprise.deployment.node.DeploymentDescriptorNode;
34 import com.sun.enterprise.deployment.node.RootXMLNode;
35 import com.sun.enterprise.deployment.xml.RuntimeTagNames;
36
37 public abstract class RuntimeBundleNode extends DeploymentDescriptorNode implements RootXMLNode {
38
39     protected Descriptor descriptor=null;
40     
41     public RuntimeBundleNode(Descriptor descriptor) {
42         this.descriptor = descriptor;
43     Init();
44     }
45
46     public RuntimeBundleNode() {
47         this(null);
48     }
49     
50     /**
51      * Initializes the child handler;
52      */

53     protected void Init() {
54     // we do not care about standard DDs common tags
55
handlers=null;
56     }
57     
58     /**
59      * Adds a new DOL descriptor instance to the descriptor instance associated with
60      * this XMLNode
61      *
62      * @param descriptor the new descriptor
63      */

64     public void addDescriptor(Object JavaDoc descriptor) {
65         return;
66     }
67     
68    /**
69     * @return the descriptor instance to associate with this XMLNode
70     */

71     public Object JavaDoc getDescriptor() {
72         return descriptor;
73     }
74     
75     /**
76      * @return the default spec version level this node complies to
77      */

78     public String JavaDoc getSpecVersion() {
79         return "1.4";
80     }
81     
82     /**
83      * set the DOCTYPE as read in the input XML File
84      * @param DOCTYPE
85      */

86     public void setDocType(String JavaDoc docType) {
87         // I do not care about the version of the runtime descriptors
88
}
89     
90     /**
91      * Sets the specVersion for this descriptor depending on the docType
92      */

93     protected void setSpecVersion() {
94         // I do not care about the version of the runtime descriptors
95
}
96
97     /**
98      * writes the message destination references runtime information
99      */

100     protected void writeMessageDestinationInfo(Node JavaDoc parent,
101                                                BundleDescriptor descriptor) {
102         for(Iterator JavaDoc iter = descriptor.getMessageDestinations().iterator();
103             iter.hasNext();) {
104             MessageDestinationRuntimeNode node =
105                 new MessageDestinationRuntimeNode();
106             node.writeDescriptor(parent, RuntimeTagNames.MESSAGE_DESTINATION,
107                                  (MessageDestinationDescriptor) iter.next());
108         }
109     }
110     
111     /**
112      * @return true if the runtime bundle node should only process
113      * the product FCS DTD declarations
114      */

115     protected static final boolean restrictDTDDeclarations() {
116         if (restrictDTDDeclarations==null) {
117             restrictDTDDeclarations = new Boolean JavaDoc(Boolean.getBoolean(
118                 "com.sun.aas.deployment.restrictdtddeclarations"));
119         }
120         return restrictDTDDeclarations.booleanValue();
121     }
122     
123     private static Boolean JavaDoc restrictDTDDeclarations=null;
124 }
125
Popular Tags