IProgressService.busyCursorWhile and event queue [message #436123] |
Wed, 31 August 2005 12:33 |
Daniel Krügler Messages: 853 Registered: July 2009 |
Senior Member |
|
|
Hello,
recently I stumbled about the interaction of busyCursorWhile and the
event queue of the relevant target system (which is WinXP).
If you see in the shortened log file below, we have an data base
application that provides an UI-related ActiveEntityManager, which
is e.g. accessible by a special entity navigation action
(AbstractEntityNavigationDelegate below), which notifies interested
active entity listeners (like the GelViewer below) on changes.
The below documented exception is raised, if the user **quickly**
applies UI entity navigation (by clicking at the toolbar action
one after the other).
To explain the situation somewhat more detailed:
- ActiveEntityManager.fireActiveEntityChanged acts in the same thread as
the AbstractEntityNavigationDelegate, I assume that should be the UI
thread
- Gelviewer.handleEntityChange is the active entity change handler and
starts busyCursorWhile, because there mainly is some Non-UI-stuff to
do, but the user should get some progress feedback. During this
work there is also some call of getDisplay().syncExec() to immediatly
ensure sync with UI parts
- As you see, suddenly we have a ModalContextThread.block. That is fine,
the documentation of busyCursorWhile tells us about that to happen.
- Now the nasty side: **During** the mentioned block the UI event queue
proceeds with the next action invocation of the user, and by doing
this it **also** visits ActiveEntityManager.fireActiveEntityChanged.
The actual runtime exception is fired by this Manager class on any
entry retrial (before previous have finished)
The question arises: What is the correct way to combine event queue with
progress service? My understanding was that busyCursorWhile blocks the
UI, but seems that this does not prevent the event queue from running.
Thanks for any input,
Daniel Krügler
!SESSION 2005-08-31 11:37:30.637
-----------------------------------------------
eclipse.buildId=unknown
java.version=1.5.0_04
java.vendor=Sun Microsystems Inc.
BootLoader constants: OS=win32, ARCH=x86, WS=win32, NL=en_US
[..]
!ENTRY org.eclipse.ui 4 0 2005-08-31 11:37:59.700
!MESSAGE Illegal access to locked active entity manager
!STACK 0
java.lang.RuntimeException: Illegal access to locked active entity manager
at
WhatEver.ui.entities.internal.ActiveEntityManager$ActiveEnti tyHistory.gotoEntry(ActiveEntityManager.java:155)
at
WhatEver.ui.entities.internal.ActiveEntityManager$ActiveEnti tyHistory.gotoPrev(ActiveEntityManager.java:141)
at
WhatEver.ui.entities.internal.EntityHistoryActionImpl.run(En tityHistoryActionImpl.java:112)
at
WhatEver.ui.entities.internal.AbstractEntityNavigationDelega te.run(AbstractEntityNavigationDelegate.java:80)
at
org.eclipse.ui.actions.ActionDelegate.runWithEvent(ActionDel egate.java:70)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:236)
at
org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPl uginAction.java:223)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:538)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
at
org.eclipse.jface.action.ActionContributionItem$6.handleEven t(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2713)
at
org.eclipse.jface.operation.ModalContext$ModalContextThread. block(ModalContext.java:153)
at org.eclipse.jface.operation.ModalContext.run(ModalContext.ja va:303)
at
org.eclipse.jface.dialogs.ProgressMonitorDialog.run(Progress MonitorDialog.java:447)
at
org.eclipse.ui.internal.progress.ProgressMonitorJobsDialog.r un(ProgressMonitorJobsDialog.java:261)
at
org.eclipse.ui.internal.progress.ProgressManager$3.run(Progr essManager.java:861)
at org.eclipse.swt.custom.BusyIndicator.showWhile(BusyIndicator .java:69)
at
org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:895)
at
org.eclipse.ui.internal.progress.ProgressManager.busyCursorW hile(ProgressManager.java:871)
at
WhatEver.ui.gelviewer.views.Gelviewer.handleEntityChange(Gel viewer.java:420)
at WhatEver.ui.gelviewer.views.Gelviewer.access$3(Gelviewer.jav a:380)
at
WhatEver.ui.gelviewer.views.Gelviewer$3.entityChanged(Gelvie wer.java:193)
at
WhatEver.ui.entities.internal.ActiveEntityManager.fireActive EntityChanged(ActiveEntityManager.java:312)
at
WhatEver.ui.entities.internal.ActiveEntityManager$ActiveEnti tyHistory.gotoEntry(ActiveEntityManager.java:163)
at
WhatEver.ui.entities.internal.ActiveEntityManager$ActiveEnti tyHistory.gotoPrev(ActiveEntityManager.java:141)
at
WhatEver.ui.entities.internal.EntityHistoryActionImpl.run(En tityHistoryActionImpl.java:112)
at
WhatEver.ui.entities.internal.AbstractEntityNavigationDelega te.run(AbstractEntityNavigationDelegate.java:80)
at
org.eclipse.ui.actions.ActionDelegate.runWithEvent(ActionDel egate.java:70)
at org.eclipse.ui.internal.PluginAction.runWithEvent(PluginActi on.java:236)
at
org.eclipse.ui.internal.WWinPluginAction.runWithEvent(WWinPl uginAction.java:223)
at
org.eclipse.jface.action.ActionContributionItem.handleWidget Selection(ActionContributionItem.java:538)
at
org.eclipse.jface.action.ActionContributionItem.access$2(Act ionContributionItem.java:488)
at
org.eclipse.jface.action.ActionContributionItem$6.handleEven t(ActionContributionItem.java:441)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java :66)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:843)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.ja va:3080)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java :2713)
at org.eclipse.ui.internal.Workbench.runEventLoop(Workbench.jav a:1699)
at org.eclipse.ui.internal.Workbench.runUI(Workbench.java:1663)
at
org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Work bench.java:367)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.j ava:143)
at WhatEver.ui.ProteinScapeApp.run(ProteinScapeApp.java:60)
at
org.eclipse.core.internal.runtime.PlatformActivator$1.run(Pl atformActivator.java:226)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:376)
at
org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseS tarter.java:163)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.core.launcher.Main.invokeFramework(Main.java:334 )
at org.eclipse.core.launcher.Main.basicRun(Main.java:278)
at org.eclipse.core.launcher.Main.run(Main.java:973)
at org.eclipse.core.launcher.Main.main(Main.java:948)
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.03380 seconds