cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cschnei...@apache.org
Subject [1/2] cxf-dosgi git commit: Small refactoring
Date Mon, 11 Jul 2016 21:19:06 GMT
Repository: cxf-dosgi
Updated Branches:
  refs/heads/master 7f75cc067 -> fc76aefaa


Small refactoring


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

Branch: refs/heads/master
Commit: 53e649a2e38a59112d2e3a261129eeab6cf1f746
Parents: 7f75cc0
Author: Christian Schneider <chris@die-schneider.net>
Authored: Thu Jul 7 12:37:24 2016 +0200
Committer: Christian Schneider <chris@die-schneider.net>
Committed: Thu Jul 7 12:37:24 2016 +0200

----------------------------------------------------------------------
 .../common/httpservice/HttpServiceManager.java  |  8 ++--
 .../cxf/dosgi/common/util/ServerEndpoint.java   | 49 ++++++++++++++++++++
 .../cxf/dosgi/common/util/ServerWrapper.java    | 49 --------------------
 .../cxf/dosgi/dsw/handlers/rest/RsProvider.java |  4 +-
 .../cxf/dosgi/dsw/handlers/ws/WsProvider.java   |  4 +-
 .../ws/PojoConfigurationTypeHandlerTest.java    |  8 ++--
 6 files changed, 61 insertions(+), 61 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/53e649a2/common/src/main/java/org/apache/cxf/dosgi/common/httpservice/HttpServiceManager.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/httpservice/HttpServiceManager.java
b/common/src/main/java/org/apache/cxf/dosgi/common/httpservice/HttpServiceManager.java
index e03b605..4f2c40e 100644
--- a/common/src/main/java/org/apache/cxf/dosgi/common/httpservice/HttpServiceManager.java
+++ b/common/src/main/java/org/apache/cxf/dosgi/common/httpservice/HttpServiceManager.java
@@ -133,12 +133,12 @@ public class HttpServiceManager {
         return "/" + type.getName().replace('.', '/');
     }
 
-    public String getAbsoluteAddress(String contextRoot, String relativeEndpointAddress)
{
-        if (relativeEndpointAddress.startsWith("http")) {
-            return relativeEndpointAddress;
+    public String getAbsoluteAddress(String contextRoot, String endpointAddress) {
+        if (endpointAddress.startsWith("http")) {
+            return endpointAddress;
         }
         String effContextRoot = contextRoot == null ? cxfServletAlias : contextRoot;
-        return this.httpBase + effContextRoot + relativeEndpointAddress;
+        return this.httpBase + effContextRoot + endpointAddress;
     }
 
     private final class UnregisterListener implements ServiceListener {

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/53e649a2/common/src/main/java/org/apache/cxf/dosgi/common/util/ServerEndpoint.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/util/ServerEndpoint.java b/common/src/main/java/org/apache/cxf/dosgi/common/util/ServerEndpoint.java
new file mode 100644
index 0000000..5d6d1a7
--- /dev/null
+++ b/common/src/main/java/org/apache/cxf/dosgi/common/util/ServerEndpoint.java
@@ -0,0 +1,49 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.cxf.dosgi.common.util;
+
+import java.io.IOException;
+
+import org.apache.aries.rsa.spi.Endpoint;
+import org.apache.cxf.endpoint.Server;
+import org.osgi.service.remoteserviceadmin.EndpointDescription;
+
+public class ServerEndpoint implements Endpoint {
+    private EndpointDescription desc;
+    private Server server;
+
+    public ServerEndpoint(EndpointDescription desc, Server server) {
+        this.desc = desc;
+        this.server = server;
+    }
+    
+    public Server getServer() {
+        return this.server;
+    }
+
+    @Override
+    public void close() throws IOException {
+        this.server.destroy();
+    }
+
+    @Override
+    public EndpointDescription description() {
+        return this.desc;
+    }
+}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/53e649a2/common/src/main/java/org/apache/cxf/dosgi/common/util/ServerWrapper.java
----------------------------------------------------------------------
diff --git a/common/src/main/java/org/apache/cxf/dosgi/common/util/ServerWrapper.java b/common/src/main/java/org/apache/cxf/dosgi/common/util/ServerWrapper.java
deleted file mode 100644
index 22144ca..0000000
--- a/common/src/main/java/org/apache/cxf/dosgi/common/util/ServerWrapper.java
+++ /dev/null
@@ -1,49 +0,0 @@
-/**
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-package org.apache.cxf.dosgi.common.util;
-
-import java.io.IOException;
-
-import org.apache.aries.rsa.spi.Endpoint;
-import org.apache.cxf.endpoint.Server;
-import org.osgi.service.remoteserviceadmin.EndpointDescription;
-
-public class ServerWrapper implements Endpoint {
-    private EndpointDescription desc;
-    private Server server;
-
-    public ServerWrapper(EndpointDescription desc, Server server) {
-        this.desc = desc;
-        this.server = server;
-    }
-    
-    public Server getServer() {
-        return this.server;
-    }
-
-    @Override
-    public void close() throws IOException {
-        this.server.destroy();
-    }
-
-    @Override
-    public EndpointDescription description() {
-        return this.desc;
-    }
-}

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/53e649a2/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java
----------------------------------------------------------------------
diff --git a/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java
b/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java
index 050c642..44d70f4 100644
--- a/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java
+++ b/provider-rs/src/main/java/org/apache/cxf/dosgi/dsw/handlers/rest/RsProvider.java
@@ -36,7 +36,7 @@ import org.apache.cxf.dosgi.common.httpservice.HttpServiceManager;
 import org.apache.cxf.dosgi.common.intent.IntentManager;
 import org.apache.cxf.dosgi.common.proxy.ProxyFactory;
 import org.apache.cxf.dosgi.common.util.OsgiUtils;
-import org.apache.cxf.dosgi.common.util.ServerWrapper;
+import org.apache.cxf.dosgi.common.util.ServerEndpoint;
 import org.apache.cxf.endpoint.AbstractEndpointFactory;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.jaxrs.JAXRSServerFactoryBean;
@@ -170,7 +170,7 @@ public class RsProvider implements DistributionProvider {
         try {
             Thread.currentThread().setContextClassLoader(JAXRSServerFactoryBean.class.getClassLoader());
             Server server = factory.create();
-            return new ServerWrapper(epd, server);
+            return new ServerEndpoint(epd, server);
         } finally {
             Thread.currentThread().setContextClassLoader(oldClassLoader);
         }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/53e649a2/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java
----------------------------------------------------------------------
diff --git a/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java
b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java
index 26fdfd0..3c5cfd0 100644
--- a/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java
+++ b/provider-ws/src/main/java/org/apache/cxf/dosgi/dsw/handlers/ws/WsProvider.java
@@ -39,7 +39,7 @@ import org.apache.cxf.dosgi.common.httpservice.HttpServiceManager;
 import org.apache.cxf.dosgi.common.intent.IntentManager;
 import org.apache.cxf.dosgi.common.proxy.ProxyFactory;
 import org.apache.cxf.dosgi.common.util.OsgiUtils;
-import org.apache.cxf.dosgi.common.util.ServerWrapper;
+import org.apache.cxf.dosgi.common.util.ServerEndpoint;
 import org.apache.cxf.endpoint.AbstractEndpointFactory;
 import org.apache.cxf.endpoint.Server;
 import org.apache.cxf.frontend.ClientProxyFactoryBean;
@@ -213,7 +213,7 @@ public class WsProvider implements DistributionProvider {
         try {
             Thread.currentThread().setContextClassLoader(ServerFactoryBean.class.getClassLoader());
             Server server = factory.create();
-            return new ServerWrapper(epd, server);
+            return new ServerEndpoint(epd, server);
         } finally {
             Thread.currentThread().setContextClassLoader(oldClassLoader);
         }

http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/53e649a2/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java
----------------------------------------------------------------------
diff --git a/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java
b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java
index 4ab9b31..c935f3d 100644
--- a/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java
+++ b/provider-ws/src/test/java/org/apache/cxf/dosgi/dsw/handlers/ws/PojoConfigurationTypeHandlerTest.java
@@ -31,7 +31,7 @@ import org.apache.aries.rsa.util.EndpointHelper;
 import org.apache.cxf.dosgi.common.httpservice.HttpServiceManager;
 import org.apache.cxf.dosgi.common.intent.IntentManager;
 import org.apache.cxf.dosgi.common.intent.IntentManagerImpl;
-import org.apache.cxf.dosgi.common.util.ServerWrapper;
+import org.apache.cxf.dosgi.common.util.ServerEndpoint;
 import org.apache.cxf.dosgi.dsw.handlers.jaxws.MyJaxWsEchoService;
 import org.apache.cxf.dosgi.dsw.handlers.simple.MySimpleEchoService;
 import org.apache.cxf.endpoint.AbstractEndpointFactory;
@@ -214,7 +214,7 @@ public class PojoConfigurationTypeHandlerTest extends TestCase {
             @Override
             protected Endpoint createServerFromFactory(ServerFactoryBean factory,
                                                        EndpointDescription epd) {
-                return new ServerWrapper(epd, null);
+                return new ServerEndpoint(epd, null);
             }
         };
         handler.setIntentManager(intentManager);
@@ -356,7 +356,7 @@ public class PojoConfigurationTypeHandlerTest extends TestCase {
         Object myService = null;
         c.replay();
 
-        ServerWrapper serverWrapper = (ServerWrapper)handler.exportService(myService,
+        ServerEndpoint serverWrapper = (ServerEndpoint)handler.exportService(myService,
                                                                            serviceBC, 
                                                                            sd, 
                                                                            new Class[]{MyJaxWsEchoService.class});
@@ -383,7 +383,7 @@ public class PojoConfigurationTypeHandlerTest extends TestCase {
         sd.put(WsConstants.WS_ADDRESS_PROPERTY, "/somewhere_else");
         BundleContext serviceBC = c.createMock(BundleContext.class);
         c.replay();
-        ServerWrapper serverWrapper = (ServerWrapper)handler.exportService(null, serviceBC,
sd, 
+        ServerEndpoint serverWrapper = (ServerEndpoint)handler.exportService(null, serviceBC,
sd, 
                                                                           new Class[]{MySimpleEchoService.class});
         c.verify();
 


Mime
View raw message