cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject [1/4] cxf git commit: [CXF-6907] Cache the EPR for performance
Date Fri, 24 Mar 2017 15:58:14 GMT
Repository: cxf
Updated Branches:
  refs/heads/3.0.x-fixes 5da6275ac -> 9abefd26b


[CXF-6907] Cache the EPR for performance


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

Branch: refs/heads/3.0.x-fixes
Commit: acf9e1ae247f34cb4f7a8cd4608fd688993a2223
Parents: 5da6275
Author: Daniel Kulp <dkulp@apache.org>
Authored: Thu Mar 23 14:10:54 2017 -0400
Committer: Daniel Kulp <dkulp@apache.org>
Committed: Fri Mar 24 10:50:15 2017 -0400

----------------------------------------------------------------------
 .../java/org/apache/cxf/wsn/AbstractEndpoint.java    | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf/blob/acf9e1ae/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/AbstractEndpoint.java
----------------------------------------------------------------------
diff --git a/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/AbstractEndpoint.java
b/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/AbstractEndpoint.java
index 1cc869c..d886874 100644
--- a/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/AbstractEndpoint.java
+++ b/services/wsn/wsn-core/src/main/java/org/apache/cxf/wsn/AbstractEndpoint.java
@@ -35,6 +35,8 @@ public abstract class AbstractEndpoint implements EndpointMBean {
     protected EndpointManager manager;
 
     protected Endpoint endpoint;
+    
+    protected W3CEndpointReference endpointEpr;
 
     public AbstractEndpoint(String name) {
         this.name = name;
@@ -59,19 +61,24 @@ public abstract class AbstractEndpoint implements EndpointMBean {
     public final URL getWSDLLocation() {
         return CreatePullPoint.class.getClassLoader().getResource("org/apache/cxf/wsn/wsdl/wsn.wsdl");

     }
-    public void register() throws EndpointRegistrationException {
+    public synchronized void register() throws EndpointRegistrationException {
         endpoint = manager.register(getAddress(), this, getWSDLLocation());
+        endpointEpr = null;
     }
 
-    public void unregister() throws EndpointRegistrationException {
+    public synchronized void unregister() throws EndpointRegistrationException {
         if (endpoint != null) {
             manager.unregister(endpoint, this);
+            endpointEpr = null;
         }
     }
 
-    public W3CEndpointReference getEpr() {
+    public synchronized W3CEndpointReference getEpr() {
         if (endpoint != null) {
-            return manager.getEpr(endpoint);
+            if (endpointEpr == null) {
+                endpointEpr = manager.getEpr(endpoint);
+            }
+            return endpointEpr;
         }
         return null;
     }


Mime
View raw message