org.atmosphere.container
Class BlockingIOCometSupport
java.lang.Object
org.atmosphere.cpr.AsynchronousProcessor
org.atmosphere.container.BlockingIOCometSupport
- All Implemented Interfaces:
- AsyncSupport<AtmosphereResourceImpl>
- Direct Known Subclasses:
- Tomcat7BIOSupportWithWebSocket
public class BlockingIOCometSupport
- extends AsynchronousProcessor
This class is used when the AtmosphereFramework fails to autodetect
the Servlet Container we are running on.
This AsyncSupport implementation uses a blocking approach, meaning
the request thread will be blocked until another Thread invoke the Broadcaster.broadcast(java.lang.Object).
- Author:
- Jeanfrancois Arcand
| Methods inherited from class org.atmosphere.cpr.AsynchronousProcessor |
completeLifecycle, getContainerName, init, invokeAtmosphereHandler, map, resumed, shutdown, supportSession, supportWebSocket, suspended, timedout, trackActiveRequest |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LATCH
protected static final String LATCH
BlockingIOCometSupport
public BlockingIOCometSupport(AtmosphereConfig config)
service
public Action service(AtmosphereRequest req,
AtmosphereResponse res)
throws IOException,
javax.servlet.ServletException
- Description copied from interface:
AsyncSupport
- Serve the
AtmosphereRequest and the AtmosphereResponse and return
the appropriate Action.
- Parameters:
req - the AtmosphereRequestres - the AtmosphereResponse
- Returns:
- the
Action that was manipulated by the AtmosphereHandler
- Throws:
IOException
javax.servlet.ServletException
suspend
protected void suspend(Action action,
AtmosphereRequest req,
AtmosphereResponse res)
throws IOException,
javax.servlet.ServletException
- Suspend the connection by blocking the current
Thread
- Parameters:
action - The Actionreq - the AtmosphereRequestres - the AtmosphereResponse
- Throws:
IOException
javax.servlet.ServletException
cancelled
public Action cancelled(AtmosphereRequest req,
AtmosphereResponse res)
throws IOException,
javax.servlet.ServletException
- Description copied from class:
AsynchronousProcessor
- All proprietary Comet based
Servlet must invoke the cancelled method when the underlying WebServer
detect that the client closed the connection.
- Overrides:
cancelled in class AsynchronousProcessor
- Parameters:
req - the AtmosphereRequestres - the AtmosphereResponse
- Returns:
- action the Action operation.
- Throws:
IOException
javax.servlet.ServletException
action
public void action(AtmosphereResourceImpl r)
- Description copied from interface:
AsyncSupport
- Process an
Action from an ActionEvent operation like suspend, resume or timed out.
- Specified by:
action in interface AsyncSupport<AtmosphereResourceImpl>- Overrides:
action in class AsynchronousProcessor
- Parameters:
r - An instance of Action
Copyright © 2014. All Rights Reserved.