You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bsf-user@jakarta.apache.org by Suresh Pendap <SU...@oracle.com> on 2009/10/28 21:20:35 UTC

regarding BSFEngine.terminate

Hi guys,
 
If I run infinite loop in a jython script (in separate thread) and call BSFEninge.terminate from a separate thread it does not seem to terminate the jython script.
 
I see that the JythonEngine which is a BSFEngine implementation for the jython script does not override the terminate method 
to actually terminate the jython script. We are using the 2.4 version of bsf and 2.1 version of jython.
 
Is this feature provided in the newer releases of BSF? 
 
If not is there any other mechanism to kill the jython script running within the bean shell.
 
 
Thanks
Suresh

 

Re: regarding BSFEngine.terminate

Posted by "Rony G. Flatscher" <Ro...@wu-wien.ac.at>.
Hi Suresh,
> If I run infinite loop in a jython script (in separate thread) and call BSFEninge.terminate from a separate thread it does not seem to terminate the jython script.
>  
> I see that the JythonEngine which is a BSFEngine implementation for the jython script does not override the terminate method 
> to actually terminate the jython script. We are using the 2.4 version of bsf and 2.1 version of jython.
>  
> Is this feature provided in the newer releases of BSF? 
>   
No, it would need to be implemented into the Jython engine.

> If not is there any other mechanism to kill the jython script running within the bean shell.
>   
No, as this should be done with the means jython allows for, if any.

Hence, what you could do is the following: try to research jython itself
for the means it offers for terminating running jython threads
(forcefully) and then implement that in the Jython engine. If you think
that you were able to find a generic solution that adheres to the Jython
philosophy then please make your patch available via Issuezilla.

Having said all of this (which also means, that I admit of not having a
working knowledge about the inner workings of Jython), maybe there are
others on this list who may have already done that or have an advice
that could help you. (One idea could be to somehow get at the Thread
object on which the jython script executes and invoke interrupt() on it.)

HTH,

---rony



---------------------------------------------------------------------
To unsubscribe, e-mail: bsf-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: bsf-user-help@jakarta.apache.org