|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.cpr.AtmosphereEventImpl
public class AtmosphereEventImpl
AtmosphereEvent implementation for supporting HttpServletRequest
and HttpServletResponse.
| Field Summary | |
|---|---|
protected AtmosphereServlet.Action |
action
|
protected Broadcaster |
broadcaster
|
protected CometSupport |
cometSupport
|
protected boolean |
isResumedOnTimeout
|
protected Object |
message
|
| Constructor Summary | |
|---|---|
AtmosphereEventImpl(AtmosphereServlet.AtmosphereConfig config,
Broadcaster broadcaster,
HttpServletRequest req,
HttpServletResponse res,
CometSupport cometSupport)
Create an AtmosphereEvent. |
|
| Method Summary | |
|---|---|
AtmosphereServlet.Action |
action()
Return the AtmosphereServlet.Action which represent the state of the response,
e.g. |
AtmosphereServlet.AtmosphereConfig |
getAtmosphereConfig()
Return the AtmosphereServlet.AtmosphereConfig |
Broadcaster |
getBroadcaster()
Return the current Broadcaster |
Object |
getMessage()
Return the object that were pass to Broadcaster.broadcast(java.lang.Object) |
HttpServletRequest |
getRequest()
Return the underlying |
HttpServletResponse |
getResponse()
Return the underlying |
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/tt> if that AtmosphereEvent.resume() has been
invoked |
boolean |
isSuspended()
Return true/tt> if that AtmosphereEvent.suspend() has been
invoked and set to true |
protected void |
reset(HttpServletRequest req,
HttpServletResponse res)
|
void |
resume()
Complete the HttpServletResponse and finish/commit it. |
void |
setBroadcaster(Broadcaster broadcaster)
Set the current Broadcaster |
protected void |
setCancelled(boolean isCancelled)
|
protected void |
setMessage(Object message)
Set the message broadacasted using Broadcaster.broadcast(java.lang.Object) |
void |
suspend()
Suspend the HttpServletResponse indefinitely. |
void |
suspend(long timeout)
Suspend the HttpServletResponse. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected AtmosphereServlet.Action action
protected Broadcaster broadcaster
protected Object message
protected boolean isResumedOnTimeout
protected CometSupport cometSupport
| Constructor Detail |
|---|
public AtmosphereEventImpl(AtmosphereServlet.AtmosphereConfig config,
Broadcaster broadcaster,
HttpServletRequest req,
HttpServletResponse res,
CometSupport cometSupport)
AtmosphereEvent.
config - broadcaster - The Broadcaster.req - The HttpServletRequestres - The HttpServletResponse| Method Detail |
|---|
public void resume()
HttpServletResponse and finish/commit it. If the
HttpServletResponse is in the process of being resumed, invoking
that method has no effect.
resume in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>public boolean isResuming()
AtmosphereEvent.resume() has been
invoked
isResuming in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>AtmosphereEvent.resume() has been
invoked and set to truepublic boolean isSuspended()
AtmosphereEvent.suspend() has been
invoked and set to true
isSuspended in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>AtmosphereEvent.suspend() has been
invoked and set to truepublic 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.
suspend in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>public 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.
suspend in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>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 AtmosphereEvent.resume()
or AtmosphereEvent#cancel()), the HttpServletResponse will be automatically
resumed and commited. Usage of any methods of a HttpServletResponse that
times out will throw an IllegalStateException.public HttpServletRequest getRequest()
getRequest in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>public HttpServletResponse getResponse()
getResponse in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>public Broadcaster getBroadcaster()
Broadcaster
getBroadcaster in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>public void setBroadcaster(Broadcaster broadcaster)
Broadcaster
setBroadcaster in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>
protected void reset(HttpServletRequest req,
HttpServletResponse res)
public Object getMessage()
Broadcaster.broadcast(java.lang.Object)
getMessage in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>Broadcaster.broadcast(java.lang.Object)protected void setMessage(Object message)
Broadcaster.broadcast(java.lang.Object)
message - The message broadacasted using Broadcaster.broadcast(java.lang.Object)public AtmosphereServlet.AtmosphereConfig getAtmosphereConfig()
AtmosphereServlet.AtmosphereConfig
getAtmosphereConfig in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>AtmosphereServlet.AtmosphereConfigpublic boolean isResumedOnTimeout()
isResumedOnTimeout in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>public AtmosphereServlet.Action action()
AtmosphereServlet.Action which represent the state of the response,
e.g. suspended, resumed or timedout.
public boolean isCancelled()
isCancelled in interface AtmosphereEvent<HttpServletRequest,HttpServletResponse>protected void setCancelled(boolean isCancelled)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||