com.scooterframework.autoloader
Class FileMonitor

java.lang.Object
  extended by com.scooterframework.autoloader.FileMonitor

public class FileMonitor
extends java.lang.Object

FileMonitor is responsible for monitoring file changes. Changed files are automatically recompiled.

The default monitor interval is 1000 milliseconds. This can be changed by updating the source_file_monitor_period property in autoloader.properties file.


Nested Class Summary
 class FileMonitor.SourceFileTimerTask
          SourceFileTimerTask is responsible for scanning files.
 
Field Summary
static boolean turnOff
           
 
Method Summary
static FileMonitor getInstance()
           
 long getLastScanTime()
           
static SourceFile getSourceFile(java.lang.String className)
           
static boolean isClassMonitored(java.lang.String className)
          Only those classes that are under src directory are monitored.
static boolean isStarted()
           
 void start()
           
 void stop()
          Terminates this loader, discarding any currently scheduled tasks.
 void update()
          Updates the FileMonitor, restarts the timer if the period is changed.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

turnOff

public static boolean turnOff
Method Detail

getInstance

public static FileMonitor getInstance()

start

public void start()

stop

public void stop()
Terminates this loader, discarding any currently scheduled tasks.

See Also:
Timer.cancel()

update

public void update()
Updates the FileMonitor, restarts the timer if the period is changed.


isStarted

public static boolean isStarted()

isClassMonitored

public static boolean isClassMonitored(java.lang.String className)
Only those classes that are under src directory are monitored.

Parameters:
className -
Returns:
true if the class is monitored.

getSourceFile

public static SourceFile getSourceFile(java.lang.String className)

getLastScanTime

public long getLastScanTime()