diff --git a/framework/src/main/java/org/apache/felix/framework/BundleRevisionDependencies.java b/framework/src/main/java/org/apache/felix/framework/BundleRevisionDependencies.java
index 9b4f83a..44b29df 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleRevisionDependencies.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleRevisionDependencies.java
@@ -88,21 +88,30 @@
         return m_dependentsMap.get(provider);
     }
 
+    public synchronized boolean hasDependents(BundleRevision revision)
+    {
+        // We have to special case fragments, since their dependencies
+        // are actually reversed (i.e., they require a host, but then
+        // the host ends up dependent on them at run time).
+        if (Util.isFragment(revision)
+            && (revision.getWiring() != null)
+            && !revision.getWiring().getRequiredWires(null).isEmpty())
+        {
+            return true;
+        }
+        else if (m_dependentsMap.containsKey(revision))
+        {
+            return true;
+        }
+        return false;
+    }
+
     public synchronized boolean hasDependents(BundleImpl bundle)
     {
         List<BundleRevision> revisions = bundle.getRevisions();
         for (BundleRevision revision : revisions)
         {
-            // We have to special case fragments, since their dependencies
-            // are actually reversed (i.e., they require a host, but then
-            // the host ends up dependent on them at run time).
-            if (Util.isFragment(revision)
-                && (revision.getWiring() != null)
-                && !revision.getWiring().getRequiredWires(null).isEmpty())
-            {
-                return true;
-            }
-            else if (m_dependentsMap.containsKey(revision))
+            if (hasDependents(revision))
             {
                 return true;
             }
diff --git a/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java b/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
index bd12416..6cd132d 100644
--- a/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
+++ b/framework/src/main/java/org/apache/felix/framework/BundleWiringImpl.java
@@ -324,7 +324,11 @@
 
     public boolean isInUse()
     {
-        throw new UnsupportedOperationException("Not supported yet.");
+        return (isCurrent()
+// TODO: OSGi R4.3 - The following can be replaced with a call to getProvidedWires()
+//       once it is implemented.
+            || ((BundleImpl) m_revision.getBundle())
+                .getFramework().getDependencies().hasDependents(m_revision));
     }
 
     public List<BundleCapability> getCapabilities(String namespace)
diff --git a/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java b/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
index 58ed7ec..839edd5 100644
--- a/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
+++ b/framework/src/main/java/org/apache/felix/framework/util/manifestparser/ManifestParser.java
@@ -109,15 +109,25 @@
             // dependencies.
             if (headerMap.get(Constants.FRAGMENT_HOST) == null)
             {
+                // All non-fragment bundles have host capabilities.
                 capList.add(bundleCap);
-                Map<String, Object> hostAttrs =
-                    new HashMap<String, Object>(bundleCap.getAttributes());
-                Object value = hostAttrs.remove(BundleRevision.BUNDLE_NAMESPACE);
-                hostAttrs.put(BundleRevision.HOST_NAMESPACE, value);
-                capList.add(new BundleCapabilityImpl(
-                    owner, BundleRevision.HOST_NAMESPACE,
-                    Collections.EMPTY_MAP,
-                    hostAttrs));
+                // A non-fragment bundle can choose to not have a host capability.
+                String attachment =
+                    bundleCap.getDirectives().get(Constants.FRAGMENT_ATTACHMENT_DIRECTIVE);
+                attachment = (attachment == null)
+                    ? Constants.FRAGMENT_ATTACHMENT_RESOLVETIME
+                    : attachment;
+                if (!attachment.equalsIgnoreCase(Constants.FRAGMENT_ATTACHMENT_NEVER))
+                {
+                    Map<String, Object> hostAttrs =
+                        new HashMap<String, Object>(bundleCap.getAttributes());
+                    Object value = hostAttrs.remove(BundleRevision.BUNDLE_NAMESPACE);
+                    hostAttrs.put(BundleRevision.HOST_NAMESPACE, value);
+                    capList.add(new BundleCapabilityImpl(
+                        owner, BundleRevision.HOST_NAMESPACE,
+                        Collections.EMPTY_MAP,
+                        hostAttrs));
+                }
             }
 
             // Add a singleton capability if the bundle is a singleton.
