From: jprocter Date: Mon, 5 Nov 2007 16:17:14 +0000 (+0000) Subject: requesttoclose event is raised if session modified flag is set. X-Git-Tag: Release_0.2~35 X-Git-Url: http://source.jalview.org/gitweb/?a=commitdiff_plain;h=dd0190e5fa9f955180ba7a00482829ec51c24ebc;p=vamsas.git requesttoclose event is raised if session modified flag is set. git-svn-id: https://svn.lifesci.dundee.ac.uk/svn/repository/trunk@485 be28352e-c001-0410-b1a7-c7978e42abec --- diff --git a/src/uk/ac/vamsas/client/simpleclient/VamsasSession.java b/src/uk/ac/vamsas/client/simpleclient/VamsasSession.java index a000f46..87e904a 100644 --- a/src/uk/ac/vamsas/client/simpleclient/VamsasSession.java +++ b/src/uk/ac/vamsas/client/simpleclient/VamsasSession.java @@ -611,10 +611,15 @@ public class VamsasSession { client.evgen._raise(Events.DOCUMENT_FINALIZEAPPDATA, null, client, null); boolean closeSession = isLastActiveClient(client); if (closeSession) { - log.debug("Raising request-to-save event"); - client.evgen._raise(Events.DOCUMENT_REQUESTTOCLOSE, null, client, null); + if (client.get_session().getUnsavedFlag()) + { + log.debug("Raising request-to-save event"); + client.evgen._raise(Events.DOCUMENT_REQUESTTOCLOSE, null, client, null); + } + log.debug("Raising session shutdown event"); client.evgen._raise(Events.SESSION_SHUTDOWN, null, client .getSessionHandle(), null); + log.debug("All events raised for finalising session "+client.getSessionHandle().toString()); } // cwe.haltWatch(); client.evgen.stopWatching(); @@ -791,7 +796,7 @@ public class VamsasSession { // {//no client has registered as active if (islastClient) { // the client is the last one, so close current session - log.info("last client removed: closing session"); + log.info("FROMCLIENTLIST WATCHER: last client removed: closing session"); closeSession(client); } } else {