public void persistentRequestRemoved(final FcpPersistentGet downloadRequest) { if (downloadModelItems.containsKey(downloadRequest.getIdentifier())) { final FrostDownloadItem dlItem = downloadModelItems.get(downloadRequest.getIdentifier()); if (dlItem.isExternal()) { SwingUtilities.invokeLater( new Runnable() { public void run() { List<FrostDownloadItem> itemList = new ArrayList<FrostDownloadItem>(); itemList.add(dlItem); downloadModel.removeItems(itemList); } }); } else { if (dlItem.isInternalRemoveExpected()) { dlItem.setInternalRemoveExpected(false); // clear flag } else if (dlItem.getState() != FrostDownloadItem.STATE_DONE) { dlItem.setEnabled(false); dlItem.setState(FrostDownloadItem.STATE_FAILED); dlItem.setErrorCodeDescription("Disappeared from global queue"); } } } }