|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.cpr.Meteor
public class Meteor
A Meteor is a simple class that can be used from a Servlet
to suspend, broadcast and resume a response. A Meteor can be created by invoking
the build() method.
Meteor.build(HttpServletRequest).suspend(-1);
A Meteor is usually created when an application need to suspend a response. A Meteor instance can then be cached and re-used later for either broadcasting a message, or when an application needs to resume the suspended response.
| Method Summary | |
|---|---|
void |
addListener(AtmosphereResourceEventListener e)
Add a AtmosphereResourceEventListener which gets invoked when
response are resuming, when the remote client close the connection or
when the a Broadcaster.broadcast(java.lang.Object) operations occurs. |
void |
attach(Object o)
Attach an Object with this Meteor |
Object |
attachement()
Return an Object with this Meteor |
Meteor |
broadcast(Object o)
Broadcast an Object to all suspended response. |
static Meteor |
build(javax.servlet.http.HttpServletRequest r)
Create a Meteor using the HttpServletRequest |
static Meteor |
build(javax.servlet.http.HttpServletRequest req,
Broadcaster.SCOPE scope,
List<BroadcastFilter> l,
Serializer s)
Create a Meteor using the HttpServletRequest and use a list of
BroadcastFilter and Serializer for writting the result
of a broadcast operation the HttpServletResponse. |
static Meteor |
build(javax.servlet.http.HttpServletRequest req,
List<BroadcastFilter> l,
Serializer s)
Create a Meteor using the HttpServletRequest and use a list of
BroadcastFilter and Serializer for writting the result
of a broadcast operation the HttpServletResponse. |
static Meteor |
build(javax.servlet.http.HttpServletRequest r,
Serializer s)
Create a Meteor using the HttpServletRequest and use the
Serializer for writting the result of a broadcast operation using
the HttpServletResponse |
Meteor |
delayBroadadcast(Object o,
long period)
Schedule a delayed broadcast, in seconds. |
Broadcaster |
getBroadcaster()
Return the underlying Broadcaster |
static Meteor |
lookup(javax.servlet.http.HttpServletRequest r)
Retrieve an instance of Meteor based on the HttpServletRequest |
void |
removeListener(AtmosphereResourceEventListener e)
Remove a AtmosphereResourceEventListener which gets invoked when
response are resuming, when the remote client close the connection or
when the a Broadcaster.broadcast(java.lang.Object) operations occurs. |
Meteor |
resume()
Resume the underlying HttpServletResponse |
Meteor |
schedule(Object o,
long period)
Schedule a periodic broadcast, in seconds. |
Meteor |
suspend(long l)
Suspend the underlying HttpServletResponse. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
public static Meteor lookup(javax.servlet.http.HttpServletRequest r)
Meteor based on the HttpServletRequest
r - HttpServletRequest
Meteor or null if not foundpublic static final Meteor build(javax.servlet.http.HttpServletRequest r)
Meteor using the HttpServletRequest
r - an HttpServletRequest
Meteor than can be used to resume, suspend and broadcast Object
public static final Meteor build(javax.servlet.http.HttpServletRequest r,
Serializer s)
Meteor using the HttpServletRequest and use the
Serializer for writting the result of a broadcast operation using
the HttpServletResponse
r - an HttpServletRequests - a Serializer used when writing broadcast events.
Meteor than can be used to resume, suspend and broadcast Object
public static final Meteor build(javax.servlet.http.HttpServletRequest req,
List<BroadcastFilter> l,
Serializer s)
Meteor using the HttpServletRequest and use a list of
BroadcastFilter and Serializer for writting the result
of a broadcast operation the HttpServletResponse.
req - an HttpServletRequestl - a list of BroadcastFilters - a Serializer used when writing broadcast events.
Meteor than can be used to resume, suspend and broadcast Object
public static final Meteor build(javax.servlet.http.HttpServletRequest req,
Broadcaster.SCOPE scope,
List<BroadcastFilter> l,
Serializer s)
Meteor using the HttpServletRequest and use a list of
BroadcastFilter and Serializer for writting the result
of a broadcast operation the HttpServletResponse.
req - an HttpServletRequestscope - the Broadcaster.SCOPE}l - a list of BroadcastFilters - a Serializer used when writing broadcast events.
Meteor than can be used to resume, suspend and broadcast Objectpublic Meteor suspend(long l)
HttpServletResponse. Passing value of -1
suspend the response forever.
l - the maximum time a response stay suspended.
Meteorpublic Meteor resume()
HttpServletResponse
Meteorpublic Meteor broadcast(Object o)
Object to all suspended response.
o - an Object
Meteor
public Meteor schedule(Object o,
long period)
o - an Objectperiod - period in seconds
Meteor
public Meteor delayBroadadcast(Object o,
long period)
o - an Objectperiod - period in seconds
Meteorpublic Broadcaster getBroadcaster()
Broadcaster
public Object attachement()
Object with this Meteor
Objectpublic void attach(Object o)
Object with this Meteor
public void addListener(AtmosphereResourceEventListener e)
AtmosphereResourceEventListener which gets invoked when
response are resuming, when the remote client close the connection or
when the a Broadcaster.broadcast(java.lang.Object) operations occurs.
e - an inatance of AtmosphereResourceEventListenerpublic void removeListener(AtmosphereResourceEventListener e)
AtmosphereResourceEventListener which gets invoked when
response are resuming, when the remote client close the connection or
when the a Broadcaster.broadcast(java.lang.Object) operations occurs.
e - an inatance of AtmosphereResourceEventListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||