[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [equinox-dev] BundleContext and getName

Actually Peter, the discussion was about getting a bundle from the location, not the name. They slipped another identifier in. Rather than proliferating methods I would encourage using Bundle.getHeaders() to get information about a specific bundle. If you want to add something to BundleContext, it would seem much better to do BundleContext.getBundles(Filter filter), where you can search on any of the header fields. That way when you find out that you want to look up a bundle by another manifest property (potentially Eclipse specific) you don't have to add another method.


Peter Kriens wrote:

I saw the discussion regarding the extra method in BundleContext to
get a bundle from its name.

We had this discussion in the past year in the OSGi and decided -not- to
extend the BundleContext interface to keep it as simple as possible.
There was quite a bit discussion about this.

One thing that I proposed, which would more or less fit with the
existing standard, is to register the bundle objects in the registry
with properties for name, id, module, version, etc. This will allow
you search for bundles with an OSGi filter. This may be a cleaner
method than adding methods to BundleContext

Kind regards,

    Peter Kriens

PR> Hi,

PR> Currently BundleContext.getName(String) uses the Bundle-name entry to do PR> the lookup.
PR> Now that we have Bundle-uniqueId, it seems to me that it would be more PR> appropriate to do the lookup on this value.
PR> Any comments?

PR>         PaScaL