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 void
addNotificationListener(EventType type, INotificationListener listener)
Addlistener
to the collection of objects to be informed when the receiver triggers an event of typename
.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)
Removelistener
from the collection of objects to be informed about events of typename
.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)
-
-
-
Method Detail
-
addNotificationListener
public void addNotificationListener(EventType type, INotificationListener listener)
Description copied from interface:INotificationSupport
Addlistener
to the collection of objects to be informed when the receiver triggers an event of typename
.- Specified by:
addNotificationListener
in 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:
close
in classjava.util.logging.Handler
- Throws:
java.lang.SecurityException
-
flush
public void flush()
- Specified by:
flush
in 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:
publish
in classjava.util.logging.Handler
-
removeNotificationListener
public void removeNotificationListener(EventType type, INotificationListener listener)
Description copied from interface:INotificationSupport
Removelistener
from the collection of objects to be informed about events of typename
.- Specified by:
removeNotificationListener
in 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)
-
-