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.-
Nested Class Summary
Nested classes/interfaces inherited from class org.atmosphere.handler.AbstractReflectorAtmosphereHandler
AbstractReflectorAtmosphereHandler.Default -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidvoidaddFilterClassName(String filterClass, String filterName) Add a FilterClass.voiddestroy()Destroy this handlerSet 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(Servlet servlet) voidsetServletClassName(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
-
-
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:
ServletException
-
addFilter
-
destroy
public void destroy()Description copied from interface:AtmosphereHandlerDestroy this handler- Specified by:
destroyin interfaceAtmosphereHandler- Overrides:
destroyin classAbstractReflectorAtmosphereHandler
-
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
-
setServlet
-
toString
-