Package de.intarsys.tools.logging
Class MemoryLogHandler
- java.lang.Object
-
- java.util.logging.Handler
-
- de.intarsys.tools.logging.MemoryLogHandler
-
- All Implemented Interfaces:
INotificationSupport
public class MemoryLogHandler extends java.util.logging.Handler implements INotificationSupport
-
-
Constructor Summary
Constructors Constructor Description MemoryLogHandler()MemoryLogHandler(java.lang.String id, int size)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddNotificationListener(EventType type, INotificationListener listener)Addlistenerto the collection of objects to be informed when the receiver triggers an event of typename.voidclear()voidclose()voidflush()java.lang.StringgetId()java.util.logging.LogRecord[]getLogRecords()intgetSize()java.lang.StringgetString()voidpublish(java.util.logging.LogRecord record)voidremoveNotificationListener(EventType type, INotificationListener listener)Removelistenerfrom the collection of objects to be informed about events of typename.voidsetId(java.lang.String id)voidsetSize(int size)protected voidtriggerChanged(java.lang.Object attribute, java.lang.Object oldValue, java.lang.Object newValue)protected voidtriggerEvent(Event event)
-
-
-
Method Detail
-
addNotificationListener
public void addNotificationListener(EventType type, INotificationListener listener)
Description copied from interface:INotificationSupportAddlistenerto the collection of objects to be informed when the receiver triggers an event of typename.- Specified by:
addNotificationListenerin interfaceINotificationSupport- 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:
closein classjava.util.logging.Handler- Throws:
java.lang.SecurityException
-
flush
public void flush()
- Specified by:
flushin classjava.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:
publishin classjava.util.logging.Handler
-
removeNotificationListener
public void removeNotificationListener(EventType type, INotificationListener listener)
Description copied from interface:INotificationSupportRemovelistenerfrom the collection of objects to be informed about events of typename.- Specified by:
removeNotificationListenerin interfaceINotificationSupport- 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)
-
-