summaryrefslogtreecommitdiffstats
path: root/branches/sca-java-2.0-M3/modules/contribution-osgi/src
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-29 22:10:28 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2009-06-29 22:10:28 +0000
commit1fd00705939747143753aeae8c8aa084e3d9f800 (patch)
tree9ecb2c48a911665549388bbcba2069b6f020c53e /branches/sca-java-2.0-M3/modules/contribution-osgi/src
parent1b4728bc676d02af0ddb68754167028cd5ab5773 (diff)
Merge changes from trunk to bring up the distributed osgi samples with Tuscany distribution
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@789466 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'branches/sca-java-2.0-M3/modules/contribution-osgi/src')
-rw-r--r--branches/sca-java-2.0-M3/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionScanner.java16
1 files changed, 14 insertions, 2 deletions
diff --git a/branches/sca-java-2.0-M3/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionScanner.java b/branches/sca-java-2.0-M3/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionScanner.java
index 3d20d968a3..a8bec24dab 100644
--- a/branches/sca-java-2.0-M3/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionScanner.java
+++ b/branches/sca-java-2.0-M3/modules/contribution-osgi/src/main/java/org/apache/tuscany/sca/contribution/osgi/impl/OSGiBundleContributionScanner.java
@@ -37,6 +37,7 @@ import org.apache.tuscany.sca.contribution.processor.ContributionException;
import org.apache.tuscany.sca.contribution.processor.ContributionReadException;
import org.apache.tuscany.sca.contribution.scanner.ContributionScanner;
import org.osgi.framework.Bundle;
+import org.osgi.framework.Constants;
/**
* Bundle Contribution package processor.
@@ -123,19 +124,30 @@ public class OSGiBundleContributionScanner implements ContributionScanner {
}
List<String> artifacts = new ArrayList<String>();
+ Set<String> bundleClassPath = new HashSet<String>();
+ String cp = (String)bundle.getHeaders().get(Constants.BUNDLE_CLASSPATH);
+ if (cp != null) {
+ String[] paths = cp.split(",");
+ for (String path : paths) {
+ bundleClassPath.add(path.trim());
+ }
+ }
try {
Enumeration<?> entries = bundle.findEntries("/", "*", true);
while (entries.hasMoreElements()) {
URL entry = (URL)entries.nextElement();
String entryName = entry.getPath();
+ if (entryName.contains("/.svn/")) {
+ // Ignore .svn files
+ continue;
+ }
if (entryName.startsWith("/")) {
entryName = entryName.substring(1);
}
artifacts.add(entryName);
- // FIXME: We probably should honor Bundle-ClassPath headers to deal with inner jars
- if (entryName.endsWith(".jar")) {
+ if (entryName.endsWith(".jar") && bundleClassPath.contains(entryName)) {
artifacts.addAll(getJarArtifacts(entry, entry.openStream()));
}