Use local var mRowCount

master
Vitaliy Filippov 2015-12-18 15:53:44 +03:00
parent 9152454c7b
commit b4ea34f05e
1 changed files with 13 additions and 10 deletions

View File

@ -149,8 +149,6 @@ public class InboundMessageProcessor implements Runnable, MessageExchangeReplyLi
private DatabaseModel dbDataAccessObject = null; private DatabaseModel dbDataAccessObject = null;
private int mRowCount = 0;
private String mTableName = null; private String mTableName = null;
private String mDbName = null; private String mDbName = null;
@ -205,10 +203,11 @@ public class InboundMessageProcessor implements Runnable, MessageExchangeReplyLi
mLogger.log(Level.INFO, "DBBC_R00629.IMP_EP_status"); mLogger.log(Level.INFO, "DBBC_R00629.IMP_EP_status");
} }
int rowCount;
do { do {
mRowCount = 0; rowCount = 0;
try { try {
execute(); rowCount = execute();
} catch (final Exception ex) { } catch (final Exception ex) {
mLogger.log(Level.SEVERE, mMessages.getString("DBBC_E00659.IMP_ERROR_WHILE_EXECUTING_SQL"), ex); mLogger.log(Level.SEVERE, mMessages.getString("DBBC_E00659.IMP_ERROR_WHILE_EXECUTING_SQL"), ex);
} }
@ -217,7 +216,7 @@ public class InboundMessageProcessor implements Runnable, MessageExchangeReplyLi
mLogger.log(Level.INFO,mMessages.getString("DBBC_R00660.IMP_FINISHED_EXECUTING_SQL")); mLogger.log(Level.INFO,mMessages.getString("DBBC_R00660.IMP_FINISHED_EXECUTING_SQL"));
} }
if (mRowCount <= 0) { if (rowCount <= 0) {
try { try {
Thread.sleep(mPollMilliSeconds); Thread.sleep(mPollMilliSeconds);
} catch (final Exception e) { } catch (final Exception e) {
@ -231,8 +230,9 @@ public class InboundMessageProcessor implements Runnable, MessageExchangeReplyLi
* @throws MessagingException * @throws MessagingException
* @throws Exception * @throws Exception
*/ */
public void execute() throws MessagingException, Exception { public int execute() throws MessagingException, Exception {
String exchangeId = null; String exchangeId = null;
int rowCount = 0;
try { try {
if (mMsgExchangeFactory == null) { if (mMsgExchangeFactory == null) {
@ -291,11 +291,11 @@ public class InboundMessageProcessor implements Runnable, MessageExchangeReplyLi
break; break;
case IN_ONLY: case IN_ONLY:
mLogger.log(Level.INFO, "DBBC_R00632.IMP_Received_INONLY", mExchange.getExchangeId()); mLogger.log(Level.INFO, "DBBC_R00632.IMP_Received_INONLY", mExchange.getExchangeId());
processInOnly(mExchange, epb); rowCount = processInOnly(mExchange, epb);
break; break;
default: default:
mLogger.log(Level.INFO, "DBBC_E00633.IMP_Invalid_pattern", mExchange.getExchangeId()); mLogger.log(Level.INFO, "DBBC_E00633.IMP_Invalid_pattern", mExchange.getExchangeId());
return; return 0;
} }
} }
} catch (final MessagingException ex) { } catch (final MessagingException ex) {
@ -307,6 +307,7 @@ public class InboundMessageProcessor implements Runnable, MessageExchangeReplyLi
mLogger.log(Level.SEVERE, mMessages.getString("DBBC_E00662.IMP_ERROR_WHILE_EXECUTING_MEP"), exchangeId); mLogger.log(Level.SEVERE, mMessages.getString("DBBC_E00662.IMP_ERROR_WHILE_EXECUTING_MEP"), exchangeId);
throw e; throw e;
} }
return rowCount;
} }
/** /**
@ -320,12 +321,13 @@ public class InboundMessageProcessor implements Runnable, MessageExchangeReplyLi
* @param exchange * @param exchange
* @param epb * @param epb
*/ */
public void processInOnly(final MessageExchange exchange, final EndpointBean epb) throws Exception { public int processInOnly(final MessageExchange exchange, final EndpointBean epb) throws Exception {
String exchangeId = null; String exchangeId = null;
String jndiName = null; String jndiName = null;
Connection connection = null; Connection connection = null;
PreparedStatement ps = null; PreparedStatement ps = null;
ResultSet rs = null; ResultSet rs = null;
int rowCount = 0;
try { try {
epb.getEndpointStatus().incrementReceivedRequests(); epb.getEndpointStatus().incrementReceivedRequests();
@ -402,7 +404,7 @@ public class InboundMessageProcessor implements Runnable, MessageExchangeReplyLi
normalizer.setInboundExchangeProcessRecordsMap(mMapInboundExchangesProcessRecords); normalizer.setInboundExchangeProcessRecordsMap(mMapInboundExchangesProcessRecords);
normalizer.setRecordsProcessedList(mProcessedList); normalizer.setRecordsProcessedList(mProcessedList);
inMsg = normalizer.normalizeSelectInbound(rs, exchange, meta, epb, mPKName,mDbName); inMsg = normalizer.normalizeSelectInbound(rs, exchange, meta, epb, mPKName,mDbName);
mRowCount = normalizer.mRowCount; rowCount = normalizer.mRowCount;
if(normalizationMeasurement != null){ if(normalizationMeasurement != null){
normalizationMeasurement.end(); normalizationMeasurement.end();
@ -456,6 +458,7 @@ public class InboundMessageProcessor implements Runnable, MessageExchangeReplyLi
mLogger.log(Level.SEVERE, mMessages.getString("DBBC_E11111.IMP_EXCEPTION_WHILE_CLOSING_THE_CONNECTION"), se); mLogger.log(Level.SEVERE, mMessages.getString("DBBC_E11111.IMP_EXCEPTION_WHILE_CLOSING_THE_CONNECTION"), se);
} }
} }
return rowCount;
} }
/** Checks if the Throttling configuration is defined on the endpoint, /** Checks if the Throttling configuration is defined on the endpoint,