|
||||||||||
| 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
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.
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>
You can force this Servlet to use native API of the Web Server instead of
the Servlet 3.0 Async API you are deploying on by adding
<init-param>
<param-name>org.atmosphere.useNative</param-name>
<param-value>true</param-value>
</init-param>
You can force this Servlet to use one Thread per connection instead of
native API of the Web Server you are deploying on by adding
<init-param>
<param-name>org.atmosphere.useBlocking</param-name>
<param-value>true</param-value>
</init-param>
You can also define Broadcasterby adding:
<init-param>
<param-name>org.atmosphere.cpr.broadcasterClass</param-name>
<param-value>class-name</param-value>
</init-param>
You can also for Atmosphere to use OutputStream for all write operations.
<init-param>
<param-name>org.atmosphere.useStream</param-name>
<param-value>true</param-value>
</init-param>
You can also configure BroadcasterCache that persist message when Browser is disconnected.
<init-param>
<param-name>org.atmosphere.cpr.broadcasterCacheClass</param-name>
<param-value>class-name</param-value>
</init-param>
You can also configure Atmosphere to use http session or not
<init-param>
<param-name>org.atmosphere.cpr.sessionSupport</param-name>
<param-value>false</param-value>
</init-param>
You can also configure BroadcastFilter that will be applied at all newly created Broadcaster
<init-param>
<param-name>org.atmosphere.cpr.broadcastFilterClasses</param-name>
<param-value>BroadcastFilter class name separated by coma</param-value>
</init-param>
All the property available are defined in ApplicationConfig
The Atmosphere Framework can also be used as a Servlet Filter (AtmosphereFilter).
If you are planning to use JSP, Servlet or JSF, you can instead use the
MeteorServlet, which allow the use of Meteor inside those
components.
| Field Summary | |
|---|---|
protected AtmosphereFramework |
framework
|
protected static org.slf4j.Logger |
logger
|
| Constructor Summary | |
|---|---|
AtmosphereServlet()
Create an Atmosphere Servlet. |
|
AtmosphereServlet(boolean isFilter)
Create an Atmosphere Servlet. |
|
AtmosphereServlet(boolean isFilter,
boolean autoDetectHandlers)
Create an Atmosphere Servlet. |
|
| Method Summary | |
|---|---|
void |
destroy()
|
void |
doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Delegate the request processing to an instance of AsyncSupport |
void |
doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Delegate the request processing to an instance of AsyncSupport |
void |
doHead(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Delegate the request processing to an instance of AsyncSupport |
void |
doOptions(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Delegate the request processing to an instance of AsyncSupport |
void |
doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Delegate the request processing to an instance of AsyncSupport |
void |
doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Delegate the request processing to an instance of AsyncSupport |
void |
doTrace(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
Delegate the request processing to an instance of AsyncSupport |
void |
event(CometEvent cometEvent)
Hack to support Tomcat AIO like other WebServer. |
void |
event(CometEvent cometEvent)
Hack to support Tomcat 7 AIO |
void |
event(HttpEvent httpEvent)
Hack to support JBossWeb AIO like other WebServer. |
AtmosphereFramework |
framework()
|
void |
init(javax.servlet.ServletConfig sc)
|
| 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 org.atmosphere.di.ServletContextProvider |
|---|
getServletContext |
| Methods inherited from interface javax.servlet.Servlet |
|---|
getServletConfig, getServletInfo, service |
| Field Detail |
|---|
protected static final org.slf4j.Logger logger
protected AtmosphereFramework framework
| Constructor Detail |
|---|
public AtmosphereServlet()
public AtmosphereServlet(boolean isFilter)
isFilter - true if this instance is used as an AtmosphereFilter
public AtmosphereServlet(boolean isFilter,
boolean autoDetectHandlers)
isFilter - true if this instance is used as an AtmosphereFilter| Method Detail |
|---|
public void destroy()
destroy in interface javax.servlet.Servletdestroy in class javax.servlet.GenericServlet
public void init(javax.servlet.ServletConfig sc)
throws javax.servlet.ServletException
init in interface javax.servlet.Servletinit in class javax.servlet.GenericServletjavax.servlet.ServletExceptionpublic AtmosphereFramework framework()
public void doHead(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException,
javax.servlet.ServletException
AsyncSupport
doHead in class javax.servlet.http.HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
javax.servlet.ServletException
public void doOptions(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException,
javax.servlet.ServletException
AsyncSupport
doOptions in class javax.servlet.http.HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
javax.servlet.ServletException
public void doTrace(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException,
javax.servlet.ServletException
AsyncSupport
doTrace in class javax.servlet.http.HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
javax.servlet.ServletException
public void doDelete(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException,
javax.servlet.ServletException
AsyncSupport
doDelete in class javax.servlet.http.HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
javax.servlet.ServletException
public void doPut(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException,
javax.servlet.ServletException
AsyncSupport
doPut in class javax.servlet.http.HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
javax.servlet.ServletException
public void doGet(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException,
javax.servlet.ServletException
AsyncSupport
doGet in class javax.servlet.http.HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
javax.servlet.ServletException
public void doPost(javax.servlet.http.HttpServletRequest req,
javax.servlet.http.HttpServletResponse res)
throws IOException,
javax.servlet.ServletException
AsyncSupport
doPost in class javax.servlet.http.HttpServletreq - the HttpServletRequestres - the HttpServletResponse
IOException
javax.servlet.ServletException
public void event(CometEvent cometEvent)
throws IOException,
javax.servlet.ServletException
Servlet implements the interface
CometProcessor without invoking Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
cometEvent - the CometEvent
IOException
javax.servlet.ServletException
public void event(CometEvent cometEvent)
throws IOException,
javax.servlet.ServletException
event in interface CometProcessorIOException
javax.servlet.ServletException
public void event(HttpEvent httpEvent)
throws IOException,
javax.servlet.ServletException
Servlet implements the interface
HttpEventServlet without invoking Servlet.service(javax.servlet.ServletRequest, javax.servlet.ServletResponse)
event in interface HttpEventServlethttpEvent - the CometEvent
IOException
javax.servlet.ServletException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||