cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From m...@apache.org
Subject svn commit: r606832 - /incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/http/HTTPBindingImpl.java
Date Wed, 26 Dec 2007 02:54:16 GMT
Author: mmao
Date: Tue Dec 25 18:54:15 2007
New Revision: 606832

URL: http://svn.apache.org/viewvc?rev=606832&view=rev
Log:
CXF-1336
  throw a WebServiceException when adding an incompatible handler in HttpBinding


Modified:
    incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/http/HTTPBindingImpl.java

Modified: incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/http/HTTPBindingImpl.java
URL: http://svn.apache.org/viewvc/incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/http/HTTPBindingImpl.java?rev=606832&r1=606831&r2=606832&view=diff
==============================================================================
--- incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/http/HTTPBindingImpl.java
(original)
+++ incubator/cxf/trunk/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/http/HTTPBindingImpl.java
Tue Dec 25 18:54:15 2007
@@ -19,6 +19,11 @@
 
 package org.apache.cxf.jaxws.binding.http;
 
+import java.util.List;
+
+import javax.xml.ws.WebServiceException;
+import javax.xml.ws.handler.Handler;
+import javax.xml.ws.handler.LogicalHandler;
 import javax.xml.ws.http.HTTPBinding;
 
 import org.apache.cxf.jaxws.binding.AbstractBindingImpl;
@@ -32,5 +37,20 @@
     public String getBindingID() {
         //REVISIT: JIRA CXF-613
         return "http://cxf.apache.org/bindings/xformat";
+    }
+    
+    @Override
+    public void setHandlerChain(List<Handler> hc) {
+        super.setHandlerChain(hc);
+        validate();
+    }
+
+    private void validate() {
+        for (Handler handler : this.getHandlerChain()) {
+            if (!(handler instanceof LogicalHandler)) {
+                throw new WebServiceException("Adding an incompatible handler in javax.xml.ws.http.HTTPBinding:
" 
+                        + handler.getClass());
+            }
+        }        
     }    
 }



Mime
View raw message