diff options
Diffstat (limited to 'subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/scope/IEngineContext.java')
-rw-r--r-- | subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/scope/IEngineContext.java | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/scope/IEngineContext.java b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/scope/IEngineContext.java new file mode 100644 index 00000000..55060853 --- /dev/null +++ b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/scope/IEngineContext.java | |||
@@ -0,0 +1,49 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2014, Bergmann Gabor, Istvan Rath and Daniel Varro | ||
3 | * This program and the accompanying materials are made available under the | ||
4 | * terms of the Eclipse Public License v. 2.0 which is available at | ||
5 | * http://www.eclipse.org/legal/epl-v20.html. | ||
6 | * | ||
7 | * SPDX-License-Identifier: EPL-2.0 | ||
8 | *******************************************************************************/ | ||
9 | package tools.refinery.viatra.runtime.api.scope; | ||
10 | |||
11 | import tools.refinery.viatra.runtime.matchers.ViatraQueryRuntimeException; | ||
12 | import tools.refinery.viatra.runtime.matchers.context.IQueryRuntimeContext; | ||
13 | |||
14 | /** | ||
15 | * The context of the engine is instantiated by the scope, | ||
16 | * and provides information and services regarding the model the towards the engine. | ||
17 | * | ||
18 | * @author Bergmann Gabor | ||
19 | * | ||
20 | */ | ||
21 | public interface IEngineContext { | ||
22 | |||
23 | /** | ||
24 | * Returns the base index. | ||
25 | * @throws ViatraQueryRuntimeException if the base index cannot be accessed | ||
26 | */ | ||
27 | IBaseIndex getBaseIndex(); | ||
28 | |||
29 | /** | ||
30 | * Disposes this context object. Resources in the index may now be freed up. | ||
31 | * No more methods should be called after this one. | ||
32 | * | ||
33 | * @throws IllegalStateException if there are any active listeners to the underlying index | ||
34 | */ | ||
35 | void dispose(); | ||
36 | |||
37 | /** | ||
38 | * Provides instance model information for pattern matching. | ||
39 | * | ||
40 | * <p> Implementors note: must be reentrant. | ||
41 | * If called while index loading is already in progress, must return the single runtime context instance that will eventually index the model. | ||
42 | * When the runtime query context is invoked in such a case, incomplete indexes are tolerable, but change notifications must be correctly provided as loading commences. | ||
43 | * | ||
44 | * @return a runtime context for pattern matching | ||
45 | * @since 1.2 | ||
46 | * @throws ViatraQueryRuntimeException if the runtime context cannot be initialized | ||
47 | */ | ||
48 | public IQueryRuntimeContext getQueryRuntimeContext(); | ||
49 | } \ No newline at end of file | ||