|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.cpr.AsynchronousProcessor
public abstract class AsynchronousProcessor
Base class which implement the semantics of suspending and resuming of a Comet/WebSocket Request.
| Nested Class Summary | |
|---|---|
static class |
AsynchronousProcessor.AsynchronousProcessorHook
An Callback class that can be used by Framework integrator to handle the close/timedout/resume life cycle of an AtmosphereResource. |
| Field Summary | |
|---|---|
protected ConcurrentHashMap<AtmosphereRequest,AtmosphereResource> |
aliveRequests
|
protected static AtmosphereFramework.Action |
cancelledAction
|
protected AtmosphereConfig |
config
|
protected static AtmosphereFramework.Action |
timedoutAction
|
| Constructor Summary | |
|---|---|
AsynchronousProcessor(AtmosphereConfig config)
|
|
| Method Summary | |
|---|---|
void |
action(AtmosphereResourceImpl r)
Process an AtmosphereFramework.Action from an ActionEvent operation like suspend, resume or timed out. |
AtmosphereFramework.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. |
static void |
destroyResource(AtmosphereResource r)
|
String |
getContainerName()
Return the container's name. |
void |
init(javax.servlet.ServletConfig sc)
Initialize the WebServer using the ServletConfig |
protected AtmosphereFramework.AtmosphereHandlerWrapper |
map(AtmosphereRequest req)
Return the AtmosphereHandler mapped to the passed servlet-path. |
protected AtmosphereFramework.AtmosphereHandlerWrapper |
map(String path)
|
AtmosphereFramework.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. |
AtmosphereFramework.Action |
suspended(AtmosphereRequest request,
AtmosphereResponse response)
All proprietary Comet based Servlet must invoke the suspended
method when the first request comes in. |
AtmosphereFramework.Action |
timedout(AtmosphereRequest request,
AtmosphereResponse response)
All proprietary Comet based Servlet must invoke the timedout
method when the underlying WebServer time out the AtmosphereResponse. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.atmosphere.cpr.AsyncSupport |
|---|
service |
| Field Detail |
|---|
protected static final AtmosphereFramework.Action timedoutAction
protected static final AtmosphereFramework.Action cancelledAction
protected final AtmosphereConfig config
protected final ConcurrentHashMap<AtmosphereRequest,AtmosphereResource> aliveRequests
| Constructor Detail |
|---|
public AsynchronousProcessor(AtmosphereConfig config)
| Method Detail |
|---|
public void init(javax.servlet.ServletConfig sc)
throws javax.servlet.ServletException
AsyncSupportServletConfig
init in interface AsyncSupport<AtmosphereResourceImpl>sc - the ServletConfig
javax.servlet.ServletExceptionprotected boolean supportSession()
HttpSession supported
public String getContainerName()
getContainerName in interface AsyncSupport<AtmosphereResourceImpl>
public AtmosphereFramework.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
AtmosphereFramework.Action, tells the proprietary Comet Servlet
to suspended or not the current AtmosphereResponse.
request - the AtmosphereRequestresponse - the AtmosphereResponse
IOException
javax.servlet.ServletExceptionpublic void action(AtmosphereResourceImpl r)
AtmosphereFramework.Action from an ActionEvent operation like suspend, resume or timed out.
action in interface AsyncSupport<AtmosphereResourceImpl>r - An instance of AtmosphereFramework.Actionprotected AtmosphereFramework.AtmosphereHandlerWrapper map(String path)
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 AtmosphereFramework.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
AtmosphereFramework.Action, tells the proprietary Comet Servlet
to resume (again), suspended or do nothing with the current AtmosphereResponse.
request - the AtmosphereRequestresponse - the AtmosphereResponse
IOException
javax.servlet.ServletException
public AtmosphereFramework.Action timedout(AtmosphereRequest request,
AtmosphereResponse response)
throws IOException,
javax.servlet.ServletException
Servlet must invoke the timedout
method when the underlying WebServer time out the AtmosphereResponse.
The returned value, of type
AtmosphereFramework.Action, tells the proprietary Comet Servlet
to resume (again), suspended or do nothing with the current AtmosphereResponse.
request - the AtmosphereRequestresponse - the AtmosphereResponse
IOException
javax.servlet.ServletExceptionpublic static void destroyResource(AtmosphereResource r)
public AtmosphereFramework.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 AtmosphereResponse
IOException
javax.servlet.ServletExceptionprotected void shutdown()
public boolean supportWebSocket()
AsyncSupport
supportWebSocket in interface AsyncSupport<AtmosphereResourceImpl>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||