public enum ExecutionModel extends Enum<ExecutionModel>
This class enumerates the policies for instantiating Threads
in classes of EasyStream library that needs of them.
Enum Constant and Description |
---|
SINGLE_THREAD
Only one thread is shared by all instances (slow).
|
STATIC_THREAD_POOL
Threads are taken from a static pool.
|
THREAD_PER_INSTANCE
One thread per instance of class.
|
Modifier and Type | Method and Description |
---|---|
static ExecutionModel |
valueOf(String name)
Returns the enum constant of this type with the specified name.
|
static ExecutionModel[] |
values()
Returns an array containing the constants of this enum type, in
the order they are declared.
|
public static final ExecutionModel SINGLE_THREAD
Only one thread is shared by all instances (slow).
public static final ExecutionModel STATIC_THREAD_POOL
Threads are taken from a static pool.
Some slow thread might lock up the pool and other processes might be slowed down.
ThreadPoolExecutor
public static final ExecutionModel THREAD_PER_INSTANCE
One thread per instance of class. Slow but each instance can work in isolation. Also if some thread is not correctly closed there might be threads leaks.
public static ExecutionModel[] values()
for (ExecutionModel c : ExecutionModel.values()) System.out.println(c);
public static ExecutionModel valueOf(String name)
name
- the name of the enum constant to be returned.IllegalArgumentException
- if this enum type has no constant with the specified nameNullPointerException
- if the argument is nullCopyright © 2008–2016. All rights reserved.