axis-java-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From prad...@apache.org
Subject svn commit: r574629 - in /webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws: ./ addressing/util/ context/ server/ server/endpoint/ spi/
Date Tue, 11 Sep 2007 15:33:14 GMT
Author: pradine
Date: Tue Sep 11 08:33:13 2007
New Revision: 574629

URL: http://svn.apache.org/viewvc?rev=574629&view=rev
Log:
Make the methods of EndpointReferenceBuilder static.

Modified:
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceBuilder.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java
    webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java?rev=574629&r1=574628&r2=574629&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
(original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/BindingProvider.java
Tue Sep 11 08:33:13 2007
@@ -256,7 +256,7 @@
             QName port = endpointDesc.getPortQName();
             URL wsdlURL = ((ServiceDescriptionWSDL) endpointDesc.getServiceDescription()).getWSDLLocation();
 
-            epr = new EndpointReferenceBuilder().createEndpointReference(address, service,
port, wsdlURL.toString(), addressingNamespace);
+            epr = EndpointReferenceBuilder.createEndpointReference(address, service, port,
wsdlURL.toString(), addressingNamespace);
         }
         
         return epr;

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceBuilder.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceBuilder.java?rev=574629&r1=574628&r2=574629&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceBuilder.java
(original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/addressing/util/EndpointReferenceBuilder.java
Tue Sep 11 08:33:13 2007
@@ -27,7 +27,6 @@
 import org.apache.axis2.addressing.metadata.ServiceName;
 import org.apache.axis2.addressing.metadata.WSDLLocation;
 import org.apache.axis2.jaxws.ExceptionFactory;
-import org.apache.axis2.jaxws.addressing.factory.EndpointReferenceFactory;
 import org.apache.axis2.jaxws.registry.FactoryRegistry;
 import org.apache.axis2.jaxws.util.WSDL4JWrapper;
 import org.apache.axis2.jaxws.util.WSDLWrapper;
@@ -36,10 +35,11 @@
     private static final EndpointMap map =
         (EndpointMap) FactoryRegistry.getFactory(EndpointMap.class);
     
-    public EndpointReferenceBuilder() {
+    //Prevent instantiation
+    private EndpointReferenceBuilder() {
     }
     
-    public void addAddress(QName serviceName, QName endpoint, String address) {
+    public static void addAddress(QName serviceName, QName endpoint, String address) {
         EndpointKey key = new EndpointKey(serviceName, endpoint);
         
         if (address == null || "".equals(address))
@@ -48,21 +48,21 @@
         map.put(key, address);
     }
     
-    public EndpointReference createEndpointReference(String address) {
+    public static EndpointReference createEndpointReference(String address) {
         if (address == null || "".equals(address))
             throw new IllegalStateException("The specified address is not a valid value:
" + address);
 
         return new EndpointReference(address);
     }
     
-    public EndpointReference createEndpointReference(QName serviceName, QName endpoint) {
+    public static EndpointReference createEndpointReference(QName serviceName, QName endpoint)
{
         EndpointKey key = new EndpointKey(serviceName, endpoint);
         String address = map.get(key);
         
         return createEndpointReference(address);
     }
     
-    public EndpointReference createEndpointReference(String address, QName serviceName, QName
portName, String wsdlDocumentLocation, String addressingNamespace) {
+    public static EndpointReference createEndpointReference(String address, QName serviceName,
QName portName, String wsdlDocumentLocation, String addressingNamespace) {
         EndpointReference axis2EPR = null;
         
         if (address != null) {
@@ -81,6 +81,14 @@
         }
         
         try {
+            //TODO If no service name and port name are specified, but the wsdl location
is
+            //specified, and the WSDL only contains one service and one port then maybe we
+            //should simply use those.
+            if (serviceName != null && portName != null) {
+                ServiceName service = new ServiceName(serviceName, portName.getLocalPart());
+                EndpointReferenceHelper.setServiceNameMetadata(axis2EPR, addressingNamespace,
service);
+            }
+
             if (wsdlDocumentLocation != null) {
             	URL wsdlURL = new URL(wsdlDocumentLocation);
             	WSDLWrapper wrapper = new WSDL4JWrapper(wsdlURL);
@@ -112,14 +120,6 @@
             	
                 WSDLLocation wsdlLocation = new WSDLLocation(portName.getNamespaceURI(),
wsdlDocumentLocation);
                 EndpointReferenceHelper.setWSDLLocationMetadata(axis2EPR, addressingNamespace,
wsdlLocation);
-            }
-            
-            //TODO If no service name and port name are specified, but the wsdl location
is
-            //specified, and the WSDL only contains one service and one port then maybe we
-            //should simply use those.
-            if (serviceName != null && portName != null) {
-                ServiceName service = new ServiceName(serviceName, portName.getLocalPart());
-                EndpointReferenceHelper.setServiceNameMetadata(axis2EPR, addressingNamespace,
service);
             }
         }
         catch (IllegalStateException ise) {

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java?rev=574629&r1=574628&r2=574629&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
(original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/context/WebServiceContextImpl.java
Tue Sep 11 08:33:13 2007
@@ -120,7 +120,7 @@
             URI wsdlURI = (URI) soapMessageContext.get(MessageContext.WSDL_DESCRIPTION);
             
             org.apache.axis2.addressing.EndpointReference axis2EPR =
-                new EndpointReferenceBuilder().createEndpointReference(null, service, endpoint,
wsdlURI.toString(), addressingNamespace);
+                EndpointReferenceBuilder.createEndpointReference(null, service, endpoint,
wsdlURI.toString(), addressingNamespace);
             
             try {
                 if (referenceParameters != null) {

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java?rev=574629&r1=574628&r2=574629&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
(original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/EndpointController.java
Tue Sep 11 08:33:13 2007
@@ -319,7 +319,7 @@
             axisSvc = ed.getAxisService();
             
             try {
-                new EndpointReferenceBuilder().addAddress(service, endpoint, axisSvc.getEPRs()[0]);
+                EndpointReferenceBuilder.addAddress(service, endpoint, axisSvc.getEPRs()[0]);
             }
             catch (Exception e) {
                 throw ExceptionFactory.makeWebServiceException(e);

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java?rev=574629&r1=574628&r2=574629&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java
(original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/server/endpoint/EndpointImpl.java
Tue Sep 11 08:33:13 2007
@@ -226,7 +226,7 @@
         //TODO: Need to understand how the binding can influence the behaviour of this method.
         
         org.apache.axis2.addressing.EndpointReference axis2EPR =
-        	new EndpointReferenceBuilder().createEndpointReference(address, serviceName, portName,
wsdlURL.toString(), addressingNamespace);
+        	EndpointReferenceBuilder.createEndpointReference(address, serviceName, portName,
wsdlURL.toString(), addressingNamespace);
         
         try {
             if (referenceParameters != null) {

Modified: webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java
URL: http://svn.apache.org/viewvc/webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java?rev=574629&r1=574628&r2=574629&view=diff
==============================================================================
--- webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java
(original)
+++ webservices/axis2/branches/java/jaxws21/modules/jaxws/src/org/apache/axis2/jaxws/spi/Provider.java
Tue Sep 11 08:33:13 2007
@@ -77,7 +77,7 @@
             List<Element> referenceParameters) {
         String addressingNamespace = getAddressingNamespace(W3CEndpointReference.class);
   	
         org.apache.axis2.addressing.EndpointReference axis2EPR =
-        	new EndpointReferenceBuilder().createEndpointReference(address, serviceName, portName,
wsdlDocumentLocation, addressingNamespace);
+        	EndpointReferenceBuilder.createEndpointReference(address, serviceName, portName,
wsdlDocumentLocation, addressingNamespace);
         
         W3CEndpointReference w3cEPR = null;
         
@@ -157,7 +157,7 @@
             ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
             OMElement eprElement = (OMElement) XMLUtils.toOM(bais);
             org.apache.axis2.addressing.EndpointReference axis2EPR =
-                new EndpointReferenceBuilder().createEndpointReference("");
+                EndpointReferenceBuilder.createEndpointReference("");
             String addressingNamespace = EndpointReferenceHelper.fromOM(axis2EPR, eprElement);
             
             jaxwsEPR = EndpointReferenceConverter.convertFromAxis2(axis2EPR, addressingNamespace);



---------------------------------------------------------------------
To unsubscribe, e-mail: axis-cvs-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-cvs-help@ws.apache.org


Mime
View raw message