You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by ow...@apache.org on 2002/07/10 11:54:57 UTC
cvs commit: xml-axis-wsif/java/src/org/apache/wsif WSIFServiceFactory.java
owenb 2002/07/10 02:54:57
Modified: java/src/org/apache/wsif/base WSIFServiceImpl.java
java/src/org/apache/wsif WSIFServiceFactory.java
Added: java/src/org/apache/wsif/base WSIFServiceFactoryImpl.java
Log:
- Changed org.apache.wsif.WSIFServiceFactory into an abstract class
- Created new org.apache.wsif.base.WSIFServiceFactoryImpl class as
the non-abstract implementation
- Changed constructors on WSIFServiceImpl to be package-private
Revision Changes Path
1.8 +21 -28 xml-axis-wsif/java/src/org/apache/wsif/base/WSIFServiceImpl.java
Index: WSIFServiceImpl.java
===================================================================
RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/base/WSIFServiceImpl.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- WSIFServiceImpl.java 9 Jul 2002 13:53:05 -0000 1.7
+++ WSIFServiceImpl.java 10 Jul 2002 09:54:57 -0000 1.8
@@ -150,12 +150,11 @@
* then WSDL document must have exactly one portType in it
* and all ports of the selected service must
* implement the same portType.
- * <br><b>NOTE:</b>
+ * <br>NOTE:
* The equivalent {@link org.apache.wsif.WSIFServiceFactory}.getService method
- * should be used to create a WSIFService rather than call this constructor
- * directly
+ * should be used to create a WSIFService.
*/
- public WSIFServiceImpl(
+ WSIFServiceImpl(
String wsdlLoc,
String serviceNS,
String serviceName,
@@ -197,12 +196,11 @@
* then WSDL document must have exactly one portType in it
* and all ports of the selected service must
* implement the same portType.
- * <br><b>NOTE:</b>
+ * <br>NOTE:
* The equivalent {@link org.apache.wsif.WSIFServiceFactory}.getService method
- * should be used to create a WSIFService rather than call this constructor
- * directly
+ * should be used to create a WSIFService.
*/
- public WSIFServiceImpl(
+ WSIFServiceImpl(
String wsdlLoc,
ClassLoader cl,
String serviceNS,
@@ -238,34 +236,31 @@
/**
* Create a WSIF service instance
- * <br><b>NOTE:</b>
+ * <br>NOTE:
* The equivalent {@link org.apache.wsif.WSIFServiceFactory}.getService method
- * should be used to create a WSIFService rather than call this constructor
- * directly
+ * should be used to create a WSIFService.
*/
- public WSIFServiceImpl(Definition def) throws WSIFException {
+ WSIFServiceImpl(Definition def) throws WSIFException {
this(def, null);
}
/**
* Create a WSIF service instance
- * <br><b>NOTE:</b>
+ * <br>NOTE:
* The equivalent {@link org.apache.wsif.WSIFServiceFactory}.getService method
- * should be used to create a WSIFService rather than call this constructor
- * directly
+ * should be used to create a WSIFService.
*/
- public WSIFServiceImpl(Definition def, Service service) throws WSIFException {
+ WSIFServiceImpl(Definition def, Service service) throws WSIFException {
this(def, service, null);
}
/**
* Create a WSIF service instance
- * <br><b>NOTE:</b>
+ * <br>NOTE:
* The equivalent {@link org.apache.wsif.WSIFServiceFactory}.getService method
- * should be used to create a WSIFService rather than call this constructor
- * directly
+ * should be used to create a WSIFService.
*/
- public WSIFServiceImpl(Definition def, Service service, PortType portType)
+ WSIFServiceImpl(Definition def, Service service, PortType portType)
throws WSIFException {
Tr.entry(this, def, service, portType);
@@ -280,12 +275,11 @@
/**
* Create a WSIF service instance
- * <br><b>NOTE:</b>
+ * <br>NOTE:
* The equivalent {@link org.apache.wsif.WSIFServiceFactory}.getService method
- * should be used to create a WSIFService rather than call this constructor
- * directly
+ * should be used to create a WSIFService.
*/
- public WSIFServiceImpl(Definition def, String serviceNS, String serviceName)
+ WSIFServiceImpl(Definition def, String serviceNS, String serviceName)
throws WSIFException {
Tr.entry(this, def, serviceNS, serviceName);
@@ -302,12 +296,11 @@
/**
* Create a WSIF service instance
- * <br><b>NOTE:</b>
+ * <br>NOTE:
* The equivalent {@link org.apache.wsif.WSIFServiceFactory}.getService method
- * should be used to create a WSIFService rather than call this constructor
- * directly
+ * should be used to create a WSIFService.
*/
- public WSIFServiceImpl(
+ WSIFServiceImpl(
Definition def,
String serviceNS,
String serviceName,
1.1 xml-axis-wsif/java/src/org/apache/wsif/base/WSIFServiceFactoryImpl.java
Index: WSIFServiceFactoryImpl.java
===================================================================
/*
* The Apache Software License, Version 1.1
*
*
* Copyright (c) 2002 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
*
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in
* the documentation and/or other materials provided with the
* distribution.
*
* 3. The end-user documentation included with the redistribution,
* if any, must include the following acknowledgment:
* "This product includes software developed by the
* Apache Software Foundation (http://www.apache.org/)."
* Alternately, this acknowledgment may appear in the software itself,
* if and wherever such third-party acknowledgments normally appear.
*
* 4. The names "WSIF" and "Apache Software Foundation" must
* not be used to endorse or promote products derived from this
* software without prior written permission. For written
* permission, please contact apache@apache.org.
*
* 5. Products derived from this software may not be called "Apache",
* nor may "Apache" appear in their name, without prior written
* permission of the Apache Software Foundation.
*
* THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
* OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR
* ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
* USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
* ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
* OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
* ====================================================================
*
* This software consists of voluntary contributions made by many
* individuals on behalf of the Apache Software Foundation and was
* originally based on software copyright (c) 2001, 2002, International
* Business Machines, Inc., http://www.apache.org. For more
* information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*/
package org.apache.wsif.base;
import javax.wsdl.Definition;
import javax.wsdl.PortType;
import javax.wsdl.Service;
import org.apache.wsif.WSIFException;
import org.apache.wsif.WSIFService;
import org.apache.wsif.WSIFServiceFactory;
import org.apache.wsif.logging.Tr;
import org.apache.wsif.util.WSIFUtils;
/**
* Factory class to create WSIFService's.
*
* @author Mark Whitlock
*/
public class WSIFServiceFactoryImpl extends WSIFServiceFactory{
/**
* Create a WSIFService from WSDL document URL.
* <br> If serviceName or serviceNS is null,
* then WSDL document must have exactly one service in it.
* <br> If portTypeName or portTypeNS is null,
* then WSDL document must have exactly one portType in it
* and all ports of the selected service must
* implement the same portType.
*/
public WSIFService getService(
String wsdlLoc,
String serviceNS,
String serviceName,
String portTypeNS,
String portTypeName)
throws WSIFException {
Tr.entry(this, wsdlLoc, serviceNS, serviceName, portTypeNS, portTypeName);
WSIFServiceImpl wsi =
new WSIFServiceImpl(wsdlLoc, serviceNS, serviceName, portTypeNS, portTypeName);
Tr.exit(wsi);
return wsi;
}
/**
* Create a WSIF service instance from WSDL document URL
* using a ClassLoader to find local resources.
* <br> If serviceName or serviceNS is null,
* then WSDL document must have exactly one service in it.
* <br> If portTypeName or portTypeNS is null,
* then WSDL document must have exactly one portType in it
* and all ports of the selected service must
* implement the same portType.
*/
public WSIFService getService(
String wsdlLoc,
ClassLoader cl,
String serviceNS,
String serviceName,
String portTypeNS,
String portTypeName)
throws WSIFException {
Tr.entry(this, wsdlLoc, cl, serviceNS, serviceName, portTypeNS, portTypeName);
WSIFServiceImpl wsi =
new WSIFServiceImpl(
wsdlLoc,
cl,
serviceNS,
serviceName,
portTypeNS,
portTypeName);
Tr.exit(wsi);
return wsi;
}
/**
* Returns a new WSIFService.
*/
public WSIFService getService(Definition def) throws WSIFException {
Tr.entry(this, def);
WSIFServiceImpl wsi = new WSIFServiceImpl(def);
Tr.exit(wsi);
return wsi;
}
/**
* Returns a new WSIFService.
*/
public WSIFService getService(Definition def, Service service)
throws WSIFException {
Tr.entry(this, def, service);
WSIFServiceImpl wsi = new WSIFServiceImpl(def, service);
Tr.exit(wsi);
return wsi;
}
/**
* Returns a new WSIFService.
*/
public WSIFService getService(
Definition def,
Service service,
PortType portType)
throws WSIFException {
Tr.entry(this, def, service, portType);
WSIFServiceImpl wsi = new WSIFServiceImpl(def, service, portType);
Tr.exit(wsi);
return wsi;
}
/**
* Returns a new WSIFService.
*/
public WSIFService getService(
Definition def,
String serviceNS,
String serviceName,
String portTypeNS,
String portTypeName)
throws WSIFException {
Tr.entry(this, def, serviceNS, serviceName, portTypeNS, portTypeName);
WSIFServiceImpl wsi =
new WSIFServiceImpl(def, serviceNS, serviceName, portTypeNS, portTypeName);
Tr.exit(wsi);
return wsi;
}
}
1.4 +36 -80 xml-axis-wsif/java/src/org/apache/wsif/WSIFServiceFactory.java
Index: WSIFServiceFactory.java
===================================================================
RCS file: /home/cvs/xml-axis-wsif/java/src/org/apache/wsif/WSIFServiceFactory.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- WSIFServiceFactory.java 14 Jun 2002 12:17:37 -0000 1.3
+++ WSIFServiceFactory.java 10 Jul 2002 09:54:57 -0000 1.4
@@ -61,31 +61,27 @@
import javax.wsdl.PortType;
import javax.wsdl.Service;
-import org.apache.wsif.base.WSIFServiceImpl;
+import org.apache.wsif.base.WSIFServiceFactoryImpl;
import org.apache.wsif.logging.Tr;
import org.apache.wsif.util.WSIFUtils;
/**
- * Factory class to create WSIFService's.
+ * Abstract factory class to create WSIFService's.
*
* @author Mark Whitlock
+ * @author Owen Burroughs
*/
-public class WSIFServiceFactory {
-
- /**
- * Private constructor since newInstance should be used instead.
- */
- private WSIFServiceFactory() {
- }
+public abstract class WSIFServiceFactory {
/**
- * Creates a new WSIFServiceFactory.
+ * Creates a new instance of an implementation the abstract
+ * WSIFServiceFactory class.
*/
public static WSIFServiceFactory newInstance() {
Tr.entry(null);
- WSIFServiceFactory wsf = new WSIFServiceFactory();
-
+ WSIFServiceFactoryImpl wsf = new WSIFServiceFactoryImpl();
+
// Create the simple types map for use by other WSIF classes
WSIFUtils.createSimpleTypesMap();
@@ -102,20 +98,13 @@
* and all ports of the selected service must
* implement the same portType.
*/
- public WSIFService getService(
- String wsdlLoc,
- String serviceNS,
- String serviceName,
- String portTypeNS,
- String portTypeName)
- throws WSIFException {
- Tr.entry(this, wsdlLoc, serviceNS, serviceName, portTypeNS, portTypeName);
- WSIFServiceImpl wsi =
- new WSIFServiceImpl(wsdlLoc, serviceNS, serviceName, portTypeNS, portTypeName);
-
- Tr.exit(wsi);
- return wsi;
- }
+ public abstract WSIFService getService(
+ String wsdlLoc,
+ String serviceNS,
+ String serviceName,
+ String portTypeNS,
+ String portTypeName)
+ throws WSIFException;
/**
* Create a WSIF service instance from WSDL document URL
@@ -127,77 +116,44 @@
* and all ports of the selected service must
* implement the same portType.
*/
- public WSIFService getService(
- String wsdlLoc,
- ClassLoader cl,
- String serviceNS,
- String serviceName,
- String portTypeNS,
- String portTypeName)
- throws WSIFException {
- Tr.entry(this, wsdlLoc, cl, serviceNS, serviceName, portTypeNS, portTypeName);
- WSIFServiceImpl wsi =
- new WSIFServiceImpl(
- wsdlLoc,
- cl,
- serviceNS,
- serviceName,
- portTypeNS,
- portTypeName);
-
- Tr.exit(wsi);
- return wsi;
- }
+ public abstract WSIFService getService(
+ String wsdlLoc,
+ ClassLoader cl,
+ String serviceNS,
+ String serviceName,
+ String portTypeNS,
+ String portTypeName)
+ throws WSIFException;
/**
* Returns a new WSIFService.
*/
- public WSIFService getService(Definition def) throws WSIFException {
- Tr.entry(this, def);
- WSIFServiceImpl wsi = new WSIFServiceImpl(def);
- Tr.exit(wsi);
- return wsi;
- }
+ public abstract WSIFService getService(Definition def)
+ throws WSIFException;
/**
* Returns a new WSIFService.
*/
- public WSIFService getService(Definition def, Service service)
- throws WSIFException {
- Tr.entry(this, def, service);
- WSIFServiceImpl wsi = new WSIFServiceImpl(def, service);
- Tr.exit(wsi);
- return wsi;
- }
+ public abstract WSIFService getService(Definition def, Service service)
+ throws WSIFException;
/**
* Returns a new WSIFService.
*/
- public WSIFService getService(
+ public abstract WSIFService getService(
Definition def,
Service service,
PortType portType)
- throws WSIFException {
- Tr.entry(this, def, service, portType);
- WSIFServiceImpl wsi = new WSIFServiceImpl(def, service, portType);
- Tr.exit(wsi);
- return wsi;
- }
+ throws WSIFException;
/**
* Returns a new WSIFService.
*/
- public WSIFService getService(
- Definition def,
- String serviceNS,
- String serviceName,
- String portTypeNS,
- String portTypeName)
- throws WSIFException {
- Tr.entry(this, def, serviceNS, serviceName, portTypeNS, portTypeName);
- WSIFServiceImpl wsi =
- new WSIFServiceImpl(def, serviceNS, serviceName, portTypeNS, portTypeName);
- Tr.exit(wsi);
- return wsi;
- }
+ public abstract WSIFService getService(
+ Definition def,
+ String serviceNS,
+ String serviceName,
+ String portTypeNS,
+ String portTypeName)
+ throws WSIFException;
}