void () { if (myState == MemoryAgentActionState.RUNNING) { try { myProgressTracker.cancelMonitoringProgress(); myCancellationFile = FileUtil.createTempFile(myProxy.getCancellationFileName(), "", true); myState = MemoryAgentActionState.CANCELLED; } catch (IOException ex) { LOG.error("Couldn't create memory agent cancellation file", ex); } } }