How to shutdown my eclipse job after rcp app closes

时间:2015-07-28 23:33:21

标签: java eclipse user-interface rcp jobs

I'm using eclipse ui jobs to perform an asynchronous operation. For this when the job is still running and close my rcp app, I get a message on the console saying, !ENTRY org.eclipse.core.jobs !MESSAGE Job found still running after platform shutdown. Jobs should be canceled by the plugin that scheduled them during shutdown: com.myPluginame. I'm currently doing this

PlatformUI.getWorkbench().addWorkbenchListener(new IWorkbenchListener() {

                    @Override
                    public boolean preShutdown(IWorkbench workbench, boolean forced) {
                        return true;
                    }

                    @Override
                    public void postShutdown(IWorkbench workbench) {
                        if (myJob != null) {
                            myJob .cancel();
                        }
                    }
                });

after my workbench shuts down, myJob.cancel() code is hit but still, I see the message. Any thoughts?

0 个答案:

没有答案