cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From j...@apache.org
Subject svn commit: r547220 - in /incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler: AnnotationHandlerChainBuilder.java HandlerChainBuilder.java Messages.properties
Date Thu, 14 Jun 2007 11:19:23 GMT
Author: jliu
Date: Thu Jun 14 04:19:22 2007
New Revision: 547220

URL: http://svn.apache.org/viewvc?view=rev&rev=547220
Log:
CXF-722: Using absolute java.net.URL in externalForm for handler chain config file is not
supported

Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerChainBuilder.java
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/Messages.properties

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java?view=diff&rev=547220&r1=547219&r2=547220
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AnnotationHandlerChainBuilder.java
Thu Jun 14 04:19:22 2007
@@ -36,6 +36,7 @@
 import javax.xml.ws.handler.Handler;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.common.i18n.Message;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.jaxws.javaee.HandlerChainType;
@@ -74,6 +75,12 @@
                         .newInstance(org.apache.cxf.jaxws.javaee.ObjectFactory.class);
                 Unmarshaller u = jc.createUnmarshaller();                
                 URL handlerFileURL  = resolveHandlerChainFile(clz, hcAnn.getFileName());

+                
+                if (handlerFileURL == null) {
+                    throw new WebServiceException(new Message("HANDLER_CFG_FILE_NOT_FOUND_EXC",
BUNDLE, hcAnn
+                        .getFileName()).toString());
+                }
+                
                 JAXBElement<?> o = (JAXBElement<?>)u.unmarshal(handlerFileURL);
 
                 HandlerChainsType handlerChainsType = (HandlerChainsType) o.getValue();

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerChainBuilder.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerChainBuilder.java?view=diff&rev=547220&r1=547219&r2=547220
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerChainBuilder.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/HandlerChainBuilder.java
Thu Jun 14 04:19:22 2007
@@ -134,7 +134,18 @@
      * @return A URL object or null if no resource with this name is found
      */    
     protected URL resolveHandlerChainFile(Class clz, String filename) {
-        return clz.getResource(filename);
+        URL handlerFile = clz.getResource(filename);
+        if (handlerFile == null) {
+            //the file location might be an absolute java.net.URL in externalForm.
+            try {
+                handlerFile = new URL(filename);
+                //test if the URL can be opened
+                handlerFile.openStream();
+            } catch (Exception e) {
+                //do nothing
+            } 
+        }
+        return handlerFile;
     } 
     
     private void configureHandler(Handler handler, PortComponentHandlerType h) {

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/Messages.properties
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/Messages.properties?view=diff&rev=547220&r1=547219&r2=547220
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/Messages.properties
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/Messages.properties
Thu Jun 14 04:19:22 2007
@@ -21,7 +21,7 @@
 NO_INPUT_STREAM_EXC = No input stream available.
 NO_OUTPUT_STREAM_EXC = No output stream available.
 ANNOTATION_WITHOUT_URL_EXC = @HandlerChain annotation does not contain a file name or url.
-HANDLER_CFG_FILE_NOT_FOUND_EXC = Unable to load handler configuration {0} specified by annotation,
file not found."
+HANDLER_CFG_FILE_NOT_FOUND_EXC = Unable to load handler configuration file specified by annotation:
{0} "
 HANDLER_INSTANTIATION_EXC = Failed to instantiate handler
 CHAIN_NOT_SPECIFIED_EXC = Chain not specified
 SEI_LOAD_FAILURE_EXC = Failed to load service endpoint interface.



Mime
View raw message