KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > jboss > axis > deployment > wsdd > WSDDGlobalConfiguration


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

55 package org.jboss.axis.deployment.wsdd;
56
57 import org.jboss.axis.ConfigurationException;
58 import org.jboss.axis.EngineConfiguration;
59 import org.jboss.axis.Handler;
60 import org.jboss.axis.encoding.SerializationContext;
61 import org.jboss.axis.utils.Messages;
62 import org.w3c.dom.Element JavaDoc;
63
64 import javax.xml.namespace.QName JavaDoc;
65 import java.io.IOException JavaDoc;
66
67
68 /**
69  * Represents the global configuration of the Axis engine.
70  *
71  * @author James Snell
72  */

73 public class WSDDGlobalConfiguration
74         extends WSDDDeployableItem
75 {
76    private WSDDRequestFlow requestFlow;
77    private WSDDResponseFlow responseFlow;
78
79    /**
80     * Default constructor
81     */

82    public WSDDGlobalConfiguration()
83    {
84    }
85
86    /**
87     * @param e (Element) XXX
88     * @throws WSDDException XXX
89     */

90    public WSDDGlobalConfiguration(Element JavaDoc e)
91            throws WSDDException
92    {
93       super(e);
94       Element JavaDoc reqEl = getChildElement(e, ELEM_WSDD_REQFLOW);
95       if (reqEl != null && reqEl.getElementsByTagName("*").getLength() > 0)
96       {
97          requestFlow = new WSDDRequestFlow(reqEl);
98       }
99       Element JavaDoc respEl = getChildElement(e, ELEM_WSDD_RESPFLOW);
100       if (respEl != null && respEl.getElementsByTagName("*").getLength() > 0)
101       {
102          responseFlow = new WSDDResponseFlow(respEl);
103       }
104    }
105
106    protected QName JavaDoc getElementName()
107    {
108       return WSDDConstants.QNAME_GLOBAL;
109    }
110
111    /**
112     * Get our request flow
113     */

114    public WSDDRequestFlow getRequestFlow()
115    {
116       return requestFlow;
117    }
118
119    /**
120     * Set our request flow
121     */

122    public void setRequestFlow(WSDDRequestFlow reqFlow)
123    {
124       requestFlow = reqFlow;
125    }
126
127    /**
128     * Get our response flow
129     */

130    public WSDDResponseFlow getResponseFlow()
131    {
132       return responseFlow;
133    }
134
135    /**
136     * Set the response flow
137     */

138    public void setResponseFlow(WSDDResponseFlow responseFlow)
139    {
140       this.responseFlow = responseFlow;
141    }
142
143    /**
144     * @return XXX
145     */

146    public WSDDFaultFlow[] getFaultFlows()
147    {
148       return null;
149    }
150
151    /**
152     * @param name XXX
153     * @return XXX
154     */

155    public WSDDFaultFlow getFaultFlow(QName JavaDoc name)
156    {
157
158       WSDDFaultFlow[] t = getFaultFlows();
159
160       for (int n = 0; n < t.length; n++)
161       {
162          if (t[n].getQName().equals(name))
163          {
164             return t[n];
165          }
166       }
167
168       return null;
169    }
170
171    /**
172     * @return XXX
173     */

174    public QName JavaDoc getType()
175    {
176       return null;
177    }
178
179    /**
180     * @param type XXX
181     */

182    public void setType(String JavaDoc type) throws WSDDException
183    {
184       throw new WSDDException(Messages.getMessage("noTypeOnGlobalConfig00"));
185    }
186
187    /**
188     * @param registry XXX
189     * @return XXX
190     */

191    public Handler makeNewInstance(EngineConfiguration registry)
192    {
193       return null;
194    }
195
196    /**
197     * Write this element out to a SerializationContext
198     */

199    public void writeToContext(SerializationContext context)
200            throws IOException JavaDoc
201    {
202       context.startElement(QNAME_GLOBAL, null);
203       writeParamsToContext(context);
204       if (requestFlow != null)
205          requestFlow.writeToContext(context);
206       if (responseFlow != null)
207          responseFlow.writeToContext(context);
208       context.endElement();
209    }
210
211    public void deployToRegistry(WSDDDeployment registry)
212            throws ConfigurationException
213    {
214       if (requestFlow != null)
215          requestFlow.deployToRegistry(registry);
216       if (responseFlow != null)
217          responseFlow.deployToRegistry(registry);
218    }
219 }
220
221
Popular Tags