readConfiguration(systemName);
mAS400System.connectService(AS400.FILE);
// AS400Receiver will be registered by TAManager
TAManager taManager = TAManager.getInstance();
taManager.clearManager();
taManager.registerResource(this);
taManager.begin();
// determine the list of XBUSSystems for the system name
List systems = XBUSSystem.getSystems(systemName, mConfigFilename);
// for failed transmissions
List errorSystems = null;
// for counting the attempts
int i = 0;
// while loop for the attemps to process the interfaces
while ((!systems.isEmpty()) && (i < mRetryCount + 1))
{ // still some systems to process and number of retires nor yet
// reached
// time out before retries
if (i > 0)
Thread.sleep(mTimeout * 1000);
// empty list for failed interfaces
errorSystems = new Vector();
// 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))