Package org.atmosphere.handler
Class AtmosphereHandlerAdapter
- java.lang.Object
-
- org.atmosphere.handler.AtmosphereHandlerAdapter
-
- All Implemented Interfaces:
AtmosphereHandler
public class AtmosphereHandlerAdapter extends java.lang.Object implements AtmosphereHandler
An implementation ofAtmosphereHandlerthat does nothing.- Author:
- Jeanfrancois Arcand
-
-
Constructor Summary
Constructors Constructor Description AtmosphereHandlerAdapter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voiddestroy()Destroy this handlervoidonRequest(AtmosphereResource resource)When a client sends a request to its associatedAtmosphereHandler, it can decide if the underlying connection can be suspended (creating a Continuation) or handle the connection synchronously.voidonStateChange(AtmosphereResourceEvent event)This method is invoked when theBroadcasterexecutes a broadcast operation.
-
-
-
Method Detail
-
onRequest
public void onRequest(AtmosphereResource resource) throws java.io.IOException
Description copied from interface:AtmosphereHandlerWhen a client sends a request to its associatedAtmosphereHandler, it can decide if the underlying connection can be suspended (creating a Continuation) or handle the connection synchronously. It is recommended to only suspend requests for which HTTP method is a GET and use the POST method to send data to the server, without marking the connection as asynchronous.- Specified by:
onRequestin interfaceAtmosphereHandler- Parameters:
resource- anAtmosphereResource- Throws:
java.io.IOException
-
onStateChange
public void onStateChange(AtmosphereResourceEvent event) throws java.io.IOException
Description copied from interface:AtmosphereHandlerThis method is invoked when theBroadcasterexecutes a broadcast operation. When this method is invoked its associatedBroadcaster, any suspended connection will be allowed to write the data back to its associated clients. This method will also be invoked when a response get resumed, e.g. whenAtmosphereResource.resume()gets invoked. In that case,AtmosphereResourceEvent.isResuming()will return true. This method will also be invoked when theAtmosphereResource.suspend(long)expires. In that case,AtmosphereResourceEvent.isResumedOnTimeout()will return true.- Specified by:
onStateChangein interfaceAtmosphereHandler- Parameters:
event- anAtmosphereResourceEvent- Throws:
java.io.IOException
-
destroy
public void destroy()
Description copied from interface:AtmosphereHandlerDestroy this handler- Specified by:
destroyin interfaceAtmosphereHandler
-
-