|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface Broadcaster<D,E,F>
A Broadcaster is responsible for delivering messages to its subscribed
AtmosphereEvent, which are representing a suspended response.
AtmosphereEvent can be added using addAtmosphereEvent(org.atmosphere.cpr.AtmosphereEvent,
so when broadcast(java.lang.Object) execute,
AtmosphereHandler.onMessage(org.atmosphere.cpr.AtmosphereEvent) will
by invoked and the suspended connection will have a chance to write the
message available using AtmosphereEvent.getMessage()
A Broadcaster, by default, will use an ExecutorService, and the
number of Thread will be computed based on the core/cpu of the OS under
which the application run.
| Nested Class Summary | |
|---|---|
static class |
Broadcaster.SCOPE
|
| Method Summary | |
|---|---|
AtmosphereEvent |
addAtmosphereEvent(AtmosphereEvent<D,E> event)
Add a AtmosphereEvent to the list of item to be notified when
the broadcast(F) is invoked. |
Future<F> |
broadcast(F o)
Broadcast the F to all suspended response, e.g. |
Future<F> |
broadcast(F o,
AtmosphereEvent event)
Broadcast the F to all suspended response, e.g. |
Future<F> |
broadcast(F o,
Set<AtmosphereEvent> subset)
Broadcast the F to all suspended response, e.g. |
void |
destroy()
Destroy this instance and shutdown it's associated ExecutorServices |
Iterator<AtmosphereEvent<HttpServletRequest,HttpServletResponse>> |
getAtmosphereEvents()
Return an Iterator AtmosphereEvent |
BroadcasterConfig |
getBroadcasterConfig()
Return the current BroadcasterConfig |
String |
getName()
Return the name of this Broadcaster |
Broadcaster.SCOPE |
getScope()
Retunr the Broadcaster#SCOPE |
AtmosphereEvent |
removeAtmosphereEvent(AtmosphereEvent<D,E> event)
Remove a AtmosphereEvent from the list of item to be notified when
the broadcast(F) is invoked. |
void |
setBroadcasterConfig(BroadcasterConfig bc)
Set the BroadcasterConfig instance. |
void |
setName(String name)
Set the name of this Broadcaster |
void |
setScope(Broadcaster.SCOPE scope)
Set the Broadcaster#SCOPE |
| Method Detail |
|---|
Future<F> broadcast(F o)
F to all suspended response, e.g. invoke
AtmosphereHandler.onMessage(org.atmosphere.cpr.AtmosphereEvent) .
o - and F to be shared.
F, which might have been transformed by BroadcasterFilter
Future<F> broadcast(F o,
AtmosphereEvent event)
F to all suspended response, e.g. invoke
AtmosphereHandler.onMessage(org.atmosphere.cpr.AtmosphereEvent) with an instance of AtmosphereEvent, representing
a set of AtmosphereHandler.
o - and F to be shared.event - an AtmosphereEvent
F, which might have been transformed by BroadcasterFilter
Future<F> broadcast(F o,
Set<AtmosphereEvent> subset)
F to all suspended response, e.g. invoke
AtmosphereHandler.onMessage(org.atmosphere.cpr.AtmosphereEvent) with a Set of AtmosphereEvent,
representing a set of AtmosphereHandler.
o - and F to be shared.event - an AtmosphereEvent
F, which might have been transformed by BroadcasterFilterAtmosphereEvent addAtmosphereEvent(AtmosphereEvent<D,E> event)
AtmosphereEvent to the list of item to be notified when
the broadcast(F) is invoked.
event - an AtmosphereEvent
AtmosphereEvent if added, or null if it was already there.AtmosphereEvent removeAtmosphereEvent(AtmosphereEvent<D,E> event)
AtmosphereEvent from the list of item to be notified when
the broadcast(F) is invoked.
event - an AtmosphereEvent
AtmosphereEvent if removed, or null if it was not.void setBroadcasterConfig(BroadcasterConfig bc)
BroadcasterConfig instance.
bf - BroadcasterConfig getBroadcasterConfig()
BroadcasterConfig
BroadcasterConfigvoid destroy()
ExecutorServices
Iterator<AtmosphereEvent<HttpServletRequest,HttpServletResponse>> getAtmosphereEvents()
AtmosphereEvent
void setScope(Broadcaster.SCOPE scope)
Broadcaster#SCOPE
Broadcaster.SCOPE getScope()
Broadcaster#SCOPE
Broadcaster#SCOPEvoid setName(String name)
Broadcaster
name - of this BroadcasterString getName()
Broadcaster
Broadcaster
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||