|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface AtmosphereResource<E,F>
A AtmosphereResource encapsulates the mechanism to suspend(),
resume() and broadcast (getBroadcaster()) messages among
suspended response. AtmosphereResource are passed at runtime to an
instance of AtmosphereHandler.
| Method Summary | |
|---|---|
AtmosphereServlet.AtmosphereConfig |
getAtmosphereConfig()
Return the AtmosphereServlet.AtmosphereConfig |
Broadcaster |
getBroadcaster()
Return the current Broadcaster |
E |
getRequest()
Return the underlying |
F |
getResponse()
Return the underlying |
Serializer |
getSerializer()
Get the Serializer or null if not defined. |
void |
resume()
Complete the HttpServletResponse and finish/commit it. |
void |
setBroadcaster(Broadcaster broadcaster)
Set the current Broadcaster |
void |
setSerializer(Serializer s)
Set the Serializer to use when write(java.io.OutputStream, java.lang.Object)
execute the operation. |
void |
suspend()
Suspend the HttpServletResponse indefinitely. |
void |
suspend(long timeout)
Suspend the HttpServletResponse. |
void |
write(OutputStream os,
Object o)
Write the Object using the OuputStream by invoking
the current Serializer. |
| Method Detail |
|---|
void resume()
HttpServletResponse and finish/commit it. If the
HttpServletResponse is in the process of being resumed, invoking
that method has no effect.
void suspend()
HttpServletResponse indefinitely.
Suspending a HttpServletResponse will
tell the underlying container to avoid recycling objects associated with
the current instance, and also to avoid commiting response.
void suspend(long timeout)
HttpServletResponse. Suspending a HttpServletResponse will
tell the underlying container to avoid recycling objects associated with
the current instance, and also to avoid commiting response. Invoking
this method when a request is being timed out, e.g. isResumedOnTimeout return true,
has no effect.
timeout - The maximum amount of time, in milliseconds,
a HttpServletResponse can be suspended. When the timeout expires (because
nothing has been written or because the resume()
or AtmosphereResource#cancel()), the HttpServletResponse will be automatically
resumed and commited. Usage of any methods of a HttpServletResponse that
times out will throw an IllegalStateException.E getRequest()
F getResponse()
AtmosphereServlet.AtmosphereConfig getAtmosphereConfig()
AtmosphereServlet.AtmosphereConfig
AtmosphereServlet.AtmosphereConfigBroadcaster getBroadcaster()
Broadcaster
void setBroadcaster(Broadcaster broadcaster)
Broadcaster
void setSerializer(Serializer s)
Serializer to use when write(java.io.OutputStream, java.lang.Object)
execute the operation. By default, the Serializer is null.
s - the Serializer
void write(OutputStream os,
Object o)
throws IOException
Object using the OuputStream by invoking
the current Serializer. If Serializer is null, the Object
will be directly written using the {
os - OuputStreamo - Object
IOExceptionSerializer getSerializer()
Serializer or null if not defined.
Serializer or null if not defined.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||