// Path: api/src/main/java/org/jboss/osgi/resolver/XBundleCapability.java
// public interface XBundleCapability extends XCapability, BundleCapability {
// 
//     /**
//      * Get the bundle revision declaring this capability.
//      */
//     XBundleRevision getResource();
// 
//     /**
//      * Get the bundle revision this capability.
//      */
//     XBundleRevision getRevision();
// 
// }
// 
// Path: api/src/main/java/org/jboss/osgi/resolver/XBundleRequirement.java
// public interface XBundleRequirement extends XRequirement, BundleRequirement {
// 
//     /**
//      * Get the bundle revision declaring this requirement.
//      */
//     XBundleRevision getResource();
// 
//     /**
//      * Get the bundle revision this requirement.
//      */
//     XBundleRevision getRevision();
// }
// 
// Path: api/src/main/java/org/jboss/osgi/resolver/XBundleRevision.java
// public interface XBundleRevision extends XResource, BundleRevision {
// 
//     /**
//      * Get the associated {@link XBundle}
//      */
//     XBundle getBundle();
// 
//     /**
//      * Get the {@link XBundleWiringSupport} associated with this resource
//      */
//     XBundleWiringSupport getWiringSupport();
// 
//     /**
//      * Get the bundle canonical name
//      *
//      * [symbolicName:version]
//      */
//     String getCanonicalName();
// 
//     /**
//      * Get the associated {@link ModuleIdentifier}
//      * or null if the revision is not resolved
//      */
//     ModuleIdentifier getModuleIdentifier();
// 
//     /**
//      * Get the associated {@link ModuleIdentifier}
//      * or null if the revision is not resolved
//      */
//     ModuleClassLoader getModuleClassLoader();
// 
//     /**
//      * @see {@link Bundle#getResource(String)}
//      */
//     URL getResource(String name);
// 
//     /**
//      * @see {@link Bundle#getResources(String)}
//      */
//     Enumeration<URL> getResources(String name) throws IOException;
// 
//     /**
//      * @see {@link Bundle#findEntries(String, String, boolean)}
//      */
//     Enumeration<URL> findEntries(String path, String filePattern, boolean recursive);
// 
//     /**
//      * @see {@link Bundle#getEntry(String)}
//      */
//     URL getEntry(String path);
// 
//     /**
//      * @see {@link Bundle#getEntryPaths(String)}
//      */
//     Enumeration<String> getEntryPaths(String path);
// 
//     /**
//      * True if this revision is a fragment
//      */
//     boolean isFragment();
// }


import org.jboss.osgi.resolver.XBundleCapability;
import org.jboss.osgi.resolver.XBundleRequirement;
import org.jboss.osgi.resolver.XBundleRevision;
import org.osgi.framework.wiring.BundleCapability;
import org.osgi.framework.wiring.BundleRequirement;
import org.osgi.framework.wiring.BundleRevision;
import org.osgi.framework.wiring.BundleWire;
import org.osgi.framework.wiring.BundleWiring;
import org.osgi.resource.Wire;
    @Override
    public BundleWiring getRequirerWiring() {
        return getRequirerWiring(true);
    }

    public BundleWiring getProviderWiring(boolean checkInUse) {
        BundleWiring providerWiring = (BundleWiring) super.getProviderWiring();
        if (providerWiring != null) {
            return !checkInUse || providerWiring.isInUse() ? providerWiring : null;
        }
        return null;
    }

    public BundleWiring getRequirerWiring(boolean checkInUse) {
        BundleWiring requirerWiring = (BundleWiring) super.getRequirerWiring();
        if (requirerWiring != null) {
            return !checkInUse || requirerWiring.isInUse() ? requirerWiring : null;
        }
        return null;
    }

    public XBundleRevision getProvider() {
        return (XBundleRevision) super.getProvider();
    }

    public XBundleRevision getRequirer() {
        return (XBundleRevision) super.getRequirer();
    }

    @Override
