org.atmosphere.cpr
Interface AtmosphereResourceEvent<E,F>

All Known Implementing Classes:
AtmosphereResourceEventImpl

public interface AtmosphereResourceEvent<E,F>

An AtmosphereResourceEvent is created every time an event occurs like when a Broadcaster.broadcast(java.lang.Object) is executed, when a Browser close remotly close the connection or when a suspended times out or gets resumed. When such events occcurs, an instance of that class will be created and its associated AtmosphereHandler.onStateChange(org.atmosphere.cpr.AtmosphereResourceEvent) will be invoked.

Author:
Jeanfrancois Arcand

Method Summary
 Object getMessage()
          Return the object that were pass to Broadcaster.broadcast(java.lang.Object)
 AtmosphereResource<E,F> getResource()
          Return the AtmosphereResource associated with this event
 boolean isCancelled()
          Return true when the remote client close the connection.
 boolean isResumedOnTimeout()
          Return true is the response gets resumed after a timeout.
 boolean isResuming()
          Return true if that AtmosphereResource.resume() has been invoked
 boolean isSuspended()
          Return true if that AtmosphereResource.suspend() has been invoked and set to true
 void setMessage(Object o)
          Set an Object that can be retrieved with getMessage().
 void write(OutputStream os, Object o)
          Write the Object using the OutputStream by invoking the current Serializer.
 

Method Detail

getMessage

Object getMessage()
Return the object that were pass to Broadcaster.broadcast(java.lang.Object)

Returns:
the object that were pass to Broadcaster.broadcast(java.lang.Object)

setMessage

void setMessage(Object o)
Set an Object that can be retrieved with getMessage(). Note that the value may be overridden when Broadcaster.broadcast(java.lang.Object) gets invoked.

Parameters:
o - an Object that can be retrieved with getMessage().

isResumedOnTimeout

boolean isResumedOnTimeout()
Return true is the response gets resumed after a timeout.

Returns:
true is the response gets resumed after a timeout.

isCancelled

boolean isCancelled()
Return true when the remote client close the connection.

Returns:
true when the remote client close the connection.

isSuspended

boolean isSuspended()
Return true if that AtmosphereResource.suspend() has been invoked and set to true

Returns:
true if that AtmosphereResource.suspend() has been invoked and set to true

isResuming

boolean isResuming()
Return true if that AtmosphereResource.resume() has been invoked

Returns:
true if that AtmosphereResource.resume() has been invoked and set to true

getResource

AtmosphereResource<E,F> getResource()
Return the AtmosphereResource associated with this event

Returns:
AtmosphereResource

write

void write(OutputStream os,
           Object o)
           throws IOException
Write the Object using the OutputStream by invoking the current Serializer. If Serializer is null, the Object will be directly written using the {

Parameters:
os - OutputStream
o - Object
Throws:
IOException


Copyright © 2011. All Rights Reserved.