Package com.googlecode.utterlyidle.handlers

Examples of com.googlecode.utterlyidle.handlers.ClientHttpHandler


    @Before
    public void setUp() throws Exception {
        console = new RestConsole(new SimpleConsole(ConsoleConfig.consoleConfig()), randomServerPort());
        console.start();

        client = new ClientHttpHandler();
        prefixUrl = "http://localhost:" + console.port();
    }
View Full Code Here


        }
    }

    private ConsoleStatus status() {
        try {
            return ConsoleStatus.valueOf(parse(new ClientHttpHandler().handle(get("http://localhost:" + port.get() + "/status").build()).entity().toString())
                    .get("status", String.class));

        } catch (Exception e) {
            return Idle;
        }
View Full Code Here

    public Response execute(String expression) {
        createProcess();

        try {
            return reportProcessError(new ClientHttpHandler().handle(RequestBuilder.post("http://localhost:" + port.get() + "/" + "execute").form("expression", expression).build()));
        } catch (Exception e) {
            e.printStackTrace();
            return response(INTERNAL_SERVER_ERROR);
        }
    }
View Full Code Here

    public Response readExpression(String line) {
        createProcess();

        try {
            return reportProcessError(new ClientHttpHandler().handle(RequestBuilder.post("http://localhost:" + port.get() + "/" + "readExpression").form("line", line).build()));
        } catch (Exception e) {
            e.printStackTrace();
            return response(INTERNAL_SERVER_ERROR);
        }
    }
View Full Code Here

    public Response completions(String expression) {
        createProcess();

        try {
            return reportProcessError(new ClientHttpHandler().handle(RequestBuilder.get("http://localhost:" + port.get() + "/" + "completions").query("expression", expression).build()));
        } catch (Exception e) {
            e.printStackTrace();
            return response(INTERNAL_SERVER_ERROR);
        }
    }
View Full Code Here

    private final ClientHttpHandler client;

    public JavaREPLClient(String hostname, Integer port) {
        this.hostname = hostname;
        this.port = port;
        this.client = new ClientHttpHandler();
    }
View Full Code Here

TOP

Related Classes of com.googlecode.utterlyidle.handlers.ClientHttpHandler

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.