org.aitools.programd.util
Class AIMLWatcher

java.lang.Object
  extended by org.aitools.programd.util.AIMLWatcher

public class AIMLWatcher
extends java.lang.Object

Watches a set of AIML files. Any file changes will be loaded automatically.

Author:
Jon Baer, Noel Bush

Nested Class Summary
private  class AIMLWatcher.CheckAIMLTask
          A TimerTask for checking changed AIML files.
 
Field Summary
private  Core core
           
protected  org.apache.log4j.Logger logger
           
private  java.util.Timer timer
          The Timer that handles watching AIML files.
protected  java.util.Map<java.net.URL,java.lang.Long> watchMap
          Used for storing information about file changes.
 
Constructor Summary
AIMLWatcher(Core coreToUse)
          Creates a new AIMLWatcher using the given Graphmaster
 
Method Summary
 void addWatchFile(java.net.URL path)
          Adds a file to the watchlist.
protected  void reload(java.net.URL path)
          Reloads AIML from a given path.
 void start()
          Starts the AIMLWatcher.
 void stop()
          Stops the AIMLWatcher.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timer

private java.util.Timer timer
The Timer that handles watching AIML files.


core

private Core core

watchMap

protected java.util.Map<java.net.URL,java.lang.Long> watchMap
Used for storing information about file changes.


logger

protected org.apache.log4j.Logger logger
Constructor Detail

AIMLWatcher

public AIMLWatcher(Core coreToUse)
Creates a new AIMLWatcher using the given Graphmaster

Parameters:
coreToUse - the Core to use
Method Detail

start

public void start()
Starts the AIMLWatcher.


stop

public void stop()
Stops the AIMLWatcher.


reload

protected void reload(java.net.URL path)
Reloads AIML from a given path.

Parameters:
path - the path to reload

addWatchFile

public void addWatchFile(java.net.URL path)
Adds a file to the watchlist.

Parameters:
path - the path to the file