org.atmosphere.cpr
Class BroadcasterConfig

java.lang.Object
  extended by org.atmosphere.cpr.BroadcasterConfig

public class BroadcasterConfig
extends Object

Handle Broadcaster configuration like ExecutorService and BroadcastFilter

Author:
Jeanfrancois Arcand

Constructor Summary
BroadcasterConfig()
           
 
Method Summary
 boolean addFilter(BroadcastFilter e)
          Add a BroadcastFilter
 void destroy()
           
 Object filter(Object object)
          Invoke BroadcastFilter in the other they were added.
 ExecutorService getDefaultExecutorService()
          Return the default ExecutorService.
 ExecutorService getExecutorService()
          Return the ExecutorService this Broadcaster support.
 ScheduledExecutorService getScheduledExecutorService()
          Return the ScheduledExecutorService this Broadcaster support.
 boolean removeFilter(BroadcastFilter e)
          Remove a BroadcastFilter
 void setExecutorService(ExecutorService executorService)
          Set an ExecutorService which can be used to dispatch AtmosphereEvent.
 void setScheduledExecutorService(ScheduledExecutorService 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

BroadcasterConfig

public BroadcasterConfig()
Method Detail

setExecutorService

public void setExecutorService(ExecutorService executorService)
Set an ExecutorService which can be used to dispatch AtmosphereEvent. By default, an Executors.newFixedThreadPool(int) is used if that method is not invoked.

Parameters:
executorService - to be used when broadcasting.

getExecutorService

public ExecutorService getExecutorService()
Return the ExecutorService this Broadcaster support. By default it returns and will use the underlying number of core/processor as an indication of the thread number.

Returns:
An ExecutorService.

addFilter

public boolean addFilter(BroadcastFilter e)
Add a BroadcastFilter

Parameters:
e - BroadcastFilter
Returns:
true if added.

destroy

public void destroy()

removeFilter

public boolean removeFilter(BroadcastFilter e)
Remove a BroadcastFilter

Parameters:
e - BroadcastFilter
Returns:
true if removed

filter

public Object filter(Object object)
Invoke BroadcastFilter in the other they were added.


getDefaultExecutorService

public ExecutorService getDefaultExecutorService()
Return the default ExecutorService.

Returns:
the defaultExecutorService

setScheduledExecutorService

public void setScheduledExecutorService(ScheduledExecutorService executorService)
Set an ExecutorService which can be used to dispatch AtmosphereEvent. By default, an Sch is used if that method is not invoked.

Parameters:
executorService - to be used when broadcasting.

getScheduledExecutorService

public ScheduledExecutorService getScheduledExecutorService()
Return the ScheduledExecutorService this Broadcaster support. By default it returns and will use the underlying number of core/processor as an indication of the thread number.

Returns:
An ExecutorService.


Copyright © 2009 SUN Microsystems. All Rights Reserved.