|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.management.NotificationBroadcasterSupport
mx4j.log.LoggerBroadcaster
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.
Nested Class Summary | |
static class |
LoggerBroadcaster.LoggerNotifier
|
Constructor Summary | |
LoggerBroadcaster()
|
Method Summary | |
protected Logger |
createLoggerPrototype()
|
MBeanNotificationInfo[] |
getNotificationInfo()
Returns the name of the java class of the notification and the notification types sent. |
void |
postDeregister()
Called upon after the MBean has been de-registered. |
void |
postRegister(java.lang.Boolean registrationDone)
Called upon after a registration ( successful or not ). |
void |
preDeregister()
Called upon before an MBean will be de-registered by
the MBeanServer . |
ObjectName |
preRegister(MBeanServer server,
ObjectName name)
Allows the MBean to perform any operations before being registered to the MBeanServer . |
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
java.lang.Object handback)
|
void |
sendNotification(Notification n)
|
void |
start()
|
void |
start(java.lang.String category)
|
void |
stop()
|
void |
stop(java.lang.String category)
|
Methods inherited from class javax.management.NotificationBroadcasterSupport |
addNotificationListener, removeNotificationListener |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface mx4j.log.LoggerBroadcasterMBean |
addNotificationListener |
Constructor Detail |
public LoggerBroadcaster()
Method Detail |
public ObjectName preRegister(MBeanServer server, ObjectName name) throws java.lang.Exception
MBeanRegistration
MBeanServer
.
Any exception will cause the MBean not being registered.
preRegister
in interface MBeanRegistration
server
- The MBeanServer on which the MBean will be registered.name
- The ObjectName
of the MBean.
java.lang.Exception
- Exception of the operation. Note that this is caught
by the MBeanServer
and re-thrown as an
MBeanRegistrationException
.public void postRegister(java.lang.Boolean registrationDone)
MBeanRegistration
postRegister
in interface MBeanRegistration
registrationDone
- Evaluates to true of the registrations
is successful, false otherwise.public void preDeregister() throws java.lang.Exception
MBeanRegistration
MBean
will be de-registered by
the MBeanServer
.
preDeregister
in interface MBeanRegistration
java.lang.Exception
- Would be caught by the MBeanServer
and rethrown as an MBeanRegistrationException.public void postDeregister()
MBeanRegistration
postDeregister
in interface MBeanRegistration
public void removeNotificationListener(NotificationListener listener, NotificationFilter filter, java.lang.Object handback) throws ListenerNotFoundException
removeNotificationListener
in interface LoggerBroadcasterMBean
ListenerNotFoundException
public void sendNotification(Notification n)
sendNotification
in class 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 MBeanNotificationInfo[] getNotificationInfo()
NotificationBroadcaster
getNotificationInfo
in interface NotificationBroadcaster
getNotificationInfo
in class NotificationBroadcasterSupport
protected Logger createLoggerPrototype()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |