1 11 package org.eclipse.core.runtime.internal.adaptor; 12 13 import org.eclipse.osgi.framework.adaptor.core.BundleInstaller; 14 import org.eclipse.osgi.service.resolver.BundleDescription; 15 import org.osgi.framework.*; 16 17 20 public class EclipseBundleInstaller implements BundleInstaller { 22 BundleContext context; 23 public EclipseBundleInstaller(BundleContext context) { 24 this.context = context; 25 } 26 27 public void installBundle(BundleDescription toInstall) throws BundleException { 28 context.installBundle(toInstall.getLocation()); 29 } 30 31 public void uninstallBundle(BundleDescription toUninstallId) throws BundleException { 32 Bundle toUninstall = context.getBundle(toUninstallId.getBundleId()); 33 if (toUninstall != null) 34 toUninstall.uninstall(); 35 } 36 37 public void updateBundle(BundleDescription toUpdateId) throws BundleException { 38 Bundle toUpdate = context.getBundle(toUpdateId.getBundleId()); 39 if (toUpdate != null) 40 toUpdate.update(); 41 } 42 } 43 | Popular Tags |