Source Code Cross Referenced for PlatformTransactionManager.java in  » J2EE » spring-framework-2.5 » org » springframework » transaction » 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 » J2EE » spring framework 2.5 » org.springframework.transaction 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Copyright 2002-2007 the original author or authors.
003:         *
004:         * Licensed under the Apache License, Version 2.0 (the "License");
005:         * you may not use this file except in compliance with the License.
006:         * You may obtain a copy of the License at
007:         *
008:         *      http://www.apache.org/licenses/LICENSE-2.0
009:         *
010:         * Unless required by applicable law or agreed to in writing, software
011:         * distributed under the License is distributed on an "AS IS" BASIS,
012:         * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
013:         * See the License for the specific language governing permissions and
014:         * limitations under the License.
015:         */
016:
017:        package org.springframework.transaction;
018:
019:        /**
020:         * This is the central interface in Spring's transaction infrastructure.
021:         * Applications can use this directly, but it is not primarily meant as API:
022:         * Typically, applications will work with either TransactionTemplate or
023:         * declarative transaction demarcation through AOP.
024:         *
025:         * <p>For implementors, it is recommended to derive from the provided
026:         * {@link org.springframework.transaction.support.AbstractPlatformTransactionManager}
027:         * class, which pre-implements the defined propagation behavior and takes care
028:         * of transaction synchronization handling. Subclasses have to implement
029:         * template methods for specific states of the underlying transaction,
030:         * for example: begin, suspend, resume, commit.
031:         *
032:         * <p>The default implementations of this strategy interface are
033:         * {@link org.springframework.transaction.jta.JtaTransactionManager} and
034:         * {@link org.springframework.jdbc.datasource.DataSourceTransactionManager},
035:         * which can serve as an implementation guide for other transaction strategies.
036:         *
037:         * @author Rod Johnson
038:         * @author Juergen Hoeller
039:         * @since 16.05.2003
040:         * @see org.springframework.transaction.support.TransactionTemplate
041:         * @see org.springframework.transaction.interceptor.TransactionInterceptor
042:         * @see org.springframework.transaction.interceptor.TransactionProxyFactoryBean
043:         */
044:        public interface PlatformTransactionManager {
045:
046:            /**
047:             * Return a currently active transaction or create a new one, according to
048:             * the specified propagation behavior.
049:             * <p>Note that parameters like isolation level or timeout will only be applied
050:             * to new transactions, and thus be ignored when participating in active ones.
051:             * <p>Furthermore, not all transaction definition settings will be supported
052:             * by every transaction manager: A proper transaction manager implementation
053:             * should thrown an exception when unsupported settings are encountered.
054:             * <p>An exception to the above rule is the read-only flag, which should be
055:             * ignored if no explicit read-only mode is supported. Essentially, the
056:             * read-only flag is just a hint for potential optimization.
057:             * @param definition TransactionDefinition instance (can be <code>null</code> for defaults),
058:             * describing propagation behavior, isolation level, timeout etc.
059:             * @return transaction status object representing the new or current transaction
060:             * @throws TransactionException in case of lookup, creation, or system errors
061:             * @throws IllegalTransactionStateException if the given transaction definition
062:             * cannot be executed (for example, if a currently active transaction is in
063:             * conflict with the specified propagation behavior)
064:             * @see TransactionDefinition#getPropagationBehavior
065:             * @see TransactionDefinition#getIsolationLevel
066:             * @see TransactionDefinition#getTimeout
067:             * @see TransactionDefinition#isReadOnly
068:             */
069:            TransactionStatus getTransaction(TransactionDefinition definition)
070:                    throws TransactionException;
071:
072:            /**
073:             * Commit the given transaction, with regard to its status. If the transaction
074:             * has been marked rollback-only programmatically, perform a rollback.
075:             * <p>If the transaction wasn't a new one, omit the commit for proper
076:             * participation in the surrounding transaction. If a previous transaction
077:             * has been suspended to be able to create a new one, resume the previous
078:             * transaction after committing the new one.
079:             * <p>Note that when the commit call completes, no matter if normally or
080:             * throwing an exception, the transaction must be fully completed and
081:             * cleaned up. No rollback call should be expected in such a case.
082:             * <p>If this method throws an exception other than a TransactionException,
083:             * then some before-commit error caused the commit attempt to fail. For
084:             * example, an O/R Mapping tool might have tried to flush changes to the
085:             * database right before commit, with the resulting DataAccessException
086:             * causing the transaction to fail. The original exception will be
087:             * propagated to the caller of this commit method in such a case.
088:             * @param status object returned by the <code>getTransaction</code> method
089:             * @throws UnexpectedRollbackException in case of an unexpected rollback
090:             * that the transaction coordinator initiated
091:             * @throws HeuristicCompletionException in case of a transaction failure
092:             * caused by a heuristic decision on the side of the transaction coordinator
093:             * @throws TransactionSystemException in case of commit or system errors
094:             * (typically caused by fundamental resource failures)
095:             * @throws IllegalTransactionStateException if the given transaction
096:             * is already completed (that is, committed or rolled back)
097:             * @see TransactionStatus#setRollbackOnly
098:             */
099:            void commit(TransactionStatus status) throws TransactionException;
100:
101:            /**
102:             * Perform a rollback of the given transaction.
103:             * <p>If the transaction wasn't a new one, just set it rollback-only for proper
104:             * participation in the surrounding transaction. If a previous transaction
105:             * has been suspended to be able to create a new one, resume the previous
106:             * transaction after rolling back the new one.
107:             * <p><b>Do not call rollback on a transaction if commit threw an exception.</b>
108:             * The transaction will already have been completed and cleaned up when commit
109:             * returns, even in case of a commit exception. Consequently, a rollback call
110:             * after commit failure will lead to an IllegalTransactionStateException.
111:             * @param status object returned by the <code>getTransaction</code> method
112:             * @throws TransactionSystemException in case of rollback or system errors
113:             * (typically caused by fundamental resource failures)
114:             * @throws IllegalTransactionStateException if the given transaction
115:             * is already completed (that is, committed or rolled back)
116:             */
117:            void rollback(TransactionStatus status) throws TransactionException;
118:
119:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.