xmlBlaster 2.2.0 API

org.xmlBlaster.contrib.dbwatcher.detector
Class AlertScheduler

java.lang.Object
  extended by java.util.TimerTask
      extended by org.xmlBlaster.contrib.dbwatcher.detector.AlertScheduler
All Implemented Interfaces:
java.lang.Runnable, I_AlertProducer
Direct Known Subclasses:
ReplicationScheduler

public class AlertScheduler
extends java.util.TimerTask
implements I_AlertProducer

This scheduler waiks up in intervals and triggers a database check.

Supported configuration:

Author:
Marcel Ruff

Field Summary
private  I_ChangeDetector changeDetector
           
private static java.util.logging.Logger log
           
private  long period
           
private  java.util.Timer timer
           
 
Constructor Summary
AlertScheduler()
          Default constructor, you need to call init(org.xmlBlaster.contrib.I_Info, org.xmlBlaster.contrib.dbwatcher.detector.I_ChangeDetector) thereafter.
AlertScheduler(I_Info info, I_ChangeDetector changeDetector)
          Create a scheduler, calls init(org.xmlBlaster.contrib.I_Info, org.xmlBlaster.contrib.dbwatcher.detector.I_ChangeDetector).
 
Method Summary
 void init(I_Info info, I_ChangeDetector changeDetector)
          Needs to be called after construction.
 void run()
          Used by scheduler thread internally.
 void shutdown()
          Stop the scheduler.
 void startProducing()
          Starts the alert producer.
 void stopProducing()
          Sets the producer to standby.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

log

private static java.util.logging.Logger log

changeDetector

private I_ChangeDetector changeDetector

timer

private java.util.Timer timer

period

private long period
Constructor Detail

AlertScheduler

public AlertScheduler()
Default constructor, you need to call init(org.xmlBlaster.contrib.I_Info, org.xmlBlaster.contrib.dbwatcher.detector.I_ChangeDetector) thereafter.


AlertScheduler

public AlertScheduler(I_Info info,
                      I_ChangeDetector changeDetector)
               throws java.lang.Exception
Create a scheduler, calls init(org.xmlBlaster.contrib.I_Info, org.xmlBlaster.contrib.dbwatcher.detector.I_ChangeDetector).

Parameters:
info - The configuration environment
changeDetector - The class to be alerted then and again
Throws:
java.lang.Exception
Method Detail

init

public void init(I_Info info,
                 I_ChangeDetector changeDetector)
          throws java.lang.Exception
Description copied from interface: I_AlertProducer
Needs to be called after construction.

Specified by:
init in interface I_AlertProducer
Parameters:
info - The configuration environment
Throws:
java.lang.Exception - Can be any plugin specific exception
See Also:
I_DataConverter.init(I_Info)

startProducing

public void startProducing()
Description copied from interface: I_AlertProducer
Starts the alert producer.

Specified by:
startProducing in interface I_AlertProducer
See Also:
I_AlertProducer.startProducing()

stopProducing

public void stopProducing()
                   throws java.lang.Exception
Description copied from interface: I_AlertProducer
Sets the producer to standby. A call to #startProducing() starts it again

Specified by:
stopProducing in interface I_AlertProducer
Throws:
java.lang.Exception - of any type
See Also:
I_AlertProducer.stopProducing()

run

public void run()
Used by scheduler thread internally.

Specified by:
run in interface java.lang.Runnable
Specified by:
run in class java.util.TimerTask

shutdown

public void shutdown()
              throws java.lang.Exception
Stop the scheduler.

Specified by:
shutdown in interface I_AlertProducer
Throws:
java.lang.Exception - of any type
See Also:
I_AlertProducer.shutdown()

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.