Identify already executing scripts - JSR 223
I'm looking at using JSR 223 to provide Jython scripting in an application. I'm slightly afraid of someone writing infinite loops that eventually require a restart of the entire web-application. I've b开发者_StackOverflow社区een looking for a way of making a list of 'currently executing' scripts (with the idea of building some kind of 'ps' command) and some way to kill them, but I can't see anything in the API that would provide that. Any ideas?
I don't think there is anything in the generic scripting API to take care of that, you will probably have to maintain your own list.
But if you know you are not going to use anything else that Jython behind the scene you should probably directly use it instead of JSR 223. It's pretty easy to use. For me the only benefit of the JSR 223 if when you want to manipulate different script engines with the same code.
精彩评论