if (notification instanceof TimerNotification) {
String type = notification.getType();
System.out.println("MessageLogQueue.handleNotification(): INFO: "
+ "Received a " + type + " notification.");
if (type.equals(MessageLogQueue.FLUSH_LOG)) {
if (_store.size() > 0) {
super.write("--- " + new Date() + " ---");
Iterator iter = _store.iterator();
while (iter.hasNext()) {
Object message = iter.next();
if (message instanceof String)
super.write((String)message);
else if (message instanceof Throwable)
super.write((Throwable)message);
}
_store.clear();
}
}
}
else
throw new RuntimeException("MessageLogQueue.handleNotification(): ERROR: "
+ "Only TimerNotification type supported. Received: " +
notification.getClass().getName());