Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep

gnu.classpath.tools.rmi
Class PersistentBidiHashTable  view PersistentBidiHashTable download PersistentBidiHashTable.java

java.lang.Object
  extended bygnu.java.rmi.activation.BidiTable
      extended bygnu.classpath.tools.rmi.PersistentBidiHashTable
All Implemented Interfaces:
Persistent

public class PersistentBidiHashTable
extends gnu.java.rmi.activation.BidiTable
implements Persistent

The persistent bidirectional hash table, maps both a to b and b to a. The changes are written to dist after SAVE_AT_MOST_AFTER time from the latest database change or at most after ALWAYS_UPDATE, if the database is updated very frequently. To ensure that no information is lost, the shutdown method must be called before exit.


Nested Class Summary
(package private)  class PersistentBidiHashTable.AdaptedReader
          Replaces instances of ActivationSystemImpl into the currently active instance of the ActivationSystemImpl
(package private)  class PersistentBidiHashTable.WriteToDiskTask
           
 
Nested classes inherited from class gnu.classpath.tools.rmi.Persistent
Persistent.ExitTask
 
Field Summary
(package private)  java.io.File database
          The database file.
(package private)  long lastUpdated
          The time, when the disk database was last updated.
(package private)  PersistentBidiHashTable.WriteToDiskTask sheduled
          The currently sheduled write to disk task, null if none.
 
Fields inherited from class gnu.java.rmi.activation.BidiTable
k2v, v2k
 
Fields inherited from interface gnu.classpath.tools.rmi.Persistent
ALWAYS_UPDATE, SAVE_AT_MOST_AFTER, timer
 
Constructor Summary
PersistentBidiHashTable()
          Create the unitialised instance that must be initalised when ActivationSystemImpl.singleton2 is assigned.
 
Method Summary
 void init(java.io.File file, boolean coldStart)
          Create a new persistent table that stores its information into the given file.
 void markDirty()
          Mark the modified database as modified.
 void put(java.lang.Object key, java.lang.Object value)
          Update the memory maps and mark as should be written to the disk.
 void removeKey(java.lang.Object key)
          Update the memory maps and mark as should be written to the disk.
 void shutdown()
          Save the current database state to the disk before exit.
 void writeContent()
          Write the database content to the disk.
 
Methods inherited from class gnu.java.rmi.activation.BidiTable
containsKey, get, getKey, keys, size
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

database

java.io.File database
The database file.


sheduled

PersistentBidiHashTable.WriteToDiskTask sheduled
The currently sheduled write to disk task, null if none.


lastUpdated

long lastUpdated
The time, when the disk database was last updated.

Constructor Detail

PersistentBidiHashTable

public PersistentBidiHashTable()
Create the unitialised instance that must be initalised when ActivationSystemImpl.singleton2 is assigned.

Method Detail

init

public void init(java.io.File file,
                 boolean coldStart)
Create a new persistent table that stores its information into the given file. The ActivationSystemImpl.singleton2 must be assigned.


writeContent

public void writeContent()
Write the database content to the disk.

Specified by:
writeContent in interface Persistent

markDirty

public void markDirty()
Mark the modified database as modified. The database will be written after several seconds, unless another modification occurs.


shutdown

public void shutdown()
Save the current database state to the disk before exit.


put

public void put(java.lang.Object key,
                java.lang.Object value)
Update the memory maps and mark as should be written to the disk.


removeKey

public void removeKey(java.lang.Object key)
Update the memory maps and mark as should be written to the disk.