You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/02/25 17:11:31 UTC

svn commit: r916335 [1/2] - in /cxf/branches/2.2.x-fixes: ./ api/src/main/java/org/apache/cxf/endpoint/ api/src/main/java/org/apache/cxf/message/ api/src/main/java/org/apache/cxf/service/model/ common/common/src/main/java/org/apache/cxf/common/util/ rt...

Author: dkulp
Date: Thu Feb 25 16:11:29 2010
New Revision: 916335

URL: http://svn.apache.org/viewvc?rev=916335&view=rev
Log:
Merged revisions 916080,916093 via svnmerge from 
https://svn.apache.org/repos/asf/cxf/trunk

........
  r916080 | dkulp | 2010-02-24 20:22:34 -0500 (Wed, 24 Feb 2010) | 1 line
  
  Bunch of minor tweeks to help performance and scalability
........
  r916093 | dkulp | 2010-02-24 21:37:33 -0500 (Wed, 24 Feb 2010) | 1 line
  
  Another "I'm beginning to not like Java5" commit
........

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/Exchange.java
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/ExchangeImpl.java
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/MessageImpl.java
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/MessageUtils.java
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/StringMapImpl.java
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
    cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java
    cxf/branches/2.2.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/ModCountCopyOnWriteArrayList.java
    cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java
    cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
    cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java
    cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FIStaxInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/AbstractBindingImpl.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/DefaultBindingImpl.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/http/HTTPBindingImpl.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/SOAPBindingImpl.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractJAXWSHandlerInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptorTest.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/HandlerChainInvokerTest.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/LogicalHandlerInterceptorTest.java
    cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptorTest.java
    cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/AbstractHTTPTransportFactory.java
    cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPConduit.java
    cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/policy/PolicyUtils.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/IssuedTokenInterceptorProvider.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationInInterceptor.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationOutInterceptor.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/policy/interceptors/SecureConversationTokenInterceptorProvider.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/trust/STSClient.java
    cxf/branches/2.2.x-fixes/rt/ws/security/src/main/java/org/apache/cxf/ws/security/wss4j/policyhandlers/AbstractBindingBuilder.java
    cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/DispatchHandlerInvocationTest.java
    cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationTest.java
    cxf/branches/2.2.x-fixes/systests/jaxws/src/test/java/org/apache/cxf/systest/handlers/HandlerInvocationUsingAddNumbersTest.java
    cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java
    cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
    cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopWithJMSTest.java

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
    svn:mergeinfo = /cxf/trunk:916080-916093

Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/endpoint/AbstractConduitSelector.java Thu Feb 25 16:11:29 2010
@@ -22,7 +22,6 @@
 import java.io.IOException;
 import java.util.logging.Logger;
 
-import org.apache.cxf.Bus;
 import org.apache.cxf.BusException;
 import org.apache.cxf.common.util.StringUtils;
 import org.apache.cxf.interceptor.Fault;
@@ -67,8 +66,8 @@
             EndpointInfo ei = endpoint.getEndpointInfo();
             String transportID = ei.getTransportId();
             try {
-                ConduitInitiatorManager conduitInitiatorMgr =
-                    getBus(exchange).getExtension(ConduitInitiatorManager.class);
+                ConduitInitiatorManager conduitInitiatorMgr = exchange.getBus()
+                    .getExtension(ConduitInitiatorManager.class);
                 if (conduitInitiatorMgr != null) {
                     ConduitInitiator conduitInitiator =
                         conduitInitiatorMgr.getConduitInitiator(transportID);
@@ -122,17 +121,6 @@
     }
     
     /**
-     * Get the associated Bus instance from the exchange.
-     * 
-     * @param exchange the current exchange
-     * @return the Bus instance
-     */
-    private Bus getBus(Exchange exchange) {
-        return exchange.get(Bus.class);
-    }
-    
-    
-    /**
      * Called on completion of the MEP for which the Conduit was required.
      * 
      * @param exchange represents the completed MEP

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/Exchange.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/Exchange.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/Exchange.java (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/Exchange.java Thu Feb 25 16:11:29 2010
@@ -19,6 +19,11 @@
 
 package org.apache.cxf.message;
 
+import org.apache.cxf.Bus;
+import org.apache.cxf.binding.Binding;
+import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.Session;
@@ -100,4 +105,11 @@
      * {@inheritDoc}
      */
     void clear();
+    
+    Bus getBus();
+    Service getService();
+    Endpoint getEndpoint();
+    Binding getBinding();
+    BindingOperationInfo getBindingOperationInfo();
+    
 }

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/ExchangeImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/ExchangeImpl.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/ExchangeImpl.java (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/ExchangeImpl.java Thu Feb 25 16:11:29 2010
@@ -19,15 +19,19 @@
 
 package org.apache.cxf.message;
 
+import org.apache.cxf.Bus;
+import org.apache.cxf.binding.Binding;
 import org.apache.cxf.endpoint.ConduitSelector;
 import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.endpoint.PreexistingConduitSelector;
+import org.apache.cxf.service.Service;
+import org.apache.cxf.service.model.BindingOperationInfo;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.Destination;
 import org.apache.cxf.transport.Session;
 
 public class ExchangeImpl extends StringMapImpl implements Exchange {
-
+    
     private Destination destination;
     private boolean oneWay;
     private boolean synchronous = true;
@@ -39,6 +43,28 @@
     
     private Session session;
     
+    private Bus bus;
+    private Endpoint endpoint;
+    private Service service;
+    private Binding binding;
+    private BindingOperationInfo bindingOp;
+    
+
+    public <T> void put(Class<T> key, T value) {
+        super.put(key, value);
+        if (key == Bus.class) {
+            bus = (Bus)value;
+        } else if (key == Endpoint.class) {
+            endpoint = (Endpoint)value;
+        } else if (key == Service.class) {
+            service = (Service)value;
+        } else if (key == BindingOperationInfo.class) {
+            bindingOp = (BindingOperationInfo)value;
+        } else if (key == Binding.class) {
+            binding = (Binding)value;
+        }
+    }
+    
     public Destination getDestination() {
         return destination;
     }
@@ -131,5 +157,26 @@
         inFaultMessage = null;
         outFaultMessage = null;
         session = null;
+        bus = null;
+    }
+
+    public Bus getBus() {
+        return bus;
+    }
+
+    public Endpoint getEndpoint() {
+        return endpoint;
+    }
+
+    public Service getService() {
+        return service;
+    }
+
+    public Binding getBinding() {
+        return binding;
+    }
+
+    public BindingOperationInfo getBindingOperationInfo() {
+        return bindingOp;
     }
 }

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/Message.java Thu Feb 25 16:11:29 2010
@@ -188,4 +188,6 @@
      * @return the property's value
      */
     Object getContextualProperty(String key);   
