net.sourceforge.groboutils.codecoverage.v2.logger
Class CacheDirChannelLogger

java.lang.Object
  extended bynet.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLogger
      extended bynet.sourceforge.groboutils.codecoverage.v2.logger.CacheDirChannelLogger
All Implemented Interfaces:
HashCache.ObjectManager, IChannelLogger, java.lang.Runnable

public class CacheDirChannelLogger
extends DirectoryChannelLogger
implements java.lang.Runnable, HashCache.ObjectManager

This is the same as the DirectoryChannelLogger, except that the open files are cached for access.

Since:
May 9, 2003
Version:
$Date: 2003/05/23 22:37:56 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Field Summary
 
Fields inherited from class net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLogger
baseDir, CLASS_LOG_EXTENTION
 
Constructor Summary
CacheDirChannelLogger(java.io.File baseDir, int cacheSize)
           
 
Method Summary
protected  void addShutdownHook()
           
 void cleanUpObject(java.lang.Object key, java.lang.Object obj)
          Called by HashCache when the given object is being removed from the cache.
 void cover(java.lang.String classSignature, short methodIndex, short markIndex)
          Records a coverage of a marked bytecode instruction.
 java.lang.Object createObject(java.lang.Object key)
          Called by the HashCache
protected  void finalize()
           
 void run()
          Called when the shutdown hook is called.
 
Methods inherited from class net.sourceforge.groboutils.codecoverage.v2.logger.DirectoryChannelLogger
createCoverString, getClassFile
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CacheDirChannelLogger

public CacheDirChannelLogger(java.io.File baseDir,
                             int cacheSize)
Method Detail

cover

public void cover(java.lang.String classSignature,
                  short methodIndex,
                  short markIndex)
Records a coverage of a marked bytecode instruction. This method should never throw an exception.

Specified by:
cover in interface IChannelLogger
Overrides:
cover in class DirectoryChannelLogger
Parameters:
classSignature - a signature of the class file being covered. this signature includes the fully-qualified name of the class, along with a checksum to uniquely identify it.
methodIndex - index for a method within the class. The meta-data store will know how to translate the index to a method signature.
markIndex - the index of the bytecode instruction mark for this particular channel.

run

public void run()
Called when the shutdown hook is called.

Specified by:
run in interface java.lang.Runnable

createObject

public java.lang.Object createObject(java.lang.Object key)
Called by the HashCache

Specified by:
createObject in interface HashCache.ObjectManager
Parameters:
key - the key associated with the created object.
Returns:
the newly created object

cleanUpObject

public void cleanUpObject(java.lang.Object key,
                          java.lang.Object obj)
Called by HashCache when the given object is being removed from the cache.

Specified by:
cleanUpObject in interface HashCache.ObjectManager
Parameters:
key - the key associated with the object.
obj - the object being cleaned up.

finalize

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

addShutdownHook

protected void addShutdownHook()


Copyright © 2001-2003 by The GroboUtils Project