public abstract class AbstractReflectorAtmosphereHandler extends Object implements AtmosphereServletProcessor
AtmosphereHandler that reflect every call to
Broadcaster.broadcast(java.lang.Object), eg sent the broadcasted event back to the remote client. All broadcasts will be by default returned
as it is to the suspended AtmosphereResponseImpl.getOutputStream()
or AtmosphereResponseImpl.getWriter().| Modifier and Type | Class and Description |
|---|---|
static class |
AbstractReflectorAtmosphereHandler.Default
This default implementation does nothing when
AbstractReflectorAtmosphereHandler.Default.onRequest(org.atmosphere.cpr.AtmosphereResource) is called. |
| Constructor and Description |
|---|
AbstractReflectorAtmosphereHandler() |
| Modifier and Type | Method and Description |
|---|---|
void |
destroy()
Destroy this handler
|
void |
init(AtmosphereConfig config)
Initialize the
AtmosphereServletProcessor using the ServletConfig. |
void |
onStateChange(AtmosphereResourceEvent event)
Write the
AtmosphereResourceEvent.getMessage() back to the client using
the AtmosphereResponseImpl.getOutputStream() or AtmosphereResponseImpl.getWriter(). |
protected void |
postStateChange(AtmosphereResourceEvent event)
Inspect the event and decide if the underlying connection must be resumed.
|
protected boolean |
useTwoStepWrite(AtmosphereResourceEvent event) |
protected void |
write(AtmosphereResourceEvent event,
javax.servlet.ServletOutputStream o,
byte[] data) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitonRequestpublic void onStateChange(AtmosphereResourceEvent event) throws IOException
AtmosphereResourceEvent.getMessage() back to the client using
the AtmosphereResponseImpl.getOutputStream() or AtmosphereResponseImpl.getWriter().
If a Serializer is defined, it will be invoked and the write operation
will be delegated to it.
By default, this method will try to use AtmosphereResponseImpl.getWriter().onStateChange in interface AtmosphereHandlerevent - the AtmosphereResourceEvent.getMessage()IOExceptionprotected void write(AtmosphereResourceEvent event, javax.servlet.ServletOutputStream o, byte[] data) throws IOException
IOExceptionprotected boolean useTwoStepWrite(AtmosphereResourceEvent event)
protected final void postStateChange(AtmosphereResourceEvent event)
event - public void destroy()
AtmosphereHandlerdestroy in interface AtmosphereHandlerpublic void init(AtmosphereConfig config) throws javax.servlet.ServletException
AtmosphereServletProcessorAtmosphereServletProcessor using the ServletConfig.init in interface AtmosphereServletProcessorconfig - the ServletConfigjavax.servlet.ServletExceptionCopyright © 2016. All rights reserved.