cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r703309 - in /cxf/trunk/rt: core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Date Fri, 10 Oct 2008 01:28:47 GMT
Author: dkulp
Date: Thu Oct  9 18:28:47 2008
New Revision: 703309

URL: http://svn.apache.org/viewvc?rev=703309&view=rev
Log:
[CXF-1809] If springs CommonAnnotation thing is turned on, let it do the @Resource/@PostConstruct
stuff. 

Modified:
    cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java
    cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java

Modified: cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java?rev=703309&r1=703308&r2=703309&view=diff
==============================================================================
--- cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java
(original)
+++ cxf/trunk/rt/core/src/main/java/org/apache/cxf/bus/spring/Jsr250BeanPostProcessor.java
Thu Oct  9 18:28:47 2008
@@ -24,6 +24,9 @@
 import java.util.List;
 import java.util.Map;
 
+import javax.annotation.Resource;
+
+import org.apache.cxf.Bus;
 import org.apache.cxf.common.injection.ResourceInjector;
 import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.resource.ResourceManager;
@@ -42,9 +45,16 @@
     
     private ApplicationContext context;
 
+    private Bus bus;
+    
     Jsr250BeanPostProcessor() {
     }
     
+    @Resource
+    public void setBus(Bus b) {
+        bus = b;
+    }
+    
     public void setApplicationContext(ApplicationContext arg0) throws BeansException {
         context = arg0;    
     }
@@ -54,6 +64,9 @@
     }
         
     public Object postProcessAfterInitialization(Object bean, String beanId) throws BeansException
{
+        if (bus != null) {
+            return bean;
+        }
         if (bean != null) {
             new ResourceInjector(resourceManager, resolvers).construct(bean);
         }
@@ -69,6 +82,9 @@
     }
 
     public Object postProcessBeforeInitialization(Object bean, String beanId) throws BeansException
{
+        if (bus != null) {
+            return bean;
+        }
         if (bean != null) {
             new ResourceInjector(resourceManager, resolvers).inject(bean);
         }
@@ -76,6 +92,9 @@
     }
 
     public void postProcessBeforeDestruction(Object bean, String beanId) {
+        if (bus != null) {
+            return;
+        }
         if (bean != null) {
             new ResourceInjector(resourceManager, resolvers).destroy(bean);
         }

Modified: cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
URL: http://svn.apache.org/viewvc/cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java?rev=703309&r1=703308&r2=703309&view=diff
==============================================================================
--- cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
(original)
+++ cxf/trunk/rt/transports/http-jetty/src/main/java/org/apache/cxf/transport/http_jetty/JettyHTTPServerEngine.java
Thu Oct  9 18:28:47 2008
@@ -457,9 +457,10 @@
 
     protected void retrieveListenerFactory() {
         if (tlsServerParameters != null) {
-            if (null != connector && !(connector instanceof SslSocketConnector))
{                         
-                throw new RuntimeException("Connector " + connector + " for JettyServerEngine
Port " 
-                        + port + " does not support SSL connections.");                
+            if (null != connector && !(connector instanceof SslSocketConnector))
{
+                LOG.warning("Connector " + connector + " for JettyServerEngine Port " 
+                        + port + " does not support SSL connections.");
+                return;
             }
             connectorFactory = 
                 getHTTPSConnectorFactory(tlsServerParameters);            



Mime
View raw message