Class EgxContextParallel
- 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
-
- org.eclipse.epsilon.egl.execute.context.concurrent.EgxContextParallel
-
- All Implemented Interfaces:
IEgxContextParallel
,IEgxContext
,IEolContextParallel
,IEolContext
,IErlContextParallel
,IErlContext
public class EgxContextParallel extends ErlContextParallel implements IEgxContextParallel
- Since:
- 1.6
- Author:
- Sina Madani
-
-
Field Summary
Fields Modifier and Type Field Description protected Collection<Template>
invokedTemplates
protected Map<URI,EglTemplate>
templateCache
protected EglTemplateFactory
templateFactory
-
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 Constructor Description EgxContextParallel()
EgxContextParallel(int parallelism)
EgxContextParallel(EglTemplateFactory templateFactory)
EgxContextParallel(EglTemplateFactory templateFactory, int parallelism)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
clearThreadLocals()
protected IEgxContext
createShadowThreadLocalContext()
void
dispose()
Collection<Template>
getInvokedTemplates()
IEgxModule
getModule()
Casts the IModule to IErlModuleIEgxContext
getShadow()
Can be used to obtain an optimal execution context while executing in parallel.Map<URI,EglTemplate>
getTemplateCache()
EglTemplateFactory
getTemplateFactory()
protected void
initThreadLocals()
protected void
nullifyThreadLocals()
void
setTemplateFactory(EglTemplateFactory templateFactory)
-
Methods inherited from class org.eclipse.epsilon.erl.execute.context.concurrent.ErlContextParallel
createThreadLocalExecutorFactory, executeJob, getExecutorFactory, setExecutorFactory, setProfilingEnabled
-
Methods inherited from class org.eclipse.epsilon.eol.execute.context.concurrent.EolContextParallel
beginParallelTask, clearExecutor, convertToParallel, createThreadLocalFrameStack, createThreadLocalOperationContributorRegistry, endParallelTask, getExecutorService, getFrameStack, getParallelism, initDelegateThreadLocal, isParallel, newExecutorService, 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
getAsyncStatementsQueue, getErrorStream, getExtendedProperties, getFrameStack, getIntrospectionManager, getModelRepository, getNativeTypeDelegates, getOperationContributorRegistry, getOperationFactory, getOutputStream, getPrettyPrinterManager, getUserInput, getWarningStream, isAssertionsEnabled, isProfilingEnabled, setAssertionsEnabled, setErrorStream, setExecutorFactory, setExtendedProperties, setFrameStack, setIntrospectionManager, setModelRepository, setModule, setNativeTypeDelegates, setOperationFactory, setOutputStream, setPrettyPrinterManager, setProfilingEnabled, 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
-
Methods inherited from interface org.eclipse.epsilon.erl.execute.context.IErlContext
getExecutorFactory
-
-
-
-
Field Detail
-
templateFactory
protected EglTemplateFactory templateFactory
-
templateCache
protected Map<URI,EglTemplate> templateCache
-
invokedTemplates
protected Collection<Template> invokedTemplates
-
-
Constructor Detail
-
EgxContextParallel
public EgxContextParallel()
-
EgxContextParallel
public EgxContextParallel(EglTemplateFactory templateFactory)
-
EgxContextParallel
public EgxContextParallel(int parallelism)
-
EgxContextParallel
public EgxContextParallel(EglTemplateFactory templateFactory, int parallelism)
-
-
Method Detail
-
createShadowThreadLocalContext
protected IEgxContext createShadowThreadLocalContext()
- Overrides:
createShadowThreadLocalContext
in classErlContextParallel
-
getShadow
public IEgxContext 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 classErlContextParallel
- Returns:
- A ThreadLocal copy of this context if in parallel, or this context otherwise.
-
initThreadLocals
protected void initThreadLocals()
- Overrides:
initThreadLocals
in classEolContextParallel
-
clearThreadLocals
protected void clearThreadLocals()
- Overrides:
clearThreadLocals
in classEolContextParallel
-
nullifyThreadLocals
protected void nullifyThreadLocals()
- Overrides:
nullifyThreadLocals
in classEolContextParallel
-
setTemplateFactory
public void setTemplateFactory(EglTemplateFactory templateFactory)
- Specified by:
setTemplateFactory
in interfaceIEgxContext
-
getTemplateFactory
public EglTemplateFactory getTemplateFactory()
- Specified by:
getTemplateFactory
in interfaceIEgxContext
-
getTemplateCache
public Map<URI,EglTemplate> getTemplateCache()
- Specified by:
getTemplateCache
in interfaceIEgxContext
-
getInvokedTemplates
public Collection<Template> getInvokedTemplates()
- Specified by:
getInvokedTemplates
in interfaceIEgxContext
-
getModule
public IEgxModule getModule()
Description copied from interface:IErlContext
Casts the IModule to IErlModule- Specified by:
getModule
in interfaceIEgxContext
- Specified by:
getModule
in interfaceIEolContext
- Specified by:
getModule
in interfaceIErlContext
- Overrides:
getModule
in classErlContextParallel
- See Also:
IEolContext.getModule()
-
dispose
public void dispose()
- Specified by:
dispose
in interfaceIEolContext
- Overrides:
dispose
in classEolContextParallel
-
-