Package org.apache.commons.io.monitor

Examples of org.apache.commons.io.monitor.FileAlterationMonitor


   * @param rootDirectory
   * @param ms
   */
  public H2HFileObserver(File rootDirectory, long ms) {
    this.observer = new FileAlterationObserver(rootDirectory);
    this.monitor = new FileAlterationMonitor(ms, observer);
  }
View Full Code Here


   private final Logger log = Logger.getLogger(getClass().getName());
   private FileAlterationMonitor alterationMonitor;

   public FileMonitor()
   {
      alterationMonitor = new FileAlterationMonitor(CHECK_INTERVAL);
      alterationMonitor.setThreadFactory(new ThreadFactory()
      {
         @Override
         public Thread newThread(Runnable r)
         {
View Full Code Here

    public Application(final RexsterProperties properties,
                       final FileAlterationObserver rexsterConfigurationObserver) throws Exception {

        // watch rexster.xml for changes
        rexsterConfigurationObserver.addListener(properties);
        this.configurationMonitor = new FileAlterationMonitor(properties.getConfigCheckInterval());
        configurationMonitor.addObserver(rexsterConfigurationObserver);

        // get the graph configurations from the XML config file
        this.properties = properties;
        this.rexsterApplication = new XmlRexsterApplication(this.properties);
View Full Code Here

        File parentFile = file.getParentFile();
        File directory = (parentFile == null) ? new File(".") : parentFile;
        FileAlterationObserver observer = new FileAlterationObserver(directory, sameFile(file));
        observer.addListener(listener);

        return new FileAlterationMonitor(INTERVAL, observer);
    }
View Full Code Here

            private boolean configChanged(BonzaConfig newCFG) {
                return !newCFG.getUri2HostMap().equals(m_uri2HostMap) || newCFG.m_logRequests != m_logRequests;
            }
        });
        FileAlterationMonitor monitor = new FileAlterationMonitor(2000);
        monitor.addObserver(observer);
        monitor.start();
    }
View Full Code Here

TOP

Related Classes of org.apache.commons.io.monitor.FileAlterationMonitor

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.