X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;f=src%2Forg%2Fvamsas%2Ftest%2FExampleApplication.java;h=520f668a38e3980a4256e0cf7fdea5aaf8c703ce;hb=752df214324e7e5feabf2432c52ee33d43bedb49;hp=63dcefe28d362b46ef8395585970c58e3203e8d9;hpb=0a7df19ef8c0986def68408789bf8b8e30230cf6;p=vamsas.git diff --git a/src/org/vamsas/test/ExampleApplication.java b/src/org/vamsas/test/ExampleApplication.java index 63dcefe..520f668 100644 --- a/src/org/vamsas/test/ExampleApplication.java +++ b/src/org/vamsas/test/ExampleApplication.java @@ -81,7 +81,15 @@ public class ExampleApplication { System.out.println("Session "+evt.getPropertyName()+" is shutting down."); // tell app to finalize its session data before shutdown. } - }); + }); + vorbaclient.addVorbaEventHandler(Events.DOCUMENT_FINALIZEAPPDATA, + new PropertyChangeListener() { + public void propertyChange(PropertyChangeEvent evt) { + System.out.println("Application received a DOCUMENT_FINALIZEAPPDATA event."); + // tell app to finalize its session data prior to the storage of the current session as an archive. + } + }); + } public static String Usage="ExampleApplication [+]\n" @@ -97,7 +105,7 @@ public class ExampleApplication { // get IClientFactory try { - clientfactory = new org.vamsas.client.SimpleClientFactory(args[0]); + clientfactory = new org.vamsas.client.simpleclient.SimpleClientFactory(args[0]); } catch (IOException e) { System.err.println(e+"\n"+Usage); System.exit(1); @@ -108,7 +116,14 @@ public class ExampleApplication { user = new UserHandle("arnolduser","deathsdoor"); vorbaclient = clientfactory.getIClient(app, user); addHandlers(vorbaclient); - vorbaclient.joinSession(); + try { + vorbaclient.joinSession(); + } + catch (Exception se) { + se.printStackTrace(); + System.err.println(se+" when joining session.\n"+Usage); + System.exit(1); + } // register an update listener and a close listener. // get document data processVamsasDocument(vorbaclient.getClientDocument());