use of org.gradle.internal.service.ServiceRegistry in project gradle by gradle.
the class BuildActionsFactory method showDaemonStatus.
private Runnable showDaemonStatus(DaemonParameters daemonParameters, ServiceRegistry loggingServices) {
ServiceRegistry clientSharedServices = createGlobalClientServices(false);
ServiceRegistry clientServices = clientSharedServices.get(DaemonClientFactory.class).createStopDaemonServices(loggingServices.get(OutputEventListener.class), daemonParameters);
ReportDaemonStatusClient statusClient = clientServices.get(ReportDaemonStatusClient.class);
return new ReportDaemonStatusAction(statusClient);
}
use of org.gradle.internal.service.ServiceRegistry in project gradle by gradle.
the class BuildActionsFactory method runBuildWithDaemon.
private Runnable runBuildWithDaemon(StartParameterInternal startParameter, DaemonParameters daemonParameters, ServiceRegistry loggingServices) {
// Create a client that will match based on the daemon startup parameters.
ServiceRegistry clientSharedServices = createGlobalClientServices(true);
ServiceRegistry clientServices = clientSharedServices.get(DaemonClientFactory.class).createBuildClientServices(loggingServices.get(OutputEventListener.class), daemonParameters, System.in);
DaemonClient client = clientServices.get(DaemonClient.class);
return runBuildAndCloseServices(startParameter, daemonParameters, client, clientSharedServices, clientServices);
}
use of org.gradle.internal.service.ServiceRegistry in project gradle by gradle.
the class BuildActionsFactory method stopAllDaemons.
private Runnable stopAllDaemons(DaemonParameters daemonParameters, ServiceRegistry loggingServices) {
ServiceRegistry clientSharedServices = createGlobalClientServices(false);
ServiceRegistry clientServices = clientSharedServices.get(DaemonClientFactory.class).createStopDaemonServices(loggingServices.get(OutputEventListener.class), daemonParameters);
DaemonStopClient stopClient = clientServices.get(DaemonStopClient.class);
return new StopDaemonAction(stopClient);
}
use of org.gradle.internal.service.ServiceRegistry in project gradle by gradle.
the class ConnectionScopeServices method createShutdownCoordinator.
ShutdownCoordinator createShutdownCoordinator(ListenerManager listenerManager, DaemonClientFactory daemonClientFactory, OutputEventListener outputEventListener) {
ServiceRegistry clientServices = daemonClientFactory.createStopDaemonServices(outputEventListener, new DaemonParameters(new BuildLayoutParameters()));
DaemonStopClient client = clientServices.get(DaemonStopClient.class);
ShutdownCoordinator shutdownCoordinator = new ShutdownCoordinator(client);
listenerManager.addListener(shutdownCoordinator);
return shutdownCoordinator;
}
use of org.gradle.internal.service.ServiceRegistry in project gradle by gradle.
the class ServicesSetupBuildActionExecuter method execute.
@Override
public Object execute(BuildAction action, BuildRequestContext requestContext, BuildActionParameters actionParameters, ServiceRegistry contextServices) {
StartParameter startParameter = action.getStartParameter();
final ServiceRegistry userHomeServices = userHomeServiceRegistry.getServicesFor(startParameter.getGradleUserHomeDir());
CrossBuildSessionScopeServices crossBuildSessionScopeServices = new CrossBuildSessionScopeServices(contextServices, startParameter);
try {
ServiceRegistry buildSessionScopeServices = new BuildSessionScopeServices(userHomeServices, crossBuildSessionScopeServices, startParameter, requestContext, actionParameters.getInjectedPluginClasspath());
try {
SessionLifecycleListener sessionLifecycleListener = buildSessionScopeServices.get(ListenerManager.class).getBroadcaster(SessionLifecycleListener.class);
try {
sessionLifecycleListener.afterStart();
return delegate.execute(action, requestContext, actionParameters, buildSessionScopeServices);
} finally {
sessionLifecycleListener.beforeComplete();
}
} finally {
CompositeStoppable.stoppable(buildSessionScopeServices).stop();
}
} finally {
new CompositeStoppable().add(new Stoppable() {
@Override
public void stop() {
userHomeServiceRegistry.release(userHomeServices);
}
}, crossBuildSessionScopeServices).stop();
}
}
Aggregations