Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/799#discussion_r135764988
--- Diff:
core/src/main/java/org/apache/brooklyn/core/catalog/internal/BasicBrooklynCatalog.java
---
@@ -1034,25 +1065,21 @@ private String setFromItemIfUnset(String oldValue,
Map<?,?> item, String fieldAt
}
@SuppressWarnings("unused") // keep during 0.12.0 until we are
decided we won't support this; search for this method name
- // note that it breaks after rebind since we don't have the JAR -- see
notes below
+ // (note that this now could work after rebind since we have the OSGi
cache)
private Collection<CatalogItemDtoAbstract<?, ?>>
scanAnnotationsInBundle(ManagementContext mgmt, ManagedBundle containingBundle)
{
CatalogDto dto = CatalogDto.newNamedInstance("Bundle
"+containingBundle.getVersionedName().toOsgiString()+" Scanned Catalog", "All
annotated Brooklyn entities detected in bundles",
"scanning-bundle-"+containingBundle.getVersionedName().toOsgiString());
CatalogDo subCatalog = new CatalogDo(dto);
// need access to a JAR to scan this
String url = null;
- if (containingBundle instanceof BasicManagedBundle) {
- File f =
((BasicManagedBundle)containingBundle).getTempLocalFileWhenJustUploaded();
- if (f!=null) {
- url = "file:"+f.getAbsolutePath();
- }
+ File f =
((ManagementContextInternal)mgmt).getOsgiManager().get().getBundleFile(containingBundle);
+ if (f!=null) {
+ url = "file:"+f.getAbsolutePath();
--- End diff --
Minor: should really be `"file://"+f.getAbsoultePath()`
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---