test clientsFile handlers.
[vamsas.git] / src / org / vamsas / client / Events.java
index bf35fa0..fea1b79 100644 (file)
@@ -1,48 +1,68 @@
 package org.vamsas.client;
+
 /**
- * Enumerates the event types generated 
- * during the lifecycle of a Vamsas session.
+ * Enumerates the event types generated during the lifecycle of a Vamsas
+ * session.
  */
 
 public class Events {
   /**
-   * Generated when a client has finished updating the document. 
-   * Passes applicationHandle of client so the updating client can recognise its own updates.
+   * Generated when a client has finished updating the document. Passes
+   * applicationHandle of client so the updating client can recognise its own
+   * updates.
    */
-  public static final String DOCUMENT_UPDATE="org.vamsas.client.events.documentUpdateEvent";
+  public static final String DOCUMENT_UPDATE = "org.vamsas.client.events.documentUpdateEvent";
+
   /**
-   * Generated when a new vamsas document is created (perhaps from some existing Vamsas data)
-   * so an application may do its own data space initialization.
-   * TODO: decide if this is called when an app is connected to a stored session...
+   * Generated when a new vamsas document is created (perhaps from some existing
+   * Vamsas data) so an application may do its own data space initialization.
+   * TODO: decide if this is called when an app is connected to a stored
+   * session...
    */
-  public static final String DOCUMENT_CREATE="org.vamsas.client.events.documentCreateEvent";
+  public static final String DOCUMENT_CREATE = "org.vamsas.client.events.documentCreateEvent";
+
   /**
-   * Generated when a new vamsas client is attached to a session (Handle is passed)
-   * Note: the newly created client does not receive the event.
+   * Generated when a new vamsas client is attached to a session (Handle is
+   * passed) Note: the newly created client does not receive the event.
    */
-  public static final String CLIENT_CREATION="org.vamsas.client.events.clientCreateEvent";
+  public static final String CLIENT_CREATION = "org.vamsas.client.events.clientCreateEvent";
+
   /**
-   * Generated when a vamsas client leaves a session (Handle is passed to all others).
+   * Generated when a vamsas client leaves a session (Handle is passed to all
+   * others).
    */
-  public static final String CLIENT_FINALIZATION="org.vamsas.client.events.clientFinalizationEvent";
+  public static final String CLIENT_FINALIZATION = "org.vamsas.client.events.clientFinalizationEvent";
+
   /**
-   * Generated prior to session Shutdown, after the last participating vamsas client has finalized.
+   * Generated prior to session Shutdown, after the last participating vamsas
+   * client has finalized.
    */
-  public static final String SESSION_SHUTDOWN="org.vamsas.client.events.SessionShutdownEvent";
+  public static final String SESSION_SHUTDOWN = "org.vamsas.client.events.SessionShutdownEvent";
+
   /**
-   * Generated by Vorba stub after the penultimate client makes a call to closeDocument().
-   * Sequence is as follows :
-   *   1. All other vamsas clients have called closeDocument()
-   *   2. Final living client monitors closures, and realises that it is last.
-   *   3. Final client generates event to prompt associated application to inquire if 
-   *      the user wishes to save the document for future reference.
-   *    
-   * *         Any call to closeDocument in a thread other than the registered EventListener 
-   *    will block until the RequestToClose handler has exited.
-   *   
+   * Generated for all clients when any client calls IClient.storeDocument() to
+   * allow them to store any updates before an offline copy of the session is
+   * created. Any client that handles this should call the
+   * IClient.getDocument(), update and then IClient.updateDocument in the same
+   * handler thread.
    */
-  public static final String DOCUMENT_REQUESTTOCLOSE="org.vamas.client.DocumentRequestToCloseEvent"; 
+  public static final String DOCUMENT_FINALIZEAPPDATA = "org.vamsas.client.events.DocumentFinalizeAppData";
+
+  /**
+   * Generated by Vorba stub after the penultimate client makes a call to
+   * closeDocument(). Sequence is as follows : 1. All other vamsas clients have
+   * called closeDocument() 2. Final living client monitors closures, and
+   * realises that it is last. 3. Final client generates event to prompt
+   * associated application to inquire if the user wishes to save the document
+   * for future reference.
+   *  * Any call to closeDocument in a thread other than the registered
+   * EventListener will block until the RequestToClose handler has exited.
+   * 
+   */
+  public static final String DOCUMENT_REQUESTTOCLOSE = "org.vamas.client.DocumentRequestToCloseEvent";
+
   public static java.util.Vector EventList = initList();
+
   private static java.util.Vector initList() {
     java.util.Vector vec = new java.util.Vector();
     vec.add((Object) DOCUMENT_UPDATE);
@@ -51,6 +71,7 @@ public class Events {
     vec.add((Object) CLIENT_FINALIZATION);
     vec.add((Object) SESSION_SHUTDOWN);
     vec.add((Object) DOCUMENT_REQUESTTOCLOSE);
+    vec.add((Object) DOCUMENT_FINALIZEAPPDATA);
     return vec;
   }
 }