Class TagScriptManager.TagScriptDispatcher
- java.lang.Object
-
- com.inductiveautomation.ignition.common.sqltags.scripts.TagScriptManager.TagScriptDispatcher
-
- All Implemented Interfaces:
TagScriptEvaluator
,java.lang.Runnable
- Enclosing class:
- TagScriptManager
protected class TagScriptManager.TagScriptDispatcher extends java.lang.Object implements java.lang.Runnable, TagScriptEvaluator
This is the actual returned evaluator. The basic goal is that we want to execute tasks asynchronously, without allowing them to back up. So we create one of these per tag, and it manages tracking the number of outstanding events.
-
-
Constructor Summary
Constructors Constructor Description TagScriptDispatcher()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addScript(CompiledTagScript s)
protected CompiledTagScript
find(java.lang.String id)
java.util.Set<java.lang.String>
getDefinedIds()
Returns the script ids that are defined on this evaluator.void
invoke(java.lang.String id, Tag source, TagPath sourcePath, TagScriptMonitor status, java.lang.Object... params)
Executes the script defined for the given id against the source object provided.protected void
maybeSchedule()
protected TagScriptManager.Task
pop()
protected void
push(TagScriptManager.Task t)
void
run()
int
size()
-
-
-
Method Detail
-
addScript
public void addScript(CompiledTagScript s)
-
getDefinedIds
public java.util.Set<java.lang.String> getDefinedIds()
Description copied from interface:TagScriptEvaluator
Returns the script ids that are defined on this evaluator. Primarily for information purposes, since the evaluator doesn't mind if invoke is called for non-defined ids.- Specified by:
getDefinedIds
in interfaceTagScriptEvaluator
-
size
public int size()
-
find
protected CompiledTagScript find(java.lang.String id)
-
invoke
public void invoke(java.lang.String id, Tag source, TagPath sourcePath, TagScriptMonitor status, java.lang.Object... params)
Description copied from interface:TagScriptEvaluator
Executes the script defined for the given id against the source object provided.- Specified by:
invoke
in interfaceTagScriptEvaluator
-
push
protected void push(TagScriptManager.Task t)
-
pop
protected TagScriptManager.Task pop()
-
maybeSchedule
protected void maybeSchedule()
-
run
public void run()
- Specified by:
run
in interfacejava.lang.Runnable
-
-