Set msgs = vrfile.getRecords();
Iterator itr = msgs.iterator();
while (itr.hasNext()) {
// get all packetSize
VRecordRAF record = (VRecordRAF)itr.next();
// sanity check
short cookie = record.getCookie();
if (cookie == MessageInfo.PENDING ||
cookie != MessageInfo.DONE) {
// writing not finish: log error, free record
String warning = myDestination + ": found a " +
"corrupted message at vrecord(" + record +
"), a message might be lost";
logger.log(logger.WARNING, warning);
// free the bad VRecord
try {
vrfile.free(record);
} catch (IOException e) {
logger.log(logger.ERROR,
"Failed to free the corrupted vrecord: " + e);
}
} else {
try {
msgCount++;
byteCount += record.readInt();
} catch (Throwable t) {
logger.log(logger.ERROR, br.X_READ_FROM_VRECORD_FAILED,
vrfile.getFile(), t);
throw new BrokerException(br.getString(
br.X_READ_FROM_VRECORD_FAILED,