Java Doc for TransactionServlet.java in  » Web-Services » Gomba » org » gomba » 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 » Web Services » Gomba » org.gomba 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


javax.servlet.http.HttpServlet
   org.gomba.TransactionServlet

TransactionServlet
public class TransactionServlet extends HttpServlet (Code)
This servlet implements transactions for RESTful web services. This servlet is used to start, commit or rollback a transaction. This servlet will be typically mapped to /transactions/*. HTTP methods are mapped to transaction operations in this way:
POST
Start a new transaction. Posting an empty resource will create a new transaction. In the future we may add an XML document type to specify transaction options.
GET
Get information about a transaction.
PUT
Commit a transaction. Putting an empty resource is allowed. In the future we may support PUTting the (updated) XML data returned by GET.
DELETE
Rollback a transaction and destroy it.
The XML returned by this servlet in response to GET request looks like this:
 <transaction>
 <uri>http://domain.com/transactions/238476245jhg34589345k</uri>
 <creationTime>2004-12-25T00:00:00</creationTime>
 <lastAccessedTime>2004-12-25T00:10:00</lastAccessedTime>
 <maxInactiveInterval>600</maxInactiveInterval>
 </transaction>
 

TODO: provide a DTD.

Init-params:
transaction-id
An expression that evaluates to the transaction id. May contain ${} parameters. This will typically be: ${path.0} (Required)
transaction-uri
The transaction URI. This is not a full-blown expression, ${} cannot be used here. Only ${transaction.id} will be replaced with actual transaction id. A typical setting is: http://domain.org/transactions/${transaction.id}. In a sense, this the reverse of the transaction-id expression: transaction-id is used to extract an id from a URI, while transaction-URI is used to generate a URI from an id. (Required)
transaction-timeout
The transaction timeout interval for all transactions created by this servlet. The specified timeout must be expressed in a whole number of seconds. Since version 0.8 this value may be exceeded, it depends on when the HarvesterThread processes the transaction. The default value is 30. (Optional)
jvm-route
Identifier which must be used in load balancing scenarios to enable session affinity. The identifier, which must be unique across all servers which participate in the cluster, will be appended to the generated transaction identifier, therefore allowing the front end proxy to always forward requests that belong to a particular transaction to the same instance. Value can be an expression evaluated at servlet initialization time, so don't use request-related expressions. The "systemProperty" parameter domain is particurarly useful for this setting.

author:
   Flavio Tordini
version:
   $Id: TransactionServlet.java,v 1.8 2005/12/07 11:19:01 flaviotordini
version:
   Exp $
See Also:    http://www.seairth.com/web/resttp.html,
See Also:   http://www.xml.com/lpt/a/2004/08/11/rest.html,
See Also:   http://lists.xml.org/archives/xml-dev/200402/msg00267.html
See Also:   http://groups.yahoo.com/group/rest-discuss/message/4141

Inner Class :final class TransactionXMLReader extends ObjectXMLReader

Field Summary
final protected static  StringCONTEXT_ATTRIBUTE_NAME_SERVLET
     Name of the context attribute that holds the servlet instance.
final protected static  StringCONTEXT_ATTRIBUTE_NAME_TRANSACTIONS
     Name of the context attribute that holds the transactions Map.


Method Summary
protected  TransactioncreateTransaction()
     Create a new transaction and add it the map.
public  voiddestroy()
    
protected  voiddoDelete(HttpServletRequest request, HttpServletResponse response)
     Rollback a transaction.
protected  voiddoGet(HttpServletRequest request, HttpServletResponse response)
     Obtain information about a transaction.
protected  voiddoPost(HttpServletRequest request, HttpServletResponse response)
     Create a transaction.
protected  voiddoPut(HttpServletRequest request, HttpServletResponse response)
     Commit a transaction.
public  voidinit(ServletConfig config)
    

Field Detail
CONTEXT_ATTRIBUTE_NAME_SERVLET
final protected static String CONTEXT_ATTRIBUTE_NAME_SERVLET(Code)
Name of the context attribute that holds the servlet instance.



CONTEXT_ATTRIBUTE_NAME_TRANSACTIONS
final protected static String CONTEXT_ATTRIBUTE_NAME_TRANSACTIONS(Code)
Name of the context attribute that holds the transactions Map. Mapping is transaction URI to Trasaction.





Method Detail
createTransaction
protected Transaction createTransaction() throws ServletException(Code)
Create a new transaction and add it the map.



destroy
public void destroy()(Code)

See Also:   javax.servlet.Servlet.destroy



doDelete
protected void doDelete(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException(Code)
Rollback a transaction.
See Also:   javax.servlet.http.HttpServlet.doDelete(javax.servlet.http.HttpServletRequestjavax.servlet.http.HttpServletResponse)



doGet
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException(Code)
Obtain information about a transaction.
See Also:   javax.servlet.http.HttpServlet.doGet(javax.servlet.http.HttpServletRequestjavax.servlet.http.HttpServletResponse)



doPost
protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException(Code)
Create a transaction.
See Also:   javax.servlet.http.HttpServlet.doPost(javax.servlet.http.HttpServletRequestjavax.servlet.http.HttpServletResponse)



doPut
protected void doPut(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException(Code)
Commit a transaction.
See Also:   javax.servlet.http.HttpServlet.doPut(javax.servlet.http.HttpServletRequestjavax.servlet.http.HttpServletResponse)



init
public void init(ServletConfig config) throws ServletException(Code)

See Also:   javax.servlet.Servlet.init(javax.servlet.ServletConfig)



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.