Package muntjac :: Package terminal :: Package gwt :: Package server :: Module http_servlet_request_listener
[hide private]
[frames] | no frames]

Source Code for Module muntjac.terminal.gwt.server.http_servlet_request_listener

 1  # Copyright (C) 2012 Vaadin Ltd.  
 2  # Copyright (C) 2012 Richard Lincoln 
 3  #  
 4  # Licensed under the Apache License, Version 2.0 (the "License");  
 5  # you may not use this file except in compliance with the License.  
 6  # You may obtain a copy of the License at  
 7  #  
 8  #     http://www.apache.org/licenses/LICENSE-2.0  
 9  #  
10  # Unless required by applicable law or agreed to in writing, software  
11  # distributed under the License is distributed on an "AS IS" BASIS,  
12  # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.  
13  # See the License for the specific language governing permissions and  
14  # limitations under the License. 
15   
16  """Request start and end listener""" 
17   
18   
19 -class IHttpServletRequestListener(object):
20 """L{Application} that implements this interface gets notified 21 of request start and end by terminal. 22 23 Interface can be used for several helper tasks including: 24 25 - Opening and closing database connections 26 - Implementing L{ThreadLocal} 27 - Setting/Getting L{Cookie} 28 29 Alternatives for implementing similar features are are Servlet 30 L{Filter}s and L{TransactionListener}s in Muntjac. 31 """ 32
33 - def onRequestStart(self, request, response):
34 """This method is called before L{Terminal} applies the 35 request to Application. 36 """ 37 raise NotImplementedError
38 39
40 - def onRequestEnd(self, request, response):
41 """This method is called at the end of each request. 42 """ 43 raise NotImplementedError
44