org.apache.commons.jci.listeners
Class AbstractFilesystemAlterationListener

java.lang.Object
  extended by org.apache.commons.jci.listeners.AbstractFilesystemAlterationListener
All Implemented Interfaces:
FilesystemAlterationListener
Direct Known Subclasses:
FileChangeListener, ReloadingListener

public abstract class AbstractFilesystemAlterationListener
extends Object
implements FilesystemAlterationListener

AbstractFilesystemAlterationListener provides some convenience methods helping to implement a FilesystemAlterationListener.

Author:
tcurdt

Field Summary
protected  FilesystemAlterationObserver observer
           
 
Constructor Summary
AbstractFilesystemAlterationListener()
           
 
Method Summary
 Collection<File> getChangedDirectories()
           
 Collection<File> getChangedFiles()
           
 Collection<File> getCreatedDirectories()
           
 Collection<File> getCreatedFiles()
           
 Collection<File> getDeletedDirectories()
           
 Collection<File> getDeletedFiles()
           
 void onDirectoryChange(File pDir)
           
 void onDirectoryCreate(File pDir)
           
 void onDirectoryDelete(File pDir)
           
 void onFileChange(File pFile)
           
 void onFileCreate(File pFile)
           
 void onFileDelete(File pFile)
           
 void onStart(FilesystemAlterationObserver pObserver)
           
 void onStop(FilesystemAlterationObserver pObserver)
           
protected  void signals()
           
 void waitForCheck()
          wait for the next filesystem check to happen
 void waitForEvent()
           
 void waitForFirstCheck()
          we don't reset the signal so if there was a check it is already true and exit immediatly otherwise it will behave just like waitForCheck()
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

observer

protected FilesystemAlterationObserver observer
Constructor Detail

AbstractFilesystemAlterationListener

public AbstractFilesystemAlterationListener()
Method Detail

onDirectoryCreate

public void onDirectoryCreate(File pDir)
Specified by:
onDirectoryCreate in interface FilesystemAlterationListener

onDirectoryChange

public void onDirectoryChange(File pDir)
Specified by:
onDirectoryChange in interface FilesystemAlterationListener

onDirectoryDelete

public void onDirectoryDelete(File pDir)
Specified by:
onDirectoryDelete in interface FilesystemAlterationListener

onFileCreate

public void onFileCreate(File pFile)
Specified by:
onFileCreate in interface FilesystemAlterationListener

onFileChange

public void onFileChange(File pFile)
Specified by:
onFileChange in interface FilesystemAlterationListener

onFileDelete

public void onFileDelete(File pFile)
Specified by:
onFileDelete in interface FilesystemAlterationListener

getChangedDirectories

public Collection<File> getChangedDirectories()

getChangedFiles

public Collection<File> getChangedFiles()

getCreatedDirectories

public Collection<File> getCreatedDirectories()

getCreatedFiles

public Collection<File> getCreatedFiles()

getDeletedDirectories

public Collection<File> getDeletedDirectories()

getDeletedFiles

public Collection<File> getDeletedFiles()

signals

protected void signals()

onStart

public void onStart(FilesystemAlterationObserver pObserver)
Specified by:
onStart in interface FilesystemAlterationListener

onStop

public void onStop(FilesystemAlterationObserver pObserver)
Specified by:
onStop in interface FilesystemAlterationListener

waitForEvent

public void waitForEvent()
                  throws Exception
Throws:
Exception

waitForFirstCheck

public void waitForFirstCheck()
                       throws Exception
we don't reset the signal so if there was a check it is already true and exit immediatly otherwise it will behave just like waitForCheck()

Throws:
Exception - in case of a timeout

waitForCheck

public void waitForCheck()
                  throws Exception
wait for the next filesystem check to happen

Throws:
Exception - in case of a timeout


Copyright © 2004–2013 The Apache Software Foundation. All rights reserved.