org.atmosphere.socketio.cpr
Class SocketIOAtmosphereHandler

java.lang.Object
  extended by org.atmosphere.socketio.cpr.SocketIOAtmosphereHandler
All Implemented Interfaces:
AtmosphereHandler

public abstract class SocketIOAtmosphereHandler
extends Object
implements AtmosphereHandler

Author:
Sebastien Dionne : sebastien.dionne@gmail.com, Jeanfrancois Arcand

Field Summary
static String SOCKETIO_SESSION_ID
           
static String SOCKETIO_SESSION_OUTBOUND
           
 
Constructor Summary
SocketIOAtmosphereHandler()
           
 
Method Summary
 void destroy()
           
abstract  void onConnect(AtmosphereResource event, SocketIOSessionOutbound handler)
          Called when the connection is established.
abstract  void onDisconnect(AtmosphereResource event, SocketIOSessionOutbound handler, DisconnectReason reason)
          Called when the socket connection is disconnected.
abstract  void onMessage(AtmosphereResource event, SocketIOSessionOutbound handler, String message)
          Called for each message received.
 void onRequest(AtmosphereResource event)
          
 void onStateChange(AtmosphereResourceEvent event)
          
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SOCKETIO_SESSION_OUTBOUND

public static final String SOCKETIO_SESSION_OUTBOUND
See Also:
Constant Field Values

SOCKETIO_SESSION_ID

public static final String SOCKETIO_SESSION_ID
Constructor Detail

SocketIOAtmosphereHandler

public SocketIOAtmosphereHandler()
Method Detail

onConnect

public abstract void onConnect(AtmosphereResource event,
                               SocketIOSessionOutbound handler)
                        throws IOException
Called when the connection is established.

Parameters:
handler - The SocketOutbound associated with the connection
Throws:
IOException

onDisconnect

public abstract void onDisconnect(AtmosphereResource event,
                                  SocketIOSessionOutbound handler,
                                  DisconnectReason reason)
Called when the socket connection is disconnected.

Parameters:
event - AtmosphereResource
handler - outbound handler to broadcast response
reason - The reason for the disconnect.

onMessage

public abstract void onMessage(AtmosphereResource event,
                               SocketIOSessionOutbound handler,
                               String message)
Called for each message received.

Parameters:
event - AtmosphereResource
handler - outbound handler to broadcast response
message - message received

onRequest

public final void onRequest(AtmosphereResource event)
                     throws IOException

Specified by:
onRequest in interface AtmosphereHandler
Throws:
IOException

onStateChange

public final void onStateChange(AtmosphereResourceEvent event)
                         throws IOException

Specified by:
onStateChange in interface AtmosphereHandler
Throws:
IOException

destroy

public void destroy()
Specified by:
destroy in interface AtmosphereHandler


Copyright © 2013. All Rights Reserved.