Reduced the time during which the configuration is locked. Computation of paths now...
[xmlrouter] / impl / src / main / java / org / wamblee / xmlrouter / impl / XMLRouterConfiguration.java
index 25ae3313151cb70d2a7f6684ab231ce704f3e93a..a57a84569e8092f044878f422a466018d2887291 100644 (file)
@@ -27,22 +27,21 @@ package org.wamblee.xmlrouter.impl;
 public interface XMLRouterConfiguration {
 
     /**
-     * To be called before the configuration is updated. Corresponds to write
-     * lock acquire.
+     * To be called before the configuration is used. Corresponds to read lock
+     * acquire.
      */
-    void startConfigurationChange();
+    void startPublishEvent();
 
     /**
-     * To be called after the configuration is updated. Corresponds to write
-     * lock acquire.
+     * @return Configuration data. {@link #startPublishEvent()} must have been
+     *         called before doing this.
      */
-    void endConfigurationChange();
+    ExtendedRouterConfig getRouterConfig();
 
     /**
-     * To be called before the configuration is used. Corresponds to read lock
-     * acquire.
+     * @return Transformation paths (derived data).
      */
-    void startPublishEvent();
+    TransformationPaths getTransformations();
 
     /**
      * To be called after the configuration is used. Corresponds to read lock
@@ -51,20 +50,11 @@ public interface XMLRouterConfiguration {
     void endPublishEvent();
 
     /**
-     * @return Configuration data.
-     */
-    ExtendedRouterConfig getRouterConfig();
-
-    /**
-     * Sets the configuration and updates derived data.
+     * Atomically sets the configuration and updates derived data. There will be
+     * a short time during which read attempts will fail.
      * 
      * @param aConfig
      *            Configuration to set.
      */
     void setRouterConfig(ExtendedRouterConfig aConfig);
-
-    /**
-     * @return Transformation paths (derived data).
-     */
-    TransformationPaths getTransformations();
 }