Back to index

moin  1.9.0~rc2
Public Member Functions
MoinMoin.support.flup.server.ajp.WSGIServer Class Reference
Inheritance diagram for MoinMoin.support.flup.server.ajp.WSGIServer:
Inheritance graph
[legend]
Collaboration diagram for MoinMoin.support.flup.server.ajp.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.py.


Constructor & Destructor Documentation

def MoinMoin.support.flup.server.ajp.WSGIServer.__init__ (   self,
  application,
  scriptName = '',
  environ = None,
  multithreaded = True,
  multiprocess = False,
  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 112 of file ajp.py.

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

00148 
00149     def run(self):
00150         """
00151         Main loop. Call this after instantiating WSGIServer. SIGHUP, SIGINT,
00152         SIGQUIT, SIGTERM cause it to cleanup and return. (If a SIGHUP
00153         is caught, this method returns True. Returns False otherwise.)
00154         """
00155         self.logger.info('%s starting up', self.__class__.__name__)
00156 
00157         try:
00158             sock = self._setupSocket()
00159         except socket.error, e:
00160             self.logger.error('Failed to bind socket (%s), exiting', e[1])
00161             return False
00162 
00163         ret = ThreadedServer.run(self, sock)
00164 
00165         self._cleanupSocket(sock)
00166         # AJP connections are more or less persistent. .shutdown() will
00167         # not return until the web server lets go. So don't bother calling
00168         # it...
00169         #self.shutdown()
00170 
00171         self.logger.info('%s shutting down%s', self.__class__.__name__,
00172                          self._hupReceived and ' (reload requested)' or '')
00173 
00174         return ret

Here is the call graph for this function:


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