*\r
*/\r
public class ValidationDaemon extends Job {\r
-\r
@SuppressWarnings("unused")\r
private static final Logger logger = Logger.getLogger(ValidationDaemon.class);\r
\r
- private final IEntityValidationService validationResultService;\r
+ private final IEntityValidationService entityValidationService;\r
\r
+ // Might want to make this configurable:\r
+ private int SLEEP_TIME = 5000;\r
+ \r
private boolean cancelRequested = false;\r
\r
\r
\r
- public ValidationDaemon()\r
- {\r
+ public ValidationDaemon(){\r
super("Running validation daemon");\r
- validationResultService = CdmStore.getService(IEntityValidationService.class);\r
+ entityValidationService = CdmStore.getService(IEntityValidationService.class);\r
}\r
\r
\r
@Override\r
- protected void canceling()\r
- {\r
+ protected void canceling(){\r
cancelRequested = true;\r
}\r
\r
* {@link Job#cancel()}, because that method does not have the desired\r
* effect.\r
*/\r
- public void setCancelRequested()\r
- {\r
+ public void setCancelRequested(){\r
cancelRequested = true;\r
}\r
\r
\r
@Override\r
- protected IStatus run(IProgressMonitor monitor)\r
- {\r
+ protected IStatus run(IProgressMonitor monitor){\r
MarkerManager markerManager;\r
List<EntityValidation> results;\r
try {\r
while (!cancelRequested) {\r
- results = validationResultService.getValidationResults();\r
+ results = entityValidationService.getValidationResults();\r
markerManager = new MarkerManager(results);\r
markerManager.deleteObsoleteMarkers();\r
markerManager.createMarkers();\r
- // Might want to make this configurable:\r
- Thread.sleep(5000);\r
+ Thread.sleep(SLEEP_TIME);\r
}\r
MessagingUtils.info("Validation module stopped");\r
return Status.OK_STATUS;\r