[Zope-Checkins] CVS: Zope3 - z3.py:1.1.2.18.2.1

Stephan Richter srichter@cbu.edu
Mon, 4 Mar 2002 01:11:09 -0500


Update of /cvs-repository/Zope3
In directory cvs.zope.org:/tmp/cvs-serv30860

Modified Files:
      Tag: srichter-OFS_Formulator-branch
	z3.py 
Log Message:
- Zope now starts two servers: HTTP (8080) and HTTP - XML-RPC (8081)


=== Zope3/z3.py 1.1.2.18 => 1.1.2.18.2.1 ===
+##############################################################################
+#
+# Copyright (c) 2001, 2002 Zope Corporation and Contributors.
+# All Rights Reserved.
 # 
 # This software is subject to the provisions of the Zope Public License,
-# Version 1.1 (ZPL).  A copy of the ZPL should accompany this distribution.
+# Version 2.0 (ZPL).  A copy of the ZPL should accompany this distribution.
 # THIS SOFTWARE IS PROVIDED "AS IS" AND ANY AND ALL EXPRESS OR IMPLIED
 # WARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 # WARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS
-# FOR A PARTICULAR PURPOSE.
+# FOR A PARTICULAR PURPOSE
+# 
+##############################################################################
+"""
+
+$Id$
+"""
 import sys, os, getopt, string
 
 sys.setcheckinterval(120)
@@ -15,17 +24,24 @@
 sys.path=[os.path.join(here,'lib','python'),
           here] + filter(None, sys.path)
 
-from Zope.Publisher.Browser.IBrowserPublisher import IBrowserPublisher
-from Zope.App.ZopePublication.ZopePublication import BrowserPublication
+
+from Zope.Server.PublisherServers import PublisherHTTPServer
+from Zope.App.ZopePublication.Browser.BrowserPublication import BrowserPublication
+from Zope.Publisher.Browser.BrowserPayload import BrowserRequestPayload, \
+     BrowserResponsePayload
+
+from Zope.Server.PublisherServers import PublisherXMLRPCServer
+from Zope.App.ZopePublication.XMLRPC.XMLRPCPublication import XMLRPCPublication
+from Zope.Publisher.XMLRPC.XMLRPCPayload import XMLRPCRequestPayload, \
+     XMLRPCResponsePayload
+
 from Zope.App.Security.SimpleSecurityPolicies import \
      PermissiveSecurityPolicy
 from Zope.App.Security.SecurityManager import setSecurityPolicy
-from Zope.Publisher.HTTP.BrowserPayload import BrowserRequestPayload, \
-     BrowserResponsePayload
 from Zope.App.OFS.Folder.RootFolder import RootFolder
 import asyncore, zLOG
+
 from Zope.Server import ZLogIntegration
-from Zope.Server.PublisherServers import PublisherHTTPServer
 from Zope.Server.TaskThreads import ThreadedTaskDispatcher
 from Zope.Server.HTTPServer import CommonHitLogger
 
@@ -60,16 +76,24 @@
 connection.close()
 
 
-publication = BrowserPublication(DB)
-request_payload = BrowserRequestPayload(publication)
-response_payload = BrowserResponsePayload()
-
 td = ThreadedTaskDispatcher()
 td.setThreadCount(4)
 
 hit_log = CommonHitLogger()
-PublisherHTTPServer(request_payload, response_payload,
+
+# Browser (HTML) Server
+browser_publication = BrowserPublication(DB)
+browser_request_payload = BrowserRequestPayload(browser_publication)
+browser_response_payload = BrowserResponsePayload()
+PublisherHTTPServer(browser_request_payload, browser_response_payload,
                     '', 8080, task_dispatcher=td, verbose=1, hit_log=hit_log)
+
+# XML-RPC Server
+xmlrpc_publication = XMLRPCPublication(DB)
+xmlrpc_request_payload = XMLRPCRequestPayload(xmlrpc_publication)
+xmlrpc_response_payload = XMLRPCResponsePayload()
+PublisherXMLRPCServer(xmlrpc_request_payload, xmlrpc_response_payload,
+                    '', 8081, task_dispatcher=td, verbose=1, hit_log=hit_log)
 
 try:
     asyncore.loop()