Java Doc for Store.java in  » Database-DBMS » mckoi » com » mckoi » store » 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 » mckoi » com.mckoi.store 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.mckoi.store.Store

All known Subclasses:   com.mckoi.store.HeapStore,  com.mckoi.store.AbstractStore,
Store
public interface Store (Code)
A store is a resource where areas can be allocated and freed to store objects. A store can be backed by a file or main memory, or a combination of the two.

Some characteristics of implementations of Store may be separately specified. For example, a file based store that is intended to persistently store objects may have robustness as a primary requirement. A main memory based store, or other type of volatile store, may not require robustness.
author:
   Tobias Downer





Method Summary
 AreaWritercreateArea(long size)
     Allocates a block of memory in the store of the specified size and returns an AreaWriter object that can be used to initialize the contents of the area.
 voiddeleteArea(long id)
     Deletes an area that was previously allocated by the 'createArea' method by the area id.
 ListgetAllAreas()
     Returns a complete list of pointers to all areas in the Store as Long objects sorted from lowest pointer to highest.
 AreagetArea(long id)
     Returns an object that allows for the contents of an area (represented by the 'id' parameter) to be read.
 InputStreamgetAreaInputStream(long id)
     Returns an InputStream implementation that allows for the area with the given identifier to be read sequentially.
 MutableAreagetMutableArea(long id)
     Returns an object that allows for the contents of an area (represented by the 'id' parameter) to be read and written.
 booleanlastCloseClean()
     Returns true if the store was closed cleanly.
 voidlockForWrite()
     It is often useful to guarentee that a certain sequence of updates to a store is completed and not broken in the middle.
 voidunlockForWrite()
     See the 'lockForWrite' method description.



Method Detail
createArea
AreaWriter createArea(long size) throws IOException(Code)
Allocates a block of memory in the store of the specified size and returns an AreaWriter object that can be used to initialize the contents of the area. Note that an area in the store is undefined until the 'finish' method is called in AreaWriter.
Parameters:
  size - the amount of memory to allocate. an AreaWriter object that allows the area to be setup.
throws:
  IOException - if not enough space available to create the area orthe store is read-only.



deleteArea
void deleteArea(long id) throws IOException(Code)
Deletes an area that was previously allocated by the 'createArea' method by the area id. Once an area is deleted the resources may be reclaimed. The behaviour of this method is undefined if the id doesn't represent a valid area.
Parameters:
  id - the identifier of the area to delete.
throws:
  IOException - (optional) if the id is invalid or the area can nototherwise by deleted.



getAllAreas
List getAllAreas() throws IOException(Code)
Returns a complete list of pointers to all areas in the Store as Long objects sorted from lowest pointer to highest. This should be used for diagnostics only because it may be difficult for this to be generated with some implementations. It is useful in a repair tool to determine if a pointer is valid or not.



getArea
Area getArea(long id) throws IOException(Code)
Returns an object that allows for the contents of an area (represented by the 'id' parameter) to be read. The behaviour of this method, and Area object, is undefined if the id doesn't represent a valid area.

When 'id' is -1 then a fixed area (64 bytes in size) in the store is returned. The fixed area can be used to store important static static information.
Parameters:
  id - the identifier of the area to read, or id = -1 is a 64 bytefixed area in the store. an Area object that allows access to the part of the store.
throws:
  IOException - (optional) if the id is invalid or the area can nototherwise be accessed.




getAreaInputStream
InputStream getAreaInputStream(long id) throws IOException(Code)
Returns an InputStream implementation that allows for the area with the given identifier to be read sequentially. The behaviour of this method, and InputStream object, is undefined if the id doesn't represent a valid area.

When 'id' is -1 then a fixed area (64 bytes in size) in the store is returned. The fixed area can be used to store important static static information.
Parameters:
  id - the identifier of the area to read, or id = -1 is a 64 bytefixed area in the store. an InputStream that allows the area to be read from the start.
throws:
  IOException - (optional) if the id is invalid or the area can nototherwise be accessed.




getMutableArea
MutableArea getMutableArea(long id) throws IOException(Code)
Returns an object that allows for the contents of an area (represented by the 'id' parameter) to be read and written. The behaviour of this method, and MutableArea object, is undefined if the id doesn't represent a valid area.

When 'id' is -1 then a fixed area (64 bytes in size) in the store is returned. The fixed area can be used to store important static static information.
Parameters:
  id - the identifier of the area to access, or id = -1 is a 64 bytefixed area in the store. a MutableArea object that allows access to the part of the store.
throws:
  IOException - (optional) if the id is invalid or the area can nototherwise be accessed.




lastCloseClean
boolean lastCloseClean()(Code)
Returns true if the store was closed cleanly. This is important information that may need to be considered when reading information from the store. This is typically used to issue a scan on the data in the store when it is not closed cleanly.



lockForWrite
void lockForWrite()(Code)
It is often useful to guarentee that a certain sequence of updates to a store is completed and not broken in the middle. For example, when inserting data into a table you don't want a record to be partially written when a check point is made. You want the entire sequence of modifications to be completed before the check point can run. This means that if a crash occurs, a check point will not recover to a possible corrupt file.

To achieve this, the 'lockForWrite' and 'unlockForWrite' methods are available. When 'lockForWrite' has been called, a check point can not created until there are no write locks obtained on the table.




unlockForWrite
void unlockForWrite()(Code)
See the 'lockForWrite' method description.



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