@Override public void stop(final BundleContext context) throws Exception { if (refreshHandle != null) { refreshHandle.remove(); refreshHandle = null; } if (focusListener != null) { if (PlatformUI.isWorkbenchRunning()) PlatformUI.getWorkbench().removeWindowListener(focusListener); focusListener = null; } if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) GitTraceLocation.getTrace() .trace( GitTraceLocation.REPOSITORYCHANGESCANNER.getLocation(), "Trying to cancel " + rcs.getName() + " job"); // $NON-NLS-1$ //$NON-NLS-2$ rcs.setReschedule(false); rcs.cancel(); if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) GitTraceLocation.getTrace() .trace( GitTraceLocation.REPOSITORYCHANGESCANNER.getLocation(), "Trying to cancel " + refreshJob.getName() + " job"); // $NON-NLS-1$ //$NON-NLS-2$ refreshJob.cancel(); rcs.join(); refreshJob.join(); if (GitTraceLocation.REPOSITORYCHANGESCANNER.isActive()) GitTraceLocation.getTrace() .trace( GitTraceLocation.REPOSITORYCHANGESCANNER.getLocation(), "Jobs terminated"); //$NON-NLS-1$ super.stop(context); plugin = null; }
private void setupRepoChangeScanner() { rcs = new RepositoryChangeScanner(); rcs.setSystem(true); rcs.schedule(RepositoryChangeScanner.REPO_SCAN_INTERVAL); }