public interface ExecutorThread extends ImplRelated
ModelClass
and
ModelClass.Port
instance is owned by one
model executor thread which runs and manages that instance.
All model code has to run on a thread that implements this interface.
As a member of the hu.elte.txtuml.api.model.impl package, this type should only be used to implement model executors, not in the model or in external libraries.
ImplRelated.RequiresRuntime<R extends ModelElementRuntime<?>>
Modifier and Type | Method and Description |
---|---|
static ExecutorThread |
current()
Gets the current model executor thread.
|
ModelRuntime |
getModelRuntime()
Returns the model runtime instance associated with the current model
execution.
|
default void |
requireOwned(ImplRelated.RequiresRuntime<?>... elements)
Ensures that the specified model elements are owned by this thread.
|
default void |
requireOwned(ImplRelated.RequiresRuntime<?> element)
Ensures that the specified model element is owned by this thread.
|
default void |
requireOwned(RequiresExecutorThread... wrappers)
Ensures that the specified runtime wrapper is owned by this thread.
|
default void |
requireOwned(RequiresExecutorThread wrapper)
Ensures that the specified runtime wrapper is owned by this thread.
|
static void |
requirePresence()
Ensures that the caller thread is a model executor thread.
|
getRuntimeOf
static ExecutorThread current() throws NotModelExecutorThreadError
NotModelExecutorThreadError
- if the caller thread is not a model executor threadstatic void requirePresence() throws NotModelExecutorThreadError
Just an alias to current()
without a returned value.
NotModelExecutorThreadError
- if the caller thread is not a model executor threaddefault void requireOwned(ImplRelated.RequiresRuntime<?> element) throws WrongModelExecutorThreadError
WrongModelExecutorThreadError
- if element
is not owned by this threaddefault void requireOwned(ImplRelated.RequiresRuntime<?>... elements) throws WrongModelExecutorThreadError
WrongModelExecutorThreadError
- if one (or more) of elements
is not owned by this
threaddefault void requireOwned(RequiresExecutorThread wrapper) throws WrongModelExecutorThreadError
WrongModelExecutorThreadError
- if wrapper
is not owned by this threaddefault void requireOwned(RequiresExecutorThread... wrappers) throws WrongModelExecutorThreadError
WrongModelExecutorThreadError
- if one (or more) of wrappers
is not owned by this
threadModelRuntime getModelRuntime()