You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by cs...@apache.org on 2017/01/04 13:02:56 UTC
cxf-dosgi git commit: [DOSGI-252] Simplify address handling
Repository: cxf-dosgi
Updated Branches:
refs/heads/master 4de42394b -> dcaa6be17
[DOSGI-252] Simplify address handling
Project: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/repo
Commit: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/commit/dcaa6be1
Tree: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/tree/dcaa6be1
Diff: http://git-wip-us.apache.org/repos/asf/cxf-dosgi/diff/dcaa6be1
Branch: refs/heads/master
Commit: dcaa6be17a0443b50ca7dd355f1211753db347ea
Parents: 4de4239
Author: Christian Schneider <ch...@die-schneider.net>
Authored: Wed Jan 4 11:42:50 2017 +0100
Committer: Christian Schneider <ch...@die-schneider.net>
Committed: Wed Jan 4 11:42:50 2017 +0100
----------------------------------------------------------------------
.../cxf/dosgi/dsw/handlers/rest/RsProvider.java | 16 +++-------------
1 file changed, 3 insertions(+), 13 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cxf-dosgi/blob/dcaa6be1/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 032bb46..7b46571 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
@@ -129,15 +129,10 @@ public class RsProvider implements DistributionProvider {
return null;
}
String contextRoot = PropertyHelper.getProperty(endpointProps, RsConstants.RS_HTTP_SERVICE_CONTEXT);
- String address;
Class<?> iClass = exportedInterfaces[0];
- if (contextRoot == null) {
- address = getServerAddress(endpointProps, iClass);
- } else {
- address = PropertyHelper.getProperty(endpointProps, RsConstants.RS_ADDRESS_PROPERTY);
- if (address == null) {
- address = "/";
- }
+ String address = PropertyHelper.getProperty(endpointProps, RsConstants.RS_ADDRESS_PROPERTY);
+ if (address == null) {
+ address = httpServiceManager.getDefaultAddress(iClass);
}
final Long sid = (Long) endpointProps.get(RemoteConstants.ENDPOINT_SERVICE_ID);
Set<String> intentNames = intentManager.getExported(endpointProps);
@@ -241,11 +236,6 @@ public class RsProvider implements DistributionProvider {
return new EndpointDescription(props);
}
- private String getServerAddress(Map<String, Object> sd, Class<?> iClass) {
- String address = PropertyHelper.getProperty(sd, RsConstants.RS_ADDRESS_PROPERTY);
- return address == null ? httpServiceManager.getDefaultAddress(iClass) : address;
- }
-
private static void addContextProperties(AbstractEndpointFactory factory, Map<String, Object> sd, String propName) {
@SuppressWarnings("unchecked")
Map<String, Object> props = (Map<String, Object>)sd.get(propName);