public Map<String, Bundle> getWiredBundles(Bundle bundle) {
// the set of bundles from which the bundle imports packages
Map<String, Bundle> exporters = new HashMap<String, Bundle>();
for (BundleRevision revision : bundle.adapt(BundleRevisions.class).getRevisions()) {
BundleWiring wiring = revision.getWiring();
if (wiring != null) {
List<BundleWire> wires = wiring.getRequiredWires(BundleRevision.PACKAGE_NAMESPACE);
if (wires != null) {
for (BundleWire wire : wires) {
if (wire.getProviderWiring().getBundle().getBundleId() != 0) {
exporters.put(wire.getCapability().getAttributes().get(BundleRevision.PACKAGE_NAMESPACE).toString(),
wire.getProviderWiring().getBundle());