Skip to content

Commit

Permalink
Simplification of sequential engine API: no more runnables, but abstr…
Browse files Browse the repository at this point in the history
…act protected methods

Also formatting and reorganisation of the order of some methods.
  • Loading branch information
ebousse committed Mar 24, 2016
1 parent 67ee1f2 commit eeadb6f
Show file tree
Hide file tree
Showing 3 changed files with 191 additions and 210 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ public abstract class AbstractSequentialExecutionEngine extends AbstractExecutio
protected InternalTransactionalEditingDomain editingDomain;
private IMultiDimensionalTraceAddon traceAddon;

abstract protected void executeEntryPoint();

abstract protected void initializeModel();

@Override
public void initialize(IExecutionContext executionContext) {
super.initialize(executionContext);
Expand All @@ -63,11 +67,8 @@ public void initialize(IExecutionContext executionContext) {
@Override
public void run() {
try {
Runnable initializeModel = getInitializeModel();
if (initializeModel != null) {
initializeModel.run();
}
getEntryPoint().run();
initializeModel();
executeEntryPoint();
Activator.getDefault().info("Execution finished");
notifyAboutToStop();
} finally {
Expand Down Expand Up @@ -328,8 +329,7 @@ protected void doExecute() {
beforeExecutionStep(caller, className, operationName, rc);
rc.execute();
}



private void stopExecutionIfAsked() {
// If the engine is stopped, we use this call to stop the execution
if (_isStopped) {
Expand Down Expand Up @@ -388,7 +388,7 @@ protected void afterExecutionStep() {
RecordingCommand emptyrc = null;

try {

LogicalStep logicalStep = currentLogicalSteps.pop();

// We commit the transaction (which might be a different one
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@

public interface ISequentialExecutionEngine extends IBasicExecutionEngine {

public Runnable getEntryPoint();

public Runnable getInitializeModel();

public Deque<MSEOccurrence> getCurrentStack();

public MSEOccurrence getCurrentMSEOccurrence();



}
Loading

0 comments on commit eeadb6f

Please sign in to comment.