Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

alma::acs::logging::table::LogEntryTableModelBase Class Reference

Inheritance diagram for alma::acs::logging::table::LogEntryTableModelBase:

Inheritance graph
[legend]
Collaboration diagram for alma::acs::logging::table::LogEntryTableModelBase:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 LogEntryTableModelBase () throws Exception
Override final int getColumnCount ()
Override int getRowCount ()
Override synchronized Object getValueAt (int row, int column)
synchronized ILogEntry getVisibleLogEntry (int row)
synchronized void clearAll ()
long totalLogNumber ()
Calendar getTimeFrame ()
synchronized Integer getLogKey (int index)
synchronized int findKeyPos (Integer key)
final String getColumnName (int columnIndex)
final Class<?> getColumnClass (int column)
synchronized void appendLog (ILogEntry log)
synchronized void replaceLog (int pos, ILogEntry newEntry)
void close (boolean sync)

Protected Attributes

LogCache allLogs = null
RowEntries rows = new RowEntries(10000)
Vector< Integer > rowsToAdd = new Vector<Integer>()
TableUpdater tableUpdater

Private Member Functions

void flushLogs ()

Private Attributes

boolean closed = false

Detailed Description

The table model with basic functionalities.

This model can be reused by log tables with reduced functionalities like the error browsers.

Author:
acaproni


Constructor & Destructor Documentation

alma::acs::logging::table::LogEntryTableModelBase::LogEntryTableModelBase  )  throws Exception [inline]
 

Constructor


Member Function Documentation

synchronized void alma::acs::logging::table::LogEntryTableModelBase::appendLog ILogEntry  log  )  [inline]
 

Adds the log to the table.

To avoid updating the table very frequently, the logs to add are immediately inserted in the LogCache but their insertion in the table is delayed and done by the TableUpdater thread.
For this reason each log is inserted in the temporary vector rowsToAdd that will be flushed into rows by the thread.

Parameters:
log The log to add

synchronized void alma::acs::logging::table::LogEntryTableModelBase::clearAll  )  [inline]
 

Remove all the logs

void alma::acs::logging::table::LogEntryTableModelBase::close boolean  sync  )  [inline]
 

Closes all the threads and frees the resources This is the last method to call before closing the application

Parameters:
sync If it is true wait the termination of the threads before returning

Reimplemented in alma::acs::logging::table::LogTableDataModel.

synchronized int alma::acs::logging::table::LogEntryTableModelBase::findKeyPos Integer  key  )  [inline]
 

Return the position of the key in the vector.

There are cases when the key is not anymore in the vector and in such situations this method return null.
For example it could happen if the log has been deleted by the LogDeleter.

Parameters:
key The key whose position in the vector has to be found
Returns:
The position of the key in the vector of logs or -1 if the key is not in the vector

void alma::acs::logging::table::LogEntryTableModelBase::flushLogs  )  [inline, private]
 

Flush the logs from the temporary vector into the table.

New logs are appended in the temporary vector rowsToAdd to limit the frequency of updating the table model. This method flushes the logs from the temporary vector into the model vector (rows).

final Class<?> alma::acs::logging::table::LogEntryTableModelBase::getColumnClass int  column  )  [inline]
 

Returns default class for column. Creation date: (12/1/2001 14:18:53)

Returns:
java.lang.Class
Parameters:
column int

Override final int alma::acs::logging::table::LogEntryTableModelBase::getColumnCount  )  [inline]
 

Return number of columns in table

final String alma::acs::logging::table::LogEntryTableModelBase::getColumnName int  columnIndex  )  [inline]
 

Returns name of the column based LogEntryXML fields. If the specified index does not return a valid column, blank string is returned. Creation date: (11/11/2001 13:50:16)

Returns:
java.lang.String
Parameters:
columnIndex int

synchronized Integer alma::acs::logging::table::LogEntryTableModelBase::getLogKey int  index  )  [inline]
 

Return the key of the log in the given position of the vector of keys.

There are several cases that forbids to retrieve the key in the given position, in such a situations the method return null. One typical situation is when the entry has been deleted by the LogDeleter.

Parameters:
index The position in the model of the key
Returns:
The key in the passed position or null if it is not possible to return the key
See also:
findKeyPos(Integer key)

Override int alma::acs::logging::table::LogEntryTableModelBase::getRowCount  )  [inline]
 

See also:
javax.swing.table.TableModel#getRowCount()

Calendar alma::acs::logging::table::LogEntryTableModelBase::getTimeFrame  )  [inline]
 

Returns:
The time frame of the log in cache
See also:
com.cosylab.logging.client.cache.LogCache

Override synchronized Object alma::acs::logging::table::LogEntryTableModelBase::getValueAt int  row,
int  column
[inline]
 

Returns an item according to the row and the column of its position.

Returns:
java.lang.Object
Parameters:
row int
column int

synchronized ILogEntry alma::acs::logging::table::LogEntryTableModelBase::getVisibleLogEntry int  row  )  [inline]
 

Return the log shown in the passed row.

Parameters:
row The row of the table containing the log
Returns:
The log in the passed row

synchronized void alma::acs::logging::table::LogEntryTableModelBase::replaceLog int  pos,
ILogEntry  newEntry
[inline]
 

Replace a log entry with another

Parameters:
pos The position in the cache of the log to replace
newEntry The new LogEntryXML

long alma::acs::logging::table::LogEntryTableModelBase::totalLogNumber  )  [inline]
 

Returns:
The number of logs in cache


Member Data Documentation

LogCache alma::acs::logging::table::LogEntryTableModelBase::allLogs = null [protected]
 

The cache of all the logs received.

boolean alma::acs::logging::table::LogEntryTableModelBase::closed = false [private]
 

true if the model has been closed

RowEntries alma::acs::logging::table::LogEntryTableModelBase::rows = new RowEntries(10000) [protected]
 

Each row shows a log identified by a key returned by the cache.

This vector stores the key of each log shown in the table.

Vector<Integer> alma::acs::logging::table::LogEntryTableModelBase::rowsToAdd = new Vector<Integer>() [protected]
 

The vector of logs to add in the rows.

Newly arrived logs are added to this vector and flushed into rows by the TableUpdater thread.

TableUpdater alma::acs::logging::table::LogEntryTableModelBase::tableUpdater [protected]
 

The thread to refresh the content of the table


The documentation for this class was generated from the following file:
Generated on Thu Apr 30 02:53:58 2009 for ACS Java API by doxygen 1.3.8