org.atmosphere.handler
Class AbstractReflectorAtmosphereHandler

java.lang.Object
  extended by org.atmosphere.handler.AbstractReflectorAtmosphereHandler
All Implemented Interfaces:
AtmosphereHandler<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
Direct Known Subclasses:
ReflectorServletProcessor

public abstract class AbstractReflectorAtmosphereHandler
extends Object
implements AtmosphereHandler<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>

Simple AtmosphereHandler that relect every call to Broadcaster.broadcast(java.lang.Object). All broadcast will be by default returned as it is to the suspended ServletResponse.getOutputStream() or ServletResponse.getWriter()

Author:
Jean-francois Arcand

Constructor Summary
AbstractReflectorAtmosphereHandler()
           
 
Method Summary
 void onStateChange(AtmosphereResourceEvent<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse> event)
          Write the AtmosphereResourceEvent.getMessage() back to the client using the ServletResponse.getOutputStream() or ServletResponse.getWriter().
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.atmosphere.cpr.AtmosphereHandler
onRequest
 

Constructor Detail

AbstractReflectorAtmosphereHandler

public AbstractReflectorAtmosphereHandler()
Method Detail

onStateChange

public void onStateChange(AtmosphereResourceEvent<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse> event)
                   throws IOException
Write the AtmosphereResourceEvent.getMessage() back to the client using the ServletResponse.getOutputStream() or ServletResponse.getWriter(). If a Serializer is defined, it will be invoked and the writ operation will be delagated to to it. By default, this method will try to use ServletResponse.getWriter().

Specified by:
onStateChange in interface AtmosphereHandler<javax.servlet.http.HttpServletRequest,javax.servlet.http.HttpServletResponse>
Parameters:
event - the AtmosphereResourceEvent.getMessage()
Throws:
IOException


Copyright © 2010 SUN Microsystems. All Rights Reserved.