stella.log
Interface Logging

All Superinterfaces:
EventListener, PropertySupplying
All Known Implementing Classes:
AbstractLogger, DatabaseNow, ErrorEcho

public interface Logging
extends EventListener, PropertySupplying

The interface denoting logging capabilities. Any logger should run as an independent thread therefore it extends the Runnable interface. It also acts as an event listener and consequentally extends the EventListener marker interface. To provide some capabilities to assign properties to a logger, this interface extends the PropertySupplying interface. Note that concrete implementations should provide a constructor that uses a Properties object as a single argument.

Loggers are used in the main STELLA control unit, the MasterMind. Herein they are constructed and started as individual threads. All Caster objects found in MasterMind are registered to the Logger with registerCaster(stella.Caster). Derigstering from a Caster is done with deregisterCaster(stella.Caster).

No further care is taken of any logger, it must be able to conduct its functionality entirely independent.
Note that loggers that implement the ExitCleaning or CancelRunnable interface are orderly shut down in the master mind on system exit.


Field Summary
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Method Summary
 boolean deregisterCaster(Caster caster)
          Removes the logger from the listener list of the stated caster.
 Thread getLoggerThread(ThreadGroup group)
          Returns the thread the logger wants to run in.
 boolean registerCaster(Caster caster)
          Test if the logger wants to register himself as a event listener to the specified caster.
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 

Method Detail

registerCaster

boolean registerCaster(Caster caster)
Test if the logger wants to register himself as a event listener to the specified caster. If the logger is interested in receiving events from the specific caster, it registers itself at this caster and returns true. If this logger is not interested in the events produced by this caster, false is returned.


deregisterCaster

boolean deregisterCaster(Caster caster)
Removes the logger from the listener list of the stated caster. If the logger is not interested in events from this caster, false is returned.


getLoggerThread

Thread getLoggerThread(ThreadGroup group)
Returns the thread the logger wants to run in. It is the logger's responsibility to set the correct priority and name of the thread. If the logger does not need an individual thread to run in this method should return null.

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