Package org.atmosphere.cpr
Class AtmosphereServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- org.atmosphere.cpr.AtmosphereServlet
-
- All Implemented Interfaces:
java.io.Serializable,javax.servlet.Servlet,javax.servlet.ServletConfig
- Direct Known Subclasses:
MeteorServlet
public class AtmosphereServlet extends javax.servlet.http.HttpServletAtmosphereServlet 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 useBlockingIOCometSupport.- Author:
- Jeanfrancois Arcand
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected AtmosphereFrameworkInitializerinitializerprotected static org.slf4j.Loggerlogger
-
Constructor Summary
Constructors Constructor Description AtmosphereServlet()Create an Atmosphere Servlet.AtmosphereServlet(boolean isFilter)Create an Atmosphere Servlet.AtmosphereServlet(boolean isFilter, boolean autoDetectHandlers)Create an Atmosphere Servlet.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected AtmosphereServletconfigureFramework(javax.servlet.ServletConfig sc)protected AtmosphereServletconfigureFramework(javax.servlet.ServletConfig sc, boolean init)voiddestroy()voiddoDelete(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)Delegate the request processing to an instance ofAsyncSupport.voiddoGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)Delegate the request processing to an instance ofAsyncSupport.voiddoHead(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)Delegate the request processing to an instance ofAsyncSupport.voiddoOptions(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)Delegate the request processing to an instance ofAsyncSupportvoiddoPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)Delegate the request processing to an instance ofAsyncSupport.voiddoPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)Delegate the request processing to an instance ofAsyncSupport.voiddoTrace(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res)Delegate the request processing to an instance ofAsyncSupport.AtmosphereFrameworkframework()voidinit(javax.servlet.ServletConfig sc)protected AtmosphereFrameworknewAtmosphereFramework()
-
-
-
Field Detail
-
logger
protected static final org.slf4j.Logger logger
-
initializer
protected final AtmosphereFrameworkInitializer initializer
-
-
Constructor Detail
-
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 anAtmosphereFilterautoDetectHandlers-
-
-
Method Detail
-
destroy
public void destroy()
- Specified by:
destroyin interfacejavax.servlet.Servlet- Overrides:
destroyin classjavax.servlet.GenericServlet
-
init
public void init(javax.servlet.ServletConfig sc) throws javax.servlet.ServletException- Specified by:
initin interfacejavax.servlet.Servlet- Overrides:
initin classjavax.servlet.GenericServlet- Throws:
javax.servlet.ServletException
-
configureFramework
protected AtmosphereServlet configureFramework(javax.servlet.ServletConfig sc) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
configureFramework
protected AtmosphereServlet configureFramework(javax.servlet.ServletConfig sc, boolean init) throws javax.servlet.ServletException
- Throws:
javax.servlet.ServletException
-
newAtmosphereFramework
protected AtmosphereFramework newAtmosphereFramework()
-
framework
public AtmosphereFramework framework()
-
doHead
public void doHead(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletExceptionDelegate the request processing to an instance ofAsyncSupport.- Overrides:
doHeadin classjavax.servlet.http.HttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
doOptions
public void doOptions(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletExceptionDelegate the request processing to an instance ofAsyncSupport- Overrides:
doOptionsin classjavax.servlet.http.HttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
doTrace
public void doTrace(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletExceptionDelegate the request processing to an instance ofAsyncSupport.- Overrides:
doTracein classjavax.servlet.http.HttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
doDelete
public void doDelete(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletExceptionDelegate the request processing to an instance ofAsyncSupport.- Overrides:
doDeletein classjavax.servlet.http.HttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
doPut
public void doPut(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletExceptionDelegate the request processing to an instance ofAsyncSupport.- Overrides:
doPutin classjavax.servlet.http.HttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
doGet
public void doGet(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletExceptionDelegate the request processing to an instance ofAsyncSupport.- Overrides:
doGetin classjavax.servlet.http.HttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
doPost
public void doPost(javax.servlet.http.HttpServletRequest req, javax.servlet.http.HttpServletResponse res) throws java.io.IOException, javax.servlet.ServletExceptionDelegate the request processing to an instance ofAsyncSupport.- Overrides:
doPostin classjavax.servlet.http.HttpServlet- Parameters:
req- theHttpServletRequestres- theHttpServletResponse- Throws:
java.io.IOExceptionjavax.servlet.ServletException
-
-