Java Doc for CachedBdbMap.java in  » Web-Crawler » heritrix » org » archive » util » 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 » Web Crawler » heritrix » org.archive.util 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


org.archive.util.CachedBdbMap

CachedBdbMap
public class CachedBdbMap extends AbstractMap implements Map<K, V>,Serializable(Code)
A BDB JE backed hashmap. It extends the normal BDB JE map implementation by holding a cache of soft referenced objects. That is objects are not written to disk until they are not referenced by any other object and therefore can be Garbage Collected.
author:
   John Erik Halse
author:
   stack
author:
   gojomo

Inner Class :protected static class DbEnvironmentEntry

Field Summary
protected transient  Databasedb
     The BDB JE database used for this instance.
protected transient  StoredSortedMapdiskMap
     The Collection view of the BDB JE database used for this instance.
protected  intdiskMapSize
     The number of objects in the diskMap StoredMap.
protected transient  ReferenceQueue<V>refQueue
    
protected static  FieldreferentField
     Reference to the Reference#referent Field.

Constructor Summary
public  CachedBdbMap(String dbName)
     Constructor. You must call CachedBdbMap.initialize(Environment,Class,Class,StoredClassCatalog) to finish construction.
public  CachedBdbMap(File dbDir, String dbName, Class<K> keyClass, Class<V> valueClass)
     A constructor for creating a new CachedBdbMap.

Method Summary
public synchronized  voidclear()
     Note that a call to this method CLOSEs the underlying bdbje. This instance is no longer of any use.
public synchronized  voidclose()
    
public synchronized  booleancontainsKey(Object key)
    
public synchronized  booleancontainsValue(Object value)
    
protected  StoredSortedMapcreateDiskMap(Database database, StoredClassCatalog classCatalog, Class keyClass, Class valueClass)
    
public  Set<Map.Entry<K, V>>entrySet()
    
protected  voidfinalize()
    
public synchronized  Vget(Object object)
    
protected  StringgetDatabaseName()
    
public synchronized  voidinitialize(Environment env, Class keyClass, Class valueClass, StoredClassCatalog classCatalog)
     Call this method when you have an instance when you used the default constructor or when you have a deserialized instance that you want to reconnect with an extant bdbje environment.
protected  voidinitializeInstance()
     Do any instance setup.
public  Set<K>keySet()
     The keySet of the diskMap is all relevant keys.
protected  DatabaseopenDatabase(Environment environment, String dbName)
    
public synchronized  Vput(K key, V value)
    
public synchronized  booleanquickContainsKey(Object key)
    
public synchronized  booleanquickContainsValue(Object value)
    
public synchronized  Vremove(Object key)
    
public  intsize()
    
public synchronized  voidsync()
     Sync in-memory map entries to backing disk store.

Field Detail
db
protected transient Database db(Code)
The BDB JE database used for this instance.



diskMap
protected transient StoredSortedMap diskMap(Code)
The Collection view of the BDB JE database used for this instance.



diskMapSize
protected int diskMapSize(Code)
The number of objects in the diskMap StoredMap. (Package access for unit testing.)



refQueue
protected transient ReferenceQueue<V> refQueue(Code)



referentField
protected static Field referentField(Code)
Reference to the Reference#referent Field.




Constructor Detail
CachedBdbMap
public CachedBdbMap(String dbName)(Code)
Constructor. You must call CachedBdbMap.initialize(Environment,Class,Class,StoredClassCatalog) to finish construction. Construction is two-stepped to support reconnecting a deserialized CachedBdbMap with its backing bdbje database.
Parameters:
  dbName - Name of the backing db this instance should use.



CachedBdbMap
public CachedBdbMap(File dbDir, String dbName, Class<K> keyClass, Class<V> valueClass) throws DatabaseException(Code)
A constructor for creating a new CachedBdbMap. Even though the put and get methods conforms to the Collections interface taking any object as key or value, you have to submit the class of the allowed key and value objects here and will get an exception if you try to put anything else in the map.

This constructor internally calls CachedBdbMap.initialize(Environment,Class,Class,StoredClassCatalog) . Do not call initialize if you use this constructor.
Parameters:
  dbDir - The directory where the database will be created.
Parameters:
  dbName - The name of the database to back this map by.
Parameters:
  keyClass - The class of the objects allowed as keys.
Parameters:
  valueClass - The class of the objects allowed as values.
throws:
  DatabaseException - is thrown if the underlying BDB JE databasethrows an exception.





Method Detail
clear
public synchronized void clear()(Code)
Note that a call to this method CLOSEs the underlying bdbje. This instance is no longer of any use. It must be re-initialized. We close the db here because if this BigMap is being treated as a plain Map, this is only opportunity for cleanup.



close
public synchronized void close() throws DatabaseException(Code)



containsKey
public synchronized boolean containsKey(Object key)(Code)



containsValue
public synchronized boolean containsValue(Object value)(Code)



createDiskMap
protected StoredSortedMap createDiskMap(Database database, StoredClassCatalog classCatalog, Class keyClass, Class valueClass)(Code)



entrySet
public Set<Map.Entry<K, V>> entrySet()(Code)



finalize
protected void finalize() throws Throwable(Code)



get
public synchronized V get(Object object)(Code)



getDatabaseName
protected String getDatabaseName()(Code)



initialize
public synchronized void initialize(Environment env, Class keyClass, Class valueClass, StoredClassCatalog classCatalog) throws DatabaseException(Code)
Call this method when you have an instance when you used the default constructor or when you have a deserialized instance that you want to reconnect with an extant bdbje environment. Do not call this method if you used the CachedBdbMap.CachedBdbMap(File,String,Class,Class) constructor.
Parameters:
  env -
Parameters:
  keyClass -
Parameters:
  valueClass -
Parameters:
  classCatalog -
throws:
  DatabaseException -



initializeInstance
protected void initializeInstance()(Code)
Do any instance setup. This method is used by constructors and when deserializing an instance.



keySet
public Set<K> keySet()(Code)
The keySet of the diskMap is all relevant keys.
See Also:   java.util.Map.keySet



openDatabase
protected Database openDatabase(Environment environment, String dbName) throws DatabaseException(Code)



put
public synchronized V put(K key, V value)(Code)



quickContainsKey
public synchronized boolean quickContainsKey(Object key)(Code)



quickContainsValue
public synchronized boolean quickContainsValue(Object value)(Code)



remove
public synchronized V remove(Object key)(Code)



size
public int size()(Code)



sync
public synchronized void sync()(Code)
Sync in-memory map entries to backing disk store. When done, the memory map will be cleared and all entries stored on disk.



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