|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--org.omegahat.Environment.Interpreter.BasicEvaluator
|
+--org.omegahat.Environment.Interpreter.UtilityEvaluator
|
+--org.omegahat.Environment.Interpreter.UserClassEvaluator
|
+--org.omegahat.Environment.Interpreter.TaskQueueEvaluator
An early and untested version of an evaluator that
works by processing elements in its TaskQueue
rather than being signalled using the
InputConsumer listener
mechanism as in the regular evaluator classes.
Instead, other objects add Task objects to the queue
and have these evaluated in the background.
This will normally be used in a dedicated thread with other
activities being carried on in other threads that communicate with this
evaluator by inserting Tasks into its queue.
This is very similar
to the classes in
TaskManager
and
DistributedTaskManager
| Field Summary | |
protected TaskQueue |
queue
The queue to which new Tasks are added by other objects
(potentially running in different threads) and which
this evaluator monitors processing the tasks as it becomes idle
and tasks are available. |
protected boolean |
terminate
A flag used to allow another object to indicate that the evaluator should not process any more tasks on its queue. |
| Fields inherited from class org.omegahat.Environment.Interpreter.UserClassEvaluator |
classManager |
| Fields inherited from class org.omegahat.Environment.Interpreter.BasicEvaluator |
allowUnrestrictedAccess, class_lists, currentExpression, data, databases, debugger, DefaultAttachIndex, defaultDatabase, dynamicClassLoader, errorHandler, evaluationEvent, evaluationListeners, initialized, internalFunctionTables, internalPrimitiveClassNames, internalPrimitiveClassTable, lexer, localClasses, manager, options, output, parser, primitive_classes, primitiveClasses, PrimitiveClassNames, primitiveTypeNames, primitiveTypes, reversePrimitiveTypes, ShowMultipleClasses, sourceStack, stderr, stdout, SubEvaluationListeners, taskHistory, toplevelExpression, warningMessages |
| Fields inherited from interface org.omegahat.Environment.Interpreter.Evaluator |
ThisVariableName |
| Constructor Summary | |
TaskQueueEvaluator()
|
|
TaskQueueEvaluator(Evaluator parent)
|
|
TaskQueueEvaluator(EvaluatorManager manager)
|
|
TaskQueueEvaluator(Options opts)
|
|
| Method Summary | |
Task |
addTask(ExpressionInt expression)
Add an expression to the evaluator's task queue by constructing a new Task to contain it. |
Task |
addTask(Task task)
Add a task to the queue. |
void |
run()
This is the method that causes the evaluator to start processing the tasks on its queue or wait for new ones to be added. |
boolean |
terminate()
Determine whether the evaluator should quit from processing any further tasks from the queue. |
boolean |
terminate(boolean val)
Set the terminatation flag, signalling that the evaluator should not process any further tasks on its queue. |
| Methods inherited from class org.omegahat.Environment.Interpreter.UserClassEvaluator |
addMethod, classManager, classManager, createInstance, createInstance, createInstance, defineClass, defineClass, defineClass, defineClass, defineClass, defineClass, DefineUserClass, DefineUserClass, DefineUserClass, findUserClass, findUserClass, parseClass, parser |
| Methods inherited from class org.omegahat.Environment.Interpreter.UtilityEvaluator |
evaluator, exec, exec, findFile, getEvaluator, setProperty, setProperty |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected TaskQueue queue
Tasks are added by other objects
(potentially running in different threads) and which
this evaluator monitors processing the tasks as it becomes idle
and tasks are available.protected boolean terminate
| Constructor Detail |
public TaskQueueEvaluator()
public TaskQueueEvaluator(Options opts)
public TaskQueueEvaluator(Evaluator parent)
public TaskQueueEvaluator(EvaluatorManager manager)
| Method Detail |
public Task addTask(Task task)
Task object directly to the
TaskQueue obtained via taskQueue().public Task addTask(ExpressionInt expression)
Task to contain it.public void run()
terminate() method.
This is the method that is run when the object
is handed to a Thread.run in interface java.lang.Runnablerun in class BasicEvaluatororg.omegahat.Environment.Interpreter.BasicEvaluatorTaskQueueEvaluator,
TaskQueuepublic boolean terminate()
public boolean terminate(boolean val)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||