This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 39640 - Allow support for asynchronous actions
Summary: Allow support for asynchronous actions
Status: VERIFIED FIXED
Alias: None
Product: platform
Classification: Unclassified
Component: Actions (show other bugs)
Version: 3.x
Hardware: All All
: P3 blocker (vote)
Assignee: Jaroslav Tulach
URL:
Keywords: API, API_REVIEW_FAST
: 35759 39866 (view as bug list)
Depends on:
Blocks: 39213 39866
  Show dependency tree
 
Reported: 2004-02-05 13:33 UTC by Jaroslav Tulach
Modified: 2008-12-22 21:34 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments
Diff of the change and test of its behaviour (8.99 KB, patch)
2004-02-05 13:34 UTC, Jaroslav Tulach
Details | Diff
Simple solution for this issue and bugs 39866, 39213 (45.42 KB, patch)
2004-02-13 17:18 UTC, Jaroslav Tulach
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jaroslav Tulach 2004-02-05 13:33:35 UTC
As part of the action clean up
(http://www.netbeans.org/download/dev/javadoc/OpenAPIs/org/openide/doc-files/upgrade.html#3.6-actions-event-thread)
 all actions are encouraged to run in AWT thread.
Due to compatibility reasons the actions that do
not override new asynchronous() method are still
executed on background. So we have infrastructure
for doing that in place.

Moreover there are actions that cannot be executed
in AWT as they would occupy it for too long time
(PrintAction) and this would result in poor
responsiveness.

But they cannot use the build-in infrastructure as
that results in a warning message to be printed
and they are told to use complicated RP calls by
themselves.

As a result tons of actions spread over a lot of
modules are going to be poluted by innerclasses
and RequestProcessor calls that will have to be
rewritten in future version once more as we will
introduce "progress api" and any background action
will be adviced to use it to communicate that
something is happening.

The goal of my proposed change is to:
1. simplify code for those who conciously want
asynchronous action behaviour
2. do it in a way that will allow future
enhancements like use of progress api without the
need to all the client code.

Btw. The actual diff is just four lines long.
Comment 1 Jaroslav Tulach 2004-02-05 13:34:21 UTC
Created attachment 13263 [details]
Diff of the change and test of its behaviour
Comment 2 Jesse Glick 2004-02-05 14:29:08 UTC
FWIW I don't really agree with this patch because I *don't* think it
will allow actions to transparently switch to the progress API without
changes. Specifically I don't think that PrintAction should be written
the way it is for promo-D; it should collect the PrintCookie's synch
in performAction (because Node's are in EQ GUI layer) and then print
from them asynch. If we have a progress API it should also probably
communicate between the PrintCookie and that API.

Also putting actions into RequestProcessor is a bit too magical for my
tastes. Just because they don't want to run in EQ doesn't necessarily
mean they *do* want to run in RP. They may want to use the
ExecutionEngine, or do something in a particular Mutex, etc. I think
having the asynchronous() -> true simply obscures what the code is
doing unnecessarily.

So -1 from me for now. I consider the automatic replanning of action
code to RP to be an undesirable hack needed to retain backward
compatibility, not a feature.
Comment 3 Jaroslav Tulach 2004-02-13 10:12:49 UTC
Accoding to reactions on nbdev@ 
http://www.netbeans.org/servlets/ReadMsg?msgId=691387&listName=nbdev
http://www.netbeans.org/servlets/BrowseList?listName=nbdev&by=thread&from=22289
and few bugs that seem to rely on a common fix I consider this bug and
I am going to work on this.
Comment 4 Jaroslav Tulach 2004-02-13 17:18:04 UTC
Created attachment 13428 [details]
Simple solution for this issue and bugs 39866, 39213
Comment 5 Jaroslav Tulach 2004-02-13 17:22:57 UTC
In order to show running actions in exit dialog, I needed a way to
communicate with core from openide. I have reused ActionManager for
that. ModuleActions are still synchronous, but they add and remove
wait cursor and keep a list of running actions.

In order to keep our unit tests functional, I had to introduce forced
synchronous mode. The good thing is that the check is not widespread.
It is only in CallableSystemAction and PasteAction, because the later
has its own presentation and functional logic.

I think now everything is functional, I'll wait for some reviews.
Comment 6 Jaroslav Tulach 2004-02-17 11:46:51 UTC
Checking in openide/openide-spec-vers.properties;
/cvs/openide/openide-spec-vers.properties,v  <-- 
openide-spec-vers.properties
new revision: 1.134; previous revision: 1.133
done
Processing log script arguments...
More commits to come...
Checking in openide/api/doc/changes/apichanges.xml;
/cvs/openide/api/doc/changes/apichanges.xml,v  <--  apichanges.xml
new revision: 1.187; previous revision: 1.186
done
Processing log script arguments...
More commits to come...
Checking in openide/arch/arch-openide-actions.xml;
/cvs/openide/arch/arch-openide-actions.xml,v  <-- 
arch-openide-actions.xml
new revision: 1.23; previous revision: 1.22
done
Processing log script arguments...
More commits to come...
Checking in openide/src/org/openide/actions/DeleteAction.java;
/cvs/openide/src/org/openide/actions/DeleteAction.java,v  <-- 
DeleteAction.java
new revision: 1.21; previous revision: 1.20
done
Checking in openide/src/org/openide/actions/PasteAction.java;
/cvs/openide/src/org/openide/actions/PasteAction.java,v  <-- 
PasteAction.java
new revision: 1.53; previous revision: 1.52
done
Checking in openide/src/org/openide/actions/PrintAction.java;
/cvs/openide/src/org/openide/actions/PrintAction.java,v  <-- 
PrintAction.java
new revision: 1.21; previous revision: 1.20
done
Processing log script arguments...
More commits to come...
Checking in openide/src/org/openide/explorer/ExplorerActions.java;
/cvs/openide/src/org/openide/explorer/ExplorerActions.java,v  <-- 
ExplorerActions.java
new revision: 1.64; previous revision: 1.63
done
Processing log script arguments...
More commits to come...
Checking in
openide/src/org/openide/util/actions/CallableSystemAction.java;
/cvs/openide/src/org/openide/util/actions/CallableSystemAction.java,v
 <--  CallableSystemAction.java
new revision: 1.17; previous revision: 1.16
done
Checking in
openide/src/org/openide/util/actions/CallbackSystemAction.java;
/cvs/openide/src/org/openide/util/actions/CallbackSystemAction.java,v
 <--  CallbackSystemAction.java
new revision: 1.37; previous revision: 1.36
done
Removing openide/src/org/openide/util/actions/MouseCursorUtils.java;
/cvs/openide/src/org/openide/util/actions/MouseCursorUtils.java,v  <--
 MouseCursorUtils.java
new revision: delete; previous revision: 1.1
done
Checking in openide/src/org/openide/util/actions/NodeAction.java;
/cvs/openide/src/org/openide/util/actions/NodeAction.java,v  <-- 
NodeAction.java
new revision: 1.44; previous revision: 1.43
done
Processing log script arguments...
More commits to come...
Checking in
openide/test/unit/src/org/openide/actions/AbstractCallbackActionTestHidden.java;
/cvs/openide/test/unit/src/org/openide/actions/AbstractCallbackActionTestHidden.java,v
 <--  AbstractCallbackActionTestHidden.java
new revision: 1.6; previous revision: 1.5
done
Checking in
openide/test/unit/src/org/openide/actions/PasteActionTest.java;
/cvs/openide/test/unit/src/org/openide/actions/PasteActionTest.java,v
 <--  PasteActionTest.java
new revision: 1.5; previous revision: 1.4
done
Processing log script arguments...
More commits to come...
Checking in
openide/test/unit/src/org/openide/explorer/ExplorerPanelTest.java;
/cvs/openide/test/unit/src/org/openide/explorer/ExplorerPanelTest.java,v
 <--  ExplorerPanelTest.java
new revision: 1.10; previous revision: 1.9
done
Processing log script arguments...
More commits to come...
RCS file:
/cvs/openide/test/unit/src/org/openide/util/actions/AsynchronousTest.java,v
done
Checking in
openide/test/unit/src/org/openide/util/actions/AsynchronousTest.java;
/cvs/openide/test/unit/src/org/openide/util/actions/AsynchronousTest.java,v
 <--  AsynchronousTest.java
initial revision: 1.1
done
Checking in
openide/test/unit/src/org/openide/util/actions/CallbackSystemActionTest.java;
/cvs/openide/test/unit/src/org/openide/util/actions/CallbackSystemActionTest.java,v
 <--  CallbackSystemActionTest.java
new revision: 1.10; previous revision: 1.9
done
Processing log script arguments...
More commits to come...
Checking in core/execution/src/org/netbeans/core/execution/Install.java;
/cvs/core/execution/src/org/netbeans/core/execution/Install.java,v 
<--  Install.java
new revision: 1.13; previous revision: 1.12
done
Processing log script arguments...
More commits to come...
Checking in core/src/org/netbeans/core/ModuleActions.java;
/cvs/core/src/org/netbeans/core/ModuleActions.java,v  <-- 
ModuleActions.java
new revision: 1.30; previous revision: 1.29
done
Processing log script arguments...
More commits to come...
RCS file:
/cvs/core/test/unit/src/org/netbeans/core/ModuleActionsTest.java,v
done
Checking in core/test/unit/src/org/netbeans/core/ModuleActionsTest.java;
/cvs/core/test/unit/src/org/netbeans/core/ModuleActionsTest.java,v 
<--  ModuleActionsTest.java
initial revision: 1.1
done
Comment 7 Jaroslav Tulach 2004-02-17 11:47:50 UTC
*** Issue 39866 has been marked as a duplicate of this issue. ***
Comment 8 Jesse Glick 2004-02-17 16:31:21 UTC
*** Issue 35759 has been marked as a duplicate of this issue. ***
Comment 9 Marian Mirilovic 2005-07-13 13:26:22 UTC
closed