* @throws Exception if the plugin is incorrectly configured or throws an error while attempting discovery
*/
ContentDiscoveryReport performContentDiscovery(int resourceId, PackageType type) throws Exception {
// Perform the discovery
// Use only a read-locked component proxy
ContentFacet contentFacet = ComponentUtil.getComponent(resourceId, ContentFacet.class, FacetLockType.READ,
FACET_METHOD_TIMEOUT, false, true, false);
Set<ResourcePackageDetails> details = contentFacet.discoverDeployedPackages(type);
if (LOG.isDebugEnabled()) {
LOG.debug("Discovered [" + ((details != null) ? details.size() : 0) + "] packages of type=" + type);
}