Class ServletReregistrationService


  • public class ServletReregistrationService
    extends Object
    Service, which allows to remove previously registered servlets in karaf/fuse environment. It assumes that particular servlet was previously registered as service in OSGI container under Servlet interface.

    The point is to register automatically registered builtin servlet endpoints (like "/cxf" for instance) to allow secure them by Keycloak and re-register them again

    Author:
    Marek Posolda
    • Field Detail

      • log

        protected static final org.jboss.logging.Logger log
    • Constructor Detail

      • ServletReregistrationService

        public ServletReregistrationService()
    • Method Detail

      • getBundleContext

        public org.osgi.framework.BundleContext getBundleContext()
      • setBundleContext

        public void setBundleContext​(org.osgi.framework.BundleContext bundleContext)
      • start

        public void start()
      • stop

        public void stop()
      • registerServlet

        protected void registerServlet​(org.ops4j.pax.web.service.WebContainer webContainer,
                                       Dictionary properties)
        Code comes from org.apache.cxf.transport.http.osgi.ServletExporter#updated(java.util.Dictionary)
        Parameters:
        webContainer -
        properties -
      • findExternalWebContainer

        protected org.ops4j.pax.web.service.WebContainer findExternalWebContainer()
        Find web container in the bundle, where was servlet originally registered
        Returns:
        web container or null
      • getManagedServiceReference

        public org.osgi.framework.ServiceReference getManagedServiceReference()
      • setManagedServiceReference

        public void setManagedServiceReference​(org.osgi.framework.ServiceReference managedServiceReference)