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, wait
service
protected 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
AsyncSupport
ServletConfig
init
in interface AsyncSupport<AtmosphereResourceImpl>
sc
- the ServletConfig
javax.servlet.ServletException
protected 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 AtmosphereRequest
response
- the AtmosphereResponse
IOException
javax.servlet.ServletException
protected void shutdown()
public void action(AtmosphereResourceImpl r)
AsyncSupport
Action
from an ActionEvent
operation like suspend, resume or timed out.action
in interface AsyncSupport<AtmosphereResourceImpl>
r
- An instance of Action
public AsyncSupport complete(AtmosphereResourceImpl r)
AsyncSupport
AtmosphereResource
complete
in interface AsyncSupport<AtmosphereResourceImpl>
r
- AtmosphereResource
public 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 AtmosphereResponse
AtmosphereHandler
mapped to the passed servlet-path.javax.servlet.ServletException
public 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 AtmosphereRequest
response
- the AtmosphereResponse
IOException
javax.servlet.ServletException
public 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 AtmosphereRequest
res
- the AtmosphereResponse
IOException
javax.servlet.ServletException
public boolean completeLifecycle(AtmosphereResource r, boolean cancelled)
AtmosphereResource
by invoking it's associated AtmosphereHandler.onStateChange(AtmosphereResourceEvent)
r
- an AtmosphereResource
cancelled
- true if cancelled, false if timedoutprotected void invokeAtmosphereHandler(AtmosphereResourceImpl r) throws IOException
AtmosphereHandler
. This method must be synchronized on an AtmosphereResource.r
- a AtmosphereResourceImpl
IOException
public 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 AtmosphereRequest
res
- the AtmosphereResponse
IOException
javax.servlet.ServletException
public void endRequest(AtmosphereResourceImpl r, boolean cancel)
public boolean supportWebSocket()
AsyncSupport
supportWebSocket
in interface AsyncSupport<AtmosphereResourceImpl>
Copyright © 2016. All rights reserved.