xmlBlaster 1.6.2 client API

org.xmlBlaster.util.log
Class XbNotifyHandler

java.lang.Object
  extended byjava.util.logging.Handler
      extended byorg.xmlBlaster.util.log.XbNotifyHandler

public class XbNotifyHandler
extends java.util.logging.Handler

Dispatch logging output to registered listeners. As java.util.logging framework supports max. one Filter per Logger/Handler we dispatch it further here.

Note: You may not directly add a Filter to java.util.logging.Logger/Handler as this would destroy our registration.

Author:
Marcel Ruff
See Also:
The admin.logging requirement

Constructor Summary
XbNotifyHandler()
           
XbNotifyHandler(java.lang.String id)
           
 
Method Summary
 void close()
           
 void flush()
           
 I_LogListener[] getAllListeners()
          Get a snapshot of all listeners.
 I_LogListener[] getErrorListeners()
          Get a snapshot of error listeners.
 java.lang.String getId()
           
 I_LogListener[] getWarnListeners()
          Get a snapshot of warn listeners.
static XbNotifyHandler instance()
           
static void main(java.lang.String[] args)
           
 void publish(java.util.logging.LogRecord record)
           
 boolean register(int level, I_LogListener logNotification)
          Register a listener.
 boolean unregister(int level, I_LogListener logNotification)
          Remove the listener.
 
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

XbNotifyHandler

public XbNotifyHandler()

XbNotifyHandler

public XbNotifyHandler(java.lang.String id)
Method Detail

instance

public static XbNotifyHandler instance()

close

public void close()
           throws java.lang.SecurityException
Throws:
java.lang.SecurityException

flush

public void flush()

publish

public void publish(java.util.logging.LogRecord record)

register

public boolean register(int level,
                        I_LogListener logNotification)
Register a listener. This listener may NOT use logging himself to avoid recursion.
If the given level/logNotification combination is already registered, the call leaves everything unchanged and returns false.

Parameters:
level - to add, Level.SEVERE.intValue() | Level.WARNING.intValue() | Level.ALL.intValue()
logNotification - The interface to send the logging
Returns:
true if the given logNotification is added

unregister

public boolean unregister(int level,
                          I_LogListener logNotification)
Remove the listener.

Parameters:
level - Which levels you want to remove. Level.SEVERE.intValue() | Level.WARNING.intValue() | Level.ALL.intValue()
Returns:
true if the set contained the specified element.

getWarnListeners

public I_LogListener[] getWarnListeners()
Get a snapshot of warn listeners.


getId

public java.lang.String getId()
Returns:
Returns the id.

getErrorListeners

public I_LogListener[] getErrorListeners()
Get a snapshot of error listeners.


getAllListeners

public I_LogListener[] getAllListeners()
Get a snapshot of all listeners.


main

public static void main(java.lang.String[] args)

xmlBlaster 1.6.2 client API

Copyright © 1999-2007 The xmlBlaster.org contributers.