1
2
3
4
5
6
7
8 package it.imolinfo.jbi4ejb.jbi.wsdl;
9
10 import it.imolinfo.jbi4ejb.Logger;
11 import it.imolinfo.jbi4ejb.LoggerFactory;
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.xml.namespace.QName;
19
20 import org.w3c.dom.Element;
21
22 import com.ibm.wsdl.util.xml.DOMUtils;
23 import com.ibm.wsdl.util.xml.QNameUtils;
24
25
26
27
28
29
30
31 public class Jbi4EjbTypesDeserializer implements ExtensionDeserializer {
32
33
34
35
36 private static final Logger LOG
37 = LoggerFactory.getLogger(Jbi4EjbTypesDeserializer.class);
38
39
40
41
42 public Jbi4EjbTypesDeserializer() {}
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63 public ExtensibilityElement unmarshall(Class parentType, QName elementType,
64 Element el, Definition def, ExtensionRegistry extReg)
65 throws WSDLException {
66
67 Jbi4EjbTypes jbi4EjbTypes = (Jbi4EjbTypes) extReg
68 .createExtension(parentType, elementType);
69
70 Element element = DOMUtils.getFirstChildElement(el);
71 while (element != null) {
72
73
74 if (QNameUtils.matches(Jbi4EjbExtension.Q_ELEM_JBI4EJB_SERIAL_VERSION_UID,
75 element)) {
76 String className = DOMUtils.getAttribute(
77 element, Jbi4EjbExtension.CLASSNAME_ATTRIBUTE);
78 String uid = DOMUtils.getAttribute(element,
79 Jbi4EjbExtension.UID_ATTRIBUTE);
80 LOG.debug("Found uid for className " + className +": " + uid);
81
82 jbi4EjbTypes.getTypesSerialVersionUIDs().put(className, uid);
83 }
84 element = DOMUtils
85 .getNextSiblingElement(element);
86
87 }
88
89 return jbi4EjbTypes;
90 }
91 }