public class JMXLogPublisher extends LogPublisher implements JMXLogPublisherMBean, NotificationEmitter
LogPublisher.ConsolePublisher, LogPublisher.FilePublisher| Modifier and Type | Field and Description |
|---|---|
protected String |
categoryName
Category name of the publisher.
|
protected NotificationBroadcasterSupport |
notification
Support for the JMX notification broadcasting.
|
protected long |
sequenceNumber
Sequence number for the published logs.
|
formatter| Constructor and Description |
|---|
JMXLogPublisher()
Initialize publisher with the simplest formatter - just publishing the message.
|
JMXLogPublisher(Formatter formatter)
Initialize the publisher with prespecified formatter.
|
JMXLogPublisher(ObjectName parent,
String categoryName) |
| Modifier and Type | Method and Description |
|---|---|
void |
addNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback) |
void |
close()
From JavaDoc API:
|
void |
flush()
From JavaDoc API:
|
String |
getCategoryName() |
MBeanNotificationInfo[] |
getNotificationInfo() |
void |
publish(LogRecord record)
From JavaDoc API:
|
void |
publish(LogRecord record,
String formattedMsg)
Not used, things are published directly via publish(LogRecord)
|
void |
removeNotificationListener(NotificationListener listener) |
void |
removeNotificationListener(NotificationListener listener,
NotificationFilter filter,
Object handback) |
getFormatter, setFormatterprotected NotificationBroadcasterSupport notification
protected String categoryName
protected long sequenceNumber
public JMXLogPublisher()
public JMXLogPublisher(Formatter formatter)
WARNING: if formatter is null, nothing will be published via JMX!
formatter - public JMXLogPublisher(ObjectName parent, String categoryName) throws MalformedObjectNameException
MalformedObjectNameExceptionpublic String getCategoryName()
getCategoryName in interface JMXLogPublisherMBeanpublic void close()
throws SecurityException
ILogPublisherClose the Handler and free all associated resources.
The close method will perform a flush and then close the Handler. After close has been called this Handler should no longer be used. Method calls may either be silently ignored or may throw runtime exceptions.
close in interface ILogPublisherclose in class LogPublisherSecurityException - if a security manager exists and if
the caller does not have LoggingPermission("control").public void flush()
ILogPublisherFlush any buffered output.
flush in interface ILogPublisherflush in class LogPublisherpublic void publish(LogRecord record)
ILogPublisherPublish a LogRecord.
The logging request was made initially to a Logger object, which initialized the LogRecord and forwarded it here.
The Handler is responsible for formatting the message, when and if necessary. The formatting should include localization.
publish in interface ILogPublisherpublish in class LogPublisherrecord - description of the log event. A null record is
silently ignored and is not publishedpublic void publish(LogRecord record, String formattedMsg)
publish in class LogPublisherpublic void removeNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws ListenerNotFoundException
removeNotificationListener in interface NotificationEmitterListenerNotFoundExceptionpublic void addNotificationListener(NotificationListener listener, NotificationFilter filter, Object handback) throws IllegalArgumentException
addNotificationListener in interface NotificationBroadcasterIllegalArgumentExceptionpublic MBeanNotificationInfo[] getNotificationInfo()
getNotificationInfo in interface NotificationBroadcasterpublic void removeNotificationListener(NotificationListener listener) throws ListenerNotFoundException
removeNotificationListener in interface NotificationBroadcasterListenerNotFoundExceptionCopyright © 2012 AMIS research group, Faculty of Mathematics and Physics, Charles University in Prague, Czech Republic. All Rights Reserved.