diff options
author | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-06 00:28:36 +0000 |
---|---|---|
committer | rfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68> | 2010-02-06 00:28:36 +0000 |
commit | 00f9947613624b251551ba709824f97f1b6c2fb1 (patch) | |
tree | de2c513df053df6e6c93e9e206fb3a52016bc9c4 /sca-java-2.x/trunk/modules/extensibility-equinox/src/main/java | |
parent | 99429fad345a10b9a3cc2fa99f828fb656da63a5 (diff) |
Only search for bundles with SCA-Version: 1.1 header for Tuscany 2.x extension points and extensions
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@907138 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-java-2.x/trunk/modules/extensibility-equinox/src/main/java')
-rw-r--r-- | sca-java-2.x/trunk/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/sca-java-2.x/trunk/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java b/sca-java-2.x/trunk/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java index 5b3f7bdb39..34e08d5ef6 100644 --- a/sca-java-2.x/trunk/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java +++ b/sca-java-2.x/trunk/modules/extensibility-equinox/src/main/java/org/apache/tuscany/sca/extensibility/equinox/EquinoxServiceDiscoverer.java @@ -63,21 +63,14 @@ public class EquinoxServiceDiscoverer implements ServiceDiscoverer { this.context = context; Bundle bundle = context.getBundle(); this.version = getSCAVersion(bundle); + if (this.version.equals(Version.emptyVersion)) { + this.version = Version.parseVersion("1.1"); + } } private Version getSCAVersion(Bundle bundle) { - Version scaVersion = Version.emptyVersion; String header = (String)bundle.getHeaders().get("SCA-Version"); - if (header == null) { - scaVersion = Version.parseVersion("1.1"); - } else { - header = header.trim(); - if (header.equals("")) { - header = "1.1"; - } - scaVersion = Version.parseVersion(header); - } - return scaVersion; + return Version.parseVersion(header); } /* @@ -231,7 +224,7 @@ public class EquinoxServiceDiscoverer implements ServiceDiscoverer { } if (isTuscanyService) { Version scaVersion = getSCAVersion(bundle); - return scaVersion.compareTo(version) >= 0; + return scaVersion.compareTo(version) == 0; } return true; } @@ -242,11 +235,14 @@ public class EquinoxServiceDiscoverer implements ServiceDiscoverer { for (Bundle b : context.getBundles()) { if (isProviderBundle(b, isTuscanyService)) { set.add(b); - } else { - if (b.getBundleId() != 0) { + } + /* + else { + if (b.getBundleId() != 0 && isTuscanyService) { logger.warning("Bundle is skipped for service discovery: " + toString(b)); } } + */ } return set; } |