34
34
* as constructor argument, or set using a property.
35
35
*
36
36
* @author Arjen Poutsma
37
+ * @author Greg Turnquist
37
38
* @see #Wsdl4jDefinition(javax.wsdl.Definition)
38
39
* @see #setDefinition(javax.wsdl.Definition)
39
40
* @since 1.0.0
@@ -42,9 +43,6 @@ public class Wsdl4jDefinition implements Wsdl11Definition {
42
43
43
44
private Definition definition ;
44
45
45
- /** Cached DOM version of the definition */
46
- private Document document ;
47
-
48
46
/** WSDL4J is not thread safe, hence the need for a monitor. */
49
47
private final Object monitor = new Object ();
50
48
@@ -76,26 +74,23 @@ public Definition getDefinition() {
76
74
public void setDefinition (Definition definition ) {
77
75
synchronized (monitor ) {
78
76
this .definition = definition ;
79
- this .document = null ;
80
77
}
81
78
}
82
79
83
80
@ Override
84
81
public Source getSource () {
85
82
synchronized (monitor ) {
86
83
Assert .notNull (definition , "definition must not be null" );
87
- if (document == null ) {
88
- try {
89
- WSDLFactory wsdlFactory = WSDLFactory .newInstance ();
90
- WSDLWriter wsdlWriter = wsdlFactory .newWSDLWriter ();
91
- document = wsdlWriter .getDocument (definition );
92
- }
93
- catch (WSDLException ex ) {
94
- throw new WsdlDefinitionException (ex .getMessage (), ex );
95
- }
84
+ try {
85
+ WSDLFactory wsdlFactory = WSDLFactory .newInstance ();
86
+ WSDLWriter wsdlWriter = wsdlFactory .newWSDLWriter ();
87
+ Document document = wsdlWriter .getDocument (definition );
88
+ return new DOMSource (document );
89
+ }
90
+ catch (WSDLException ex ) {
91
+ throw new WsdlDefinitionException (ex .getMessage (), ex );
96
92
}
97
93
}
98
- return new DOMSource (document );
99
94
}
100
95
101
96
public String toString () {
0 commit comments