Search in sources :

Example 1 with Message

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

the class DefaultDaemonConnector method connectToDaemon.

private DaemonClientConnection connectToDaemon(DaemonConnectDetails daemon, DaemonClientConnection.StaleAddressDetector staleAddressDetector) throws ConnectException {
    ProgressLogger progressLogger = progressLoggerFactory.newOperation(DefaultDaemonConnector.class).start("Connecting to Gradle Daemon", "Connecting to Daemon");
    RemoteConnection<Message> connection;
    try {
        connection = connector.connect(daemon.getAddress()).create(Serializers.stateful(DaemonMessageSerializer.create()));
    } catch (ConnectException e) {
        staleAddressDetector.maybeStaleAddress(e);
        throw e;
    } finally {
        progressLogger.completed();
    }
    return new DaemonClientConnection(connection, daemon, staleAddressDetector);
}
Also used : Message(org.gradle.launcher.daemon.protocol.Message) ProgressLogger(org.gradle.internal.logging.progress.ProgressLogger) ConnectException(org.gradle.internal.remote.internal.ConnectException)

Aggregations

ProgressLogger (org.gradle.internal.logging.progress.ProgressLogger)1 ConnectException (org.gradle.internal.remote.internal.ConnectException)1 Message (org.gradle.launcher.daemon.protocol.Message)1