diff idavoll/tap.py @ 176:17fc5dd77158

Move around service setup.
author Ralph Meijer <ralphm@ik.nu>
date Wed, 09 Apr 2008 13:15:39 +0000
parents 958e69630e52
children faf1c9bc2612
line wrap: on
line diff
--- a/idavoll/tap.py	Wed Apr 09 13:02:29 2008 +0000
+++ b/idavoll/tap.py	Wed Apr 09 13:15:39 2008 +0000
@@ -40,18 +40,7 @@
 def makeService(config):
     s = service.MultiService()
 
-    cs = Component(config["rhost"], int(config["rport"]),
-                   config["jid"], config["secret"])
-    cs.setServiceParent(s)
-
-    cs.factory.maxDelay = 900
-
-    if config["verbose"]:
-        cs.logTraffic = True
-
-    FallbackHandler().setHandlerParent(cs)
-    VersionHandler('Idavoll', __version__).setHandlerParent(cs)
-    DiscoHandler().setHandlerParent(cs)
+    # Create backend service with storage
 
     if config['backend'] == 'pgsql':
         from idavoll.pgsql_storage import Storage
@@ -67,6 +56,21 @@
     bs = BackendService(st)
     bs.setServiceParent(s)
 
+    # Set up XMPP server-side component with publish-subscribe capabilities
+
+    cs = Component(config["rhost"], int(config["rport"]),
+                   config["jid"], config["secret"])
+    cs.setServiceParent(s)
+
+    cs.factory.maxDelay = 900
+
+    if config["verbose"]:
+        cs.logTraffic = True
+
+    FallbackHandler().setHandlerParent(cs)
+    VersionHandler('Idavoll', __version__).setHandlerParent(cs)
+    DiscoHandler().setHandlerParent(cs)
+
     ps = IPubSubService(bs)
     ps.setHandlerParent(cs)
     ps.hideNodes = config["hide-nodes"]