public ContentDiscoveryReport executeResourcePackageDiscoveryImmediately(int resourceId, String packageTypeName)
throws PluginContainerException {
// Load the package type object
PackageType packageType = findPackageType(resourceId, packageTypeName);
if (packageType == null) {
throw new PluginContainerException("Could not load package type [" + packageTypeName + "] for resource: "
+ resourceId);
}
// Create a new runner that is scoped to the resource/package type specified
ScheduledContentDiscoveryInfo discoveryInfo = new ScheduledContentDiscoveryInfo(resourceId, packageType);
ContentDiscoveryRunner oneTimeRunner = new ContentDiscoveryRunner(this, discoveryInfo);
ContentDiscoveryReport results;
try {
results = discoveryThreadPoolExecutor.submit((Callable<ContentDiscoveryReport>) oneTimeRunner).get();
} catch (Exception e) {
throw new PluginContainerException("Exception occurred during execution of discovery", e);
}
return results;
}