org.keycloak.adapters.osgi

## Class ServletReregistrationService

- java.lang.Object
- - org.keycloak.adapters.osgi.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 Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static org.jboss.logging.Logger` | `log`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ServletReregistrationService()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `protected org.ops4j.pax.web.service.WebContainer` | `findExternalWebContainer()` Find web container in the bundle, where was servlet originally registered
    `org.osgi.framework.BundleContext` | `getBundleContext()`
    `org.osgi.framework.ServiceReference` | `getServletReference()`
    `protected org.osgi.util.tracker.ServiceTracker` | `getWebContainerTracker()`
    `protected void` | `registerServlet(org.ops4j.pax.web.service.WebContainer webContainer, javax.servlet.Servlet servlet)`
    `void` | `setBundleContext(org.osgi.framework.BundleContext bundleContext)`
    `void` | `setServletReference(org.osgi.framework.ServiceReference servletReference)`
    `void` | `start()`
    `void` | `stop()`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### 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)

    - #### getServletReference

          public org.osgi.framework.ServiceReference getServletReference()

    - #### setServletReference

          public void setServletReference(org.osgi.framework.ServiceReference servletReference)

    - #### getWebContainerTracker

          protected org.osgi.util.tracker.ServiceTracker getWebContainerTracker()

    - #### start

          public void start()

    - #### stop

          public void stop()

    - #### registerServlet

          protected void registerServlet(org.ops4j.pax.web.service.WebContainer webContainer,
                             javax.servlet.Servlet servlet)

    - #### 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

Copyright © 2015. All rights reserved.