|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle org.jboss.soa.esb.listeners.gateway.SqlTableGatewayListener
public class SqlTableGatewayListener
Polls an SQL table for rows that satisfy conditions defined in the xml runtime configuration
When a row that matches conditions is retrieved, it's contents are packed into an ESB Message and The following fields are mandatory (see checkMyParms()):
Nested Class Summary | |
---|---|
static class |
SqlTableGatewayListener.PackageRowContents
Default gateway action for SQL table rows It will just drop the result set contents into a Message |
static class |
SqlTableGatewayListener.ROW_STATE
|
Field Summary | |
---|---|
protected java.lang.String[] |
_columns
|
protected java.lang.Object |
_composer
|
protected java.lang.Class |
_composerClass
|
protected java.lang.String |
_composerName
|
protected ConfigTree |
_config
|
protected java.util.Map<java.lang.String,java.lang.Object> |
_currentRow
|
protected java.lang.String |
_datasource
|
protected JdbcCleanConn |
_dbConn
|
protected boolean |
_deleteAfterOK
|
protected java.lang.String |
_driver
|
protected java.lang.String |
_inProcessField
|
protected java.lang.String |
_inProcessVals
|
protected java.lang.String |
_keyFields
|
protected java.lang.String[] |
_keys
|
protected static org.apache.log4j.Logger |
_logger
|
protected java.lang.String |
_orderBy
|
protected java.lang.String |
_password
|
protected java.lang.reflect.Method |
_processMethod
|
protected java.sql.PreparedStatement |
_PSdeleteRow
|
protected java.sql.PreparedStatement |
_PSscan
|
protected java.sql.PreparedStatement |
_PSupdate
|
protected java.lang.String |
_selectFields
|
protected ServiceInvoker |
_serviceInvoker
|
protected long |
_sleepBetweenPolls
|
protected java.lang.String |
_tableName
|
protected java.lang.String |
_targetServiceCategory
|
protected java.lang.String |
_targetServiceName
|
protected java.lang.String |
_timestamp
|
protected java.util.Map<java.lang.String,java.lang.Object> |
_upperCurrentRow
|
protected java.lang.String |
_url
|
protected java.lang.String |
_user
|
protected java.lang.String |
_where
|
static java.lang.String |
DEFAULT_IN_PROCESS_STATES
|
Fields inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle |
---|
PARAM_TERMINATION_PERIOD |
Constructor Summary | |
---|---|
SqlTableGatewayListener(ConfigTree config)
|
Method Summary | |
---|---|
protected boolean |
changeStatus(SqlTableGatewayListener.ROW_STATE fromState,
SqlTableGatewayListener.ROW_STATE toState)
|
protected boolean |
changeStatusToDone()
|
protected boolean |
changeStatusToError()
|
protected boolean |
changeStatusToWorking()
|
protected boolean |
deleteCurrentRow()
Try to delete 'current row' from polled table |
protected java.lang.String |
deleteStatement()
Assemble the SQL statement to delete the current row in the table row uniquely identified by the list of fields in the "keyFields" parameter |
protected void |
doInitialise()
Handle the initialisation of the managed instance. |
protected void |
doRun()
Execute on the thread. |
protected void |
doThreadedDestroy()
Handle the threaded destroy of the managed instance. |
protected JdbcCleanConn |
getDbConn()
Obtain a new database connection with parameter info |
protected java.lang.String |
getStatus(SqlTableGatewayListener.ROW_STATE p_oState)
|
protected java.util.List<java.util.Map<java.lang.String,java.lang.Object>> |
pollForCandidates()
|
protected void |
prepareStatements()
|
void |
refreshDatasource()
|
protected void |
resolveComposerClass()
|
protected java.lang.String |
scanStatement()
Assemble the SQL statement to scan (poll) the table |
protected java.lang.String |
selectForUpdStatement()
Assemble the SQL "select for update" statement for the "inProcessField" parameter in the table row uniquely identified by the list of fields in the "keyFields" parameter |
protected java.lang.String |
updateStatement()
Assemble the SQL statement to update the field in the "inProcessField" parameter in the table row uniquely identified by the list of fields in the "keyFields" parameter |
Methods inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractThreadedManagedLifecycle |
---|
addManagedLifecycleThreadEventListener, doDestroy, doStart, doStop, isRunning, isStopped, isStopping, removeManagedLifecycleThreadEventListener, run, setRunning, waitForRunningStateChange, waitUntilStopped, waitUntilStopped, waitUntilStopping |
Methods inherited from class org.jboss.soa.esb.listeners.lifecycle.AbstractManagedLifecycle |
---|
addManagedLifecycleEventListener, changeState, destroy, getConfig, getState, getTerminationPeriod, initialise, removeManagedLifecycleEventListener, start, stop, waitUntilDestroyed, waitUntilDestroyed, waitUntilNotState, waitUntilState |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final org.apache.log4j.Logger _logger
protected ConfigTree _config
protected long _sleepBetweenPolls
protected java.lang.String _targetServiceCategory
protected java.lang.String _targetServiceName
protected java.lang.String _composerName
protected ServiceInvoker _serviceInvoker
protected java.lang.Class _composerClass
protected java.lang.Object _composer
protected java.lang.reflect.Method _processMethod
protected java.lang.String _driver
protected java.lang.String _url
protected java.lang.String _user
protected java.lang.String _password
protected java.lang.String _datasource
protected java.lang.String _tableName
protected java.lang.String _selectFields
protected java.lang.String _keyFields
protected java.lang.String _timestamp
protected java.lang.String _where
protected java.lang.String _orderBy
protected java.lang.String _inProcessField
protected java.lang.String _inProcessVals
protected boolean _deleteAfterOK
protected java.lang.String[] _columns
protected java.lang.String[] _keys
protected java.sql.PreparedStatement _PSscan
protected java.sql.PreparedStatement _PSupdate
protected java.sql.PreparedStatement _PSdeleteRow
protected JdbcCleanConn _dbConn
protected java.util.Map<java.lang.String,java.lang.Object> _currentRow
protected java.util.Map<java.lang.String,java.lang.Object> _upperCurrentRow
public static final java.lang.String DEFAULT_IN_PROCESS_STATES
Constructor Detail |
---|
public SqlTableGatewayListener(ConfigTree config) throws ConfigurationException
ConfigurationException
Method Detail |
---|
protected void doInitialise() throws ManagedLifecycleException
doInitialise
in class AbstractManagedLifecycle
ManagedLifecycleException
- for errors while initialisation.protected void doRun()
doRun
in class AbstractThreadedManagedLifecycle
protected void doThreadedDestroy() throws ManagedLifecycleException
doThreadedDestroy
in class AbstractThreadedManagedLifecycle
ManagedLifecycleException
- for errors while destroying.protected void prepareStatements() throws java.sql.SQLException
java.sql.SQLException
protected void resolveComposerClass() throws ConfigurationException
ConfigurationException
protected java.util.List<java.util.Map<java.lang.String,java.lang.Object>> pollForCandidates()
public void refreshDatasource()
protected JdbcCleanConn getDbConn()
ConfigurationException
- -
if problems are encounteredprotected java.lang.String scanStatement()
protected java.lang.String updateStatement()
protected java.lang.String selectForUpdStatement()
protected java.lang.String deleteStatement()
protected boolean deleteCurrentRow()
protected java.lang.String getStatus(SqlTableGatewayListener.ROW_STATE p_oState)
protected boolean changeStatusToWorking()
protected boolean changeStatusToDone()
protected boolean changeStatusToError()
protected boolean changeStatus(SqlTableGatewayListener.ROW_STATE fromState, SqlTableGatewayListener.ROW_STATE toState)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |