servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ff...@apache.org
Subject svn commit: r906350 - in /servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc: CxfBcProvider.java CxfBcProviderMessageObserver.java
Date Thu, 04 Feb 2010 03:56:44 GMT
Author: ffang
Date: Thu Feb  4 03:56:43 2010
New Revision: 906350

URL: http://svn.apache.org/viewvc?rev=906350&view=rev
Log:
[SMXCOMP-706]Poor interceptor chain management and memory leak in CxfBc

Modified:
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
    servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java?rev=906350&r1=906349&r2=906350&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProvider.java
Thu Feb  4 03:56:43 2010
@@ -83,7 +83,6 @@
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.ExchangeImpl;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.phase.PhaseChainCache;
 import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.phase.PhaseManager;
 import org.apache.cxf.service.Service;
@@ -208,14 +207,12 @@
         cxfExchange.put(Endpoint.class, ep);
         cxfExchange.put(Service.class, cxfService);
         cxfExchange.put(Bus.class, getBus());
-        PhaseChainCache outboundChainCache = new PhaseChainCache();
         PhaseManager pm = getBus().getExtension(PhaseManager.class);
         List<Interceptor> outList = new ArrayList<Interceptor>();
         if (isMtomEnabled()) {
             outList.add(new JbiOutInterceptor());
             outList.add(new MtomCheckInterceptor(true));
             outList.add(new AttachmentOutInterceptor());
-
         }
          
         outList.add(new JbiOutInterceptor());
@@ -229,15 +226,13 @@
         outList.add(new StaxOutInterceptor());
         
         
-        getInInterceptors().addAll(getBus().getInInterceptors());
-        getInFaultInterceptors().addAll(getBus().getInFaultInterceptors());
-        getOutInterceptors().addAll(getBus().getOutInterceptors());
-        getOutFaultInterceptors()
-                .addAll(getBus().getOutFaultInterceptors());
-        PhaseInterceptorChain outChain = outboundChainCache.get(pm
-                .getOutPhases(), outList);
+        PhaseInterceptorChain outChain = new PhaseInterceptorChain(pm.getOutPhases());
+        outChain.add(outList);
+        outChain.add(getBus().getOutInterceptors());
+        outChain.add(getBus().getOutFaultInterceptors());
         outChain.add(getOutInterceptors());
         outChain.add(getOutFaultInterceptors());
+
         message.setInterceptorChain(outChain);
         InputStream is = convertMessageToInputStream(nm
                 .getContent());

Modified: servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
URL: http://svn.apache.org/viewvc/servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java?rev=906350&r1=906349&r2=906350&view=diff
==============================================================================
--- servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
(original)
+++ servicemix/components/bindings/servicemix-cxf-bc/trunk/src/main/java/org/apache/servicemix/cxfbc/CxfBcProviderMessageObserver.java
Thu Feb  4 03:56:43 2010
@@ -47,7 +47,6 @@
 import org.apache.cxf.message.Exchange;
 import org.apache.cxf.message.ExchangeImpl;
 import org.apache.cxf.message.Message;
-import org.apache.cxf.phase.PhaseChainCache;
 import org.apache.cxf.phase.PhaseInterceptorChain;
 import org.apache.cxf.phase.PhaseManager;
 import org.apache.cxf.service.model.BindingOperationInfo;
@@ -110,7 +109,6 @@
             
             // create Interceptor chain
 
-            PhaseChainCache inboundChainCache = new PhaseChainCache();
             PhaseManager pm = providerEndpoint.getBus().getExtension(
                     PhaseManager.class);
             List<Interceptor> inList = new ArrayList<Interceptor>();
@@ -124,8 +122,9 @@
                         this.providerEndpoint.isUseSOAPEnvelope()));
             }
             inList.add(new AttachmentInInterceptor());
-            PhaseInterceptorChain inChain = inboundChainCache.get(pm
-                    .getInPhases(), inList);
+            PhaseInterceptorChain inChain = new PhaseInterceptorChain(pm.getInPhases());
+            inChain.add(providerEndpoint.getBus().getInInterceptors());
+            inChain.add(inList);
             inChain.add(providerEndpoint.getInInterceptors());
             soapMessage.setInterceptorChain(inChain);
             inChain.doIntercept(soapMessage);



Mime
View raw message