Java Doc for MMBaseServlet.java in  » Database-ORM » MMBase » org » mmbase » servlet » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Database ORM » MMBase » org.mmbase.servlet 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.servlet.http.HttpServlet
   org.mmbase.servlet.MMBaseServlet

All known Subclasses:   org.mmbase.servlet.BridgeServlet,
MMBaseServlet
public class MMBaseServlet extends HttpServlet implements MMBaseStarter(Code)
MMBaseServlet is a base class for other MMBase servlets (like ImageServlet). Its main goal is to store a MMBase instance for all its descendants, but it can also be used as a serlvet itself, to show MMBase version information.
version:
   $Id: MMBaseServlet.java,v 1.71 2007/11/28 17:10:04 michiel Exp $
author:
   Michiel Meeuwissen
since:
   MMBase-1.6


Field Summary
protected  MMBasemmbase
     MMBase reference.
protected  intretryAfter
     If MMBase has not been started, a 503 is given, with this value for the 'Retry-After' header.


Method Summary
protected static synchronized  voidassociateMapping(String function, String servletMapping, Integer priority)
     Associate a given servletmapping with the given function.
protected  booleancheckInited(HttpServletResponse res)
     This methods can be (and is) called in the beginning of service.
protected  voiddecRefCount(HttpServletRequest req)
    
public  voiddestroy()
    
protected  voiddoGet(HttpServletRequest req, HttpServletResponse res)
     Serves MMBase version information.
protected  Map<String, Integer>getAssociations()
     On default, servlets are not associated with any function. This function is called in the init method. A map of Strings (function) -> Integer (priority).
public static  StringgetBasePath(String function)
    
public  MMBasegetMMBase()
     Returns the MMBase instance.
protected static  StringgetRequestURL(HttpServletRequest req)
    
public static  StringgetServletByAssociation(String function)
     Gets the name of the servlet that performs actions associated with the the given function.
public static  HttpServletgetServletByMapping(String mapping)
    
public  StringgetServletInfo()
     Returns information about this servlet.
public static  List<String>getServletMappings(String servletName)
     Gets all the mappings for a given servlet.
public static  List<String>getServletMappingsByAssociation(String function)
     Gets all the mappings for a given association.
protected  voidincRefCount(HttpServletRequest req)
    
public  voidinit()
     The init of an MMBaseServlet checks if MMBase is running.
public  voidservice(HttpServletRequest req, HttpServletResponse res)
     The service method is extended with calls for the refCount functionality (for performance related debugging).
public  voidsetInitException(ServletException e)
     Called by MMBaseStartThread, if something went wrong during initialization of MMBase.
public  voidsetMMBase(MMBase mmb)
     Sets the mmbase member.

Field Detail
mmbase
protected MMBase mmbase(Code)
MMBase reference. While null, servlet does not accept request.



retryAfter
protected int retryAfter(Code)
If MMBase has not been started, a 503 is given, with this value for the 'Retry-After' header. See rfc 2616, section 10.5.4. Defaults to 60 seconds, can be configured in web.xml with the 'retry-after' propery on the servlets.
since:
   MMBase-1.7.2





Method Detail
associateMapping
protected static synchronized void associateMapping(String function, String servletMapping, Integer priority)(Code)
Associate a given servletmapping with the given function. Use this to set a servletmapping to call for a certain type of operation or data (i.e 'image-processing'); For now, only one servletmapping can be registered.
Parameters:
  function - the function that identifies the type of association
Parameters:
  servletMapping - mapping of the servlet to associate with the function
Parameters:
  priority - priority of this association, the association only occurs if no servlet or servletmappingwith higher priority for the same function is present already



checkInited
protected boolean checkInited(HttpServletResponse res) throws ServletException, IOException(Code)
This methods can be (and is) called in the beginning of service. It sends an UNAVAILABLE error if MMBase has not bee started, or throws an exeption if that was unsuccessful. A boolean. If false, then service must return immediately (because mmbase has not been inited yet).
since:
   MMBase-1.7.2



decRefCount
protected void decRefCount(HttpServletRequest req)(Code)
Decrease the reference count of the servlet
Parameters:
  req - The HttpServletRequest.



destroy
public void destroy()(Code)



doGet
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException(Code)
Serves MMBase version information. This doesn't do much usefull yet, but one could image lots of cool stuff here. Any other MMBase servlet will probably override this method.



getAssociations
protected Map<String, Integer> getAssociations()(Code)
On default, servlets are not associated with any function. This function is called in the init method. A map of Strings (function) -> Integer (priority). Never null.



getBasePath
public static String getBasePath(String function)(Code)

since:
   MMBase-1.8.5



getMMBase
public MMBase getMMBase()(Code)
Returns the MMBase instance.
since:
   MMBase-1.7



getRequestURL
protected static String getRequestURL(HttpServletRequest req)(Code)
Return URI with QueryString appended
Parameters:
  req - The HttpServletRequest.



getServletByAssociation
public static String getServletByAssociation(String function)(Code)
Gets the name of the servlet that performs actions associated with the the given function. Use this to find a servlet to handle a certain type of operation or data (i.e 'imageservlet', 'myimageservlet', 'images');
Parameters:
  function - the function that identifies the type of association the name of the servlet associated with the function, or null if there is none



getServletByMapping
public static HttpServlet getServletByMapping(String mapping)(Code)
Gets the servlet that belongs to the given mapping
Parameters:
  mapping - the mapping used to access the servlet the Servlet that handles the mapping



getServletInfo
public String getServletInfo()(Code)
Returns information about this servlet. Don't forget to override it.



getServletMappings
public static List<String> getServletMappings(String servletName)(Code)
Gets all the mappings for a given servlet. So, this is a method to obtain info from web.xml.
Parameters:
  servletName - the name of the servlet an unmodifiable list of servlet mappings for this servlet



getServletMappingsByAssociation
public static List<String> getServletMappingsByAssociation(String function)(Code)
Gets all the mappings for a given association. Use this to find out how to call a servlet to handle a certain type of operation or data (i.e 'images', 'attachments').
Parameters:
  function - the function that identifies the type of association an unmodifiable list of servlet mappings associated with the function



incRefCount
protected void incRefCount(HttpServletRequest req)(Code)
Increase the reference count of the servlet (for debugging) and send running servlets to log once every 32 requests
Parameters:
  req - The HttpServletRequest.



init
public void init() throws ServletException(Code)
The init of an MMBaseServlet checks if MMBase is running. It not then it is started.



service
public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException(Code)
The service method is extended with calls for the refCount functionality (for performance related debugging). So you can simply override doGet in extension classes, and this stays working, without having to think about it.



setInitException
public void setInitException(ServletException e)(Code)
Called by MMBaseStartThread, if something went wrong during initialization of MMBase. It will be thrown by checkInited then.
since:
   MMBase-1.7



setMMBase
public void setMMBase(MMBase mmb)(Code)
Sets the mmbase member. Can be overriden to implement extra initalization for the servlet which needs a running MMBase.
since:
   MMBase-1.7



Methods inherited from javax.servlet.http.HttpServlet
protected void doDelete(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doHead(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doOptions(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doPut(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected void doTrace(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
protected long getLastModified(HttpServletRequest req)(Code)(Java Doc)
protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException(Code)(Java Doc)
public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.