xmlBlaster 2.2.0 contributions API

org.xmlBlaster.contrib.replication
Class OracleByEventsScheduler

java.lang.Object
  extended by org.xmlBlaster.contrib.replication.OracleByEventsScheduler
All Implemented Interfaces:
I_AlertProducer

public class OracleByEventsScheduler
extends java.lang.Object
implements I_AlertProducer

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

Supported configuration:


Constructor Summary
OracleByEventsScheduler()
          Default constructor, you need to call init(org.xmlBlaster.contrib.I_Info, org.xmlBlaster.contrib.dbwatcher.detector.I_ChangeDetector) thereafter.
OracleByEventsScheduler(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.
static void registerEvent(java.sql.Connection conn, java.lang.String event)
           
 void shutdown()
          Stop the scheduler.
 void startProducing()
          Starts the alert producer.
 void stopProducing()
          Sets the producer to standby.
static void unregisterEvent(java.sql.Connection conn, java.lang.String event)
           
static void waitForEvent(java.sql.Connection conn, java.lang.String event, long timeout)
          This method does not return exceptions (also catches Throwable).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleByEventsScheduler

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


OracleByEventsScheduler

public OracleByEventsScheduler(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()

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()

waitForEvent

public static void waitForEvent(java.sql.Connection conn,
                                java.lang.String event,
                                long timeout)
                         throws java.lang.Exception
This method does not return exceptions (also catches Throwable).

Parameters:
conn - The database connection to use.
event - the name of the even on which to wait
timeout - the maximum time to wait in ms
Throws:
java.lang.Exception

registerEvent

public static void registerEvent(java.sql.Connection conn,
                                 java.lang.String event)
                          throws java.lang.Exception
Throws:
java.lang.Exception

unregisterEvent

public static void unregisterEvent(java.sql.Connection conn,
                                   java.lang.String event)
                            throws java.lang.Exception
Throws:
java.lang.Exception

xmlBlaster 2.2.0 contributions API

Copyright © 1999-2014 The xmlBlaster.org contributers.