org.codehaus.spice.loggerstore.factories
Class AbstractLoggerStoreFactory

java.lang.Object
  |
  +--org.jcontainer.dna.AbstractLogEnabled
        |
        +--org.codehaus.spice.loggerstore.factories.AbstractLoggerStoreFactory
All Implemented Interfaces:
LogEnabled, LoggerStoreFactory
Direct Known Subclasses:
ConsoleLoggerStoreFactory, DOMLog4JLoggerStoreFactory, Jdk14LoggerStoreFactory, LogKitLoggerStoreFactory, PropertyLog4JLoggerStoreFactory

public abstract class AbstractLoggerStoreFactory
extends AbstractLogEnabled
implements LoggerStoreFactory

The abstract class that makes it easy to create LoggerStoreFactory implementations.

Version:
$Revision: 1.1 $ $Date: 2003/11/19 18:22:44 $
Author:
Peter Donald
, Mauro Talevi

Field Summary
 
Fields inherited from interface org.codehaus.spice.loggerstore.LoggerStoreFactory
FILE_LOCATION, URL_LOCATION
 
Constructor Summary
AbstractLoggerStoreFactory()
           
 
Method Summary
 LoggerStore createLoggerStore(Map config)
          Creates a LoggerStore from a given set of configuration parameters.
protected abstract  LoggerStore doCreateLoggerStore(Map config)
           
protected  InputStream getInputStream(Map config)
          A utility method to retrieve a InputStream from input map.
protected  LoggerStore missingConfiguration()
          Utility method to throw exception indicating input data was invalid.
 
Methods inherited from class org.jcontainer.dna.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractLoggerStoreFactory

public AbstractLoggerStoreFactory()
Method Detail

createLoggerStore

public LoggerStore createLoggerStore(Map config)
                              throws Exception
Creates a LoggerStore from a given set of configuration parameters. The configuration map contains entrys specific to the concrete implementation.

Specified by:
createLoggerStore in interface LoggerStoreFactory
Parameters:
config - the parameter map to configuration of the store
Returns:
the LoggerStore
Throws:
Exception - if unable to create the LoggerStore

doCreateLoggerStore

protected abstract LoggerStore doCreateLoggerStore(Map config)
                                            throws Exception
Exception

missingConfiguration

protected LoggerStore missingConfiguration()
                                    throws Exception
Utility method to throw exception indicating input data was invalid.

Returns:
never returns
Throws:
Exception - indicating input data was invalid

getInputStream

protected InputStream getInputStream(Map config)
                              throws Exception
A utility method to retrieve a InputStream from input map. It will systematically go through the following steps to attempt to locate the InputStream stopping at success.

Parameters:
config - the input map
Returns:
the InputStream or null if no stream present
Throws:
Exception - if there was a problem aquiring stream


Copyright © 2003 Codehaus. All Rights Reserved.