M
Mullin
I have an applicatin that will create a new thread every time to do an
operation calling a third-party jar. Unfortunately, that 3rd party jar file
may hang and will not return any exception or error to my application.
Therefore, I want to kill that thread after a time-out period, say 5 minutes.
How can I implement this logic at my application?
My Main Application
===================
....
....
//new a thread to begin conversion
ConversionThread con = new ConversionThread(attachments);
Thread _thread = new Thread(con);
_thread.start();
....
....
ConversionThread
=================
// encapculate the conversion logic, calling a 3rd party java class
public class ConversionThread implements Runnable {
...
...
//calling 3rd party java class, but may hang
...
...
}
operation calling a third-party jar. Unfortunately, that 3rd party jar file
may hang and will not return any exception or error to my application.
Therefore, I want to kill that thread after a time-out period, say 5 minutes.
How can I implement this logic at my application?
My Main Application
===================
....
....
//new a thread to begin conversion
ConversionThread con = new ConversionThread(attachments);
Thread _thread = new Thread(con);
_thread.start();
....
....
ConversionThread
=================
// encapculate the conversion logic, calling a 3rd party java class
public class ConversionThread implements Runnable {
...
...
//calling 3rd party java class, but may hang
...
...
}