Groovy Documentation

org.gradle.tooling
[Java] Interface BuildConnection


public interface BuildConnection

Represents a long-lived connection to a Gradle build.

Thread safety

All implementations of GradleConnection are thread-safe, and may be shared by any number of threads.

All notifications from a given GradleConnection instance are delivered by a single thread at a time. Note, however, that the delivery thread may change over time.


Method Summary
T getModel(java.lang.Class viewType)

Fetches a snapshot of the model for this build.

void getModel(java.lang.Class viewType, ResultHandler handler)

Fetches a snapshot of the model for this build asynchronously.

 

Method Detail

getModel

public T getModel(java.lang.Class viewType)
Fetches a snapshot of the model for this build. This method blocks until the model is available.
throws:
UnsupportedVersionException When the target Gradle version does not support the given model.
throws:
GradleConnectionException On some failure to communicate with Gradle.
Parameters:
viewType - The model type.
- The model type.
Returns:
The model.


getModel

public void getModel(java.lang.Class viewType, ResultHandler handler)
Fetches a snapshot of the model for this build asynchronously. This method return immediately, and the result of the operation is passed to the supplied result handler.
Parameters:
viewType - The model type.
handler - The handler to pass the result to.
- The model type.


 

Groovy Documentation