stella.log
Class AbstractLogger
java.lang.Object
util.PropertyContainer
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.
|
Constructor Summary |
protected |
AbstractLogger(Map prop)
Constructs a new logger with the given properties. |
| 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 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 |
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.
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()