KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > apache > axis2 > description > ModuleDescription


1 /*
2 * Copyright 2004,2005 The Apache Software Foundation.
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */

16 package org.apache.axis2.description;
17
18 import org.apache.axis2.modules.Module;
19
20 import javax.xml.namespace.QName JavaDoc;
21 import java.util.HashMap JavaDoc;
22
23 /**
24  * <p>This holds the information about a Module. </p>
25  * <ol>
26  * <li>parameters<li>
27  * <li>handlers<li>
28  * <ol>
29  * <p>Handler are registered once they are avlible but they avalibe to all services if axis2.xml
30  * has a module ref="." or avalible to a single service if service.xml have module ref=".."</p>
31  */

32 public class ModuleDescription implements FlowInclude, ParameterInclude {
33
34     private Module module;
35     /**
36      * Field name
37      */

38     private QName JavaDoc name;
39
40     /**
41      * Field flowInclude
42      */

43     private final FlowInclude flowInclude = new FlowIncludeImpl();
44
45     //to store module opeartions , which are suppose to be added to a service if it is engaged to a service
46
private HashMap JavaDoc opeartions ;
47
48     /**
49      * Field parameters
50      */

51     private final ParameterInclude parameters = new ParameterIncludeImpl();
52
53     /**
54      * Constructor ModuleDescription
55      */

56     public ModuleDescription() {
57         opeartions = new HashMap JavaDoc();
58     }
59
60     /**
61      * Constructor ModuleDescription
62      *
63      * @param name
64      */

65     public ModuleDescription(QName JavaDoc name) {
66         this();
67         this.name = name;
68     }
69
70     /**
71      * @return
72      */

73     public Flow getFaultInFlow() {
74         return flowInclude.getFaultInFlow();
75     }
76
77     public Flow getFaultOutFlow() {
78         return flowInclude.getFaultOutFlow();
79     }
80
81     /**
82      * @return
83      */

84     public Flow getInFlow() {
85         return flowInclude.getInFlow();
86     }
87
88     /**
89      * @return
90      */

91     public Flow getOutFlow() {
92         return flowInclude.getOutFlow();
93     }
94
95     /**
96      * @param faultFlow
97      */

98     public void setFaultInFlow(Flow faultFlow) {
99         flowInclude.setFaultInFlow(faultFlow);
100     }
101
102     /**
103      * @param faultFlow
104      */

105     public void setFaultOutFlow(Flow faultFlow) {
106         flowInclude.setFaultOutFlow(faultFlow);
107     }
108
109     /**
110      * @param inFlow
111      */

112     public void setInFlow(Flow inFlow) {
113         flowInclude.setInFlow(inFlow);
114     }
115
116     /**
117      * @param outFlow
118      */

119     public void setOutFlow(Flow outFlow) {
120         flowInclude.setOutFlow(outFlow);
121     }
122
123     /**
124      * @param param
125      */

126     public void addParameter(Parameter param) {
127         parameters.addParameter(param);
128     }
129
130     /**
131      * @param name
132      * @return
133      */

134     public Parameter getParameter(String JavaDoc name) {
135         return parameters.getParameter(name);
136     }
137
138     /**
139      * @return
140      */

141     public QName JavaDoc getName() {
142         return name;
143     }
144
145     /**
146      * @param name
147      */

148     public void setName(QName JavaDoc name) {
149         this.name = name;
150     }
151     /**
152      * @return
153      */

154     public Module getModule() {
155         return module;
156     }
157
158     /**
159      * @param module
160      */

161     public void setModule(Module module) {
162         this.module = module;
163     }
164
165     public void addOperation(OperationDescription operation){
166         opeartions.put(operation.getName(),operation);
167     }
168     
169     public HashMap JavaDoc getOperations(){
170         return opeartions;
171     }
172
173 }
174
Popular Tags