diff options
Diffstat (limited to 'language-web/src/main/java/tools/refinery/language/web/ProblemServlet.java')
-rw-r--r-- | language-web/src/main/java/tools/refinery/language/web/ProblemServlet.java | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/language-web/src/main/java/tools/refinery/language/web/ProblemServlet.java b/language-web/src/main/java/tools/refinery/language/web/ProblemServlet.java new file mode 100644 index 00000000..d249525f --- /dev/null +++ b/language-web/src/main/java/tools/refinery/language/web/ProblemServlet.java | |||
@@ -0,0 +1,38 @@ | |||
1 | /* | ||
2 | * generated by Xtext 2.25.0 | ||
3 | */ | ||
4 | package tools.refinery.language.web; | ||
5 | |||
6 | import javax.servlet.ServletException; | ||
7 | |||
8 | import org.eclipse.xtext.util.DisposableRegistry; | ||
9 | import org.eclipse.xtext.web.servlet.XtextServlet; | ||
10 | |||
11 | /** | ||
12 | * Deploy this class into a servlet container to enable DSL-specific services. | ||
13 | */ | ||
14 | public class ProblemServlet extends XtextServlet { | ||
15 | |||
16 | private static final long serialVersionUID = 1L; | ||
17 | |||
18 | // Xtext requires a mutable servlet instance field. | ||
19 | @SuppressWarnings("squid:S2226") | ||
20 | private DisposableRegistry disposableRegistry; | ||
21 | |||
22 | @Override | ||
23 | public void init() throws ServletException { | ||
24 | super.init(); | ||
25 | var injector = new ProblemWebSetup().createInjectorAndDoEMFRegistration(); | ||
26 | this.disposableRegistry = injector.getInstance(DisposableRegistry.class); | ||
27 | } | ||
28 | |||
29 | @Override | ||
30 | public void destroy() { | ||
31 | if (disposableRegistry != null) { | ||
32 | disposableRegistry.dispose(); | ||
33 | disposableRegistry = null; | ||
34 | } | ||
35 | super.destroy(); | ||
36 | } | ||
37 | |||
38 | } | ||