de.infinityloop.util.log
Interface LogListener

All Known Implementing Classes:
LogEventAggregator, LogEventCollector, LoggingBridge, LogListenerImpl

public interface LogListener

A class that wants to subscribe to a LogBroadcaster must implement this interface.

Author:
Christian Roth

Method Summary
 void addedTo(LogBroadcaster le)
          This method is called whenever this LogSubscriber is successfully attached to a LogBroadcaster.
 boolean receiveLogEvent(LogEvent le)
          This method is called whenever a new log event has arrived for the subscriber to handle.
 void removedFrom(LogBroadcaster le)
          This method is called whenever this LogListener is removed from a LogBroadcaster.
 

Method Detail

receiveLogEvent

boolean receiveLogEvent(LogEvent le)
This method is called whenever a new log event has arrived for the subscriber to handle.

Returns:
when true, the log event was accepted by the listener's filter configuration, false otherwise LogSubscribers.

addedTo

void addedTo(LogBroadcaster le)
This method is called whenever this LogSubscriber is successfully attached to a LogBroadcaster. The LogSubscriber can use this event to keep a list of LogBroadcasters it is subscribed to, so it can easily remove itself from those when itself wants to get garbage-collected.


removedFrom

void removedFrom(LogBroadcaster le)
This method is called whenever this LogListener is removed from a LogBroadcaster. The LogBroadcaster can use this event to update its list of LogBroadcaster it is subscribed to.