I have a screen that shows an active jobs running as a result of the
TurbineScheduledJob service running them. I have an action as a result of
that screen that returns a list of active jobs I want to terminate. It seems
the best way to do this in Java is Thread.interrupt() them.

So in my action class I have the following code:

                    if(je.isActive()) {

if(aData.getParameters().getString(aSchedule.getScheduleName()) != null) {
                            ScheduledJob
runningjob=ScheduledJobLoader.getInstance().getInstance(je.getTask());
                            // How do I get the Thread that this job is
running in so I can call interrupt()?
                        }
                    }

The job itself has been modified so that the main loop where it does it's
work has:

          try
        {   while( !Thread.interrupted() )
            {
                // Do your work
            }
        }
        catch( InterruptedException e ){/*terminate thread by returning*/}

Any ideas on this or a different way of doing it?

Thanks

David Wynter
Director
roamware Ltd.
(+44) (0) 208 922 7539 B.
(+44) (0) 7879 605 706 M.
[EMAIL PROTECTED]


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to