org.sourceforge.jemm.database.components
Class DefaultDBDebugHandler

java.lang.Object
  extended by org.sourceforge.jemm.database.components.DefaultDBDebugHandler
All Implemented Interfaces:
DatabaseDebugIF

public class DefaultDBDebugHandler
extends java.lang.Object
implements DatabaseDebugIF

Author:
Rory Graves

Constructor Summary
DefaultDBDebugHandler(DBObjectHandler objectHandler, DBClientRefHandler clientRefHandler, DBGarbageSweeper gcHandler)
          Creates a debug handler for a database.
 
Method Summary
 int getObjectCount()
           
 boolean isClientReferenceHeld(ClientId clientId, ID id)
          Returns whether within parent database the given client has a reference to the given object.
 int noLocksHeld()
           
 void triggerGCCycle()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultDBDebugHandler

public DefaultDBDebugHandler(DBObjectHandler objectHandler,
                             DBClientRefHandler clientRefHandler,
                             DBGarbageSweeper gcHandler)
Creates a debug handler for a database.

Parameters:
objectHandler - The core object handler.
clientRefHandler - The client reference handler.
gcHandler - The database garbage sweeper.
Method Detail

isClientReferenceHeld

public boolean isClientReferenceHeld(ClientId clientId,
                                     ID id)
Description copied from interface: DatabaseDebugIF
Returns whether within parent database the given client has a reference to the given object.

Specified by:
isClientReferenceHeld in interface DatabaseDebugIF
Parameters:
clientId - The id of the client.
id - The id of the object.
Returns:
True if the given client holds a reference to object 'id'.

triggerGCCycle

public void triggerGCCycle()
Specified by:
triggerGCCycle in interface DatabaseDebugIF

getObjectCount

public int getObjectCount()
Specified by:
getObjectCount in interface DatabaseDebugIF
Returns:
The number of objects stored in the database.

noLocksHeld

public int noLocksHeld()
Specified by:
noLocksHeld in interface DatabaseDebugIF


Copyright © 2009. All Rights Reserved.