|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.atmosphere.cpr.BroadcasterConfig
public class BroadcasterConfig
Handle Broadcaster configuration like ExecutorService and
BroadcastFilter
| Nested Class Summary | |
|---|---|
static class |
BroadcasterConfig.DefaultBroadcasterCache
|
| Field Summary | |
|---|---|
protected ConcurrentLinkedQueue<BroadcastFilter> |
filters
|
protected ConcurrentLinkedQueue<PerRequestBroadcastFilter> |
perRequestFilters
|
| Constructor Summary | |
|---|---|
BroadcasterConfig(ExecutorService executorService,
ExecutorService asyncWriteService,
ScheduledExecutorService scheduler,
AtmosphereConfig config)
|
|
BroadcasterConfig(List<String> list,
AtmosphereConfig config)
|
|
BroadcasterConfig(List<String> list,
AtmosphereConfig config,
boolean createExecutor)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final ConcurrentLinkedQueue<BroadcastFilter> filters
protected final ConcurrentLinkedQueue<PerRequestBroadcastFilter> perRequestFilters
| Constructor Detail |
|---|
public BroadcasterConfig(List<String> list,
AtmosphereConfig config)
public BroadcasterConfig(List<String> list,
AtmosphereConfig config,
boolean createExecutor)
public BroadcasterConfig(ExecutorService executorService,
ExecutorService asyncWriteService,
ScheduledExecutorService scheduler,
AtmosphereConfig config)
| Method Detail |
|---|
protected void configExecutors()
public BroadcasterConfig setExecutorService(ExecutorService executorService)
ExecutorService which can be used to dispatch
AtmosphereResourceEvent. By default, an Executors.newFixedThreadPool(int)
of size 1 is used if that method is not invoked.
executorService - to be used when broadcasting.
public BroadcasterConfig setExecutorService(ExecutorService executorService,
boolean isExecutorShared)
ExecutorService which can be used to dispatch
AtmosphereResourceEvent. By default, an Executors.newFixedThreadPool(int)
of size 1 is used if that method is not invoked.
executorService - to be used when broadcasting.isExecutorShared - true is the life cycle of the ExecutorService will be executed by the application.
That means Atmosphere will NOT invoke the shutdown method when this destroy()public ExecutorService getExecutorService()
ExecutorService this Broadcaster support.
By default it returns Executors.newFixedThreadPool(int) of size 1.
public BroadcasterConfig setAsyncWriteService(ExecutorService asyncWriteService)
ExecutorService which can be used to write
AtmosphereResourceEvent.getMessage(). By default, an Executors.newFixedThreadPool(int)
is used if that method is not invoked.
asyncWriteService - to be used when writing events .
public BroadcasterConfig setAsyncWriteService(ExecutorService asyncWriteService,
boolean isAsyncExecutorShared)
ExecutorService which can be used to write
AtmosphereResourceEvent.getMessage(). By default, an Executors.newFixedThreadPool(int)
is used if that method is not invoked.
asyncWriteService - to be used when writing events .isAsyncExecutorShared - true is the life cycle of the ExecutorService will be executed by the application.
That means Atmosphere will NOT invoke the shutdown method when this destroy()public ExecutorService getAsyncWriteService()
ExecutorService this Broadcaster use for executing asynchronous write of events.
By default it returns Executors.newCachedThreadPool() of size 1.
public boolean addFilter(BroadcastFilter e)
BroadcastFilter
e - BroadcastFilter
public void destroy()
protected void destroy(boolean force)
public void forceDestroy()
ExecutorService
public boolean removeFilter(BroadcastFilter filter)
BroadcastFilter
filter - BroadcastFilter
public void removeAllFilters()
BroadcastFilter
public boolean hasFilters()
BroadcastFilter
BroadcastFilterpublic boolean hasPerRequestFilters()
BroadcastFilter
BroadcastFilterprotected BroadcastFilter.BroadcastAction filter(Object object)
BroadcastFilter in the other they were added.
object - the broadcasted object.
protected BroadcastFilter.BroadcastAction filter(AtmosphereResource r,
Object message,
Object originalMessage)
BroadcastFilter in the other they were added, with a unique AtmosphereRequest
r - AtmosphereResourcemessage - the broadcasted object.message - the broadcasted object.
public ExecutorService getDefaultExecutorService()
ExecutorService.
public BroadcasterConfig setScheduledExecutorService(ScheduledExecutorService scheduler)
ExecutorService which can be used to dispatch
AtmosphereResourceEvent. By default, an ScheduledExecutorService
is used if that method is not invoked.
scheduler - to be used when broadcasting.
public ScheduledExecutorService getScheduledExecutorService()
ScheduledExecutorService this Broadcaster support.
By default it returns Executors.newScheduledThreadPool(int) and will use
the underlying number of core/protocol as an indication of the thread number.
public BroadcasterConfig setBroadcasterCache(BroadcasterCache broadcasterCache)
BroadcasterConfig.DefaultBroadcasterCache
broadcasterCache - a BroadcasterConfig.DefaultBroadcasterCache
public BroadcasterCache getBroadcasterCache()
BroadcasterConfig.DefaultBroadcasterCache
public AtmosphereConfig getAtmosphereConfig()
AtmosphereConfig value. This value might be null
if the associated Broadcaster has been created manually.
AtmosphereConfigpublic void setAtmosphereConfig(AtmosphereConfig config)
AtmosphereConfig
config - AtmosphereConfig
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||