mx4j.log

Class LoggerBroadcaster

Implemented Interfaces:
LoggerBroadcasterMBean, javax.management.MBeanRegistration, javax.management.NotificationEmitter

public class LoggerBroadcaster
extends javax.management.NotificationBroadcasterSupport
implements javax.management.MBeanRegistration, LoggerBroadcasterMBean

This broadcaster MBean allows to redirect MX4J internal logging to registered JMX listeners.

Simply register this MBean in the MBeanServer, register one or more listener (eventually with filters on the notification type), then call (directly or through MBeanServer) one of the start operations. From this moment, MX4J internal logging is redirected to this MBean, and from here to all registered listeners, basing on their filters.

Version:
$Revision: 1.7 $

Nested Class Summary

static class
LoggerBroadcaster.LoggerNotifier

Method Summary

protected Logger
createLoggerPrototype()
javax.management.MBeanNotificationInfo[]
getNotificationInfo()
void
postDeregister()
void
postRegister(Boolean registrationDone)
void
preDeregister()
javax.management.ObjectName
preRegister(javax.management.MBeanServer server, javax.management.ObjectName name)
void
removeNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, Object handback)
void
sendNotification(javax.management.Notification n)
void
start()
void
start(String category)
void
stop()
void
stop(String category)

Methods inherited from class javax.management.NotificationBroadcasterSupport

addNotificationListener, getNotificationInfo, handleNotification, removeNotificationListener, removeNotificationListener, sendNotification

Method Details

createLoggerPrototype

protected Logger createLoggerPrototype()

getNotificationInfo

public javax.management.MBeanNotificationInfo[] getNotificationInfo()
Specified by:
getNotificationInfo in interface javax.management.NotificationBroadcaster
Overrides:
getNotificationInfo in interface javax.management.NotificationBroadcasterSupport

postDeregister

public void postDeregister()
Specified by:
postDeregister in interface javax.management.MBeanRegistration

postRegister

public void postRegister(Boolean registrationDone)
Specified by:
postRegister in interface javax.management.MBeanRegistration

preDeregister

public void preDeregister()
            throws Exception
Specified by:
preDeregister in interface javax.management.MBeanRegistration

preRegister

public javax.management.ObjectName preRegister(javax.management.MBeanServer server,
                                               javax.management.ObjectName name)
            throws Exception
Specified by:
preRegister in interface javax.management.MBeanRegistration

removeNotificationListener

public void removeNotificationListener(javax.management.NotificationListener listener,
                                       javax.management.NotificationFilter filter,
                                       Object handback)
            throws javax.management.ListenerNotFoundException
Specified by:
removeNotificationListener in interface LoggerBroadcasterMBean
removeNotificationListener in interface javax.management.NotificationEmitter
Overrides:
removeNotificationListener in interface javax.management.NotificationBroadcasterSupport

sendNotification

public void sendNotification(javax.management.Notification n)
Overrides:
sendNotification in interface javax.management.NotificationBroadcasterSupport

start

public void start()
Specified by:
start in interface LoggerBroadcasterMBean

start

public void start(String category)
Specified by:
start in interface LoggerBroadcasterMBean

stop

public void stop()
Specified by:
stop in interface LoggerBroadcasterMBean

stop

public void stop(String category)
Specified by:
stop in interface LoggerBroadcasterMBean

Copyright © 2001-2005 The MX4J Contributors. All Rights Reserved.