equality based on the ids of the contents of SingleRouterConfig.
[xmlrouter] / impl / src / main / java / org / wamblee / xmlrouter / impl / XMLRouterConfiguration.java
index 51c8cc7b257074f259798150cf51bc674630fe05..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,12 +50,11 @@ public interface XMLRouterConfiguration {
     void endPublishEvent();
 
     /**
-     * @return Configuration data.
-     */
-    ExtendedRouterConfig routerConfig();
-
-    /**
-     * @return Transformation paths (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.
      */
-    TransformationPaths transformations();
+    void setRouterConfig(ExtendedRouterConfig aConfig);
 }