cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject git commit: CXF-5576: Initital support for CDI integration. Added support for bus injection inside CXFCdiServlet.
Date Sun, 23 Mar 2014 16:57:10 GMT
Repository: cxf
Updated Branches:
  refs/heads/master 0b21c66dc -> 869b0807b


CXF-5576: Initital support for CDI integration. Added support for bus injection inside CXFCdiServlet.


Project: http://git-wip-us.apache.org/repos/asf/cxf/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf/commit/869b0807
Tree: http://git-wip-us.apache.org/repos/asf/cxf/tree/869b0807
Diff: http://git-wip-us.apache.org/repos/asf/cxf/diff/869b0807

Branch: refs/heads/master
Commit: 869b0807bd298a6e65e0a77b6ac8d26a34ac18b4
Parents: 0b21c66
Author: reta <drreta@gmail.com>
Authored: Sun Mar 23 12:56:59 2014 -0400
Committer: reta <drreta@gmail.com>
Committed: Sun Mar 23 12:56:59 2014 -0400

----------------------------------------------------------------------
 .../cdi/src/main/java/org/apache/cxf/cdi/CXFCdiServlet.java   | 7 +++++++
 .../cxf/systest/jaxrs/cdi/jetty/AbstractJettyServer.java      | 3 +++
 2 files changed, 10 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/869b0807/integration/cdi/src/main/java/org/apache/cxf/cdi/CXFCdiServlet.java
----------------------------------------------------------------------
diff --git a/integration/cdi/src/main/java/org/apache/cxf/cdi/CXFCdiServlet.java b/integration/cdi/src/main/java/org/apache/cxf/cdi/CXFCdiServlet.java
index be93b8a..389f201 100644
--- a/integration/cdi/src/main/java/org/apache/cxf/cdi/CXFCdiServlet.java
+++ b/integration/cdi/src/main/java/org/apache/cxf/cdi/CXFCdiServlet.java
@@ -23,6 +23,7 @@ import java.util.Set;
 import javax.enterprise.inject.spi.Bean;
 import javax.enterprise.inject.spi.BeanManager;
 import javax.enterprise.inject.spi.CDI;
+import javax.inject.Inject;
 import javax.servlet.ServletConfig;
 
 import org.apache.cxf.Bus;
@@ -36,9 +37,15 @@ public class CXFCdiServlet extends CXFNonSpringServlet {
     private static final long serialVersionUID = -2890970731778523861L;
     private boolean busCreated;
     
+    @Override @Inject
+    public void setBus(final Bus bus) {
+        super.setBus(bus);
+    }
+    
     @Override
     protected void loadBus(ServletConfig servletConfig) {
         Bus bus = null;
+        
         final BeanManager beanManager = CDI.current().getBeanManager();        
         if (beanManager != null) {
             final Set< Bean< ? > > candidates = beanManager.getBeans(CdiBusBean.CXF);

http://git-wip-us.apache.org/repos/asf/cxf/blob/869b0807/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/AbstractJettyServer.java
----------------------------------------------------------------------
diff --git a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/AbstractJettyServer.java
b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/AbstractJettyServer.java
index 0023934..4f8cea3 100644
--- a/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/AbstractJettyServer.java
+++ b/systests/cdi/src/test/java/org/apache/cxf/systest/jaxrs/cdi/jetty/AbstractJettyServer.java
@@ -72,6 +72,9 @@ public abstract class AbstractJettyServer extends AbstractBusTestServerBase
{
                 final WebAppContext context = new WebAppContext();
                 context.setContextPath(contextPath);
                 context.setWar(getClass().getResource(resourcePath).toURI().getPath());
+                context.setServerClasses(new String[] {
+                    "org.eclipse.jetty.servlet.ServletContextHandler.Decorator"
+                });
         
                 HandlerCollection handlers = new HandlerCollection();
                 handlers.setHandlers(new Handler[] {context, new DefaultHandler()});


Mime
View raw message