if (loaded) return;
loaded = true;
// before we do anything else, make sure we dont have any
// unexpected exceptions
LoadException load_ex = null;
try {
load_ex = Globals.getStore().getLoadConsumerException();
} catch (Exception ex) {
// nothing to do
logger.logStack(Logger.DEBUG,"Error loading consumer exception ", ex);
}
if (load_ex != null) {
// some messages could not be loaded
LoadException processing = load_ex;
while (processing != null) {
ConsumerUID cuid = (ConsumerUID)processing.getKey();
Consumer con = (Consumer)processing.getValue();
if (cuid == null && con == null) {
logger.log(Logger.WARNING,
BrokerResources.E_INTERNAL_ERROR,
"both key and value are corrupted");
continue;
}
if (cuid == null) {
// store with valid key
try {
Globals.getStore().storeInterest(con, true);
} catch (Exception ex) {
logger.log(Logger.WARNING,
BrokerResources.W_CON_RECREATE_FAILED,
con.getConsumerUID(), ex);
}
} else {
// nothing we can do, remove it
logger.log(Logger.WARNING,
BrokerResources.W_CON_CORRUPT_REMOVE,
cuid.toString());
try {
Consumer c = new Consumer(cuid);
Globals.getStore().removeInterest(c, false);
} catch (Exception ex) {
logger.logStack(Logger.DEBUG,"Error removing "
+ "corrupt consumer " + cuid, ex);
}
} // end if
processing = processing.getNextException();
} // end while
}
try {
Consumer[] cons = Globals.getStore().getAllInterests();