Source Code Cross Referenced for PhysicalPageOperation.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » impl » store » raw » data » 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 DBMS » db derby 10.2 » org.apache.derby.impl.store.raw.data 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*
002:
003:           Derby - Class org.apache.derby.impl.store.raw.data.PhysicalPageOperation
004:
005:           Licensed to the Apache Software Foundation (ASF) under one or more
006:           contributor license agreements.  See the NOTICE file distributed with
007:           this work for additional information regarding copyright ownership.
008:           The ASF licenses this file to you under the Apache License, Version 2.0
009:           (the "License"); you may not use this file except in compliance with
010:           the License.  You may obtain a copy of the License at
011:
012:              http://www.apache.org/licenses/LICENSE-2.0
013:
014:           Unless required by applicable law or agreed to in writing, software
015:           distributed under the License is distributed on an "AS IS" BASIS,
016:           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
017:           See the License for the specific language governing permissions and
018:           limitations under the License.
019:
020:         */
021:
022:        package org.apache.derby.impl.store.raw.data;
023:
024:        import org.apache.derby.impl.store.raw.data.BasePage;
025:
026:        import org.apache.derby.iapi.store.raw.Compensation;
027:
028:        import org.apache.derby.iapi.store.raw.log.LogInstant;
029:
030:        import org.apache.derby.iapi.store.raw.Transaction;
031:        import org.apache.derby.iapi.store.raw.Undoable;
032:
033:        import org.apache.derby.iapi.error.StandardException;
034:
035:        import java.io.InputStream;
036:        import java.io.ObjectInput;
037:        import java.io.IOException;
038:        import org.apache.derby.iapi.services.io.LimitObjectInput;
039:
040:        /**
041:         An abstract class that is used for physical log operation.  A physical log
042:         operation is one where the undo of the operation must be applied to the
043:         same page as the original operation, and the undo operation must store the
044:         byte image of the row(s) changed to its before image.  (If a logical page
045:         operation happened to the page or if another transaction altered other rows
046:         on the page, the undo of this operation will only restore the before image
047:         of the row(s) affected).
048:
049:         <PRE>
050:         @format_id	no format id, an abstract class.
051:         @purpose	provide methods for physical undo
052:         @upgrade
053:         @disk_layout
054:         PageBasicOperation	the super class
055:         @end_format
056:         </PRE>
057:         */
058:
059:        public abstract class PhysicalPageOperation extends PageBasicOperation
060:                implements  Undoable {
061:            protected PhysicalPageOperation(BasePage page) {
062:                super (page);
063:            }
064:
065:            /*
066:             * Formatable methods
067:             */
068:
069:            // no-arg constructor, required by Formatable 
070:            public PhysicalPageOperation() {
071:                super ();
072:            }
073:
074:            // no fields, therefore no writeExternal or readExternal
075:
076:            /**
077:            	Undoable method
078:             */
079:
080:            /** 
081:              Generate a Compensation (PageUndoOperation) that will rollback the
082:              changes of this page operation. If this Page operation cannot or need not
083:              be rolled back (redo only), overwrite this function to return null.
084:
085:              <P><B>Note</B><BR> For operation that needs logical undo, use
086:              LogicalUndoOperation instead</B>  This implementation just finds
087:              the same page that the PageOperation was applied on - i.e., only works
088:              for undo on the same page.  
089:
090:              <P>During recovery redo, the logging system is page oriented and will use
091:              the pageID stored in the PageUndoOperation to find the page.  The
092:              page will be latched and released using the default findpage and
093:              releaseResource - this.releaseResource() will still be called so it has
094:              to know not to release any resource it did not acquire.
095:
096:              @param xact	the transaction doing the compensating
097:              @param in		optional input
098:
099:              @return the compensation operation that will rollback this change 
100:
101:              @exception StandardException Standard Cloudscape policy.
102:
103:              @see PageBasicOperation
104:              @see Undoable#generateUndo
105:              
106:             */
107:            public Compensation generateUndo(Transaction xact,
108:                    LimitObjectInput in) throws StandardException {
109:                // findpage will have the page latched.
110:                // CompensationOperation.doMe must call this.releaseResource the page
111:                // when it is done 
112:                BasePage undoPage = findpage(xact);
113:
114:                // Needs to pre-dirty this page so that if a checkpoint is taken any
115:                // time after the CLR is sent to the log stream, it will wait for the
116:                // actual undo to happen on the page.  We need this to preserve the
117:                // integrity of the redoLWM.
118:                undoPage.preDirty();
119:
120:                return new PhysicalUndoOperation(undoPage, this );
121:            }
122:
123:            /**
124:            	Undo the change indicated by this log operation and optional data.
125:            	The page the undo should apply to is the latched undoPage, the
126:            	recordId is the same as the roll forward operation.  
127:            	
128:            	<BR><B>In this RawStore implementation, should only only be called via
129:            	CompOp.doMe</B>.
130:
131:            	<P> The available() method of in indicates how much data can be read, i.e.
132:            	how much was originally written.
133:
134:            	@param xact			the Transaction doing the rollback
135:            	@param undoPage		the page to rollback changes on
136:            	@param CLRinstant	the log instant of this (PageUndo) operation
137:            	@param in			optional data for the rollback operation
138:
139:            	@exception IOException Can be thrown by any of the methods of ObjectInput.
140:            	@exception StandardException Standard Cloudscape policy.		
141:             */
142:            abstract public void undoMe(Transaction xact, BasePage undoPage,
143:                    LogInstant CLRinstant, LimitObjectInput in)
144:                    throws StandardException, IOException;
145:
146:        }
www__._ja_v__a__2_s_.___c_o_m__ | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.