Java Doc for BridgeServlet.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
      org.mmbase.servlet.BridgeServlet

All known Subclasses:   org.mmbase.servlet.Performance,
BridgeServlet
abstract public class BridgeServlet extends MMBaseServlet (Code)
BridgeServlet is an MMBaseServlet with a bridge Cloud in it. Extending from this makes it easy to implement servlet implemented with the MMBase bridge interfaces. An advantage of this is that security is used, which means that you cannot unintentionly serve content to the whole world which should actually be protected by the security mechanism. Another advantage is that implementation using the bridge is easier/clearer. The query of a bridge servlet can possible start with session= in which case the cloud is taken from that session attribute with that name. Otherewise 'cloud_mmbase' is supposed. All this is only done if there was a session active at all. If not, or the session variable was not found, that an anonymous cloud is used. Object can only be accessed by alias if a mapping on query string is used (so not e.g. /images/*, but /img.db). Normally this is no problem, because the alias is resolved by the image-tag. But if for some reason you need aliases to be working on the URL, you must map to URL's with a question mark.
version:
   $Id: BridgeServlet.java,v 1.33 2007/02/10 16:22:37 nklasens Exp $
author:
   Michiel Meeuwissen
since:
   MMBase-1.6

Inner Class :final public static class QueryParts

Field Summary
final public static  PatternFILE_PATTERN
     Pattern used for the 'filename' part of the request.
final public static  StringMESSAGE_ATTRIBUTE
    


Method Summary
protected  NodedesperatelyGetNode(Cloud cloud, String nodeIdentifier)
     Extensions can override this, to produce a node, even if cloud.hasNode failed.
protected  CloudfindCloud(Cloud c, String nodeNumber, QueryParts query)
     Tries to find a Cloud which can read the given node.
final protected  CloudgetAnonymousCloud()
     Obtains an 'anonymous' cloud.
protected  CloudgetClassCloud()
     Obtains a cloud using 'class' security.
final protected  CloudgetCloud(QueryParts qp)
     Obtains a cloud object, using a QueryParts object.
protected  StringgetCloudName()
     The name of the mmbase cloud which must be used.
protected  longgetLastModified(HttpServletRequest req)
     The idea is that a 'bridge servlet' on default serves 'nodes', and that there could be defined a 'last modified' time for nodes.
final protected  NodegetNode(QueryParts query)
     Servlets would often need a node.
protected  NodegetServedNode(QueryParts qp, Node node)
     If the node associated with the resonse is another node then the node associated with the request.\ (E.g.
public  voidinit()
     Inits lastmodifiedField.
public static  voidmain(String[] argv)
    
protected  QueryPartsreadQuery(HttpServletRequest req, HttpServletResponse res)
     Creates a QueryParts object which wraps request and response and the parse result of them.
public static  QueryPartsreadQuery(String query)
    
public static  QueryPartsreadServletPath(String servletPath)
    

Field Detail
FILE_PATTERN
final public static Pattern FILE_PATTERN(Code)
Pattern used for the 'filename' part of the request. The a node-identifying string may be present in it, and it the one capturing group. It is a digit optionially followed by +.* (used in ImageServlet for url-triggered icache production)



MESSAGE_ATTRIBUTE
final public static String MESSAGE_ATTRIBUTE(Code)





Method Detail
desperatelyGetNode
protected Node desperatelyGetNode(Cloud cloud, String nodeIdentifier)(Code)
Extensions can override this, to produce a node, even if cloud.hasNode failed. ('title aliases' e.g.).
since:
   MMBase-1.7.5



findCloud
protected Cloud findCloud(Cloud c, String nodeNumber, QueryParts query) throws IOException(Code)
Tries to find a Cloud which can read the given node.
since:
   MMBase-1.8



getAnonymousCloud
final protected Cloud getAnonymousCloud()(Code)
Obtains an 'anonymous' cloud.



getClassCloud
protected Cloud getClassCloud()(Code)
Obtains a cloud using 'class' security. If e.g. you authorize org.mmbase.servlet.ImageServlet by class-security for read all rights, it will be used.
since:
   MMBase-1.8



getCloud
final protected Cloud getCloud(QueryParts qp) throws IOException(Code)
Obtains a cloud object, using a QueryParts object. A Cloud or null if unsuccessful (this may not be fatal).



getCloudName
protected String getCloudName()(Code)
The name of the mmbase cloud which must be used. At the moment this is not supported (every mmbase cloud is called 'mmbase').



getLastModified
protected long getLastModified(HttpServletRequest req)(Code)
The idea is that a 'bridge servlet' on default serves 'nodes', and that there could be defined a 'last modified' time for nodes. This can't be determined right now, so 'now' is returned. This function is defined in HttpServlet



getNode
final protected Node getNode(QueryParts query) throws IOException(Code)
Servlets would often need a node. This function provides it.
Parameters:
  query - A QueryParts object, which you must have obtained by BridgeServlet.readQuery



getServedNode
protected Node getServedNode(QueryParts qp, Node node) throws IOException(Code)
If the node associated with the resonse is another node then the node associated with the request.\ (E.g. a icache based on a url with an image node).
Parameters:
  qp - A QueryParts object, which you must have obtained by BridgeServlet.readQuery
Parameters:
  node - The node which is specified on the URL (obtained by BridgeServlet.getNode
since:
   MMBase-1.7.4



init
public void init() throws ServletException(Code)
Inits lastmodifiedField.



main
public static void main(String[] argv)(Code)
Just to test to damn regexp



readQuery
protected QueryParts readQuery(HttpServletRequest req, HttpServletResponse res) throws IOException(Code)
Creates a QueryParts object which wraps request and response and the parse result of them. A QueryParts or null if something went wrong (in that case an error was sent, using the response).



readQuery
public static QueryParts readQuery(String query)(Code)

since:
   MMBase-1.7.4



readServletPath
public static QueryParts readServletPath(String servletPath)(Code)

since:
   MMBase-1.7.4



Fields inherited from org.mmbase.servlet.MMBaseServlet
protected MMBase mmbase(Code)(Java Doc)
protected int retryAfter(Code)(Java Doc)

Methods inherited from org.mmbase.servlet.MMBaseServlet
protected static synchronized void associateMapping(String function, String servletMapping, Integer priority)(Code)(Java Doc)
protected boolean checkInited(HttpServletResponse res) throws ServletException, IOException(Code)(Java Doc)
protected void decRefCount(HttpServletRequest req)(Code)(Java Doc)
public void destroy()(Code)(Java Doc)
protected void doGet(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException(Code)(Java Doc)
protected Map<String, Integer> getAssociations()(Code)(Java Doc)
public static String getBasePath(String function)(Code)(Java Doc)
public MMBase getMMBase()(Code)(Java Doc)
protected static String getRequestURL(HttpServletRequest req)(Code)(Java Doc)
public static String getServletByAssociation(String function)(Code)(Java Doc)
public static HttpServlet getServletByMapping(String mapping)(Code)(Java Doc)
public String getServletInfo()(Code)(Java Doc)
public static List<String> getServletMappings(String servletName)(Code)(Java Doc)
public static List<String> getServletMappingsByAssociation(String function)(Code)(Java Doc)
protected void incRefCount(HttpServletRequest req)(Code)(Java Doc)
public void init() throws ServletException(Code)(Java Doc)
public void service(HttpServletRequest req, HttpServletResponse res) throws ServletException, IOException(Code)(Java Doc)
public void setInitException(ServletException e)(Code)(Java Doc)
public void setMMBase(MMBase mmb)(Code)(Java Doc)

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.