You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@pivot.apache.org by "Andrei Pozolotin (JIRA)" <ji...@apache.org> on 2011/05/23 05:37:48 UTC
[jira] [Created] (PIVOT-747) pivot & blocking edt
pivot & blocking edt
--------------------
Key: PIVOT-747
URL: https://issues.apache.org/jira/browse/PIVOT-747
Project: Pivot
Issue Type: Improvement
Components: wtk
Affects Versions: 2.0
Reporter: Andrei Pozolotin
Greg, hello;
in this thread:
http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
your final word is:
"Sorry, it is not possible"
but I know that you know that it is possible :-)
the reason I need this is same as Martin here:
http://netbeans.org/bugzilla/show_bug.cgi?id=90590
namely: do some cleanup after shutdown was requested and confirmed:
org.apache.pivot.wtk.Application
public boolean shutdown(boolean optional) throws Exception;
since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
http://bugs.sun.com/view_bug.do?bug_id=6424157
wich "almost works", except you have this check everywhere:
Container.assertEventDispatchThread();
which fails, as described above:
http://bugs.sun.com/view_bug.do?bug_id=6424157
due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
my request is this:
do you think you could make
Container.assertEventDispatchThread();
less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
thanks!
Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038669#comment-13038669 ]
Greg Brown commented on PIVOT-747:
----------------------------------
Under what circumstances might an application want to call this method?
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039146#comment-13039146 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
great! decided, then. should I submit a patch?
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041149#comment-13041149 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
@ Noel:
please take a look on patch_2011-05-29_assert-runner.patch ;
benefits:
1) flexible / insertable / switchable;
2) does not take much space in Container.java;
3) much less perfomance hit when not active;
4) allows not to blow up but reports violations instead;
5) preserves original intent to inforce EDT contract;
this is how I use it:
####################################
public class App extends HostServiceProvider implements Application {
private final Runnable assertRunner = new Runnable() {
@Override
public void run() {
if (EventQueue.isDispatchThread()) {
return;
}
String name = Thread.currentThread().getName();
if (name.equals("main")) {
return;
}
if (name.equals("javawsApplicationMain")) {
return;
}
if (name.startsWith("AWT-EventQueue-")) {
return;
}
Exception e = new Exception("NON EDT THREAD : " + name);
log.error("", e);
}
};
@Override
public synchronized void startup(Display display,
org.apache.pivot.collections.Map<String, String> properties) {
Container.setAssertRunner(assertRunner);
@Override
public synchronized boolean shutdown(final boolean isShutdownOptional) {
Container.setAssertRunner(null);
####################################
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037942#comment-13037942 ]
Greg Brown commented on PIVOT-747:
----------------------------------
The application lifecycle methods are defined to be called from the EDT, so changing that would introduce other problems. Maybe Noel can comment on the other issues - he added the assertEventDispatchThread() functionality.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Greg Brown updated PIVOT-747:
-----------------------------
Priority: Minor (was: Major)
Fix Version/s: 2.0.1
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038052#comment-13038052 ]
Greg Brown commented on PIVOT-747:
----------------------------------
Can't you just return true from shutdown() to prevent the Pivot app from closing? Then when your OSGi shutdown hook is called, you set a flag in your app and call DesktopApplicationContext.exit(), similar to what is implemented here:
http://svn.apache.org/repos/asf/pivot/trunk/tests/src/org/apache/pivot/tests/ShutdownTest.java
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038597#comment-13038597 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
still another little hack idea: why not permit more names! :-)
public static boolean isProperEDT() {
/*
* Currently, application startup happens on the main thread, so we need
* to allow that thread to modify WTK state.
*/
String threadName = Thread.currentThread().getName();
return EventQueue.isDispatchThread() || threadName.equals("main")
|| threadName.startsWith("AWT-EventQueue-");
}
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Assigned] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Greg Brown reassigned PIVOT-747:
--------------------------------
Assignee: Noel Grandin
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Fix For: 2.0.1
>
> Attachments: patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Edvin Syse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041484#comment-13041484 ]
Edvin Syse commented on PIVOT-747:
----------------------------------
Nice, that should do it. But if you really need to change the default EDT_CHECKER, you won't be able to do so before the main() method of DesktopApplicationContext is run, and then the default EDIT_CHECKER has already been called multiple times. I think it would be much better to install the default EDT_CHECKER after Application#startup() is called from the ApplicationContext, provided no EDT_CHECKER was set by the #startup() method.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040716#comment-13040716 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
@Greg & @Noel:
guys, in case you still thik this is "minor":
I have a use case when under jnlp startup pivot blows up on the same assert,
because there is a different "main" under sun plugin2 in browser, called "javawsApplicationMain"
and I can not even rename the thread, because it happens too early;
##################################
stack trace:
java.lang.IllegalStateException: this method can only be called from the AWT event dispatch thread; javawsApplicationMain
at org.apache.pivot.wtk.Container.assertEventDispatchThread(Container.java:853)
at org.apache.pivot.wtk.WTKListenerList.add(WTKListenerList.java:36)
at org.apache.pivot.wtk.skin.ComponentSkin.install(ComponentSkin.java:96)
at org.apache.pivot.wtk.skin.ContainerSkin.install(ContainerSkin.java:129)
at org.apache.pivot.wtk.skin.DisplaySkin.install(DisplaySkin.java:41)
at org.apache.pivot.wtk.Component.setSkin(Component.java:749)
at org.apache.pivot.wtk.Display.<init>(Display.java:31)
at org.apache.pivot.wtk.ApplicationContext$DisplayHost.<init>(ApplicationContext.java:77)
at org.apache.pivot.wtk.DesktopApplicationContext$DesktopDisplayHost.<init>(DesktopApplicationContext.java:90)
at org.apache.pivot.wtk.DesktopApplicationContext.main(DesktopApplicationContext.java:537)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at com.sun.javaws.Launcher.executeApplication(Launcher.java:1804)
at com.sun.javaws.Launcher.executeMainClass(Launcher.java:1750)
at com.sun.javaws.Launcher.doLaunchApp(Launcher.java:1512)
at com.sun.javaws.Launcher.run(Launcher.java:130)
at java.lang.Thread.run(Thread.java:662)
##################################
modified assert that prints thread name:
public static final void assertEventDispatchThread() {
/* Currently, application startup happens on the main thread, so we need to allow
* that thread to modify WTK state.
*/
if (!java.awt.EventQueue.isDispatchThread()
&& !Thread.currentThread().getName().equals("main")) {
throw new IllegalStateException("this method can only be called from the AWT event dispatch thread; " + Thread.currentThread().getName());
}
}
##################################
and the test app - does nothing wrong, right? :-)
##################################
public class AppXXX implements Application {
protected final Logger log = LoggerFactory.getLogger(getClass());
public AppXXX() {
log.info("init");
}
//
@Override
public synchronized void startup(Display display,
org.apache.pivot.collections.Map<String, String> properties) {
log.debug("### pivot startup");
}
@Override
public synchronized boolean shutdown(final boolean isShutdownOptional) {
log.debug("### pivot shutdown; isOptional : {};", isShutdownOptional);
return true;
}
//
@Override
public void suspend() throws Exception {
// not used
}
@Override
public void resume() throws Exception {
// not used
}
}
##################################
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041718#comment-13041718 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
@Noel: great! works good now; thank you.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038140#comment-13038140 ]
Greg Brown commented on PIVOT-747:
----------------------------------
That seems reasonable. Can you submit a patch?
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041142#comment-13041142 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
@Noel: thanks! testing now.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037717#comment-13037717 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
or may be you can call startup() & shutdown() from non-EDT pool thread?
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Edvin Syse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041104#comment-13041104 ]
Edvin Syse commented on PIVOT-747:
----------------------------------
I don't think this is enough for Java WebStart. The main thread there is called javawsApplicationMain. Could you add a check for this as well? Right now, Webstart is not working with Pivot as far as I understand.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039105#comment-13039105 ]
Greg Brown commented on PIVOT-747:
----------------------------------
Not sure if it would be best to enable or disable by default. Noel, what do you think?
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041483#comment-13041483 ]
Noel Grandin commented on PIVOT-747:
------------------------------------
Committed installable checker in rev 1129568
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039143#comment-13039143 ]
Noel Grandin commented on PIVOT-747:
------------------------------------
I'm in agreement with Greg, trying to fix Andrei's use-case is getting too complex.
So yes, I think we should make it possible to turn it off with a system property.
I think it's actually fairly robust in general - very few developers play the kind of EDT-switching tricks that Andrei does.
For those developers not using such tricks, it provides early-on checking for a class of problems that is otherwise hard to debug.
I also note from reading the bugs referenced by Andrei, that this particular problem is fixed in JDK7, so when that comes around, Andrei will not longer need to turn this off.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038149#comment-13038149 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
great! yes.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038540#comment-13038540 ]
Greg Brown commented on PIVOT-747:
----------------------------------
@Noel - I don't think we should make assertEventDispatchThread() synchronized. That will incur a performance hit which, in my opinion, isn't justified for what is essentially debug code. It may be possible to avoid that penalty by wrapping the actual check in an assert:
public static final void assertEventDispatchThread() {
assert isEventDispatchThread();
}
public static final synchronized boolean isEventDispatchThread() {
return (java.awt.EventQueue.isDispatchThread()
&& !Thread.currentThread().getName().equals("main"));
}
However, it would probably be best to avoid this if possible.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Attachments: patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038131#comment-13038131 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
do you think you could expand
private static class DesktopDisplayHost extends DisplayHost {
public static boolean exit() {
with extra:
public static boolean exit(boolean isOptional) {
and propogate isOptional to shutdown(boolean isOptional) ?
as flag signaling gets convoluted, and I've got no static fields :-)
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039129#comment-13039129 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
re: "such a narrow use case" - sorry, but looks very wide in my eyes :-)
but probably more problematic is the philosophy of enforcing a policy which is buggy in itself;
for example, if I am creating an osgi-based platform, where people will contribute their own plugins,
I'd rather have a way to collect "edt policy violations" form their plugins and report back to them in a meaninful way,
instead of to blow up entire application at run time.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039093#comment-13039093 ]
Sandro Martini commented on PIVOT-747:
--------------------------------------
Hi all,
Greg I agree with you, this is an useful feature, but probably it would be better to have a (simple) way to enable/disable, for example using a system property.
And by default do you think it's better to have enabled or disabled ?
For a mid/long term solution (for this and maybe other things) could we think to add environment-dependent behavior (but maybe this could be part of the 2.1 release) (DEVELOPMENT, TEST, PREPRODUCTION, PRODUCTION, etc ...) like in Grails, Griffon, Spring 3.1.x, etc ? But all this could be too much ...
Some reference here:
http://www.grails.org/Environments
http://griffon-user.3225736.n2.nabble.com/Problems-with-Environment-current-td5138933.html
If you think this could be interesting tell me and I'll add a ticket for the 2.1 on this.
Bye
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038771#comment-13038771 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
it is no more hack than checking for "main" in thread name, would you agree?
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (PIVOT-747) pivot & blocking edt
Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Sandro Martini updated PIVOT-747:
---------------------------------
Comment: was deleted
(was: Hi all,
assign this issue to 2.0.1 and to Noel ?
)
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038050#comment-13038050 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
re: "which correctly traverses the push()/pop() hierarchy, so there shouldn't be a problem there. "
well, it does not;
the failure scenario is this:
a) I issue pop() in the "old EDT", while some pivot components
are still being closed in the "new EDT";
b) this closing results in some pivot event listener trying to unregster some pivot component,
which calls your assert, and it fails, since "new EDT" is no longer "valid" according to EventQueue.isDispatchThread();
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrei Pozolotin updated PIVOT-747:
-----------------------------------
Attachment: patch-001-exit.patch
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Attachments: patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037714#comment-13037714 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
this is my current pusher-popper
public abstract class EQ_Runner implements Runnable {
protected final Logger log = LoggerFactory.getLogger(getClass());
private final String name;
public EQ_Runner(String name) {
this.name = name;
}
private boolean isDispatchThread() {
return EventQueue.isDispatchThread();
}
private void assertEventDispatchThread() {
if (isDispatchThread()) {
return;
} else {
String message = "must be in EDT";
log.error(message);
throw new IllegalStateException(message);
}
}
private EventQueue getSystemQueue() {
return Toolkit.getDefaultToolkit().getSystemEventQueue();
}
private class ExtraQueue extends EventQueue {
@Override
public void pop() {
try {
super.pop();
} catch (Throwable e) {
log.error("", e);
}
}
}
protected abstract void runCore() throws Exception;
@Override
public final void run() {
try {
runCore();
} catch (Throwable e) {
log.error("", e);
}
}
// http://bugs.sun.com/view_bug.do?bug_id=6424157
// http://netbeans.org/bugzilla/show_bug.cgi?id=90590
// http://code.google.com/p/javafxdemos/source/browse/ModalDialog/src/modaldialog/EventQueueUtils.java
public final void execute() {
// main EQ; main EDT;
assertEventDispatchThread();
// log.debug("START : {} : {}", isDispatchThread(), getSystemQueue());
// log.debug("### thread id : {}", Thread.currentThread().getId());
EventQueue mainQueue = getSystemQueue();
ExtraQueue workQueue = new ExtraQueue();
Thread worker = new Thread(this, name);
// context: switch new
// drain main EQ into work EQ
// start work EDT
mainQueue.push(workQueue);
// worker uses work EDT
worker.start();
// block old main EDT
try {
worker.join();
} catch (InterruptedException e) {
e.printStackTrace();
}
// context: restore old
// drain work EQ into main EQ;
// stop old main EDT; start new main EDT; stop work EDT;
workQueue.pop();
// NOTE: this is no longer a EDT form "pedantic point of view"
// assertEventDispatchThread();
// log.debug("FINISH : {} : {}", isDispatchThread(), getSystemQueue());
}
}
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038370#comment-13038370 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
Noel, hello again!
1) I think I found the reason why your isDispatchThread() blows up on push() / pop():
2) both push and pop are synchronized :
public synchronized void push(EventQueue newEventQueue) {
synchronized (newEventQueue) {
protected void pop() throws EmptyStackException {
synchronized ((prev != null) ? prev : this) {
synchronized(this) {
3) but isDispatchThread() is not synchronized, hence it can see all kind of transitory phases;
public static boolean isDispatchThread() {
EventQueue eq = Toolkit.getEventQueue();
EventQueue next = eq.nextQueue;
while (next != null) {
eq = next;
next = eq.nextQueue;
}
return (Thread.currentThread() == eq.dispatchThread);
}
for example I have a test case which, with proper timing,
blows up both source and target EDT threads during push/pop switch! :-)
4) so it seems, if you insist on EventQueue Pivot Police ® :-)
we would need a better isDispatchThread() implementatoion;
5) bottom line: isDispatchThread() is a good guard for EDT vs non-EDT,
but does not work for EDT vs EDT;
Cheers,
Andrei.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Attachments: patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrei Pozolotin updated PIVOT-747:
-----------------------------------
Attachment: patch_2011-05-29_assert-runner.patch
for your review:
patch_2011-05-29_assert-runner.patch
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039125#comment-13039125 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
how about this:
################################
public class Container1 {
private volatile static Runnable policeEDT;
public static Runnable getPoliceEDT() {
return policeEDT;
}
public static void setPoliceEDT(Runnable police) {
policeEDT = police;
}
//
static {
Runnable defaultPoliceEDT = new Runnable() {
@Override
public void run() {
// use current pivot checker?
}
};
setPoliceEDT(defaultPoliceEDT);
}
public static final void assertEventDispatchThread() {
getPoliceEDT().run();
}
}
################################
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038565#comment-13038565 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
@Greg:
a) re: "applied a modified version of the patch" - thank you;
b) re: "encourage you to test" - sorry; I will;
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrei Pozolotin updated PIVOT-747:
-----------------------------------
Attachment: Container.java
@Greg & @Noel:
attached Container.java shows an idea of how to make edt police more people friendly; what do you think?
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039130#comment-13039130 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
also: thead name "main" based check: some frameworks (and people!) rename threads early, before pivot sees it.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037997#comment-13037997 ]
Noel Grandin commented on PIVOT-747:
------------------------------------
Firstly, Container.assertEventDispatchThread() calls into EventQueue.isDispatchThread(), which correctly traverses the push()/pop() hierarchy, so there shouldn't be a problem there.
Secondly, I don't understand why you need such a complicated solution. Why can you not simply call osgiShutdown() directly from your
Application#shutdown(boolean) ?
And why not simply call osgiStartup() from Application#startup ?
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039128#comment-13039128 ]
Greg Brown commented on PIVOT-747:
----------------------------------
I think a flag would be simpler. It could be set via a system property.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Edvin Syse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13040754#comment-13040754 ]
Edvin Syse commented on PIVOT-747:
----------------------------------
I can confirm the same problem. When I deploy with trunk and start as applet (via jnlp), everything is fine. If I start as WebStart, I get the IllegalStateException on startup, stacktrace is similar to Andrei's.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Resolved] (PIVOT-747) pivot & blocking edt
Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Noel Grandin resolved PIVOT-747.
--------------------------------
Resolution: Fixed
Fixed in rev 1129031
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039079#comment-13039079 ]
Greg Brown commented on PIVOT-747:
----------------------------------
My personal feeling is that this is getting a bit too complex, especially for such a narrow use case. Rather than synchronizing maybe it would be better to simply provide a means to turn the EDT check off.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038357#comment-13038357 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
Greg: if pach is ok, can you please apply?
Noel: can you please relax your assertEventDispatchThread:
just log error but do not blow up with exception? or make it optional to blow up or not?
I still have use cases where AWT works fine w/o being "politically correct".
thanks!
Andrei.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Attachments: patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038065#comment-13038065 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
great idea, thank you! I will try to see if it works for me and report back.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039134#comment-13039134 ]
Greg Brown commented on PIVOT-747:
----------------------------------
> re: "such a narrow use case" - sorry, but looks very wide in my eyes :-)
Understood. But from the perspective of a Pivot platform developer, this is a narrow use case. And we generally try to avoid overburdening the platform with code to address narrow use cases.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038047#comment-13038047 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
Noel: thank you very much for looking into this.
my problem is this:
1) I receive shutdown(optional==true) from the user;
2) before I run (or cancel) actual shutdown, including osgiShutdown()
I need to perfom negotiation with the user;
3) this negotiation happens in osgi bundle wich runs on non-ETD thread
and which uses EventQueue.invokeLater() to converse with the user;
4) while the negotiation is going on, I must block original ETD which called shutdown()
(or else pivot will just shut me down) and permit new working EDT in the meanwhile;
5) this is pretty much the same problem as net beans people discussed some time back:
http://bugs.sun.com/view_bug.do?bug_id=6424157
http://netbeans.org/bugzilla/show_bug.cgi?id=90590
am I making more sense?
Andrei.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039142#comment-13039142 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
re: "should remain" - yes, I vote it should remain, but be more flexible
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Edvin Syse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041487#comment-13041487 ]
Edvin Syse commented on PIVOT-747:
----------------------------------
Actually, an even cleaner approach would probably be to create an interface called EdtCheckerProvider or something, so that the Application class can implement this and return an EDT_CHECKER to be installed by the ApplicationContext even before creating the displayhost.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Edvin Syse (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041106#comment-13041106 ]
Edvin Syse commented on PIVOT-747:
----------------------------------
Sorry, I checked out from trunk, but it seems the patch isn't in trunk yet :) I guess all is fine, sorry for the confusion :)
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039140#comment-13039140 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
well, I am at loss, but you are the boss! :-)
I still would prefer police injection as above
https://issues.apache.org/jira/browse/PIVOT-747?focusedCommentId=13039125&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13039125
and yes, I understand you do not want to pollute nice api with ugly things like this.
but you can take this check out of the Container.java and place in a separate, say Policy.java class,
which can continue to collect cases like this :-)
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041144#comment-13041144 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
@Edvin: you are right; the patch does not work for jnlp start; as described here:
https://issues.apache.org/jira/browse/PIVOT-747?focusedCommentId=13040716&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-13040716
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Sandro Martini (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038553#comment-13038553 ]
Sandro Martini commented on PIVOT-747:
--------------------------------------
Hi all,
assign this issue to 2.0.1 and to Noel ?
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Attachments: patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038532#comment-13038532 ]
Noel Grandin commented on PIVOT-747:
------------------------------------
Thanks for your analysis Andrei.
There is not much I can do to fix EventQueue#isDispatchThread.
But does it help your situation if you change the Container#assertEventDispatchThread method to be synchronized?
That will force the VM to emit a memory barrier, which will at least enforce that it can see recent memory writes.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Attachments: patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038768#comment-13038768 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
re: "circumstances" - the original issue of pivot blowing up with exceptions under push()/pop();
my "name hack idea" is just replacement for your isEventDispatchThread():
##############################################
public static final void assertEventDispatchThread() {
assert isEventDispatchThread();
}
public static final synchronized boolean isEventDispatchThread() {
String threadName = Thread.currentThread().getName();
return EventQueue.isDispatchThread() || threadName.equals("main") || threadName.startsWith("AWT-EventQueue-");
}
##############################################
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039311#comment-13039311 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
or, do you think you can agree on this small change to the current assertEventDispatchThread() [ see: startsWith("AWT-EventQueue-") ]:
?
####################################
public static final void assertEventDispatchThread() {
/*
* Currently, application startup happens on the main thread, so we need
* to allow that thread to modify WTK state.
*/
if (!java.awt.EventQueue.isDispatchThread()
&& !Thread.currentThread().getName().equals("main")
&& !Thread.currentThread().getName()
.startsWith("AWT-EventQueue-")) {
throw new IllegalStateException(
"this method can only be called from the AWT event dispatch thread");
}
}
####################################
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039138#comment-13039138 ]
Greg Brown commented on PIVOT-747:
----------------------------------
My preference would actually be to remove the check altogether. But if others feel strongly that it should remain, I think a flag would be preferable.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Greg Brown (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13038535#comment-13038535 ]
Greg Brown commented on PIVOT-747:
----------------------------------
I have applied a modified version of the patch as the original didn't compile. I'd encourage you to test any future patches more thoroughly before submitting them. I also changed the name of the argument from "isOptional" to "optional" since Pivot's coding conventions don't include the "is" prefix in variable names, just getter methods.
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Attachments: patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Updated] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Andrei Pozolotin updated PIVOT-747:
-----------------------------------
Attachment: patch_2011-05-27_edt-name.patch
@Greg, @Noel,
guys, while you still thinking; can you please commit
patch_2011-05-27_edt-name.patch
?
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13039133#comment-13039133 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
re: "flag would be simple" - yes;
but it would also limit you to single way of checking; and will force another negotiation when someone else needs some other check enforced by pivot
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Noel Grandin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13041597#comment-13041597 ]
Noel Grandin commented on PIVOT-747:
------------------------------------
No, you can substitute your own main method and do whatever you need to do there, before calling DesktopApplicationContext#main()
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
> Assignee: Noel Grandin
> Priority: Minor
> Fix For: 2.0.1
>
> Attachments: Container.java, patch-001-exit.patch, patch_2011-05-27_edt-name.patch, patch_2011-05-29_assert-runner.patch
>
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira
[jira] [Commented] (PIVOT-747) pivot & blocking edt
Posted by "Andrei Pozolotin (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/PIVOT-747?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13037716#comment-13037716 ]
Andrei Pozolotin commented on PIVOT-747:
----------------------------------------
and use cases:
##################
@Override
public void startup(Display display,
org.apache.pivot.collections.Map<String, String> properties)
throws Exception {
new EQ_Runner("# OSGI START") {
@Override
protected void runCore() throws Exception {
osgiStartup();
}
}.execute();
##################
@Override
public boolean shutdown(final boolean isOptional) throws Exception {
final Value<Boolean> isCanceled = new Value<Boolean>(false);
new EQ_Runner("# OSGI FINISH") {
@Override
protected void runCore() throws Exception {
isCanceled.set(isOptional && isShutdownCanceled());
if (isCanceled.get()) {
return;
}
osgiShutdown();
}
}.execute();
##################
> pivot & blocking edt
> --------------------
>
> Key: PIVOT-747
> URL: https://issues.apache.org/jira/browse/PIVOT-747
> Project: Pivot
> Issue Type: Improvement
> Components: wtk
> Affects Versions: 2.0
> Reporter: Andrei Pozolotin
>
> Greg, hello;
> in this thread:
> http://mail-archives.apache.org/mod_mbox/pivot-user/201001.mbox/%3C4B5E581D.2080604@hms.harvard.edu%3E
> your final word is:
> "Sorry, it is not possible"
> but I know that you know that it is possible :-)
> the reason I need this is same as Martin here:
> http://netbeans.org/bugzilla/show_bug.cgi?id=90590
> namely: do some cleanup after shutdown was requested and confirmed:
> org.apache.pivot.wtk.Application
> public boolean shutdown(boolean optional) throws Exception;
> since you call shutdown(boolean optional) from EDT I need to block it, using this approach:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> wich "almost works", except you have this check everywhere:
> Container.assertEventDispatchThread();
> which fails, as described above:
> http://bugs.sun.com/view_bug.do?bug_id=6424157
> due to EventQueue.isDispatchThread() failing on the "T1 vs T1*" distinction
> my request is this:
> do you think you could make
> Container.assertEventDispatchThread();
> less pedantic, and allow both "current and past/next" EDT threads to pass which are created during EventQueue push() / pop()
> thanks!
> Andrei
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira