public class BroadcasterConfig
extends java.lang.Object
| Modifier and Type | Class and Description |
|---|---|
static class |
BroadcasterConfig.DefaultBroadcasterCache |
| Modifier and Type | Field and Description |
|---|---|
protected java.util.concurrent.ConcurrentLinkedQueue<BroadcastFilter> |
filters |
protected java.util.concurrent.ConcurrentLinkedQueue<PerRequestBroadcastFilter> |
perRequestFilters |
| Constructor and Description |
|---|
BroadcasterConfig(java.util.concurrent.ExecutorService executorService,
java.util.concurrent.ExecutorService asyncWriteService,
java.util.concurrent.ScheduledExecutorService scheduler,
AtmosphereConfig config,
java.lang.String name) |
BroadcasterConfig(java.util.List<java.lang.String> list,
AtmosphereConfig config,
boolean handleExecutors,
java.lang.String name) |
BroadcasterConfig(java.util.List<java.lang.String> list,
AtmosphereConfig config,
java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
addFilter(BroadcastFilter e)
Add a
BroadcastFilter |
protected boolean |
addFilter(BroadcastFilter e,
boolean init)
Add a
BroadcastFilter |
protected BroadcasterConfig |
broadcasterID(java.lang.String name) |
protected void |
configExecutors() |
void |
destroy() |
protected void |
destroy(boolean force) |
protected BroadcastFilter.BroadcastAction |
filter(AtmosphereResource r,
java.lang.Object message,
java.lang.Object originalMessage)
Invoke
BroadcastFilter in the other they were added, with a unique AtmosphereRequest |
protected BroadcastFilter.BroadcastAction |
filter(java.lang.Object object)
Invoke
BroadcastFilter in the other they were added. |
java.util.Collection<BroadcastFilter> |
filters()
Return the current list of installed
BroadcastFilter |
void |
forceDestroy()
Force shutdown of all
ExecutorService |
java.util.concurrent.ExecutorService |
getAsyncWriteService()
Return the
ExecutorService this Broadcaster use for executing asynchronous write of events. |
AtmosphereConfig |
getAtmosphereConfig()
Return the
AtmosphereConfig value. |
BroadcasterCache |
getBroadcasterCache()
Get a
BroadcasterCache |
java.util.concurrent.ExecutorService |
getExecutorService()
Return the
ExecutorService this Broadcaster support. |
java.util.concurrent.ScheduledExecutorService |
getScheduledExecutorService()
Return the
ScheduledExecutorService this Broadcaster support. |
boolean |
hasFilters()
Return true if this object contains
BroadcastFilter |
boolean |
hasPerRequestFilters()
Return true if this object contains
BroadcastFilter |
protected void |
initClusterExtension() |
void |
removeAllFilters()
Remove all
BroadcastFilter |
boolean |
removeFilter(BroadcastFilter filter)
Remove a
BroadcastFilter |
BroadcasterConfig |
setAsyncWriteService(java.util.concurrent.ExecutorService asyncWriteService)
Set an
ExecutorService which can be used to write
AtmosphereResourceEvent.getMessage(). |
BroadcasterConfig |
setAsyncWriteService(java.util.concurrent.ExecutorService asyncWriteService,
boolean isAsyncExecutorShared)
Set an
ExecutorService which can be used to write
AtmosphereResourceEvent.getMessage(). |
BroadcasterConfig |
setBroadcasterCache(BroadcasterCache broadcasterCache)
Set a
BroadcasterCache |
BroadcasterConfig |
setExecutorService(java.util.concurrent.ExecutorService executorService)
Set an
ExecutorService which can be used to dispatch
AtmosphereResourceEvent. |
BroadcasterConfig |
setExecutorService(java.util.concurrent.ExecutorService executorService,
boolean isExecutorShared)
Set an
ExecutorService which can be used to dispatch
AtmosphereResourceEvent. |
BroadcasterConfig |
setScheduledExecutorService(java.util.concurrent.ScheduledExecutorService scheduler)
Set an
ExecutorService which can be used to dispatch
AtmosphereResourceEvent. |
protected boolean |
uuidCache() |
protected final java.util.concurrent.ConcurrentLinkedQueue<BroadcastFilter> filters
protected final java.util.concurrent.ConcurrentLinkedQueue<PerRequestBroadcastFilter> perRequestFilters
public BroadcasterConfig(java.util.List<java.lang.String> list,
AtmosphereConfig config,
java.lang.String name)
public BroadcasterConfig(java.util.List<java.lang.String> list,
AtmosphereConfig config,
boolean handleExecutors,
java.lang.String name)
public BroadcasterConfig(java.util.concurrent.ExecutorService executorService,
java.util.concurrent.ExecutorService asyncWriteService,
java.util.concurrent.ScheduledExecutorService scheduler,
AtmosphereConfig config,
java.lang.String name)
protected BroadcasterConfig broadcasterID(java.lang.String name)
protected void initClusterExtension()
protected void configExecutors()
public BroadcasterConfig setExecutorService(java.util.concurrent.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(java.util.concurrent.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 java.util.concurrent.ExecutorService getExecutorService()
ExecutorService this Broadcaster support.
By default it returns Executors.newFixedThreadPool(int) of size 1.public BroadcasterConfig setAsyncWriteService(java.util.concurrent.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(java.util.concurrent.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 java.util.concurrent.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)
BroadcastFiltere - BroadcastFilterprotected boolean addFilter(BroadcastFilter e, boolean init)
BroadcastFiltere - BroadcastFilterpublic java.util.Collection<BroadcastFilter> filters()
BroadcastFilterBroadcastFilterpublic void destroy()
protected void destroy(boolean force)
public void forceDestroy()
ExecutorServicepublic boolean removeFilter(BroadcastFilter filter)
BroadcastFilterfilter - BroadcastFilterpublic void removeAllFilters()
BroadcastFilterpublic boolean hasFilters()
BroadcastFilterBroadcastFilterpublic boolean hasPerRequestFilters()
BroadcastFilterBroadcastFilterprotected BroadcastFilter.BroadcastAction filter(java.lang.Object object)
BroadcastFilter in the other they were added.object - the broadcasted object.protected BroadcastFilter.BroadcastAction filter(AtmosphereResource r, java.lang.Object message, java.lang.Object originalMessage)
BroadcastFilter in the other they were added, with a unique AtmosphereRequestr - AtmosphereResourcemessage - the broadcasted object.message - the broadcasted object.public BroadcasterConfig setScheduledExecutorService(java.util.concurrent.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 java.util.concurrent.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)
BroadcasterCachebroadcasterCache - a BroadcasterCacheprotected boolean uuidCache()
public BroadcasterCache getBroadcasterCache()
BroadcasterCachepublic AtmosphereConfig getAtmosphereConfig()
AtmosphereConfig value. This value might be null
if the associated Broadcaster has been created manually.AtmosphereConfigCopyright © 2018. All Rights Reserved.