Package org.gradle.launcher.daemon.context

Examples of org.gradle.launcher.daemon.context.DaemonContext


public class DaemonContextParser {
    public static DaemonContext parseFromFile(File file) {
        try {
            BufferedReader reader = new BufferedReader(new FileReader(file));
            for (String line = reader.readLine(); line != null; line = reader.readLine()) {
                DaemonContext context = parseFrom(line);
                if (context != null) {
                    return context;
                }
            }
        } catch(FileNotFoundException e) {
View Full Code Here


        }
        throw new IllegalStateException("unable to parse DefaultDaemonContext from source: [" + file.getAbsolutePath() + "].");
    }

    public static DaemonContext parseFromString(String source) {
        DaemonContext context = parseFrom(source);
        if (context == null) {
            throw new IllegalStateException("unable to parse DefaultDaemonContext from source: [" + source + "].");
        }
        return context;
    }
View Full Code Here

        return builder.create();
    }
   
    public File getDaemonLogFile() {
        final DaemonContext daemonContext = get(DaemonContext.class);
        final Long pid = daemonContext.getPid();
        String fileName = String.format("daemon-%s.out.log", pid == null ? UUID.randomUUID() : pid);
        return new File(get(DaemonDir.class).getVersionedDir(), fileName);
    }
View Full Code Here

        Daemon daemon = daemonServices.get(Daemon.class);
        daemon.start();

        try {
            DaemonContext daemonContext = daemonServices.get(DaemonContext.class);
            Long pid = daemonContext.getPid();
            daemonStarted(pid, daemon.getUid(), daemon.getAddress(), daemonLog);

            // Block until idle
            daemon.requestStopOnIdleTimeout(parameters.getIdleTimeout(), TimeUnit.MILLISECONDS);
        } finally {
View Full Code Here

TOP

Related Classes of org.gradle.launcher.daemon.context.DaemonContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.