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

java.lang.Object
  extended bynet.sourceforge.groboutils.codecoverage.v2.logger.AbstractSingleSourceLoggerFactory
All Implemented Interfaces:
IChannelLoggerFactory, ISingleSource, java.lang.Runnable
Direct Known Subclasses:
FileSingleSourceLoggerFactory

public abstract class AbstractSingleSourceLoggerFactory
extends java.lang.Object
implements ISingleSource, IChannelLoggerFactory, java.lang.Runnable

A shared mark writer.

Since:
April 16, 2004
Version:
$Date: 2004/07/07 09:39:10 $
Author:
Matt Albrecht groboclown@users.sourceforge.net

Field Summary
static java.lang.String MILLIS_PER_FLUSH_PROP
           
static java.lang.String USE_CACHE_PROP
           
static java.lang.String WRITES_PER_FLUSH_PROP
           
 
Constructor Summary
AbstractSingleSourceLoggerFactory()
           
 
Method Summary
protected  void addShutdownHook()
           
 void cover(short channelIndex, java.lang.String classSig, short methodIndex, short markIndex)
          Outputs all the data associated with a probe to the shared single source.
 IChannelLogger createChannelLogger(java.lang.String propertyPrefix, java.util.Properties props, short channelIndex)
          Creates a specific logger type.
 void run()
          This is the shutdown hook.
protected  void setReloadSourceAfterError(boolean yes)
          Set to true if you want to try to reconnect to the source everytime the I/O write fails.
protected  void setupProps(java.lang.String prefix, java.util.Properties props)
          Extend this method to setup your own properties.
protected abstract  java.io.Writer setupSource()
          Setup the source writer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WRITES_PER_FLUSH_PROP

public static final java.lang.String WRITES_PER_FLUSH_PROP
See Also:
Constant Field Values

MILLIS_PER_FLUSH_PROP

public static final java.lang.String MILLIS_PER_FLUSH_PROP
See Also:
Constant Field Values

USE_CACHE_PROP

public static final java.lang.String USE_CACHE_PROP
See Also:
Constant Field Values
Constructor Detail

AbstractSingleSourceLoggerFactory

public AbstractSingleSourceLoggerFactory()
Method Detail

createChannelLogger

public IChannelLogger createChannelLogger(java.lang.String propertyPrefix,
                                          java.util.Properties props,
                                          short channelIndex)
Description copied from interface: IChannelLoggerFactory
Creates a specific logger type. Initializes the logger based on the given collection of properties.

Specified by:
createChannelLogger in interface IChannelLoggerFactory
Parameters:
propertyPrefix - the prefix that all logger properties will begin with. Expect all logger-specific properties to be appended directly to this string.
props - the property collection to pull the logger properties from.
channelIndex - channel number to log to.
Returns:
the initialized logger.

cover

public void cover(short channelIndex,
                  java.lang.String classSig,
                  short methodIndex,
                  short markIndex)
Outputs all the data associated with a probe to the shared single source. This class manages its own buffering for safety.

Specified by:
cover in interface ISingleSource

run

public void run()
This is the shutdown hook. We flush the buffer to the source, then we call close() on the writer.

Specified by:
run in interface java.lang.Runnable

setupSource

protected abstract java.io.Writer setupSource()
Setup the source writer. This can return null. Its actions will be synchronized for you.


setupProps

protected void setupProps(java.lang.String prefix,
                          java.util.Properties props)
Extend this method to setup your own properties. Be sure to call the super's setupProps, though. Be sure to keep the properties around for how to connect to the source.


setReloadSourceAfterError

protected void setReloadSourceAfterError(boolean yes)
Set to true if you want to try to reconnect to the source everytime the I/O write fails. This can be changed at any time.


addShutdownHook

protected void addShutdownHook()


Copyright © 2001-2003 by The GroboUtils Project