FileDocCategorySizeDatePackage
ThreadPerWatchdogFactory.javaAPI DocApache James 2.3.13046Fri Jan 12 12:56:34 GMT 2007org.apache.james.util.watchdog

ThreadPerWatchdogFactory

public class ThreadPerWatchdogFactory extends org.apache.avalon.framework.logger.AbstractLogEnabled implements WatchdogFactory
This class is a factory to produce Watchdogs, each of which is associated with a single thread.

Fields Summary
private org.apache.excalibur.thread.ThreadPool
myThreadPool
The thread pool used to generate InaccurateTimeoutWatchdogs
private long
timeout
The watchdog timeout for Watchdogs generated by this factory
Constructors Summary
public ThreadPerWatchdogFactory(org.apache.excalibur.thread.ThreadPool theThreadPool, long timeout)
Creates the factory and sets the thread pool used to generate InaccurateTimeoutWatchdogs.

        if (theThreadPool == null) {
            throw new IllegalArgumentException("The thread pool for the ThreadPerWatchdogFactory cannot be null.");
        }
        myThreadPool = theThreadPool;
        this.timeout = timeout;
    
Methods Summary
public WatchdoggetWatchdog(WatchdogTarget theTarget)

see
org.apache.james.util.watchdog.WatchdogFactory#getWatchdog(WatchdogTarget)

        InaccurateTimeoutWatchdog watchdog = new InaccurateTimeoutWatchdog(timeout, theTarget, myThreadPool);
        watchdog.enableLogging(getLogger());
        return watchdog;