cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r440424 - in /incubator/cxf/trunk: api/src/main/java/org/apache/cxf/interceptor/ common/src/main/java/org/apache/cxf/common/i18n/ rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/ rt/bindings/xml/src/main/java/org/apache/cxf/bindi...
Date Tue, 05 Sep 2006 18:03:24 GMT
Author: dkulp
Date: Tue Sep  5 11:03:23 2006
New Revision: 440424

URL: http://svn.apache.org/viewvc?view=rev&rev=440424
Log:
Remove some deprecated methods, fix some bugs in ServiceImpl


Modified:
    incubator/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/Fault.java
    incubator/cxf/trunk/common/src/main/java/org/apache/cxf/common/i18n/Exception.java
    incubator/cxf/trunk/common/src/main/java/org/apache/cxf/common/i18n/UncheckedException.java
    incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
    incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLFault.java
    incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/Messages.properties
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java

Modified: incubator/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/Fault.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/Fault.java?view=diff&rev=440424&r1=440423&r2=440424
==============================================================================
--- incubator/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/Fault.java (original)
+++ incubator/cxf/trunk/api/src/main/java/org/apache/cxf/interceptor/Fault.java Tue Sep  5
11:03:23 2006
@@ -39,8 +39,5 @@
         super(t);
     }
 
-    @SuppressWarnings("deprecation")
-    protected Fault(String message) {
-        super(message);
-    }
+
 }

Modified: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/common/i18n/Exception.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/main/java/org/apache/cxf/common/i18n/Exception.java?view=diff&rev=440424&r1=440423&r2=440424
==============================================================================
--- incubator/cxf/trunk/common/src/main/java/org/apache/cxf/common/i18n/Exception.java (original)
+++ incubator/cxf/trunk/common/src/main/java/org/apache/cxf/common/i18n/Exception.java Tue
Sep  5 11:03:23 2006
@@ -41,26 +41,6 @@
         message = null;
     } 
     
-    // the above constructors should be preferred to the following ones
-    
-    @Deprecated
-    public Exception() {
-        super();
-        message = null;
-    }
-    
-    @Deprecated
-    public Exception(String msg) {
-        super(msg);
-        message = null;
-    }
-    
-    @Deprecated
-    public Exception(String msg, Throwable t) {
-        super(msg, t);
-        message = null;
-    }
-
     public String getCode() {
         if (null != message) {
             return message.getCode();

Modified: incubator/cxf/trunk/common/src/main/java/org/apache/cxf/common/i18n/UncheckedException.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/common/src/main/java/org/apache/cxf/common/i18n/UncheckedException.java?view=diff&rev=440424&r1=440423&r2=440424
==============================================================================
--- incubator/cxf/trunk/common/src/main/java/org/apache/cxf/common/i18n/UncheckedException.java
(original)
+++ incubator/cxf/trunk/common/src/main/java/org/apache/cxf/common/i18n/UncheckedException.java
Tue Sep  5 11:03:23 2006
@@ -41,25 +41,6 @@
         message = null;
     } 
     
-    // the above constructors should be preferred to the following ones
-    
-    @Deprecated
-    public UncheckedException() {
-        super();
-        message = null;
-    }
-    
-    @Deprecated
-    public UncheckedException(String msg) {
-        super(msg);
-        message = null;
-    }
-    
-    @Deprecated
-    public UncheckedException(String msg, Throwable t) {
-        super(msg, t);
-        message = null;
-    }
 
     public String getCode() {
         if (null != message) {

Modified: incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java?view=diff&rev=440424&r1=440423&r2=440424
==============================================================================
--- incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
(original)
+++ incubator/cxf/trunk/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/SoapFault.java
Tue Sep  5 11:03:23 2006
@@ -21,6 +21,7 @@
 
 import java.util.HashMap;
 import java.util.Map;
+import java.util.ResourceBundle;
 
 import javax.xml.namespace.QName;
 
@@ -73,7 +74,7 @@
     }
 
     public SoapFault(String message, QName faultCode) {
-        super(message);
+        super(new Message(message, (ResourceBundle)null));
         this.faultCode = faultCode;
     }
     

Modified: incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLFault.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLFault.java?view=diff&rev=440424&r1=440423&r2=440424
==============================================================================
--- incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLFault.java
(original)
+++ incubator/cxf/trunk/rt/bindings/xml/src/main/java/org/apache/cxf/binding/xml/XMLFault.java
Tue Sep  5 11:03:23 2006
@@ -37,10 +37,6 @@
         super(t);
     }
 
-    @SuppressWarnings("deprecation")
-    protected XMLFault(String message) {
-        super(message);
-    }
 
 
 }