// Path: api/src/main/java/org/jboss/osgi/resolver/XBundleCapability.java
// public interface XBundleCapability extends XCapability, BundleCapability {
// 
//     /**
//      * Get the bundle revision declaring this capability.
//      */
//     XBundleRevision getResource();
// 
//     /**
//      * Get the bundle revision this capability.
//      */
//     XBundleRevision getRevision();
// 
// }
// 
// Path: api/src/main/java/org/jboss/osgi/resolver/XBundleRequirement.java
// public interface XBundleRequirement extends XRequirement, BundleRequirement {
// 
//     /**
//      * Get the bundle revision declaring this requirement.
//      */
//     XBundleRevision getResource();
// 
//     /**
//      * Get the bundle revision this requirement.
//      */
//     XBundleRevision getRevision();
// }
// 
// Path: api/src/main/java/org/jboss/osgi/resolver/XBundleRevision.java
// public interface XBundleRevision extends XResource, BundleRevision {
// 
//     /**
//      * Get the associated {@link XBundle}
//      */
//     XBundle getBundle();
// 
//     /**
//      * Get the {@link XBundleWiringSupport} associated with this resource
//      */
//     XBundleWiringSupport getWiringSupport();
// 
//     /**
//      * Get the bundle canonical name
//      *
//      * [symbolicName:version]
//      */
//     String getCanonicalName();
// 
//     /**
//      * Get the associated {@link ModuleIdentifier}
//      * or null if the revision is not resolved
//      */
//     ModuleIdentifier getModuleIdentifier();
// 
//     /**
//      * Get the associated {@link ModuleIdentifier}
//      * or null if the revision is not resolved
//      */
//     ModuleClassLoader getModuleClassLoader();
// 
//     /**
//      * @see {@link Bundle#getResource(String)}
//      */
//     URL getResource(String name);
// 
//     /**
//      * @see {@link Bundle#getResources(String)}
//      */
//     Enumeration<URL> getResources(String name) throws IOException;
// 
//     /**
//      * @see {@link Bundle#findEntries(String, String, boolean)}
//      */
//     Enumeration<URL> findEntries(String path, String filePattern, boolean recursive);
// 
//     /**
//      * @see {@link Bundle#getEntry(String)}
//      */
//     URL getEntry(String path);
// 
//     /**
//      * @see {@link Bundle#getEntryPaths(String)}
//      */
//     Enumeration<String> getEntryPaths(String path);
// 
//     /**
//      * True if this revision is a fragment
//      */
//     boolean isFragment();
// }


// Path: api/src/main/java/org/jboss/osgi/resolver/spi/AbstractBundleWire.java
import org.jboss.osgi.resolver.XBundleCapability;
import org.jboss.osgi.resolver.XBundleRequirement;
import org.jboss.osgi.resolver.XBundleRevision;
import org.osgi.framework.wiring.BundleCapability;
import org.osgi.framework.wiring.BundleRequirement;
import org.osgi.framework.wiring.BundleRevision;
import org.osgi.framework.wiring.BundleWire;
import org.osgi.framework.wiring.BundleWiring;
import org.osgi.resource.Wire;

    @Override
    public BundleWiring getRequirerWiring() {
        return getRequirerWiring(true);
    }

    public BundleWiring getProviderWiring(boolean checkInUse) {
        BundleWiring providerWiring = (BundleWiring) super.getProviderWiring();
        if (providerWiring != null) {
            return !checkInUse || providerWiring.isInUse() ? providerWiring : null;
        }
        return null;
    }

    public BundleWiring getRequirerWiring(boolean checkInUse) {
        BundleWiring requirerWiring = (BundleWiring) super.getRequirerWiring();
        if (requirerWiring != null) {
            return !checkInUse || requirerWiring.isInUse() ? requirerWiring : null;
        }
        return null;
    }

    public XBundleRevision getProvider() {
        return (XBundleRevision) super.getProvider();
    }

    public XBundleRevision getRequirer() {
        return (XBundleRevision) super.getRequirer();
    }

    @Override
    public XBundleCapability getCapability() {