Class SmartSwitchingServlet

java.lang.Object
jakarta.servlet.GenericServlet
eu.rarogsoftware.rarog.platform.core.plugins.web.servlets.SmartSwitchingServlet
All Implemented Interfaces:
FeatureModule<PluginServletMappingDescriptor>, jakarta.servlet.Servlet, jakarta.servlet.ServletConfig, Serializable

@AutoRegisterFeatureModuleComponent(PluginServletMappingDescriptor.class) public class SmartSwitchingServlet extends jakarta.servlet.GenericServlet implements FeatureModule<PluginServletMappingDescriptor>
See Also:
  • Constructor Details

    • SmartSwitchingServlet

      public SmartSwitchingServlet(org.springframework.web.servlet.DispatcherServlet dispatcherServlet, org.springframework.boot.autoconfigure.web.servlet.WebMvcProperties webMvcProperties, ApplicationSettings applicationSettings, org.springframework.web.util.UrlPathHelper urlPathHelper, MetricsService metricsService)
  • Method Details

    • init

      public void init(jakarta.servlet.ServletConfig config) throws jakarta.servlet.ServletException
      Specified by:
      init in interface jakarta.servlet.Servlet
      Overrides:
      init in class jakarta.servlet.GenericServlet
      Throws:
      jakarta.servlet.ServletException
    • destroy

      public void destroy()
      Specified by:
      destroy in interface jakarta.servlet.Servlet
      Overrides:
      destroy in class jakarta.servlet.GenericServlet
    • service

      public void service(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res) throws jakarta.servlet.ServletException, IOException
      Specified by:
      service in interface jakarta.servlet.Servlet
      Specified by:
      service in class jakarta.servlet.GenericServlet
      Throws:
      jakarta.servlet.ServletException
      IOException
    • plugDescriptor

      public void plugDescriptor(Plugin plugin, PluginServletMappingDescriptor descriptor)
      Description copied from interface: FeatureModule
      Registers new descriptor into module. Module will use resources represented by descriptor to provide its functionality as long as descriptor is unplugged.
      Specified by:
      plugDescriptor in interface FeatureModule<PluginServletMappingDescriptor>
      Parameters:
      plugin - plugin that is parent of descriptor
      descriptor - feature descriptor to plug
    • unplugDescriptor

      public void unplugDescriptor(Plugin plugin, PluginServletMappingDescriptor descriptor)
      Description copied from interface: FeatureModule
      Unregisters new descriptor into module. Module will no longer use resources provided by specified descriptor
      Specified by:
      unplugDescriptor in interface FeatureModule<PluginServletMappingDescriptor>
      Parameters:
      plugin - plugin that is parent of descriptor
      descriptor - feature descriptor to unplug
    • getServletsAuthorizationManager

      public Optional<org.springframework.security.authorization.AuthorizationManager<org.springframework.security.web.access.intercept.RequestAuthorizationContext>> getServletsAuthorizationManager(jakarta.servlet.http.HttpServletRequest servletRequest)
    • shouldDisableCsrfProtection

      public Optional<Boolean> shouldDisableCsrfProtection(jakarta.servlet.http.HttpServletRequest servletRequest)