public abstract class AsynchronousProcessor extends Object implements AsyncSupport<AtmosphereResourceImpl>
| Modifier and Type | Field and Description |
|---|---|
protected static Action |
cancelledAction |
protected AtmosphereConfig |
config |
protected static Action |
timedoutAction |
| Constructor and Description |
|---|
AsynchronousProcessor(AtmosphereConfig config) |
| Modifier and Type | Method and Description |
|---|---|
void |
action(AtmosphereResourceImpl r)
Process an
Action from an ActionEvent operation like suspend, resume or timed out. |
protected boolean |
allowSessionTimeoutRemoval()
Is
HttpSession timeout removal supported |
Action |
cancelled(AtmosphereRequest req,
AtmosphereResponse res)
All proprietary Comet based
Servlet must invoke the cancelled method when the underlying WebServer
detect that the client closed the connection. |
AsyncSupport |
complete(AtmosphereResourceImpl r)
Complete and close the connection associated with an implementation of
AtmosphereResource |
boolean |
completeLifecycle(AtmosphereResource r,
boolean cancelled)
Cancel or times out an
AtmosphereResource by invoking it's associated AtmosphereHandler.onStateChange(AtmosphereResourceEvent) |
void |
endRequest(AtmosphereResourceImpl r,
boolean cancel) |
String |
getContainerName()
Return the container's name.
|
void |
init(javax.servlet.ServletConfig sc)
Initialize the WebServer using the
ServletConfig |
protected void |
invokeAtmosphereHandler(AtmosphereResourceImpl r)
Invoke the associated
AtmosphereHandler. |
Action |
invokeInterceptors(List<AtmosphereInterceptor> c,
AtmosphereResource r,
int tracing) |
protected AtmosphereFramework.AtmosphereHandlerWrapper |
map(AtmosphereRequest req)
Return the
AtmosphereHandler mapped to the passed servlet-path. |
void |
postInterceptors(List<AtmosphereInterceptor> c,
AtmosphereResource r) |
Action |
resumed(AtmosphereRequest request,
AtmosphereResponse response)
All proprietary Comet based
Servlet must invoke the resume method when the Atmosphere's application
decide to resume the AtmosphereResponse. |
protected void |
shutdown() |
protected boolean |
supportSession()
Is
HttpSession supported |
boolean |
supportWebSocket()
Return true if this implementation supports the websocket protocol.
|
Action |
suspended(AtmosphereRequest request,
AtmosphereResponse response)
All proprietary Comet based
Servlet must invoke the suspended method when the first request comes in. |
Action |
timedout(AtmosphereRequest req,
AtmosphereResponse res)
All proprietary Comet based
Servlet must invoke the timedout method when the underlying WebServer time
out the AtmosphereResponse. |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitserviceprotected static final Action timedoutAction
protected static final Action cancelledAction
protected final AtmosphereConfig config
public AsynchronousProcessor(AtmosphereConfig config)
public void init(javax.servlet.ServletConfig sc)
throws javax.servlet.ServletException
AsyncSupportServletConfiginit in interface AsyncSupport<AtmosphereResourceImpl>sc - the ServletConfigjavax.servlet.ServletExceptionprotected boolean supportSession()
HttpSession supportedprotected boolean allowSessionTimeoutRemoval()
HttpSession timeout removal supportedpublic String getContainerName()
getContainerName in interface AsyncSupport<AtmosphereResourceImpl>public Action suspended(AtmosphereRequest request, AtmosphereResponse response) throws IOException, javax.servlet.ServletException
Servlet must invoke the suspended method when the first request comes in.
The returned value, of type Action, tells the proprietary Comet Servlet to suspended or not the
current AtmosphereResponse.request - the AtmosphereRequestresponse - the AtmosphereResponseIOExceptionjavax.servlet.ServletExceptionprotected void shutdown()
public void action(AtmosphereResourceImpl r)
AsyncSupportAction from an ActionEvent operation like suspend, resume or timed out.action in interface AsyncSupport<AtmosphereResourceImpl>r - An instance of Actionpublic AsyncSupport complete(AtmosphereResourceImpl r)
AsyncSupportAtmosphereResourcecomplete in interface AsyncSupport<AtmosphereResourceImpl>r - AtmosphereResourcepublic Action invokeInterceptors(List<AtmosphereInterceptor> c, AtmosphereResource r, int tracing)
public void postInterceptors(List<AtmosphereInterceptor> c, AtmosphereResource r)
protected AtmosphereFramework.AtmosphereHandlerWrapper map(AtmosphereRequest req) throws javax.servlet.ServletException
AtmosphereHandler mapped to the passed servlet-path.req - the AtmosphereResponseAtmosphereHandler mapped to the passed servlet-path.javax.servlet.ServletExceptionpublic Action resumed(AtmosphereRequest request, AtmosphereResponse response) throws IOException, javax.servlet.ServletException
Servlet must invoke the resume method when the Atmosphere's application
decide to resume the AtmosphereResponse. The returned value, of type Action, tells the
proprietary Comet Servlet to resume (again), suspended or do nothing with the current AtmosphereResponse.request - the AtmosphereRequestresponse - the AtmosphereResponseIOExceptionjavax.servlet.ServletExceptionpublic Action timedout(AtmosphereRequest req, AtmosphereResponse res) throws IOException, javax.servlet.ServletException
Servlet must invoke the timedout method when the underlying WebServer time
out the AtmosphereResponse. The returned value, of type Action, tells the proprietary
Comet Servlet to resume (again), suspended or do nothing with the current AtmosphereResponse.req - the AtmosphereRequestres - the AtmosphereResponseIOExceptionjavax.servlet.ServletExceptionpublic boolean completeLifecycle(AtmosphereResource r, boolean cancelled)
AtmosphereResource by invoking it's associated AtmosphereHandler.onStateChange(AtmosphereResourceEvent)r - an AtmosphereResourcecancelled - true if cancelled, false if timedoutprotected void invokeAtmosphereHandler(AtmosphereResourceImpl r) throws IOException
AtmosphereHandler. This method must be synchronized on an AtmosphereResource.r - a AtmosphereResourceImplIOExceptionpublic Action cancelled(AtmosphereRequest req, AtmosphereResponse res) throws IOException, javax.servlet.ServletException
Servlet must invoke the cancelled method when the underlying WebServer
detect that the client closed the connection.req - the AtmosphereRequestres - the AtmosphereResponseIOExceptionjavax.servlet.ServletExceptionpublic void endRequest(AtmosphereResourceImpl r, boolean cancel)
public boolean supportWebSocket()
AsyncSupportsupportWebSocket in interface AsyncSupport<AtmosphereResourceImpl>Copyright © 2016. All rights reserved.