org.kuali.student.common.ui.client.logging
Class LogBuffer

java.lang.Object
  extended by org.kuali.student.common.ui.client.logging.LogBuffer
All Implemented Interfaces:
Serializable

public class LogBuffer
extends Object
implements Serializable

Stores log messages, can be sent to log service.

See Also:
Serialized Form

Field Summary
(package private)  List<LogMessage> buffer
           
(package private)  int maxSize
           
private static long serialVersionUID
           
 
Constructor Summary
LogBuffer()
          Creates an empty LogBuffer with a size limit of Integer.MAX_VALUE
LogBuffer(int maxSize)
          Creates an empty LogBuffer with the specified size limit.
 
Method Summary
 void add(LogMessage message)
          Adds a message to the buffer
private  void checkLimit()
          Removes excess messages, oldest first.
 List<LogMessage> getLogMessages()
          Returns the underlying log buffer.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

serialVersionUID

private static final long serialVersionUID
See Also:
Constant Field Values

maxSize

int maxSize

buffer

List<LogMessage> buffer
Constructor Detail

LogBuffer

public LogBuffer()
Creates an empty LogBuffer with a size limit of Integer.MAX_VALUE


LogBuffer

public LogBuffer(int maxSize)
Creates an empty LogBuffer with the specified size limit. When size limit is reached, older messages are removed as newer ones are added.

Parameters:
maxSize -
Method Detail

add

public void add(LogMessage message)
Adds a message to the buffer

Parameters:
message -

getLogMessages

public List<LogMessage> getLogMessages()
Returns the underlying log buffer.

Returns:
the underlying log buffer as List

checkLimit

private void checkLimit()
Removes excess messages, oldest first.



Copyright © 2004-2011 The Kuali Foundation. All Rights Reserved.