diff options
Diffstat (limited to 'subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/backend/IQueryBackendFactory.java')
-rw-r--r-- | subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/backend/IQueryBackendFactory.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/backend/IQueryBackendFactory.java b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/backend/IQueryBackendFactory.java new file mode 100644 index 00000000..e264ab3f --- /dev/null +++ b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/matchers/backend/IQueryBackendFactory.java | |||
@@ -0,0 +1,52 @@ | |||
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.matchers.backend; | ||
10 | |||
11 | import tools.refinery.viatra.runtime.matchers.context.IQueryBackendContext; | ||
12 | import tools.refinery.viatra.runtime.matchers.psystem.queries.PQuery; | ||
13 | |||
14 | /** | ||
15 | * A Query Backend Factory identifies a query evaluator implementation, and can create an evaluator instance (an {@link IQueryBackend}) tied to a specific VIATRA Query engine upon request. | ||
16 | * | ||
17 | * <p> The factory is used as a lookup key for the backend instance, | ||
18 | * therefore implementors should either be singletons, or implement equals() / hashCode() accordingly. | ||
19 | * | ||
20 | * @author Bergmann Gabor | ||
21 | * | ||
22 | */ | ||
23 | public interface IQueryBackendFactory { | ||
24 | |||
25 | /** | ||
26 | * Creates a new {@link IQueryBackend} instance tied to the given context elements. | ||
27 | * | ||
28 | * @return an instance of the class returned by {@link #getBackendClass()} that operates in the given context. | ||
29 | * @since 1.5 | ||
30 | */ | ||
31 | public IQueryBackend | ||
32 | create(IQueryBackendContext context); | ||
33 | |||
34 | |||
35 | /** | ||
36 | * The backend instances created by this factory are guaranteed to conform to the returned class. | ||
37 | */ | ||
38 | public Class<? extends IQueryBackend> getBackendClass(); | ||
39 | |||
40 | /** | ||
41 | * Calculate the required capabilities, which are needed to execute the given pattern | ||
42 | * | ||
43 | * @since 1.4 | ||
44 | */ | ||
45 | public IMatcherCapability calculateRequiredCapability(PQuery query, QueryEvaluationHint hint); | ||
46 | |||
47 | /** | ||
48 | * Returns whether the current backend is caching | ||
49 | * @since 2.0 | ||
50 | */ | ||
51 | public boolean isCaching(); | ||
52 | } | ||