Use "reference:" scheme to install bundles from the orginal location without copying

git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@707563 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
rfeng 2008-10-24 06:43:56 +00:00
parent fe85e4d6a0
commit b4ea757877

View file

@ -249,7 +249,14 @@ class EquinoxHost {
Bundle bundle = allBundles.get(bundleName);
if (bundle == null) {
long installStart = currentTimeMillis();
bundle = bundleContext.installBundle(bundleFile);
String location = bundleFile;
if (bundleFile.startsWith("file:")) {
File target = file(new URL(bundleFile));
// Use a special "reference" scheme to install the bundle as a reference
// instead of copying the bundle
location = "reference:file:/" + target.getPath();
}
bundle = bundleContext.installBundle(location);
if (logger.isLoggable(Level.FINE)) {
logger.fine("Bundle installed in " + (currentTimeMillis() - installStart) + " ms: " + string(bundle, false));
}