diff options
Diffstat (limited to 'subprojects/store-query-viatra/src/main/java/org/eclipse/viatra/query/runtime/rete/network/RefineryNodeFactory.java')
-rw-r--r-- | subprojects/store-query-viatra/src/main/java/org/eclipse/viatra/query/runtime/rete/network/RefineryNodeFactory.java | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/subprojects/store-query-viatra/src/main/java/org/eclipse/viatra/query/runtime/rete/network/RefineryNodeFactory.java b/subprojects/store-query-viatra/src/main/java/org/eclipse/viatra/query/runtime/rete/network/RefineryNodeFactory.java new file mode 100644 index 00000000..1a76e22a --- /dev/null +++ b/subprojects/store-query-viatra/src/main/java/org/eclipse/viatra/query/runtime/rete/network/RefineryNodeFactory.java | |||
@@ -0,0 +1,37 @@ | |||
1 | /* | ||
2 | * SPDX-FileCopyrightText: 2023 The Refinery Authors <https://refinery.tools/> | ||
3 | * | ||
4 | * SPDX-License-Identifier: EPL-2.0 | ||
5 | */ | ||
6 | package org.eclipse.viatra.query.runtime.rete.network; | ||
7 | |||
8 | import org.apache.log4j.Logger; | ||
9 | import org.eclipse.viatra.query.runtime.rete.recipes.ReteNodeRecipe; | ||
10 | import org.eclipse.viatra.query.runtime.rete.traceability.TraceInfo; | ||
11 | import tools.refinery.store.query.viatra.internal.rete.network.RefineryNodeFactoryExtensions; | ||
12 | |||
13 | /** | ||
14 | * This class overrides some RETE node types from {@link NodeFactory}. | ||
15 | * <p> | ||
16 | * Since {@link NodeFactory} is package-private, this class has to be in the | ||
17 | * {@code org.eclipse.viatra.query.runtime.rete.network} package as well. | ||
18 | * However, due to JAR signature verification errors, <b>this class cannot be loaded directly</b> | ||
19 | * and has to be loaded at runtime as a byte array instead. | ||
20 | */ | ||
21 | @SuppressWarnings("unused") | ||
22 | class RefineryNodeFactory extends NodeFactory { | ||
23 | private final RefineryNodeFactoryExtensions extensions = new RefineryNodeFactoryExtensions(); | ||
24 | |||
25 | public RefineryNodeFactory(Logger logger) { | ||
26 | super(logger); | ||
27 | } | ||
28 | |||
29 | @Override | ||
30 | public Supplier createNode(ReteContainer reteContainer, ReteNodeRecipe recipe, TraceInfo... traces) { | ||
31 | var extendedResult = extensions.createNode(reteContainer, recipe, traces); | ||
32 | if (extendedResult != null) { | ||
33 | return extendedResult; | ||
34 | } | ||
35 | return super.createNode(reteContainer, recipe, traces); | ||
36 | } | ||
37 | } | ||