Class ErlContextParallel
- java.lang.Object
-
- org.eclipse.epsilon.eol.execute.context.EolContext
-
- org.eclipse.epsilon.eol.execute.context.concurrent.EolContextParallel
-
- org.eclipse.epsilon.erl.execute.context.concurrent.ErlContextParallel
-
- All Implemented Interfaces:
IEolContextParallel
,IEolContext
,IErlContextParallel
,IErlContext
- Direct Known Subclasses:
EclContextParallel
,EgxContextParallel
,EplContextParallel
,EtlContextParallel
,EvlContextParallel
public class ErlContextParallel extends EolContextParallel implements IErlContextParallel
- Since:
- 1.6
- Author:
- Sina Madani
-
-
Field Summary
-
Fields inherited from class org.eclipse.epsilon.eol.execute.context.concurrent.EolContextParallel
executorService
-
Fields inherited from class org.eclipse.epsilon.eol.execute.context.EolContext
assertionsEnabled, asyncStatementsQueue, classpathNativeTypeDelegate, errorStream, executorFactory, extendedProperties, frameStack, introspectionManager, methodContributorRegistry, modelRepository, module, nativeTypeDelegates, operationFactory, outputStream, prettyPrinterManager, profilingEnabled, userInput, warningStream
-
Fields inherited from interface org.eclipse.epsilon.eol.execute.context.concurrent.IEolContextParallel
NUM_THREADS_CONFIG
-
-
Constructor Summary
Constructors Modifier Constructor Description ErlContextParallel()
ErlContextParallel(int parallelism)
protected
ErlContextParallel(IEolContext other)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected IErlContext
createShadowThreadLocalContext()
protected ExecutorFactory
createThreadLocalExecutorFactory()
Object
executeJob(Object job)
Evaluates the job using this context's parallel execution facilities.RuleExecutorFactory
getExecutorFactory()
IErlModule
getModule()
Casts the IModule to IErlModuleIErlContext
getShadow()
Can be used to obtain an optimal execution context while executing in parallel.void
setExecutorFactory(ExecutorFactory executorFactory)
void
setProfilingEnabled(boolean profilingEnabled)
-
Methods inherited from class org.eclipse.epsilon.eol.execute.context.concurrent.EolContextParallel
beginParallelTask, clearExecutor, clearThreadLocals, convertToParallel, createThreadLocalFrameStack, createThreadLocalOperationContributorRegistry, dispose, endParallelTask, getExecutorService, getFrameStack, getParallelism, initDelegateThreadLocal, initThreadLocals, isParallel, newExecutorService, nullifyThreadLocals, parallelGet, parallelGet, parallelSet, removeAll, setFrameStack, setParallelism, toString, useThreadLocalValue
-
Methods inherited from class org.eclipse.epsilon.eol.execute.context.EolContext
getAsyncStatementsQueue, getErrorStream, getExtendedProperties, getIntrospectionManager, getModelRepository, getNativeTypeDelegates, getOperationContributorRegistry, getOperationFactory, getOutputStream, getPrettyPrinterManager, getUserInput, getWarningStream, isAssertionsEnabled, isProfilingEnabled, setAssertionsEnabled, setErrorStream, setExtendedProperties, setIntrospectionManager, setModelRepository, setModule, setNativeTypeDelegates, setOperationFactory, setOutputStream, setPrettyPrinterManager, setUserInput, setWarningStream
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.eclipse.epsilon.eol.execute.context.IEolContext
dispose, getAsyncStatementsQueue, getErrorStream, getExtendedProperties, getFrameStack, getIntrospectionManager, getModelRepository, getNativeTypeDelegates, getOperationContributorRegistry, getOperationFactory, getOutputStream, getPrettyPrinterManager, getUserInput, getWarningStream, isAssertionsEnabled, isProfilingEnabled, setAssertionsEnabled, setErrorStream, setExtendedProperties, setFrameStack, setIntrospectionManager, setModelRepository, setModule, setNativeTypeDelegates, setOperationFactory, setOutputStream, setPrettyPrinterManager, setUserInput, setWarningStream
-
Methods inherited from interface org.eclipse.epsilon.eol.execute.context.concurrent.IEolContextParallel
beginParallelTask, beginParallelTask, endParallelTask, ensureNotNested, executeAll, executeAny, getExecutorService, getParallelism, isParallel, isParallelisationLegal, setParallelism
-
-
-
-
Constructor Detail
-
ErlContextParallel
public ErlContextParallel()
-
ErlContextParallel
public ErlContextParallel(int parallelism)
-
ErlContextParallel
protected ErlContextParallel(IEolContext other)
-
-
Method Detail
-
createThreadLocalExecutorFactory
protected ExecutorFactory createThreadLocalExecutorFactory()
- Overrides:
createThreadLocalExecutorFactory
in classEolContextParallel
-
setProfilingEnabled
public void setProfilingEnabled(boolean profilingEnabled)
- Specified by:
setProfilingEnabled
in interfaceIEolContext
- Overrides:
setProfilingEnabled
in classEolContext
-
setExecutorFactory
public void setExecutorFactory(ExecutorFactory executorFactory)
- Specified by:
setExecutorFactory
in interfaceIEolContext
- Overrides:
setExecutorFactory
in classEolContextParallel
-
getExecutorFactory
public RuleExecutorFactory getExecutorFactory()
- Specified by:
getExecutorFactory
in interfaceIEolContext
- Specified by:
getExecutorFactory
in interfaceIErlContext
- Overrides:
getExecutorFactory
in classEolContextParallel
-
createShadowThreadLocalContext
protected IErlContext createShadowThreadLocalContext()
- Overrides:
createShadowThreadLocalContext
in classEolContextParallel
-
getShadow
public IErlContext getShadow()
Description copied from class:EolContextParallel
Can be used to obtain an optimal execution context while executing in parallel. If execution is currently not parallel, then this context itself is returned.- Overrides:
getShadow
in classEolContextParallel
- Returns:
- A ThreadLocal copy of this context if in parallel, or this context otherwise.
-
getModule
public IErlModule getModule()
Description copied from interface:IErlContext
Casts the IModule to IErlModule- Specified by:
getModule
in interfaceIEolContext
- Specified by:
getModule
in interfaceIErlContext
- Overrides:
getModule
in classEolContext
- See Also:
IEolContext.getModule()
-
executeJob
public Object executeJob(Object job) throws EolRuntimeException
Description copied from class:EolContextParallel
Evaluates the job using this context's parallel execution facilities. Subclasses may override this to support additional job types, calling the super method as the last resort for unknown cases. Supported types include multi-valued types (e.g. arrays, Iterable / Iterator, Stream etc.) as well as common concurrency units such as Runnable, Callable and Future.- Overrides:
executeJob
in classEolContextParallel
- Parameters:
job
- The job (or jobs) to evaluate.- Returns:
- The result of evaluating the job, if any.
- Throws:
EolRuntimeException
- If an exception is thrown whilst evaluating the job(s).
-
-