xmlBlaster 2.2.0 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:


Nested Class Summary
private  class OracleByEventsScheduler.SchedulerRunner
           
 
Field Summary
private  I_ChangeDetector changeDetector
           
private  I_Info info
           
private static java.util.logging.Logger log
           
private  OracleByEventsScheduler.SchedulerRunner runner
           
 
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)
           
private static void registerUnregisterForEvents(java.sql.Connection conn, java.lang.String event, boolean doRegister)
          This method does not return exceptions (also catches Throwable).
 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
 

Field Detail

log

private static java.util.logging.Logger log

changeDetector

private I_ChangeDetector changeDetector

runner

private OracleByEventsScheduler.SchedulerRunner runner

info

private I_Info info
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

registerUnregisterForEvents

private static void registerUnregisterForEvents(java.sql.Connection conn,
                                                java.lang.String event,
                                                boolean doRegister)
                                         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
doRegister - if true it will register, otherwise unregister.
Throws:
java.lang.Exception

xmlBlaster 2.2.0 API

Copyright © 1999-2014 The xmlBlaster.org contributers.