org.atmosphere.cpr
Interface AtmosphereResourceEventListener

All Known Subinterfaces:
WebSocketEventListener
All Known Implementing Classes:
AtmosphereResourceEventListenerAdapter, PaddingAtmosphereInterceptor.ForcePreSuspend, WebSocketEventListenerAdapter

public interface AtmosphereResourceEventListener

Receive notifications when resume, client disconnect or broadcast events occur.

Author:
Jeanfrancois Arcand

Method Summary
 void onBroadcast(AtmosphereResourceEvent event)
          Invoked when a Broadcaster.broadcast(java.lang.Object) occurs.
 void onClose(AtmosphereResourceEvent event)
          Invoked when AtmosphereResource.close() gets called.
 void onDisconnect(AtmosphereResourceEvent event)
          Invoked when the remote connection gets closed.
 void onPreSuspend(AtmosphereResourceEvent event)
          Invoked when the AtmosphereResource.suspend() is in the process of being suspended but nothing has yet been written on the connection.
 void onResume(AtmosphereResourceEvent event)
          Invoked when the AtmosphereResource.resume() is invoked or when the suspend's time out expires.
 void onSuspend(AtmosphereResourceEvent event)
          Invoked when the AtmosphereResource.suspend() has been completed and the response is considered as suspended.
 void onThrowable(AtmosphereResourceEvent event)
          Invoked when an operations failed to execute for an unknown reason (eg.
 

Method Detail

onPreSuspend

void onPreSuspend(AtmosphereResourceEvent event)
Invoked when the AtmosphereResource.suspend() is in the process of being suspended but nothing has yet been written on the connection. An implementation could configure the request's headers, flush some data, etc. during that stage.

Parameters:
event - a AtmosphereResourceEvent

onSuspend

void onSuspend(AtmosphereResourceEvent event)
Invoked when the AtmosphereResource.suspend() has been completed and the response is considered as suspended.

Parameters:
event - a AtmosphereResourceEvent

onResume

void onResume(AtmosphereResourceEvent event)
Invoked when the AtmosphereResource.resume() is invoked or when the suspend's time out expires.

Parameters:
event - a AtmosphereResourceEvent

onDisconnect

void onDisconnect(AtmosphereResourceEvent event)
Invoked when the remote connection gets closed.

Parameters:
event - a AtmosphereResourceEvent

onBroadcast

void onBroadcast(AtmosphereResourceEvent event)
Invoked when a Broadcaster.broadcast(java.lang.Object) occurs.

Parameters:
event - a AtmosphereResourceEvent

onThrowable

void onThrowable(AtmosphereResourceEvent event)
Invoked when an operations failed to execute for an unknown reason (eg. IOException because the client remotely closed the connection, a broken connection, etc.).

Parameters:
event - a AtmosphereResourceEvent

onClose

void onClose(AtmosphereResourceEvent event)
Invoked when AtmosphereResource.close() gets called.

Parameters:
event - a AtmosphereResourceEvent


Copyright © 2013. All Rights Reserved.