Results 1 to 3 of 3

Thread: Scoped plans and extenders

  1. #1
    Join Date
    Dec 2005
    Location
    Philadelphia, PA, USA
    Posts
    228

    Default Scoped plans and extenders

    Hi,

    I need to create an extender bundle for my project. That bundle is included in the scoped plan. I was hopping that by virtue of being in the plan it would only have visibility or be notified about bundles in the plan. That is not the case. I see all of the deployed bundles from my extender.

    So the question is: is there something I can do in the extender to check the scope or even figure out if I am in the scoped plan? Is there any other approach that I can take to achieve extender like capabilities but honor boundaries of the plan?
    Thanks
    Dmitry

  2. #2
    Join Date
    Oct 2008
    Location
    Winchester, UK
    Posts
    535

    Default

    There are a couple of ways of spotting that a bundle belongs to a scope.

    Firstly, you can look at the manifest of the bundle. dm Server adds a Module-Scope header to the manifest of bundles which belong to a scope. The header contains the scope name. If the header is absent, the bundle is in the global scope.

    Alternatively, if you're happy to use a dm Server internal service, the com.springsource.kernel.shim.scope.ScopeFactory service provides methods for getting the Scope of a Bundle and of a ServiceReference. Scope.getScopeName then lets you determine the name of the scope (null for the global scope).

    Either way this means you can find the scope name of the extender and compare it to the scope name of another bundle. (The Scope implementation has an equals method, but I wouldn't recommend using it.)
    Glyn Normington
    SpringSource

  3. #3
    Join Date
    Dec 2005
    Location
    Philadelphia, PA, USA
    Posts
    228

    Default

    Glyn,

    Module-Scope is what I will use for now.
    Thanks
    Dmitry

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •