From: <jbo...@li...> - 2006-07-05 22:44:46
|
Author: estebanschifman Date: 2006-07-05 18:44:42 -0400 (Wed, 05 Jul 2006) New Revision: 4924 Modified: labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/SqlTablePoller.java Log: Encapsulate instantiation of SqlChildProcess class in the getSqlChildProcess() method (easier to have your own - only this getter changes) Modified: labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/SqlTablePoller.java =================================================================== --- labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/SqlTablePoller.java 2006-07-05 22:31:53 UTC (rev 4923) +++ labs/jbossesb/trunk/ESBCore/listeners/src/org/jboss/soa/esb/listeners/SqlTablePoller.java 2006-07-05 22:44:42 UTC (rev 4924) @@ -261,6 +261,19 @@ } } //________________________________ + +/** + * Override this method if you wish to extend the SqlChildProcess class + * (for example with ad-hoc notifications for OK list or Error list) + * @param p_oParms = DomElement containing attributes of trigger + * @return the SqlChildProcess to be started + * @throws Exception + */ + protected SqlChildProcess getSqlChildProcess(DomElement p_oParms) + throws Exception + { + return new SqlChildProcess(this, p_oParms); + } //________________________________ @Override protected void doYourJob(DomElement p_oP) throws Exception @@ -274,11 +287,11 @@ break; } - new Thread(m_oThrGrp, - new SqlChildProcess(this, oCurr)).start(); + SqlChildProcess oNew = getSqlChildProcess(oCurr); + new Thread(m_oThrGrp,oNew).start(); // Wait a little bit, so thread count will be updated // at some point in the past, this sleep was indispensable - // new thread control classes in Java 5 should be explored + // new thread control classes in Java 5 might have solved the problem Thread.sleep(500); } |