org.atmosphere.util
Class ExecutorsFactory

java.lang.Object
  extended by org.atmosphere.util.ExecutorsFactory

public class ExecutorsFactory
extends Object

Stateless Factory to create ExecutorService used in all Atmosphere Component. By default they are shared amongst all component. To change the behavior, add ApplicationConfig.BROADCASTER_SHARABLE_THREAD_POOLS

Author:
Jeanfrancois Arcand

Constructor Summary
ExecutorsFactory()
           
 
Method Summary
static ExecutorService getAsyncOperationExecutor(AtmosphereConfig config, String name)
          Create an ExecutorService to be used for dispatching I/O events.
static ExecutorService getMessageDispatcher(AtmosphereConfig config, String name)
          Create an ExecutorService to be used for dispatching messages, not I/O events.
static ScheduledExecutorService getScheduler(AtmosphereConfig config)
          Create a ScheduledExecutorService used ot schedule I/O and non I/O events.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ExecutorsFactory

public ExecutorsFactory()
Method Detail

getMessageDispatcher

public static ExecutorService getMessageDispatcher(AtmosphereConfig config,
                                                   String name)
Create an ExecutorService to be used for dispatching messages, not I/O events.

Parameters:
config - the AtmosphereConfig
name - a name to use if shared is false.
Returns:
ExecutorService

getAsyncOperationExecutor

public static ExecutorService getAsyncOperationExecutor(AtmosphereConfig config,
                                                        String name)
Create an ExecutorService to be used for dispatching I/O events.

Parameters:
config - the AtmosphereConfig
name - a name to use if shared is false.
Returns:
ExecutorService

getScheduler

public static ScheduledExecutorService getScheduler(AtmosphereConfig config)
Create a ScheduledExecutorService used ot schedule I/O and non I/O events.

Parameters:
config - the AtmosphereConfig
Returns:
ScheduledExecutorService


Copyright © 2014. All Rights Reserved.