Package org.atmosphere.handler
Class ReflectorServletProcessor
java.lang.Object
org.atmosphere.handler.AbstractReflectorAtmosphereHandler
org.atmosphere.handler.ReflectorServletProcessor
- All Implemented Interfaces:
AtmosphereHandler,AtmosphereServletProcessor
An implementation of
AtmosphereHandler using the AtmosphereServletProcessor that delegate the AtmosphereHandler.onRequest(org.atmosphere.cpr.AtmosphereResource)
to a set of FilterChain and Servlet.service(jakarta.servlet.ServletRequest, jakarta.servlet.ServletResponse)
and store the AtmosphereResource as a AtmosphereRequestImpl.getAttribute(String) attribute named
FrameworkConfig.ATMOSPHERE_RESOURCE. The AtmosphereResource can later be retrieved
and used to suspend/resume and broadcast.- Author:
- Jeanfrancois Arcand
-
Nested Class Summary
Nested classes/interfaces inherited from class org.atmosphere.handler.AbstractReflectorAtmosphereHandler
AbstractReflectorAtmosphereHandler.Default -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddFilter(jakarta.servlet.Filter filter) voidaddFilterClassName(String filterClass, String filterName) Add a FilterClass.voiddestroy()Destroy this handlerjakarta.servlet.ServletDeprecated.- use getServletClassNameSet the Servlet class.voidinit(AtmosphereConfig config) Initialize theAtmosphereServletProcessorusing theServletConfig.voidDelegate the request to the Servlet.service method, and add theAtmosphereResourceto the}.invalid @link
{@link HttpServletRequest#setAttribute(java.lang.String, java.lang.Object))voidsetFilterClassName(String filterClass) Add a FilterClass.voidsetServlet(jakarta.servlet.Servlet servlet) voidsetServletClass(String servletClass) Deprecated.- use setServletClassNamevoidsetServletClassName(String servletClass) Return the Servlet class name.toString()Methods inherited from class org.atmosphere.handler.AbstractReflectorAtmosphereHandler
onStateChange, postStateChange, useTwoStepWrite, write
-
Constructor Details
-
ReflectorServletProcessor
public ReflectorServletProcessor() -
ReflectorServletProcessor
public ReflectorServletProcessor(jakarta.servlet.Servlet servlet)
-
-
Method Details
-
onRequest
Delegate the request to the Servlet.service method, and add theAtmosphereResourceto the}. Theinvalid @link
{@link HttpServletRequest#setAttribute(java.lang.String, java.lang.Object))AtmosphereResourcecan ve retrieved usingFrameworkConfig.ATMOSPHERE_RESOURCEvalue.- Parameters:
r- TheAtmosphereResource- Throws:
IOException
-
init
Description copied from interface:AtmosphereServletProcessorInitialize theAtmosphereServletProcessorusing theServletConfig.- Specified by:
initin interfaceAtmosphereServletProcessor- Overrides:
initin classAbstractReflectorAtmosphereHandler- Parameters:
config- theServletConfig- Throws:
jakarta.servlet.ServletException
-
addFilter
public void addFilter(jakarta.servlet.Filter filter) -
destroy
public void destroy()Description copied from interface:AtmosphereHandlerDestroy this handler- Specified by:
destroyin interfaceAtmosphereHandler- Overrides:
destroyin classAbstractReflectorAtmosphereHandler
-
getServletClass
Deprecated.- use getServletClassNameSet the Servlet class.- Returns:
- the servletClass
-
setServletClass
Deprecated.- use setServletClassNameReturn the Servlet class name.- Parameters:
servletClass- the servletClass to set
-
getServletClassName
Set the Servlet class.- Returns:
- the servletClass
-
setServletClassName
Return the Servlet class name.- Parameters:
servletClass- the servletClass to set
-
setFilterClassName
Add a FilterClass. Since we are using Reflection to call this method, what we are really doing is addFilterClass.- Parameters:
filterClass-
-
addFilterClassName
Add a FilterClass. Since we are using Reflection to call this method, what we are really doing is addFilterClass.- Parameters:
filterClass- class name of the filter to instantiate.filterName- mapping name of the filter to instantiate
-
getServlet
public jakarta.servlet.Servlet getServlet() -
setServlet
public void setServlet(jakarta.servlet.Servlet servlet) -
toString
-