Java Doc for Loggable.java in  » Database-DBMS » db-derby-10.2 » org » apache » derby » iapi » store » raw » 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.iapi.store.raw 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.apache.derby.iapi.store.raw.Loggable

All known Subclasses:   org.apache.derby.impl.store.raw.log.ChecksumOperation,  org.apache.derby.impl.store.raw.log.CheckpointOperation,  org.apache.derby.impl.store.raw.data.ContainerBasicOperation,  org.apache.derby.impl.store.raw.data.PageBasicOperation,  org.apache.derby.impl.store.raw.xact.BeginXact,  org.apache.derby.impl.store.raw.xact.EndXact,
Loggable
public interface Loggable extends Formatable(Code)
A Loggable is a record of a change of state or an event that happened in the RawStore in the context of a transaction. All changes in the RawStore must be logged. This is the root class for all log operations.
See Also:   Transaction.logAndDo


Field Summary
final public static  intABORT
    
final public static  intBI_LOG
    
final public static  intCHECKSUM
    
final public static  intCOMMIT
    
final public static  intCOMPENSATION
    
final public static  intFILE_RESOURCE
    
final public static  intFIRST
     Each loggable belongs to one or more groups of similar functionality. Grouping is a way to quickly sort out log records that are interesting to different modules or different implementations. When a module makes loggable and sent it to the log file, it must mark this loggable with one or more of the following group.
final public static  intLAST
    
final public static  intPREPARE
    
final public static  intRAWSTORE
    
final public static  intXA_NEEDLOCK
    


Method Summary
public  voiddoMe(Transaction xact, LogInstant instant, LimitObjectInput in)
     Apply the change indicated by this operation and optional data. If this method fail, the system will be shut down because the log record has already been written to disk.
public  ByteArraygetPreparedLog()
     The log operations are responsible to create the ByteArray, and the log operations should write out any optional data for the change to the ByteArray.
public  intgroup()
    
public  booleanneedsRedo(Transaction xact)
     Determine if the operation should be reapplied in recovery redo. If redo is needed, acquire any resource that is necessary for the loggable's doMe method.
public  voidreleaseResource(Transaction xact)
     Release any resource that was acquired for doMe for rollback or recovery redo. This resource is acquired in either generateUndo (if this is a compensation operation during run time rollback or recovery rollback) or in needsRedo (if this is during recovery redo).

Field Detail
ABORT
final public static int ABORT(Code)



BI_LOG
final public static int BI_LOG(Code)



CHECKSUM
final public static int CHECKSUM(Code)



COMMIT
final public static int COMMIT(Code)



COMPENSATION
final public static int COMPENSATION(Code)



FILE_RESOURCE
final public static int FILE_RESOURCE(Code)



FIRST
final public static int FIRST(Code)
Each loggable belongs to one or more groups of similar functionality. Grouping is a way to quickly sort out log records that are interesting to different modules or different implementations. When a module makes loggable and sent it to the log file, it must mark this loggable with one or more of the following group. If none fit, or if the loggable encompasses functionality that is not described in existing groups, then a new group should be introduced. Grouping has no effect on how the record is logged or how it is treated in rollback or recovery. The following groups are defined. This list serves as the registry of all loggable groups.



LAST
final public static int LAST(Code)



PREPARE
final public static int PREPARE(Code)



RAWSTORE
final public static int RAWSTORE(Code)



XA_NEEDLOCK
final public static int XA_NEEDLOCK(Code)





Method Detail
doMe
public void doMe(Transaction xact, LogInstant instant, LimitObjectInput in) throws StandardException, IOException(Code)
Apply the change indicated by this operation and optional data. If this method fail, the system will be shut down because the log record has already been written to disk. Moreover, the log record will be replayed during recovery and this doMe method will be called on the same page again, so if it fails again, recovery will fail and the database cannot be started. So it is very important to make sure that every resource you need, such as disk space, has been acquired before the logAndDo method is called!
This method cannot acquire any resource (like latching of a page) since it is called underneath the logging system, ie., the log record has already been written to the log stream.

The available() method of in indicates how much data can be read, i.e. how much was originally written.
Parameters:
  xact - the Transaction
Parameters:
  instant - the log instant of this operation
Parameters:
  in - optional data
exception:
  IOException - Can be thrown by any of the methods of in.
exception:
  StandardException - Standard Cloudscape policy.




getPreparedLog
public ByteArray getPreparedLog() throws StandardException(Code)
The log operations are responsible to create the ByteArray, and the log operations should write out any optional data for the change to the ByteArray. The ByteArray can be prepared when the log operation is constructed, or it can be prepared when getPreparedLog() is called. Called by the log manager to allow the log operation to pass the buffer which contains optional data that will be available in to doMe() methods.
exception:
  StandardException - Standard Cloudscape policy.



group
public int group()(Code)
Get the loggable's group value



needsRedo
public boolean needsRedo(Transaction xact) throws StandardException(Code)
Determine if the operation should be reapplied in recovery redo. If redo is needed, acquire any resource that is necessary for the loggable's doMe method. These need to be released in the releaseResource method.

The sequence of events in recovery redo of a Loggable operation is:

  • Get the loggable operation. If loggable.needsRedo is false, then no need to redo this operation.
  • If loggable.needsRedo is true, all the resources necessary for applying the doMe is acquired in needsRedo.
  • If the loggable is actually a compensation operation, then the logging system will find the undoable operation that needs to be undone, call compensation.setUndoOp with the undoable operation.
  • The recovery system then calls loggable.doMe, which re-applies the loggable operation, or re-applies the compensation operation
  • The recovery system then calls loggable.releaseResource.
    Parameters:
      xact - The transaction trying to redo this operation true if operation needs redoing, false if not.
    exception:
      StandardException - Standard Cloudscape policy.
    See Also:   Loggable.releaseResource



  • releaseResource
    public void releaseResource(Transaction xact)(Code)
    Release any resource that was acquired for doMe for rollback or recovery redo. This resource is acquired in either generateUndo (if this is a compensation operation during run time rollback or recovery rollback) or in needsRedo (if this is during recovery redo). The run time transaction context should have all the resource already acquird for run time roll forward, so there is no need to releaseResource during run time roll forward. This method must be safe to be called multiple times.



    www.java2java.com | Contact Us
    Copyright 2009 - 12 Demo Source and Support. All rights reserved.
    All other trademarks are property of their respective owners.