Package org.atmosphere.cpr
Class AtmosphereServlet
java.lang.Object
jakarta.servlet.GenericServlet
jakarta.servlet.http.HttpServlet
org.atmosphere.cpr.AtmosphereServlet
- All Implemented Interfaces:
Servlet,ServletConfig,Serializable
AtmosphereServlet that use Servlet 3.0 Async API when available, and fallback to native comet support if not available.
For Tomcat6/7 and JBossWeb Native support, use atmosphere-native dependencies instead.
If Servlet 3.0 or native API isn't found, Atmosphere will use
BlockingIOCometSupport.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final AtmosphereFrameworkInitializerprotected static final org.slf4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptionCreate an Atmosphere Servlet.AtmosphereServlet(boolean isFilter) Create an Atmosphere Servlet.AtmosphereServlet(boolean isFilter, boolean autoDetectHandlers) Create an Atmosphere Servlet. -
Method Summary
Modifier and TypeMethodDescriptionprotected AtmosphereServletprotected AtmosphereServletconfigureFramework(ServletConfig sc, boolean init) voiddestroy()voiddoDelete(HttpServletRequest req, HttpServletResponse res) Delegate the request processing to an instance ofAsyncSupport.voiddoGet(HttpServletRequest req, HttpServletResponse res) Delegate the request processing to an instance ofAsyncSupport.voiddoHead(HttpServletRequest req, HttpServletResponse res) Delegate the request processing to an instance ofAsyncSupport.voiddoOptions(HttpServletRequest req, HttpServletResponse res) Delegate the request processing to an instance ofAsyncSupportvoiddoPost(HttpServletRequest req, HttpServletResponse res) Delegate the request processing to an instance ofAsyncSupport.voiddoPut(HttpServletRequest req, HttpServletResponse res) Delegate the request processing to an instance ofAsyncSupport.voiddoTrace(HttpServletRequest req, HttpServletResponse res) Delegate the request processing to an instance ofAsyncSupport.voidinit(ServletConfig sc) protected AtmosphereFrameworkMethods inherited from class jakarta.servlet.http.HttpServlet
getLastModified, service, serviceMethods inherited from class jakarta.servlet.GenericServlet
getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log
-
Field Details
-
logger
protected static final org.slf4j.Logger logger -
initializer
-
-
Constructor Details
-
AtmosphereServlet
public AtmosphereServlet()Create an Atmosphere Servlet. -
AtmosphereServlet
public AtmosphereServlet(boolean isFilter) Create an Atmosphere Servlet.- Parameters:
isFilter- true if this instance is used as anAtmosphereFilter
-
AtmosphereServlet
public AtmosphereServlet(boolean isFilter, boolean autoDetectHandlers) Create an Atmosphere Servlet.- Parameters:
isFilter- true if this instance is used as anAtmosphereFilter
-
-
Method Details
-
destroy
public void destroy()- Specified by:
destroyin interfaceServlet- Overrides:
destroyin classGenericServlet
-
init
- Specified by:
initin interfaceServlet- Overrides:
initin classGenericServlet- Throws:
ServletException
-
configureFramework
- Throws:
ServletException
-
configureFramework
protected AtmosphereServlet configureFramework(ServletConfig sc, boolean init) throws ServletException - Throws:
ServletException
-
newAtmosphereFramework
-
framework
-
doHead
public void doHead(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException Delegate the request processing to an instance ofAsyncSupport.- Overrides:
doHeadin classHttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
IOExceptionServletException
-
doOptions
public void doOptions(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException Delegate the request processing to an instance ofAsyncSupport- Overrides:
doOptionsin classHttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
IOExceptionServletException
-
doTrace
public void doTrace(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException Delegate the request processing to an instance ofAsyncSupport.- Overrides:
doTracein classHttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
IOExceptionServletException
-
doDelete
public void doDelete(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException Delegate the request processing to an instance ofAsyncSupport.- Overrides:
doDeletein classHttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
IOExceptionServletException
-
doPut
public void doPut(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException Delegate the request processing to an instance ofAsyncSupport.- Overrides:
doPutin classHttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
IOExceptionServletException
-
doGet
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException Delegate the request processing to an instance ofAsyncSupport.- Overrides:
doGetin classHttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
IOExceptionServletException
-
doPost
public void doPost(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException Delegate the request processing to an instance ofAsyncSupport.- Overrides:
doPostin classHttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
IOExceptionServletException
-