public class SimpleWebSocketAtmosphereHandler extends AbstractReflectorAtmosphereHandler
AtmosphereHandler which redirect the first request to the web application welcome page.
Once the WebSocket upgrade happens, this class just invoke the upgrade(AtmosphereResource) method.
Application should override the upgrade(AtmosphereResource).
Application should override the AbstractReflectorAtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent) if they do not want to reflect/send back all Websocket
messages to all connections.| Constructor and Description |
|---|
SimpleWebSocketAtmosphereHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy this handler
|
void |
onRequest(AtmosphereResource r)
This method redirect the request to the server main page (index.html, index.jsp, etc.) and then execute the
upgrade(AtmosphereResource). |
void |
upgrade(AtmosphereResource resource)
WebSocket upgrade.
|
onStateChange, postStateChangepublic final void onRequest(AtmosphereResource r) throws java.io.IOException
upgrade(AtmosphereResource).r - The AtmosphereResourcejava.io.IOExceptionpublic void upgrade(AtmosphereResource resource) throws java.io.IOException
Broadcaster, BroadcastFilter , BroadcasterCache etc.resource - an AtmosphereResourcejava.io.IOExceptionpublic void destroy()
AtmosphereHandlerCopyright © 2018. All Rights Reserved.