public static BundleContext getBundleContextByBundleId(long bundleId) {
        Bundle bundle = bundleContext.getBundle(bundleId);
        if (bundle != null) {
            return bundle.getBundleContext();
        } else {
            return null;
        }
    }
public static BundleContext getBundleContextByBundleId ( long bundleId ) { Bundle bundle = bundleContext . getBundle ( bundleId ) ; if ( bundle != null ) { return bundle . getBundleContext ( ) ; } else { return null ; } }
<p>getBundleContextByBundleId.</p>

@param bundleId a long.
@return a {@link org.osgi.framework.BundleContext} object.