+ private final boolean interactive;
+
+ LocalJShellSession(Path sessionDir, Path bundleIdDir, boolean interactive) {
+ this.interactive = interactive;
+ try {
+ this.sessionDir = sessionDir;
+ this.uuid = UUID.fromString(sessionDir.getFileName().toString());
+ bundleId = Long.parseLong(bundleIdDir.getFileName().toString());
+ socketsDir = bundleIdDir.resolve(uuid.toString());
+ Files.createDirectories(socketsDir);
+
+ stdPath = socketsDir.resolve(JShellClient.STD);
+ Files.createSymbolicLink(sessionDir.resolve(JShellClient.STD), stdPath);
+
+ ctlPath = socketsDir.resolve(JShellClient.CTL);
+ Files.createSymbolicLink(sessionDir.resolve(JShellClient.CTL), ctlPath);
+
+ // TODO proper login
+ try {
+ loginContext = new LoginContext(CmsAuth.DATA_ADMIN.getLoginContextName());
+ loginContext.login();
+ } catch (LoginException e1) {
+ throw new RuntimeException("Could not login as data admin", e1);
+ } finally {
+ }
+
+ } catch (IOException e) {
+ log.error("Cannot initiate local session " + uuid, e);
+ cleanUp();
+ return;
+ }
+ replThread = new Thread(() -> CurrentSubject.callAs(loginContext.getSubject(), Executors.callable(this)),
+ "JShell " + sessionDir);