// for loop iterates over the all XBUSSystems and tries to
// receive the interface data
for (Iterator it = systems.iterator(); it.hasNext();)
{ // iterating operation in first body instruction:
XBUSSystem xbusSystem = (XBUSSystem) it.next();
if (i == 0)
{ // first attempt
Trace.info("Start processing "
+ xbusSystem.getCompleteName());
} // then (i == 0)
else
{ // a retry
Trace.info("Retry number " + i + ": "
+ xbusSystem.getCompleteName());
} // else (i == 0)
if (doReceive(xbusSystem))
{ // successfully received
taManager.commit();
PostProcessor.start(xbusSystem, null,
Constants.POSTPROCESSING_PERSYSTEM);
Trace.info("End processing "
+ xbusSystem.getCompleteName());
Trace.info("----------------------------------------");
} // then (receive(xbusSystem))
else
{ // An error occured during data transmission
// but the resulting exception was already catched.
taManager.rollback();
Trace.info("Error while processing "
+ xbusSystem.getCompleteName());
Trace.info("----------------------------------------");
errorSystems.add(xbusSystem);
} // else (receive(xbusSystem))
} // for (Iterator it = systems.iterator(); it.hasNext();)
// In next attempt only try the failed interfaces.
systems = errorSystems;
// One attempt more done.
i++;
} // while ((!systems.isEmpty()) && (i < mRetryCount + 1))
if (!systems.isEmpty())
{ // Even after retrying some systems were not successfully
// processed.
Trace.error("Some systems couldn't be processed.");
// Falied interfaces list for error message.
Hashtable additionalInfo = new Hashtable();
// Counting the failed interfaces.
i = 1;
XBUSSystem system;
// loop over al failed interfaces
for (Iterator it = systems.iterator(); it.hasNext();)
{ // iterating operation in first body instruction:
system = (XBUSSystem) it.next();
additionalInfo.put("System" + i, system.getCompleteName());
// Perform cleaning operations according to configuration.
try
{
if (mOnError.equals(Constants.READ_DELETE)
|| mOnError.equals(Constants.READ_DELETEFILE))
{
deleteFile(mAS400System, system
.replaceAllMarkers(mConfigFilename)[0]);
} // delete
else if (mOnError.equals(Constants.READ_DELETEMEMBER))
{
deleteMember(mAS400System, system
.replaceAllMarkers(mConfigFilename)[0]);
} // delete member
else if (mOnError.equals(Constants.READ_RENAME))
{
renameFile(
mAS400System,
system.replaceAllMarkers(mConfigFilename)[0],
system.replaceAllMarkers(mConfigFilename)[0]
+ Constants.getDateAsString());
} // rename
// Nothing to do for "Preserve".
} // try
catch (XException e)
{
Trace.error(e);
} // catch
// Next system.
i++;
} // for (Iterator it = systems.iterator(); it.hasNext();)
NotifyError.notifyError(this, new XBUSSystem(systemName),
"Some interfaces couldn't be processed", null,
additionalInfo);
} // if (!systems.isEmpty())
else
PostProcessor.start(new XBUSSystem(systemName), null,
Constants.POSTPROCESSING_FINAL);
} // try
catch (Throwable e)
{
try
{
NotifyError.notifyError(this, new XBUSSystem(systemName), e
.getMessage(), null, null);
}
catch (XException e1)
{
// do nothing