Package org.atmosphere.util
Class ExecutorsFactory
java.lang.Object
org.atmosphere.util.ExecutorsFactory
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
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic ExecutorServicegetAsyncOperationExecutor(AtmosphereConfig config, String name) Create anExecutorServiceto be used for dispatching I/O events.static ExecutorServicegetMessageDispatcher(AtmosphereConfig config, String name) Create anExecutorServiceto be used for dispatching messages, not I/O events.static ScheduledExecutorServicegetScheduler(AtmosphereConfig config) Create aScheduledExecutorServiceused ot schedule I/O and non I/O events.static voidreset(AtmosphereConfig config)
-
Field Details
-
DEFAULT_ASYNC_THREAD
public static final int DEFAULT_ASYNC_THREAD- See Also:
-
DEFAULT_MESSAGE_THREAD
public static final int DEFAULT_MESSAGE_THREAD- See Also:
-
DEFAULT_KEEP_ALIVE
public static final int DEFAULT_KEEP_ALIVE- See Also:
-
ASYNC_WRITE_THREAD_POOL
- See Also:
-
SCHEDULER_THREAD_POOL
- See Also:
-
BROADCASTER_THREAD_POOL
- See Also:
-
-
Constructor Details
-
ExecutorsFactory
public ExecutorsFactory()
-
-
Method Details
-
getMessageDispatcher
Create anExecutorServiceto be used for dispatching messages, not I/O events.- Parameters:
config- theAtmosphereConfigname- a name to use if shared is false.- Returns:
ExecutorService
-
getAsyncOperationExecutor
Create anExecutorServiceto be used for dispatching I/O events.- Parameters:
config- theAtmosphereConfigname- a name to use if shared is false.- Returns:
ExecutorService
-
getScheduler
Create aScheduledExecutorServiceused ot schedule I/O and non I/O events.- Parameters:
config- theAtmosphereConfig- Returns:
ScheduledExecutorService
-
reset
-