Search in sources :

Example 1 with Finished

use of org.gradle.launcher.daemon.protocol.Finished in project gradle by gradle.

the class ReportStatusDispatcher method dispatch.

public Status dispatch(Connection<Message> connection, Command statusCommand) {
    Status returnedStatus = null;
    Throwable failure = null;
    try {
        connection.dispatch(statusCommand);
        Result result = (Result) connection.receive();
        if (result instanceof Failure) {
            failure = ((Failure) result).getValue();
        } else if (result instanceof Success) {
            returnedStatus = (Status) result.getValue();
        }
        connection.dispatch(new Finished());
    } catch (Throwable e) {
        failure = e;
    }
    if (failure != null) {
        LOGGER.debug(String.format("Unable to get status of %s.", connection), failure);
    }
    return returnedStatus;
}
Also used : Status(org.gradle.launcher.daemon.protocol.Status) Finished(org.gradle.launcher.daemon.protocol.Finished) Failure(org.gradle.launcher.daemon.protocol.Failure) Success(org.gradle.launcher.daemon.protocol.Success) Result(org.gradle.launcher.daemon.protocol.Result)

Aggregations

Failure (org.gradle.launcher.daemon.protocol.Failure)1 Finished (org.gradle.launcher.daemon.protocol.Finished)1 Result (org.gradle.launcher.daemon.protocol.Result)1 Status (org.gradle.launcher.daemon.protocol.Status)1 Success (org.gradle.launcher.daemon.protocol.Success)1