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

`The Transaction container.`

Modules
`` |  |
sys | traceback |  |

Classes
`` |  | __builtin__.object Transaction
class Transaction(__builtin__.object)
`` | `The Transaction container. A transaction serves as: * A container for all objects involved in the transaction. The objects include application, request, response, session and servlet. * A message dissemination point. The messages include awake(), respond() and sleep(). When first created, a transaction has no session. However, it will create or retrieve one upon being asked for session(). The life cycle of a transaction begins and ends with Application's dispatchRequest().`
| Methods defined here: __init__(self, application, request=None) __repr__(self) application(self) `Get the corresponding application.` awake(self) `Send awake() to the session (if there is one) and the servlet. Currently, the request and response do not partake in the awake()-respond()-sleep() cycle. This could definitely be added in the future if any use was demonstrated for it.` die(self) `End transaction. This method should be invoked when the entire transaction is finished with. Currently, this is invoked by AppServer. This method removes references to the different objects in the transaction, breaking cyclic reference chains and speeding up garbage collection.` dump(self, file=None) `Dump debugging info to stdout.` duration(self) `Return the duration, in seconds, of the transaction. This is basically the response end time minus the request start time.` error(self) `Return Exception instance if there was any.` errorOccurred(self) `Check whether a server error occured.` hasSession(self) `Return true if the transaction has a session.` request(self) `Get the corresponding request.` respond(self) `Respond to the request.` response(self) `Get the corresponding response.` servlet(self) `Return the current servlet that is processing. Remember that servlets can be nested.` session(self) `Return the session for the transaction. A new transaction is created if necessary. Therefore, this method never returns None. Use hasSession() if you want to find out if a session already exists.` setError(self, err) `Set Exception instance. Invoked by the application if an Exception is raised to the application level.` setResponse(self, response) `Set the corresponding response.` setServlet(self, servlet) `Set the servlet for processing the transaction.` setSession(self, session) `Set the session for the transaction.` sleep(self) `Send sleep() to the session and the servlet. Note that sleep() is sent in reverse order as awake() (which is typical for shutdown/cleanup methods).` writeExceptionReport(self, handler) `Write extra information to the exception report.` Data descriptors defined here: __dict__ `dictionary for instance variables (if defined)` __weakref__ `list of weak references to the object (if defined)`