use of org.gradle.internal.concurrent.CompositeStoppable in project gradle by gradle.
the class BuildActionsFactory method runBuildAndCloseServices.
private Runnable runBuildAndCloseServices(StartParameter startParameter, DaemonParameters daemonParameters, BuildActionExecuter<BuildActionParameters> executer, ServiceRegistry sharedServices, Object... stopBeforeSharedServices) {
BuildActionParameters parameters = createBuildActionParamters(startParameter, daemonParameters);
Stoppable stoppable = new CompositeStoppable().add(stopBeforeSharedServices).add(sharedServices);
return new RunBuildAction(executer, startParameter, clientMetaData(), getBuildStartTime(), parameters, sharedServices, stoppable);
}
use of org.gradle.internal.concurrent.CompositeStoppable in project gradle by gradle.
the class BuildActionsFactory method runBuildAndCloseServices.
private Runnable runBuildAndCloseServices(StartParameterInternal startParameter, DaemonParameters daemonParameters, BuildActionExecuter<BuildActionParameters> executer, ServiceRegistry sharedServices, Object... stopBeforeSharedServices) {
BuildActionParameters parameters = createBuildActionParameters(startParameter, daemonParameters);
Stoppable stoppable = new CompositeStoppable().add(stopBeforeSharedServices).add(sharedServices);
return new RunBuildAction(executer, startParameter, clientMetaData(), getBuildStartTime(), parameters, sharedServices, stoppable);
}
use of org.gradle.internal.concurrent.CompositeStoppable in project gradle by gradle.
the class DefaultWorkerProcess method cleanup.
private void cleanup() {
CompositeStoppable stoppable;
lock.lock();
try {
stoppable = CompositeStoppable.stoppable(connection, new Stoppable() {
@Override
public void stop() {
execHandle.abort();
}
}, acceptor);
} finally {
this.connection = null;
this.acceptor = null;
lock.unlock();
}
stoppable.stop();
}
use of org.gradle.internal.concurrent.CompositeStoppable in project gradle by gradle.
the class BuildActionsFactory method runBuildAndCloseServices.
private Runnable runBuildAndCloseServices(StartParameterInternal startParameter, DaemonParameters daemonParameters, BuildActionExecuter<BuildActionParameters, BuildRequestContext> executer, ServiceRegistry sharedServices, Object... stopBeforeSharedServices) {
BuildActionParameters parameters = createBuildActionParameters(startParameter, daemonParameters);
Stoppable stoppable = new CompositeStoppable().add(stopBeforeSharedServices).add(sharedServices);
return new RunBuildAction(executer, startParameter, clientMetaData(), getBuildStartTime(), parameters, sharedServices, stoppable);
}
use of org.gradle.internal.concurrent.CompositeStoppable 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