Modified: incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java?view=diff&rev=440424&r1=440423&r2=440424
==============================================================================
--- incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
(original)
+++ incubator/cxf/trunk/rt/core/src/main/java/org/apache/cxf/wsdl11/WSDLServiceFactory.java
Tue Sep  5 11:03:23 2006
@@ -20,7 +20,6 @@
 package org.apache.cxf.wsdl11;
 
 import java.net.URL;
-import java.util.logging.Level;
 import java.util.logging.Logger;
 
 import javax.wsdl.Definition;
@@ -28,10 +27,12 @@
 import javax.xml.namespace.QName;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.ServiceImpl;
 import org.apache.cxf.service.factory.AbstractServiceFactoryBean;
+import org.apache.cxf.service.factory.ServiceConstructionException;
 import org.apache.cxf.service.model.ServiceInfo;
 import org.apache.cxf.wsdl.WSDLManager;
 
@@ -55,7 +56,7 @@
         try {
             definition = getBus().getExtension(WSDLManager.class).getDefinition(wsdlUrl);
         } catch (WSDLException ex) {
-            LOG.log(Level.SEVERE, "SERVICE_CREATION_MSG", ex);
+            throw new ServiceConstructionException(new Message("SERVICE_CREATION_MSG", LOG),
ex);
         }
         
         javax.wsdl.Service wsdlService = definition.getService(serviceName);

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/Messages.properties?view=diff&rev=440424&r1=440423&r2=440424
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/Messages.properties
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/Messages.properties
Tue Sep  5 11:03:23 2006
@@ -21,4 +21,5 @@
 PORT_NAME_NULL_EXC = Port name must not be null.
 NO_OPERATION_INFO = Could not find operation info for web method {0}.
 COULD_NOT_DETERMINE_PORT = Unable to determine port name.
-FAILED_TO_PUBLISH_ENDPOINT_EXC = Failed to publish endpoint.
\ No newline at end of file
+FAILED_TO_PUBLISH_ENDPOINT_EXC = Failed to publish endpoint.
+FAILED_TO_INITIALIZE_JAXBCONTEXT = Failed to initialize JAXB context for types used by {0}.

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?view=diff&rev=440424&r1=440423&r2=440424
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
Tue Sep  5 11:03:23 2006
@@ -71,8 +71,13 @@
         bus = b;
         wsdlURL = url;
 
-        WSDLServiceFactory sf = new WSDLServiceFactory(bus, url, name);
-        service = sf.create();
+        if (url == null) {
+            ServiceInfo info = new ServiceInfo();
+            service = new org.apache.cxf.service.ServiceImpl(info);
+        } else {
+            WSDLServiceFactory sf = new WSDLServiceFactory(bus, url, name);
+            service = sf.create();
+        }
         handlerResolver = new HandlerResolverImpl(bus, name);
 
         try {
@@ -80,8 +85,9 @@
             service.setDataReaderFactory(dataBinding.getDataReaderFactory());
             service.setDataWriterFactory(dataBinding.getDataWriterFactory());
         } catch (JAXBException e) {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+            throw new WebServiceException(new Message("FAILED_TO_INITIALIZE_JAXBCONTEXT",
+                                                      LOG,
+                                                      cls.getName()).toString(), e);
         }
     }
 

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java?view=diff&rev=440424&r1=440423&r2=440424
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/JaxWsClientTest.java
Tue Sep  5 11:03:23 2006
@@ -35,6 +35,7 @@
 import org.apache.cxf.jaxws.support.JaxwsEndpointImpl;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.service.Service;
+import org.apache.cxf.service.factory.ServiceConstructionException;
 import org.apache.cxf.service.invoker.SimpleMethodInvoker;
 import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.service.model.EndpointInfo;
@@ -82,6 +83,21 @@
 
         Destination d = localTransport.getDestination(ei);
         d.setMessageObserver(new EchoObserver());
+    }
+    
+    public void testCreate() throws Exception {
+        javax.xml.ws.Service s =
+            javax.xml.ws.Service.create(new QName("http://apache.org/hello_world_soap_http",
+                                                          "SoapPort"));
+        assertNotNull(s);
+        
+        try {
+            s = javax.xml.ws.Service.create(new URL("file:/does/not/exist.wsdl"),
+                                            new QName("http://apache.org/hello_world_soap_http",
+                                                "SoapPort"));
+        } catch (ServiceConstructionException sce) {
+            //ignore, this is expected
+        }
     }
 
     public void testEndpoint() throws Exception {



Mime
View raw message