org.openorb.pss.connector.file
Class DataManager

java.lang.Object
  extended by org.openorb.pss.connector.file.DataManager
Direct Known Subclasses:
TransactionalDataManager

public class DataManager
extends java.lang.Object

A data manager manages data entries into a persistent file storage.

Author:
Jerome Daniel

Constructor Summary
DataManager()
          Constuctor used for transaction delegation.
DataManager(java.lang.String home_name, java.lang.String datastore_name, org.omg.PortableInterceptor.ORBInitInfo info)
          Constructor
 
Method Summary
 void addListener(java.lang.Thread thread, TransactionalDataManagerSerializable tmz)
          Add a listener
 void close()
           
 java.util.Enumeration content()
          Return the datastore content under an enumeration format
 long datastoreSize()
          Return the datastore length
 void destroy()
          This operation is used to destroy the datastore
 void finalize()
          Finalize operation
 void flush()
           
 void free_all()
           
 java.util.Hashtable get_clean_table()
          Return the clean index table
 java.util.Hashtable get_index_table()
          Return the index table
 java.lang.String home()
          Return home base name
 void invalidate_entry(PID pid)
          Invalidate an entry
 java.lang.String key()
          Return the hashtable key
 void lock_flush(boolean lock)
          Disable or enable flush
 java.lang.Object lock()
          Return the current lock
 long nextFreeID()
          This operation returns a new free ID.
 DataEntry read_entry_from_clean_table(PID pid)
          Read an entry from its PID.
 DataEntry read_entry_from_index(org.omg.CORBA.LongHolder index)
          The operation reads an entry from its PID.
 DataEntry read_entry(PID pid)
          Read an entry from its PID.
 void share()
          Increment the shared value counter
 boolean shared()
          Is this data manager shared ?
 boolean transaction_lock()
          Return true if this data manager is locked for a transaction
 void transaction_lock(TransactionalDataManagerSerializable lock)
          Set the lock value
 void transaction_unlock()
          Unlock this data manager for another transaction
 void write_entry(DataEntry entry)
          Add a data into the cache.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataManager

public DataManager(java.lang.String home_name,
                   java.lang.String datastore_name,
                   org.omg.PortableInterceptor.ORBInitInfo info)
Constructor


DataManager

public DataManager()
Constuctor used for transaction delegation.

Method Detail

share

public void share()
Increment the shared value counter


shared

public boolean shared()
Is this data manager shared ?


transaction_lock

public boolean transaction_lock()
Return true if this data manager is locked for a transaction


transaction_unlock

public void transaction_unlock()
Unlock this data manager for another transaction


transaction_lock

public void transaction_lock(TransactionalDataManagerSerializable lock)
Set the lock value


addListener

public void addListener(java.lang.Thread thread,
                        TransactionalDataManagerSerializable tmz)
Add a listener


key

public java.lang.String key()
Return the hashtable key


finalize

public void finalize()
Finalize operation

Overrides:
finalize in class java.lang.Object

read_entry

public DataEntry read_entry(PID pid)
                     throws NotFoundException
Read an entry from its PID. If the entry is already in the cache, return it.

Throws:
NotFoundException

read_entry_from_clean_table

public DataEntry read_entry_from_clean_table(PID pid)
                                      throws NotFoundException
Read an entry from its PID. If the entry is already in the cache, return it.

Throws:
NotFoundException

invalidate_entry

public void invalidate_entry(PID pid)
Invalidate an entry


write_entry

public void write_entry(DataEntry entry)
Add a data into the cache.


flush

public void flush()

free_all

public void free_all()

close

public void close()

nextFreeID

public long nextFreeID()
This operation returns a new free ID.


destroy

public void destroy()
This operation is used to destroy the datastore


read_entry_from_index

public DataEntry read_entry_from_index(org.omg.CORBA.LongHolder index)
The operation reads an entry from its PID.


lock_flush

public void lock_flush(boolean lock)
Disable or enable flush


home

public java.lang.String home()
Return home base name


content

public java.util.Enumeration content()
Return the datastore content under an enumeration format


datastoreSize

public long datastoreSize()
Return the datastore length


get_index_table

public java.util.Hashtable get_index_table()
Return the index table


get_clean_table

public java.util.Hashtable get_clean_table()
Return the clean index table


lock

public java.lang.Object lock()
Return the current lock