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()
Returns the metadata information associated with this emitter.
|
void |
postDeregister()
Callback called just after the MBean has been successfully unregistered.
|
void |
postRegister(java.lang.Boolean registrationDone)
Callback called just after the MBean has been registered (successfully or not).
|
void |
preDeregister()
Callback called just before MBean unregistration from the MBeanServer.
|
javax.management.ObjectName |
preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
Callback called just before MBean registration in the MBeanServer.
|
void |
removeNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
Removes a notification listener from this MBean.
|
void |
sendNotification(javax.management.Notification n)
Sends the given notification to all registered listeners
|
void |
start() |
void |
start(java.lang.String category) |
void |
stop() |
void |
stop(java.lang.String category) |
addNotificationListener, handleNotification, removeNotificationListenerclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddNotificationListenerpublic javax.management.ObjectName preRegister(javax.management.MBeanServer server,
javax.management.ObjectName name)
throws java.lang.Exception
javax.management.MBeanRegistrationpreRegister in interface javax.management.MBeanRegistrationserver - The MBeanServer on which the MBean will be registered.name - The ObjectName of the MBean.ObjectName of the registered MBean, must not be nulljava.lang.Exception - Any possible exception generated by this method will be caught
by the MBeanServer and re-thrown as an MBeanRegistrationException
to the client.public void postRegister(java.lang.Boolean registrationDone)
javax.management.MBeanRegistrationpostRegister in interface javax.management.MBeanRegistrationregistrationDone - True if the registration was successful, false otherwise.public void preDeregister()
throws java.lang.Exception
javax.management.MBeanRegistrationpreDeregister in interface javax.management.MBeanRegistrationjava.lang.Exception - Any possible exception generated by this method will be caught
by the MBeanServer and re-thrown as an MBeanRegistrationException
to the client.public void postDeregister()
javax.management.MBeanRegistrationpostDeregister in interface javax.management.MBeanRegistrationpublic void removeNotificationListener(javax.management.NotificationListener listener,
javax.management.NotificationFilter filter,
java.lang.Object handback)
throws javax.management.ListenerNotFoundException
javax.management.NotificationEmitterremoveNotificationListener in interface javax.management.NotificationEmitterremoveNotificationListener in interface LoggerBroadcasterMBeanremoveNotificationListener in class javax.management.NotificationBroadcasterSupportlistener - The listener that was previously added to this MBean.filter - The filter that was specified when the listener was added.handback - The handback that was specified when the listener was added.javax.management.ListenerNotFoundException - If the triple listener, filter, handback is not registered with the emitterpublic void sendNotification(javax.management.Notification n)
javax.management.NotificationBroadcasterSupportsendNotification in class javax.management.NotificationBroadcasterSupportn - The notification to sendpublic void start()
start in interface LoggerBroadcasterMBeanpublic void start(java.lang.String category)
start in interface LoggerBroadcasterMBeanpublic void stop()
stop in interface LoggerBroadcasterMBeanpublic void stop(java.lang.String category)
stop in interface LoggerBroadcasterMBeanpublic javax.management.MBeanNotificationInfo[] getNotificationInfo()
javax.management.NotificationBroadcastergetNotificationInfo in interface javax.management.NotificationBroadcastergetNotificationInfo in class javax.management.NotificationBroadcasterSupportprotected Logger createLoggerPrototype()