xmlBlaster 2.1.0 API

org.xmlBlaster.contrib.replication
Class ReplicationScheduler

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

public class ReplicationScheduler
extends AlertScheduler

ReplicationScheduler extends the AlertScheduler which is a poller to the database. The only purpose of this extention is to call a stored procedure which triggers a detection of changes in structure of the tables currently watched and/or replicated. The call to this stored procedure is only needed in such database implementations where it is not possible to get CREATE TABLE, DROP TABLE or ALTER TABLE events by means of trigger. This is for example the case of PostGres 8.0.

Author:
Michele Laghi

Field Summary
private  I_DbSpecific dbSpecific
           
private  boolean isInit
           
 
Constructor Summary
ReplicationScheduler()
           
ReplicationScheduler(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.
 
Methods inherited from class org.xmlBlaster.contrib.dbwatcher.detector.AlertScheduler
startProducing, stopProducing
 
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

dbSpecific

private I_DbSpecific dbSpecific

isInit

private boolean isInit
Constructor Detail

ReplicationScheduler

public ReplicationScheduler()

ReplicationScheduler

public ReplicationScheduler(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
Overrides:
init in class AlertScheduler
Parameters:
info - The configuration environment
Throws:
java.lang.Exception - Can be any plugin specific exception
See Also:
I_DataConverter.init(I_Info)

run

public void run()
Used by scheduler thread internally.

Specified by:
run in interface java.lang.Runnable
Overrides:
run in class AlertScheduler

shutdown

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

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

xmlBlaster 2.1.0 API

Copyright © 1999-2011 The xmlBlaster.org contributers.