|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjavax.servlet.GenericServlet
javax.servlet.http.HttpServlet
weblogic.servlet.http.AbstractAsyncServlet
org.atmosphere.cpr.AtmosphereServlet
public class AtmosphereServlet
The AtmosphereServlet acts as a dispatcher for AtmosphereHandler
defined in META-INF/atmosphere.xml, or if atmosphere.xml is missing, all classes
that implements AtmosphereHandler will be discovered and mapped using
the class's name. This Servlet can be defined inside an application's
web.xml using the following:
<servlet>
<description>AtmosphereServlet</description>
<servlet-name>AtmosphereServlet</servlet-name>
<servlet-class>org.atmosphere.cpr.AtmosphereServlet</servlet-class>
<load-on-startup>0 </load-on-startup>
</servlet>
<servlet-mapping>
<servlet-name>AtmosphereServlet</servlet-name>
<url-pattern>/Atmosphere </url-pattern>
</servlet-mapping>
| Nested Class Summary | |
|---|---|
static class |
AtmosphereServlet.Action
Simple class/struck that hold the current state. |
static class |
AtmosphereServlet.AtmosphereHandlerWrapper
|
| Field Summary | |
|---|---|
static String |
GLASSFISH_V2
|
static String |
GLASSFISH_V3
|
static String |
GRIZZLY
|
static String |
JETTY
|
static Logger |
logger
|
static String |
SERVLET_30
|
static String |
TOMCAT
|
static String |
WEBLOGIC
|
| Constructor Summary | |
|---|---|
AtmosphereServlet()
Create an Atmosphere Servlet. |
|
| Method Summary | |
|---|---|
protected void |
autoDetectAtmosphereHandlers(ServletContext sc,
URLClassLoader c)
Auto detect instance of AtmosphereHandler in case META-INF/atmosphere.xml
is missing. |
protected void |
autoDetectContainer()
Auto detect the underlying Servlet Container we are running on. |
void |
doDelete(HttpServletRequest req,
HttpServletResponse res)
Delegate the request processing to an instance of CometSupport |
void |
doGet(HttpServletRequest req,
HttpServletResponse res)
Delegate the request processing to an instance of CometSupport |
void |
doHead(HttpServletRequest req,
HttpServletResponse res)
Delegate the request processing to an instance of CometSupport |
void |
doOptions(HttpServletRequest req,
HttpServletResponse res)
Delegate the request processing to an instance of CometSupport |
void |
doPost(HttpServletRequest req,
HttpServletResponse res)
Delegate the request processing to an instance of CometSupport |
void |
doPut(HttpServletRequest req,
HttpServletResponse res)
Delegate the request processing to an instance of CometSupport |
protected boolean |
doRequest(RequestResponseKey rrk)
Weblogic specific comet based implementation. |
protected void |
doResponse(RequestResponseKey rrk,
Object arg1)
Weblogic specific comet based implementation. |
protected void |
doTimeout(RequestResponseKey rrk)
Weblogic specific comet based implementation. |
void |
doTrace(HttpServletRequest req,
HttpServletResponse res)
Delegate the request processing to an instance of CometSupport |
void |
event(CometEvent cometEvent)
Hack to support Tomcat AIO like other WebServer. |
void |
init(ServletConfig sc)
Load the AtmosphereHandler associated with this AtmosphereServlet. |
protected void |
loadAtmosphereDotXml(InputStream stream,
URLClassLoader c)
Load AtmosphereHandler defined under META-INF/atmosphere.xml |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, log, log |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface javax.servlet.Servlet |
|---|
destroy, getServletConfig, getServletInfo, service |
| Field Detail |
|---|
public static final String SERVLET_30
public static final String GLASSFISH_V2
public static final String TOMCAT
public static final String JETTY
public static final String GRIZZLY
public static final String GLASSFISH_V3
public static final String WEBLOGIC
public static final Logger logger
| Constructor Detail |
|---|
public AtmosphereServlet()
| Method Detail |
|---|
public void init(ServletConfig sc)
throws ServletException
AtmosphereHandler associated with this AtmosphereServlet.
init in interface Servletinit in class GenericServletsc - the ServletContext
ServletException
protected void loadAtmosphereDotXml(InputStream stream,
URLClassLoader c)
throws IOException
IOExceptionprotected void autoDetectContainer()
protected void autoDetectAtmosphereHandlers(ServletContext sc,
URLClassLoader c)
throws MalformedURLException,
URISyntaxException
AtmosphereHandler in case META-INF/atmosphere.xml
is missing.
sc - ServletContextc - URLClassLoaser to load the class.
MalformedURLException
URISyntaxException
public void doHead(HttpServletRequest req,
HttpServletResponse res)
throws IOException,
ServletException
CometSupport
doHead in class HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
ServletException
public void doOptions(HttpServletRequest req,
HttpServletResponse res)
throws IOException,
ServletException
CometSupport
doOptions in class HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
ServletException
public void doTrace(HttpServletRequest req,
HttpServletResponse res)
throws IOException,
ServletException
CometSupport
doTrace in class HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
ServletException
public void doDelete(HttpServletRequest req,
HttpServletResponse res)
throws IOException,
ServletException
CometSupport
doDelete in class HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
ServletException
public void doPut(HttpServletRequest req,
HttpServletResponse res)
throws IOException,
ServletException
CometSupport
doPut in class HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
ServletException
public void doGet(HttpServletRequest req,
HttpServletResponse res)
throws IOException,
ServletException
CometSupport
doGet in class HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
ServletException
public void doPost(HttpServletRequest req,
HttpServletResponse res)
throws IOException,
ServletException
CometSupport
doPost in class HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
ServletException
public void event(CometEvent cometEvent)
throws IOException,
ServletException
Servlet implements the interface
CometProcessor without invoking Servlet#service
event in interface CometProcessorcometEvent - the CometEvent
IOException
ServletException
protected boolean doRequest(RequestResponseKey rrk)
throws IOException,
ServletException
doRequest in class AbstractAsyncServletrrk -
IOException
ServletException
protected void doResponse(RequestResponseKey rrk,
Object arg1)
throws IOException,
ServletException
doResponse in class AbstractAsyncServletrrk -
IOException
ServletException
protected void doTimeout(RequestResponseKey rrk)
throws IOException,
ServletException
doTimeout in class AbstractAsyncServletrrk -
IOException
ServletException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||