Search in sources :

Example 1 with DaemonRegistry

use of org.gradle.launcher.daemon.registry.DaemonRegistry in project gradle by gradle.

the class ForegroundDaemonAction method run.

public void run() {
    LoggingManagerInternal loggingManager = loggingRegistry.newInstance(LoggingManagerInternal.class);
    loggingManager.start();
    DaemonServices daemonServices = new DaemonServices(configuration, loggingRegistry, loggingManager, new DefaultClassPath());
    Daemon daemon = daemonServices.get(Daemon.class);
    DaemonRegistry daemonRegistry = daemonServices.get(DaemonRegistry.class);
    DaemonExpirationStrategy expirationStrategy = daemonServices.get(MasterExpirationStrategy.class);
    daemon.start();
    try {
        daemonRegistry.markState(daemon.getAddress(), Idle);
        daemon.stopOnExpiration(expirationStrategy, configuration.getPeriodicCheckIntervalMs());
    } finally {
        daemon.stop();
    }
}
Also used : LoggingManagerInternal(org.gradle.internal.logging.LoggingManagerInternal) Daemon(org.gradle.launcher.daemon.server.Daemon) DaemonServices(org.gradle.launcher.daemon.server.DaemonServices) DaemonRegistry(org.gradle.launcher.daemon.registry.DaemonRegistry) DaemonExpirationStrategy(org.gradle.launcher.daemon.server.expiry.DaemonExpirationStrategy) DefaultClassPath(org.gradle.internal.classpath.DefaultClassPath)

Aggregations

DefaultClassPath (org.gradle.internal.classpath.DefaultClassPath)1 LoggingManagerInternal (org.gradle.internal.logging.LoggingManagerInternal)1 DaemonRegistry (org.gradle.launcher.daemon.registry.DaemonRegistry)1 Daemon (org.gradle.launcher.daemon.server.Daemon)1 DaemonServices (org.gradle.launcher.daemon.server.DaemonServices)1 DaemonExpirationStrategy (org.gradle.launcher.daemon.server.expiry.DaemonExpirationStrategy)1