Hi,
I have a Dialog Field Object with a Progressbar and a Cancel Button with a method iscanceled, and when this method is true (e.g. when the cancel button is pressed, it returns true) I would like to break a loop.
So I have three options:
1. I create all three classes (create buildIndex, LSA and buildPositionalIndex) by myself as methods in my parser class (including the depending methods like Vectorwriters and stuff and break the loops conditionally somewhere when the Index Process does its heavy duty work, but I know not exactly where this is, or I @Overwrite your classes but am not exactly sure how to do this.
2. There is some way to kill a swingworker thread without this whole stuff beeing implemented a second time...by interrupting which is task.cancel(), but so far this did not work for me.
3. Somewhere in your class I can call a method to kill the process (like maybe Vectorwriter.stop(), (buildIndex.stop() or LSA.stop()) which calls an internal variable in SV classes which is regularly queried in the docindexing loops of the SV classes and triggers a sane closing of the operation without corrupting vectorfiles or something which would be very handy!
if 1 is true, then it is a lot of work. But there must be examples to kill such a heavyweight process without killing the whole Application, did you never had this problem programatically?
I mean, If i use the jar file directly, I can always use ctrl-c but this means killing the process completely.
I would prefer option 3 to stay cleanly at the provided API´s instead of creating the stuff again (which is the buildIndex, LSA and buildPositionalIndex classes, but only with an option to stop the indexing).
Thanks a lot for your effort,
Michael