|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.cpr.DefaultBroadcaster
public class DefaultBroadcaster
Broadcaster implementation.
Broadcast messages to suspended reponse using the caller's Thread.
This basic Broadcaster isn't using any ExecutorService to
broadcast messages, so it is single threaded.
| Constructor Summary | |
|---|---|
DefaultBroadcaster(AtmosphereHandler atmosphereHandler)
|
|
| Method Summary | |
|---|---|
boolean |
addAtmosphereEvent(AtmosphereEventImpl event)
Add a AtmosphereEvent to the list of item to be notified when
the Broadcaster.broadcast(java.lang.Object) is invoked. |
void |
broadcast(Object msg)
Broadcast the Object to all suspended response, e.g. |
void |
broadcast(Object msg,
AtmosphereEventImpl event)
Broadcast the Object to all suspended response, e.g. |
void |
broadcast(Object msg,
Set<AtmosphereEventImpl> subset)
Broadcast the Object to all suspended response, e.g. |
ExecutorService |
getExecutorService()
Return the ExecutorService this Broadcaster support. |
boolean |
removeAtmosphereEvent(AtmosphereEventImpl event)
Remove a AtmosphereEvent from the list of item to be notified when
the Broadcaster.broadcast(java.lang.Object) is invoked. |
void |
setExecutorService(ExecutorService executorService)
Set an ExecutorService which can be used to dispatch
AtmosphereEvent. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public DefaultBroadcaster(AtmosphereHandler atmosphereHandler)
| Method Detail |
|---|
public void broadcast(Object msg)
Object to all suspended response, e.g. invoke
AtmosphereHandler.onMessage(org.atmosphere.cpr.AtmosphereEvent) .
broadcast in interface Broadcaster<AtmosphereEventImpl>msg - and Object to be shared.
public void broadcast(Object msg,
AtmosphereEventImpl event)
Object to all suspended response, e.g. invoke
AtmosphereHandler.onMessage(org.atmosphere.cpr.AtmosphereEvent) with an instance of AtmosphereEvent, representing
a set of AtmosphereHandler.
broadcast in interface Broadcaster<AtmosphereEventImpl>msg - and Object to be shared.event - an AtmosphereEvent
public void broadcast(Object msg,
Set<AtmosphereEventImpl> subset)
Object to all suspended response, e.g. invoke
AtmosphereHandler.onMessage(org.atmosphere.cpr.AtmosphereEvent) with a Set of AtmosphereEvent,
representing a set of AtmosphereHandler.
broadcast in interface Broadcaster<AtmosphereEventImpl>msg - and Object to be shared.public boolean addAtmosphereEvent(AtmosphereEventImpl event)
AtmosphereEvent to the list of item to be notified when
the Broadcaster.broadcast(java.lang.Object) is invoked.
addAtmosphereEvent in interface Broadcaster<AtmosphereEventImpl>event - an AtmosphereEvent
public boolean removeAtmosphereEvent(AtmosphereEventImpl event)
AtmosphereEvent from the list of item to be notified when
the Broadcaster.broadcast(java.lang.Object) is invoked.
removeAtmosphereEvent in interface Broadcaster<AtmosphereEventImpl>event - an AtmosphereEvent
public void setExecutorService(ExecutorService executorService)
ExecutorService which can be used to dispatch
AtmosphereEvent. Set it to null if broadcast must be executed
using the calling thread (this is the default).
setExecutorService in interface Broadcaster<AtmosphereEventImpl>executorService - to be used when broadcasting.public ExecutorService getExecutorService()
ExecutorService this Broadcaster support.
By defaul it return null, which means the calling thread is used when
invoking Broadcaster.broadcast(java.lang.Object)
getExecutorService in interface Broadcaster<AtmosphereEventImpl>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||