WebKit.Servlet | index /usr/local/share/webware/WebKit/Servlet.py

`Abstract servlets`

Modules

``

os |  |  |

Classes

``

__builtin__.object
  Servlet

class Servlet(__builtin__.object)

``

`A general servlet.
A servlet is a key portion of a server-based application that implements
the semantics of a particular request by providing a response.
This abstract class defines servlets at a very high level.
Most often, developers will subclass HTTPServlet or even Page.
Servlets can be created once, then used and destroyed, or they may be
reused several times over (it's up to the server). Therefore, servlet
developers should take the proper actions in awake() and sleep()
so that reuse can occur.
Objects that participate in a transaction include:
* Application
* Request
* Transaction
* Session
* Servlet
* Response
The awake(), respond() and sleep() methods form a message sandwich.
Each is passed an instance of Transaction which gives further access
to all the objects involved.
`

Methods defined here:

__init__(self)
  `Subclasses must invoke super.`

awake(self, trans)
  `Send the awake message.
  This message is sent to all objects that participate in the
  request-response cycle in a top-down fashion, prior to respond().
  Subclasses must invoke super.`

close(self)

log(self, message)
  `Log a message.
  This can be invoked to print messages concerning the servlet.
  This is often used by self to relay important information back
  to developers.`

name(self)
  `Return the name which is simple the name of the class.
  Subclasses should *not* override this method.
  It is used for logging and debugging.`

open(self)

respond(self, trans)
  `Respond to a request.`

runMethodForTransaction(self, trans, method, *args, **kw)

serverSidePath(self, path=None)
  `Return the filesystem path of the page on the server.`

setFactory(self, factory)

sleep(self, trans)
  `Send the sleep message.`

Static methods defined here:

canBeReused()
  `Returns whether a single servlet instance can be reused.
  The default is True, but subclasses con override to return False.
  Keep in mind that performance may seriously be degraded if instances
  can't be reused. Also, there's no known good reasons not to reuse
  an instance. Remember the awake() and sleep() methods are invoked
  for every transaction. But just in case, your servlet can refuse
  to be reused.`

canBeThreaded()
  `Return whether the servlet can be multithreaded.
  This value should not change during the lifetime of the object.
  The default implementation returns False.
  Note: This is not currently used.`

runTransaction(trans)

Data descriptors defined here:

__dict__
  `dictionary for instance variables (if defined)`

__weakref__
  `list of weak references to the object (if defined)`