|
||||||||||
| 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. |
class |
AtmosphereServlet.AtmosphereConfig
|
static class |
AtmosphereServlet.AtmosphereHandlerWrapper
|
| Field Summary | |
|---|---|
protected Map<String,AtmosphereServlet.AtmosphereHandlerWrapper> |
atmosphereHandlers
The list of AtmosphereHandler and their associated mapping. |
protected CometSupport |
cometSupport
|
protected AtmosphereServlet.AtmosphereConfig |
config
|
static String |
GLASSFISH_V2
|
static String |
GLASSFISH_V3
|
static String |
GRIZZLY
|
static String |
JBOSS_5
|
static String |
JBOSSWEB
|
static String |
JETTY
|
static String |
JETTY_7
|
static Logger |
logger
|
static String |
SERVLET_30
|
static String |
TOMCAT
|
static String |
WEBLOGIC
|
| Constructor Summary | |
|---|---|
AtmosphereServlet()
Create an Atmosphere Servlet. |
|
AtmosphereServlet(boolean isFilter)
Create an Atmosphere Servlet. |
|
| Method Summary | |
|---|---|
void |
addAtmosphereHandler(String mapping,
AtmosphereHandler h)
Add an AtmosphereHandler serviced by the Servlet
This API is exposed to allow embedding an Atmosphere application. |
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 |
destroy()
|
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(weblogic.servlet.http.RequestResponseKey rrk)
Weblogic specific comet based implementation. |
protected void |
doResponse(weblogic.servlet.http.RequestResponseKey rrk,
Object context)
Weblogic specific comet based implementation. |
protected void |
doTimeout(weblogic.servlet.http.RequestResponseKey rrk)
Weblogic specific comet based implementation. |
void |
doTrace(HttpServletRequest req,
HttpServletResponse res)
Delegate the request processing to an instance of CometSupport |
void |
event(org.apache.catalina.CometEvent cometEvent)
Hack to support Tomcat AIO like other WebServer. |
void |
event(org.jboss.servlet.http.HttpEvent httpEvent)
Hack to support JBossWeb AIO like other WebServer. |
CometSupport |
getCometSupport()
Return the current CometSupport |
String |
getDefaultBroadcasterClassName()
Return the default Broadcaster class name. |
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 |
void |
setCometSupport(CometSupport cometSupport)
Set the CometSupport implementation. |
void |
setDefaultBroadcasterClassName(String broadcasterClassName)
Set the default Broadcaster class name |
| Methods inherited from class weblogic.servlet.http.AbstractAsyncServlet |
|---|
notify |
| Methods inherited from class javax.servlet.http.HttpServlet |
|---|
getLastModified, service, service |
| Methods inherited from class javax.servlet.GenericServlet |
|---|
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 |
|---|
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 JBOSS_5
public static final String JETTY
public static final String JETTY_7
public static final String GRIZZLY
public static final String GLASSFISH_V3
public static final String WEBLOGIC
public static final String JBOSSWEB
public static final Logger logger
protected Map<String,AtmosphereServlet.AtmosphereHandlerWrapper> atmosphereHandlers
AtmosphereHandler and their associated mapping.
protected CometSupport cometSupport
protected AtmosphereServlet.AtmosphereConfig config
| Constructor Detail |
|---|
public AtmosphereServlet()
public AtmosphereServlet(boolean isFilter)
| Method Detail |
|---|
public void addAtmosphereHandler(String mapping,
AtmosphereHandler h)
AtmosphereHandler serviced by the Servlet
This API is exposed to allow embedding an Atmosphere application.
The - servlet mapping (servlet path)an - implementation of an AtmosphereHandler
public void init(ServletConfig sc)
throws ServletException
AtmosphereHandler associated with this AtmosphereServlet.
init in interface Servletinit in class GenericServletsc - the ServletContext
ServletExceptionpublic void destroy()
destroy in interface Servletdestroy in class GenericServlet
protected void loadAtmosphereDotXml(InputStream stream,
URLClassLoader c)
throws IOException
IOExceptionpublic void setCometSupport(CometSupport cometSupport)
CometSupport implementation. Make sure you don't set
an implementation that only works on some Container. See BlockingIOCometSupport
for an example.
cometSupport - public CometSupport getCometSupport()
CometSupport
protected 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(org.apache.catalina.CometEvent cometEvent)
throws IOException,
ServletException
Servlet implements the interface
CometProcessor without invoking Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
event in interface org.apache.catalina.CometProcessorcometEvent - the CometEvent
IOException
ServletException
public void event(org.jboss.servlet.http.HttpEvent httpEvent)
throws IOException,
ServletException
Servlet implements the interface
HttpEventServlet without invoking Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
event in interface org.jboss.servlet.http.HttpEventServlethttpEvent - the CometEvent
IOException
ServletException
protected boolean doRequest(weblogic.servlet.http.RequestResponseKey rrk)
throws IOException,
ServletException
doRequest in class weblogic.servlet.http.AbstractAsyncServletrrk -
IOException
ServletException
protected void doResponse(weblogic.servlet.http.RequestResponseKey rrk,
Object context)
throws IOException,
ServletException
doResponse in class weblogic.servlet.http.AbstractAsyncServletrrk -
IOException
ServletException
protected void doTimeout(weblogic.servlet.http.RequestResponseKey rrk)
throws IOException,
ServletException
doTimeout in class weblogic.servlet.http.AbstractAsyncServletrrk -
IOException
ServletExceptionpublic String getDefaultBroadcasterClassName()
Broadcaster class name.
public void setDefaultBroadcasterClassName(String broadcasterClassName)
Broadcaster class name
broadcasterClassName - the broadcasterClassName to set
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||