/** This method is called when the plug-in is stopped */ public void stop(BundleContext context) throws Exception { Object[] listeners = shutdownListeners.getListeners(); for (int i = 0; i < listeners.length; ++i) { ((IShutdownListener) listeners[i]).shutdown(); } shutdownListeners.clear(); super.stop(context); ResourcesPlugin.getWorkspace().removeResourceChangeListener(projectConvertListener); ResourcesPlugin.getWorkspace().removeResourceChangeListener(reindexOperationListener); plugin = null; }
/** * Add listener that will be notified when this plug-in is going to shutdown * * @param listener */ public void addShutdownListener(IShutdownListener listener) { shutdownListeners.add(listener); }