Interface MultiBundleWebContainerContext

  • All Superinterfaces:
    org.osgi.service.http.HttpContext, WebContainerContext

    @Review("\"shared\" flag should be in WebContainerContext, new Whiteboard context (ServletContextHelper) shouldbe shared by default an this interface should be for \"pax-web shared contexts\".\"sharing\" in new Whiteboard is about allowing the contribution of web elements to cross-bundle webapp.\"sharing\" in PaxWeb Whiteboard is about accessing more bundles in search for resources.")
    public interface MultiBundleWebContainerContext
    extends WebContainerContext
    WebContainerContext that can be shared between different bundles. Users may obtain such context by name using WebContainer.createDefaultSharedHttpContext(String) and register different bundles for shared context access.
    • Method Detail

      • registerBundle

        boolean registerBundle​(org.osgi.framework.Bundle bundle)
        Register given Bundle as a bundle using given shared context.
        Parameters:
        bundle -
        Returns:
      • deregisterBundle

        boolean deregisterBundle​(org.osgi.framework.Bundle bundle)
        Unrgister given Bundle as a bundle using given shared context.
        Parameters:
        bundle -
        Returns:
      • isShared

        default boolean isShared()
        Description copied from interface: WebContainerContext

        Should this context (as defined in "102 Http Service" specification, not in "140 Whiteboard Service" specification) be allowed to be used by different bundles?

        In Whiteboard Service scenario (to wrap ServletContextHelper) the context should be shared by default and there's no real way to make a context not shared.

        In Http Service scenario, but default, a context is not shared. It means that if a web element is being registered through such context, but with different bundle, exception should be thrown.

        Specified by:
        isShared in interface WebContainerContext
        Returns: