public class DaemonClient extends Object implements GradleLauncherActionExecuter<BuildActionParameters>
Immediately upon forming a connection, the daemon may send OutputEvent messages back to the client and may do so
for as long as the connection is open.
The client is expected to send exactly one Build message as the first message it sends to the daemon. The daemon
may either return DaemonBusy or BuildStarted. If the former is received, the client should not send any more
messages to this daemon. If the latter is received, the client can assume the daemon is performing the build. The client may then
send zero to many ForwardInput messages. If the client's stdin stream is closed before the connection to the
daemon is terminated, the client must send a CloseInput command to instruct the daemon that no more input is to be
expected.
After receiving the Result message (after a BuildStarted mesage), the client must send a CloseInput
command if it has not already done so due to the stdin stream being closed. At this point the client is expected to
terminate the connection with the daemon.
If the daemon returns a null message before returning a Result object, it has terminated unexpectedly for some reason.
| Modifier and Type | Field and Description |
|---|---|
protected BuildClientMetaData |
clientMetaData |
protected DaemonConnector |
connector |
| Constructor and Description |
|---|
DaemonClient(DaemonConnector connector,
BuildClientMetaData clientMetaData,
OutputEventListener outputEventListener,
Spec<DaemonContext> compatibilitySpec,
InputStream buildStandardInput) |
| Modifier and Type | Method and Description |
|---|---|
<T> T |
execute(GradleLauncherAction<T> action,
BuildActionParameters parameters)
Executes the given action in the daemon.
|
protected Object |
executeBuild(Build build,
Connection<Object> connection) |
void |
stop()
Stops all daemons, if any is running.
|
protected final DaemonConnector connector
protected final BuildClientMetaData clientMetaData
public DaemonClient(DaemonConnector connector, BuildClientMetaData clientMetaData, OutputEventListener outputEventListener, Spec<DaemonContext> compatibilitySpec, InputStream buildStandardInput)
public void stop()
public <T> T execute(GradleLauncherAction<T> action, BuildActionParameters parameters)
execute in interface GradleLauncherActionExecuter<BuildActionParameters>T - The result typeaction - The actionReportedException - On failure, when the failure has already been logged/reported.protected Object executeBuild(Build build, Connection<Object> connection) throws org.gradle.launcher.daemon.client.DaemonInitialConnectException
org.gradle.launcher.daemon.client.DaemonInitialConnectExceptionCopyright © 2013. All rights reserved