SimpleRegistrationListener regListener =
new SimpleRegistrationListener(mErrors);
dispelEngine.addRegistrationListener(regListener);
// Compile the DISPEL and optimise the graphs
DispelEngineResult engineResult = null;
try
{
dispelEngine.setRequestContext(context);
engineResult = dispelEngine.processDispel(
new BufferedReader(new StringReader(dispel)));
}
catch (CompilationException e)
{
LOG.error("Caught exception during compilation.");
updateStatus(ProcessingStatus.COMPILATION_ERROR);
updateFinishedAt();
return;
}
catch(TransformationException transformationException)
{
errorListener.error(transformationException);
LOG.error("Caught exception during optimisation.");
updateStatus(ProcessingStatus.COMPILATION_ERROR);
updateFinishedAt();
return;
}
finally
{
updateErrors();
}
// TODO: THERE IS A LOT OF APPLICATION LOGIC UNDER HERE THAT SHOULD
// NOT BE IN PRESENTATION LAYER CODE.
updateStatus(ProcessingStatus.INITIALISING);
LOG.debug("Starting initialisation.");
// Start execution of the graphs
Collection<Graph> executionGraphs =
engineResult.getExecutionGraphs();
List<DistributedDISPELProcessor> processors =
new ArrayList<DistributedDISPELProcessor>(executionGraphs.size());
Map<String, String> allResults = new HashMap<String, String>();
Map<String, String> allExternalTransfers = new HashMap<String, String>();