diff options
Diffstat (limited to 'subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/ViatraQueryEngineLifecycleListener.java')
-rw-r--r-- | subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/ViatraQueryEngineLifecycleListener.java | 52 |
1 files changed, 52 insertions, 0 deletions
diff --git a/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/ViatraQueryEngineLifecycleListener.java b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/ViatraQueryEngineLifecycleListener.java new file mode 100644 index 00000000..1c4dc264 --- /dev/null +++ b/subprojects/viatra-runtime/src/main/java/tools/refinery/viatra/runtime/api/ViatraQueryEngineLifecycleListener.java | |||
@@ -0,0 +1,52 @@ | |||
1 | /******************************************************************************* | ||
2 | * Copyright (c) 2010-2013, Abel Hegedus, 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; | ||
10 | |||
11 | |||
12 | /** | ||
13 | * Listener interface for getting notification on changes in an {@link ViatraQueryEngine}. | ||
14 | * | ||
15 | * You can use it to remove any other listeners that you attached to matchers or the engine, | ||
16 | * or to handle matchers that are initialized after you started using the engine. | ||
17 | * | ||
18 | * @author Abel Hegedus | ||
19 | * | ||
20 | */ | ||
21 | public interface ViatraQueryEngineLifecycleListener { | ||
22 | |||
23 | // ------------------------------------------------------------------------------- | ||
24 | // MATCHERS (methods notifying on changes in the matchers available in the engine) | ||
25 | // ------------------------------------------------------------------------------- | ||
26 | |||
27 | /** | ||
28 | * Called after a matcher is instantiated in the engine | ||
29 | * | ||
30 | * @param matcher the new matcher | ||
31 | */ | ||
32 | void matcherInstantiated(ViatraQueryMatcher<? extends IPatternMatch> matcher); | ||
33 | |||
34 | // ------------------------------------------------------------------------- | ||
35 | // HEALTH (methods notifying on changes that affect the health of the engine | ||
36 | // ------------------------------------------------------------------------- | ||
37 | |||
38 | /** | ||
39 | * Called after the engine has become tainted due to a fatal error | ||
40 | */ | ||
41 | void engineBecameTainted(String message, Throwable t); | ||
42 | |||
43 | /** | ||
44 | * Called after the engine has been wiped | ||
45 | */ | ||
46 | void engineWiped(); | ||
47 | |||
48 | /** | ||
49 | * Called after the engine has been disposed | ||
50 | */ | ||
51 | void engineDisposed(); | ||
52 | } | ||