1
2
3
4
5
6
7
8
9 package bexee.wsdl.extensions.partnerlinktype;
10
11 import java.util.Set;
12
13 import javax.wsdl.Definition;
14 import javax.wsdl.WSDLException;
15 import javax.wsdl.extensions.ExtensibilityElement;
16 import javax.wsdl.extensions.ExtensionDeserializer;
17 import javax.wsdl.extensions.ExtensionRegistry;
18 import javax.wsdl.extensions.ExtensionSerializer;
19 import javax.wsdl.extensions.UnknownExtensionDeserializer;
20 import javax.wsdl.extensions.UnknownExtensionSerializer;
21 import javax.wsdl.factory.WSDLFactory;
22 import javax.xml.namespace.QName;
23
24 import bexee.wsdl.extensions.partnerlinktype.impl.PartnerLinkTypeImpl;
25
26 /***
27 * This is merely a helper class which pre-registers a deserializer and a
28 * serializer for the PartnerLinkType elements (BPEL extension to WSDL).
29 *
30 * @author Pawel Kowalski
31 * @version $Revision: 1.1 $, $Date: 2004/12/15 14:18:21 $
32 */
33 public class PartnerLinkTypeExtensionRegistry extends ExtensionRegistry {
34
35 private ExtensionRegistry registry;
36
37 private boolean delegateInitialized = false;
38
39 /***
40 * Create new <code>PartnerLinkTypeExtensionRegistry</code> instance.
41 *
42 * @throws WSDLException
43 */
44 public PartnerLinkTypeExtensionRegistry() throws WSDLException {
45
46 WSDLFactory factory = WSDLFactory.newInstance();
47 registry = factory.newPopulatedExtensionRegistry();
48
49 delegateInitialized = true;
50 setDefaultSerializer(new UnknownExtensionSerializer());
51 setDefaultDeserializer(new UnknownExtensionDeserializer());
52
53
54 PartnerLinkTypeDeserializer pLinkTypeSerDeser = new PartnerLinkTypeDeserializer();
55
56
57 registerDeserializer(Definition.class,
58 PartnerLinkTypeConstants.PLINK_TYPE_QNAME, pLinkTypeSerDeser);
59
60
61
62 registerSerializer(Definition.class,
63 PartnerLinkTypeConstants.PLINK_TYPE_QNAME, pLinkTypeSerDeser);
64
65
66
67 mapExtensionTypes(Definition.class,
68 PartnerLinkTypeConstants.PLINK_TYPE_QNAME,
69 PartnerLinkTypeImpl.class);
70
71 }
72
73
74
75
76
77
78
79 public ExtensibilityElement createExtension(Class arg0, QName arg1)
80 throws WSDLException {
81 return registry.createExtension(arg0, arg1);
82 }
83
84
85
86
87
88
89 public boolean equals(Object arg0) {
90 return registry.equals(arg0);
91 }
92
93
94
95
96
97
98 public Set getAllowableExtensions(Class arg0) {
99 return registry.getAllowableExtensions(arg0);
100 }
101
102
103
104
105
106
107 public ExtensionDeserializer getDefaultDeserializer() {
108 return registry.getDefaultDeserializer();
109 }
110
111
112
113
114
115
116 public ExtensionSerializer getDefaultSerializer() {
117 return registry.getDefaultSerializer();
118 }
119
120
121
122
123
124
125 public int hashCode() {
126 return registry.hashCode();
127 }
128
129
130
131
132
133
134
135 public void mapExtensionTypes(Class arg0, QName arg1, Class arg2) {
136 registry.mapExtensionTypes(arg0, arg1, arg2);
137 }
138
139
140
141
142
143
144
145 public ExtensionDeserializer queryDeserializer(Class arg0, QName arg1)
146 throws WSDLException {
147 return registry.queryDeserializer(arg0, arg1);
148 }
149
150
151
152
153
154
155
156 public ExtensionSerializer querySerializer(Class arg0, QName arg1)
157 throws WSDLException {
158 return registry.querySerializer(arg0, arg1);
159 }
160
161
162
163
164
165
166
167
168 public void registerDeserializer(Class arg0, QName arg1,
169 ExtensionDeserializer arg2) {
170 registry.registerDeserializer(arg0, arg1, arg2);
171 }
172
173
174
175
176
177
178
179
180 public void registerSerializer(Class arg0, QName arg1,
181 ExtensionSerializer arg2) {
182 registry.registerSerializer(arg0, arg1, arg2);
183 }
184
185
186
187
188
189
190 public void setDefaultDeserializer(ExtensionDeserializer extDeserializer) {
191
192
193
194
195
196 if (delegateInitialized) {
197 registry.setDefaultDeserializer(extDeserializer);
198 }
199 }
200
201
202
203
204
205
206 public void setDefaultSerializer(ExtensionSerializer extSerializer) {
207
208
209
210
211
212 if (delegateInitialized) {
213 registry.setDefaultSerializer(extSerializer);
214 }
215 }
216
217
218
219
220
221
222 public String toString() {
223 return registry.toString();
224 }
225 }