Project

Profile

Help

Interrupting transform

Added by Anonymous over 15 years ago

Legacy ID: #7492320 Legacy Poster: Oliver Meyer (ormek)

Hi everyone, is there a standard way to (Thread.)interrupt a running transform? I am running .transform within a thread of its own. Now I like to "kill" the thread. As Thread.stop is deprecated I have to use Thread.interrupt() which only works if the interrrupted thread cooperates. Is there a standard way to check for the interrupt flag of the thread running the transform? Is there alread a checked interrupt flag in saxon? Right now, we are thinking in implementing a kind of listener/handler that receives callbacks from transform, checks the interrupt flag and throws a TransformationException to abort the transform. Any help is appreciated. Thanks Oliver


Replies (1)

RE: Interrupting transform - Added by Anonymous over 15 years ago

Legacy ID: #7492358 Legacy Poster: Michael Kay (mhkay)

No, there's no standard or recommended way to do this, you'll have to devise your own. Some debugging environments use a TraceListener, but that significantly reduces performance because it disables a number of optimisations (also, if a long time is spent in path expressions searching a large document, there can be a significant time elapsed between calls). You can also intercept output written to the serializer or result tree, but again there can be a long time between calls.

    (1-1/1)

    Please register to reply