public class AtmosphereHandlerAdapter extends java.lang.Object implements AtmosphereHandler
AtmosphereHandler that does nothing.| Constructor and Description |
|---|
AtmosphereHandlerAdapter() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy this handler
|
void |
onRequest(AtmosphereResource resource)
When a client sends a request to its associated
AtmosphereHandler, it can decide if the underlying
connection can be suspended (creating a Continuation) or handle the connection synchronously. |
void |
onStateChange(AtmosphereResourceEvent event)
This method is invoked when the
Broadcaster executes a broadcast operation. |
public void onRequest(AtmosphereResource resource) throws java.io.IOException
AtmosphereHandlerAtmosphereHandler, 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.onRequest in interface AtmosphereHandlerresource - an AtmosphereResourcejava.io.IOExceptionpublic void onStateChange(AtmosphereResourceEvent event) throws java.io.IOException
AtmosphereHandlerBroadcaster executes a broadcast operation. When this method is invoked
its associated Broadcaster, 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. when AtmosphereResource.resume() gets
invoked. In that case, AtmosphereResourceEvent.isResuming() will return true.
This method will also be invoked when the AtmosphereResource.suspend(long) expires. In that case,
AtmosphereResourceEvent.isResumedOnTimeout() will return true.onStateChange in interface AtmosphereHandlerevent - an AtmosphereResourceEventjava.io.IOExceptionpublic void destroy()
AtmosphereHandlerdestroy in interface AtmosphereHandlerCopyright © 2021. All Rights Reserved.