public class Driver
extends java.lang.Thread
Modifier and Type | Field and Description |
---|---|
private BaseState |
base
State shared by all callbacks (across multiple different trees).
|
private java.util.concurrent.CountDownLatch |
latch
Mechanism to notify the main engine thread of completion.
|
private AstManager |
mgr
Provides core AST services.
|
private Pipeline |
pipeline
Callbacks to execute based on the events of the tree walk.
|
private java.util.concurrent.ConcurrentLinkedQueue<java.lang.String> |
queue
Queue from which to obtain the next tree name to process.
|
Constructor and Description |
---|
Driver(java.util.concurrent.ConcurrentLinkedQueue<java.lang.String> queue,
Pipeline pipeline,
BaseState base,
java.util.concurrent.CountDownLatch latch)
Construct a driver thread instance.
|
Modifier and Type | Method and Description |
---|---|
private WalkState |
prepareState(Resolver resolver,
Aast here)
Setup the resolver and walk state for the walk of a tree at the
beginning of a walk element in the pipeline.
|
void |
run()
Execute the core logic of the thread.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private final java.util.concurrent.ConcurrentLinkedQueue<java.lang.String> queue
private final Pipeline pipeline
private final BaseState base
private final java.util.concurrent.CountDownLatch latch
private final AstManager mgr
public Driver(java.util.concurrent.ConcurrentLinkedQueue<java.lang.String> queue, Pipeline pipeline, BaseState base, java.util.concurrent.CountDownLatch latch)
queue
- Queue from which to obtain the next tree name to process.pipeline
- Callbacks to execute based on the events of the tree walk.base
- Common state shared with all callbacks.latch
- Mechanism to notify the main engine thread of completion.public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
private WalkState prepareState(Resolver resolver, Aast here)
resolver
- The resolver used in the previous walk element or
null
for the first walk element.here
- This is the root node for the read-only "source" tree.