Class StatelessJob<Match extends IPatternMatch>
- java.lang.Object
-
- org.eclipse.viatra.transformation.evm.api.Job<Match>
-
- org.eclipse.viatra.transformation.evm.specific.job.StatelessJob<Match>
-
- Direct Known Subclasses:
SequentialProcessorsJob
public class StatelessJob<Match extends IPatternMatch> extends Job<Match>
This class represents aJob
that uses anConsumer
on the match of the activation when executed.
-
-
Constructor Summary
Constructors Constructor Description StatelessJob(CRUDActivationStateEnum activationStateEnum, java.util.function.Consumer<Match> matchProcessor)
Creates a stateless job for the given state and processor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
execute(Activation<? extends Match> activation, Context context)
Executes the action on the activation using the supplied context.java.util.function.Consumer<Match>
getMatchProcessor()
protected void
handleError(Activation<? extends Match> activation, java.lang.Exception exception, Context context)
Called if theJob.execute(org.eclipse.viatra.transformation.evm.api.Activation<? extends EventAtom>, org.eclipse.viatra.transformation.evm.api.Context)
method has thrown an exception to allow jobs to handle their own errors.-
Methods inherited from class org.eclipse.viatra.transformation.evm.api.Job
getActivationState
-
-
-
-
Constructor Detail
-
StatelessJob
public StatelessJob(CRUDActivationStateEnum activationStateEnum, java.util.function.Consumer<Match> matchProcessor)
Creates a stateless job for the given state and processor.- Since:
- 2.0
-
-
Method Detail
-
getMatchProcessor
public java.util.function.Consumer<Match> getMatchProcessor()
- Returns:
- the matchProcessor executed by the job
- Since:
- 2.0
-
execute
protected void execute(Activation<? extends Match> activation, Context context)
Description copied from class:Job
Executes the action on the activation using the supplied context.- Specified by:
execute
in classJob<Match extends IPatternMatch>
-
handleError
protected void handleError(Activation<? extends Match> activation, java.lang.Exception exception, Context context)
Description copied from class:Job
Called if theJob.execute(org.eclipse.viatra.transformation.evm.api.Activation<? extends EventAtom>, org.eclipse.viatra.transformation.evm.api.Context)
method has thrown an exception to allow jobs to handle their own errors.- Specified by:
handleError
in classJob<Match extends IPatternMatch>
-
-