Source Code Cross Referenced for Level2Cache.java in  » Database-ORM » JPOX » org » jpox » cache » 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 ORM » JPOX » org.jpox.cache 
Source Cross Referenced  Class Diagram Java Document (Java Doc) 


001:        /**********************************************************************
002:        Copyright (c) 2004 Andy Jefferson and others. All rights reserved.
003:        Licensed under the Apache License, Version 2.0 (the "License");
004:        you may not use this file except in compliance with the License.
005:        You may obtain a copy of the License at
006:
007:            http://www.apache.org/licenses/LICENSE-2.0
008:
009:        Unless required by applicable law or agreed to in writing, software
010:        distributed under the License is distributed on an "AS IS" BASIS,
011:        WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
012:        See the License for the specific language governing permissions and
013:        limitations under the License. 
014:
015:
016:        Contributors:
017:            ...
018:         **********************************************************************/package org.jpox.cache;
019:
020:        import java.util.Collection;
021:
022:        /**
023:         * Interface for any Level 2 Cache used by JPOX.
024:         * Provides the typical controls required by JPOX itself and including the JDO2 DataStoreCache methods.
025:         * 
026:         * @version $Revision: 1.7 $
027:         */
028:        public interface Level2Cache {
029:            /**
030:             * Evict the parameter instance from the second-level cache.
031:             * @param oid the object id of the instance to evict.
032:             */
033:            void evict(Object oid);
034:
035:            /**
036:             * Evict the parameter instances from the second-level cache.
037:             * All instances in the PersistenceManager's cache are evicted
038:             * from the second-level cache.
039:             */
040:            void evictAll();
041:
042:            /**
043:             * Evict the parameter instances from the second-level cache.
044:             * @param oids the object ids of the instance to evict.
045:             */
046:            void evictAll(Object[] oids);
047:
048:            /**
049:             * Evict the parameter instances from the second-level cache.
050:             * @param oids the object ids of the instance to evict.
051:             */
052:            void evictAll(Collection oids);
053:
054:            /**
055:             * Evict the parameter instances from the second-level cache.
056:             * @param pcClass the class of instances to evict
057:             * @param subclasses if true, evict instances of subclasses also
058:             */
059:            void evictAll(Class pcClass, boolean subclasses);
060:
061:            /**
062:             * Pin the parameter instance in the second-level cache.
063:             * @param oid the object id of the instance to pin.
064:             */
065:            void pin(Object oid);
066:
067:            /**
068:             * Pin the parameter instances in the second-level cache.
069:             * @param oids the object ids of the instances to pin.
070:             */
071:            void pinAll(Collection oids);
072:
073:            /**
074:             * Pin the parameter instances in the second-level cache.
075:             * @param oids the object ids of the instances to pin.
076:             */
077:            void pinAll(Object[] oids);
078:
079:            /**
080:             * Pin instances in the second-level cache.
081:             * @param pcClass the class of instances to pin
082:             * @param subclasses if true, pin instances of subclasses also
083:             */
084:            void pinAll(Class pcClass, boolean subclasses);
085:
086:            /**
087:             * Unpin the parameter instance from the second-level cache.
088:             * @param oid the object id of the instance to unpin.
089:             */
090:            void unpin(Object oid);
091:
092:            /**
093:             * Unpin the parameter instances from the second-level cache.
094:             * @param oids the object ids of the instance to evict.
095:             */
096:            void unpinAll(Collection oids);
097:
098:            /**
099:             * Unpin the parameter instance from the second-level cache.
100:             * @param oids the object id of the instance to evict.
101:             */
102:            void unpinAll(Object[] oids);
103:
104:            /**
105:             * Unpin instances from the second-level cache.
106:             * @param pcClass the class of instances to unpin
107:             * @param subclasses if true, unpin instances of subclasses also
108:             */
109:            void unpinAll(Class pcClass, boolean subclasses);
110:
111:            /**
112:             * Accessor for the number of pinned objects in the cache.
113:             * @return Number of pinned objects
114:             */
115:            int getNumberOfPinnedObjects();
116:
117:            /**
118:             * Accessor for the number of unpinned objects in the cache.
119:             * @return Number of unpinned objects
120:             */
121:            int getNumberOfUnpinnedObjects();
122:
123:            /**
124:             * Accessor for the total number of objects in the L2 cache.
125:             * @return Number of objects
126:             */
127:            int getSize();
128:
129:            /**
130:             * Accessor for an object from the cache.
131:             * @param oid The Object ID
132:             * @return The L2 cacheable object
133:             */
134:            CachedPC get(Object oid);
135:
136:            /**
137:             * Method to put an object in the cache.
138:             * @param oid The Object id for this object
139:             * @param pc The L2 cacheable PersistenceCapable object
140:             * @return The value previously associated with this oid
141:             */
142:            CachedPC put(Object oid, CachedPC pc);
143:
144:            /**
145:             * Accessor for whether the cache is empty.
146:             * @return Whether it is empty.
147:             */
148:            boolean isEmpty();
149:
150:            /**
151:             * Method to clear the cache.
152:             */
153:            void clear();
154:
155:            /**
156:             * Accessor for whether an object with the specified id is in the cache
157:             * @param oid The object id
158:             * @return Whether it is in the cache
159:             */
160:            boolean containsOid(Object oid);
161:
162:            /**
163:             * Representation of a class whose objects will be pinned when put into the L2 cache.
164:             * @version $Revision: 1.7 $
165:             */
166:            class PinnedClass {
167:                Class cls;
168:                boolean subclasses;
169:
170:                /**
171:                 * Constructor
172:                 * @param cls the class
173:                 * @param subclasses sub classes
174:                 */
175:                public PinnedClass(Class cls, boolean subclasses) {
176:                    this .cls = cls;
177:                    this .subclasses = subclasses;
178:                }
179:
180:                public boolean equals(Object obj) {
181:                    if (obj == null) {
182:                        return false;
183:                    }
184:                    if (!(obj instanceof  PinnedClass)) {
185:                        return false;
186:                    }
187:                    PinnedClass other = (PinnedClass) obj;
188:                    return other.cls.getName().equals(cls.getName())
189:                            && other.subclasses == subclasses;
190:                }
191:            }
192:        }
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.