Home | Trees | Indices | Help |
|
---|
|
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 """Defines a servlet that connects a Muntjac Application to Web.""" 17 18 from muntjac.terminal.gwt.server.exceptions import ServletException 19 20 from muntjac.terminal.gwt.server.abstract_application_servlet import \ 21 AbstractApplicationServlet 22 2325 """This servlet connects a Muntjac Application to Web. 26 27 @author: Vaadin Ltd. 28 @author: Richard Lincoln 29 @version: 1.1.2 30 """ 3184 8533 super(ApplicationServlet, self).__init__(*args, **kw_args) 34 35 self._applicationClass = applicationClass36 37 38 # def awake(self, transaction): 39 # """Called by the servlet container to indicate to a servlet that 40 # the servlet is being placed into service. 41 # 42 # @param servletConfig 43 # the object containing the servlet's configuration and 44 # initialization parameters 45 # @raise javax.servlet.ServletException 46 # if an exception has occurred that interferes with the 47 # servlet's normal operation. 48 # """ 49 # super(ApplicationServlet, self).awake(transaction) 50 # 51 # 52 # # Loads the application class using the same class loader 53 # # as the servlet itself 54 # 55 # # Gets the application class name 56 # applicationClassName = CONFIG.get('application') 57 # if applicationClassName is None: 58 # raise ServletException, ('Application not specified ' 59 # 'in servlet parameters') 60 # 61 # try: 62 # self._applicationClass = loadClass(applicationClassName) 63 # except ImportError: 64 # raise ServletException, ('Failed to import module: ' 65 # + applicationClassName) 66 # except AttributeError: 67 # raise ServletException, ('Failed to load application class: ' 68 # + applicationClassName) 69 7072 # Creates a new application instance 73 try: 74 applicationClass = self.getApplicationClass() 75 application = applicationClass() 76 except TypeError: 77 raise ServletException, "getNewApplication failed" 78 79 return application80 818710289 super(SingletonApplicationServlet, self).__init__(*args, **kw_args) 90 self._applicationObject = applicationObject91 9294 if self._applicationObject is not None: 95 return self._applicationObject 96 else: 97 raise ServletException, "getNewApplication failed"98 99
Home | Trees | Indices | Help |
|
---|
Generated by Epydoc 3.0.1 on Fri Jun 5 20:45:10 2015 | http://epydoc.sourceforge.net |