antelder 2002/09/27 05:53:23
Modified: java/src/org/apache/wsif/util WSIFUtils.java
Log:
Change the readWSDL methods to not fiddle with the wsdl factory system property but
to use the WSDLFactory newinstance method which takes a factory name.
Revision Changes Path
1.17 +14 -118 xml-axis-wsif/java/src/org/apache/wsif/util/WSIFUtils.java
Index: WSIFUtils.java
===================================================================
RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/util/WSIFUtils.java,v
retrieving revision 1.16
retrieving revision 1.17
diff -u -r1.16 -r1.17
--- WSIFUtils.java 20 Sep 2002 15:11:16 -0000 1.16
+++ WSIFUtils.java 27 Sep 2002 12:53:23 -0000 1.17
@@ -437,27 +437,12 @@
initializeProviders();
- Properties props = System.getProperties();
- String oldPropValue =
- props.getProperty(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
-
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- WSIFConstants.WSIF_WSDLFACTORY);
-
- WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLFactory factory = WSDLFactory.newInstance(
+ WSIFConstants.WSIF_WSDLFACTORY );
WSDLReader wsdlReader = factory.newWSDLReader();
wsdlReader.setFeature(Constants.FEATURE_VERBOSE, false);
try {
Definition def = wsdlReader.readWSDL(contextURL, wsdlLoc);
-
- if (oldPropValue != null) {
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- oldPropValue);
- } else {
- props.remove(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
- }
Trc.exitExpandWsdl(def);
return def;
} catch (WSDLException e) {
@@ -497,29 +482,14 @@
initializeProviders();
- Properties props = System.getProperties();
- String oldPropValue =
- props.getProperty(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
-
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- WSIFConstants.WSIF_WSDLFACTORY);
-
- WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLFactory factory = WSDLFactory.newInstance(
+ WSIFConstants.WSIF_WSDLFACTORY );
WSDLReader wsdlReader = factory.newWSDLReader();
wsdlReader.setFeature(Constants.FEATURE_VERBOSE, false);
try {
WSIFWSDLLocatorImpl lo =
new WSIFWSDLLocatorImpl(documentBase, reader, cl);
Definition def = wsdlReader.readWSDL(lo);
-
- if (oldPropValue != null) {
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- oldPropValue);
- } else {
- props.remove(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
- }
Trc.exitExpandWsdl(def);
return def;
} catch (WSDLException e) {
@@ -544,15 +514,8 @@
initializeProviders();
- Properties props = System.getProperties();
- String oldPropValue =
- props.getProperty(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
-
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- WSIFConstants.WSIF_WSDLFACTORY);
-
- WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLFactory factory = WSDLFactory.newInstance(
+ WSIFConstants.WSIF_WSDLFACTORY );
WSDLReader wsdlReader = factory.newWSDLReader();
wsdlReader.setFeature(Constants.FEATURE_VERBOSE, false);
@@ -560,14 +523,6 @@
String url = (contextURL == null) ? null : contextURL.toString();
WSIFWSDLLocatorImpl lo = new WSIFWSDLLocatorImpl(url, wsdlLoc, cl);
Definition def = wsdlReader.readWSDL(lo);
-
- if (oldPropValue != null) {
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- oldPropValue);
- } else {
- props.remove(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
- }
Trc.exitExpandWsdl(def);
return def;
} catch (WSDLException e) {
@@ -588,28 +543,12 @@
initializeProviders();
- Properties props = System.getProperties();
- String oldPropValue =
- props.getProperty(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
-
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- WSIFConstants.WSIF_WSDLFACTORY);
-
- WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLFactory factory = WSDLFactory.newInstance(
+ WSIFConstants.WSIF_WSDLFACTORY );
WSDLReader wsdlReader = factory.newWSDLReader();
wsdlReader.setFeature(Constants.FEATURE_VERBOSE, false);
Definition def =
wsdlReader.readWSDL(contextURL, new InputSource(reader));
-
- if (oldPropValue != null) {
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- oldPropValue);
- } else {
- props.remove(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
- }
-
Trc.exitExpandWsdl(def);
return def;
}
@@ -625,27 +564,12 @@
initializeProviders();
- Properties props = System.getProperties();
- String oldPropValue =
- props.getProperty(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
-
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- WSIFConstants.WSIF_WSDLFACTORY);
-
- WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLFactory factory = WSDLFactory.newInstance(
+ WSIFConstants.WSIF_WSDLFACTORY );
WSDLReader wsdlReader = factory.newWSDLReader();
wsdlReader.setFeature(Constants.FEATURE_VERBOSE, false);
Definition def = wsdlReader.readWSDL(contextURL, wsdlDocument);
- if (oldPropValue != null) {
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- oldPropValue);
- } else {
- props.remove(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
- }
-
Trc.exitExpandWsdl(def);
return def;
}
@@ -663,27 +587,12 @@
initializeProviders();
- Properties props = System.getProperties();
- String oldPropValue =
- props.getProperty(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
-
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- WSIFConstants.WSIF_WSDLFACTORY);
-
- WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLFactory factory = WSDLFactory.newInstance(
+ WSIFConstants.WSIF_WSDLFACTORY );
WSDLReader wsdlReader = factory.newWSDLReader();
wsdlReader.setFeature(Constants.FEATURE_VERBOSE, false);
Definition def = wsdlReader.readWSDL(contextURL, wsdlServicesElement);
- if (oldPropValue != null) {
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- oldPropValue);
- } else {
- props.remove(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
- }
-
Trc.exitExpandWsdl(def);
return def;
}
@@ -696,25 +605,12 @@
public static void writeWSDL(Definition def, Writer sink)
throws WSDLException {
Trc.entry(null, def, sink);
- Properties props = System.getProperties();
- String oldPropValue =
- props.getProperty(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
-
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- WSIFConstants.WSIF_WSDLFACTORY);
- WSDLFactory factory = WSDLFactory.newInstance();
+ WSDLFactory factory = WSDLFactory.newInstance(
+ WSIFConstants.WSIF_WSDLFACTORY );
WSDLWriter wsdlWriter = factory.newWSDLWriter();
wsdlWriter.writeWSDL(def, sink);
- if (oldPropValue != null) {
- props.setProperty(
- WSIFConstants.WSDLFACTORY_PROPERTY_NAME,
- oldPropValue);
- } else {
- props.remove(WSIFConstants.WSDLFACTORY_PROPERTY_NAME);
- }
Trc.exit();
}