cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ashaki...@apache.org
Subject git commit: Backported [CXF-5879]: Distinguishing client or service in FactoryBeanListener
Date Tue, 15 Jul 2014 08:33:02 GMT
Repository: cxf
Updated Branches:
  refs/heads/2.7.x-fixes 7fc13a021 -> 0bf7ead59


Backported [CXF-5879]: Distinguishing client or service in FactoryBeanListener


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

Branch: refs/heads/2.7.x-fixes
Commit: 0bf7ead591ad4a751e7e9770afa29058b1d54df6
Parents: 7fc13a0
Author: Andrei Shakirin <andrei.shakirin@gmail.com>
Authored: Tue Jul 15 10:32:44 2014 +0200
Committer: Andrei Shakirin <andrei.shakirin@gmail.com>
Committed: Tue Jul 15 10:32:44 2014 +0200

----------------------------------------------------------------------
 .../apache/cxf/service/factory/FactoryBeanListener.java   | 10 ++++++++++
 .../java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java |  6 ++++++
 .../apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java   |  1 +
 .../java/org/apache/cxf/frontend/ClientFactoryBean.java   |  1 +
 .../java/org/apache/cxf/frontend/ServerFactoryBean.java   | 10 ++++++++++
 5 files changed, 28 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/0bf7ead5/rt/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListener.java
----------------------------------------------------------------------
diff --git a/rt/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListener.java
b/rt/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListener.java
index e511895..a523fbf 100644
--- a/rt/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListener.java
+++ b/rt/core/src/main/java/org/apache/cxf/service/factory/FactoryBeanListener.java
@@ -97,6 +97,11 @@ public interface FactoryBeanListener {
         /**
          * Server, targetObject, Class
          */
+        PRE_SERVER_CREATE, 
+
+        /**
+         * Server, targetObject, Class
+         */
         SERVER_CREATED, 
         
         /**
@@ -110,6 +115,11 @@ public interface FactoryBeanListener {
         BINDING_CREATED, 
         
         /**
+         * Endpoint
+         */
+        PRE_CLIENT_CREATE, 
+
+        /**
          * Endpoint, Client
          */
         CLIENT_CREATED, 

http://git-wip-us.apache.org/repos/asf/cxf/blob/0bf7ead5/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
index 3161783..886a5ed 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/JAXRSServerFactoryBean.java
@@ -156,6 +156,12 @@ public class JAXRSServerFactoryBean extends AbstractJAXRSFactoryBean
{
             }
             
             Endpoint ep = createEndpoint();
+
+            getServiceFactory().sendEvent(FactoryBeanListener.Event.PRE_SERVER_CREATE,
+                                          server, 
+                                          null,
+                                          null);
+            
             server = new ServerImpl(getBus(), 
                                     ep, 
                                     getDestinationFactory(), 

http://git-wip-us.apache.org/repos/asf/cxf/blob/0bf7ead5/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
----------------------------------------------------------------------
diff --git a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
index 878ba0f..70f51c5 100644
--- a/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
+++ b/rt/frontend/jaxrs/src/main/java/org/apache/cxf/jaxrs/client/JAXRSClientFactoryBean.java
@@ -205,6 +205,7 @@ public class JAXRSClientFactoryBean extends AbstractJAXRSFactoryBean {
         
         try {
             Endpoint ep = createEndpoint();
+            this.getServiceFactory().sendEvent(FactoryBeanListener.Event.PRE_CLIENT_CREATE,
ep);
             ClientState actualState = getActualState();
             WebClient client = actualState == null ? new WebClient(getAddress())
                 : new WebClient(actualState);

http://git-wip-us.apache.org/repos/asf/cxf/blob/0bf7ead5/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
----------------------------------------------------------------------
diff --git a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
index 10ca15c..e2a427b 100644
--- a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
+++ b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ClientFactoryBean.java
@@ -89,6 +89,7 @@ public class ClientFactoryBean extends AbstractWSDLBasedEndpointFactory
{
         Endpoint ep = null;
         try {
             ep = createEndpoint();
+            this.getServiceFactory().sendEvent(FactoryBeanListener.Event.PRE_CLIENT_CREATE,
ep);
             applyProperties(ep);
             client = createClient(ep);
             initializeAnnotationInterceptors(ep, getServiceClass());

http://git-wip-us.apache.org/repos/asf/cxf/blob/0bf7ead5/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
----------------------------------------------------------------------
diff --git a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
index ac11d8d..d389ca6 100644
--- a/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
+++ b/rt/frontend/simple/src/main/java/org/apache/cxf/frontend/ServerFactoryBean.java
@@ -157,6 +157,16 @@ public class ServerFactoryBean extends AbstractWSDLBasedEndpointFactory
{
                 }
     
                 Endpoint ep = createEndpoint();
+
+                getServiceFactory().sendEvent(FactoryBeanListener.Event.PRE_SERVER_CREATE,
server, serviceBean,
+                                              serviceBean == null 
+                                              ? getServiceClass() == null 
+                                                  ? getServiceFactory().getServiceClass()

+                                                  : getServiceClass()
+                                              : getServiceClass() == null
+                                                  ? ClassHelper.getRealClass(getServiceBean())

+                                                  : getServiceClass());
+                                
                 server = new ServerImpl(getBus(),
                                         ep,
                                         getDestinationFactory(),


Mime
View raw message