org.atmosphere.handler
Class SimpleWebSocketAtmosphereHandler
java.lang.Object
org.atmosphere.handler.AbstractReflectorAtmosphereHandler
org.atmosphere.handler.SimpleWebSocketAtmosphereHandler
- All Implemented Interfaces:
- AtmosphereHandler
public class SimpleWebSocketAtmosphereHandler
- extends AbstractReflectorAtmosphereHandler
Simple 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.
- Author:
- Jeanfrancois Arcand
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SimpleWebSocketAtmosphereHandler
public SimpleWebSocketAtmosphereHandler()
onRequest
public final void onRequest(AtmosphereResource r)
throws IOException
- This method redirect the request to the server main page (index.html, index.jsp, etc.) and then execute the
upgrade(AtmosphereResource).
- Parameters:
r - The AtmosphereResource
- Throws:
IOException
upgrade
public void upgrade(AtmosphereResource resource)
throws IOException
- WebSocket upgrade. This is usually inside that method that you decide if a connection
needs to be suspended or not. Override this method for specific operations like configuring their own
Broadcaster, BroadcastFilter , BroadcasterCache etc.
- Parameters:
resource - an AtmosphereResource
- Throws:
IOException
destroy
public void destroy()
- Description copied from interface:
AtmosphereHandler
- Destroy this handler
Copyright © 2012. All Rights Reserved.