public class ThreadContext extends Object
Constructor and Description |
---|
ThreadContext(MBpmnModel model)
Create a new top-level thread context.
|
ThreadContext(MSubProcess model,
ProcessThread initiator)
Create a new sub-level thread context.
|
Modifier and Type | Method and Description |
---|---|
void |
addExternalThread(ProcessThread thread)
Add an external thread to this context.
|
void |
addSubcontext(ThreadContext context)
Add a sub context.
|
void |
addThread(ProcessThread thread)
Add a thread to this context.
|
Set |
getAllThreads()
Get all threads of the context and all subcontexts.
|
ProcessThread |
getExecutableThread(String pool,
String lane)
Get an executable thread in the context or its sub contexts.
|
ProcessThread |
getInitiator()
Get the initiating thread.
|
MIdElement |
getModelElement()
Get the model element.
|
ThreadContext |
getParent()
Get the parent context.
|
ThreadContext |
getSubcontext(ProcessThread thread)
Get the subcontext of a thread.
|
Set<ProcessThread> |
getThreads()
Get all threads of this context.
|
boolean |
isFinished(String pool,
String lane)
The context is finished, when there are no (more) threads to execute.
|
void |
removeSubcontext(ThreadContext context)
Remove a sub context but keep the corresponding thread.
|
void |
removeThread(ProcessThread thread)
Remove a thread from this context.
|
String |
toString()
Get the string representation.
|
public ThreadContext(MBpmnModel model)
model
- The process model element.public ThreadContext(MSubProcess model, ProcessThread initiator)
model
- The sub process model element.initiator
- The initiating thread.public MIdElement getModelElement()
public ThreadContext getParent()
public ProcessThread getInitiator()
public void addThread(ProcessThread thread)
thread
- The thread to be added.public void addExternalThread(ProcessThread thread)
thread
- The thread to be added.public void removeThread(ProcessThread thread)
thread
- The thread to be removed.public Set<ProcessThread> getThreads()
public Set getAllThreads()
public void addSubcontext(ThreadContext context)
context
- The sub context to be added.public void removeSubcontext(ThreadContext context)
context
- The sub context to be removed.public ThreadContext getSubcontext(ProcessThread thread)
thread
- The thread which owns the subcontext.public boolean isFinished(String pool, String lane)
pool
- The pool to be executed or null for any.lane
- The lane to be executed or null for any. Nested lanes may be addressed by dot-notation, e.g. 'OuterLane.InnerLane'.public ProcessThread getExecutableThread(String pool, String lane)
pool
- The pool to be executed or null for any.lane
- The lane to be executed or null for any. Nested lanes may be addressed by dot-notation, e.g. 'OuterLane.InnerLane'.Copyright © 2012. All Rights Reserved.