//the protocol handles the command line to launch gradle and messaging between us and said externally launched gradle.
ProcessLauncherServer.Protocol serverProtocol = request.createServerProtocol(logLevel, stackTraceLevel, currentDirectory, gradleHomeDirectory, customGradleExecutor);
//the server kicks off gradle as an external process and manages the communication with said process
ProcessLauncherServer server = new ProcessLauncherServer(serverProtocol);
request.setProcessLauncherServer(server);
//we need to know when this command is finished executing so we can mark it as complete and notify any observers.
server.addServerObserver( new ProcessLauncherServer.ServerObserver()
{
public void clientExited( int result, String output )
{
currentlyExecutingRequests.remove( request );
notifyRequestExecutionComplete( request, result, output );
}
public void serverExited() { }
}, false );
server.start();
}