de.intarsys.tools.logging
Class MemoryLogHandler

java.lang.Object
  extended by java.util.logging.Handler
      extended by de.intarsys.tools.logging.MemoryLogHandler
All Implemented Interfaces:
INotificationSupport

public class MemoryLogHandler
extends java.util.logging.Handler
implements INotificationSupport


Constructor Summary
MemoryLogHandler()
           
MemoryLogHandler(java.lang.String id, int size)
           
 
Method Summary
 void addNotificationListener(EventType type, INotificationListener listener)
          Add listener to the collection of objects to be informed when the receiver triggers an event of type name.
 void clear()
           
 void close()
           
 void flush()
           
 java.lang.String getId()
           
 java.util.logging.LogRecord[] getLogRecords()
           
 int getSize()
           
 java.lang.String getString()
           
 void publish(java.util.logging.LogRecord record)
           
 void removeNotificationListener(EventType type, INotificationListener listener)
          Remove listener from the collection of objects to be informed about events of type name.
 void setId(java.lang.String id)
           
 void setSize(int size)
           
protected  void triggerChanged(java.lang.Object attribute, java.lang.Object oldValue, java.lang.Object newValue)
           
protected  void triggerEvent(Event event)
           
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, reportError, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryLogHandler

public MemoryLogHandler()

MemoryLogHandler

public MemoryLogHandler(java.lang.String id,
                        int size)
Method Detail

addNotificationListener

public void addNotificationListener(EventType type,
                                    INotificationListener listener)
Description copied from interface: INotificationSupport
Add listener to the collection of objects to be informed when the receiver triggers an event of type name.

Specified by:
addNotificationListener in interface INotificationSupport
Parameters:
type - The event type we are interested in.
listener - The object to be informed about an event occurrence

clear

public void clear()

close

public void close()
           throws java.lang.SecurityException
Specified by:
close in class java.util.logging.Handler
Throws:
java.lang.SecurityException

flush

public void flush()
Specified by:
flush in class java.util.logging.Handler

getId

public java.lang.String getId()

getLogRecords

public java.util.logging.LogRecord[] getLogRecords()

getSize

public int getSize()

getString

public java.lang.String getString()

publish

public void publish(java.util.logging.LogRecord record)
Specified by:
publish in class java.util.logging.Handler

removeNotificationListener

public void removeNotificationListener(EventType type,
                                       INotificationListener listener)
Description copied from interface: INotificationSupport
Remove listener from the collection of objects to be informed about events of type name.

Specified by:
removeNotificationListener in interface INotificationSupport
Parameters:
type - The event type we are no longer interested in.
listener - The object registered for the event till now.

setId

public void setId(java.lang.String id)

setSize

public void setSize(int size)

triggerChanged

protected void triggerChanged(java.lang.Object attribute,
                              java.lang.Object oldValue,
                              java.lang.Object newValue)

triggerEvent

protected void triggerEvent(Event event)