Announcement Announcement Module
Collapse
No announcement yet.
Scoped plans and extenders Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #2
    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.)

    Comment


    • #3
      Glyn,

      Module-Scope is what I will use for now.

      Comment

      Working...
      X