Community
Participate
Working Groups
Command clhas uses Bundle.loadClass() which triggers bundles resolution and for lazy bundles can cause state change. Since this is done on all bundles the effect may be that all lazy bundles change their state. A possible improvement may be: 1) use of findEntries (according to the JavaDoc: "This bundle's class loader is not used to search for entries.") 2) scan all class loader resources (pretty hard if not impossible to achieve)
I don't see triggering resolution as being a major drawback. Bundles deployed in Virgo and almost always already resolved. When lazy activation bundles are deployed, they are aggressively started, meaning they too are already resolved. I think we could close this as WONTFIX if we cannot find an elegant solution.
I'm currently testing findEntries approach. It also allows search for resources and wildcards.
Commit cb559540d895853b0340b500fc13c35d92bb333a introduces support for resource lookup with findEntries and wildcards in the search pattern.
Commit ac3858421a631fad3d64d4e8e9fae14eba95b7db provides logic for searching the whole bundle for entity starting from the root. We need this since "the pattern is only matched against the last element of the entry path" as stated in findEntries JavaDoc. This means that web bundle that packages a class in WEB-INF/classes will not be found by findEntries since the path is prepended with WEB-INF/classes. TO overcome this we search for the class everywhere in the bundle and then filter the result.
Added user guide documentation with commit 1fe4736dc32f3583e8e024a3731bda1f72aae788