[jboss-user] [JBoss Portal] - multi-threading inside JBoss Portlet
sbiwal
do-not-reply at jboss.com
Mon May 19 04:09:16 EDT 2008
Hi,
I have the following situation -
* User takes an action on a portlet and the portlet starts a new thread which handles the action (apparently the action which is copying some files may take long and thats why I fork it in a new thread).
* If in the meantime, the user starts the (copy) action again, the previous thread should be interrupted and the new copy should be honored.
All of this works fine as long as I do not refresh the view of my portlet ie the isInterrupted flag is set on any previous thread and when this thread checks for "isInterrupted()", it finds itself interrupted and I can exit gracefully. But if I have a situation where the user interrupts a previous copy action (lets say Thread1), and then refreshes the portlet (anything that called doView), then the isInterrupted flag on Thread1 is cleared and it still proceeds.
Does doView of a portlet causes thread interrupts to be cleared ? Am I doing something wrong ? I had searched the forums enough, but did not find anyone doing something similar to this.
Any help would be appreciated.
View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=4151669#4151669
Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=4151669
More information about the jboss-user
mailing list