Source Code Cross Referenced for RawStore.java in  » JMX » je » com » sleepycat » persist » 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 » JMX » je » com.sleepycat.persist.raw 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /*-
002:         * See the file LICENSE for redistribution information.
003:         *
004:         * Copyright (c) 2002,2008 Oracle.  All rights reserved.
005:         *
006:         * $Id: RawStore.java,v 1.14.2.2 2008/01/07 15:14:21 cwl Exp $
007:         */
008:
009:        package com.sleepycat.persist.raw;
010:
011:        import com.sleepycat.je.DatabaseException;
012:        import com.sleepycat.je.Environment;
013:        import com.sleepycat.persist.PrimaryIndex;
014:        import com.sleepycat.persist.SecondaryIndex;
015:        import com.sleepycat.persist.StoreConfig;
016:        import com.sleepycat.persist.evolve.Mutations;
017:        import com.sleepycat.persist.impl.Store;
018:        import com.sleepycat.persist.model.EntityModel;
019:
020:        /**
021:         * Provides access to the raw data in a store for use by general purpose tools.
022:         * A <code>RawStore</code> provides access to stored entities without using
023:         * entity classes or key classes.  Keys are represented as simple type objects
024:         * or, for composite keys, as {@link RawObject} instances, and entities are
025:         * represented as {@link RawObject} instances.
026:         *
027:         * <p>{@code RawStore} objects are thread-safe.  Multiple threads may safely
028:         * call the methods of a shared {@code RawStore} object.</p>
029:         *
030:         * <p>When using a {@code RawStore}, the current persistent class definitions
031:         * are not used.  Instead, the previously stored metadata and class definitions
032:         * are used.  This has several implications:</p>
033:         * <ol>
034:         * <li>An {@code EntityModel} may not be specified using {@link
035:         * StoreConfig#setModel}.  In other words, the configured model must be
036:         * null (the default).</li>
037:         * <li>When storing entities, their format will not automatically be evolved
038:         * to the current class definition, even if the current class definition has
039:         * changed.</li>
040:         * </ol>
041:         *
042:         * @author Mark Hayes
043:         */
044:        public class RawStore {
045:
046:            private Store store;
047:
048:            /**
049:             * Opens an entity store for raw data access.
050:             *
051:             * @param env an open Berkeley DB environment.
052:             *
053:             * @param storeName the name of the entity store within the given
054:             * environment.
055:             *
056:             * @param config the store configuration, or null to use default
057:             * configuration properties.
058:             *
059:             * @throws IllegalArgumentException if the <code>Environment</code> is
060:             * read-only and the <code>config ReadOnly</code> property is false.
061:             */
062:            public RawStore(Environment env, String storeName,
063:                    StoreConfig config) throws DatabaseException {
064:
065:                store = new Store(env, storeName, config, true /*rawAccess*/);
066:            }
067:
068:            /**
069:             * Opens the primary index for a given entity class.
070:             */
071:            public PrimaryIndex<Object, RawObject> getPrimaryIndex(
072:                    String entityClass) throws DatabaseException {
073:
074:                return store.getPrimaryIndex(Object.class, null,
075:                        RawObject.class, entityClass);
076:            }
077:
078:            /**
079:             * Opens the secondary index for a given entity class and secondary key
080:             * name.
081:             */
082:            public SecondaryIndex<Object, Object, RawObject> getSecondaryIndex(
083:                    String entityClass, String keyName)
084:                    throws DatabaseException {
085:
086:                return store.getSecondaryIndex(getPrimaryIndex(entityClass),
087:                        RawObject.class, entityClass, Object.class, null,
088:                        keyName);
089:            }
090:
091:            /**
092:             * Returns the environment associated with this store.
093:             */
094:            public Environment getEnvironment() {
095:                return store.getEnvironment();
096:            }
097:
098:            /**
099:             * Returns a copy of the entity store configuration.
100:             */
101:            public StoreConfig getConfig() {
102:                return store.getConfig();
103:            }
104:
105:            /**
106:             * Returns the name of this store.
107:             */
108:            public String getStoreName() {
109:                return store.getStoreName();
110:            }
111:
112:            /**
113:             * Returns the last configured and stored entity model for this store.
114:             */
115:            public EntityModel getModel() {
116:                return store.getModel();
117:            }
118:
119:            /**
120:             * Returns the set of mutations that were configured and stored previously.
121:             */
122:            public Mutations getMutations() {
123:                return store.getMutations();
124:            }
125:
126:            /**
127:             * Closes all databases and sequences that were opened by this model.  No
128:             * databases opened via this store may be in use.
129:             */
130:            public void close() throws DatabaseException {
131:
132:                store.close();
133:            }
134:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.