org.garret.perst
Class StorageListener

java.lang.Object
  extended byorg.garret.perst.StorageListener

public abstract class StorageListener
extends java.lang.Object

Listener of database events. Programmer should derive his own subclass and register it using Storage.setListener method.


Constructor Summary
StorageListener()
           
 
Method Summary
 void databaseCorrupted()
          This metod is called during database open when database was not close normally and has to be recovered
 void deallocateObject(java.lang.Class cls, int oid)
          This method is called when unreferenced object is deallocated from database.
 void gcCompleted(int nDeallocatedObjects)
          This method is called when garbage collection is completed
 void gcStarted()
          This method is called when garbage collection is started (ether explicitly by invocation of Storage.gc() method, either implicitly after allocation of some amount of memory)).
 void JSQLRuntimeError(JSQLRuntimeException x)
          This method is called when runtime error happen during execution of JSQL query
 void recoveryCompleted()
          This method is called after completion of recovery
 boolean replicationError(java.lang.String host)
          Handle replication error
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

StorageListener

public StorageListener()
Method Detail

databaseCorrupted

public void databaseCorrupted()
This metod is called during database open when database was not close normally and has to be recovered


deallocateObject

public void deallocateObject(java.lang.Class cls,
                             int oid)
This method is called when unreferenced object is deallocated from database. It is possible to get instance of the object using Storage.getObjectByOid() method.

Parameters:
cls - class of deallocated object
oid - object identifier of deallocated object

gcCompleted

public void gcCompleted(int nDeallocatedObjects)
This method is called when garbage collection is completed

Parameters:
nDeallocatedObjects - number of deallocated objects

gcStarted

public void gcStarted()
This method is called when garbage collection is started (ether explicitly by invocation of Storage.gc() method, either implicitly after allocation of some amount of memory)).


JSQLRuntimeError

public void JSQLRuntimeError(JSQLRuntimeException x)
This method is called when runtime error happen during execution of JSQL query


recoveryCompleted

public void recoveryCompleted()
This method is called after completion of recovery


replicationError

public boolean replicationError(java.lang.String host)
Handle replication error

Parameters:
host - address of host replication to which is failed (null if error jappens at slave node)
Returns:
true if host should be reconnected and attempt to send data to it should be repeated, false if no more attmpts to communicate with this host should be performed