mx4j.log
Class LoggerBroadcaster
java.lang.Object
|
+--javax.management.NotificationBroadcasterSupport
|
+--mx4j.log.LoggerBroadcaster
- All Implemented Interfaces:
- LoggerBroadcasterMBean, MBeanRegistration, NotificationBroadcaster
- public class LoggerBroadcaster
- extends NotificationBroadcasterSupport
- implements 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.5 $
- Author:
- Simone Bordet
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LoggerBroadcaster
public LoggerBroadcaster()
preRegister
public ObjectName preRegister(MBeanServer server,
ObjectName name)
throws java.lang.Exception
- Description copied from interface:
MBeanRegistration
- Allows the MBean to perform any operations before being registered
to the
MBeanServer
.
Any exception will cause the MBean not being registered.
- Specified by:
preRegister
in interface MBeanRegistration
- Following copied from interface:
javax.management.MBeanRegistration
- Parameters:
server
- The MBeanServer on which the MBean will be registered.name
- The ObjectName
of the MBean.- Returns:
- ObjectName The name of the registered MBean
- Throws:
java.lang.Exception
- Exception of the operation. Note that this is caught
by the MBeanServer
and re-thrown as an
MBeanRegistrationException
.
postRegister
public void postRegister(java.lang.Boolean registrationDone)
- Description copied from interface:
MBeanRegistration
- Called upon after a registration ( successful or not ).
- Specified by:
postRegister
in interface MBeanRegistration
- Following copied from interface:
javax.management.MBeanRegistration
- Parameters:
registrationDone
- Evaluates to true of the registrations
is successful, false otherwise.
preDeregister
public void preDeregister()
throws java.lang.Exception
- Description copied from interface:
MBeanRegistration
- Called upon before an
MBean
will be de-registered by
the MBeanServer
.
- Specified by:
preDeregister
in interface MBeanRegistration
- Following copied from interface:
javax.management.MBeanRegistration
- Throws:
java.lang.Exception
- Would be caught by the MBeanServer
and rethrown as an MBeanRegistrationException.
postDeregister
public void postDeregister()
- Description copied from interface:
MBeanRegistration
- Called upon after the MBean has been de-registered.
- Specified by:
postDeregister
in interface MBeanRegistration
removeNotificationListener
public void removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
java.lang.Object handback)
throws ListenerNotFoundException
- Specified by:
removeNotificationListener
in interface LoggerBroadcasterMBean
sendNotification
public void sendNotification(Notification n)
- Overrides:
sendNotification
in class NotificationBroadcasterSupport
start
public void start()
- Specified by:
start
in interface LoggerBroadcasterMBean
start
public void start(java.lang.String category)
- Specified by:
start
in interface LoggerBroadcasterMBean
stop
public void stop()
- Specified by:
stop
in interface LoggerBroadcasterMBean
stop
public void stop(java.lang.String category)
- Specified by:
stop
in interface LoggerBroadcasterMBean
getNotificationInfo
public MBeanNotificationInfo[] getNotificationInfo()
- Description copied from interface:
NotificationBroadcaster
- Returns the name of the java class of the notification and the
notification types sent.
- Overrides:
getNotificationInfo
in class NotificationBroadcasterSupport
- Following copied from interface:
javax.management.NotificationBroadcaster
- Returns:
- MBeanNotificationInfo The NotificationInfo
createLoggerPrototype
protected Logger createLoggerPrototype()
Copyright © 2001-2002 MX4J Team. All Rights Reserved.