org.apache.catalina.ha.deploy

Class WarWatcher

public class WarWatcher extends 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 classWarWatcher.WarFilter
File name filter for war files
protected classWarWatcher.WarInfo
File information on existing WAR files
Field Summary
protected MapcurrentStatus
Currently deployed files
protected FileChangeListenerlistener
Parent to be notified of changes
static Loglog
protected FilewatchDir
Directory to watch for war files
Constructor Summary
WarWatcher()
WarWatcher(FileChangeListener listener, File watchDir)
Method Summary
protected voidaddWarInfo(File warfile)
add cluster war to the watcher state
voidcheck()
check for modification and send notifcation to listener
voidclear()
clear watcher state
FileChangeListenergetListener()
FilegetWatchDir()
voidsetListener(FileChangeListener listener)
voidsetWatchDir(File watchDir)

Field Detail

currentStatus

protected Map currentStatus
Currently deployed files

listener

protected FileChangeListener listener
Parent to be notified of changes

log

public static Log log

watchDir

protected File watchDir
Directory to watch for war files

Constructor Detail

WarWatcher

public WarWatcher()

WarWatcher

public WarWatcher(FileChangeListener listener, File watchDir)

Method Detail

addWarInfo

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

Parameters: warfile

check

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

clear

public void clear()
clear watcher state

getListener

public FileChangeListener getListener()

Returns: Returns the listener.

getWatchDir

public File getWatchDir()

Returns: Returns the watchDir.

setListener

public void setListener(FileChangeListener listener)

Parameters: listener The listener to set.

setWatchDir

public void setWatchDir(File watchDir)

Parameters: watchDir The watchDir to set.

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