Examples of Tailer


Examples of org.apache.commons.io.input.Tailer

                return;
            }

            LOG.info("Starting tailer: {}", file.getAbsolutePath());

            Tailer tailer;
            if (gzip)
            {
                tailer = new GzipTailer(
                    TailerFile.create(file), new TailerListener(file), delayMs, !newFile && !readWhole
                );
            }
            else
            {
                tailer = new Tailer(
                    TailerFile.create(file), new TailerListener(file), delayMs, !newFile && !readWhole, reopen
                );
            }
            tailers.put(file, tailer);
View Full Code Here

Examples of org.apache.commons.io.input.Tailer

        if (!toRead.exists() || !toRead.canRead()) {
            throw new IllegalStateException("Couldn't read "+toRead.getCanonicalPath()+" in the configured timeout");
        }
        logger.debug("Initialising Tailer for "+toRead.getCanonicalPath());

        tailer = new Tailer(toRead, this, DELAY, false);
    }
View Full Code Here

Examples of org.apache.commons.io.input.Tailer

    }
   
    public void waitFor(final String message, long waitForMillis) {
        final AtomicBoolean found = new AtomicBoolean();
       
        Tailer tailer = new Tailer(file, new TailerListenerAdapter() {
            private Tailer tailer;

            @Override
            public void init(Tailer tailer) {
                this.tailer = tailer;
                System.out.println("Waiting for message: [" + message + "]");
            }

            @Override
            public void handle(String line) {
                if (line.contains(message)) {
                    found.set(true);
                    tailer.stop();
                }
            }
        }, 500);

        Thread tailerThread = new Thread(tailer);
View Full Code Here

Examples of org.apache.commons.io.input.Tailer

        if (!toRead.exists() || !toRead.canRead()) {
            throw new IllegalStateException("Couldn't read "+toRead.getCanonicalPath()+" in the configured timeout");
        }
        logger.debug("Initialising Tailer for "+toRead.getCanonicalPath());

        tailer = new Tailer(toRead, this, DELAY, false);
    }
View Full Code Here

Examples of org.apache.commons.io.input.Tailer

  private Tailer controlFileTailer;
  private LocalEventBus eventBus;

  public ControlServer() {
    this.controlFile = new File(UserConfig.getUserConfigDir(), CONTROL_FILE);
    this.controlFileTailer = new Tailer(controlFile, this, 1000, true);
    this.eventBus = LocalEventBus.getInstance();   
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.