Log4j 1.3alpha-4

org.apache.log4j.chainsaw
Interface EventContainer

All Superinterfaces:
LoggerNameModel, SortTableModel, javax.swing.table.TableModel

public interface EventContainer
extends SortTableModel, LoggerNameModel

To allow pluggable TableModel implementations for Chainsaw, this interface has been factored out. This interface is still subject to change.

Author:
Paul Smith , Scott Deboy , Stephen Pain

Method Summary
 void addEventCountListener(EventCountListener listener)
          Adds an EventCountListener, to be notified when the # of events changes
 void addNewKeyListener(NewKeyListener l)
          Adds a NewKeyListener to be notified when unique Key (Property keys) arrive into this EventContainer
 void addPropertyChangeListener(java.beans.PropertyChangeListener l)
           
 void addPropertyChangeListener(java.lang.String propertyName, java.beans.PropertyChangeListener l)
           
 void clearModel()
          Clears the model completely
 int find(Rule rule, int startRow, boolean searchForward)
          Locates a row number, starting from startRow, matching the rule provided
 void fireTableEvent(int begin, int end, int count)
          Fire appropriate table update events for the range.
 java.util.List getAllEvents()
          Returns a copied list of all the event in the model.
 java.util.List getFilteredEvents()
          Returns a copied list containing the events in the model with filter applied
 int getLastAdded()
          Return the last added row.
 java.util.List getMatchingEvents(Rule rule)
           
 int getMaxSize()
          If this container is in Cyclic mode, returns the Size of the cyclic buffer, otherwise this method throws an IllegalStateException, when in unlimited mode, this method has no meaning.
 LoggingEvent getRow(int row)
          Returns the vector representing the row.
 int getRowIndex(LoggingEvent e)
          Returns the index of the LoggingEvent
 boolean isAddRow(LoggingEvent e, boolean valueIsAdjusting)
          Adds a row to the model.
 boolean isCyclic()
          Returns true if this model is Cyclic (bounded) or not.
 void notifyCountListeners()
          Allow a forced notification of the EventCountListeners
 void removeNewKeyListener(NewKeyListener l)
          Removes a listener from being notified of NewKey events.
 void setCyclic(boolean cyclic)
          Configures this model to use Cyclic or non-cyclic models.
 void setDisplayRule(Rule displayRule)
          Sets the DisplayFilter in operation
 int size()
          Returns the total number of events currently in the model (all, not just filtered)
 
Methods inherited from interface org.apache.log4j.chainsaw.SortTableModel
isSortable, isSortEnabled, sort, sortColumn
 
Methods inherited from interface javax.swing.table.TableModel
addTableModelListener, getColumnClass, getColumnCount, getColumnName, getRowCount, getValueAt, isCellEditable, removeTableModelListener, setValueAt
 
Methods inherited from interface org.apache.log4j.chainsaw.LoggerNameModel
addLoggerName, addLoggerNameListener, getLoggerNames, removeLoggerNameListener
 

Method Detail

addEventCountListener

public void addEventCountListener(EventCountListener listener)
Adds an EventCountListener, to be notified when the # of events changes

Parameters:
listener -

addPropertyChangeListener

public void addPropertyChangeListener(java.beans.PropertyChangeListener l)

addPropertyChangeListener

public void addPropertyChangeListener(java.lang.String propertyName,
                                      java.beans.PropertyChangeListener l)

addNewKeyListener

public void addNewKeyListener(NewKeyListener l)
Adds a NewKeyListener to be notified when unique Key (Property keys) arrive into this EventContainer

Parameters:
l -

removeNewKeyListener

public void removeNewKeyListener(NewKeyListener l)
Removes a listener from being notified of NewKey events.

Parameters:
l -

clearModel

public void clearModel()
Clears the model completely


getMatchingEvents

public java.util.List getMatchingEvents(Rule rule)

isCyclic

public boolean isCyclic()
Returns true if this model is Cyclic (bounded) or not.

Returns:
true/false

setCyclic

public void setCyclic(boolean cyclic)
Configures this model to use Cyclic or non-cyclic models. This method should fire a property Change event if it involves an actual change in the underlying model. This method does nothing if there is no change in proprty.

Parameters:
cyclic -

getMaxSize

public int getMaxSize()
If this container is in Cyclic mode, returns the Size of the cyclic buffer, otherwise this method throws an IllegalStateException, when in unlimited mode, this method has no meaning.

Returns:
int size of the cyclic buffer
Throws:
java.lang.IllegalStateException - if this containers isCyclic() method returns false.

find

public int find(Rule rule,
                int startRow,
                boolean searchForward)
Locates a row number, starting from startRow, matching the rule provided

Parameters:
rule -
startRow -
searchForward -

getAllEvents

public java.util.List getAllEvents()
Returns a copied list of all the event in the model.


getFilteredEvents

public java.util.List getFilteredEvents()
Returns a copied list containing the events in the model with filter applied


size

public int size()
Returns the total number of events currently in the model (all, not just filtered)

Returns:
size

getRow

public LoggingEvent getRow(int row)
Returns the vector representing the row.


getLastAdded

public int getLastAdded()
Return the last added row.


isAddRow

public boolean isAddRow(LoggingEvent e,
                        boolean valueIsAdjusting)
Adds a row to the model.

Parameters:
e - event
valueIsAdjusting -
Returns:
flag representing whether or not the row is being displayed (not filtered)

fireTableEvent

public void fireTableEvent(int begin,
                           int end,
                           int count)
Fire appropriate table update events for the range.


notifyCountListeners

public void notifyCountListeners()
Allow a forced notification of the EventCountListeners


setDisplayRule

public void setDisplayRule(Rule displayRule)
Sets the DisplayFilter in operation

Parameters:
displayRule -

getRowIndex

public int getRowIndex(LoggingEvent e)
Returns the index of the LoggingEvent

Parameters:
e -

Log4j 1.3alpha-4

Copyright 2000-2003 Apache Software Foundation.