From 348ef9d3339cdd7014e93bbdc1597a77864b5539 Mon Sep 17 00:00:00 2001 From: jprocter Date: Mon, 19 Mar 2007 13:26:04 +0000 Subject: [PATCH] trap exceptions during session events and ensure pick messages are blocked whilst document changed events occur git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@366 be28352e-c001-0410-b1a7-c7978e42abec --- .../ac/vamsas/client/simpleclient/EventGeneratorThread.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/uk/ac/vamsas/client/simpleclient/EventGeneratorThread.java b/src/uk/ac/vamsas/client/simpleclient/EventGeneratorThread.java index ded388f..1d1cf09 100644 --- a/src/uk/ac/vamsas/client/simpleclient/EventGeneratorThread.java +++ b/src/uk/ac/vamsas/client/simpleclient/EventGeneratorThread.java @@ -87,7 +87,11 @@ public class EventGeneratorThread { PropertyChangeSupport h = (PropertyChangeSupport) handlers.get(handlerEvent); if (h!=null) { log.debug("Triggering:"+handlerEvent); - h.firePropertyChange(property, oldval, newval); + try { + h.firePropertyChange(property, oldval, newval); + } catch (Exception e) { + log.warn("Client Exception during handling of "+handlerEvent, e); + } log.debug("Finished :"+handlerEvent); } else log.debug("No handlers for raised "+handlerEvent); @@ -109,8 +113,12 @@ public class EventGeneratorThread { boolean continueWatching=true; if (!block_document_updates) { session.vamArchive.fileLock=doclock; + if (client.pickmanager!=null) + client.pickmanager.setPassThru(false); // TODO: decide if individual object update handlers are called as well as overall event handler _raise(Events.DOCUMENT_UPDATE, client.getSessionUrn(), null, client); + if (client.pickmanager!=null) + client.pickmanager.setPassThru(true); if (log.isDebugEnabled()) { log.debug("Finished handling a documentChanged event. Document is "+(client.cdocument==null ? "closed" : "open")); } -- 1.7.10.2