|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.cpr.MetaBroadcaster
public class MetaBroadcaster
Broadcast events to all or a subset of available Broadcaster based on theirBroadcaster.getID() value.
This class allow broadcasting events to a set of broadcaster that maps some String like:
// Broadcast the event to all Broadcaster ID starting with /hello
broadcast("/hello", event)
// Broadcast the event to all Broadcaster ID
broaccast("/*", event);
The rule used is similar to path/uri mapping used by technology like Servlet, Jersey, etc.
NOTE: Broadcaster's name must start with / in order to get retrieved by this class.
| Field Summary | |
|---|---|
static String |
MAPPING_REGEX
|
| Constructor Summary | |
|---|---|
MetaBroadcaster()
|
|
| Method Summary | |
|---|---|
MetaBroadcaster |
addBroadcasterListener(BroadcasterListener b)
Add a BroadcasterListener to all mapped Broadcaster. |
protected org.atmosphere.cpr.MetaBroadcaster.MetaBroadcasterFuture |
broadcast(String path,
Object message,
int time,
TimeUnit unit,
boolean delay)
|
Future<List<Broadcaster>> |
broadcastTo(String broadcasterID,
Object message)
Broadcast the message to all Broadcaster whose Broadcaster.getID() maps the broadcasterID value. |
Future<List<Broadcaster>> |
delayTo(String broadcasterID,
Object message,
int time,
TimeUnit unit)
Delay the message delivery to Broadcaster.getID()
maps the broadcasterID value. |
static MetaBroadcaster |
getDefault()
|
protected org.atmosphere.cpr.MetaBroadcaster.MetaBroadcasterFuture |
map(String path,
Object message,
int time,
TimeUnit unit,
boolean delay)
|
MetaBroadcaster |
removeBroadcasterListener(BroadcasterListener b)
Remove the BroadcasterListener. |
Future<List<Broadcaster>> |
scheduleTo(String broadcasterID,
Object message,
int time,
TimeUnit unit)
Broadcast the message at a fixed rate to all Broadcaster whose Broadcaster.getID()
maps the broadcasterID value. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String MAPPING_REGEX
| Constructor Detail |
|---|
public MetaBroadcaster()
| Method Detail |
|---|
protected org.atmosphere.cpr.MetaBroadcaster.MetaBroadcasterFuture broadcast(String path,
Object message,
int time,
TimeUnit unit,
boolean delay)
protected org.atmosphere.cpr.MetaBroadcaster.MetaBroadcasterFuture map(String path,
Object message,
int time,
TimeUnit unit,
boolean delay)
public Future<List<Broadcaster>> broadcastTo(String broadcasterID,
Object message)
Broadcaster.getID() maps the broadcasterID value.
broadcasterID - a String (or path) that can potentially match a Broadcaster.getID()message - a message to be broadcasted
public Future<List<Broadcaster>> scheduleTo(String broadcasterID,
Object message,
int time,
TimeUnit unit)
Broadcaster.getID()
maps the broadcasterID value. This operation will invoke Broadcaster.scheduleFixedBroadcast(Object, long, java.util.concurrent.TimeUnit)}
broadcasterID - a String (or path) that can potentially match a Broadcaster.getID()message - a message to be broadcastedtime - a time valueunit - a TimeUnit
public Future<List<Broadcaster>> delayTo(String broadcasterID,
Object message,
int time,
TimeUnit unit)
Broadcaster.getID()
maps the broadcasterID value. This operation will invoke Broadcaster.delayBroadcast(Object, long, java.util.concurrent.TimeUnit) (Object, long, java.util.concurrent.TimeUnit)}}
broadcasterID - a String (or path) that can potentially match a Broadcaster.getID()message - a message to be broadcastedtime - a time valueunit - a TimeUnit
public static final MetaBroadcaster getDefault()
public MetaBroadcaster addBroadcasterListener(BroadcasterListener b)
BroadcasterListener to all mapped Broadcaster. T
b - BroadcasterListener
public MetaBroadcaster removeBroadcasterListener(BroadcasterListener b)
BroadcasterListener.
b - BroadcasterListener
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||