]> git.argeo.org Git - lgpl/argeo-commons.git/blob - org.argeo.cms.jshell/src/org/argeo/cms/jshell/CmsExecutionControl.java
Small improvements to JShell
[lgpl/argeo-commons.git] / org.argeo.cms.jshell / src / org / argeo / cms / jshell / CmsExecutionControl.java
1 package org.argeo.cms.jshell;
2
3 import jdk.jshell.execution.DirectExecutionControl;
4 import jdk.jshell.execution.LoaderDelegate;
5 import jdk.jshell.spi.ExecutionControl;
6 import jdk.jshell.spi.ExecutionEnv;
7
8 /** Custom {@link ExecutionControl}. */
9 public class CmsExecutionControl extends DirectExecutionControl {
10 private final ExecutionEnv executionEnv;
11
12 public CmsExecutionControl(ExecutionEnv executionEnv, LoaderDelegate loaderDelegate) {
13 super(loaderDelegate);
14 this.executionEnv = executionEnv;
15
16 }
17
18 @Override
19 protected void clientCodeEnter() throws InternalException {
20 super.clientCodeEnter();
21 }
22
23 @Override
24 protected void clientCodeLeave() throws InternalException {
25 super.clientCodeLeave();
26 executionEnv.userOut().flush();
27 }
28
29 }