Back to index

moin  1.9.0~rc2
Public Member Functions
MoinMoin.support.flup.server.ajp_fork.WSGIServer Class Reference
Inheritance diagram for MoinMoin.support.flup.server.ajp_fork.WSGIServer:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.flup.server.ajp_fork.WSGIServer:
Collaboration graph
[legend]

List of all members.

Public Member Functions

def __init__
def run

Detailed Description

AJP1.3/WSGI server. Runs your WSGI application as a persistant program
that understands AJP1.3. Opens up a TCP socket, binds it, and then
waits for forwarded requests from your webserver.

Why AJP? Two good reasons are that AJP provides load-balancing and
fail-over support. Personally, I just wanted something new to
implement. :)

Of course you will need an AJP1.3 connector for your webserver (e.g.
mod_jk) - see http://jakarta.apache.org/tomcat/connectors-doc/.

Definition at line 96 of file ajp_fork.py.


Constructor & Destructor Documentation

def MoinMoin.support.flup.server.ajp_fork.WSGIServer.__init__ (   self,
  application,
  scriptName = '',
  environ = None,
  bindAddress = ('localhost', 8009,
  allowedServers = None,
  loggingLevel = logging.INFO,
  debug = False,
  kw 
)
scriptName is the initial portion of the URL path that "belongs"
to your application. It is used to determine PATH_INFO (which doesn't
seem to be passed in). An empty scriptName means your application
is mounted at the root of your virtual host.

environ, which must be a dictionary, can contain any additional
environment variables you want to pass to your application.

bindAddress is the address to bind to, which must be a tuple of
length 2. The first element is a string, which is the host name
or IPv4 address of a local interface. The 2nd element is the port
number.

allowedServers must be None or a list of strings representing the
IPv4 addresses of servers allowed to connect. None means accept
connections from anywhere.

loggingLevel sets the logging level of the module-level logger.

Definition at line 111 of file ajp_fork.py.

00111 
00112                  loggingLevel=logging.INFO, debug=False, **kw):
00113         """
00114         scriptName is the initial portion of the URL path that "belongs"
00115         to your application. It is used to determine PATH_INFO (which doesn't
00116         seem to be passed in). An empty scriptName means your application
00117         is mounted at the root of your virtual host.
00118 
00119         environ, which must be a dictionary, can contain any additional
00120         environment variables you want to pass to your application.
00121 
00122         bindAddress is the address to bind to, which must be a tuple of
00123         length 2. The first element is a string, which is the host name
00124         or IPv4 address of a local interface. The 2nd element is the port
00125         number.
00126 
00127         allowedServers must be None or a list of strings representing the
00128         IPv4 addresses of servers allowed to connect. None means accept
00129         connections from anywhere.
00130 
00131         loggingLevel sets the logging level of the module-level logger.
00132         """
00133         BaseAJPServer.__init__(self, application,
00134                                scriptName=scriptName,
00135                                environ=environ,
00136                                multithreaded=False,
00137                                multiprocess=True,
00138                                bindAddress=bindAddress,
00139                                allowedServers=allowedServers,
00140                                loggingLevel=loggingLevel,
00141                                debug=debug)
00142         for key in ('multithreaded', 'multiprocess', 'jobClass', 'jobArgs'):
00143             if kw.has_key(key):
00144                 del kw[key]
00145         PreforkServer.__init__(self, jobClass=Connection, jobArgs=(self,), **kw)


Member Function Documentation

Main loop. Call this after instantiating WSGIServer. SIGHUP, SIGINT,
SIGQUIT, SIGTERM cause it to cleanup and return. (If a SIGHUP
is caught, this method returns True. Returns False otherwise.)

Definition at line 146 of file ajp_fork.py.

00146 
00147     def run(self):
00148         """
00149         Main loop. Call this after instantiating WSGIServer. SIGHUP, SIGINT,
00150         SIGQUIT, SIGTERM cause it to cleanup and return. (If a SIGHUP
00151         is caught, this method returns True. Returns False otherwise.)
00152         """
00153         self.logger.info('%s starting up', self.__class__.__name__)
00154 
00155         try:
00156             sock = self._setupSocket()
00157         except socket.error, e:
00158             self.logger.error('Failed to bind socket (%s), exiting', e[1])
00159             return False
00160 
00161         ret = PreforkServer.run(self, sock)
00162 
00163         self._cleanupSocket(sock)
00164 
00165         self.logger.info('%s shutting down%s', self.__class__.__name__,
00166                          self._hupReceived and ' (reload requested)' or '')
00167 
00168         return ret

Here is the call graph for this function:


The documentation for this class was generated from the following file: