Source Code Cross Referenced for TransactionEvent.java in  » Database-ORM » openjpa » org » apache » openjpa » event » 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 » openjpa » org.apache.openjpa.event 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:         * Licensed to the Apache Software Foundation (ASF) under one
003:         * or more contributor license agreements.  See the NOTICE file
004:         * distributed with this work for additional information
005:         * regarding copyright ownership.  The ASF licenses this file
006:         * to you under the Apache License, Version 2.0 (the
007:         * "License"); you may not use this file except in compliance
008:         * with the License.  You may obtain a copy of the License at
009:         *
010:         * http://www.apache.org/licenses/LICENSE-2.0
011:         *
012:         * Unless required by applicable law or agreed to in writing,
013:         * software distributed under the License is distributed on an
014:         * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
015:         * KIND, either express or implied.  See the License for the
016:         * specific language governing permissions and limitations
017:         * under the License.    
018:         */
019:        package org.apache.openjpa.event;
020:
021:        import java.util.Collection;
022:        import java.util.Collections;
023:        import java.util.EventObject;
024:
025:        import org.apache.openjpa.kernel.Broker;
026:
027:        /**
028:         * A transactional event. The event source is the {@link Broker} whose
029:         * transaction state changed.
030:         *
031:         * @since 0.3.0
032:         * @author Abe White
033:         */
034:        public class TransactionEvent extends EventObject {
035:
036:            /**
037:             * Event type signifying that a transaction has just begun.
038:             */
039:            public static final int AFTER_BEGIN = 0;
040:
041:            /**
042:             * Event type signifying that changes are about to be flushed to the
043:             * datastore. This does not necessarily mean that a commit is taking place.
044:             */
045:            public static final int BEFORE_FLUSH = 1;
046:
047:            /**
048:             * Event type signifying that changes have been flushed to the datastore.
049:             * This event is only fired if flushing is successful.
050:             */
051:            public static final int AFTER_FLUSH = 2;
052:
053:            /**
054:             * Event type signifying that the transaction is about to be committed.
055:             * This will be fired before the {@link #BEFORE_FLUSH} event for the
056:             * transaction, so that you can differentiate between flushes for commits
057:             * and other flushes.
058:             */
059:            public static final int BEFORE_COMMIT = 3;
060:
061:            /**
062:             * Event type signifying that the transaction has committed.
063:             */
064:            public static final int AFTER_COMMIT = 4;
065:
066:            /**
067:             * Event type signifying that the transaction was rolled back.
068:             */
069:            public static final int AFTER_ROLLBACK = 5;
070:
071:            /**
072:             * Event type signifying that all state transitions have been made.
073:             */
074:            public static final int AFTER_STATE_TRANSITIONS = 6;
075:
076:            /**
077:             * Event type signifying that the commit has completey ended and the
078:             * transaction is no longer active.
079:             */
080:            public static final int AFTER_COMMIT_COMPLETE = 7;
081:
082:            /**
083:             * Event type signifying that the rollback has completey ended and the
084:             * transaction is no longer active.
085:             */
086:            public static final int AFTER_ROLLBACK_COMPLETE = 8;
087:
088:            private final int _type;
089:            private transient final Collection _objs;
090:            private transient final Collection _addClss;
091:            private transient final Collection _updateClss;
092:            private transient final Collection _deleteClss;
093:
094:            /**
095:             * Constructor.
096:             *
097:             * @param broker the event source
098:             * @param type the event type
099:             * @param objs transactional objects
100:             * @param addClss classes of added instances
101:             * @param updateClss classes of updated instances
102:             * @param deleteClss classes of deleted instances
103:             */
104:            public TransactionEvent(Broker broker, int type, Collection objs,
105:                    Collection addClss, Collection updateClss,
106:                    Collection deleteClss) {
107:                super (broker);
108:                _type = type;
109:                _objs = (objs == null) ? Collections.EMPTY_LIST : objs;
110:                _addClss = (addClss == null) ? Collections.EMPTY_SET : addClss;
111:                _updateClss = (updateClss == null) ? Collections.EMPTY_SET
112:                        : updateClss;
113:                _deleteClss = (deleteClss == null) ? Collections.EMPTY_SET
114:                        : deleteClss;
115:            }
116:
117:            /**
118:             * Return the type of event.
119:             */
120:            public int getType() {
121:                return _type;
122:            }
123:
124:            /**
125:             * Return the unmodifiable set of persistence capable objects
126:             * participating in the transaction. This set will contain all dirty
127:             * objects, but may not contain clean objects.
128:             */
129:            public Collection getTransactionalObjects() {
130:                return _objs;
131:            }
132:
133:            /**
134:             * Return the unmodifiable the set of classes of
135:             * persistence capable objects that were created in the transaction.
136:             */
137:            public Collection getPersistedTypes() {
138:                return _addClss;
139:            }
140:
141:            /**
142:             * Return the unmodifiable the set of classes of
143:             * persistence capable objects that were modified in the transaction.
144:             */
145:            public Collection getUpdatedTypes() {
146:                return _updateClss;
147:            }
148:
149:            /**
150:             * Return the unmodifiable the set of classes of
151:             * persistence capable objects that were deleted in the transaction.
152:             */
153:            public Collection getDeletedTypes() {
154:                return _deleteClss;
155:            }
156:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.