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

SchedulerWatchdogFactory

public class SchedulerWatchdogFactory extends Object implements WatchdogFactory
This class is a factory to produce Watchdogs, each of which is associated with a single TimeScheduler Target and a TimeScheduler object. This could be used in James by adding a server configuration parameter: schedulerWatchdogs = conf.getChild("useSchedulerWatchdogs").getValueAsBoolean(false); getting the TimeScheduler component: scheduler = (TimeScheduler) compMgr.lookup(TimeScheduler.ROLE); and changing AbstractJamesService.getWatchdogFactory to look something like: protected WatchdogFactory getWatchdogFactory() { WatchdogFactory theWatchdogFactory = null; if (schedulerWatchdogs) { theWatchdogFactory = new SchedulerWatchdogFactory(scheduler, timeout); } else { theWatchdogFactory = new ThreadPerWatchdogFactory(threadPool, timeout); } if (theWatchdogFactory instanceof LogEnabled) { ((LogEnabled)theWatchdogFactory).enableLogging(getLogger()); } return theWatchdogFactory; }

Fields Summary
private org.apache.avalon.cornerstone.services.scheduler.TimeScheduler
myTimeScheduler
The thread pool used to generate InaccurateTimeoutWatchdogs
private long
timeout
Constructors Summary
public SchedulerWatchdogFactory(org.apache.avalon.cornerstone.services.scheduler.TimeScheduler theTimeScheduler, long timeout)
Creates the factory and sets the TimeScheduler used to implement the watchdogs.

param
theTimeScheduler the scheduler that manages Watchdog triggering for Watchdogs produced by this factory
param
timeout the timeout for Watchdogs produced by this factory


                                                                     
         
        this.timeout = timeout;
        myTimeScheduler = theTimeScheduler;
    
Methods Summary
public WatchdoggetWatchdog(WatchdogTarget theTarget)

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

        return new SchedulerWatchdog(theTarget);