Package javarepl.client

Examples of javarepl.client.JavaREPLClient


    }

    public void initAndRun(final String... statements) throws ExecutionException, IOException {
        port = randomServerPort();

        languageConsole = new JavaREPLLanguageConsole(project, consoleTitle, JavaLanguage.INSTANCE, new JavaREPLClient("localhost", port));
        languageConsoleView = new JavaREPLLanguageConsoleView(languageConsole);

        GeneralCommandLine commandLine = createCommandLine(module, workingDir);
        processHandler = new ColoredProcessHandler(commandLine.createProcess(), commandLine.getCommandLineString()) {
            @Override
View Full Code Here


    private static ResultPrinter console;

    public static void main(String... args) throws Exception {
        console = new ResultPrinter(printColors(args));

        JavaREPLClient client = clientFor(hostname(args), port(args));
        ExpressionReader expressionReader = expressionReaderFor(client);

        Option<String> expression = none();
        Option<EvaluationResult> result = none();
        while (expression.isEmpty() || !result.isEmpty()) {
            expression = expressionReader.readExpression();

            if (!expression.isEmpty()) {
                result = client.execute(expression.get());
                if (!result.isEmpty())
                    console.printEvaluationResult(result.get());
            }
        }
    }
View Full Code Here

            return connectToRemoteInstance(hostname.getOrElse("localhost"), port.getOrElse(randomServerPort()));
        }
    }

    private static JavaREPLClient connectToRemoteInstance(String hostname, Integer port) {
        JavaREPLClient replClient = new JavaREPLClient(hostname, port);

        if (!replClient.status().isRunning()) {
            console.printError("ERROR: Could not connect to remote REPL instance at http://" + hostname + ":" + port);
            System.exit(0);
        } else {
            console.printInfo("Connected to remote instance at http://" + hostname + ":" + port);
        }

        String remoteInstanceVersion = replClient.version();
        if (!remoteInstanceVersion.equals(applicationVersion())) {
            console.printError("WARNING: Client version (" + applicationVersion() + ") is different from remote instance version (" + remoteInstanceVersion + ")");
        }

        return replClient;
View Full Code Here

                console.printInfo("\nTerminating...");
                process.get().destroy();
            }
        });

        JavaREPLClient replClient = new JavaREPLClient(hostname, port);
        if (!waitUntilInstanceStarted(replClient)) {
            console.printError("\nERROR: Could not start REPL instance at http://" + hostname + ":" + port);
            System.exit(0);
        }
View Full Code Here

    public Sequence<String> history() {
        createProcess();

        try {
            return new JavaREPLClient("localhost", port.get()).history();
        } catch (Exception e) {
            e.printStackTrace();
            return Sequences.empty();
        }
    }
View Full Code Here

TOP

Related Classes of javarepl.client.JavaREPLClient

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.