ru.biosoft.access
Class DefaultQuerySystem

java.lang.Object
  extended byru.biosoft.access.DefaultQuerySystem
All Implemented Interfaces:
DataCollectionListener, java.util.EventListener, QuerySystem

public class DefaultQuerySystem
extends java.lang.Object
implements QuerySystem

DefaultQuerySystem loads indexes based on information from DataCollectionInfo. Generally this information is stored in config file in following form:

 querySystem = ru.biosoft.access.DefaultQuerySystem
 querySystem.indexes = title;other
 index.title = biouml.standard.type.access.TitleSqlIndex
 index.title.table = substances
 index.other = com.xxx.Index
 

Pendung:
indexes update when data collection is changed.

Field Summary
protected static org.apache.log4j.Category cat
           
protected  java.util.HashMap indexes
           
 
Fields inherited from interface ru.biosoft.access.QuerySystem
INDEX_BLOCK_SIZE, INDEX_LIST, QUERY_SYSTEM_CLASS
 
Constructor Summary
DefaultQuerySystem(DataCollection dc)
           
 
Method Summary
 void close()
          Closes all indexes and releases any system resources associated with them stream.
 void elementAdded(DataCollectionEvent e)
          Called after data element was added.
 void elementChanged(DataCollectionEvent e)
          Called after data element was changed.
 void elementRemoved(DataCollectionEvent e)
          Called after data element was removed.
 void elementWillAdd(DataCollectionEvent e)
          Called before data element will be added.
 void elementWillChange(DataCollectionEvent e)
          Called before data element will be changed.
 void elementWillRemove(DataCollectionEvent e)
          Called before data element will be removed.
protected  void finalize()
           
 Index getIndex(java.lang.String name)
           
 Index[] getIndexes()
           
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cat

protected static org.apache.log4j.Category cat

indexes

protected java.util.HashMap indexes
Constructor Detail

DefaultQuerySystem

public DefaultQuerySystem(DataCollection dc)
Method Detail

getIndexes

public Index[] getIndexes()
Specified by:
getIndexes in interface QuerySystem
Returns:
all indexes supported by this QuerySystem.

getIndex

public Index getIndex(java.lang.String name)
Specified by:
getIndex in interface QuerySystem
Returns:
index by its name

finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable

close

public void close()
Closes all indexes and releases any system resources associated with them stream. A closed QuerySystem cannot be reopened.

Specified by:
close in interface QuerySystem

elementAdded

public void elementAdded(DataCollectionEvent e)
                  throws java.lang.Exception
Description copied from interface: DataCollectionListener
Called after data element was added.

Specified by:
elementAdded in interface DataCollectionListener
Parameters:
e - DataCollectionEvent information about added data element.
Throws:
java.lang.Exception - If error occured.

elementWillAdd

public void elementWillAdd(DataCollectionEvent e)
                    throws DataCollectionVetoException,
                           java.lang.Exception
Description copied from interface: DataCollectionListener
Called before data element will be added.

Specified by:
elementWillAdd in interface DataCollectionListener
Parameters:
e - DataCollectionEvent information about will added data element.
Throws:
DataCollectionVetoException - If listener cancel adding of data element.
java.lang.Exception - If error occured.

elementChanged

public void elementChanged(DataCollectionEvent e)
                    throws java.lang.Exception
Description copied from interface: DataCollectionListener
Called after data element was changed. e contains old data element (which already changed).

Specified by:
elementChanged in interface DataCollectionListener
Parameters:
e - DataCollectionEvent information about changed data element.
Throws:
java.lang.Exception - If error occured.

elementWillChange

public void elementWillChange(DataCollectionEvent e)
                       throws DataCollectionVetoException,
                              java.lang.Exception
Description copied from interface: DataCollectionListener
Called before data element will be changed. e contains old data element (which will be changed).

Specified by:
elementWillChange in interface DataCollectionListener
Parameters:
e - DataCollectionEvent information about will change data element.
Throws:
DataCollectionVetoException - If listener cancel changing of data element.
java.lang.Exception - If error occured.

elementRemoved

public void elementRemoved(DataCollectionEvent e)
                    throws java.lang.Exception
Description copied from interface: DataCollectionListener
Called after data element was removed.

Specified by:
elementRemoved in interface DataCollectionListener
Parameters:
e - DataCollectionEvent information about removed data element.
Throws:
java.lang.Exception - If error occured.

elementWillRemove

public void elementWillRemove(DataCollectionEvent e)
                       throws DataCollectionVetoException,
                              java.lang.Exception
Description copied from interface: DataCollectionListener
Called before data element will be removed.

Specified by:
elementWillRemove in interface DataCollectionListener
Parameters:
e - DataCollectionEvent information about will removed data element.
Throws:
DataCollectionVetoException - If listener cancel removing of data element.
java.lang.Exception - If error occured.


Copyright © 2001-2003 Biosof.Ru. All Rights Reserved.