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/10/20 04:11:24 UTC

svn commit: r1024495 - in /cxf/branches/2.2.x-fixes: ./ rt/core/src/main/java/org/apache/cxf/bus/spring/ rt/core/src/main/java/org/apache/cxf/service/invoker/ rt/transports/http/src/main/java/org/apache/cxf/transport/http/

Author: dkulp
Date: Wed Oct 20 02:11:24 2010
New Revision: 1024495

URL: http://svn.apache.org/viewvc?rev=1024495&view=rev
Log:
Port some session fixes from 2.3

Modified:
    cxf/branches/2.2.x-fixes/   (props changed)
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/FactoryInvoker.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/SessionFactory.java
    cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/SpringBeanFactory.java
    cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPSession.java

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

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java?rev=1024495&r1=1024494&r2=1024495&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/bus/spring/BusExtensionPostProcessor.java Wed Oct 20 02:11:24 2010
@@ -60,7 +60,7 @@ public class BusExtensionPostProcessor i
     private Bus getBus() {
         if (bus == null) {
             bus = (Bus)context.getBean(Bus.DEFAULT_BUS_ID);
-            
+            bus.setExtension(context, ApplicationContext.class);
             final ApplicationContext ctx = context;
             if (bus instanceof CXFBusImpl) {
                 CXFBusImpl b = (CXFBusImpl)bus;

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/FactoryInvoker.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/FactoryInvoker.java?rev=1024495&r1=1024494&r2=1024495&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/FactoryInvoker.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/FactoryInvoker.java Wed Oct 20 02:11:24 2010
@@ -33,7 +33,7 @@ import org.apache.cxf.message.Exchange;
 public class FactoryInvoker extends AbstractInvoker {
     private static final ResourceBundle BUNDLE = BundleUtils.getBundle(FactoryInvoker.class);
 
-    private final Factory factory;
+    private Factory factory;
 
     /**
      * Create a FactoryInvoker object.
@@ -43,6 +43,11 @@ public class FactoryInvoker extends Abst
     public FactoryInvoker(Factory factory) {
         this.factory = factory;
     }
+    public FactoryInvoker() {
+    }
+    public void setFactory(Factory f) {
+        this.factory = f;
+    }
 
     public Object getServiceObject(Exchange ex) {
         try {

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/SessionFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/SessionFactory.java?rev=1024495&r1=1024494&r2=1024495&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/SessionFactory.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/SessionFactory.java Wed Oct 20 02:11:24 2010
@@ -42,10 +42,10 @@ public class SessionFactory implements F
         Service serv = e.get(Service.class);
         Object o = null;
         synchronized (serv) {
-            o = e.getSession().get(serv.getName());
+            o = e.getSession().get(serv.getName().toString());
             if (o == null) {
                 o = factory.create(e);
-                e.getSession().put(serv.getName(), o);
+                e.getSession().put(serv.getName().toString(), o);
             }
         }
         return o;

Modified: cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/SpringBeanFactory.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/SpringBeanFactory.java?rev=1024495&r1=1024494&r2=1024495&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/SpringBeanFactory.java (original)
+++ cxf/branches/2.2.x-fixes/rt/core/src/main/java/org/apache/cxf/service/invoker/SpringBeanFactory.java Wed Oct 20 02:11:24 2010
@@ -43,6 +43,9 @@ public class SpringBeanFactory implement
     
     /** {@inheritDoc}*/
     public Object create(Exchange e) throws Throwable {
+        if (ctx == null) {
+            ctx = e.getBus().getExtension(ApplicationContext.class);
+        }
         return ctx.getBean(beanName);
     }
 

Modified: cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPSession.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPSession.java?rev=1024495&r1=1024494&r2=1024495&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPSession.java (original)
+++ cxf/branches/2.2.x-fixes/rt/transports/http/src/main/java/org/apache/cxf/transport/http/HTTPSession.java Wed Oct 20 02:11:24 2010
@@ -39,11 +39,11 @@ public class HTTPSession implements Sess
     }
 
     public Object get(Object key) {
-        return getSession().getAttribute((String)key);
+        return getSession().getAttribute(key.toString());
     }
 
     public void put(Object key, Object value) {
-        getSession().setAttribute((String)key, value);
+        getSession().setAttribute(key.toString(), value);
     }
 
     public HttpSession getSession() {