stella.log
Class AbstractLogger

java.lang.Object
  extended by util.PropertyContainer
      extended by stella.log.AbstractLogger
All Implemented Interfaces:
Cloneable, EventListener, Logging, Initializable, PropertyBearing
Direct Known Subclasses:
ErrorEcho

public abstract class AbstractLogger
extends PropertyContainer
implements Logging

An abstract implementation of the Logging interface. Any logger, should extend this class and provide implementation to the crucial logger methods.

This class allows construction of a logger with a Map object for convenience of further use.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyContainer
PropertyContainer.URLResource
 
Field Summary
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR, KEY_NOINITONCREATE, KEY_RESOURCEBUNDLES
 
Fields inherited from interface util.PropertyBearing
CONFIG, KEY_CLASS, KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
protected AbstractLogger(Map prop)
          Constructs a new logger with the given properties.
 
Method Summary
static Logging createLogger(Map prop)
          Constructs a new logging instance using the mapping of the PropertyBearing.KEY_CLASS to the class name to derive the class to instantiate.
 Thread getAsociatedThread()
          Returns null.
 Thread getLoggerThread(ThreadGroup group)
          Returns null.
 long maxTimeToCancel()
          Returns zero.
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, clone, createFrom, createFrom, createFrom, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getLocalClassLoader, getLocalized, getLocalized, getLocalizedString, getLocalizedString, getProperties, getPropertiesToKey, getPropertiesToKey, getProperty, getResource, getResourceAsStream, getResourceFromKey, getResources, has, init, isNew, keyCreate, keyCreate, parseObject, reload, reload, removeProperty, rescanned, setObject, setProperties, setProperty, stringProperties, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.log.Logging
deregisterCaster, registerCaster
 
Methods inherited from interface util.PropertyBearing
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getLocalized, getProperties, getProperty, getResource, getResourceAsStream, getResources, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Constructor Detail

AbstractLogger

protected AbstractLogger(Map prop)
Constructs a new logger with the given properties. The PropertyBearing.KEY_CLASS is always specified when this constructer is used.

Method Detail

createLogger

public static final Logging createLogger(Map prop)
Constructs a new logging instance using the mapping of the PropertyBearing.KEY_CLASS to the class name to derive the class to instantiate. If this property is defined, a new logging instance with the stated class name is created, the supplied properties used as an argument in the constructor. Can throw a lot of exceptions if unsuccessful.


getLoggerThread

public Thread getLoggerThread(ThreadGroup group)
Returns null. This means that default loggers do not need a thread to run in. All tasks are handled with the appropriate listener methods. If different behaviour is intended daugther class must override this method.

Specified by:
getLoggerThread in interface Logging
Parameters:
group - The thread group the logger must run in.
Returns:
A thread that can be started with start().

getAsociatedThread

public Thread getAsociatedThread()
Returns null. This means that default loggers do not run in any thread.


maxTimeToCancel

public long maxTimeToCancel()
Returns zero. This means that default loggers do not need any time to cancel, because no thread is asociated with them.

See Also:
getAsociatedThread()