+    
+
 }

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/MessageImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/MessageImpl.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/MessageImpl.java (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/MessageImpl.java Thu Feb 25 16:11:29 2010
@@ -19,37 +19,73 @@
 
 package org.apache.cxf.message;
 
+import java.io.InputStream;
+import java.io.OutputStream;
 import java.util.Collection;
+import java.util.HashSet;
 import java.util.IdentityHashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Set;
 
+import javax.xml.stream.XMLStreamReader;
+import javax.xml.stream.XMLStreamWriter;
+
+import org.w3c.dom.Node;
+
 import org.apache.cxf.Bus;
 import org.apache.cxf.endpoint.Endpoint;
+import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.interceptor.InterceptorChain;
+import org.apache.cxf.io.DelegatingInputStream;
 import org.apache.cxf.service.Service;
 import org.apache.cxf.service.model.OperationInfo;
 import org.apache.cxf.transport.Destination;
 
 public class MessageImpl extends StringMapImpl implements Message {
-    static int count;
+    private static final Class<?> DEFAULT_CONTENTS[];
+    private static final int DEFAULT_CONTENTS_LENGTH;
+    
+    static {
+        Class<?> tmps[];
+        
+        try {
+            //if SAAJ is there, give it a slot
+            Class<?> cls = Class.forName("javax.xml.soap.SOAPMessage");
+            tmps = new Class<?>[] {
+                XMLStreamReader.class, XMLStreamWriter.class,
+                InputStream.class, OutputStream.class,
+                List.class, Exception.class, Node.class, DelegatingInputStream.class,
+                cls
+            };
+        } catch (Throwable e) {
+            tmps = new Class<?>[] {
+                XMLStreamReader.class, XMLStreamWriter.class,
+                InputStream.class, OutputStream.class,
+                List.class, Exception.class, Node.class, DelegatingInputStream.class
+            };
+        }
+        DEFAULT_CONTENTS = tmps;
+        DEFAULT_CONTENTS_LENGTH = tmps.length;
+    }
+    
     
-    private Collection<Attachment> attachments;
     private Exchange exchange;
     private String id;
     private InterceptorChain interceptorChain;
-    private Map<Class<?>, Object> contents = new IdentityHashMap<Class<?>, Object>(6);
+    
+    private Object[] defaultContents = new Object[DEFAULT_CONTENTS_LENGTH];
+    private Map<Class<?>, Object> contents;
     
     public MessageImpl() {
         //nothing
     }
     
     public Collection<Attachment> getAttachments() {
-        return attachments;
+        return CastUtils.cast((Collection<?>)get(ATTACHMENTS));
     }
 
     public void setAttachments(Collection<Attachment> attachments) {
-        this.attachments = attachments;
         put(ATTACHMENTS, attachments);
     }
 
@@ -74,20 +110,55 @@
         return this.interceptorChain;
     }
 
+    @SuppressWarnings("unchecked")
     public <T> T getContent(Class<T> format) {
-        return format.cast(contents.get(format));
+        for (int x = 0; x < DEFAULT_CONTENTS_LENGTH; x++) {
+            if (DEFAULT_CONTENTS[x] == format) {
+                return (T)defaultContents[x];
+            }
+        }
+        return contents == null ? null : (T)contents.get(format);
     }
 
     public <T> void setContent(Class<T> format, Object content) {
+        for (int x = 0; x < DEFAULT_CONTENTS_LENGTH; x++) {
+            if (DEFAULT_CONTENTS[x] == format) {
+                defaultContents[x] = content;
+                return;
+            }
+        }
+        if (contents == null) {
+            contents = new IdentityHashMap<Class<?>, Object>(6);
+        }
         contents.put(format, content);
     }
     
     public <T> void removeContent(Class<T> format) {
-        contents.remove(format);
+        for (int x = 0; x < DEFAULT_CONTENTS_LENGTH; x++) {
+            if (DEFAULT_CONTENTS[x] == format) {
+                defaultContents[x] = null;
+                return;
+            }
+        }
+        if (contents != null) {
+            contents.remove(format);
+        }
     }
 
     public Set<Class<?>> getContentFormats() {
-        return contents.keySet();
+        
+        Set<Class<?>> c;
+        if (contents == null) {
+            c = new HashSet<Class<?>>();
+        } else {
+            c = new HashSet<Class<?>>(contents.keySet());
+        }
+        for (int x = 0; x < DEFAULT_CONTENTS_LENGTH; x++) {
+            if (defaultContents[x] != null) {
+                c.add(DEFAULT_CONTENTS[x]);
+            }
+        }
+        return c;
     }
 
     public void setDestination(Destination d) {

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/MessageUtils.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/MessageUtils.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/MessageUtils.java (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/MessageUtils.java Thu Feb 25 16:11:29 2010
@@ -26,6 +26,16 @@
  * Holder for utility methods relating to messages.
  */
 public final class MessageUtils {
+    private static final Class<?> SAAJ_CLASS;
+    static {
+        Class<?> tmp = null;
+        try {
+            tmp = Class.forName("javax.xml.soap.SOAPMessage");
+        } catch (Throwable t) {
+            tmp = null;
+        }
+        SAAJ_CLASS = tmp;
+    }
 
     /**
      * Prevents instantiation.
@@ -130,12 +140,7 @@
      * Returns true if the underlying content format is a W3C DOM or a SAAJ message.
      */
     public static boolean isDOMPresent(Message m) {
-        for (Class c : m.getContentFormats()) {
-            if (c.equals(Node.class) || c.getName().equals("javax.xml.soap.SOAPMessage")) {
-                return true;
-            }   
-        }
-        return false;
+        return m.getContent(Node.class) != null || (SAAJ_CLASS != null && m.getContent(SAAJ_CLASS) != null);
     }
 
 }

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/StringMapImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/StringMapImpl.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/StringMapImpl.java (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/message/StringMapImpl.java Thu Feb 25 16:11:29 2010
@@ -20,6 +20,7 @@
 package org.apache.cxf.message;
 
 import java.util.HashMap;
+import java.util.Map;
 
 /**
  * A variation on HashMap which allows lookup by Class, via the string
@@ -29,8 +30,15 @@
     extends HashMap<String, Object> 
     implements StringMap {
     
+    public StringMapImpl() {
+    }
+    public StringMapImpl(Map<String, Object> i) {
+        super(i);
+    }
+    
+    @SuppressWarnings("unchecked")
     public <T> T get(Class<T> key) {
-        return key.cast(get(key.getName()));
+        return (T)get(key.getName());
     }
 
     public <T> void put(Class<T> key, T value) {

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractMessageContainer.java Thu Feb 25 16:11:29 2010
@@ -204,9 +204,12 @@
      * @return all message parts.
      */
     public List<MessagePartInfo> getMessageParts() {
+        if (outOfBandParts == null) {
+            return new ArrayList<MessagePartInfo>(messageParts.values());
+        }
         List<MessagePartInfo> parts = new ArrayList<MessagePartInfo>(messageParts.values());
-        parts.addAll(getOutOfBandParts());
-        return Collections.unmodifiableList(parts);
+        parts.addAll(outOfBandParts);
+        return parts;
     }
     public List<MessagePartInfo> getOutOfBandParts() {
         if (outOfBandParts == null) {

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/AbstractPropertiesHolder.java Thu Feb 25 16:11:29 2010
@@ -33,6 +33,9 @@
     private AtomicReference<Object[]> extensors = new AtomicReference<Object[]>();
     private Map<QName, Object> extensionAttributes;
     
+    public Map<String, Object> getProperties() {
+        return propertyMap.get();
+    }
     public Object getProperty(String name) {
         if (null == propertyMap.get()) {
             return null;

Modified: cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java (original)
+++ cxf/branches/2.2.x-fixes/api/src/main/java/org/apache/cxf/service/model/ServiceModelUtil.java Thu Feb 25 16:11:29 2010
@@ -42,7 +42,7 @@
     }
 
     public static Service getService(Exchange exchange) {
-        return exchange.get(Service.class);
+        return exchange.getService();
     }
     
     public static String getTargetNamespace(Exchange exchange) {

Modified: cxf/branches/2.2.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/ModCountCopyOnWriteArrayList.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/ModCountCopyOnWriteArrayList.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/ModCountCopyOnWriteArrayList.java (original)
+++ cxf/branches/2.2.x-fixes/common/common/src/main/java/org/apache/cxf/common/util/ModCountCopyOnWriteArrayList.java Thu Feb 25 16:11:29 2010
@@ -21,104 +21,129 @@
 
 import java.util.Collection;
 import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.concurrent.atomic.AtomicInteger;
 
 public final class ModCountCopyOnWriteArrayList<T> extends CopyOnWriteArrayList<T> {
-    int modCount;
+    AtomicInteger modCount = new AtomicInteger();
     
     public ModCountCopyOnWriteArrayList() {
         super();
     }
     public ModCountCopyOnWriteArrayList(Collection<? extends T> c) {
-        super();
-        synchronized (c) {
-            addAll(c);
-            if (c instanceof ModCountCopyOnWriteArrayList) {
-                modCount = ((ModCountCopyOnWriteArrayList)c).getModCount();
-            }
+        super(c);
+        if (c instanceof ModCountCopyOnWriteArrayList) {
+            modCount.set(((ModCountCopyOnWriteArrayList)c).getModCount());
         }
     }
     
-    public synchronized int getModCount() {
-        return modCount;
+    public int getModCount() {
+        return modCount.get();
     }
     
-    public synchronized void setModCount(int i) {
-        modCount = i;
+    public void setModCount(int i) {
+        modCount.set(i);
     }
     
     @Override
-    public synchronized void add(int index, T element) {
-        ++modCount;
+    public void add(int index, T element) {
         super.add(index, element);
+        modCount.incrementAndGet();
     }
 
     @Override
-    public synchronized boolean add(T element) {
-        ++modCount;
-        return super.add(element);
+    public boolean add(T element) {
+        if (super.add(element)) {
+            modCount.incrementAndGet();
+            return true;
+        }
+        return false;
     }
 
     @Override
-    public synchronized boolean addAll(Collection<? extends T> c) {
-        ++modCount;
-        return super.addAll(c);
+    public boolean addAll(Collection<? extends T> c) {
+        if (super.addAll(c)) {
+            modCount.incrementAndGet();
+            return true;
+        }
+        return false;
     }
 
     @Override
-    public synchronized boolean addAll(int index, Collection<? extends T> c) {
-        ++modCount;
-        return super.addAll(index, c);
+    public boolean addAll(int index, Collection<? extends T> c) {
+        if (super.addAll(index, c)) {
+            modCount.incrementAndGet();
+            return true;
+        }
+        return false;
     }
 
     @Override
-    public synchronized int addAllAbsent(Collection<? extends T> c) {
-        ++modCount;
-        return super.addAllAbsent(c);
+    public int addAllAbsent(Collection<? extends T> c) {
+        int i = super.addAllAbsent(c);
+        if (i > 0) {
+            modCount.incrementAndGet();
+        }
+        return i;
     }
 
     @Override
-    public synchronized boolean addIfAbsent(T element) {
-        ++modCount;
-        return super.addIfAbsent(element);
+    public boolean addIfAbsent(T element) {
+        if (super.addIfAbsent(element)) {
+            modCount.incrementAndGet();
+            return true;
+        }
+        return false;
     }
 
     @Override
-    public synchronized void clear() {
-        ++modCount;
+    public void clear() {
         super.clear();
+        modCount.incrementAndGet();
     }
 
     @Override
-    public synchronized T remove(int index) {
-        ++modCount;
-        return super.remove(index);
+    public T remove(int index) {
+        T t = super.remove(index);
+        if (t != null) {
+            modCount.incrementAndGet();
+        }
+        return t;
     }
 
     @Override
-    public synchronized boolean remove(Object o) {
-        ++modCount;
-        return super.remove(o);
+    public boolean remove(Object o) {
+        if (super.remove(o)) {
+            modCount.incrementAndGet();
+            return true;
+        }
+        return false;
     }
 
     @Override
-    public synchronized boolean removeAll(Collection c) {
-        ++modCount;
-        return super.removeAll(c);
+    public boolean removeAll(Collection c) {
+        if (super.removeAll(c)) {
+            modCount.incrementAndGet();
+            return true;
+        }
+        return false;
     }
 
     @Override
-    public synchronized boolean retainAll(Collection c) {
-        ++modCount;
-        return super.retainAll(c);
+    public boolean retainAll(Collection c) {
+        if (super.retainAll(c)) {
+            modCount.incrementAndGet();
+            return true;
+        }
+        return false;
     }
     
-    public synchronized int hashCode() {
-        return super.hashCode() + modCount;
+    public int hashCode() {
+        return super.hashCode() + modCount.get();
     }
     
-    public synchronized boolean equals(Object o) {
+    public boolean equals(Object o) {
         if (o instanceof ModCountCopyOnWriteArrayList) {
-            return super.equals(o) && modCount == ((ModCountCopyOnWriteArrayList)o).getModCount();
+            return super.equals(o) && modCount.get() == ((ModCountCopyOnWriteArrayList)o).getModCount();
         }
         return false;
     }

Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java (original)
+++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/HeaderUtil.java Thu Feb 25 16:11:29 2010
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.binding.soap;
 
+import java.util.Collections;
 import java.util.HashSet;
 import java.util.List;
 import java.util.Set;
@@ -75,17 +76,15 @@
     }
 
     public static Set<QName> getHeaderQNameInOperationParam(SoapMessage soapMessage) {
-        Set<QName> headers = new HashSet<QName>();
-        BindingOperationInfo bop = soapMessage.getExchange()
-            .get(BindingOperationInfo.class);
+        BindingOperationInfo bop = soapMessage.getExchange().getBindingOperationInfo();
         if (bop != null) {
             if (bop.getInput() != null) {
-                headers.addAll(getHeaderParts(bop.getInput()));
+                return getHeaderParts(bop.getInput());
             }
             if (bop.getOutput() != null) {
-                headers.addAll(getHeaderParts(bop.getOutput()));
+                return getHeaderParts(bop.getOutput());
             }
         }
-        return headers;
+        return Collections.emptySet();
     }
 }

Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/MustUnderstandInterceptor.java Thu Feb 25 16:11:29 2010
@@ -60,6 +60,12 @@
     }
 
     public void handleMessage(SoapMessage soapMessage) {
+        Set<QName> paramHeaders = HeaderUtil.getHeaderQNameInOperationParam(soapMessage);
+
+        if (soapMessage.getHeaders().isEmpty() && paramHeaders.isEmpty()) {
+            return;
+        }
+        
         SoapVersion soapVersion = soapMessage.getVersion();              
         Set<Header> mustUnderstandHeaders = new HashSet<Header>();
         Set<URI> serviceRoles = new HashSet<URI>();
@@ -67,7 +73,7 @@
         Set<Header> ultimateReceiverHeaders = new HashSet<Header>();
         Set<QName> mustUnderstandQNames = new HashSet<QName>();
 
-        initServiceSideInfo(mustUnderstandQNames, soapMessage, serviceRoles);
+        initServiceSideInfo(mustUnderstandQNames, soapMessage, serviceRoles, paramHeaders);
         buildMustUnderstandHeaders(mustUnderstandHeaders, soapMessage,
                                    serviceRoles, ultimateReceiverHeaders);
         
@@ -124,9 +130,7 @@
         }
     }
     private void initServiceSideInfo(Set<QName> mustUnderstandQNames, SoapMessage soapMessage,
-                    Set<URI> serviceRoles) {
-
-        Set<QName> paramHeaders = HeaderUtil.getHeaderQNameInOperationParam(soapMessage);
+                    Set<URI> serviceRoles, Set<QName> paramHeaders) {
 
         if (paramHeaders != null) {
             mustUnderstandQNames.addAll(paramHeaders);

Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapHeaderInterceptor.java Thu Feb 25 16:11:29 2010
@@ -65,7 +65,7 @@
             parameters = new MessageContentsList();
         }
 
-        BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
+        BindingOperationInfo bop = exchange.getBindingOperationInfo();
         if (null == bop) {
             return;
         }

Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/interceptor/SoapPreProtocolOutInterceptor.java Thu Feb 25 16:11:29 2010
@@ -97,7 +97,7 @@
     }
     
     private void setSoapAction(SoapMessage message) {
-        BindingOperationInfo boi = message.getExchange().get(BindingOperationInfo.class);
+        BindingOperationInfo boi = message.getExchange().getBindingOperationInfo();
         
         // The soap action is set on the wrapped operation.
         if (boi != null && boi.isUnwrapped()) {

Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJInInterceptor.java Thu Feb 25 16:11:29 2010
@@ -110,6 +110,7 @@
             } else {
                 StaxUtils.copy(node, new W3CDOMStreamWriter(part));
             }
+            message.setContent(Node.class, soapMessage.getSOAPPart());
 
             Collection<Attachment> atts = message.getAttachments();
             if (atts != null) {

Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/main/java/org/apache/cxf/binding/soap/saaj/SAAJOutInterceptor.java Thu Feb 25 16:11:29 2010
@@ -36,6 +36,8 @@
 import javax.xml.stream.XMLStreamException;
 import javax.xml.stream.XMLStreamWriter;
 
+import org.w3c.dom.Node;
+
 
 import org.apache.cxf.attachment.AttachmentImpl;
 import org.apache.cxf.binding.soap.Soap11;
@@ -122,6 +124,7 @@
                 // Replace stax writer with DomStreamWriter
                 message.setContent(XMLStreamWriter.class, writer);
                 message.setContent(SOAPMessage.class, soapMessage);
+                message.setContent(Node.class, soapMessage.getSOAPPart());
                 
                 
             } catch (SOAPException e) {

Modified: cxf/branches/2.2.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java (original)
+++ cxf/branches/2.2.x-fixes/rt/bindings/soap/src/test/java/org/apache/cxf/binding/soap/SoapActionInterceptorTest.java Thu Feb 25 16:11:29 2010
@@ -64,18 +64,18 @@
         soapMessage = (SoapMessage) sb.createMessage(soapMessage);
         soapMessage.put(Message.REQUESTOR_ROLE, Boolean.TRUE);
         i.handleMessage(soapMessage);
-        String ct = (String) message.get(Message.CONTENT_TYPE);
+        String ct = (String) soapMessage.get(Message.CONTENT_TYPE);
         assertEquals("application/soap+xml", ct);
         
         BindingOperationInfo bop = createBindingOperation();
  
-        message.getExchange().put(BindingOperationInfo.class, bop);
+        soapMessage.getExchange().put(BindingOperationInfo.class, bop);
         SoapOperationInfo soapInfo = new SoapOperationInfo();
         soapInfo.setAction("foo");
         bop.addExtensor(soapInfo);
         
         i.handleMessage(soapMessage);
-        ct = (String) message.get(Message.CONTENT_TYPE);
+        ct = (String) soapMessage.get(Message.CONTENT_TYPE);
         assertEquals("application/soap+xml; action=\"foo\"", ct);
     }
 

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/clustering/FailoverTargetSelector.java Thu Feb 25 16:11:29 2010
@@ -19,10 +19,9 @@
 
 package org.apache.cxf.clustering;
 
-import java.io.IOException;
-import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
+import java.util.concurrent.ConcurrentHashMap;
 import java.util.logging.Level;
 import java.util.logging.Logger;
 
@@ -64,7 +63,7 @@
      */
     public FailoverTargetSelector(Conduit c) {
         super(c);
-        inProgress = new HashMap<InvocationKey, InvocationContext>();
+        inProgress = new ConcurrentHashMap<InvocationKey, InvocationContext>();
     }
     
     /**
@@ -78,7 +77,7 @@
         if (!inProgress.containsKey(key)) {
             Endpoint endpoint = exchange.get(Endpoint.class);
             BindingOperationInfo bindingOperationInfo =
-                exchange.get(BindingOperationInfo.class);
+                exchange.getBindingOperationInfo();
             Object[] params = message.getContent(List.class).toArray();
             Map<String, Object> context =
                 CastUtils.cast((Map)message.get(Message.INVOCATION_CONTEXT));
@@ -197,18 +196,18 @@
         Exception ex = outMessage.get(Exception.class) != null
                        ? outMessage.get(Exception.class)
                        : exchange.get(Exception.class);
-        getLogger().log(Level.INFO,
+        getLogger().log(Level.FINE,
                         "CHECK_LAST_INVOKE_FAILED",
                         new Object[] {ex != null});
         Throwable curr = ex;
         boolean failover = false;
         while (curr != null) {
-            getLogger().log(Level.WARNING,
-                            "CHECK_FAILURE_IN_TRANSPORT",
-                            new Object[] {ex, curr instanceof IOException});
             failover = curr instanceof java.io.IOException;
             curr = curr.getCause();
         }
+        getLogger().log(Level.INFO,
+                        "CHECK_FAILURE_IN_TRANSPORT",
+                        new Object[] {ex, failover});
         return failover;
     }
     

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/endpoint/ClientImpl.java Thu Feb 25 16:11:29 2010
@@ -596,7 +596,7 @@
 
     public void onMessage(Message message) {
 
-        Endpoint endpoint = message.getExchange().get(Endpoint.class);
+        Endpoint endpoint = message.getExchange().getEndpoint();
         if (endpoint == null) {
             // in this case correlation will occur outside the transport,
             // however there's a possibility that the endpoint may have been
@@ -858,19 +858,17 @@
         return getConduitSelector(null);
     }
 
-    protected final synchronized ConduitSelector getConduitSelector(
+    protected final ConduitSelector getConduitSelector(
         ConduitSelector override
     ) {
         if (null == conduitSelector) {
-            setConduitSelector(override != null
-                               ? override
-                               : new UpfrontConduitSelector());
+            setConduitSelector(override);
         }
         return conduitSelector;
     }
 
-    public final void setConduitSelector(ConduitSelector selector) {
-        conduitSelector = selector;
+    public final synchronized void setConduitSelector(ConduitSelector selector) {
+        conduitSelector = selector == null ? new UpfrontConduitSelector() : selector;
     }
 
     private boolean isPartialResponse(Message in) {

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractInDatabindingInterceptor.java Thu Feb 25 16:11:29 2010
@@ -89,7 +89,7 @@
                                                                    BUNDLE, service.getName()));
         }
         dataReader.setAttachments(message.getAttachments());
-        dataReader.setProperty(DataReader.ENDPOINT, message.getExchange().get(Endpoint.class));
+        dataReader.setProperty(DataReader.ENDPOINT, message.getExchange().getEndpoint());
         dataReader.setProperty(Message.class.getName(), message);
         setSchemaInMessage(service, message, dataReader);   
         return dataReader;
@@ -215,7 +215,7 @@
         QName interfaceQName = si.getInterface().getName();
         message.put(Message.WSDL_INTERFACE, interfaceQName);
 
-        EndpointInfo endpointInfo = ex.get(Endpoint.class).getEndpointInfo();
+        EndpointInfo endpointInfo = ex.getEndpoint().getEndpointInfo();
         QName portQName = endpointInfo.getName();
         message.put(Message.WSDL_PORT, portQName);
 

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/AbstractOutDatabindingInterceptor.java Thu Feb 25 16:11:29 2010
@@ -30,7 +30,6 @@
 import javax.xml.validation.Schema;
 
 import org.apache.cxf.databinding.DataWriter;
-import org.apache.cxf.endpoint.Endpoint;
 import org.apache.cxf.message.Attachment;
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.Message;
@@ -68,7 +67,7 @@
                               List<MessagePartInfo> parts) {
         OutputStream out = message.getContent(OutputStream.class);
         XMLStreamWriter origXmlWriter = message.getContent(XMLStreamWriter.class);
-        Service service = exchange.get(Service.class);
+        Service service = exchange.getService();
         XMLStreamWriter xmlWriter = origXmlWriter;
         CachingXmlEventWriter cache = null;
         
@@ -167,7 +166,7 @@
         }
         
         writer.setAttachments(atts);
-        writer.setProperty(DataWriter.ENDPOINT, message.getExchange().get(Endpoint.class));
+        writer.setProperty(DataWriter.ENDPOINT, message.getExchange().getEndpoint());
         writer.setProperty(Message.class.getName(), message);
         
         setSchemaOutMessage(service, message, writer);

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/DocLiteralInInterceptor.java Thu Feb 25 16:11:29 2010
@@ -67,7 +67,7 @@
         MessageContentsList parameters = new MessageContentsList();
 
         Exchange exchange = message.getExchange();
-        BindingOperationInfo bop = exchange.get(BindingOperationInfo.class);
+        BindingOperationInfo bop = exchange.getBindingOperationInfo();
 
         boolean client = isRequestor(message);
 

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FIStaxInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FIStaxInInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FIStaxInInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/FIStaxInInterceptor.java Thu Feb 25 16:11:29 2010
@@ -54,7 +54,7 @@
     }
 
     public void handleMessage(Message message) {
-        if (message.getContentFormats().contains(XMLStreamReader.class)
+        if (message.getContent(XMLStreamReader.class) != null
             || !isHttpVerbSupported(message)) {
             return;
         }
@@ -72,7 +72,7 @@
             if (isRequestor(message)) {
                 //record the fact that is worked so future requests will 
                 //automatically be FI enabled
-                Endpoint ep = message.getExchange().get(Endpoint.class);
+                Endpoint ep = message.getExchange().getEndpoint();
                 ep.put(FIStaxOutInterceptor.FI_ENABLED, Boolean.TRUE);
             }
         }

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/StaxInInterceptor.java Thu Feb 25 16:11:29 2010
@@ -57,7 +57,7 @@
     }
 
     public void handleMessage(Message message) {
-        if (isGET(message) || message.getContentFormats().contains(XMLStreamReader.class)) {
+        if (isGET(message) || message.getContent(XMLStreamReader.class) != null) {
             LOG.fine("StaxInInterceptor skipped.");
             return;
         }

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/interceptor/WrappedOutInterceptor.java Thu Feb 25 16:11:29 2010
@@ -49,7 +49,7 @@
     }
 
     public void handleMessage(Message message) {
-        BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
+        BindingOperationInfo bop = message.getExchange().getBindingOperationInfo();
 
         if (bop != null && bop.isUnwrapped()) {
             XMLStreamWriter xmlWriter = message.getContent(XMLStreamWriter.class);

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/transport/ChainInitiationObserver.java Thu Feb 25 16:11:29 2010
@@ -74,6 +74,7 @@
             Exchange exchange = message.getExchange();
             if (exchange == null) {
                 exchange = new ExchangeImpl();
+                m.setExchange(exchange);
             }
             exchange.setInMessage(message);
             setExchangeProperties(exchange, message);

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxrs/src/test/java/org/apache/cxf/jaxrs/utils/JAXRSUtilsTest.java Thu Feb 25 16:11:29 2010
@@ -1401,6 +1401,10 @@
         m.setExchange(e);
         e.setInMessage(m);
         Endpoint endpoint = EasyMock.createMock(Endpoint.class);
+        endpoint.getEndpointInfo();
+        EasyMock.expectLastCall().andReturn(null).anyTimes();
+        endpoint.size();
+        EasyMock.expectLastCall().andReturn(0).anyTimes();
         endpoint.get(ProviderFactory.class.getName());
         EasyMock.expectLastCall().andReturn(factory).anyTimes();
         EasyMock.replay(endpoint);

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/ServiceImpl.java Thu Feb 25 16:11:29 2010
@@ -455,6 +455,7 @@
         List<Handler> hc = jaxwsEndpoint.getJaxwsBinding().getHandlerChain();
         
         hc.addAll(handlerResolver.getHandlerChain(portInfos.get(portName)));
+        jaxwsEndpoint.getJaxwsBinding().setHandlerChain(hc);
 
         LOG.log(Level.FINE, "created proxy", obj);
 

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/AbstractBindingImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/AbstractBindingImpl.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/AbstractBindingImpl.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/AbstractBindingImpl.java Thu Feb 25 16:11:29 2010
@@ -25,15 +25,29 @@
 import javax.xml.ws.Binding;
 import javax.xml.ws.handler.Handler;
 
+import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
+
 public abstract class AbstractBindingImpl implements Binding {
     private List<Handler> handlerChain = new ArrayList<Handler>();
+    private final JaxWsEndpointImpl endpoint;
+    
+    public AbstractBindingImpl(JaxWsEndpointImpl imp) {
+        endpoint = imp;
+    }
+    
     
     public List<Handler> getHandlerChain() {
-        return handlerChain;
+        //per spec, this should be a copy
+        return new ArrayList<Handler>(handlerChain);
     }
 
     public void setHandlerChain(List<Handler> hc) {
         handlerChain = hc;
+        if (handlerChain == null || handlerChain.isEmpty()) {
+            endpoint.removeHandlerInterceptors();
+        } else {
+            endpoint.addHandlerInterceptors();
+        }
     }
 
     public abstract String getBindingID();

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/DefaultBindingImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/DefaultBindingImpl.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/DefaultBindingImpl.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/DefaultBindingImpl.java Thu Feb 25 16:11:29 2010
@@ -19,7 +19,13 @@
 
 package org.apache.cxf.jaxws.binding;
 
+import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
+
 public class DefaultBindingImpl extends AbstractBindingImpl {
+    public DefaultBindingImpl(JaxWsEndpointImpl endpoint) {
+        super(endpoint);
+    }
+    
     public String getBindingID() {
         //DefaultBindingImpl should not be used, though JBI binding and
         //some other bindings did not implement their own Binding.

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/http/HTTPBindingImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/http/HTTPBindingImpl.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/http/HTTPBindingImpl.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/http/HTTPBindingImpl.java Thu Feb 25 16:11:29 2010
@@ -27,11 +27,13 @@
 import javax.xml.ws.http.HTTPBinding;
 
 import org.apache.cxf.jaxws.binding.AbstractBindingImpl;
+import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
 import org.apache.cxf.service.model.BindingInfo;
 
 public class HTTPBindingImpl extends AbstractBindingImpl implements HTTPBinding {
         
-    public HTTPBindingImpl(BindingInfo sb) {       
+    public HTTPBindingImpl(BindingInfo sb, JaxWsEndpointImpl ep) {
+        super(ep);
     }
     
     public String getBindingID() {

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/SOAPBindingImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/SOAPBindingImpl.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/SOAPBindingImpl.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/binding/soap/SOAPBindingImpl.java Thu Feb 25 16:11:29 2010
@@ -36,6 +36,7 @@
 import org.apache.cxf.binding.soap.model.SoapBindingInfo;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.jaxws.binding.AbstractBindingImpl;
+import org.apache.cxf.jaxws.support.JaxWsEndpointImpl;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.service.model.BindingInfo;
 
@@ -47,7 +48,8 @@
     private BindingInfo soapBinding;
     private Set<String> roles;
 
-    public SOAPBindingImpl(BindingInfo sb) {
+    public SOAPBindingImpl(BindingInfo sb, JaxWsEndpointImpl endpoint) {
+        super(endpoint);
         soapBinding = sb;  
         addRequiredRoles();
     }

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractJAXWSHandlerInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractJAXWSHandlerInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractJAXWSHandlerInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractJAXWSHandlerInterceptor.java Thu Feb 25 16:11:29 2010
@@ -30,7 +30,7 @@
 import org.apache.cxf.service.model.ServiceModelUtil;
 
 public abstract class AbstractJAXWSHandlerInterceptor<T extends Message> extends AbstractPhaseInterceptor<T> {
-    private Binding binding;
+    protected Binding binding;
     
     protected AbstractJAXWSHandlerInterceptor(Binding b, String phase) {
         super(phase);

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptor.java Thu Feb 25 16:11:29 2010
@@ -39,6 +39,9 @@
     }
     
     public void handleMessage(T message) {
+        if (binding.getHandlerChain().isEmpty()) {
+            return;
+        }
         MessageContext context = createProtocolMessageContext(message);
         HandlerChainInvoker invoker = getInvoker(message);
         invoker.setProtocolMessageContext(context);

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultInInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultInInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultInInterceptor.java Thu Feb 25 16:11:29 2010
@@ -37,6 +37,9 @@
     }
 
     public void handleMessage(T message) {
+        if (binding.getHandlerChain().isEmpty()) {
+            return;
+        }
         HandlerChainInvoker invoker = getInvoker(message);
         if (invoker.getLogicalHandlers().isEmpty()) {
             return;

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerFaultOutInterceptor.java Thu Feb 25 16:11:29 2010
@@ -58,6 +58,9 @@
     }
     
     public void handleMessage(T message) throws Fault {
+        if (binding.getHandlerChain().isEmpty()) {
+            return;
+        }
         HandlerChainInvoker invoker = getInvoker(message);
         if (invoker.getLogicalHandlers().isEmpty()) {
             return;

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerInInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerInInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerInInterceptor.java Thu Feb 25 16:11:29 2010
@@ -50,6 +50,9 @@
     }
 
     public void handleMessage(T message) {
+        if (binding.getHandlerChain().isEmpty()) {
+            return;
+        }
         HandlerChainInvoker invoker = getInvoker(message);
         if (invoker.getLogicalHandlers().isEmpty()) {
             return;

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/logical/LogicalHandlerOutInterceptor.java Thu Feb 25 16:11:29 2010
@@ -60,6 +60,9 @@
     }
     
     public void handleMessage(T message) throws Fault {
+        if (binding.getHandlerChain().isEmpty()) {
+            return;
+        }
         HandlerChainInvoker invoker = getInvoker(message);
         if (invoker.getLogicalHandlers().isEmpty()) {
             return;

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultInInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultInInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultInInterceptor.java Thu Feb 25 16:11:29 2010
@@ -70,6 +70,9 @@
     }
 
     public void handleMessage(SoapMessage message) {
+        if (binding.getHandlerChain().isEmpty()) {
+            return;
+        }
         if (getInvoker(message).getProtocolHandlers().isEmpty()) {
             return;
         }

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerFaultOutInterceptor.java Thu Feb 25 16:11:29 2010
@@ -89,6 +89,9 @@
     }
 
     public void handleMessage(SoapMessage message) {
+        if (binding.getHandlerChain().isEmpty()) {
+            return;
+        }
         if (getInvoker(message).getProtocolHandlers().isEmpty()) {
             return;
         }

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/handler/soap/SOAPHandlerInterceptor.java Thu Feb 25 16:11:29 2010
@@ -106,6 +106,9 @@
     }
 
     public void handleMessage(SoapMessage message) {
+        if (binding.getHandlerChain().isEmpty()) {
+            return;
+        }
         if (getInvoker(message).getProtocolHandlers().isEmpty()) {
             return;
         }
@@ -283,6 +286,9 @@
     }
 
     public void handleFault(SoapMessage message) {
+        if (binding.getHandlerChain().isEmpty()) {
+            return;
+        }
         if (getInvoker(message).getProtocolHandlers().isEmpty()) {
             return;
         }

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderInInterceptor.java Thu Feb 25 16:11:29 2010
@@ -47,7 +47,7 @@
 
         Exchange exchange = message.getExchange();
         
-        OperationInfo op = exchange.get(OperationInfo.class);
+        OperationInfo op = exchange.getBindingOperationInfo().getOperationInfo();
         if (op == null || !op.hasOutput() || op.getOutput().size() == 0) {
             return;
         }

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/HolderOutInterceptor.java Thu Feb 25 16:11:29 2010
@@ -49,7 +49,9 @@
     public void handleMessage(Message message) throws Fault {
         MessageContentsList outObjects = MessageContentsList.getContentsList(message);
         Exchange exchange = message.getExchange();
-        OperationInfo op = exchange.get(OperationInfo.class);
+        OperationInfo op = exchange.getBindingOperationInfo() == null 
+            ? null
+                : exchange.getBindingOperationInfo().getOperationInfo();
         
         if (LOG.isLoggable(Level.FINE)) {
             LOG.fine("op: " + op);

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAInInterceptor.java Thu Feb 25 16:11:29 2010
@@ -46,7 +46,7 @@
     }
 
     public void handleMessage(SoapMessage message) throws Fault {
-        BindingOperationInfo bop = message.getExchange().get(BindingOperationInfo.class);
+        BindingOperationInfo bop = message.getExchange().getBindingOperationInfo();
         if (bop == null) {
             return;
         }

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/SwAOutInterceptor.java Thu Feb 25 16:11:29 2010
@@ -99,7 +99,7 @@
 
     public void handleMessage(SoapMessage message) throws Fault {
         Exchange ex = message.getExchange();
-        BindingOperationInfo bop = ex.get(BindingOperationInfo.class);
+        BindingOperationInfo bop = ex.getBindingOperationInfo();
         if (bop == null) {
             return;
         }
@@ -118,7 +118,7 @@
         SoapBodyInfo sbi = bmi.getExtensor(SoapBodyInfo.class);
         
         if (sbi == null || sbi.getAttachments() == null || sbi.getAttachments().size() == 0) {
-            Service s = ex.get(Service.class);
+            Service s = ex.getService();
             DataBinding db = s.getDataBinding();
             if (db instanceof JAXBDataBinding
                 && hasSwaRef((JAXBDataBinding) db)) {

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassInInterceptor.java Thu Feb 25 16:11:29 2010
@@ -54,7 +54,7 @@
 
     public void handleMessage(Message message) throws Fault {
         Exchange ex = message.getExchange();
-        BindingOperationInfo boi = ex.get(BindingOperationInfo.class);
+        BindingOperationInfo boi = ex.getBindingOperationInfo();
         if (Boolean.TRUE.equals(message.get(Message.PARTIAL_RESPONSE_MESSAGE)) 
             || boi == null) {
             return;

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/interceptors/WrapperClassOutInterceptor.java Thu Feb 25 16:11:29 2010
@@ -48,7 +48,7 @@
 
     public void handleMessage(Message message) throws Fault {
         Exchange ex = message.getExchange();
-        BindingOperationInfo bop = ex.get(BindingOperationInfo.class);
+        BindingOperationInfo bop = ex.getBindingOperationInfo();
 
         MessageInfo messageInfo = message.get(MessageInfo.class);
         if (messageInfo == null || bop == null || !bop.isUnwrapped()) {

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/main/java/org/apache/cxf/jaxws/support/JaxWsEndpointImpl.java Thu Feb 25 16:11:29 2010
@@ -83,6 +83,15 @@
     private List<WebServiceFeature> wsFeatures;
     private List<AbstractFeature> features;
     
+    //interceptors added/removed to chains as needed
+    private SOAPHandlerInterceptor soapHandlerInterceptor;
+    private LogicalHandlerInInterceptor logicalInInterceptor;
+    private LogicalHandlerOutInterceptor logicalOutInterceptor;
+    private LogicalHandlerFaultOutInterceptor logicalFaultOutInterceptor;
+    private SOAPHandlerFaultOutInterceptor soapFaultOutInterceptor;
+    private LogicalHandlerFaultInInterceptor logicalFaultInInterceptor;
+    private SOAPHandlerFaultInInterceptor soapFaultInInterceptor;
+    
     public JaxWsEndpointImpl(Bus bus, Service s, EndpointInfo ei) throws EndpointException {
         this(bus, s, ei, null, null, null, true);
     }
@@ -117,13 +126,13 @@
         }
 
         // Inbound chain
-        in.add(new LogicalHandlerInInterceptor(jaxwsBinding));
+        logicalInInterceptor = new LogicalHandlerInInterceptor(jaxwsBinding);
         if (!isProvider) {
             in.add(new WrapperClassInInterceptor());
             in.add(new HolderInInterceptor());
         }
         if (getBinding() instanceof SoapBinding) {
-            in.add(new SOAPHandlerInterceptor(jaxwsBinding));
+            soapHandlerInterceptor = new SOAPHandlerInterceptor(jaxwsBinding);
             in.add(new SwAInInterceptor());
             getOutInterceptors().add(new SwAOutInterceptor());
             if (isProvider && mode == Mode.MESSAGE) {
@@ -135,38 +144,28 @@
         }
 
         // Outbound chain
-        out.add(new LogicalHandlerOutInterceptor(jaxwsBinding));
+        logicalOutInterceptor = new LogicalHandlerOutInterceptor(jaxwsBinding);
         if (!isProvider) {
             out.add(new WrapperClassOutInterceptor());
             out.add(new HolderOutInterceptor());
         }
-        if (getBinding() instanceof SoapBinding) {
-            out.add(new SOAPHandlerInterceptor(jaxwsBinding));
-            if (mode == Mode.MESSAGE) {
-                SAAJOutInterceptor saajOut = new SAAJOutInterceptor();
-                out.add(saajOut);
-                out.add(new MessageModeOutInterceptor(saajOut,
-                                                      getBinding().getBindingInfo().getName()));
-            }
+        if (getBinding() instanceof SoapBinding && mode == Mode.MESSAGE) {
+            SAAJOutInterceptor saajOut = new SAAJOutInterceptor();
+            out.add(saajOut);
+            out.add(new MessageModeOutInterceptor(saajOut,
+                                                  getBinding().getBindingInfo().getName()));
         } else if (isProvider) {
             out.add(new MessageModeOutInterceptor(clazz, getBinding().getBindingInfo().getName()));
         }
+
+        logicalFaultOutInterceptor = new LogicalHandlerFaultOutInterceptor(jaxwsBinding);
+        logicalFaultInInterceptor = new LogicalHandlerFaultInInterceptor(jaxwsBinding);
         
-        //Outbound fault chain
-        List<Interceptor> outFault = super.getOutFaultInterceptors();    
-        outFault.add(new LogicalHandlerFaultOutInterceptor(jaxwsBinding));
         if (getBinding() instanceof SoapBinding) {
-            outFault.add(new SOAPHandlerFaultOutInterceptor(jaxwsBinding));
+            soapFaultOutInterceptor = new SOAPHandlerFaultOutInterceptor(jaxwsBinding);
+            soapFaultInInterceptor = new SOAPHandlerFaultInInterceptor(jaxwsBinding);
         }
 
-        //Inbound fault chain
-        List<Interceptor> inFault = super.getInFaultInterceptors(); 
-        inFault.add(new LogicalHandlerFaultInInterceptor(jaxwsBinding));
-        if (getBinding() instanceof SoapBinding) {
-            inFault.add(new SOAPHandlerFaultInInterceptor(jaxwsBinding));
-        }
-        
-        
         if (ei != null) {
             if (!isFromWsdl) {
                 buildWsdlExtensibilities(ei.getBinding());
@@ -325,18 +324,60 @@
     
     final void createJaxwsBinding() {
         if (getBinding() instanceof SoapBinding) {
-            jaxwsBinding = new SOAPBindingImpl(getEndpointInfo().getBinding());
+            jaxwsBinding = new SOAPBindingImpl(getEndpointInfo().getBinding(), this);
             MTOMFeature mtomFeature = getMTOMFeature();
             if (mtomFeature != null && mtomFeature.isEnabled()) {
                 ((SOAPBinding)jaxwsBinding).setMTOMEnabled(true);
             }
         } else if (getBinding() instanceof XMLBinding) {
-            jaxwsBinding = new HTTPBindingImpl(getEndpointInfo().getBinding());
+            jaxwsBinding = new HTTPBindingImpl(getEndpointInfo().getBinding(), this);
         } else {
             //REVISIT: Should not get here, though some bindings like JBI
             //did not implement their own Binding type.
-            jaxwsBinding = new DefaultBindingImpl();
-           
+            jaxwsBinding = new DefaultBindingImpl(this);
+        }
+    }
+
+    public void addHandlerInterceptors() {
+        List<Interceptor> in = super.getInInterceptors();       
+        List<Interceptor> out = super.getOutInterceptors();
+        List<Interceptor> outFault = super.getOutFaultInterceptors();    
+        List<Interceptor> inFault = super.getInFaultInterceptors(); 
+        
+        in.add(logicalInInterceptor);
+        out.add(logicalOutInterceptor);
+        inFault.add(logicalFaultInInterceptor);
+        outFault.add(logicalFaultOutInterceptor);
+        if (soapHandlerInterceptor != null) {
+            in.add(soapHandlerInterceptor);
+            out.add(soapHandlerInterceptor);
+        }
+        if (soapFaultInInterceptor != null) {
+            inFault.add(soapFaultInInterceptor);
+        }
+        if (soapFaultOutInterceptor != null) {
+            outFault.add(soapFaultOutInterceptor);
+        }
+    }
+    public void removeHandlerInterceptors() {
+        List<Interceptor> in = super.getInInterceptors();       
+        List<Interceptor> out = super.getOutInterceptors();
+        List<Interceptor> outFault = super.getOutFaultInterceptors();    
+        List<Interceptor> inFault = super.getInFaultInterceptors(); 
+        
+        in.remove(logicalInInterceptor);
+        out.remove(logicalOutInterceptor);
+        inFault.remove(logicalFaultInInterceptor);
+        outFault.remove(logicalFaultOutInterceptor);
+        if (soapHandlerInterceptor != null) {
+            in.remove(soapHandlerInterceptor);
+            out.remove(soapHandlerInterceptor);
+        }
+        if (soapFaultInInterceptor != null) {
+            inFault.remove(soapFaultInInterceptor);
+        }
+        if (soapFaultOutInterceptor != null) {
+            outFault.remove(soapFaultOutInterceptor);
         }
     }
 }

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/ConfiguredEndpointTest.java Thu Feb 25 16:11:29 2010
@@ -290,19 +290,19 @@
         assertTrue("Unexpected value for property validating", 
                    Boolean.valueOf((String) ei.getProperties().get(Message.SCHEMA_VALIDATION_ENABLED)));
         List<Interceptor> interceptors = endpoint.getInInterceptors();
-        assertEquals("Unexpected number of interceptors.", 6, interceptors.size());
+        assertEquals("Unexpected number of interceptors.", 4, interceptors.size());
         assertEquals("Unexpected interceptor id.", "endpoint-in", 
                      findTestInterceptor(interceptors).getId());
         interceptors = endpoint.getOutInterceptors();
-        assertEquals("Unexpected number of interceptors.", 7, interceptors.size());
+        assertEquals("Unexpected number of interceptors.", 5, interceptors.size());
         assertEquals("Unexpected interceptor id.", "endpoint-out", 
                      findTestInterceptor(interceptors).getId());
         interceptors = endpoint.getInFaultInterceptors();
-        assertEquals("Unexpected number of interceptors.", 4, interceptors.size());
+        assertEquals("Unexpected number of interceptors.", 2, interceptors.size());
         assertEquals("Unexpected interceptor id.", "endpoint-in-fault", 
                      findTestInterceptor(interceptors).getId());
         interceptors = endpoint.getOutFaultInterceptors();
-        assertEquals("Unexpected number of interceptors.", 4, interceptors.size());
+        assertEquals("Unexpected number of interceptors.", 2, interceptors.size());
         assertEquals("Unexpected interceptor id.", "endpoint-out-fault", 
                      findTestInterceptor(interceptors).getId());
         

Modified: cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptorTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptorTest.java?rev=916335&r1=916334&r2=916335&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptorTest.java (original)
+++ cxf/branches/2.2.x-fixes/rt/frontend/jaxws/src/test/java/org/apache/cxf/jaxws/handler/AbstractProtocolHandlerInterceptorTest.java Thu Feb 25 16:11:29 2010
@@ -19,6 +19,9 @@
 
 package org.apache.cxf.jaxws.handler;
 
+import java.util.ArrayList;
+import java.util.List;
+
 import javax.xml.ws.Binding;
 import javax.xml.ws.handler.Handler;
 import javax.xml.ws.handler.MessageContext;
@@ -51,7 +54,11 @@
         invoker = control.createMock(HandlerChainInvoker.class);
         message = control.createMock(IIOPMessage.class);
         exchange = control.createMock(Exchange.class);
+        binding = control.createMock(Binding.class);
         
+        List<Handler> list = new ArrayList<Handler>();
+        list.add(null);
+        expect(binding.getHandlerChain()).andReturn(list).anyTimes();
     }
     
     @After