XMLEncoder encoder = new XMLEncoder(
new BufferedOutputStream(
new FileOutputStream(getPersistedFileName())));
Map<String, AlertInfo> persistedAlerts = new HashMap<String, AlertInfo>();
persistedAlerts.putAll(alerts);
encoder.writeObject(persistedAlerts);
encoder.close();
} catch (FileNotFoundException e) {
throw new RuntimeException(e);
}
}