I have written a little external Java tool that does some auditing on the server logs. The issue is that sometimes, the views I am reading aren’t up-to-date and the tool blocks on the “View.createViewNav()” method. So basically it stalls on that code. Note I am not interested in fixing or updating the index on the view so “run Updall” isn’t the solution.What I would like to do is to either kill the thread reading the view or perhaps set a timeout on the method.
The initiation of the thread looks like this…
[
]private void processServer(final String server, final String fileName) {
if (worker == null || !worker.isAlive()) { worker = new NotesThread(new Runnable() { public void run() { try { cancelMenuItem.setEnabled(true); process(server, fileName); cancelMenuItem.setEnabled(false); } catch (InterruptedException e) { e.printStackTrace(); } catch (Exception e) { e.printStackTrace(); } } }); worker.start(); } else { JOptionPane.showMessageDialog(this, "Process already running"); }}
The createViewNav method is in the processServer(string,string) call. The (Notes)Session used in the processServer method is a class member originally initiated from a NotesThread.sinitThread context within the main thread. Only one worker can be running at a time.
I’ve tried issuing an interrupt to worker but it seems to have no effect. I can’t see a way to force the timeout without possibly creating a third thread just to create the ViewNav. But that involves it’s own problems.
I’ve also thread a termThread on worker but that threw some really nasty errors.
Any help is appreciated
Thanks
Zach Mabe