XML router now uses config object passed in through constructor.
[xmlrouter] / impl / src / main / java / org / wamblee / xmlrouter / impl / XMLRouter.java
index ca0637b43353708b0c0b9410e5eda9577ef861d5..d74c93d09f20a99e09c57480952822c2a1ac4a4c 100644 (file)
@@ -31,10 +31,8 @@ import javax.xml.transform.dom.DOMSource;
 import org.wamblee.general.Clock;
 import org.wamblee.xml.XMLDocument;
 import org.wamblee.xmlrouter.common.Id;
-import org.wamblee.xmlrouter.config.Config;
 import org.wamblee.xmlrouter.config.DocumentType;
 import org.wamblee.xmlrouter.config.Filter;
-import org.wamblee.xmlrouter.config.RouterConfig;
 import org.wamblee.xmlrouter.config.Transformation;
 import org.wamblee.xmlrouter.listener.EventInfo;
 import org.wamblee.xmlrouter.listener.EventListener;
@@ -48,7 +46,7 @@ import org.wamblee.xmlrouter.subscribe.DestinationRegistry;
  * @author Erik Brakkee
  * 
  */
-public class XMLRouter implements RouterConfig, Gateway, DestinationRegistry {
+public class XMLRouter implements Gateway, DestinationRegistry {
 
     private static final Logger LOGGER = Logger.getLogger(XMLRouter.class
         .getName());
@@ -63,31 +61,17 @@ public class XMLRouter implements RouterConfig, Gateway, DestinationRegistry {
 
     private Map<Id<Destination>, Destination> destinations;
 
-    public XMLRouter(Clock aClock, EventListener aListener) {
+    public XMLRouter(Clock aClock, ExtendedRouterConfig aRouterConfig,
+        EventListener aListener) {
         sequenceNumbers = new AtomicLong(1);
         listener = aListener;
         clock = aClock;
         nextEventId = new AtomicLong(clock.currentTimeMillis());
-        routerConfig = new SingleRouterConfig(sequenceNumbers);
+        routerConfig = aRouterConfig;
         transformations = new TransformationPaths();
         destinations = new LinkedHashMap<Id<Destination>, Destination>();
     }
 
-    @Override
-    public Config<DocumentType> documentTypeConfig() {
-        return routerConfig.documentTypeConfig();
-    }
-
-    @Override
-    public Config<Transformation> transformationConfig() {
-        return routerConfig.transformationConfig();
-    }
-
-    @Override
-    public Config<Filter> filterConfig() {
-        return routerConfig.filterConfig();
-    }
-
     @Override
     public void publish(String aSource, DOMSource aEvent) {
         long time = clock.currentTimeMillis();