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


001:        /*-
002:         * See the file LICENSE for redistribution information.
003:         *
004:         * Copyright (c) 2000,2008 Oracle.  All rights reserved.
005:         *
006:         * $Id: SerialSerialBinding.java,v 1.22.2.2 2008/01/07 15:14:05 cwl Exp $
007:         */
008:
009:        package com.sleepycat.bind.serial;
010:
011:        import com.sleepycat.bind.EntityBinding;
012:        import com.sleepycat.je.DatabaseEntry;
013:
014:        /**
015:         * An abstract <code>EntityBinding</code> that treats an entity's key entry and
016:         * data entry as serialized objects.
017:         *
018:         * <p>This class takes care of serializing and deserializing the key and
019:         * data entry automatically.  Its three abstract methods must be implemented by
020:         * a concrete subclass to convert the deserialized objects to/from an entity
021:         * object.</p>
022:         * <ul>
023:         * <li> {@link #entryToObject(Object,Object)} </li>
024:         * <li> {@link #objectToKey(Object)} </li>
025:         * <li> {@link #objectToData(Object)} </li>
026:         * </ul>
027:         *
028:         * @author Mark Hayes
029:         */
030:        public abstract class SerialSerialBinding implements  EntityBinding {
031:
032:            private SerialBinding keyBinding;
033:            private SerialBinding dataBinding;
034:
035:            /**
036:             * Creates a serial-serial entity binding.
037:             *
038:             * @param classCatalog is the catalog to hold shared class information and
039:             * for a database should be a {@link StoredClassCatalog}.
040:             *
041:             * @param keyClass is the key base class.
042:             *
043:             * @param dataClass is the data base class.
044:             */
045:            public SerialSerialBinding(ClassCatalog classCatalog,
046:                    Class keyClass, Class dataClass) {
047:
048:                this (new SerialBinding(classCatalog, keyClass),
049:                        new SerialBinding(classCatalog, dataClass));
050:            }
051:
052:            /**
053:             * Creates a serial-serial entity binding.
054:             *
055:             * @param keyBinding is the key binding.
056:             *
057:             * @param dataBinding is the data binding.
058:             */
059:            public SerialSerialBinding(SerialBinding keyBinding,
060:                    SerialBinding dataBinding) {
061:
062:                this .keyBinding = keyBinding;
063:                this .dataBinding = dataBinding;
064:            }
065:
066:            // javadoc is inherited
067:            public Object entryToObject(DatabaseEntry key, DatabaseEntry data) {
068:
069:                return entryToObject(keyBinding.entryToObject(key), dataBinding
070:                        .entryToObject(data));
071:            }
072:
073:            // javadoc is inherited
074:            public void objectToKey(Object object, DatabaseEntry key) {
075:
076:                object = objectToKey(object);
077:                keyBinding.objectToEntry(object, key);
078:            }
079:
080:            // javadoc is inherited
081:            public void objectToData(Object object, DatabaseEntry data) {
082:
083:                object = objectToData(object);
084:                dataBinding.objectToEntry(object, data);
085:            }
086:
087:            /**
088:             * Constructs an entity object from deserialized key and data objects.
089:             *
090:             * @param keyInput is the deserialized key object.
091:             *
092:             * @param dataInput is the deserialized data object.
093:             *
094:             * @return the entity object constructed from the key and data.
095:             */
096:            public abstract Object entryToObject(Object keyInput,
097:                    Object dataInput);
098:
099:            /**
100:             * Extracts a key object from an entity object.
101:             *
102:             * @param object is the entity object.
103:             *
104:             * @return the deserialized key object.
105:             */
106:            public abstract Object objectToKey(Object object);
107:
108:            /**
109:             * Extracts a data object from an entity object.
110:             *
111:             * @param object is the entity object.
112:             *
113:             * @return the deserialized data object.
114:             */
115:            public abstract Object objectToData(Object object);
116:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.