*/
public class DatabaseStateDumper
{
public void dump(@Observes DumpDataCommand dumpDataCommand)
{
final DataDump dataDump = dumpDataCommand.getDumpData();
Writer writer = null;
try
{
writer = new BufferedWriter(new FileWriter(dataDump.getPath()));
writer.write(dataDump.getDataSet());
}
catch (Exception e)
{
throw new DatabaseDumpException("Unable to dump database state to " + dataDump.getPath(), e);
}
finally
{
dumpDataCommand.setResult(true);
if (writer != null)