Skip to content

Commit

Permalink
#70 Force initialization of default Viatra query backends
Browse files Browse the repository at this point in the history
  • Loading branch information
bergmanngabor authored and ujhelyiz committed Mar 26, 2021
1 parent d16dae1 commit c2bd11f
Showing 1 changed file with 12 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
import org.eclipse.viatra.query.runtime.api.IQuerySpecification;
import org.eclipse.viatra.query.runtime.api.ViatraQueryEngineOptions;
import org.eclipse.viatra.query.runtime.exception.ViatraQueryException;
import org.eclipse.viatra.query.runtime.localsearch.matcher.integration.LocalSearchEMFBackendFactory;
import org.eclipse.viatra.query.runtime.rete.matcher.ReteBackendFactory;

import com.incquerylabs.v4md.internal.MagicDrawProjectScope;
import com.incquerylabs.v4md.internal.NopQueryBackend;
Expand All @@ -37,6 +39,16 @@ public class ViatraQueryAdapter extends AdapterImpl {
"Cannot initialize VIATRA Query Engine until the project is loaded.";
private static final Logger LOGGER = Logger.getLogger(ViatraQueryAdapter.class);


static {
ViatraQueryEngineOptions.setSystemDefaultBackends(
ReteBackendFactory.INSTANCE,
ReteBackendFactory.INSTANCE,
LocalSearchEMFBackendFactory.INSTANCE
);
}


private Optional<AdvancedViatraQueryEngine> engine = Optional.empty();
private Project project;
private boolean engineDisposable = true;
Expand Down

0 comments on commit c2bd11f

Please sign in to comment.