intarsys runtime library

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 Handler
implements INotificationSupport

A Handler that keeps its LogRecords in memory.


Constructor Summary
MemoryLogHandler(String id)
           
MemoryLogHandler(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()
           
 String getId()
           
 LogRecord[] getLogRecords()
           
 int getSize()
           
 String getString()
           
 void publish(LogRecord record)
           
 void push(Handler target)
           
 void removeNotificationListener(EventType type, INotificationListener listener)
          Remove listener from the collection of objects to be informed about events of type name.
 
Methods inherited from class java.util.logging.Handler
getEncoding, getErrorManager, getFilter, getFormatter, getLevel, isLoggable, setEncoding, setErrorManager, setFilter, setFormatter, setLevel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryLogHandler

public MemoryLogHandler(String id)

MemoryLogHandler

public MemoryLogHandler(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 SecurityException
Specified by:
close in class Handler
Throws:
SecurityException

flush

public void flush()
Specified by:
flush in class Handler

getId

public String getId()

getLogRecords

public LogRecord[] getLogRecords()

getSize

public int getSize()

getString

public String getString()

publish

public void publish(LogRecord record)
Specified by:
publish in class Handler

push

public void push(Handler target)

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.

intarsys runtime library

Copyright © 2012 intarsys consulting GmbH. All Rights Reserved.