mx4j.log
public class LoggerBroadcaster extends javax.management.NotificationBroadcasterSupport implements javax.management.MBeanRegistration, LoggerBroadcasterMBean
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.
Modifier and Type | Class and Description |
---|---|
static class |
LoggerBroadcaster.LoggerNotifier |
Constructor and Description |
---|
LoggerBroadcaster() |
Modifier and Type | Method and Description |
---|---|
protected Logger |
createLoggerPrototype() |
javax.management.MBeanNotificationInfo[] |
getNotificationInfo() |
void |
postDeregister() |
void |
postRegister(java.lang.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,
java.lang.Object handback) |
void |
sendNotification(javax.management.Notification n) |
void |
start() |
void |
start(java.lang.String category) |
void |
stop() |
void |
stop(java.lang.String category) |
addNotificationListener, handleNotification, removeNotificationListener
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
addNotificationListener
public javax.management.ObjectName preRegister(javax.management.MBeanServer server, javax.management.ObjectName name) throws java.lang.Exception
preRegister
in interface javax.management.MBeanRegistration
java.lang.Exception
public void postRegister(java.lang.Boolean registrationDone)
postRegister
in interface javax.management.MBeanRegistration
public void preDeregister() throws java.lang.Exception
preDeregister
in interface javax.management.MBeanRegistration
java.lang.Exception
public void postDeregister()
postDeregister
in interface javax.management.MBeanRegistration
public void removeNotificationListener(javax.management.NotificationListener listener, javax.management.NotificationFilter filter, java.lang.Object handback) throws javax.management.ListenerNotFoundException
removeNotificationListener
in interface javax.management.NotificationEmitter
removeNotificationListener
in interface LoggerBroadcasterMBean
removeNotificationListener
in class javax.management.NotificationBroadcasterSupport
javax.management.ListenerNotFoundException
public void sendNotification(javax.management.Notification n)
sendNotification
in class javax.management.NotificationBroadcasterSupport
public void start()
start
in interface LoggerBroadcasterMBean
public void start(java.lang.String category)
start
in interface LoggerBroadcasterMBean
public void stop()
stop
in interface LoggerBroadcasterMBean
public void stop(java.lang.String category)
stop
in interface LoggerBroadcasterMBean
public javax.management.MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo
in interface javax.management.NotificationBroadcaster
getNotificationInfo
in class javax.management.NotificationBroadcasterSupport
protected Logger createLoggerPrototype()