org.apache.catalina.cluster.deploy
Class WarWatcher

java.lang.Object
  extended byorg.apache.catalina.cluster.deploy.WarWatcher

public class WarWatcher
extends java.lang.Object

The WarWatcher watches the deployDir for changes made to the directory (adding new WAR files->deploy or remove WAR files->undeploy) And notifies a listener of the changes made

Version:
1.1
Author:
Filip Hanik, Peter Rossbach

Nested Class Summary
protected  class WarWatcher.WarFilter
          File name filter for war files
protected  class WarWatcher.WarInfo
          File information on existing WAR files
 
Field Summary
protected  java.util.Map currentStatus
          Currently deployed files
protected  FileChangeListener listener
          Parent to be notified of changes
static org.apache.commons.logging.Log log
           
protected  java.io.File watchDir
          Directory to watch for war files
 
Constructor Summary
WarWatcher()
           
WarWatcher(FileChangeListener listener, java.io.File watchDir)
           
 
Method Summary
protected  void addWarInfo(java.io.File warfile)
          add cluster war to the watcher state
 void check()
          check for modification and send notifcation to listener
 void clear()
          clear watcher state
 FileChangeListener getListener()
           
 java.io.File getWatchDir()
           
 void setListener(FileChangeListener listener)
           
 void setWatchDir(java.io.File watchDir)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

public static org.apache.commons.logging.Log log

watchDir

protected java.io.File watchDir
Directory to watch for war files


listener

protected FileChangeListener listener
Parent to be notified of changes


currentStatus

protected java.util.Map currentStatus
Currently deployed files

Constructor Detail

WarWatcher

public WarWatcher()

WarWatcher

public WarWatcher(FileChangeListener listener,
                  java.io.File watchDir)
Method Detail

check

public void check()
check for modification and send notifcation to listener


addWarInfo

protected void addWarInfo(java.io.File warfile)
add cluster war to the watcher state

Parameters:
warfile -

clear

public void clear()
clear watcher state


getWatchDir

public java.io.File getWatchDir()
Returns:
Returns the watchDir.

setWatchDir

public void setWatchDir(java.io.File watchDir)
Parameters:
watchDir - The watchDir to set.

getListener

public FileChangeListener getListener()
Returns:
Returns the listener.

setListener

public void setListener(FileChangeListener listener)
Parameters:
listener - The listener to set.


Copyright © 2000-2012 Apache Software Foundation. All Rights Reserved.