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:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescription(package private) static final record
-
Constructor Summary
ConstructorsConstructorDescriptionSmartSwitchingServlet
(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 Summary
Modifier and TypeMethodDescriptionvoid
destroy()
Optional<org.springframework.security.authorization.AuthorizationManager<org.springframework.security.web.access.intercept.RequestAuthorizationContext>>
getServletsAuthorizationManager
(jakarta.servlet.http.HttpServletRequest servletRequest) void
init
(jakarta.servlet.ServletConfig config) void
plugDescriptor
(Plugin plugin, PluginServletMappingDescriptor descriptor) Registers new descriptor into module.void
service
(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res) shouldDisableCsrfProtection
(jakarta.servlet.http.HttpServletRequest servletRequest) void
unplugDescriptor
(Plugin plugin, PluginServletMappingDescriptor descriptor) Unregisters new descriptor into module.Methods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
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 interfacejakarta.servlet.Servlet
- Overrides:
init
in classjakarta.servlet.GenericServlet
- Throws:
jakarta.servlet.ServletException
-
destroy
public void destroy()- Specified by:
destroy
in interfacejakarta.servlet.Servlet
- Overrides:
destroy
in classjakarta.servlet.GenericServlet
-
service
public void service(jakarta.servlet.ServletRequest req, jakarta.servlet.ServletResponse res) throws jakarta.servlet.ServletException, IOException - Specified by:
service
in interfacejakarta.servlet.Servlet
- Specified by:
service
in classjakarta.servlet.GenericServlet
- Throws:
jakarta.servlet.ServletException
IOException
-
plugDescriptor
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 interfaceFeatureModule<PluginServletMappingDescriptor>
- Parameters:
plugin
- plugin that is parent of descriptordescriptor
- feature descriptor to plug
-
unplugDescriptor
Description copied from interface:FeatureModule
Unregisters new descriptor into module. Module will no longer use resources provided by specified descriptor- Specified by:
unplugDescriptor
in interfaceFeatureModule<PluginServletMappingDescriptor>
- Parameters:
plugin
- plugin that is parent of descriptordescriptor
- 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
-