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 { link ApplicationConfig#BROADCASTER_SHARABLE_THREAD_POOLS}

Author:
Jeanfrancois Arcand

Field Summary
static int DEFAULT_ASYNC_THREAD
           
static int DEFAULT_KEEP_ALIVE
           
static int DEFAULT_MESSAGE_THREAD
           
 
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
 

Field Detail

DEFAULT_ASYNC_THREAD

public static final int DEFAULT_ASYNC_THREAD
See Also:
Constant Field Values

DEFAULT_MESSAGE_THREAD

public static final int DEFAULT_MESSAGE_THREAD
See Also:
Constant Field Values

DEFAULT_KEEP_ALIVE

public static final int DEFAULT_KEEP_ALIVE
See Also:
Constant Field Values
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.