protected void restartServer() throws Exception { shellServer.shutdown(); db.shutdown(); db = newDb(); remotelyAvailableOnPort = null; shellServer = newServer(db); shellClient = newShellClient(shellServer); }
private void shutdownIfNecessary(ShellServer server) { try { if (!hasBeenShutdown.compareAndSet(false, true)) { server.shutdown(); } } catch (RemoteException e) { throw new RuntimeException(e); } }
@After public void doAfter() throws Exception { if (tx != null) { finishTx(false); } shellClient.shutdown(); shellServer.shutdown(); db.shutdown(); }
protected Node getCurrentNode() throws RemoteException, ShellException { Serializable current = shellServer.interpretVariable(shellClient.getId(), Variables.CURRENT_KEY); int nodeId = parseInt(current.toString().substring(1)); try (Transaction tx = db.beginTx()) { Node nodeById = db.getNodeById(nodeId); tx.success(); return nodeById; } }
@After public void doAfter() throws Exception { server.shutdown(); db.shutdown(); }
public void executeCommand(ShellServer server, ShellClient client, String command) throws Exception { CollectingOutput output = new CollectingOutput(); server.interpretLine(client.getId(), command, output); }
protected void makeServerRemotelyAvailable() throws RemoteException { if (remotelyAvailableOnPort == null) { remotelyAvailableOnPort = findFreePort(); shellServer.makeRemotelyAvailable(remotelyAvailableOnPort, SimpleAppServer.DEFAULT_NAME); } }